1import{bZ as B,j as e,B as o,P as D,aj as S,D as L,a as R,b as T,c as P,aq as f,f as q,ai as x,s as k,dw as J,dx as W,dy as X,L as F,bO as ee,aS as se,A as ae,aT as te}from"./index-B0RymvlI.js";import{r as h}from"./charts-DAQo80Uz.js";import{T as re,a as ie,b as C,c as E}from"./tabs-C-HyifYX.js";import{L as c}from"./label-By9C5--J.js";import{S as A}from"./switch-BOnDn1C9.js";import{T as O}from"./textarea-iG6Dkz8s.js";import{S as le,a as ne,b as ce,c as de,d as I}from"./select-BqpjCFNc.js";import{u as oe}from"./useCategories-oMTOOfXr.js";import{S as Y}from"./SeoScorePanel-YXKrbdce.js";import{T as K}from"./trash-2-DgeFiAab.js";import{a as me}from"./useCmsPages-jr9k6eL1.js";import{E as ue}from"./external-link-9u1PhXpE.js";import"./pdf-DlF9gChH.js";import"./chevron-up-DlnIpn04.js";import"./seoScore-DR2UUnij.js";import"./circle-x-BP4O5RpS.js";import"./circle-check-C-TC2HUU.js";const z="__none__",M=r=>r.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),U={id:"",name:"",slug:"",description:"",parent_id:"",sort_order:0,is_active:!0,seo_h2:"",seo_text:"",image_url:"",focus_keyword:""},xe=()=>{const{data:r=[],isLoading:l}=oe(),u=B(),[N,g]=h.useState(!1),[p,j]=h.useState(!1),[t,d]=h.useState(U),a=()=>d(U),m=()=>{a(),g(!0)},y=s=>{d({id:s.id,name:s.name,slug:s.slug,description:s.description,parent_id:s.parent_id??"",sort_order:s.sort_order,is_active:s.is_active,seo_h2:s.seo_h2??"",seo_text:s.seo_text??"",image_url:s.image_url??"",focus_keyword:s.focus_keyword??""}),g(!0)},i=async()=>{if(!t.name.trim())return x.error("Namn krävs");j(!0);const s={name:t.name.trim(),slug:t.slug.trim()||M(t.name),description:t.description,parent_id:t.parent_id||null,sort_order:t.sort_order,is_active:t.is_active,seo_h2:t.seo_h2||null,seo_text:t.seo_text||null,image_url:t.image_url||null,focus_keyword:t.focus_keyword.trim()||null},_=t.id?k.from("categories").update(s).eq("id",t.id):k.from("categories").insert(s),{error:w}=await _;if(j(!1),w)return x.error(w.message);x.success(t.id?"Uppdaterad":"Skapad"),g(!1),a(),u.invalidateQueries({queryKey:["categories"]})},b=async s=>{if(!confirm(`Ta bort kategorin "${s.name}"?`))return;const{error:_}=await k.from("categories").delete().eq("id",s.id);if(_)return x.error(_.message);x.success("Borttagen"),u.invalidateQueries({queryKey:["categories"]})},n=r.filter(s=>!s.parent_id),v=s=>r.filter(_=>_.parent_id===s);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Kategorier visas pÃ¥ ",e.jsx("code",{children:"/kategori/<slug>"}),". Du kan välja en förälderkategori för att skapa underkategorier."]}),e.jsxs(o,{onClick:m,className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"})," Ny kategori"]})]}),l?e.jsxs("div",{className:"mt-6 flex items-center gap-2 text-muted-foreground",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Laddarâ¦"]}):e.jsx("ul",{className:"mt-6 space-y-2",children:n.map(s=>e.jsxs("li",{className:"rounded-md border border-border bg-card",children:[e.jsx(Q,{c:s,onEdit:y,onRemove:b}),v(s.id).length>0&&e.jsx("ul",{className:"border-t border-border bg-secondary/20",children:v(s.id).map(_=>e.jsx("li",{className:"border-t border-border first:border-t-0 pl-6",children:e.jsx(Q,{c:_,onEdit:y,onRemove:b})},_.id))})]},s.id))}),e.jsx(L,{open:N,onOpenChange:g,children:e.jsxs(R,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(T,{children:e.jsx(P,{children:t.id?"Redigera kategori":"Ny kategori"})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_22rem]",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Namn"}),e.jsx(f,{value:t.name,onChange:s=>d({...t,name:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Slug (URL)"}),e.jsx(f,{value:t.slug,placeholder:M(t.name),onChange:s=>d({...t,slug:s.target.value})})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(c,{children:"Beskrivning"}),e.jsx(O,{rows:2,value:t.description,onChange:s=>d({...t,description:s.target.value})})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(c,{children:"Fokus-nyckelord (för SEO-analys)"}),e.jsx(f,{value:t.focus_keyword,onChange:s=>
1d({...t,focus_keyword:s.target.value}),placeholder:"t.ex. kontinentalsängar"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Förälderkategori"}),e.jsxs(le,{value:t.parent_id||z,onValueChange:s=>d({...t,parent_id:s===z?"":s}),children:[e.jsx(ne,{children:e.jsx(ce,{placeholder:"Ingen (toppnivÃ¥)"})}),e.jsxs(de,{children:[e.jsx(I,{value:z,children:"Ingen (toppnivÃ¥)"}),r.filter(s=>s.id!==t.id).map(s=>e.jsx(I,{value:s.id,children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Sortering"}),e.jsx(f,{type:"number",value:t.sort_order,onChange:s=>d({...t,sort_order:Number(s.target.value)||0})})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(c,{children:"SEO â h2-rubrik (visas under produktlistan)"}),e.jsx(f,{value:t.seo_h2,onChange:s=>d({...t,seo_h2:s.target.value}),placeholder:"Kategorinamnet blir h1, denna h2 visas under"})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(c,{children:"SEO-text"}),e.jsx(O,{rows:5,value:t.seo_text,onChange:s=>d({...t,seo_text:s.target.value})})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[e.jsx(c,{children:"Bild-URL (valfri)"}),e.jsx(f,{value:t.image_url,onChange:s=>d({...t,image_url:s.target.value})})]}),e.jsxs("div",{className:"flex items-center gap-3 sm:col-span-2",children:[e.jsx(A,{checked:t.is_active,onCheckedChange:s=>d({...t,is_active:s})}),e.jsx(c,{children:"Aktiv (visas pÃ¥ sajten)"})]})]}),e.jsx(Y,{type:"category",title:t.name,content:`<h2>${t.seo_h2}</h2>${t.description} 2 3${t.seo_text}`,focusKeyword:t.focus_keyword,slug:t.slug})]}),e.jsxs(q,{children:[e.jsx(o,{variant:"ghost",onClick:()=>g(!1),children:"Avbryt"}),e.jsxs(o,{onClick:i,disabled:p,className:"gap-2",children:[p?e.jsx(S,{className:"h-4 w-4 animate-spin"}):null,"Spara"]})]})]})})]})},Q=({c:r,onEdit:l,onRemove:u})=>e.jsxs("div",{className:"flex items-center justify-between gap-3 p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-medium",children:[r.name," ",!r.is_active&&e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(inaktiv)"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["/kategori/",r.slug]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",onClick:()=>l(r),children:"Redigera"}),e.jsx(o,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>u(r),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})]}),he={meta_title:"",meta_description:"",og_image_url:"",canonical_url:"",seo_h2:"",seo_text:"",no_index:!1},Z=({entityType:r,entityKey:l,label:u,onClose:N})=>{const g=B(),[p,j]=h.useState(!0),[t,d]=h.useState(!1),[a,m]=h.useState(he),[y,i]=h.useState(!1);h.useEffect(()=>{let n=!0;return(async()=>{const{data:v}=await k.from("seo_overrides").select("*").eq("entity_type",r).eq("entity_key",l).maybeSingle();n&&(v&&(m({meta_title:v.meta_title??"",meta_description:v.meta_description??"",og_image_url:v.og_image_url??"",canonical_url:v.canonical_url??"",seo_h2:v.seo_h2??"",seo_text:v.seo_text??"",no_index:!!v.no_index}),i(!0)),j(!1))})(),()=>{n=!1}},[r,l]);const b=async()=>{d(!0);const n={entity_type:r,entity_key:l,meta_title:a.meta_title||null,meta_description:a.meta_description||null,og_image_url:a.og_image_url||null,canonical_url:a.canonical_url||null,seo_h2:a.seo_h2||null,seo_text:a.seo_text||null,no_index:a.no_index},v=y?k.from("seo_overrides").update(n).eq("entity_type",r).eq("entity_key",l):k.from("seo_overrides").insert(n),{error:s}=await v;if(d(!1),s)return x.error(s.message);x.success("SEO sparat"),g.invalidateQueries({queryKey:["seo-override",r,l]}),N()};return e.jsx(L,{open:!0,onOpenChange:n=>!n&&N(),children:e.jsxs(R,{className:"max-w-2xl",children:[e.jsx(T,{children:e.jsxs(P,{children:["SEO-inställningar â ",u]})}),p?e.jsxs("div",{className:"flex items-center gap-2 py-6 text-muted-foreground",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Laddarâ¦"]}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Metatitel (max 60 tecken)"}),e.jsx(f,{maxLength:70,value:a.meta_title,onChange:n=>m({...a,meta_title:n.target.value})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.meta_title.length,"/60"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Metabeskrivning (max 160 tecken)"}),e.jsx(O,{rows:3,maxLength:180,value:a.meta_description,onChange:n=>m({...a,meta_description:n.target.value})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.meta_description.length,"/160"]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"OG-bild URL"}),e.jsx(f,{value:a.og_image_url,onChange:n=>m({...a,og_image_url:n.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Canonical URL"}),e.jsx(f,{value:a.canonical_url,onChange:n=>m({...a,canonical_url:n.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"SEO-text h2 (visas under sidans innehÃ¥ll)"}),e.jsx(f,{value:a.seo_h2,onChange:n=>m({...a,seo_h2:n.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"SEO-text brödtext"}),e.jsx(O,{rows:6,value:a.seo_text,onChange:n=>m({...a,seo_text:n.target.value})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(A,{checked:a.no_index,onCheckedChange:n=>m({...a,no_index:n})}),e.jsx(c,{children:"No-index (dölj frÃ¥n sökmotorer)"})]})]}),e.jsxs(q,{children:[e.jsx(o,{variant:"ghost",onClick:N,children:"Avbryt"}),e.jsxs(o,{onClick:b,disabled:t||p,className:"gap-2",children:[t?e.jsx(S,{className:"h-4 w-4 animate-spin"}):null,"Spara"]})]})]})})},V=r=>r.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),ge=[{path:"/",title:"Startsida"},{path:"/sangar/guide",title:"Sängguide"},{path:"/checkout",title:"Kassa"},{path:"/auth",title:"Logga in / skapa konto"},{path:"/mina-sidor",title:"Mina sidor"}],H={id:"",title:"",slug:"",content:"",is_published:!0,focus_keyword:""},pe=()=>{const{data:r=[],isLoading:l}=me(),u=B(),[N,g]=h.useState(!1),[p,j]=h.useState(null),[t,d]=h.useState(!1),[a,m]=h.useState(H),y=()=>m(H),i=()=>{y(),g(!0)},b=s=>{m({id:s.id,title:s.title,slug:s.slug,content:s.content,is_published:s.is_published,focus_keyword:s.focus_keyword??""}),g(!0)},n=async()=>
3{if(!a.title.trim())return x.error("Titel krävs");d(!0);const s={title:a.title.trim(),slug:a.slug.trim()||V(a.title),content:a.content,is_published:a.is_published,focus_keyword:a.focus_keyword.trim()||null},_=a.id?k.from("cms_pages").update(s).eq("id",a.id):k.from("cms_pages").insert(s),{error:w}=await _;if(d(!1),w)return x.error(w.message);x.success(a.id?"Uppdaterad":"Skapad"),g(!1),y(),u.invalidateQueries({queryKey:["cms-pages"]})},v=async s=>{if(!confirm(`Ta bort sidan "${s.title}"?`))return;const{error:_}=await k.from("cms_pages").delete().eq("id",s.id);if(_)return x.error(_.message);x.success("Borttagen"),u.invalidateQueries({queryKey:["cms-pages"]})};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Skapa egna sidor pÃ¥ ",e.jsx("code",{children:"/sida/<slug>"}),". Befintliga sidor kan fÃ¥ SEO-overlay (titel, beskrivning, SEO-text längst ner)."]}),e.jsxs(o,{onClick:i,className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"})," Ny CMS-sida"]})]}),e.jsx("h3",{className:"mt-8 font-mono-label text-muted-foreground",children:"Egna CMS-sidor"}),l?e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-muted-foreground",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Laddarâ¦"]}):r.length===0?e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Inga sidor ännu."}):e.jsx("ul",{className:"mt-3 space-y-2",children:r.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-card p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-medium",children:[s.title," ",!s.is_published&&e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(utkast)"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["/sida/",s.slug]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",onClick:()=>b(s),children:"Redigera"}),e.jsx(o,{size:"sm",variant:"ghost",onClick:()=>j({type:"cms_page",key:s.id,label:s.title}),children:"SEO"}),e.jsx(o,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>v(s),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})]},s.id))}),e.jsx("h3",{className:"mt-10 font-mono-label text-muted-foreground",children:"Befintliga sidor (SEO-overlay)"}),e.jsx("ul",{className:"mt-3 space-y-2",children:ge.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-card p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium",children:s.title}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.path})]}),e.jsx(o,{size:"sm",variant:"ghost",onClick:()=>j({type:"route",key:s.path,label:s.title}),children:"SEO-inställningar"})]},s.path))}),e.jsx(L,{open:N,onOpenChange:g,children:e.jsxs(R,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(T,{children:e.jsx(P,{children:a.id?"Redigera sida":"Ny CMS-sida"})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_22rem]",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Titel"}),e.jsx(f,{value:a.title,onChange:s=>m({...a,title:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Slug"}),e.jsx(f,{value:a.slug,placeholder:V(a.title),onChange:s=>m({...a,slug:s.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Fokus-nyckelord (för SEO-analys)"}),e.jsx(f,{value:a.focus_keyword,onChange:s=>m({...a,focus_keyword:s.target.value}),placeholder:"t.ex. leveransvillkor"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"InnehÃ¥ll (fritext)"}),e.jsx(O,{rows:14,value:a.content,onChange:s=>m({...a,content:s.target.value}),placeholder:"Skriv din sida här. Radbrytningar bevaras."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(A,{checked:a.is_published,onCheckedChange:s=>m({...a,is_published:s})}),e.jsx(c,{children:"Publicerad"})]})]}),e.jsx(Y,{type:"page",title:a.title,content:a.content,focusKeyword:a.focus_keyword,slug:a.slug})]}),e.jsxs(q,{children:[e.jsx(o,{variant:"ghost",onClick:()=>g(!1),children:"Avbryt"}),e.jsxs(o,{onClick:n,disabled:t,className:"gap-2",children:[t?e.jsx(S,{className:"h-4 w-4 animate-spin"}):null,"Spara"]})]})]})}),p&&e.jsx(Z,{entityType:p.type,entityKey:p.key,label:p.label,onClose:()=>j(null)})]})},$=r=>r.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),je=()=>{const{data:r=[],isLoading:l}=J(),u=W(),N=X(),[g,p]=h.useState(!1),[j,t]=h.useState(""),[d,a]=h.useState(""),m=r.filter(i=>i.page_type==="system"),y=r.filter(i=>i.page_type==="cms");return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Visuella sidor redigeras med drag-och-släpp page builder."}),e.jsxs(o,{onClick:()=>p(!0),className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"})," Ny visuell sida"]})]}),l?e.jsx(S,{className:"h-5 w-5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx("h3",{className:"font-mono-label text-muted-foreground mb-3",children:"Systemsidor"}),e.jsx("ul",{className:"space-y-2",children:m.map(i=>e.jsx(G,{page:i,live:i.slug==="home"?"/":`/sida/${i.slug}`},i.id))})]}),e.jsxs("section",{children:[e.jsx("h3",{className:"font-mono-label text-muted-foreground mb-3",children:"Egna sidor"}),y.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Inga egna visuella sidor ännu."}):e.jsx("ul",{className:"space-y-2",children:y.map(i=>e.jsx(G,{page:i,live:`/sida/${i.slug}`,onDelete:()=>{confirm(`Ta bort "${i.title}"?`)&&(N.mutate(i.id),x.success("Borttagen"))}},i.id))})]})]}),e.jsx(L,{open:g,onOpenChange:p,children:e.jsxs(R,{children:[e.jsx(T,{children:e.jsx(P,{children:"Ny visuell sida"})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{children:[e.jsx(c,{children:"Titel"}),e.jsx(f,{value:j,onChange:i=>t(i.target.value)})]}),e.jsxs("div",{children:[e.jsx(c,{children:"Slug"}),e.jsx(f,{value:d,placeholder:$(j),onChange:i=>a(i.target.value)}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["URL blir ",e.jsxs("code",{children:["/sida/",d||$(j)||"..."]})]})]})]}),e.jsxs(q,{children:[e.jsx(o,{variant:"ghost",onClick:()=>p(!1),children:"Avbryt"}),e.jsx(o,{onClick:async()=>
3{if(!j.trim())return x.error("Titel krävs");const i=d.trim()||$(j);try{await u.mutateAsync({slug:i,title:j.trim()}),x.success("Sida skapad"),p(!1),t(""),a("")}catch(b){x.error(b.message)}},children:"Skapa & öppna i editor"})]})]})})]})},G=({page:r,live:l,onDelete:u})=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-card p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[r.title,r.has_unpublished_changes&&e.jsx("span",{className:"rounded bg-orange-500/15 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-orange-700 dark:text-orange-400",children:"Utkast"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{asChild:!0,size:"sm",variant:"ghost",className:"gap-1",children:e.jsxs(F,{to:l,target:"_blank",children:[e.jsx(ue,{className:"h-3.5 w-3.5"})," Visa"]})}),e.jsx(o,{asChild:!0,size:"sm",className:"gap-1",children:e.jsxs(F,{to:`/admin/sida-redigerare/${r.slug}`,children:[e.jsx(ee,{className:"h-3.5 w-3.5"})," Redigera visuellt"]})}),u&&e.jsx(o,{size:"icon",variant:"ghost",onClick:u,children:e.jsx(K,{className:"h-4 w-4 text-destructive"})})]})]}),Fe=()=>{const[r,l]=h.useState(null);return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(se,{}),e.jsxs("main",{className:"container py-8 md:py-16",children:[e.jsx("p",{className:"font-mono-label text-accent",children:"InnehÃ¥ll"}),e.jsx("h1",{className:"mt-2 font-display text-4xl tracking-tight",children:"InnehÃ¥ll & SEO"}),e.jsx("p",{className:"mt-2 max-w-prose text-sm text-muted-foreground",children:"Hantera kategorier, sidor och SEO-inställningar pÃ¥ samma ställe."}),e.jsxs(re,{defaultValue:"categories",className:"mt-10",children:[e.jsxs(ie,{children:[e.jsx(C,{value:"categories",children:"Kategorier"}),e.jsx(C,{value:"builder",children:"Visuella sidor"}),e.jsx(C,{value:"pages",children:"Sidor"}),e.jsx(C,{value:"products",children:"Produkter"}),e.jsx(C,{value:"seo",children:"Snabb-SEO"})]}),e.jsx(E,{value:"categories",className:"mt-6",children:e.jsx(xe,{})}),e.jsx(E,{value:"builder",className:"mt-6",children:e.jsx(je,{})}),e.jsx(E,{value:"pages",className:"mt-6",children:e.jsx(pe,{})}),e.jsxs(E,{value:"products",className:"mt-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Produkter redigeras i den befintliga produkthanteraren â där kan du ocksÃ¥ sätta SEO per produkt via SEO-knappen."}),e.jsx(o,{asChild:!0,className:"mt-4 gap-2",children:e.jsxs(F,{to:"/admin/produkter",children:["Ãppna produkthantering ",e.jsx(ae,{className:"h-4 w-4"})]})})]}),e.jsxs(E,{value:"seo",className:"mt-6",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sätt SEO för en specifik route, t.ex. ",e.jsx("code",{children:"/checkout"})," eller",e.jsx("code",{children:"/mina-sidor"}),". För kategorier och CMS-sidor används SEO-knappen i respektive flik."]}),e.jsx(fe,{onPick:(u,N)=>l({key:u,label:N})}),r&&e.jsx(Z,{entityType:"route",entityKey:r.key,label:r.label,onClose:()=>l(null)})]})]})]}),e.jsx(te,{})]})},ve=[{path:"/",label:"Startsida"},{path:"/sangar",label:"Sängar (lista)"},{path:"/sangar/guide",label:"Sängguide"},{path:"/checkout",label:"Kassa"},{path:"/auth",label:"Logga in"},{path:"/mina-sidor",label:"Mina sidor"}],fe=({onPick:r})=>e.jsx("ul",{className:"mt-4 space-y-2",children:ve.map(l=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-card p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:l.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l.path})]}),e.jsx(o,{size:"sm",variant:"ghost",onClick:()=>r(l.path,l.label),children:"Redigera SEO"})]},l.path))});export{Fe 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.