vendor: 4,259 bytes, line 1
1import{j as e,x as s,e as a,P as t,d as n,H as i,I as r,f as l,a as o,c,J as d}from"./ui-vendor-DKm8cimc.js";import{r as m,j as u}from"./react-vendor-BmPVsWQ-.js";import{e as x,u as g,c as p,g as h,H as j}from"./index-D1M3HNit.js";import{A as f}from"./AdminSidebarSimple-BpGLM1ht.js";import{C as b,a as v,b as N,c as w,d as y}from"./card-Iv5-hK5w.js";import{B as S}from"./badge-BjSIrjf_.js";import{a as k}from"./utils-vendor-BbncCth-.js";import{b as D}from"./imagePathUtils-DqywJy2k.js";import{S as R,ac as C,s as E,G as T,ad as A,t as L,ae as U,R as F,Q as I}from"./lucide-vendor-CeMWj2yY.js";import{isAdminAuthenticatedFromStorage as _,checkAdminAuth as P}from"./authUtils-KflHSdRs.js";const V=k("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),M=m.forwardRef(({className:s,variant:a,...t},n)=>e.jsx("div",{ref:n,role:"alert",className:x(V({variant:a}),s),...t}));M.displayName="Alert";m.forwardRef(({className:s,...a},t)=>e.jsx("h5",{ref:t,className:x("mb-1 font-medium leading-none tracking-tight",s),...a})).displayName="AlertTitle";const $=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:x("text-sm [&_p]:leading-relaxed",s),...a}));$.displayName="AlertDescription";var H="Tabs",[K]=c(H,[d]),O=d(),[q,z]=K(H),G=m.forwardRef((i,r)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:u,activationMode:x="automatic",...g}=i,p=s(u),[h,j]=a({prop:o,onChange:c,defaultProp:d??"",caller:H});return e.jsx(q,{scope:l,baseId:n(),value:h,onValueChange:j,orientation:m,dir:p,activationMode:x,children:e.jsx(t.div,{dir:p,"data-orientation":m,...g,ref:r})})});G.displayName=H;var B="TabsList",J=m.forwardRef((s,a)=>{const{__scopeTabs:n,loop:r=!0,...l}=s,o=z(B,n),c=O(n);return e.jsx(i,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:r,children:e.jsx(t.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:a})})});J.displayName=B;var Q="TabsTrigger",W=m.forwardRef((s,a)=>{const{__scopeTabs:n,value:i,disabled:o=!1,...c}=s,d=z(Q,n),m=O(n),u=Z(d.baseId,i),x=ee(d.baseId,i),g=i===d.value;return e.jsx(r,{asChild:!0,...m,focusable:!o,active:g,children:e.jsx(t.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":x,"data-state":g?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...c,ref:a,onMouseDown:l(s.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(i)}),onKeyDown:l(s.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(i)}),onFocus:l(s.onFocus,()=>{const e="manual"!==d.activationMode;g||o||!e||d.onValueChange(i)})})})});W.displayName=Q;var X="TabsContent",Y=m.forwardRef((s,a)=>{const{__scopeTabs:n,value:i,forceMount:r,children:l,...c}=s,d=z(X,n),u=Z(d.baseId,i),x=ee(d.baseId,i),g=i===d.value,p=m.useRef(g);return m.useEffect(()=>{const e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),e.jsx(o,{present:r||g,children:({present:n})=>e.jsx(t.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:x,tabIndex:0,...c,ref:a,style:{...s.style,animationDuration:p.current?"0s":void 0},children:n&&l})})});function Z(e,s){return`${e}-trigger-${s}`}function ee(e,s){return`${e}-content-${s}`}Y.displayName=X;var se=J,ae=W,te=Y;const ne=G,ie=m.forwardRef(({className:s,...a},t)=>e.jsx(se,{ref:t,className:x("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ie.displayName=se.displayName;const re=m.forwardRef(({className:s,...a},t)=>e.jsx(ae,{ref:t,className:x("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...a}
1));re.displayName=ae.displayName;const le=m.forwardRef(({className:s,...a},t)=>e.jsx(te,{ref:t,className:x("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));function oe(){const{t:s}=g("blog"),[a,t]=m.useState(!1),[n,i]=m.useState(""),[r,l]=m.useState(null),[o,c]=m.useState([{name:s("seo.manager.operations.sitemap.name"),icon:e.jsx(R,{className:"h-4 w-4"}),description:s("seo.manager.operations.sitemap.description"),action:D.generateSitemap,loading:!1,result:null},{name:s("seo.manager.operations.aiDiscovery.name"),icon:e.jsx(C,{className:"h-4 w-4"}),description:s("seo.manager.operations.aiDiscovery.description"),action:D.generateLLMsFile,loading:!1,result:null},{name:s("seo.manager.operations.robotsTxt.name"),icon:e.jsx(E,{className:"h-4 w-4"}),description:s("seo.manager.operations.robotsTxt.description"),action:D.updateRobotsFile,loading:!1,result:null},{name:s("seo.manager.operations.searchEnginePing.name"),icon:e.jsx(T,{className:"h-4 w-4"}),description:s("seo.manager.operations.searchEnginePing.description"),action:D.pingSearchEngines,loading:!1,result:null}]),d=(a,t)=>t?e.jsx(S,{variant:"secondary",children:s("seo.manager.status.running")}):a?a.success?e.jsx(S,{variant:"default",className:"bg-green-500",children:s("seo.manager.status.success")}):e.jsx(S,{variant:"destructive",children:s("seo.manager.status.failed")}):e.jsx(S,{variant:"outline",children:s("seo.manager.status.notRun")});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:s("seo.manager.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("seo.manager.description")})]}),e.jsxs(p,{onClick:async()=>{t(!0),l(null);try{const e=await D.updateSEOFiles();l(e),i((new Date).toLocaleString()),e.details&&c(s=>s.map(s=>{let a=null;switch(s.name){case"Sitemap Generation":a=e.details.sitemap;break;case"AI Discovery File":a=e.details.llms;break;case"Robots.txt Update":a=e.details.robots;break;case"Search Engine Ping":a=e.details.searchEngines}return{...s,result:a,loading:!1}}))}catch(e){l({success:!1,message:`SEO update failed: ${e instanceof Error?e.message:"Unknown error"}`,timestamp:(new Date).toISOString()})}finally{t(!1)}},disabled:a,className:"bg-blue-600 hover:bg-blue-700",children:[e.jsx(A,{className:"h-4 w-4 me-2"}),s(a?"seo.manager.button.updating":"seo.manager.button.updateAll")]})]}),r&&e.jsxs(M,{className:r.success?"border-green-200 bg-green-50":"border-red-200 bg-red-50",children:[r.success?e.jsx(L,{className:"h-4 w-4 text-green-600"}):e.jsx(U,{className:"h-4 w-4 text-red-600"}),e.jsxs($,{className:r.success?"text-green-800":"text-red-800",children:[r.message,r.timestamp&&e.jsx("span",{className:"block text-sm mt-1 opacity-70",children:new Date(r.timestamp).toLocaleString()})]})]}),e.jsxs(ne,{defaultValue:"operations",className:"w-full",children:[e.jsxs(ie,{className:"grid w-full grid-cols-2",children:[e.jsx(re,{value:"operations",children:s("seo.manager.tabs.operations")}),e.jsx(re,{value:"automation",children:s("seo.manager.tabs.automation")})]}),e.jsx(le,{value:"operations",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:o.map((t,n)=>{return e.jsxs(b,{className:"relative",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[t.icon,e.jsx(N,{className:"text-lg",children:t.name})]}),(i=t.result,r=t.loading,r?e.jsx(I,{className:"h-4 w-4 animate-spin text-blue-500"}):i?i.success?e.jsx(L,{className:"h-4 w-4 text-green-500"}):e.jsx(U,{className:"h-4 w-4 text-red-500"}):e.jsx(I,{className:"h-4 w-4 text-gray-400"}))]}),e.jsx(w,{children:t.description})]}),e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[d(t.result,t.loading),t.result&&e.jsx("p",{className:"text-sm "+(t.result.success?"text-green-600":"text-red-600"),children:t.result.message})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>(async e=>{c(s=>s.map((s,a)=>a===e?{...s,loading:!0,result:null}:s));try{const s=o[e],a=await s.action();c(s=>s.map((s,t)=>t===e?{...s,loading:!1,result:a}:s))}catch(s){c(a=>a.map((a,t)=>t===e?{...a,loading:!1,result:{success:!1,message:`Failed: ${s instanceof Error?s.message:"Unknown error"}`}}:a))}})(n),disabled:t.loading||a,children:[e.jsx(F,{className:"h-3 w-3 me-1 "+(t.loading?"animate-spin":"")}),s("seo.manager.button.run")]})]})})]},t.name);var i,r})})}),e.jsx(le,{value:"automation",className:"space-y-4",children:e.jsxs(b,{children:[e.jsxs(v,{children:[e.jsxs(N,{className:"flex items-center space-x-2",children:[e.jsx(A,{className:"h-5 w-5 text-blue-500"}),e.jsx("span",{children:s("seo.manager.automation.title")})]}),e.jsx(w,{children:s("seo.manager.automation.description")})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center space-x-3 p-3 bg-green-50 rounded-lg border border-green-200",children:[e.jsx(L,{className:"h-5 w-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800",children:s("seo.manager.automation.items.postCreation.title")}),e.jsx("p",{className:"text-sm text-green-600",children:s("seo.manager.automation.items.postCreation.subtitle")})]})]}),e.jsxs("div",{className:"flex items-center space-x-3 p-3 bg-green-50 rounded-lg border border-green-200",children:[e.jsx(L,{className:"h-5 w-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800",children:s("seo.manager.automation.items.postUpdate.title")}),e.jsx("p",{className:"text-sm text-green-600",children:s("seo.manager.automation.items.postUpdate.subtitle")})]})]}),e.jsxs("div",{className:"flex items-center space-x-3 p-3 bg-green-50 rounded-lg border border-green-200",children:[e.jsx(L,{className:"h-5 w-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800",children:s("seo.manager.automation.items.postDeletion.title")}),e.jsx("p",{className:"text-sm text-green-600",children:s("seo.manager.automation.items.postDeletion.subtitle")})]})]}),e.jsxs("div",{className:"flex items-center space-x-3 p-3 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx(I,{className:"h-5 w-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-blue-800",children:s("seo.manager.automation.items.scheduledUpdates.title")}),e.jsx("p",{className:"text-sm text-blue-600",children:s("seo.manager.automation.items.scheduledUpdates.subtitle")})]})]})]}),e.jsxs("div",{className:"mt-6 p-4 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"font-medium mb-2",children:s("seo.manager.automation.updatesHeading")}),e.jsxs("ul",{className:"text-sm text-gray-600 space-y-1",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:s("seo.manager.automation.updatesList.sitemap")})]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:s("seo.manager.automation.updatesList.llmsTxt")})]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:s("seo.manager.automation.updatesList.robotsTxt")})]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:s("seo.manager.automation.updatesList.searchEnginePing")})]})]})]}),n&&e.jsx("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg border border-blue-200",children:e.jsxs("p",{className:"text-sm text-blue-800",children:[e.jsx("strong",{children:s("seo.manager.automation.lastUpdate")})," ",n]})})]})]})})]})]})}le.displayName=te.displayName;const ce=()=>{const[s,a]=m.useState(!1),[t,n]=m.useState(!0),i=u(),{toast:r}=h();return m.useEffect(()=>{(async()=>{try{if(_())return a(!0),void n(!1);if(!(await P()))throw new Error("Not authenticated");a(!0)}catch(e){r({title:"Authentication required",description:"Please log in to access this page",variant:"destructive"}),i("/blogin")}finally{n(!1)}})()},[i,r]),t?e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(j,{}),e.jsx("main",{className:"flex-grow pt-[84px]",children:e.jsx("div",{className:"container mx-auto px-4 py-16",children:e.jsx("p",{className:"text-center",children:"Loading..."})})})]}):e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(j,{}),e.jsxs("div",{className:"flex flex-1 admin-page-content",children:[e.jsx(f,{}),e.jsx("main",{className:"flex-1 min-w-0 overflow-x-auto bg-gray-50 pt-6",children:e.jsx("div",{className:"p-3 sm:p-6",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsx(oe,{})})})})]})]})};export{ce 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.