1import{r as n,s as l,j as e,B as a,t as y}from"./index-D1RwamVf.js";import{A as N,C as _}from"./AdminLayout-CQ1ZCywC.js";import{I as w}from"./input-DWdTtHmt.js";import{L as x}from"./label-DnOi2XOT.js";import{S as E}from"./switch-DvXMqcPh.js";import{C as p,a as h,b as u,d as f,c as I}from"./card-z0ZtGknD.js";import{E as g}from"./external-link-Chhawjus.js";import"./menu-BV4BGHxp.js";import"./file-text-BNj1Ikmn.js";import"./book-open-BTxHryhG.js";import"./calendar-rUT6zQLe.js";import"./handshake-dvxgH7Xz.js";import"./globe-DHie2Ov1.js";import"./search-BWIdBq3K.js";import"./shopping-bag-CqfyIXNe.js";import"./gift-8I1fGKht.js";import"./users-vcsirtMx.js";import"./index-D2vI5Na1.js";const d="d42b0a07-bb9d-428d-b6bd-4c07118f8167";async function j(s,o){const{data:r}=await l.from("site_settings").select("id").eq("key",s).maybeSingle();r?await l.from("site_settings").update({value:o}).eq("key",s):await l.from("site_settings").insert({key:s,value:o})}function P(){const[s,o]=n.useState(d),[r,m]=n.useState(!0),[c,C]=n.useState(!0),[k,b]=n.useState(!1);n.useEffect(()=>{l.from("site_settings").select("key, value").in("key",["cookiebot_cbid","cookiebot_enabled"]).then(({data:t})=>{t==null||t.forEach(i=>{i.key==="cookiebot_cbid"&&i.value&&o(i.value),i.key==="cookiebot_enabled"&&m(i.value!=="false")}),C(!1)})},[]);const v=async()=>{b(!0),await j("cookiebot_cbid",s.trim()||d),await j("cookiebot_enabled",String(r));try{localStorage.setItem("cookiebot_cbid",s.trim()||d),localStorage.setItem("cookiebot_enabled",String(r))}catch{}b(!1),y({title:"Gemt",description:"Cookiebanner-indstillingerne er opdateret. Genindlæs siden for at se ændringen."})},S=typeof window<"u"&&!!document.getElementById("Cookiebot");return e.jsx(N,{children:e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(_,{className:"w-7 h-7 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Cookiebanner"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Styr Cookiebot-samtykkebanneret pÃ¥ hele hjemmesiden."})]})]}),e.jsxs(p,{children:[e.jsxs(h,{children:[e.jsx(u,{children:"Indstillinger"}),e.jsx(f,{children:"Banneret indlæses via Cookiebot med automatisk blokering af cookies indtil besøgende har givet samtykke."})]}),e.jsxs(I,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{children:[e.jsx(x,{className:"text-base",children:"Vis cookiebanner"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"SlÃ¥ banneret til eller fra pÃ¥ hele sitet."})]}),e.jsx(E,{checked:r,onCheckedChange:m,disabled:c})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{htmlFor:"cbid",children:"Cookiebot domain group ID (CBID)"}),e.jsx(w,{id:"cbid",value:s,onChange:t=>o(t.target.value),placeholder:d,disabled:c}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Findes i Cookiebot under Settings â Your scripts."})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Status i denne browser: "}),S?"Cookiebot-scriptet er indlæst â":"Scriptet er ikke indlæst"]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(a,{onClick:v,disabled:k||c,children:k?"Gemmer...":"Gem indstillinger"}),e.jsx(a,{variant:"outline",onClick:()=>{var t,i;return(i=(t=window.Cookiebot)==null?void 0:t.renew)==null?void 0:i.call(t)},children:"Ã
bn samtykke-dialog"}),e.jsx(a,{variant:"outline",asChild:!0,children:e.jsxs("a",{href:"/cookiepolitik",target:"_blank",rel:"noopener noreferrer",children:["Se cookiepolitik ",e.jsx(g,{className:"w-4 h-4 ml-2"})]})}),e.jsx(a,{variant:"ghost",asChild:!0,children:e.jsxs("a",{href:"https://admin.cookiebot.com",target:"_blank",rel:"noopener noreferrer",children:["Cookiebot dashboard ",e.jsx(g,{className:"w-4 h-4 ml-2"})]})})]})]})]}),e.jsx(p,{children:e.jsxs(h,{children:[e.jsx(u,{children:"Cookiepolitik-side"}),e.jsxs(f,{children:["Siden ",e.jsx("code",{children:"/cookiepolitik"})," viser den automatisk opdaterede cookie-erklæring fra Cookiebot. Overskrift, introtekst og knaptekst redigeres under Sideindhold â cookiepolitik."]})]})})]})})}export{P 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.