PageSourceSearch

https://budoucnost.ai/assets/CookieConsent-CzhgidDu.js

js budoucnost.ai collected 2026-10-05 15:13:33 UTC 5,318 bytes, 1 lines download raw bytes

1import{a as j}from"./rolldown-runtime-WehaI0Q3.js";import{Pt as N,T as w,ct as C,gt as S,n as z,yt as _}from"./vendor-icons-BbqRbNit.js";import{n as E}from"./vendor-react-Dd-_MHac.js";import{i as P}from"./vendor-query-BSA9x7ZJ.js";import{t as p}from"./proxy-D6lEFKfe.js";import{t as g}from"./AnimatePresence-Ok-swSGg.js";var o=j(N(),1),e=P(),m="cookie-consent-v2",r={necessary:!0,analytics:!1,functional:!1},A=[{key:"necessary",label:"Nezbytné",desc:"Základní funkce webu — navigace a bezpečnost. Nelze vypnout.",locked:!0},{key:"analytics",label:"Analytické",desc:"Anonymní sledování návštěvnosti a výkonu webu (Core Web Vitals, počty zobrazení).",locked:!1},{key:"functional",label:"Funkční",desc:"Preference uživatele — tmavý/světlý režim a zobrazení obsahu.",locked:!1}];function I(){try{const n=localStorage.getItem(m);if(!n)return r;const s=JSON.parse(n);return typeof s=="string"?s==="accepted"?{necessary:!0,analytics:!0,functional:!0}:r:{...r,...s,necessary:!0}}catch{return r}}function U(){return I().analytics}function q(){const[n,s]=(0,o.useState)(!1),[a,h]=(0,o.useState)(!1),[u,y]=(0,o.useState)(r),[x,b]=(0,o.useState)(!1),i=(0,o.useCallback)(()=>s(!0),[]);(0,o.useEffect)(()=>{if(x)return;b(!0);const t=localStorage.getItem(m),c=localStorage.getItem("cookie-consent");if(!t&&!c){const d=setTimeout(()=>s(!0),2e3);return()=>clearTimeout(d)}},[x]),(0,o.useEffect)(()=>(window.addEventListener("open-cookie-settings",i),()=>window.removeEventListener("open-cookie-settings",i)),[i]);const l=t=>{localStorage.setItem(m,JSON.stringify(t)),localStorage.removeItem("cookie-consent"),s(!1)},v=()=>l({necessary:!0,analytics:!0,functional:!0}),f=()=>l({necessary:!0,analytics:!1,functional:!1}),k=()=>l(u);return(0,e.jsx)(g,{children:n&&(0,e.jsxs)(p.div,{role:"dialog","aria-modal":"false","aria-label":"Nastavení cookies",initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",bounce:.2},className:"fixed left-3 right-3 bottom-3 z-[80] w-auto max-w-lg rounded-xl border border-border/50 bg-card/95 backdrop-blur-xl p-3 shadow-2xl max-h-[50vh] overflow-y-auto sm:left-auto sm:right-6 sm:bottom-6 sm:w-[420px] sm:rounded-2xl sm:p-5 md:bottom-6 mb-[calc(3.5rem+env(safe-area-inset-bottom))] sm:mb-0",children:[(0,e.jsx)("button",{onClick:f,className:"absolute right-3 top-3 rounded-lg p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Zavřít",children:(0,e.jsx)(z,{size:14})}),(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,e.jsx)(C,{size:16})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("h3",{className:"text-sm font-bold text-foreground",children:"Nastavení cookies"}),(0,e.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:["Respektujeme vaše soukromí. Vyberte si, které kategorie cookies chcete povolit."," ",(0,e.jsx)(E,{to:"/zasady-cookies",className:"text-primary hover:underline",children:"Více informací"})]}),(0,e.jsx)(g,{children:a&&(0,e.jsx)(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,e.jsx)("div",{className:"mt-3 space-y-2",children:A.map(t=>(0,e.jsxs)("label",{className:`flex items-start gap-3 rounded-lg p-2.5 text-xs transition-colors ${t.locked?"bg-muted/30":"bg-secondary/40 hover:bg-secondary/60 cursor-pointer"}`,children:[(0,e.jsx)("input",{type:"checkbox",checked:t.locked?!0:u[t.key],disabled:t.locked,onChange:c=>!t.locked&&y(d=>({...d,[t.key]:c.target.checked})),className:"mt-0.5 h-3.5 w-3.5 rounded border-border accent-primary disabled:opacity-50"}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"font-bold text-foreground",children:t.label}),t.locked&&(0,e.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[9px] font-semibold text-muted-foreground",children:"Vždy aktivní"})]}),(0,e.jsx)("p",{className:"text-muted-foreground leading-relaxed mt-0.5",children:t.desc})]})]},t.key))})})}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)("button",{onClick:v,className:"rounded-lg bg-primary px-4 py-2 text-xs font-bold text-primary-foreground shadow-lg shadow-primary/25 transition-all hover:brightness-110",children:"Přijmout vše"}),a?(0,e.jsx)("button",{onClick:k,className:"rounded-lg bg-secondary/80 px-4 py-2 text-xs font-semibold text-foreground ring-1 ring-border/50 transition-colors hover:bg-secondary",children:"Uložit výběr"}):(0,e.jsx)("button",{onClick:f,className:"rounded-lg bg-secondary/80 px-4 py-2 text-xs font-semibold text-muted-foreground ring-1 ring-border/50 transition-colors hover:text-foreground",children:"Pouze nezbytné"}),(0,e.jsxs)("button",{onClick:()=>h(t=>
1!t),className:"inline-flex items-center gap-1 text-[11px] font-semibold text-primary hover:underline ml-auto",children:[(0,e.jsx)(w,{size:11}),a?"Skrýt":"Nastavení",a?(0,e.jsx)(S,{size:10}):(0,e.jsx)(_,{size:10})]})]})]})]})]})})}export{q as default,I as getCookiePreferences,U as hasAnalyticsConsent};

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.