PageSourceSearch

https://mojebublina.cz/static/js/145.a3ae3e68.chunk.js

js mojebublina.cz collected 2026-10-10 02:43:03 UTC 44,872 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmojebublina_client=self.webpackChunkmojebublina_client||[]).push([[145],{2503(e,t,n){n.d(t,{A:()=>o});var a=n(2074),s=n(9561),l=n(4414);const o=function(e){let{poll:t}=e;const n=(0,s.f)(null===t||void 0===t?void 0:t.expires_at);if(!t)return null;const o=100-function(e,t){const n=new Date(e).getTime(),a=new Date(t).getTime(),s=Date.now();if(!(a>n))return 0;const l=(s-n)/(a-n)*100;return Math.min(100,Math.max(0,l))}(t.created_at,t.expires_at);return(0,l.jsxs)("div",{className:"relative rounded-3xl overflow-hidden bg-dark shadow-lg",children:[(0,l.jsx)("div",{className:"absolute -top-16 -right-16 w-56 h-56 bg-accent opacity-20 rounded-full blur-3xl pointer-events-none"}),(0,l.jsx)("div",{className:"absolute -bottom-20 -left-10 w-56 h-56 bg-primary opacity-20 rounded-full blur-3xl pointer-events-none"}),(0,l.jsx)("div",{className:"absolute inset-0 opacity-[0.07] pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 2px 2px, white 1px, transparent 0)",backgroundSize:"28px 28px"}}),(0,l.jsxs)("div",{className:"relative p-6 md:p-10",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-5",children:[(0,l.jsxs)("div",{className:"inline-flex items-center gap-2 bg-accent/15 border border-accent/40 rounded-full pl-2.5 pr-4 py-1.5",children:[(0,l.jsxs)("svg",{className:"w-4 h-4 text-accent",fill:"currentColor",viewBox:"0 0 24 24",children:[(0,l.jsx)("path",{d:"M3 11a1 1 0 011-1h2.586l4.707-4.707A1 1 0 0113 6v12a1 1 0 01-1.707.707L6.586 14H4a1 1 0 01-1-1v-2z"}),(0,l.jsx)("path",{d:"M16.293 8.293a1 1 0 011.414 0A5.98 5.98 0 0119.5 12.5a5.98 5.98 0 01-1.793 4.207 1 1 0 01-1.414-1.414A3.98 3.98 0 0017.5 12.5a3.98 3.98 0 00-1.207-2.793 1 1 0 010-1.414z"})]}),(0,l.jsx)("span",{className:"font-display font-bold text-accent text-xs uppercase tracking-widest",children:"Admin anketa"})]}),(0,l.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-white/60 font-body text-xs",children:[(0,l.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,l.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent opacity-75"}),(0,l.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent"})]}),"pr\xe1v\u011b b\u011b\u017e\xed"]})]}),(0,l.jsx)("h3",{className:"text-white font-display font-bold text-2xl md:text-3xl leading-snug mb-6",children:t.question}),(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-7",children:[(0,l.jsx)("div",{className:"flex-1 h-2 rounded-full bg-white/10 overflow-hidden",children:(0,l.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-accent to-secondary transition-all duration-500",style:{width:"".concat(o,"%")}})}),(0,l.jsxs)("span",{className:"flex items-center gap-1.5 text-white/70 font-body text-sm whitespace-nowrap",children:[(0,l.jsxs)("svg",{className:"w-4 h-4",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,l.jsx)("path",{d:"M12 7v5l3 3"})]}),n]})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[(0,l.jsxs)(a.N_,{to:"/poll/".concat(t.id),className:"btn btn-accent w-full sm:w-auto justify-center",children:["Hlasovat",(0,l.jsx)("svg",{className:"ml-2 w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]}),(0,l.jsx)(a.N_,{to:"/redakcni-ankety",className:"text-white/50 hover:text-white/80 font-body text-sm transition-colors text-center sm:text-left",children:"Historie redak\u010dn\xedch anket \u2192"})]})]})]})}},8267(e,t,n){n.d(t,{A:()=>o});var a=n(9950),s=n(6435),l=n(4414);function o(e){let{storageKey:t,title:n,children:o}=e;const[i,r]=(0,a.useState)(()=>function(e){try{return"1"===localStorage.getItem(e)}catch(t){return!1}}(t));if(i)return null;const c=()=>{!function(e){try{localStorage.setItem(e,"1")}catch(t){}}(t),r(!0)};return(0,l.jsxs)(s.A,{isOpen:!0,title:n,onClose:c,children:[o,(0,l.jsx)("button",{onClick:c,className:"btn btn-primary w-full mt-6",children:"Rozum\xedm"})]})}},9561(e,t,n){n.d(t,{f:()=>s});var a=n(9950);function s(e){const[,t]=(0,a.useState)(0);return(0,a.useEffect)(()=>
1{if(!e)return;if(new Date(e).getTime()<=Date.now())return;const n=setInterval(()=>{t(e=>e+1),new Date(e).getTime()<=Date.now()&&clearInterval(n)},3e4);return()=>clearInterval(n)},[e]),e?function(e){const t=new Date(e)-new Date,n=Math.ceil(t/36e5);if(n<=1)return"Kon\u010d\xed za m\xe9n\u011b ne\u017e hodinu";if(n<24)return"Kon\u010d\xed za ".concat(n," h");const a=Math.ceil(n/24),s=1===a?"den":a<=4?"dny":"dn\xed";return"Kon\u010d\xed za ".concat(a," ").concat(s)}(e):null}},7468(e,t,n){function a(e){const t=(null===e||void 0===e?void 0:e.message)||"";return/invalid login credentials/i.test(t)?"Nespr\xe1vn\xfd email nebo heslo. Zkontroluj pros\xedm oba \xfadaje a zkus to znovu.":/email.*not.*confirmed/i.test(t)?"Email je\u0161t\u011b nen\xed potvrzen\xfd. Zkontroluj si schr\xe1nku (i Spam) a klikni na potvrzovac\xed odkaz.":/user already registered|already been registered/i.test(t)?"\xda\u010det s t\xedmto emailem u\u017e existuje. Zkus se p\u0159ihl\xe1sit, nebo si obnov heslo.":/unable to validate email address/i.test(t)?"Zadan\xfd email nem\xe1 platn\xfd form\xe1t. Zkontroluj ho pros\xedm.":/password should be at least/i.test(t)?"Heslo je p\u0159\xedli\u0161 kr\xe1tk\xe9. Zvol pros\xedm heslo s alespo\u0148 8 znaky.":429===(null===e||void 0===e?void 0:e.status)||/rate limit|too many/i.test(t)?"P\u0159\xedli\u0161 mnoho pokus\u016f. Zkus to pros\xedm za chv\xedli.":/auth session missing|session.*expired|refresh.*token/i.test(t)?"Tv\xe9 p\u0159ihl\xe1\u0161en\xed vypr\u0161elo. P\u0159ihlas se pros\xedm znovu.":/failed to fetch|network/i.test(t)?"Nepoda\u0159ilo se spojit se serverem. Zkontroluj pros\xedm internetov\xe9 p\u0159ipojen\xed a zkus to znovu.":null}function s(e,t){t("P\u0159ihl\xe1\u0161en\xed vypr\u0161elo. P\u0159ihlas se pros\xedm znovu.","error"),e("/login")}n.d(t,{L:()=>a,j:()=>s})},1945(e,t,n){function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return!!e&&(!(e.starts_at&&new Date(e.starts_at)>t)&&!(e.ends_at&&new Date(e.ends_at)<t))}function s(e){if(!Array.isArray(e)||0===e.length)return null;const t=e.filter(e=>Number(null===e||void 0===e?void 0:e.weight)>0);if(0===t.length)return null;const n=t.reduce((e,t)=>e+Number(t.weight),0);let a=Math.random()*n;for(const s of t)if(a-=Number(s.weight),a<=0)return s;return t[t.length-1]}n.d(t,{e:()=>a,n:()=>s})},5914(e,t,n){n.d(t,{F:()=>l,c:()=>o});const a="/.netlify/functions/track-banner-event";function s(e,t){if(e)try{const n=JSON.stringify({bannerId:e,eventType:t});navigator.sendBeacon?navigator.sendBeacon(a,new Blob([n],{type:"application/json"})):fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch(n){}}function l(e){s(e,"impression")}function o(e){s(e,"click")}},7381(e,t,n){n.d(t,{u:()=>s});var a=n(5483);async function s(){const{data:e}=await a.N.from("polls").select("id, question, expires_at, created_at").eq("poll_type","editorial").gt("expires_at",(new Date).toISOString()).order("created_at",{ascending:!0}).limit(1).maybeSingle();return e||null}},8145(e,t,n){n.r(t),n.d(t,{default:()=>Z});var a=n(2555),s=n(9950),l=n(8429),o=n(2074),i=n(5483),r=n(5532),c=n(7615),d=n(9163),m=n(1842),u=n(5914),x=n(390),h=n(7611);const p="/.netlify/functions/track-share-open",f=/^[a-z0-9_-]{1,40}$/;function v(e,t){(0,h.v)()&&e&&t&&f.test(t)&&function(e){try{const t=JSON.stringify(e);navigator.sendBeacon?navigator.sendBeacon(p,new Blob([t],{type:"application/json"})):fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0}).catch(()=>{})}catch(t){}}({pollId:e,source:t})}var b=n(1945),j=n(7468),g=n(6435),k=n(4414);const y=[{value:"dezinformace",label:"Dezinformace"},{value:"nenavistny_obsah",label:"Nen\xe1vistn\xfd obsah"},{value:"spam",label:"Spam nebo reklama"},{value:"jine",label:"Jin\xe9"}];const w=function(e){let{pollId:t}=e;const{user:n}=(0,r.A)(),l=(0,c.d)(),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(""),[x,h]=(0,s.use
1State)(""),[p,f]=(0,s.useState)(""),[v,b]=(0,s.useState)(!1);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{onClick:()=>d(!0),className:"flex items-center gap-1.5 text-text-light hover:text-red-500 transition-colors font-display text-sm",title:"Nahl\xe1sit obsah",children:[(0,k.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,k.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})}),"Nahl\xe1sit"]}),(0,k.jsx)(g.A,{isOpen:o,onClose:()=>d(!1),title:"Nahl\xe1sit anketu",children:(0,k.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),m){b(!0);try{const{data:{session:e}}=await i.N.auth.getSession(),n=await fetch("/.netlify/functions/report-poll",{method:"POST",headers:(0,a.A)({"Content-Type":"application/json"},null!==e&&void 0!==e&&e.access_token?{Authorization:"Bearer ".concat(e.access_token)}:{}),body:JSON.stringify({pollId:t,reason:m,description:x.trim()||null,contactEmail:p.trim()||null})}),s=await n.json();if(!n.ok)throw new Error(s.error||"Nahl\xe1\u0161en\xed se nezda\u0159ilo");l("D\u011bkuji, prov\u011b\u0159\xedm to co nejd\u0159\xedve."),d(!1),u(""),h(""),f("")}catch(n){l(n.message||"Nahl\xe1\u0161en\xed se nezda\u0159ilo","error")}finally{b(!1)}}},className:"space-y-4 text-left",children:[(0,k.jsxs)("div",{children:[(0,k.jsx)("label",{className:"form-label block mb-2 text-sm",children:"D\u016fvod nahl\xe1\u0161en\xed"}),(0,k.jsx)("div",{className:"space-y-2",children:y.map(e=>(0,k.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,k.jsx)("input",{type:"radio",name:"reason",value:e.value,checked:m===e.value,onChange:()=>u(e.value),className:"text-primary"}),(0,k.jsx)("span",{className:"font-body text-dark",children:e.label})]},e.value))})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("label",{className:"form-label block mb-1 text-sm",children:"Popis (nepovinn\xfd)"}),(0,k.jsx)("textarea",{value:x,onChange:e=>h(e.target.value),placeholder:"P\u0159idej v\xedce podrobnost\xed...",rows:3,maxLength:500,className:"form-input w-full resize-none"}),(0,k.jsxs)("p",{className:"text-xs text-text-light mt-1 font-body",children:[x.length,"/500"]})]}),(0,k.jsxs)("div",{children:[(0,k.jsxs)("label",{className:"form-label block mb-1 text-sm",children:["E-mail pro informov\xe1n\xed o v\xfdsledku ",(0,k.jsx)("span",{className:"font-normal text-medium-gray",children:"(nepovinn\xe9)"})]}),(0,k.jsx)("input",{type:"email",value:p,onChange:e=>f(e.target.value),placeholder:"[email protected]",maxLength:255,className:"form-input w-full"}),(0,k.jsx)("p",{className:"text-xs text-text-light mt-1 font-body",children:"Nech\xe1\u0161-li e-mail, d\xe1m ti v\u011bd\u011bt, jak nahl\xe1\u0161en\xed dopadlo."})]}),!n&&(0,k.jsx)("p",{className:"text-xs text-text-light font-body bg-light-gray rounded-lg p-3",children:"Nahl\xe1sit lze i bez p\u0159ihl\xe1\u0161en\xed. P\u0159ihl\xe1\u0161en\xed n\xe1m pom\xe1h\xe1 l\xe9pe zpracovat tv\xe9 nahl\xe1\u0161en\xed."}),(0,k.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,k.jsx)("button",{type:"button",onClick:()=>d(!1),className:"btn btn-secondary flex-1",disabled:v,children:"Zru\u0161it"}),(0,k.jsx)("button",{type:"submit",disabled:!m||v,className:"btn btn-primary flex-1",children:v?(0,k.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,k.jsx)("div",{className:"loading-spinner w-4 h-4 border-2"}),(0,k.jsx)("span",{children:"Odes\xedl\xe1m..."})]}):"Odeslat nahl\xe1\u0161en\xed"})]})]})})]})};var N=n(8267),_=n(5266);const z=function(e){let{isOpen:t,title:n="Opravdu?",message:a,confirmLabel:l="Smazat",loadingLabel:o="Ma\u017eu...",cancelLabel:i="Zru\u0161it",loading:r=!1,onConfirm:c,onCancel:d}=e;const m=(0,s.useRef)(null),u=(0,s.useId)(),x=(0,s.useCallback)(()=>{r||d()},[r,d]);return(0,_.r)(m,t,x),t?(0,k.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:x,children:(0,k.jsxs)("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":u,tabIndex:-1,
1className:"bg-white rounded-2xl p-8 max-w-sm w-full mx-4 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,k.jsx)("h3",{id:u,className:"text-xl font-display font-bold text-dark mb-3",children:n}),(0,k.jsx)("p",{className:"text-text-light font-body text-sm mb-6",children:a}),(0,k.jsxs)("div",{className:"modal-actions flex gap-3",children:[(0,k.jsx)("button",{onClick:d,disabled:r,className:"btn btn-secondary flex-1 disabled:opacity-50",children:i}),(0,k.jsx)("button",{onClick:c,disabled:r,className:"btn btn-danger flex-1 disabled:opacity-50",children:r?(0,k.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,k.jsx)("div",{className:"loading-spinner w-4 h-4 border-2"}),(0,k.jsx)("span",{children:o})]}):l})]})]})}):null},S="Po\u010dkej pros\xedm na dokon\u010den\xed bezpe\u010dnostn\xed kontroly a zkus to znovu.",C="Bezpe\u010dnostn\xed kontrola dokon\u010dena, m\u016f\u017ee\u0161 hlasovat.",A="Ov\u011b\u0159en\xed se te\u010f neda\u0159\xed dokon\u010dit. Zkus to pros\xedm za chv\xedli znovu.";let L=null;function I(e,t,n,s){const l=window.turnstile;if(l&&t.current){if(e.current)try{l.remove(e.current)}catch(o){}e.current=l.render(t.current,(0,a.A)({sitekey:n,appearance:"interaction-only"},s))}}const B=/FBAN|FBAV|FB_IAB|Instagram|Twitter/i;var T=n(9561),M=n(7381),E=n(2503),D=n(8335);function O(e){try{const t=new URL(e);return["https:","http:"].includes(t.protocol)?e:"#"}catch(t){return"#"}}function H(e){return e?e.split(/(\*[^*]+\*)/g).map((e,t)=>e.startsWith("*")&&e.endsWith("*")&&e.length>2?(0,k.jsx)("span",{className:"text-[#f2465f]",children:e.slice(1,-1)},t):e):e}const P={banner_type:"promo",question:"O tom, \u017ee *digit\xe1ln\xed tv\xe1\u0159* podnik\xe1n\xed je dnes nutnost\xed, hlasovat net\u0159eba.",subtitle:"Ahoj, jsem Dan \ud83d\udc4b \u2014 tvo\u0159\xedm weby a aplikace, co *makaj\xed za tebe!*",button_text:"djech.cz \u2192",link_url:"https://djech.cz/"};function R(e){try{localStorage.setItem("mojebublina_cta_tooltip_dismissed_".concat(e),"1")}catch(t){}}const Z=function(){const{pollId:e}=(0,l.g)(),t=(0,l.Zp)(),{user:n}=(0,r.A)(),h=(0,c.d)(),p=(0,s.useRef)(null),f=(0,s.useRef)(null),[y,_]=(0,s.useState)(null),[Z,F]=(0,s.use
1State)([]),[q,V]=(0,s.useState)(0),[W,U]=(0,s.useState)(!1),[J,G]=(0,s.useState)(!0),[K,X]=(0,s.useState)(null),[$,Y]=(0,s.useState)(!1),[Q,ee]=(0,s.useState)(""),[te,ne]=(0,s.useState)(!1),[ae,se]=(0,s.useState)(""),[le,oe]=(0,s.useState)(!1),[ie,re]=(0,s.useState)(!1),[ce,de]=(0,s.useState)(!1),[me,ue]=(0,s.useState)(!1),[xe,he]=(0,s.useState)(!1),[pe,fe]=(0,s.useState)(0),[ve,be]=(0,s.useState)(!1),[je,ge]=(0,s.useState)(null),[ke,ye]=(0,s.useState)(!1),[we,Ne]=(0,s.useState)(null),[_e,ze]=(0,s.useState)(null),[Se,Ce]=(0,s.useState)(""),[Ae,Le]=(0,s.useState)(!1),[Ie,Be]=(0,s.useState)(10),[Te,Me]=(0,s.useState)(!1),[Ee,De]=(0,s.useState)(!1),[Oe,He]=(0,s.useState)(!1),Pe=(0,s.useRef)(null),Re=(0,s.useRef)(null),Ze=(0,s.useRef)(!1),Fe=(0,s.useRef)(null),qe=(0,s.useRef)(!1),Ve="0x4AAAAAAEDBH-frwMRkgOIj",We=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"!==typeof navigator?navigator.userAgent:"";return B.test(e||"")}();(0,s.useEffect)(()=>{let e=localStorage.getItem("mojebublina_voter_id");e||(e="voter_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9)),localStorage.setItem("mojebublina_voter_id",e)),ee(e)},[]),(0,s.useEffect)(()=>{if(qe.current||!e)return;const t=new URLSearchParams(window.location.search).get("src");t&&(qe.current=!0,v(e,t))},[e]),(0,s.useEffect)(()=>{const e=document.createElement("meta");return e.name="robots",e.content="noindex",document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]),(0,s.useEffect)(()=>{if($||We)return;let e=!1;Le(!1),Fe.current=Date.now(),Be(10);const t={callback:e=>{Le(!1),Ce(e)},"expired-callback":()=>Ce(""),"error-callback":()=>Ce("")};("undefined"===typeof window?Promise.reject(new Error("No window")):window.turnstile?Promise.resolve(window.turnstile):L||(L=new Promise((e,t)=>{const n=document.querySelector("script[data-turnstile]");if(n)return n.addEventListener("load",()=>e(window.turnstile)),void n.addEventListener("error",()=>t(new Error("Turnstile script se nepoda\u0159ilo na\u010d\xedst")));const a=document.createElement("script");a.src="https://challenges.cloudflare.com/turnstile/v0/api.js",a.async=!0,a.defer=!0,a.dataset.turnstile="true",a.onload=()=>e(window.turnstile),a.onerror=()=>t(new Error("Turnstile script se nepoda\u0159ilo na\u010d\xedst")),document.head.appendChild(a)}),L)).then(n=>{e||!Pe.current||Re.current||(Re.current=n.render(Pe.current,(0,a.A)({sitekey:Ve,appearance:"interaction-only"},t)))}).catch(()=>Ce(""));const n=setTimeout(()=>{e||Ze.current||(Le(!0),I(Re,Pe,Ve,t))},1e4),s=setInterval(()=>{const e=10-Math.floor((Date.now()-Fe.current)/1e3);Be(Math.max(0,e))},1e3);return()=>{e=!0,clearTimeout(n),clearInterval(s)}},[$,Ve,We,J]),(0,s.useEffect)(()=>{Ze.current=!!Se,!Se||ae!==S&&ae!==A||se(C)},[Se,ae]),(0,s.useEffect)(()=>{ge(null),ye(!1),Ne(null),be(function(e){try{return"1"===localStorage.getItem("mojebublina_cta_tooltip_dismissed_".concat(e))}catch(t){return!1}}(e))},[e]),(0,s.useEffect)(()=>{null!==je&&void 0!==je&&je.id&&(0,u.F)(je.id)},[null===je||void 0===je?void 0:je.id]),(0,s.useEffect)(()=>{null!==we&&void 0!==we&&we.id&&(0,u.F)(we.id)},[null===we||void 0===we?void 0:we.id]),(0,s.useEffect)(()=>{n||!$||ve||(0,x.GX)(e)},[n,$,ve,e]);const Ue=(0,s.useCallback)(async t=>{const{data:n,error:a}=await i.N.rpc("get_poll_vote_counts",{p_poll_id:e});if(a)return console.error("fetchVoteCounts failed:",a),void U(!0);U(!1);const s=Array(t).fill(0);let l=0;(n||[]).forEach(e=>{if(e.option_index>=0&&e.option_index<t){const t=Number(e.vote_count);s[e.option_index]=t,l+=t}}),F(s),V(l)},[e]),Je=(0,T.f)(null===y||void 0===y?void 0:y.expires_at);(0,s.useEffect)(()=>{if(!e||!Q)return;let t=!1;return(async()=>{G(!0);try{const{data:n,error:a}=await i.N.rpc("get_poll_by_id",{p_poll_id:e});if(a)throw a;if(!n||0===n.length)throw new Error("poll_not_found");const s=n[0];if(t)return;if("partner"===s.poll_type&&"active"!==s.partner_status)throw new Error("poll_not_found");_(s);const{data:l}=await i.N.rpc("has_voted",{p_poll_id:e,p_voter_hash:Q});if(t)return;const o=!!l;if(Y(o),oe(o),o){const t=function(e){try{const t=localStorage.getItem("mojebublina_vote_option_".concat(e));return null===t?null:Number(t)}catch(t){return null}}(e);null!==t&&X(t)}await Ue(s.options.length)}catch(n){if(!t){const e="poll_not_found"===(null===n||void 0===n?void 0:n.message);se(e?"Anketa nenalezena":"Anketu se nepoda\u0159ilo na\u010d\xedst. Zkus pros\xedm obnovit str\xe1nku."),e||(0,D.h)("poll_fetch_failed",(null===n||void 0===n?void 0:n.message)||String(n),null===n||void 0===n?void 0:n.stack)}}finally{t||G(!1)}})(),()=>{t=!0}},[e,Q,Ue]),(0,s.useEffect)(()=>
1{if(!y||we)return;const e=(null===n||void 0===n?void 0:n.id)===y.user_id;($||e)&&("public"===y.results_visibility||e)&&Ne(P)},[y,$,null===n||void 0===n?void 0:n.id,we]),(0,s.useEffect)(()=>{if(!y)return;let e=!1;return(async()=>{const t=await(0,M.u)();!e&&t&&t.id!==y.id&&ze(t)})(),()=>{e=!0}},[y]),(0,s.useEffect)(()=>{var e;null===K||$||(null===(e=f.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"}))},[K,$]);const Ge=e=>0===q?0:(e/q*100).toFixed(1),Ke="".concat(window.location.origin,"/share/").concat(e),Xe=async(e,t,n)=>{t(!0);try{(await(0,m.$)(e,{poll:(0,a.A)((0,a.A)({},y),{},{options:at,totalVotes:q}),calculatePercentage:Ge,qrCanvas:p.current})).toBlob(e=>{const a=URL.createObjectURL(e),s=document.createElement("a");s.download=n,s.href=a,s.click(),URL.revokeObjectURL(a),t(!1)})}catch(s){se("Generov\xe1n\xed karty se nezda\u0159ilo"),t(!1)}},$e=()=>{navigator.clipboard.writeText(Ke),h("Odkaz zkop\xedrov\xe1n!")},Ye=e=>{navigator.clipboard.writeText("".concat(Ke,"?src=").concat(e)),h("Odkaz pro koment\xe1\u0159 zkop\xedrov\xe1n!")};if(J)return(0,k.jsx)("div",{className:"min-h-screen bg-cream py-12 px-4",children:(0,k.jsxs)("div",{className:"container mx-auto max-w-4xl",children:[(0,k.jsxs)("div",{className:"mb-8 text-center flex flex-col items-center",children:[(0,k.jsx)("div",{className:"skeleton h-8 w-2/3 mb-3"}),(0,k.jsx)("div",{className:"skeleton h-5 w-40"})]}),(0,k.jsx)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-1 md:gap-6",children:[0,1].map(e=>(0,k.jsxs)("div",{className:"flex flex-col items-center gap-2 md:flex-row md:gap-6 p-4 md:p-6 border-2 border-light-gray rounded-lg",children:[(0,k.jsx)("div",{className:"skeleton flex-shrink-0 w-full aspect-square max-w-[110px] md:w-40 md:h-40 md:max-w-none"}),(0,k.jsx)("div",{className:"skeleton h-6 w-full md:w-1/2"})]},e))})]})});if(ae&&!y)return(0,k.jsx)("div",{className:"min-h-screen bg-cream flex items-center justify-center px-4",children:(0,k.jsxs)("div",{className:"card max-w-md w-full text-center",children:[(0,k.jsx)("h2",{className:"text-dark mb-4",children:"Chyba"}),(0,k.jsx)("p",{className:"text-text-light font-body mb-6",children:ae}),(0,k.jsx)("button",{onClick:()=>t("/"),className:"btn btn-primary",children:"Zp\u011bt na hlavn\xed str\xe1nku"})]})});if(!y)return null;const Qe=(null===n||void 0===n?void 0:n.id)===y.user_id,et="[email protected]"===(null===n||void 0===n?void 0:n.email),tt=y.expires_at&&new Date(y.expires_at)<=new Date,nt=(le||Qe||tt)&&("public"===y.results_visibility||Qe),at=y.options.map((e,t)=>(0,a.A)((0,a.A)({},e),{},{index:t,votes:Z[t]||0})),st=at.some(e=>e.image),lt=we&&("promo"===we.banner_type?(0,k.jsxs)("a",{href:O(we.link_url),target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,u.c)(we.id),className:"flex flex-col rounded-2xl shadow-lg overflow-hidden p-6 gap-4",style:{background:"radial-gradient(140% 120% at 50% 100%, rgba(220,20,60,0.35) 0%, transparent 55%), linear-gradient(160deg, #1a1a1a 0%, #050505 60%, #000000 100%)"},children:[(0,k.jsx)("span",{className:"self-center sm:self-start bg-white/10 text-white/80 text-xs font-display font-semibold px-3 py-1 rounded-full backdrop-blur-sm w-fit",children:"Sponzorov\xe1no"}),(0,k.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4 sm:gap-5 text-center sm:text-left",children:[we.option1_image&&(0,k.jsx)("img",{src:O(we.option1_image),alt:we.option1_name||"",className:"w-20 h-20 sm:w-24 sm:h-24 rounded-full object-cover flex-shrink-0 border-2 border-white/20"}),(0,k.jsxs)("div",{className:"min-w-0",children:[(0,k.jsx)("p",{className:"font-display font-bold text-white text-lg sm:text-xl leading-snug",children:H(we.question)}),we.subtitle&&(0,k.jsx)("p",{className:"font-body font-semibold text-white text-sm sm:text-base mt-2",children:H(we.subtitle)}),we.button_text&&(0,k.jsx)("span",{className:"inline-flex items-center gap-1 mt-3 bg-[#DC143C] text-white font-display font-semibold text-sm px-3 py-1.5 rounded-full",children:we.button_text})]})]})]}):(0,k.jsxs)("a",{href:O(we.link_url),target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,u.c)(we.id),className:"relative block rounded-2xl shadow-lg overflow-hidden",style:we.aspect_ratio?{aspectRatio:we.aspect_ratio.replace(":"," / ")}:void 0,children:[(0,k.jsx)("span",{className:"absolute top-3 left-3 z-10 bg-white/90 text-dark text-xs font-display font-semibold px-3 py-1 rounded-full shadow",children:"Sponzorov\xe1no"}),(0,k.jsx)("img",{src:O(we.image_url),alt:"reklama",className:"w-full block ".concat(we.aspect_ratio?"h-full object-cover":"")})]}));return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"min-h-screen bg-cream py-12 px-4",children:(0,k.jsxs)("div",{className:"container mx-auto max-w-4xl",children:[(0,k.jsxs)("div",{className:"mb-6 text-center",children:[(0,k.jsx)("h1",{className:"text-dark mb-4",children:y.question}),y.creator_nickname&&(0,k.jsxs)("p",{className:"text-text-light font-body text-sm",children:["Vytvo\u0159il/a: ",y.creator_nickname]}),Qe&&(0,k.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-2 mt-3",children:[(0,k.jsx)("button",{onClick:()=>De(!0),className:"btn btn-secondary py-2 px-4 text-sm",children:"Sd\xedlet"}),(0,k.jsx)("button",{onClick:$e,className:"btn btn-secondary py-2 px-4 text-sm",children:"Zkop\xedrovat odkaz"})]})]}),(0,k.jsxs)("div",{className:"mb-6 text-center",children:[y.expires_at&&!tt&&(0,k.jsx)("p",{className:"text-text-light font-body text-sm mb-1",children:Je}),!(tt&&!$)&&(0,k.jsx)("p",{className:"text-text-light text-lg font-body",children:$?"D\xedky za tv\u
1016fj hlas!":"Vyber jednu mo\u017enost"})]}),!$&&tt&&(0,k.jsxs)("div",{className:"card text-center mb-8",children:[(0,k.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-accent bg-opacity-20 rounded-full flex items-center justify-center",children:(0,k.jsx)("svg",{className:"w-8 h-8 text-accent",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,k.jsx)("path",{d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,k.jsx)("h2",{className:"text-dark mb-4",children:"Tato anketa skon\u010dila"}),(0,k.jsx)("p",{className:"text-text-light font-body text-lg",children:"Doba trv\xe1n\xed ankety vypr\u0161ela, hlasov\xe1n\xed ji\u017e nen\xed mo\u017en\xe9."})]}),!$&&!tt&&(0,k.jsx)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-1 md:gap-6 mb-8",children:at.map(e=>(0,k.jsx)("button",{type:"button","aria-pressed":K===e.index,onClick:()=>X(e.index),className:"poll-option ".concat(K===e.index?"selected":""," ").concat(n?"":"guest-highlight"),children:(0,k.jsxs)("div",{className:"flex flex-col items-center text-center gap-2 md:flex-row md:items-center md:text-left md:gap-0 md:space-x-6",children:[st&&("#"!==O(e.image)?(0,k.jsx)("img",{src:O(e.image),alt:e.name,className:"flex-shrink-0 w-full aspect-square max-w-[110px] md:w-40 md:h-40 md:max-w-none object-cover rounded-lg"}):(0,k.jsx)("div",{className:"flex-shrink-0 w-full aspect-square max-w-[110px] md:w-40 md:h-40 md:max-w-none rounded-lg bg-light-gray flex items-center justify-center",children:(0,k.jsx)("svg",{className:"w-8 h-8 md:w-10 md:h-10 text-medium-gray",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,k.jsx)("path",{d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})})),(0,k.jsx)("div",{className:"flex-1 min-w-0",children:(0,k.jsxs)("h3",{className:"text-base sm:text-lg md:text-2xl font-display font-bold text-dark flex flex-wrap items-center justify-center md:justify-start gap-x-2 gap-y-1",children:[(0,k.jsx)("span",{children:e.name}),K===e.index&&(0,k.jsxs)("span",{className:"inline-flex items-center gap-1 flex-shrink-0 whitespace-nowrap text-primary text-xs sm:text-sm font-display font-semibold",children:[(0,k.jsx)("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"currentColor",viewBox:"0 0 20 20",children:(0,k.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Vybr\xe1no"]})]})})]})},e.index))}),!$&&!tt&&null!==K&&(0,k.jsx)("div",{className:"mb-6",children:(0,k.jsx)("button",{ref:f,onClick:async()=>{if(null!==K)if(y.expires_at&&new Date(y.expires_at)<=new Date)se("Tato anketa ji\u017e skon\u010dila, hlasov\xe1n\xed nen\xed mo\u017en\xe9");else if(Se||We){ne(!0),se("");try{const t=await fetch("/.netlify/functions/cast-vote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pollId:e,optionIndex:K,voterHash:Q,turnstileToken:Se})}),n=await t.json().catch(()=>({}));if(!t.ok)return 409===t.status?se("Ji\u017e jsi v t\xe9to anket\u011b hlasoval/a"):429===t.status?se("P\u0159\xedli\u0161 mnoho po\u017eadavk\u016f. Zkus to za chv\xedli."):403===t.status?se("Bezpe\u010dnostn\xed ov\u011b\u0159en\xed se nezda\u0159ilo. Zkus to pros\xedm znovu."):se(n.error||"Hlasov\xe1n\xed se nezda\u0159ilo"),I(Re,Pe,Ve,{callback:e=>Ce(e),"expired-callback":()=>Ce(""),"error-callback":()=>Ce("")}),void Ce("");Y(!0),oe(!0),function(e,t){try{localStorage.setItem("mojebublina_vote_option_".concat(e),String(t))}catch(n){}}(e,K),window.scrollTo({top:0,behavior:"smooth"}),await Ue(y.options.length);const{data:a}=await i.N.from("banners_public").select("id, image_url, link_url, aspect_ratio, starts_at, ends_at, weight").eq("placement","post_vote"),s=(0,b.n)((a||[]).filter(e=>(0,b.e)(e)));s&&(ge(s),setTimeout(()=>ye(!0),2e3))}catch(t){se((0,j.L)(t)||t.message||"Hlasov\xe1n\xed se nezda\u0159ilo"),I(Re,Pe,Ve,{callback:e=>Ce(e),"expired-callback":()=>Ce(""),"error-callback":()=>Ce("")}),Ce("")}finally{ne(!1)}}else se(Ae?A:S);else se("Pros\xedm vyberte mo\u017enost")},disabled:te,className:"btn btn-primary w-full text-lg",children:te?(0,k.jsxs)("div",{className:"flex items-center justify-center",children:[(0,k.jsx)("div",{className:"loading-spinner w-6 h-6 border-2"}),(0,k.jsx)("span",{className:"ml-3",children:"Hlasuju..."})]}):"Hlasovat"})}),!$&&!tt&&Ve&&!We&&(0,k.jsx)("div",{ref:Pe,className:"flex justify-center",style:Se?{display:"none"}:void 0}),ae&&y&&(0,k.jsx)("div",{className:"mb-6 p-4 border-2 rounded-lg ".concat(ae===C?"bg-green-50 border-green-200":"bg-red-50 border-red-200"),children:(0,k.jsxs)("p",{className:"font-body ".concat(ae===C?"text-green-600":"text-red-600"),children:[ae,ae===S&&!Ae&&Ie>0&&(0,k.jsxs)("span",{className:"block text-sm text-red-500 mt-1",children:["Zkus\xedme to znovu za ",Ie," s."]})]})}),n&&!$&&!tt&&(0,k.jsx)(N.A,{storageKey:"mb_seen_anonymity_alert",title:"Hlasuje\u0161 anonymn\u011b",children:(0,k.jsx)("p",{children:"Jsi p\u0159ihl\xe1\u0161en/a, ale tv\u016fj hlas je i tak 100% anonymn\xed \u2013 nijak se nepoj\xed s tv\xfdm \xfa\u010dtem a nikdo (ani my) ho nedok\xe1\u017ee dohledat zp\u011bt k tob\u011b."})},e),nt&&(0,k.jsxs)("div",{className:"space-y-6",children:[!Qe&&lt,(0,k.jsxs)("div",{className:"text-center mb-8",children:[(0,k.jsx)("h2",{className:"text-dark mb-2",children:"V\xfdsledky"}),(0,k.jsxs)("p",{className:"text-text-light font-body text-lg",children:["Celkem hlas\u016f: ",(0,k.jsx)("span",{className:"font-bold text-primary",children:q})]}),W&&(0,k.jsx)("p",{className:"text-red-600 font-body text-sm mt-1",children:"Po\u010dty hlas\u016f se te\u010f nepoda\u0159ilo na\u010d\xedst. Zkus pros\xedm obnovit str\xe1nku."})]}),(0,k.jsx)("div",{className:"sticky top-20 z-30 -mx-4 px-4 pt-4 pb-6 bg-cream/85 backdrop-blur-md",style:{WebkitMaskImage:"linear-gradient(to bottom, black 65%, transparent 100%)",maskImage:"linear-gradient(to bottom, black 65%, transparent 100%)"},children:(0,k.jsx)("h3",{className:"text-dark text-center font-display font-bold text-base md:text-lg truncate",children:y.question})}),(0,k.jsx)("div",{className:"flex flex-col gap-4",children:at.slice().sort((e,t)=>
1t.votes-e.votes).map(e=>{const t=Ge(e.votes),n=e.index===K;return(0,k.jsxs)("div",{className:"card-poll p-4 flex items-center gap-5 ".concat(n?"card-poll--mine":""),children:[st&&("#"!==O(e.image)?(0,k.jsx)("img",{src:O(e.image),alt:e.name,className:"w-20 h-20 sm:w-24 sm:h-24 flex-shrink-0 object-cover rounded-lg"}):(0,k.jsx)("div",{className:"w-20 h-20 sm:w-24 sm:h-24 flex-shrink-0 rounded-lg bg-light-gray flex items-center justify-center",children:(0,k.jsx)("svg",{className:"w-8 h-8 text-medium-gray",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,k.jsx)("path",{d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})})),(0,k.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,k.jsxs)("h3",{className:"text-lg font-display font-bold text-dark mb-2 flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,k.jsx)("span",{className:"break-words",children:e.name}),n&&(0,k.jsxs)("span",{className:"inline-flex items-center gap-1 flex-shrink-0 whitespace-nowrap text-xs font-display font-semibold text-primary",children:[(0,k.jsx)("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,k.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Tvoje volba"]})]}),(0,k.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,k.jsxs)("span",{className:"text-xl font-display font-bold text-primary",children:[t,"%"]}),(0,k.jsxs)("span",{className:"text-text-light font-body text-sm",children:[e.votes," hlas\u016f"]})]}),(0,k.jsx)("div",{className:"progress-bar",children:(0,k.jsx)("div",{className:"progress-bar-fill",style:{width:"".concat(t,"%")}})})]})]},e.index)})}),Qe&&(0,k.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-2",children:[(0,k.jsx)(o.N_,{to:"/my-polls/".concat(y.id,"/edit"),className:"btn btn-secondary py-2 px-3 sm:px-4 text-sm",children:"Upravit"}),(0,k.jsx)("button",{onClick:()=>Me(!0),className:"btn btn-danger-outline py-2 px-3 sm:px-4 text-sm",children:"Smazat"})]}),Qe&&lt,_e&&(0,k.jsx)(E.A,{poll:_e}),(0,k.jsx)("div",{style:{position:"fixed",left:"-9999px",top:0,pointerEvents:"none",zIndex:-1},children:(0,k.jsx)(d.X,{ref:p,value:Ke,size:300,fgColor:"#0D0D1A",bgColor:"#FFFFFF",level:"H"})})]}),$&&!nt&&(0,k.jsxs)("div",{className:"card text-center",children:[(0,k.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-accent bg-opacity-20 rounded-full flex items-center justify-center",children:(0,k.jsx)("svg",{className:"w-8 h-8 text-accent",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,k.jsx)("path",{d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),(0,k.jsx)("h2",{className:"text-dark mb-4",children:"Tv\u016fj hlas byl zaznamen\xe1n"}),(0,k.jsx)("p",{className:"text-text-light font-body text-lg",children:"V\xfdsledky t\xe9to ankety jsou soukrom\xe9 a viditeln\xe9 pouze pro autora."})]}),!Qe&&(0,k.jsx)("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-3 gap-y-2",children:(0,k.jsx)(w,{pollId:e})}),!n&&$&&!ve&&(0,k.jsxs)("div",{className:"relative mt-8 bg-dark rounded-2xl p-6 text-center",children:[(0,k.jsx)("button",{onClick:()=>{R(e),be(!0)},className:"absolute top-3 right-3 text-white/40 hover:text-white/80 text-lg leading-none",children:"\u2715"}),(0,k.jsx)("p",{className:"font-display font-bold text-white text-lg mb-4",children:"Zjisti, co si mysl\xed tv\xe1 bublina!"}),(0,k.jsxs)("div",{className:"max-w-xs mx-auto",children:[(0,k.jsx)(o.N_,{to:"/register",onClick:()=>{(0,x.m4)(e),R(e),be(!0)},className:"btn btn-primary text-sm py-2 w-full text-center block",children:"Vytvo\u0159it profil"}),(0,k.jsx)("p",{className:"text-white/60 text-xs text-center mt-2",children:"* trv\xe1 m\xe9n\u011b ne\u017e minutu"}),(0,k.jsx)(o.N_,{to:"/login",onClick:()=>{(0,x.ax)(e),R(e),be(!0)},className:"text-white/60 hover:text-white/90 text-xs text-center mt-2 block underline",children:"U\u017e m\xe1\u0161 \xfa\u010det? P\u0159ihl\xe1sit se"})]})]})]})}),je&&(0,k.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(26,26,46,0.7)"},children:(0,k.jsxs)("div",{className:"relative max-w-lg w-full",children:[ke&&(0,k.jsx)("button",{onClick:()=>ge(null),className:"absolute -top-3 -right-3 z-10 w-8 h-8 bg-white rounded-full shadow-lg flex items-center justify-center text-dark hover:text-primary transition-colors",children:(0,k.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,k.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,k.jsxs)("a",{href:O(je.link_url),target:"_blank",rel:"noopener noreferrer",onClick:()=>{(0,u.c)(je.id),ge(null)},className:"relative block rounded-2xl shadow-2xl overflow-hidden",style:je.aspect_ratio?{aspectRatio:je.aspect_ratio.replace(":"," / ")}:void 0,children:[(0,k.jsx)("span",{className:"absolute top-3 left-3 z-10 bg-white/90 text-dark text-xs font-display font-semibold px-3 py-1 rounded-full shadow",children:"Sponzorov\xe1no"}),(0,k.jsx)("img",{src:O(je.image_url),alt:"reklama",className:"w-full block ".concat(je.aspect_ratio?"h-full object-cover":"")})]})]})}),pe>0&&(0,k.jsx)(N.A,{storageKey:"mb_seen_stories_link_alert",title:"Odkaz je zkop\xedrovan\xfd",children:(0,k.jsx)("p",{children:"Instagram do Stories s\xe1m odkaz nep\u0159id\xe1 \u2013 proto jsme ti ho zkop\xedrovali do schr\xe1nky. Ve Stories editoru ho sta\u010d\xed vlo\u017eit jako link sticker, aby se na anketu mohli sleduj\xedc\xed rovnou proklikat."})},pe),(0,k.jsxs)(g.A,{isOpen:Ee,onClose:()=>De(!1),title:"Sd\xedlet anketu",children:[(0,k.jsxs)("div",{children:[(0,k.jsx)("p",{className:"text-text-light font-body text-sm mb-4",children:"Sd\xedlej odkaz na hlasov\xe1n\xed \u2013 p\u0159\xedjemci se dostanou p\u0159\xedmo na anketu jedn\xedm kliknut\xedm."}),(0,k.jsxs)("div",{className:"modal-actions grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,k.jsxs)("button",{onClick:()=>{window.open("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(Ke)),"_blank","width=600,height=400")},className:"btn btn-secondary flex items-center justify-center gap-2",children:[(0,k.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,k.jsx)("path",{d:"M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.236 2.686.236v2.97h-1.513c-1.491 0-1.956.93-1.956 1.883v2.258h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z"})}),"Facebook"]}),(0,k.jsxs)("button",{onClick:()=>{const e=null!==y&&void 0!==y&&y.question?"\ud83d\uddf3\ufe0f ".concat(y.question,"\n\nHlasujte na MojeBublina:"):"Hlasujte v m\xe9 anket\u011b na MojeBublina!";window.open("https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(Ke),"&text=").concat(encodeURIComponent(e)),"_blank","width=600,height=400")},className:"btn btn-secondary flex items-center justify-center gap-2",children:[(0,k.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:(0,k.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X (Twitter)"]}),(0,k.jsx)("button",{onClick:async()=>{he(!0);try{const t=null!==y&&void 0!==y&&y.question?"\ud83d\uddf3\ufe0f ".concat(y.question,"\n\nHlasujte na MojeBublina:"):"Hlasujte v m\xe9 anket\u011b na MojeBublina!";if(await navigator.clipboard.writeText(Ke),fe(e=>e+1),navigator.canShare){const n=await(0,m.$)("invite",{poll:y,qrCanvas:p.current}),a=await new Promise(e=>n.toBlob(e)),s=new File([a],"anketa-".concat(e,"-pozvanka.png"),{type:"image/png"});if(navigator.canShare({files:[s]}))return void await navigator.share({files:[s],title:(null===y||void 0===y?void 0:y.question)||"Anketa"});if(navigator.canShare({url:Ke}))return void await navigator.share({title:(null===y||void 0===y?void 0:y.question)||"Anketa",text:t,url:Ke})}}catch(t){"AbortError"!==t.name&&(await navigator.clipboard.writeText(Ke),h("Odkaz zkop\xedrov\xe1n \u2013 vlo\u017ete ho do Stories"))}finally{he(!1)}},disabled:xe,className:"btn btn-secondary flex items-center justify-center gap-2",children:xe?(0,k.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,k.jsx)("div",{className:"loading-spinner w-4 h-4 border-2"}),(0,k.jsx)("span",{children:"P\u0159ipravuji..."})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:(0,k.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})}),"Instagram"]})}),(0,k.jsxs)("button",{onClick:$e,className:"btn btn-secondary flex items-center justify-center gap-2",children:[(0,k.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,k.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Zkop\xedrovat odkaz"]})]})]}),et&&(0,k.jsxs)("div",{className:"pt-6 border-t-2 border-light-gray mt-6",children:[(0,k.jsx)("h3",{className:"text-dark font-display font-bold text-lg mb-3",children:"Odkaz do koment\xe1\u0159e"}),(0,k.jsx)("p",{className:"text-text-light font-body text-sm mb-3",children:"Pro vkl\xe1d\xe1n\xed pod ciz\xed p\u0159\xedsp\u011bvky \u2013 n\xe1hled z\u016fstane stejn\xfd jako v\xfd\u0161e, nav\xedc jde otev\u0159en\xed sledovat zvl\xe1\u0161\u0165."}),(0,k.jsxs)("div",{className:"modal-actions grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,k.jsx)("button",{onClick:()=>Ye("fb-comment"),className:"btn btn-secondary text-sm",children:"Zkop\xedrovat pro FB koment\xe1\u0159"}),(0,k.jsx)("button",{onClick:()=>Ye("x-comment"),className:"btn btn-secondary text-sm",children:"Zkop\xedrovat pro X koment\xe1\u0159"})]})]}),(0,k.jsxs)("div",{className:"pt-6 border-t-2 border-light-gray mt-6",children:[(0,k.jsx)("h3",{className:"text-dark font-display font-bold text-lg mb-3",children:"Sd\xedlet v\xfdsledky jako obr\xe1zek"}),(0,k.jsxs)("div",{className:"modal-actions flex flex-col gap-3",children:[(0,k.jsx)("button",{onClick:()=>Xe("twitter",re,"anketa-".concat(e,"-twitter.png")),disabled:ie,className:"btn btn-accent",children:ie?(0,k.jsxs)("div",{className:"flex items-center justify-center",children:[(0,k.jsx)("div",{className:"loading-spinner w-5 h-5 border-2"}),(0,k.jsx)("span",{className:"ml-2",children:"Generuji..."})]}):"St\xe1hnout pro Twitter / FB"}),(0,k.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(Ke),h("Pokud chce\u0161, aby se sleduj\xedc\xed do ankety i proklikli, vlo\u017e do story p\u0159\xedsp\u011bvku odkaz, kter\xfd m\xe1\u0161 zkop\xedrovan\xfd ve schr\xe1nce","info",6e3),Xe("stories",de,"anketa-".concat(e,"-stories.png"))},disabled:ce,className:"btn btn-accent",children:ce?(0,k.jsxs)("div",{className:"flex items-center justify-center",children:[(0,k.jsx)("div",{className:"loading-spinner w-5 h-5 border-2"}),(0,k.jsx)("span",{className:"ml-2",children:"Generuji..."})]}):"St\xe1hnout pro Stories (IG, FB, YT)"}),(0,k.jsx)("button",{onClick:()=>Xe("feed",ue,"anketa-".concat(e,"-ig-feed.png")),disabled:me,className:"btn btn-accent",children:me?(0,k.jsxs)("div",{className:"flex items-center justify-center",children:[(0,k.jsx)("div",{className:"loading-spinner w-5 h-5 border-2"}),(0,k.jsx)("span",{className:"ml-2",children:"Generuji..."})]}):"St\xe1hnout pro IG Feed"})]})]})]}),(0,k.jsx)(z,{isOpen:Te,title:"Smazat anketu?",message:"Tato akce je nevratn\xe1. Anketa \u201e".concat(y.question,'" a v\u
10161echny jej\xed hlasy budou trvale smaz\xe1ny.'),confirmLabel:"Trvale smazat",loading:Oe,onConfirm:async()=>{He(!0);try{const{data:{session:n}}=await i.N.auth.getSession();if(null===n||void 0===n||!n.access_token)return void(0,j.j)(t,h);const a=await fetch("/.netlify/functions/delete-poll",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n.access_token)},body:JSON.stringify({pollId:e})}),s=await a.json().catch(()=>({}));if(!a.ok)throw new Error(s.error||"Smaz\xe1n\xed ankety se nezda\u0159ilo");h("Anketa byla smaz\xe1na."),t("/my-polls")}catch(n){h(n.message||"Smaz\xe1n\xed ankety se nezda\u0159ilo","error"),He(!1)}},onCancel:()=>Me(!1)})]})}}}]);

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.