Files
MyClub/frontend/build/static/js/main.8c4bb3a7.js
T
Tomas Dvorak 823fabee02 de day #74
2025-10-28 22:38:27 +01:00

2 lines
1.2 MiB
Plaintext

"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[792],{857:(e,t,n)=>{var a=n(5043),i=n(4391),o=(n(5884),n(9576),n(3309)),r=n(359),s=n(9043),l=n(9781),c=n(3216),d=n(5475),h=n(9379),u=n(1860),m=n(6291),p=n(579);const x=(0,a.createContext)(void 0),g=e=>{let{children:t}=e;const[n,i]=(0,a.useState)(null),[o,r]=(0,a.useState)(!1),[s,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{const e=await(0,u.Ec)();d(e);const t=(0,u.gf)();if(t&&(0,u.wR)())try{const n=m.API_URL,a=await fetch("".concat(n,"/auth/me"),{credentials:"include",headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const o=await a.json(),s=o.user||o;if(i(s),r(!0),!e&&!s.role){if((await fetch("".concat(n,"/auth/make-admin"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}})).ok){const e=(0,h.A)((0,h.A)({},s),{},{role:"admin"});i(e),d(!0)}}}else(0,u.L)()}catch(n){console.error("Error initializing auth:",n),(0,u.L)()}l(!1)})()},[]);return(0,p.jsx)(x.Provider,{value:{isAuthenticated:o,user:n,isLoading:s,adminExists:c,login:async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if((0,u.WG)(e,n),"admin"===t.role)d(!0);else if(!c&&!t.role)try{const n=m.API_URL;(await fetch("".concat(n,"/auth/make-admin"),{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})).ok&&(t.role="admin",d(!0))}catch(a){console.error("Error making user admin:",a)}i(t),r(!0)},logout:()=>{try{m.Ay.post("/auth/logout").catch(()=>{})}catch(e){}(0,u.L)(),i(null),r(!1)},updateUser:e=>{n&&i((0,h.A)((0,h.A)({},n),e))}},children:t})},v=()=>{const e=(0,a.useContext)(x);if(void 0===e)throw new Error("useAuth must be used within an AuthProvider");return e};var j=n(502),b=n(4093),y=n(2107),f=n(8659),k=n(3572),z=n(8846),w=n(202),_=n(3225),S=n(6668),C=n(5699),A=n(5973),E=n(9244),T=n(8662),N=n(4946);const R=async()=>(await m.Ay.get("/settings")).data,P=async()=>(await m.Ay.get("/admin/settings")).data,I=async e=>(await m.Ay.put("/admin/settings",e)).data;function W(e){if(e)try{if(/^(?:https?:)?\/\//i.test(e)||/^data:/i.test(e))return e;if(e.startsWith("/uploads")||e.startsWith("/dist")){const t="http://127.0.0.1:8080";if(t&&!t.startsWith("/")){const n=new URL(t,"undefined"!==typeof window?window.location.origin:void 0);return n.pathname="/",new URL(e,n).toString()}return e}return e}catch(t){return e||void 0}}function M(e){if(!e)return"";let t=e.trim();return t=t.replace(/^T\u011blov\xfdchovn\xe1 jednota\s+/i,"TJ "),t=t.replace(/^Sportovn\xed klub\s+/i,"SK "),t=t.replace(/^Fotbalov\xfd klub\s+/i,"FK "),t=t.replace(/^Fotbal klub\s+/i,"FK "),t=t.replace(/^Sokol\s+/i,"SK "),t=t.replace(/,\s*(spolek|z\.\s*s\.|o\.\s*s\.|z\s*s|o\s*s|spolkov\xe1\s+organizace|spolek\s+registrovan\xfd|z\.s\.|o\.s\.)$/i,""),t.trim()}const D=()=>{var e,t;const{isAuthenticated:n,adminExists:i,login:o}=v(),[r,s]=(0,a.useState)(""),[l,d]=(0,a.useState)(""),[h,u]=(0,a.useState)(!1),[x,g]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!0),[M,D]=(0,a.useState)(null),U=(0,c.Zp)(),L=(0,c.zy)(),F=(0,j.d)(),O=(0,b.dU)("white","gray.800");if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await R();e&&D(t)}catch(t){}})(),()=>{e=!1}},[]),n)return(0,p.jsx)(c.C5,{to:"/admin",replace:!0});null===(e=L.state)||void 0===e||null===(t=e.from)||void 0===t||t.pathname;return(0,p.jsx)(y.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.50",children:(0,p.jsxs)(y.a,{w:"100%",maxW:"md",p:8,bg:O,borderRadius:"lg",boxShadow:"lg",children:[(0,p.jsx)(f.o,{mb:4,children:null!==M&&void 0!==M&&M.club_logo_url?(0,p.jsx)(k._,{src:W(M.club_logo_url)||M.club_logo_url,alt:M.club_name||"Club logo",maxH:"64px",objectFit:"contain"}):(0,p.jsx)(z.D,{size:"md",children:"P\u0159ihl\xe1\u0161en\xed"})}),(0,p.jsxs)(w.T,{as:"form",onSubmit:async e=>{e.preventDefault(),g(!0);try{const e=await m.Ay.post("/auth/login",{email:r,password:l}),{token:t,user:n}=e.data;o(t,n,P),F({title:"P\u0159ihl\xe1\u0161en\xed prob\u011bhlo \xfasp\u011b\u0161n\u011b",status:"success",duration:3e3,isClosable:!0});const a=String((null===n||void 0===n?void 0:n.role)||"").toLowerCase();U("admin"===a||"editor"===a?"/admin":"/",{replace:!0})}catch(s){var t,n,a,i;F({title:"P\u0159ihl\xe1\u0161en\xed selhalo",description:(null===(t=s.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Neplatn\xfd e-mail nebo heslo",status:"error",duration:5e3,isClosable:!0})}finally{g(!1)}},spacing:4,align:"stretch",children:[(0,p.jsxs)(_.MJ,{id:"login-email",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"E-mailov\xe1 adresa"}),(0,p.jsx)(C.p,{type:"email",value:r,onChange:e=>s(e.target.value),placeholder:"Zadejte sv\u016fj e-mail"})]}),(0,p.jsxs)(_.MJ,{id:"login-password",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Heslo"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{type:h?"text":"password",value:l,onChange:e=>d(e.target.value),placeholder:"Zadejte sv\xe9 heslo"}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>u(e=>!e),children:h?"Skr\xfdt":"Zobrazit"})})]})]}),(0,p.jsx)(N.S,{isChecked:P,onChange:e=>I(e.target.checked),children:"Zapamatovat p\u0159ihl\xe1\u0161en\xed"}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",isLoading:x,loadingText:"P\u0159ihla\u0161uji...",mt:4,children:"P\u0159ihl\xe1sit se"}),(0,p.jsx)(y.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",children:(0,p.jsx)(T.$,{variant:"link",colorScheme:"blue",onClick:()=>U("/forgot-password?admin=1"),children:"Zapomn\u011bli jste heslo?"})})]})]})})};var U=n(9081),L=n(7189);const F=()=>{var e,t;const[n,i]=(0,a.useState)(""),[o,r]=(0,a.useState)(""),[s,l]=(0,a.useState)(""),[d,h]=(0,a.useState)(!1),{login:u}=v(),x=(0,c.Zp)(),g=(0,c.zy)(),b=(0,j.d)(),f=(null===(e=g.state)||void 0===e||null===(t=e.from)||void 0===t?void 0:t.pathname)||"/";return(0,p.jsx)(y.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(y.a,{w:"100%",maxW:"md",p:8,borderWidth:1,borderRadius:8,boxShadow:"lg",children:(0,p.jsxs)(w.T,{as:"form",onSubmit:async e=>{e.preventDefault(),h(!0);try{const e=await m.Ay.post("/auth/register",{email:o,password:s,name:n}),{token:t,user:a}=e.data;await u(t,a,!0),b({title:"\xda\u010det vytvo\u0159en",status:"success",duration:3e3}),x(f,{replace:!0})}catch(i){var t,a;b({title:"Registrace selhala",description:(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message)||"Zkuste to znovu.",status:"error",duration:5e3,isClosable:!0})}finally{h(!1)}},spacing:4,align:"stretch",children:[(0,p.jsx)(z.D,{as:"h2",size:"lg",textAlign:"center",mb:2,children:"Vytvo\u0159it \xfa\u010det"}),(0,p.jsxs)(_.MJ,{id:"name",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Jm\xe9no a p\u0159\xedjmen\xed"}),(0,p.jsx)(C.p,{value:n,onChange:e=>i(e.target.value),placeholder:"nap\u0159. Jan Nov\xe1k"})]}),(0,p.jsxs)(_.MJ,{id:"email",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"E\u2011mail"}),(0,p.jsx)(C.p,{type:"email",value:o,onChange:e=>r(e.target.value),placeholder:"nap\u0159. jan@klub.cz"})]}),(0,p.jsxs)(_.MJ,{id:"password",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Heslo"}),(0,p.jsx)(C.p,{type:"password",value:s,onChange:e=>l(e.target.value),placeholder:"Zadejte heslo (min. 8 znak\u016f)"})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",width:"full",mt:2,isLoading:d,children:"Zaregistrovat se"}),(0,p.jsxs)(U.E,{fontSize:"sm",textAlign:"center",children:["U\u017e m\xe1te \xfa\u010det?"," ",(0,p.jsx)(L.N,{color:"blue.500",href:"/login",children:"P\u0159ihlaste se"})]})]})})})};var O=n(45),Z=n(8939),K=n(2703),q=n(1009),V=n(3935),H=n(1054),$=n(9542),B=n(5929),J=n(5071),Y=n(7516),G=n(2459),X=n(6870),Q=n(5371),ee=n(6148),te=n(9956),ne=n(9883),ae=n(6236),ie=n(7024),oe=n(1872),re=n(3560),se=n(8460),le=n(5421),ce=n(2342),de=n(9973),he=n(3710),ue=n(7813),me=n(5874),pe=n(5369),xe=n(2526);const ge=()=>(0,xe.I)({queryKey:["public-settings"],queryFn:R,staleTime:6e5,cacheTime:18e5,refetchOnWindowFocus:!1,refetchOnMount:!1});var ve=n(9722);const je=new Map,be=ve.A.create({baseURL:"/api/v1/facr",timeout:parseInt("5000 # 5 seconds",10),headers:{"Content-Type":"application/json",Accept:"application/json"}}),ye=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_API_BASE_URL||"/api/v1";if("undefined"===typeof window)return e;const n=t?new URL(t,window.location.origin).origin:window.location.origin;return new URL(e,n).toString()}return e}catch(t){return e}};let fe=null;const ke=async()=>{const e=Date.now();if(fe&&e-fe.ts<6e4)return fe.data||{};try{const n=await fetch(ye("/api/v1/public/team-logo-overrides?t=".concat(e)),{cache:"no-cache"});if(n.ok){var t;const a=await n.json(),i=JSON.stringify((null===(t=fe)||void 0===t?void 0:t.data)||{}),o=JSON.stringify(a||{});return fe={data:a,ts:e},i!==o&&je.clear(),a||{}}}catch(a){}try{const t=await fetch(ye("/cache/prefetch/team_logo_overrides.json"),{cache:"no-cache"});if(t.ok){var n;const a=await t.json(),i=JSON.stringify((null===(n=fe)||void 0===n?void 0:n.data)||{}),o=JSON.stringify(a||{});return fe={data:a,ts:e},i!==o&&je.clear(),a||{}}}catch(i){}return fe={data:{by_name:{}},ts:e},{by_name:{}}},ze=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),we=e=>{let t=ze(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()};be.interceptors.request.use(e=>{var t;if("get"!==(null===(t=e.method)||void 0===t?void 0:t.toLowerCase()))return e;const n="".concat(e.method,":").concat(e.url,":").concat(JSON.stringify(e.params)),a=je.get(n),i=Date.now(),o=parseInt("3600000 # 1 hour in milliseconds",10);return a&&i-a.timestamp<o?(0,h.A)((0,h.A)({},e),{},{adapter:()=>Promise.resolve({data:a.data,status:200,statusText:"OK",headers:{},config:e})}):e},e=>Promise.reject(e)),be.interceptors.response.use(e=>{var t;const n=null===(t=e.config.method)||void 0===t?void 0:t.toLowerCase(),a=e.config.url,i=e.config.params;if("get"===n){const t="".concat(n,":").concat(a,":").concat(JSON.stringify(i));je.set(t,{data:e.data,timestamp:Date.now()})}return e},e=>(console.error("API Error:",e),Promise.reject(e)));const _e=e=>{if(e.response){const t=e.response.data||{},n=t.message||"API request failed";throw console.error("API Error Response:",t),new Error(n)}throw e.request?(console.error("API Error: No response received",e.request),new Error("No response from server. Please check if the FACR scraper API is running.")):(console.error("API Error:",e.message),new Error("API request failed: ".concat(e.message)))},Se={searchClubs:async e=>{try{return(await be.get("/club/search",{params:{q:e}})).data}catch(t){return _e(t)}},getClub:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{const n=await be.get("/club/".concat(t,"/").concat(e)),a=await ke(),i=((e,t)=>{var n;if(null===e||void 0===e||null===(n=e.competitions)||void 0===n||!n.length)return e;const a=(null===t||void 0===t?void 0:t.by_name)||{},i=(null===t||void 0===t?void 0:t.by_id)||{},o=Object.keys(a||{}).reduce((e,t)=>(e[ze(t)]=a[t],e),{}),r=Object.keys(a||{}).map(e=>({key:we(e),url:a[e]})),s=(e,t,n)=>{var s;if(e&&null!==(s=i[e])&&void 0!==s&&s.logo_url){const t=i[e].logo_url;return"string"===typeof t&&t.startsWith("/")?ye(t):t}if(!t)return n;const l=(a||{})[t],c=ze(t);let d=l||o[c];if(!d){const e=we(t);for(const{key:t,url:n}of r)if(t&&(e.endsWith(t)||t.endsWith(e))){d=n;break}}const h=d||n;return"string"===typeof h&&h.startsWith("/")?ye(h):h},l=(e,t)=>{var n;const a=e&&null!==(n=i[e])&&void 0!==n&&n.name?i[e].name:void 0;return a&&a.trim().length>0?a:t};return e.competitions=(e.competitions||[]).map(e=>(0,h.A)((0,h.A)({},e),{},{matches:(e.matches||[]).map(e=>(0,h.A)((0,h.A)({},e),{},{home:l(e.home_id,e.home),away:l(e.away_id,e.away),home_logo_url:s(e.home_id,e.home,e.home_logo_url),away_logo_url:s(e.away_id,e.away,e.away_logo_url)}))})),e})(n.data,a);return i}catch(n){return _e(n)}},getClubTable:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{const n=(await be.get("/club/".concat(t,"/").concat(e,"/table"))).data,a=await ke(),i=(null===a||void 0===a?void 0:a.by_name)||{},o=(null===a||void 0===a?void 0:a.by_id)||{},r=Object.keys(i||{}).reduce((e,t)=>(e[ze(t)]=i[t],e),{}),s=Object.keys(i||{}).map(e=>({key:we(e),url:i[e]})),l=(e,t,n)=>{var a;if(e&&null!==(a=o[e])&&void 0!==a&&a.logo_url){const t=o[e].logo_url;return"string"===typeof t&&t.startsWith("/")?ye(t):t}if(!t)return n;const l=(i||{})[t],c=ze(t);let d=l||r[c];if(!d){const e=we(t);for(const{key:t,url:n}of s)if(t&&(e.endsWith(t)||t.endsWith(e))){d=n;break}}const h=d||n;return"string"===typeof h&&h.startsWith("/")?ye(h):h},c=(e,t)=>{var n;const a=e&&null!==(n=o[e])&&void 0!==n&&n.name?o[e].name:void 0;return a&&a.trim().length>0?a:t};return Array.isArray(null===n||void 0===n?void 0:n.competitions)&&(n.competitions=n.competitions.map(e=>{var t;return(0,h.A)((0,h.A)({},e),{},{table:{overall:((null===(t=e.table)||void 0===t?void 0:t.overall)||[]).map(e=>(0,h.A)((0,h.A)({},e),{},{team:c(e.team_id,e.team),team_logo_url:l(e.team_id,e.team,e.team_logo_url)}))}})})),n}catch(n){return _e(n)}},clearCache:()=>{je.clear()},getClubCompetitions:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{return(await Se.getClub(e,t)).competitions||[]}catch(n){return _e(n)}},getCompetitionMatches:async e=>{try{var t;const[n,a]=e.split("/"),i=null===(t=(await be.get("/club/".concat(n,"/").concat(a))).data.competitions)||void 0===t?void 0:t.find(t=>t.id===e);return(null===i||void 0===i?void 0:i.matches)||[]}catch(n){return _e(n)}}},Ce=Se;async function Ae(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return new Promise((n,a)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{try{const e=document.createElement("canvas"),a=e.getContext("2d");if(!a)return n([]);const o=160,r=Math.max(1,Math.round(i.height/i.width*o));e.width=o,e.height=r,a.drawImage(i,0,0,o,r);const{data:s}=a.getImageData(0,0,o,r),l={};for(let t=0;t<s.length;t+=4){const e=s[t],n=s[t+1],a=s[t+2];if(s[t+3]<200)continue;const i=16,o=Math.round(e/i)*i,r=Math.round(n/i)*i,c=Math.round(a/i)*i,d="".concat(o,",").concat(r,",").concat(c);l[d]=(l[d]||0)+1}const c=Object.entries(l).sort((e,t)=>t[1]-e[1]),d=[],h=(e,t)=>Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2);for(const[t,n]of c){const[e,a,i]=t.split(",").map(Number);let o=!1;for(const t of d){const[r,s,l]=t.key.split(",").map(Number);if(h([e,a,i],[r,s,l])<24){t.count+=n,o=!0;break}}o||d.push({key:t,count:n})}d.sort((e,t)=>t.count-e.count);const u=e=>Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0"),m=d.slice(0,t).map(e=>{const[t,n,a]=e.key.split(",").map(Number);return"#".concat(u(t)).concat(u(n)).concat(u(a))});if(m.length>1){const e=[];for(const n of m){const a=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16);if(e.some(e=>{const t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return h([t,n,r],[a,i,o])<40})||e.push(n),e.length>=t)break}e.length?n(e):n(m)}else n(m)}catch(e){n([])}},i.onerror=()=>n([]);try{const t=new URL(m.API_URL).origin;let n=e||"";(n.startsWith("/uploads")||n.startsWith("/dist")||n.startsWith("/api/"))&&(n=t+n);const a=new URL(n,window.location.origin),o="data:"===a.protocol,r=a.origin===window.location.origin,s=a.origin===t;i.src=o||r||s?a.toString():"".concat(m.API_URL,"/proxy/image?url=").concat(encodeURIComponent(a.toString()))}catch(o){i.src=e}})}function Ee(e){const t=e.replace("#","");return(299*parseInt(t.substring(0,2),16)+587*parseInt(t.substring(2,4),16)+114*parseInt(t.substring(4,6),16))/1e3>=128?"#000000":"#ffffff"}function Te(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ne(e){const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),a=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return.2126*Te(n)+.7152*Te(a)+.0722*Te(i)}function Re(e,t){try{const n=Ne(e),a=Ne(t),i=Math.max(n,a);return(i+.05)/(Math.min(n,a)+.05)}catch(n){return 1}}function Pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AA";return Re(e,t)>=("AAA"===n?7:4.5)}function Ie(){const e=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:48);window.crypto.getRandomValues(e);return btoa(String.fromCharCode(...Array.from(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function We(e){const t=e.replace("#","");return{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16)}}function Me(e,t,n){const a=e=>Math.round(255*function(e){return Math.min(1,Math.max(0,e))}(e)).toString(16).padStart(2,"0");return"#".concat(a(e)).concat(a(t)).concat(a(n))}function De(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;const{r:n,g:a,b:i}=We(e);return Me(n/255+t,a/255+t,i/255+t)}function Ue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;const{r:n,g:a,b:i}=We(e);return Me(n/255-t,a/255-t,i/255-t)}function Le(e,t){const n=t||Ee(e);if(Pe(e,n,"AA"))return{text:n,bg:e};for(const a of[.1,.2,.3]){const t=Ue(e,a);if(Pe(t,n,"AA"))return{text:n,bg:t};const i=De(e,a);if(Pe(i,n,"AA"))return{text:n,bg:i}}return{text:"#000000"===n?"#ffffff":"#000000",bg:e}}function Fe(e){var t,n,a;const i=(e||[]).filter(Boolean),o=["#0b5cff","#ffd200","#141414","#ffffff"];function r(e){const{r:t,g:n,b:a}=We(e),i=t/255,o=n/255,r=a/255,s=Math.max(i,o,r),l=Math.min(i,o,r);let c=0,d=0,h=(s+l)/2;if(s!==l){const e=s-l;switch(d=h>.5?e/(2-s-l):e/(s+l),s){case i:c=(o-r)/e+(o<r?6:0);break;case o:c=(r-i)/e+2;break;case r:c=(i-o)/e+4}c/=6}return{h:c,s:d,l:h}}function s(e,t){if(!t||0===t.length)return o[2];let n=t[0],a=Re(e,n);for(const i of t){const t=Re(e,i);t>a&&(a=t,n=i)}return n}const l=[],c=(e,t,n,a,i)=>{const{text:o}=Le(i,"#111111"),r=Le(i,o);l.push({name:e,primary:t,secondary:n,accent:a,background:r.bg,text:r.text})},d=i.length?i:o,h=d[0]||o[0],u=d.find(e=>e.toLowerCase()!==h.toLowerCase())||o[1],m=s(h,d.slice(1))||o[2];c("Klasick\xfd",h,u,m,"#ffffff");const p=d.map(e=>({c:e,s:r(e).s}));p.sort((e,t)=>t.s-e.s);const x=(null===(t=p[0])||void 0===t?void 0:t.c)||h;c("\u017div\xfd",x,(null===(n=p[1])||void 0===n?void 0:n.c)||u,s(x,e)||m,"#ffffff");const g=(null===(a=p.slice(-1)[0])||void 0===a?void 0:a.c)||d[1]||o[1],v=d.find(e=>e!==g)||d[0]||o[1],j=s(g,d)||o[2];c("Tlumen\xfd",g,v,j,"#f8f9fb");const b=s("#0f1115",d)||m;c("Tmav\xfd",h,u,b,"#0f1115");let y=d[0]||o[2],f=-1;for(const k of d){let e=0;for(const t of d)e+=Re(k,t);e>f&&(f=e,y=k)}return c("Akcentn\xed",h,d.find(e=>e!==y)||u,y,"#ffffff"),l}const Oe="logos";let Ze=null;const Ke=()=>Ze||(Ze=new Promise((e,t)=>{const n=indexedDB.open("LogoCache",1);n.onerror=()=>t(n.error),n.onsuccess=()=>e(n.result),n.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(Oe)){const e=t.createObjectStore(Oe,{keyPath:"id"});e.createIndex("lastUsed","lastUsed",{unique:!1}),e.createIndex("source","source",{unique:!1})}}}),Ze),qe=async e=>{try{const t=await Ke(),n=t.transaction(Oe,"readonly").objectStore(Oe);return new Promise(t=>{const a=n.get(e);a.onsuccess=()=>{const e=a.result;if(!e)return void t(null);Date.now()-e.timestamp>6048e5?t(null):t(e)},a.onerror=()=>t(null)})}catch(t){return null}},Ve=async e=>{try{const t=(await Ke()).transaction(Oe,"readwrite");t.objectStore(Oe).put(e),await new Promise((e,n)=>{t.oncomplete=()=>e(),t.onerror=()=>n(t.error)})}catch(t){console.warn("Failed to cache logo:",t)}},He=async(e,t)=>{try{const t=await qe(e);if(null!==t&&void 0!==t&&t.url&&!t.url.startsWith("blob:"))return await(async e=>{try{const t=await qe(e);t&&(t.lastUsed=Date.now(),await Ve(t))}catch(t){}})(e),t.url;const n=await fetch("https://logoapi.sportcreative.eu/logos/".concat(e,"/json"),{method:"GET",headers:{Accept:"application/json"}});if(!n.ok)return null;const a=await n.json(),i=a.logo_url_svg||a.logo_url_png||a.logo_url;return i?(await Ve({id:e,url:i,timestamp:Date.now(),source:"logoapi",lastUsed:Date.now()}),i):null}catch(n){return console.warn("Failed to fetch logo for team ".concat(e,":"),n),null}},$e=async e=>{if(!e.length)return{};try{const t={};return await Promise.all(e.map(async e=>{const n=await He(e);n&&(t[e]=n)})),t}catch(t){return console.error("Error in batchFetchLogosFromSportLogosAPI (logoapi.sportcreative.eu):",t),{}}},Be={primary:"#0b5cff",secondary:"#ffd200",accent:"#141414",textOnPrimary:"#ffffff"},Je=(0,a.createContext)(Be),Ye=()=>(0,a.useContext)(Je),Ge=e=>{let{children:t}=e;const{data:n}=ge(),i=null===n||void 0===n?void 0:n.club_id,o=(null===n||void 0===n?void 0:n.club_type)||"football",[r,s]=(0,a.useState)(Be),l=(0,a.useMemo)(()=>{if(!n)return null;return JSON.stringify({primary_color:n.primary_color,secondary_color:n.secondary_color,accent_color:n.accent_color,text_color:n.text_color,background_color:n.background_color,club_logo_url:n.club_logo_url,club_id:n.club_id,club_type:n.club_type,club_name:n.club_name})},[n]);(0,a.useEffect)(()=>{if(!l)return;let e=!0;return(async()=>{try{const d=null!==n&&void 0!==n&&n.primary_color&&""!==n.primary_color.trim()?n.primary_color:void 0,h=null!==n&&void 0!==n&&n.secondary_color&&""!==n.secondary_color.trim()?n.secondary_color:void 0,u=null!==n&&void 0!==n&&n.accent_color&&""!==n.accent_color.trim()?n.accent_color:void 0,m=null!==n&&void 0!==n&&n.text_color&&""!==n.text_color.trim()?n.text_color:void 0,p=null===n||void 0===n?void 0:n.club_logo_url,x=null===n||void 0===n?void 0:n.club_name,g=null!==n&&void 0!==n&&n.background_color&&""!==n.background_color.trim()?n.background_color:void 0;let v,j,b=d,y=h,f=u,k=m,z=p,w=x,_=g,S=m;if(!b||!y||!f||!z||!w){if((!z||!w)&&i)try{const e=await Se.getClub(i,o);z=z||e.logo_url,w=w||e.name}catch(t){}let e=[];try{e=z?await Ae(z,5):[]}catch(a){e=[]}b=b||e[0]||Be.primary,y=y||e[1]||Be.secondary,f=f||e.find(e=>"#ffffff"===Ee(e))||"#1a1a1a"}if(k=k||Ee(b),v=Ee(y),j=Ee(f),_=_||"#ffffff",S=S||Ee(_),Pe(b,k)||(k=Ee(b)),Pe(y,v)||(v=Ee(y)),Pe(f,j)||(j=Ee(f)),!p&&i)try{const e=await He(String(i));e&&(z=e)}catch(l){}const C={primary:b,secondary:y,accent:f,textOnPrimary:k,textOnSecondary:v,textOnAccent:j,background:_,text:S,logoUrl:z,name:w};if(e&&(r.primary!==C.primary||r.secondary!==C.secondary||r.accent!==C.accent||r.textOnPrimary!==C.textOnPrimary||r.logoUrl!==C.logoUrl||r.name!==C.name)){s(C);const e=document.documentElement;e.style.setProperty("--club-primary",C.primary),e.style.setProperty("--club-secondary",C.secondary),e.style.setProperty("--club-accent",C.accent),e.style.setProperty("--club-text-on-primary",C.textOnPrimary),C.textOnSecondary&&e.style.setProperty("--club-text-on-secondary",C.textOnSecondary),C.textOnAccent&&e.style.setProperty("--club-text-on-accent",C.textOnAccent),e.style.setProperty("--club-bg-light",_),e.style.setProperty("--club-text-light",S);try{localStorage.setItem("club_theme_cache",JSON.stringify({primary:C.primary,secondary:C.secondary,accent:C.accent,textOnPrimary:C.textOnPrimary,textOnSecondary:C.textOnSecondary,textOnAccent:C.textOnAccent,background:_,text:S,timestamp:Date.now()}))}catch(c){}}}catch(d){console.warn("ClubTheme: Error updating theme:",d)}})(),()=>{e=!1}},[l]);const c=(0,a.useMemo)(()=>r,[r]);return(0,p.jsx)(Je.Provider,{value:c,children:t})};function Xe(e){var t,n,a,i,o,r,s,l,c,d,h,u,m,p,x,g,v,j,b,y,f,k,z,w,_,S,C;if(!e)return e;const A=null!==(t=e.id)&&void 0!==t?t:e.ID;return{id:"string"===typeof A?Number(A):A,first_name:null!==(n=null!==(a=e.first_name)&&void 0!==a?a:e.FirstName)&&void 0!==n?n:"",last_name:null!==(i=null!==(o=e.last_name)&&void 0!==o?o:e.LastName)&&void 0!==i?i:"",position:null!==(r=null!==(s=e.position)&&void 0!==s?s:e.Position)&&void 0!==r?r:void 0,jersey_number:null!==(l=null!==(c=e.jersey_number)&&void 0!==c?c:e.JerseyNumber)&&void 0!==l?l:void 0,image_url:null!==(d=null!==(h=e.image_url)&&void 0!==h?h:e.ImageURL)&&void 0!==d?d:void 0,is_active:Boolean(null===(u=null!==(m=e.is_active)&&void 0!==m?m:e.IsActive)||void 0===u||u),nationality:null!==(p=null!==(x=e.nationality)&&void 0!==x?x:e.Nationality)&&void 0!==p?p:void 0,date_of_birth:null!==(g=null!==(v=e.date_of_birth)&&void 0!==v?v:e.DateOfBirth)&&void 0!==g?g:void 0,height:null!==(j=null!==(b=e.height)&&void 0!==b?b:e.Height)&&void 0!==j?j:void 0,weight:null!==(y=null!==(f=e.weight)&&void 0!==f?f:e.Weight)&&void 0!==y?y:void 0,email:null!==(k=null!==(z=e.email)&&void 0!==z?z:e.Email)&&void 0!==k?k:void 0,phone:null!==(w=null!==(_=e.phone)&&void 0!==_?_:e.Phone)&&void 0!==w?w:void 0,team_id:null!==(S=null!==(C=e.team_id)&&void 0!==C?C:e.TeamID)&&void 0!==S?S:void 0}}async function Qe(){const e=await m.Ay.get("/players");return((Array.isArray(e.data)?e.data:e.data.data||e.data.items)||[]).map(Xe)}async function et(){const e=await m.Ay.get("/sponsors");return Array.isArray(e.data)?e.data:e.data.data}async function tt(e){return(await m.Ay.post("/contact",e)).data}async function nt(){const e=await m.Ay.get("/categories");return Array.isArray(e.data)?e.data:e.data.data}const at=async()=>(await ve.A.get("".concat(m.API_URL,"/navigation"))).data,it=async()=>(await ve.A.get("".concat(m.API_URL,"/admin/navigation"),{withCredentials:!0})).data,ot=async e=>{await ve.A.post("".concat(m.API_URL,"/admin/navigation/reorder"),e,{withCredentials:!0})},rt=async()=>(await ve.A.get("".concat(m.API_URL,"/admin/social-links"),{withCredentials:!0})).data,st=async()=>(await ve.A.post("".concat(m.API_URL,"/admin/navigation/seed"),{},{withCredentials:!0})).data,lt=async()=>(await m.FH.get("/events/upcoming")).data,ct=async e=>{const t=(0,u.gf)();return(await m.FH.post("/events",e,{headers:t?{Authorization:"Bearer ".concat(t)}:void 0})).data},dt=async()=>(await m.FH.get("/events")).data,ht=async(e,t)=>{const n=(0,u.gf)();return(await m.FH.put("/events/".concat(e),t,{headers:n?{Authorization:"Bearer ".concat(n)}:void 0})).data},ut=e=>{var t,n,a,i,o;if(!e)return e;const r=null!==(t=null!==(n=null!==(a=e.id)&&void 0!==a?a:e.ID)&&void 0!==n?n:e.article_id)&&void 0!==t?t:e.articleId,s=null!==(i=e.category)&&void 0!==i?i:e.Category,l=null!==(o=e.author)&&void 0!==o?o:e.Author;return(0,h.A)((0,h.A)({},e),{},{id:r,category:s,author:l})};async function mt(e){return(await m.Ay.get("/articles/".concat(e,"/match-link"))).data}async function pt(e,t){return(await m.Ay.post("/articles/".concat(e,"/match-link"),t)).data}async function xt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(await m.Ay.get("/articles",{params:e})).data||{},n=(Array.isArray(t.items)?t.items:Array.isArray(t.data)?t.data:[]).map(e=>ut(e));return{data:n,total:"number"===typeof t.total?t.total:"number"===typeof t.count?t.count:n.length,page:"number"===typeof t.page?t.page:e.page||1,page_size:"number"===typeof t.page_size?t.page_size:e.page_size||n.length}}async function gt(e){const t=await m.Ay.post("/articles",e);return ut(t.data)}async function vt(e,t){const n=await m.Ay.put("/articles/".concat(e),t);return ut(n.data)}async function jt(e){const t=new FormData;t.append("file",e);const n=(await m.Ay.post("/upload",t)).data;let a=n.url||"";try{const e=new URL(a,window.location.origin),t=window.location.origin,n=new URL(m.API_URL).origin;(e.origin===t||e.origin===n)&&(a=e.pathname+e.search+e.hash)}catch(i){}return(0,h.A)((0,h.A)({},n),{},{url:a})}const bt=async()=>{try{const e=await m.Ay.get("/youtube/videos"),t=null===e||void 0===e?void 0:e.data,n=Array.isArray(null===t||void 0===t?void 0:t.videos)&&t.videos.length>0;if(204===e.status||!t||!n){const e=await yt();return ft(e)}return ft(t)}catch(e){return await yt()}},yt=async()=>{try{const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/youtube_channel.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return null;const a=await n.json();return ft(a)}catch(e){return null}},ft=e=>{if(!e||!Array.isArray(e.videos))return null!==e&&void 0!==e?e:null;const t=(0,h.A)((0,h.A)({},e),{},{videos:[...e.videos]});return t.videos.sort((e,t)=>{const n=Date.parse(e.published_date||"")||0;return(Date.parse(t.published_date||"")||0)-n}),t};async function kt(){const e=await async function(){const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/zonerama_flat.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return[];try{const e=await n.json();return Array.isArray(e)?e:[]}catch(a){return[]}}();if(e&&e.length>0)return e;const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;try{const e="".concat(t,"/cache/prefetch/zonerama_albums.json"),n=await fetch(e,{cache:"no-cache"});if(n.ok){const e=await n.json(),t=(Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:[]).map(e=>({id:String(e.id||e.photo_id||""),album_id:String(e.album_id||""),src:String(e.src||e.image_url||""),local:String(e.local||e.local_url||e.image_local||""),page_url:String(e.page_url||e.url||"")}));if(t.length>0)return t}}catch(n){}try{const e=await async function(){const e=await m.Ay.get("/zonerama/picks");return Array.isArray(e.data)?e.data:[]}();return e.map(e=>({id:String(e.id),album_id:String(e.album_id||""),src:String(e.image_url),local:String(e.image_url),page_url:String(e.page_url||e.album_url||"")}))}catch(a){}return[]}async function zt(e,t){const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};Object.entries(e).forEach(e=>{let[n,a]=e;if(void 0!==a)if("boolean"!==typeof a&&"number"!==typeof a)if("string"!==typeof a){if(Array.isArray(a)){const e=a.map(e=>"string"===typeof e?e.trim():null===e||void 0===e?"":String(e)).filter(e=>""!==e);return void(t[n]=e.join(", "))}if(null!==a)try{t[n]=JSON.stringify(a)}catch(i){t[n]=String(a)}else t[n]=null}else t[n]=a.trim();else t[n]=a});const n=t.competitions;return"string"!==typeof n||t.categories||(t.categories=n),t}(t);"string"!==typeof n.competitions||n.categories||(n.categories=n.competitions);const{data:a}=await m.FH.post("/newsletter/preferences",{token:e,preferences:n});return a}const wt=(e,t)=>{let n=String(t||"").trim();if(!n)return null;if(n=n.replace(/\s+/g,""),n.startsWith("@")){const t=n.slice(1);if("facebook"===e)return"https://www.facebook.com/".concat(t);if("instagram"===e)return"https://www.instagram.com/".concat(t);if("youtube"===e)return"https://www.youtube.com/@".concat(t)}if(!/^https?:\/\//i.test(n)&&!n.includes("/")&&!n.includes(".")){if("facebook"===e)return"https://www.facebook.com/".concat(n);if("instagram"===e)return"https://www.instagram.com/".concat(n);if("youtube"===e)return"https://www.youtube.com/@".concat(n)}if(!/^https?:\/\//i.test(n)){if(/^facebook\.com\//i.test(n))return"https://www.".concat(n);if(/^instagram\.com\//i.test(n))return"https://www.".concat(n);if(/^youtube\.com\//i.test(n))return"https://www.".concat(n)}return n},_t=e=>{var t;let{isOpen:n,onClose:i,isAdmin:o,isAuthenticated:r,menuBg:s,dividerColor:l,settings:c,categories:u,galleryHref:m,galleryLabel:x,hasTables:g,hasActivities:v,hasPlayers:j,hasArticles:b,hasVideos:y,hasGallery:f,dynamicNavItems:k,navLoading:z}=e;return(0,p.jsxs)(V._s,{isOpen:n,placement:"left",onClose:i,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)($.z,{bg:s,children:[(0,p.jsx)(B.s,{}),(0,p.jsx)(J.r,{borderBottomWidth:"1px",borderColor:"border.subtle",children:"Menu"}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[!z&&k.length>0?k.map((e,t)=>{const n="external"===e.type,i="dropdown"===e.type&&e.children&&e.children.length>0,o=n?{href:e.url}:{to:e.url||"/"},r=n?"a":d.N_;return(0,p.jsxs)(a.Fragment,{children:[(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:r},o),{},{target:n?"_blank":void 0,rel:n?"noreferrer":void 0,variant:"ghost",justifyContent:"flex-start",fontWeight:i?"bold":"normal",children:e.label})),i&&(0,p.jsx)(w.T,{align:"stretch",pl:4,spacing:1,children:e.children.map(e=>{const t="external"===e.type,n=t?{href:e.url}:{to:e.url||"/"},a=t?"a":d.N_;return(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:a},n),{},{variant:"ghost",justifyContent:"flex-start",fontWeight:"normal",size:"sm",children:e.label}),e.id)})})]},e.id||t)}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{as:d.N_,to:"/",variant:"ghost",justifyContent:"flex-start",children:"Dom\u016f"}),(null===(t=null===c||void 0===c?void 0:c.show_about_in_nav)||void 0===t||t)&&(0,p.jsx)(T.$,{as:d.N_,to:"/o-klubu",variant:"ghost",justifyContent:"flex-start",children:"O klubu"}),(0,p.jsx)(T.$,{as:d.N_,to:"/kalendar",variant:"ghost",justifyContent:"flex-start",children:"Kalend\xe1\u0159"}),(0,p.jsx)(T.$,{as:d.N_,to:"/zapasy",variant:"ghost",justifyContent:"flex-start",children:"Z\xe1pasy"}),!0===v&&(0,p.jsx)(T.$,{as:d.N_,to:"/aktivity",variant:"ghost",justifyContent:"flex-start",children:"Aktivity"}),!0===j&&(0,p.jsx)(T.$,{as:d.N_,to:"/hraci",variant:"ghost",justifyContent:"flex-start",children:"Hr\xe1\u010di"}),!0===g&&(0,p.jsx)(T.$,{as:d.N_,to:"/tabulky",variant:"ghost",justifyContent:"flex-start",children:"Tabulky"}),Array.isArray(null===c||void 0===c?void 0:c.custom_nav)&&c.custom_nav.length>0&&c.custom_nav.map((e,t)=>{const n="string"===typeof(null===e||void 0===e?void 0:e.url)&&/^https?:\/\//i.test(e.url),a=n?{href:e.url}:{to:e.url||"/"},i=n?"a":d.N_;return(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:i},a),{},{target:n?"_blank":void 0,rel:n?"noreferrer":void 0,variant:"ghost",justifyContent:"flex-start",children:(null===e||void 0===e?void 0:e.label)||"Str\xe1nka"}),"custom-nav-".concat(t,"-").concat((null===e||void 0===e?void 0:e.label)||"link"))}),!0===b&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{as:d.N_,to:"/blog",variant:"ghost",justifyContent:"flex-start",fontWeight:"bold",children:"\u010cl\xe1nky"}),Array.isArray(u)&&u.length>0&&(0,p.jsx)(w.T,{align:"stretch",pl:4,spacing:1,children:u.map(e=>{const t="string"===typeof e.url&&/^https?:\/\//i.test(e.url),n=e.url||(e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog"),a=t?{href:n}:{to:n};return(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:t?"a":d.N_},a),{},{variant:"ghost",justifyContent:"flex-start",fontWeight:"normal",size:"sm",children:e.name}),e.slug||e.name)})})]}),!0===y&&(0,p.jsx)(T.$,{as:d.N_,to:"/videa",variant:"ghost",justifyContent:"flex-start",children:"Videa"}),(0,p.jsx)(T.$,{as:d.N_,to:"/hledat",variant:"ghost",justifyContent:"flex-start",children:"Hledat"}),!0===f&&(0,p.jsx)(T.$,{as:d.N_,to:"/galerie",variant:"ghost",justifyContent:"flex-start",children:x||"Fotogalerie"}),(null===c||void 0===c?void 0:c.shop_url)&&(0,p.jsx)(T.$,{as:"a",href:c.shop_url,target:"_blank",rel:"noreferrer",variant:"ghost",justifyContent:"flex-start",children:"Fanshop"}),(0,p.jsx)(T.$,{as:d.N_,to:"/sponzori",variant:"ghost",justifyContent:"flex-start",children:"Sponzo\u0159i"}),(0,p.jsx)(T.$,{as:d.N_,to:"/kontakt",variant:"ghost",justifyContent:"flex-start",children:"Kontakt"})]}),o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{my:2,borderColor:l}),(0,p.jsx)(U.E,{fontWeight:"bold",mt:2,color:l,children:"Administrace"}),(0,p.jsx)(T.$,{as:d.N_,to:"/admin",variant:"ghost",justifyContent:"flex-start",colorScheme:"blue",children:"Administrace"})]}),!r&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{my:2,borderColor:l}),(0,p.jsx)(T.$,{as:d.N_,to:"/login",colorScheme:"blue",justifyContent:"flex-start",children:"P\u0159ihl\xe1sit se"}),(0,p.jsx)(T.$,{as:d.N_,to:"/register",variant:"outline",justifyContent:"flex-start",children:"Registrovat se"})]})]})})]})]})},St=e=>{let{label:t,items:n,isActive:a}=e;const{isOpen:i,onOpen:o,onClose:r}=(0,X.j)(),s=(0,b.dU)("brand.primary","brand.accent"),l=(0,b.dU)("gray.700","gray.200"),c=(0,b.dU)("blackAlpha.50","whiteAlpha.100"),h=(0,b.dU)("blackAlpha.100","whiteAlpha.200");return(0,p.jsx)(y.a,{onMouseEnter:o,onMouseLeave:r,children:(0,p.jsxs)(ne.W,{isOpen:i,placement:"bottom-start",gutter:4,children:[(0,p.jsx)(ae.I,{as:T.$,rightIcon:(0,p.jsx)(me.D,{}),variant:"ghost",size:"sm",px:3,fontWeight:a?"700":"600",color:a?s:l,bg:a?c:"transparent",_hover:{bg:h,transform:"translateY(-1px)"},transition:"all 0.2s",children:t}),(0,p.jsx)(oe.c,{children:n.map(e=>(0,p.jsx)(re.D,{as:d.N_,to:e.to,children:e.label},e.to))})]})})},Ct=e=>{var t;let{fullWidth:n=!1}=e;const{colorMode:i,toggleColorMode:o}=(0,b.G6)(),{isAuthenticated:r,logout:s,user:l}=v(),{isOpen:u,onOpen:x,onClose:g}=(0,X.j)(),{isOpen:f,onOpen:z,onClose:_}=(0,X.j)(),S="admin"===(null===l||void 0===l?void 0:l.role),N=S?"/admin/nastaveni":"/semiadmin",{data:R}=ge(),P=Ye(),I=(0,c.zy)(),M=(0,c.Zp)(),D=(0,j.d)(),L=(0,b.dU)("white","#0f1115"),F=(0,b.dU)("gray.600","gray.300"),O=(0,b.dU)("blackAlpha.100","whiteAlpha.200"),q=(0,b.dU)("blackAlpha.50","whiteAlpha.100"),V=(0,b.dU)("brand.primary","brand.accent"),$=(0,b.dU)("gray.700","gray.200"),G=(0,b.dU)("gray.50","blackAlpha.500"),[me,xe]=(0,a.useState)(!1),[ve,je]=(0,a.useState)(null),[be,ye]=(0,a.useState)(null),[fe,ke]=(0,a.useState)(null),[ze,we]=(0,a.useState)(null),[_e,Se]=(0,a.useState)(null),[Ce,Ae]=(0,a.useState)(null),[Ee,Te]=(0,a.useState)([]),[Ne,Re]=(0,a.useState)(!0),Pe=n?"full":"7xl",[Ie,We]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=()=>xe(window.scrollY>8);return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);(0,a.useEffect)(()=>{const e=(null===R||void 0===R?void 0:R.club_name)||P.name;e&&"undefined"!==typeof document&&(document.title=e)},[null===R||void 0===R?void 0:R.club_name,P.name]),(0,a.useEffect)(()=>{try{const e=(null===R||void 0===R?void 0:R.club_logo_url)||P.logoUrl||"/dist/img/logo-club-empty.svg";if(!e)return;const t=W(e)||e,n=e=>{let n=document.querySelector('link[rel="'.concat(e,'"]'));n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t,t.endsWith(".svg")&&(n.type="image/svg+xml")};n("icon"),n("shortcut icon")}catch(e){}},[null===R||void 0===R?void 0:R.club_logo_url,P.logoUrl]);const Me=(null===R||void 0===R?void 0:R.gallery_url)||(null===R||void 0===R?void 0:R.zonerama_url),De=(null===R||void 0===R?void 0:R.gallery_label)||"Fotogalerie";(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const n=await at();if(e&&Array.isArray(n)){const a=n.filter(e=>!e.requires_admin);if(0===a.length&&S)try{console.log("Navigation empty, auto-seeding..."),await st();const t=await at();if(e&&Array.isArray(t)){const e=t.filter(e=>!e.requires_admin);Te(e)}}catch(t){console.error("Auto-seed failed:",t)}else Te(a)}}catch(n){console.error("Failed to load navigation:",n)}finally{e&&Re(!1)}})(),()=>{e=!1}},[S]);const[Ue,Le]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await nt();e&&Array.isArray(t)&&t.length>0?Le(t):e&&Array.isArray(null===R||void 0===R?void 0:R.categories)&&Le(R.categories)}catch(t){e&&Array.isArray(null===R||void 0===R?void 0:R.categories)&&Le(R.categories)}})(),()=>{e=!1}},[null===R||void 0===R?void 0:R.categories]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch((e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/facr_tables.json"),{cache:"no-cache"});if(!t.ok)return void(e||je(!1));const n=await t.json(),a=Array.isArray(null===n||void 0===n?void 0:n.competitions)&&n.competitions.some(e=>{var t;return Array.isArray(null===e||void 0===e||null===(t=e.table)||void 0===t?void 0:t.overall)&&e.table.overall.length>0});e||je(!!a)}catch(t){e||je(!1)}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await dt();e||ye(Array.isArray(t)&&t.length>0)}catch(t){e||ye(!1)}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await Qe();e||ke(Array.isArray(t)&&t.length>0)}catch(t){e||ke(!1)}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await xt({page:1,page_size:1,published:!0});e||we(t.total>0)}catch(t){e||we(!1)}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await bt();e||Se(t&&Array.isArray(t.videos)&&t.videos.length>0)}catch(t){e||Se(!1)}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await kt();e||Ae(Array.isArray(t)&&t.length>0)}catch(t){e||Ae(!1)}})(),()=>{e=!0}},[]);const Fe=e=>!!e&&(I.pathname===e||I.pathname.startsWith(e+"/")),Oe=e=>{const t={label:e.label,to:e.url||"#",external:"external"===e.type};return"dropdown"===e.type&&e.children&&e.children.length>0&&(t.items=e.children.map(e=>({label:e.label,to:e.url||"#"}))),t},Ze=(0,a.useMemo)(()=>(Array.isArray(Ue)&&Ue.length>0?Ue:[]).map(e=>({label:e.name,to:e.url||(e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog")})),[Ue]),Ke=(0,a.useMemo)(()=>{const e=t=>{const n=t.url||"";if(n.startsWith("/aktivity")&&!0!==be)return null;if(n.startsWith("/hraci")&&!0!==fe)return null;if(n.startsWith("/blog")&&!0!==ze)return null;if(n.startsWith("/videa")&&!0!==_e)return null;if(n.startsWith("/galerie")&&!0!==Ce)return null;if("dropdown"===t.type&&Array.isArray(t.children)){const n=t.children.map(e).filter(Boolean);return(0,h.A)((0,h.A)({},t),{},{children:n})}return t};return Ee.map(e).filter(Boolean)},[Ee,be,fe,ze,_e,Ce]);let qe=(0,a.useMemo)(()=>{if(!Ne&&Ke.length>0){const e=Ke.map(Oe);if(Ze.length>0){const t=e.findIndex(e=>"\u010cl\xe1nky"===e.label||"Blog"===e.label||"/blog"===e.to);-1!==t&&(e[t]=(0,h.A)((0,h.A)({},e[t]),{},{items:Ze}))}return e.filter(e=>{const t=e.to||"";return t.startsWith("/aktivity")?!0===be:t.startsWith("/hraci")?!0===fe:t.startsWith("/blog")?!0===ze:t.startsWith("/videa")?!0===_e:!t.startsWith("/galerie")||!0===Ce})}let e=[{label:"Dom\u016f",to:"/"},...!1===(null===R||void 0===R?void 0:R.show_about_in_nav)?[]:[{label:"O klubu",to:"/o-klubu"}],{label:"Kalend\xe1\u0159",to:"/kalendar"},{label:"Z\xe1pasy",to:"/zapasy"},{label:"Aktivity",to:"/aktivity"},{label:"Hr\xe1\u010di",to:"/hraci"},{label:"Tabulky",to:"/tabulky"},Ze.length>0?{label:"\u010cl\xe1nky",to:"/blog",items:Ze}:{label:"\u010cl\xe1nky",to:"/blog"},{label:"Videa",to:"/videa"},{label:De,to:"/galerie"},...null!==R&&void 0!==R&&R.shop_url?[{label:"Fanshop",to:R.shop_url,external:!0}]:[],{label:"Sponzo\u0159i",to:"/sponzori"},{label:"Kontakt",to:"/kontakt"}];const t=Array.isArray(null===R||void 0===R?void 0:R.custom_nav)?R.custom_nav:[];if(t.length>0){const n=t.map(e=>({label:String(e.label||"Str\xe1nka"),to:String(e.url||"#"),external:Boolean(e.external)})),a=e.findIndex(e=>"Tabulky"===e.label);e=a>=0?[...e.slice(0,a+1),...n,...e.slice(a+1)]:[...e,...n]}return!1===ve&&(e=e.filter(e=>"Tabulky"!==e.label)),!0!==be&&(e=e.filter(e=>"Aktivity"!==e.label)),!0!==fe&&(e=e.filter(e=>"Hr\xe1\u010di"!==e.label)),!0!==ze&&(e=e.filter(e=>"\u010cl\xe1nky"!==e.label)),!0!==_e&&(e=e.filter(e=>"Videa"!==e.label)),!0!==Ce&&(e=e.filter(e=>"/galerie"!==e.to)),e},[Ke,Ne,R,Ze,ve,be,fe,ze,_e,Ce,De]);return(0,p.jsxs)(y.a,{position:"sticky",top:0,zIndex:1e3,children:[((null===R||void 0===R?void 0:R.facebook_url)||(null===R||void 0===R?void 0:R.instagram_url)||(null===R||void 0===R?void 0:R.youtube_url)||(null===R||void 0===R?void 0:R.shop_url))&&(0,p.jsx)(y.a,{bg:G,borderBottomWidth:"1px",borderColor:"border.subtle",py:1,children:(0,p.jsx)(Z.m,{maxW:Pe,px:n?0:void 0,children:(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",gap:2,children:[(0,p.jsx)(ee.z,{spacing:2,children:(null===R||void 0===R?void 0:R.shop_url)&&(0,p.jsx)(T.$,{as:"a",href:R.shop_url,target:"_blank",rel:"noreferrer",variant:"link",size:"xs",leftIcon:(0,p.jsx)(pe.IoZ,{}),children:"Fanshop"})}),(0,p.jsxs)(ee.z,{spacing:1,children:[wt("facebook",null===R||void 0===R?void 0:R.facebook_url)&&(0,p.jsx)(K.K,{as:"a",href:wt("facebook",null===R||void 0===R?void 0:R.facebook_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"Facebook",icon:(0,p.jsx)(pe.iYk,{}),variant:"ghost",size:"xs"}),wt("instagram",null===R||void 0===R?void 0:R.instagram_url)&&(0,p.jsx)(K.K,{as:"a",href:wt("instagram",null===R||void 0===R?void 0:R.instagram_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"Instagram",icon:(0,p.jsx)(pe.ao$,{}),variant:"ghost",size:"xs"}),wt("youtube",null===R||void 0===R?void 0:R.youtube_url)&&(0,p.jsx)(K.K,{as:"a",href:wt("youtube",null===R||void 0===R?void 0:R.youtube_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"YouTube",icon:(0,p.jsx)(pe.Vk6,{}),variant:"ghost",size:"xs"})]})]})})}),(0,p.jsxs)(y.a,{bg:(0,b.dU)("rgba(255,255,255,0.9)","rgba(15,17,21,0.85)"),backdropFilter:"saturate(180%) blur(10px)",borderBottomWidth:"1px",borderColor:"border.subtle",boxShadow:me?"sm":"none",transition:"box-shadow 0.2s ease, background-color 0.2s ease, backdrop-filter 0.2s ease",children:[(0,p.jsx)(_t,{isOpen:u,onClose:g,isAdmin:S,isAuthenticated:r,menuBg:L,dividerColor:F,settings:R,categories:Ue,galleryHref:Me,galleryLabel:De,hasTables:ve,hasActivities:be,hasPlayers:fe,hasArticles:ze,hasVideos:_e,hasGallery:Ce,dynamicNavItems:Ke,navLoading:Ne}),(0,p.jsx)(Z.m,{maxW:Pe,px:n?0:void 0,children:(0,p.jsxs)(Q.s,{h:16,alignItems:"center",justifyContent:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:4,alignItems:"center",children:[(0,p.jsx)(ee.z,{as:d.N_,to:"/",spacing:3,align:"center",children:((null===R||void 0===R?void 0:R.club_logo_url)||P.logoUrl)&&(0,p.jsx)(k._,{src:W((null===R||void 0===R?void 0:R.club_logo_url)||P.logoUrl)||(null===R||void 0===R?void 0:R.club_logo_url)||P.logoUrl,alt:(null===R||void 0===R?void 0:R.club_name)||P.name||"Logo",boxSize:{base:"36px",md:"40px"},objectFit:"contain",borderRadius:"full",borderWidth:"2px",borderColor:"brand.primary",style:{padding:null!==(t=(null===R||void 0===R?void 0:R.club_logo_url)||P.logoUrl)&&void 0!==t&&t.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"}})}),(0,p.jsx)(ee.z,{as:"nav",spacing:1,display:{base:"none",lg:"flex"},ml:4,children:qe.map(e=>{const t={variant:"ghost",size:"sm",px:3,_hover:{bg:O,transform:"translateY(-1px)"},fontWeight:Fe(e.to)?"700":"600",color:Fe(e.to)?V:$,bg:Fe(e.to)?q:"transparent",transition:"all 0.2s"};return e.items&&e.items.length>0?(0,p.jsx)(St,{label:e.label,items:e.items,isActive:Fe(e.to)},e.label):e.external&&e.to?(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:"a",href:e.to,target:"_blank",rel:"noreferrer",rightIcon:(0,p.jsx)(pe.EQc,{})},t),{},{children:e.label}),e.label):(0,p.jsx)(T.$,(0,h.A)((0,h.A)({as:d.N_,to:e.to||"#"},t),{},{children:e.label}),e.label)})})]}),(0,p.jsxs)(Q.s,{alignItems:"center",children:[(0,p.jsx)(K.K,{display:{base:"flex",md:"none"},onClick:x,icon:(0,p.jsx)(ce.R,{}),"aria-label":"Otev\u0159\xedt menu",variant:"ghost",mr:2}),(0,p.jsx)(y.a,{display:{base:"none",md:"flex"},mr:2}),(0,p.jsx)(te.m,{label:"Hledat",hasArrow:!0,children:(0,p.jsx)(K.K,{"aria-label":"Hledat",icon:(0,p.jsx)(pe.KSO,{}),size:"sm",mr:2,variant:"ghost",onClick:z})}),S&&(0,p.jsx)(te.m,{label:"Spr\xe1va obsahu",hasArrow:!0,children:(0,p.jsx)(K.K,{as:d.N_,to:"/admin","aria-label":"Spr\xe1va obsahu",icon:(0,p.jsx)(de.q,{}),size:"sm",mr:2,colorScheme:"blue",variant:"ghost"})}),(0,p.jsx)(K.K,{size:"md",fontSize:"lg","aria-label":"P\u0159epnout barevn\xe9 t\xe9ma",variant:"ghost",color:"current",onClick:o,icon:"light"===i?(0,p.jsx)(he.r,{}):(0,p.jsx)(ue.g,{})}),!r&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{as:d.N_,to:"/register",size:"sm",variant:"outline",display:{base:"none",md:"inline-flex"},ml:2,mr:2,children:"Registrovat se"}),(0,p.jsx)(T.$,{as:d.N_,to:"/login",size:"sm",colorScheme:"blue",display:{base:"none",md:"inline-flex"},mr:2,children:"P\u0159ihl\xe1sit se"})]}),r&&(0,p.jsxs)(ne.W,{children:[(0,p.jsx)(ae.I,{as:T.$,rounded:"full",variant:"link",cursor:"pointer",minW:0,ml:2,children:(0,p.jsx)(ie.e,{size:"sm",name:(null===l||void 0===l?void 0:l.name)||"U\u017eivatel"})}),(0,p.jsxs)(oe.c,{children:[(0,p.jsx)(re.D,{as:d.N_,to:N,children:"M\u016fj \xfa\u010det"}),(0,p.jsx)(re.D,{onClick:async()=>{try{const{token:e}=await async function(){const{data:e}=await m.FH.get("/newsletter/token/me");return e}();M("/newsletter/preferences?token=".concat(encodeURIComponent(e)))}catch(e){D({title:"Chyba",description:"Nelze na\u010d\xedst odkaz na e\u2011mailov\xe9 preference. Zkuste to pros\xedm znovu.",status:"error",duration:4e3})}},children:"E\u2011mailov\xe9 preference"}),S&&(0,p.jsx)(re.D,{as:d.N_,to:"/admin/nastaveni",children:"Nastaven\xed str\xe1nky"}),S&&(0,p.jsx)(re.D,{as:d.N_,to:"/admin",children:"Administrace"}),(0,p.jsx)(re.D,{onClick:s,children:"Odhl\xe1sit se"})]})]})]})]})}),(0,p.jsxs)(se.aF,{isOpen:f,onClose:_,size:"md",motionPreset:"scale",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Vyhled\xe1v\xe1n\xed"}),(0,p.jsx)(B.s,{}),(0,p.jsxs)(Y.c,{pb:6,children:[(0,p.jsx)("form",{onSubmit:e=>{e.preventDefault(),(()=>{const e=Ie.trim();e&&(_(),We(""),M("/hledat?q=".concat(encodeURIComponent(e))))})()},children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(A.M,{size:"lg",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(pe.KSO,{})}),(0,p.jsx)(C.p,{placeholder:"Hledat kluby, z\xe1pasy, \u010dl\xe1nky, hr\xe1\u010de...",value:Ie,onChange:e=>We(e.target.value),autoFocus:!0})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",size:"lg",w:"full",leftIcon:(0,p.jsx)(pe.KSO,{}),children:"Vyhledat"})]})}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",mt:4,textAlign:"center",children:"Zadejte kl\xed\u010dov\xe1 slova pro vyhled\xe1v\xe1n\xed"})]})]})]})]})]})};var At=n(9904),Et=n(8861),Tt=n(3212);const Nt=async()=>(await m.Ay.get("/admin/analytics")).data,Rt=async()=>(await m.Ay.get("/admin/analytics/overview")).data,Pt=async e=>(await m.Ay.post("/analytics/track",e)).data,It=(e,t)=>{"undefined"!==typeof window&&window.umami&&window.umami.track(e,t),Pt({event_type:e,page:"undefined"!==typeof window?window.location.pathname:void 0,data:t}).catch(e=>{console.debug("Backend tracking failed:",e)})},Wt=function(e){It("Form Submit",{form:e,success:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]})},Mt=(e,t)=>{It("Navigation",{destination:e,source:t||window.location.pathname})},Dt=function(){It("Contact Form",{success:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]})},Ut=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},Lt=()=>{const e=(new Date).getFullYear(),[t,n]=(0,a.useState)("Fotbal Club"),[i,o]=(0,a.useState)(null),[r,s]=(0,a.useState)([]),{data:l}=(Ye(),ge());return(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch(Ut("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(!t.ok)return;const a=await t.json();if(e)return;null!==a&&void 0!==a&&a.name&&n(String(a.name))}catch(t){}try{const t=await fetch(Ut("/cache/prefetch/settings.json"),{cache:"no-cache"});if(null!==t&&void 0!==t&&t.ok){const n=await t.json();!e&&n&&o((null===n||void 0===n?void 0:n.shop_url)||(null===n||void 0===n?void 0:n.eshop_url)||null)}}catch(a){}try{const t=await fetch("".concat(m.API_URL,"/sponsors"));if(t.ok){const n=await t.json();if(!e&&Array.isArray(n)){const e=n.filter(e=>!1!==e.is_active);s(e)}}}catch(i){}})(),()=>{e=!0}},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(y.a,{bg:"gray.800",color:"white",mt:12,py:8,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(At.B,{direction:{base:"column",lg:"row"},spacing:6,justify:"space-between",align:{base:"flex-start",lg:"center"},w:"100%",children:[(0,p.jsx)(ee.z,{spacing:3,align:"center",children:(0,p.jsx)(U.E,{fontWeight:"700",fontSize:"lg",children:t})}),(0,p.jsxs)(Et.B,{spacing:4,shouldWrapChildren:!0,children:[(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/blog",color:"whiteAlpha.900",fontWeight:"600",_hover:{color:"white",textDecoration:"underline"},children:"\u010cl\xe1nky"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/kalendar",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Z\xe1pasy"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/tabulky",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Tabulka"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/sponzori",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Sponzo\u0159i"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/kontakt",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Kontakt"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/pravidla-cookies",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Cookies"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/obchodni-podminky",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Obchodn\xed podm\xednky"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(L.N,{href:"/zasady-ochrany-osobnich-udaju",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f"})}),i&&(0,p.jsx)(Et.Q,{children:(0,p.jsxs)(L.N,{href:i,color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},isExternal:!0,display:"inline-flex",alignItems:"center",gap:1,children:["E\u2011shop ",(0,p.jsx)(q.qdV,{})]})})]})]})})}),r.length>0&&(0,p.jsx)(y.a,{bg:"gray.700",color:"white",py:8,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(w.T,{spacing:6,children:[(0,p.jsx)(z.D,{size:"md",color:"whiteAlpha.900",children:"Na\u0161i partne\u0159i"}),(0,p.jsx)(Tt.r,{columns:{base:2,sm:3,md:4,lg:6},spacing:6,w:"full",children:r.map(e=>(0,p.jsx)(L.N,{href:e.website_url||"#",isExternal:!!e.website_url,target:e.website_url?"_blank":void 0,rel:e.website_url?"noopener noreferrer":void 0,display:"flex",alignItems:"center",justifyContent:"center",p:3,bg:"whiteAlpha.100",borderRadius:"md",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)"},transition:"all 0.2s",onClick:()=>Mt("footer","sponsor_".concat(e.name)),children:(0,p.jsx)(k._,{src:W(e.logo_url)||"/logo192.png",alt:e.name,maxH:"60px",maxW:"full",objectFit:"contain",filter:"brightness(0) invert(1)",opacity:.9,_hover:{opacity:1}})},e.id))})]})})}),((null===l||void 0===l?void 0:l.facebook_url)||(null===l||void 0===l?void 0:l.instagram_url)||(null===l||void 0===l?void 0:l.youtube_url))&&(0,p.jsx)(y.a,{bg:"gray.600",color:"white",py:6,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(U.E,{fontSize:"lg",fontWeight:"600",color:"whiteAlpha.900",children:"Sledujte n\xe1s"}),(0,p.jsxs)(ee.z,{spacing:4,children:[(null===l||void 0===l?void 0:l.facebook_url)&&(0,p.jsx)(K.K,{as:"a",href:l.facebook_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Facebook",icon:(0,p.jsx)(pe.iYk,{}),size:"lg",colorScheme:"facebook",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#1877F2"},transition:"all 0.2s",onClick:()=>Mt("footer","social_facebook")}),(null===l||void 0===l?void 0:l.instagram_url)&&(0,p.jsx)(K.K,{as:"a",href:l.instagram_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Instagram",icon:(0,p.jsx)(pe.ao$,{}),size:"lg",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#E4405F"},transition:"all 0.2s",onClick:()=>Mt("footer","social_instagram")}),(null===l||void 0===l?void 0:l.youtube_url)&&(0,p.jsx)(K.K,{as:"a",href:l.youtube_url,target:"_blank",rel:"noopener noreferrer","aria-label":"YouTube",icon:(0,p.jsx)(pe.Vk6,{}),size:"lg",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#FF0000"},transition:"all 0.2s",onClick:()=>Mt("footer","social_youtube")})]})]})})}),(0,p.jsx)(y.a,{bg:"gray.900",color:"whiteAlpha.900",py:4,children:(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(U.E,{fontSize:"sm",textAlign:"center",children:["\xa9 ",e," ",t,". V\u0161echna pr\xe1va vyhrazena."]})})}),(0,p.jsx)(y.a,{bg:"white",borderTop:"1px",borderColor:"gray.200",py:6,"data-watermark":"myclub",children:(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(At.B,{direction:{base:"column",md:"row"},spacing:6,justify:"space-between",align:"center",children:[(0,p.jsxs)(ee.z,{spacing:4,align:"center",children:[(0,p.jsx)(k._,{src:"https://myclub.sportcreative.eu/logo.svg",alt:"MyClub",h:{base:"32px",md:"40px"},w:"auto",fallbackSrc:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 50'%3E%3Ctext x='10' y='35' font-family='Arial' font-size='24' font-weight='bold' fill='%23000'%3EMyClub%3C/text%3E%3C/svg%3E"}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:{base:"sm",md:"md"},fontWeight:"600",color:"gray.800",children:"Str\xe1nku provozuje MyClub"}),(0,p.jsx)(U.E,{fontSize:{base:"xs",md:"sm"},color:"gray.600",children:"Profesion\xe1ln\xed webov\xe9 str\xe1nky pro sportovn\xed kluby"})]})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(T.$,{as:"a",href:"https://myclub.sportcreative.eu/kontakt",target:"_blank",rel:"noopener noreferrer",size:{base:"sm",md:"md"},colorScheme:"blue",variant:"solid",leftIcon:(0,p.jsx)(q.pHD,{}),_hover:{transform:"translateY(-2px)",boxShadow:"lg"},transition:"all 0.2s",children:"Objednat"}),(0,p.jsx)(T.$,{as:"a",href:"https://myclub.sportcreative.eu",target:"_blank",rel:"noopener noreferrer",size:{base:"sm",md:"md"},variant:"outline",colorScheme:"gray",rightIcon:(0,p.jsx)(q.qdV,{}),_hover:{bg:"gray.50"},children:"V\xedce info"})]})]})})})]})},Ft=async e=>(await ve.A.get("".concat(m.API_URL,"/page-elements"),{params:{page_type:e}})).data||[],Ot=[{name:"style-pack",label:"Styl bal\xed\u010dek",description:"Glob\xe1ln\xed vizu\xe1ln\xed bal\xed\u010dek pro celou str\xe1nku",icon:pe.$ZR,category:"layout",defaultVariant:"default"},{name:"header",label:"Hlavi\u010dka",description:"Hlavi\u010dka str\xe1nky s logem a navigac\xed",icon:pe.O6N,category:"layout",defaultVariant:"unified"},{name:"hero-topbar",label:"Klub li\u0161ta nad hero",description:"Pruh nad hero s logem klubu, n\xe1zvem a akcemi",icon:pe.$ZR,category:"layout",defaultVariant:"brand"},{name:"hero",label:"Hlavn\xed Sekce",description:"Hlavn\xed obsahov\xe1 oblast s \xfavodn\xedm obsahem",icon:pe.RBv,category:"layout",defaultVariant:"grid"},{name:"footer",label:"Pati\u010dka",description:"Spodn\xed \u010d\xe1st str\xe1nky s odkazy a kontakty",icon:pe.Iz3,category:"layout",defaultVariant:"standard"},{name:"sidebar",label:"Bo\u010dn\xed Panel",description:"Bo\u010dn\xed sloupec s dopl\u0148kov\xfdm obsahem",icon:pe.vgu,category:"layout",defaultVariant:"right"},{name:"banner",label:"Banner",description:"Reklamn\xed nebo informa\u010dn\xed banner",icon:pe.O5k,category:"layout",defaultVariant:"top"},{name:"news",label:"Novinky",description:"Nejnov\u011bj\u0161\xed \u010dl\xe1nky a zpr\xe1vy",icon:pe.Nhm,category:"content",defaultVariant:"grid"},{name:"matches",label:"Z\xe1pasy",description:"Nadch\xe1zej\xedc\xed a posledn\xed z\xe1pasy",icon:pe.i0U,category:"content",defaultVariant:"compact"},{name:"matches-slider",label:"Z\xe1pasy (slider)",description:"P\u0159ehled z\xe1pas\u016f podle sout\u011b\u017ee ve slideru",icon:pe.i0U,category:"content",defaultVariant:"carousel"},{name:"team",label:"T\xfdm",description:"Hr\xe1\u010di a realiza\u010dn\xed t\xfdm",icon:pe.YXz,category:"content",defaultVariant:"grid"},{name:"table",label:"Tabulka",description:"Ligov\xe1 tabulka",icon:pe.ist,category:"content",defaultVariant:"split_news"},{name:"stats",label:"Statistiky",description:"T\xfdmov\xe9 a hr\xe1\u010dsk\xe9 statistiky",icon:pe.YYR,category:"content",defaultVariant:"cards"},{name:"activities",label:"Akce",description:"Nadch\xe1zej\xedc\xed ud\xe1losti a aktivity",icon:pe.bfZ,category:"content",defaultVariant:"list"},{name:"sponsors",label:"Partne\u0159i",description:"Loga a odkazy partner\u016f",icon:pe.DDN,category:"content",defaultVariant:"grid"},{name:"merch",label:"Fanshop",description:"Prodej klubov\xe9ho zbo\u017e\xed",icon:pe.umw,category:"content",defaultVariant:"grid"},{name:"testimonials",label:"Reference",description:"Hodnocen\xed a ohlasy fanou\u0161k\u016f",icon:pe.hYw,category:"content",defaultVariant:"carousel"},{name:"achievements",label:"\xdasp\u011bchy",description:"Trofeje a ocen\u011bn\xed klubu",icon:pe.SBv,category:"content",defaultVariant:"timeline"},{name:"history",label:"Historie",description:"Historie a miln\xedky klubu",icon:pe.hko,category:"content",defaultVariant:"timeline"},{name:"gallery",label:"Galerie",description:"Fotogalerie",icon:pe.kQE,category:"media",defaultVariant:"grid"},{name:"videos",label:"Videa",description:"YouTube videa a sest\u0159ihy",icon:pe.HiP,category:"media",defaultVariant:"grid"},{name:"live",label:"Live Stream",description:"\u017div\xe9 p\u0159enosy z\xe1pas\u016f",icon:pe.Uhg,category:"media",defaultVariant:"featured"},{name:"podcast",label:"Podcast",description:"Zvukov\xe9 podcasty a koment\xe1\u0159e",icon:pe._G3,category:"media",defaultVariant:"list"},{name:"social",label:"Soci\xe1ln\xed S\xedt\u011b",description:"P\u0159\xedsp\u011bvky ze soci\xe1ln\xedch s\xedt\xed",icon:pe.amN,category:"media",defaultVariant:"grid"},{name:"newsletter",label:"Newsletter",description:"Formul\xe1\u0159 pro odb\u011br novinek",icon:pe.L2J,category:"interactive",defaultVariant:"default"},{name:"contact",label:"Kontakt",description:"Kontaktn\xed formul\xe1\u0159",icon:pe.dRU,category:"interactive",defaultVariant:"form"},{name:"countdown",label:"Odpo\u010det",description:"Odpo\u010det do p\u0159\xed\u0161t\xedho z\xe1pasu",icon:pe.lhZ,category:"interactive",defaultVariant:"default"},{name:"poll",label:"Anketa",description:"Hlasov\xe1n\xed a ankety pro fanou\u0161ky",icon:pe.l2R,category:"interactive",defaultVariant:"vertical"},{name:"quiz",label:"Kv\xedz",description:"Interaktivn\xed kv\xedzy",icon:pe.gZZ,category:"interactive",defaultVariant:"card"},{name:"search",label:"Vyhled\xe1v\xe1n\xed",description:"Vyhled\xe1vac\xed pole",icon:pe.KSO,category:"interactive",defaultVariant:"header"},{name:"map",label:"Mapa",description:"Mapa stadionu a are\xe1lu",icon:pe.ZYm,category:"interactive",defaultVariant:"default"},{name:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159 z\xe1pas\u016f a akc\xed",icon:pe.gUT,category:"interactive",defaultVariant:"month"},{name:"weather",label:"Po\u010das\xed",description:"Informace o po\u010das\xed na stadionu",icon:pe.vZy,category:"interactive",defaultVariant:"widget"},{name:"ticketing",label:"Vstupenky",description:"Prodej a rezervace vstupenek",icon:pe.tVd,category:"interactive",defaultVariant:"widget"}],Zt={"style-pack":[{value:"default",label:"V\xfdchoz\xed",description:"Z\xe1kladn\xed sjednocen\xfd styl"},{value:"modern",label:"Modern\xed",description:"Zaoblen\xe9 rohy, lehk\xe9 st\xedny, v\xedce prostoru"},{value:"minimal",label:"Minimal",description:"\u010cist\xe9, bez st\xedn\u016f, tenk\xe9 r\xe1me\u010dky"},{value:"sparta",label:"Sparta",description:"P\u0159ibl\xed\u017een\xed k Sparta packu"}],header:[{value:"unified",label:"Jednotn\xfd",description:"Klasick\xe1 hlavi\u010dka s logem a navigac\xed"},{value:"edge",label:"Okrajov\xfd",description:"Modern\xed hlavi\u010dka s gradientem"},{value:"minimal",label:"Minim\xe1ln\xed",description:"\u010cist\xfd minimalistick\xfd design"},{value:"modern",label:"Modern\xed",description:"Odv\xe1\u017en\xfd modern\xed styl s akcenty"},{value:"sticky",label:"P\u0159ilepen\xfd",description:"Pevn\u011b p\u0159ilepen\xe1 hlavi\u010dka p\u0159i scrollov\xe1n\xed"},{value:"transparent",label:"Pr\u016fhledn\xfd",description:"Pr\u016fhledn\xe1 hlavi\u010dka s efektem"},{value:"sparta_navbar",label:"Sparta Navbar",description:"AC Sparta Praha styl - burger menu, logo, navigace, vyhled\xe1v\xe1n\xed"},{value:"current",label:"Sou\u010dasn\xfd",description:"St\xe1vaj\xedc\xed navigace"},{value:"fullwidth",label:"\u0160\xed\u0159ka 100%",description:"Navigace p\u0159es celou \u0161\xed\u0159ku obrazovky"}],"hero-topbar":[{value:"brand",label:"Brand",description:"Barevn\xe1 li\u0161ta s klubov\xfdmi barvami a akcemi"},{value:"minimal",label:"Minimal",description:"Pr\u016fhledn\xe1/nen\xe1padn\xe1 li\u0161ta"},{value:"badge",label:"Badge",description:"Pill styl s klubovou barvou"}],hero:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Rozlo\u017een\xed ve form\u011b m\u0159\xed\u017eky"},{value:"swiper",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"swiper_full",label:"Cel\xfd Karusel",description:"Celoobrazovkov\xfd karusel"},{value:"edge",label:"Okrajov\xfd",description:"Modern\xed okrajov\xfd styl"},{value:"video",label:"Video",description:"Hero s pozad\xedm videa"},{value:"split",label:"Rozd\u011blen\xfd",description:"Rozd\u011blen\xe9 rozlo\u017een\xed text/obraz"},{value:"featured_sidebar",label:"Zv\xfdrazn\u011bn\xfd + Sidebar",description:"Velk\xfd \u010dl\xe1nek vlevo + 4 \u010dl\xe1nky vpravo. Kategorie: BLOG/T\xddM. Tla\u010d\xedtko: P\u0158EHR\xc1T. Sidebar link: V\xcdCE NOVINEK. P\u0159ekr\xfdv\xe1 se s nadch\xe1zej\xedc\xedm z\xe1pasem"},{value:"sparta_featured_carousel",label:"Sparta Featured Carousel",description:"Hero header s pozad\xedm, \u010dl\xe1nek s kategoriemi, thumbnail navigace, auto-swap"}],news:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Rozlo\u017een\xed karet v m\u0159\xed\u017ece"},{value:"scroller",label:"Posuvn\xedk",description:"Horizont\xe1ln\xed posuvn\xedk"},{value:"hero_carousel",label:"Hero Karusel",description:"Jeden \u010dl\xe1nek najednou. Tla\u010d\xedtko: ZJISTIT V\xcdCE (vlevo dole). Numerace: 01 02 03 (vpravo dole). Auto-swap"},{value:"featured_sidebar",label:"Zv\xfdrazn\u011bn\xfd + Sidebar",description:"Velk\xfd \u010dl\xe1nek vlevo + 4 \u010dl\xe1nky vpravo. Kategorie: BLOG/NOVINKY. Tla\u010d\xedtko: P\u0158EHR\xc1T/\u010c\xcdST V\xcdCE. Link: V\xcdCE NOVINEK"},{value:"list",label:"Seznam",description:"Vertik\xe1ln\xed seznam"},{value:"magazine",label:"Magaz\xedn",description:"Stylizace jako \u010dasopis"},{value:"masonry",label:"Zdivo",description:"Pinterest styl zdiva"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Chronologick\xe1 \u010dasov\xe1 osa"}],matches:[{value:"compact",label:"Kompaktn\xed",description:"Kompaktn\xed karty z\xe1pas\u016f - jeden sloupec (slider + taby dole)"},{value:"compact_split",label:"Kompaktn\xed Rozd\u011blen\xfd",description:"Kompaktn\xed karty z\xe1pas\u016f - dva sloupce (slider vlevo + taby vpravo)"},{value:"expanded",label:"Roz\u0161\xed\u0159en\xfd",description:"Detailn\xed informace o z\xe1pasech"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Zobrazen\xed \u010dasov\xe9 osy"},{value:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159n\xed zobrazen\xed"},{value:"live",label:"\u017div\u011b",description:"\u017div\xe9 v\xfdsledky"},{value:"scoreboard",label:"Tabule",description:"TV broadcast style - velk\xe1 tabule sk\xf3re s live aktualizacemi"},{value:"ticker",label:"Ticker",description:"Scrolluj\xedc\xed ticker s v\xfdsledky a nadch\xe1zej\xedc\xedmi z\xe1pasy"}],"matches-slider":[{value:"carousel",label:"Karusel",description:"Horizont\xe1ln\xed karusel z\xe1pas\u016f"},{value:"scroller",label:"Posuvn\xedk",description:"Plynul\xfd horizont\xe1ln\xed posuvn\xedk"},{value:"ticker",label:"Ticker",description:"\xdazk\xfd ticker v\xfdsledk\u016f a z\xe1pas\u016f"}],sponsors:[{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017ekov\xe9 rozlo\u017een\xed"},{value:"slider",label:"Posuvn\xedk",description:"Animovan\xfd posuvn\xedk"},{value:"scroller",label:"Horizont\xe1ln\xed",description:"Horizont\xe1ln\xed posuvn\xedk"},{value:"pyramid",label:"Pyramida",description:"Pyramidov\xe9 rozlo\u017een\xed"},{value:"wall",label:"Ze\u010f",description:"Ze\u010f partner\u016f"},{value:"tiered",label:"Vrstven\xfd",description:"\xdarovn\u011b partner\u016f - Hlavn\xed / Zlat\xed / St\u0159\xedbrn\xed / Bronzov\xed"},{value:"spotlight",label:"Spotlight",description:"Velk\xfd hlavn\xed partner + men\u0161\xed partne\u0159i okolo"},{value:"sparta_partners_pyramid",label:"Sparta Partners Pyramid",description:"T\u0159\xed-\xfarov\u0148ov\xe1 pyramida partner\u016f (1 hlavn\xed / 4 st\u0159edn\xed / v\xedce mal\xfdch)"}],gallery:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Fotom\u0159\xed\u017eka"},{value:"masonry",label:"Zdivo",description:"Pinterest styl"},{value:"slider",label:"Posuvn\xedk",description:"Slideshow prezentace"},{value:"lightbox",label:"Lightbox",description:"Otev\u0159en\xed v lightboxu"},{value:"collage",label:"Kol\xe1\u017e",description:"Kreativn\xed kol\xe1\u017e"},{value:"featured_grid",label:"Zv\xfdrazn\u011bn\xe1 + M\u0159\xed\u017eka",description:"Velk\xe1 hlavn\xed fotka vlevo + mal\xe9 fotky vpravo v m\u0159\xed\u017ece"},{value:"stories",label:"Stories",description:"Instagram-style stories kruhov\xe9 thumbnaily s full-screen view"}],videos:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Video m\u0159\xed\u017eka"},{value:"featured",label:"Zv\xfdrazn\u011bn\xe9",description:"Hlavn\xed video + seznam"},{value:"carousel",label:"Karusel",description:"Video karusel"},{value:"playlist",label:"Playlist",description:"Playlist styl"},{value:"highlight_reel",label:"Sest\u0159ih",description:"TV broadcast style - hlavn\xed sest\u0159ih + kategorie (G\xf3ly, Z\xe1kroky, Highlights)"},{value:"channel",label:"Kan\xe1l",description:"YouTube channel style s playlists a navigac\xed"},{value:"sparta_horizontal_slider",label:"Sparta Horizontal Slider",description:"Horizont\xe1ln\xed posuvn\xedk s kartami, UNLIMITED odznaky, prev/next tla\u010d\xedtka, drag support"}],team:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Karty hr\xe1\u010d\u016f v m\u0159\xed\u017ece"},{value:"list",label:"Seznam",description:"Seznam hr\xe1\u010d\u016f"},{value:"carousel",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"auto_scroller",label:"Auto Scroller",description:"Horizont\xe1ln\xed auto-scroll. Jm\xe9no hr\xe1\u010de + \u010d\xedslo dresu + odkaz. Taby: MU\u017dI / \u017dENY. Fotky hr\xe1\u010d\u016f na pozad\xed"},{value:"table",label:"Tabulka",description:"Tabulkov\xe9 zobrazen\xed"},{value:"hierarchy",label:"Hierarchie",description:"Organiza\u010dn\xed hierarchie"},{value:"formation",label:"Rozestaven\xed",description:"Fotbalov\xe9 rozestaven\xed na h\u0159i\u0161ti (4-4-2, 4-3-3, atd.)"},{value:"depth_chart",label:"Hloubka K\xe1dru",description:"Pozice s hlavn\xedmi hr\xe1\u010di a n\xe1hradn\xedky"},{value:"sparta_tabs_stats",label:"Sparta Tabs & Stats",description:"Tabovan\xfd v\xfdb\u011br t\xfdmu s fotkou, statistikami a CTA tla\u010d\xedtky (Koupit dres, Detail t\xfdmu)"}],activities:[{value:"list",label:"Seznam",description:"Seznam ud\xe1lost\xed"},{value:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159n\xed zobrazen\xed"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Zobrazen\xed \u010dasov\xe9 osy"},{value:"cards",label:"Karty",description:"Kartov\xe9 rozlo\u017een\xed"},{value:"featured_event",label:"Zv\xfdrazn\u011bn\xe1 Akce",description:"Velk\xe1 hlavn\xed akce + men\u0161\xed nadch\xe1zej\xedc\xed akce"},{value:"countdown_grid",label:"Odpo\u010det + M\u0159\xed\u017eka",description:"Odpo\u010det k nejbli\u017e\u0161\xed akci + m\u0159\xed\u017eka dal\u0161\xedch akc\xed"}],newsletter:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed formul\xe1\u0159"},{value:"popup",label:"Vyskakovac\xed",description:"Vyskakovac\xed okno"},{value:"inline",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd minim\xe1ln\xed"},{value:"sidebar",label:"Bo\u010dn\xed",description:"Bo\u010dn\xed panel"},{value:"banner",label:"Banner",description:"Sticky top banner s minimalistick\xfdm formul\xe1\u0159em"},{value:"hero_cta",label:"Hero CTA",description:"Velk\xfd call-to-action s benefity (Z\xedskejte exkluzivn\xed obsah, slevy...)"}],social:[{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka p\u0159\xedsp\u011bvk\u016f"},{value:"sidebar",label:"Bo\u010dn\xed Panel",description:"Bo\u010dn\xed widgety"},{value:"floating",label:"Plovouc\xed",description:"Plovouc\xed ikony"},{value:"feed",label:"Tok",description:"Tok p\u0159\xedsp\u011bvk\u016f"},{value:"wall",label:"Soci\xe1ln\xed Ze\u010f",description:"Twitter/Instagram ze\u010f s \u017eiv\xfdmi p\u0159\xedsp\u011bvky z v\u0161ech platforem"},{value:"highlights",label:"Highlights",description:"Nejlep\u0161\xed p\u0159\xedsp\u011bvky t\xfddne s most liked/shared"}],stats:[{value:"cards",label:"Karty",description:"Karty statistik"},{value:"table",label:"Tabulka",description:"Datov\xe1 tabulka"},{value:"charts",label:"Grafy",description:"Vizu\xe1ln\xed grafy"},{value:"dashboard",label:"Dashboard",description:"P\u0159ehledov\xe1 deska"},{value:"leaderboard",label:"\u017deb\u0159\xed\u010dek",description:"Top hr\xe1\u010di - nejlep\u0161\xed st\u0159elci, asistence, \u010dist\xe9 konto, atd."},{value:"comparison",label:"Porovn\xe1n\xed",description:"Side-by-side porovn\xe1n\xed hr\xe1\u010d\u016f nebo t\xfdm\u016f"}],countdown:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed odpo\u010det"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minim\xe1ln\xed \u010dasova\u010d"},{value:"large",label:"Velk\xfd",description:"Velk\xe9 zobrazen\xed"},{value:"circular",label:"Kruhov\xfd",description:"Kruhov\xfd odpo\u010det"}],map:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed mapa"},{value:"satellite",label:"Satelit",description:"Satelitn\xed zobrazen\xed"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minim\xe1ln\xed design"},{value:"interactive",label:"Interaktivn\xed",description:"Pln\u011b interaktivn\xed mapa"}],merch:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Produktov\xe1 m\u0159\xed\u017eka"},{value:"carousel",label:"Karusel",description:"Produktov\xfd karusel"},{value:"featured",label:"Zv\xfdrazn\u011bn\xe9",description:"Zv\xfdrazn\u011bn\xe9 produkty"},{value:"list",label:"Seznam",description:"Seznam produkt\u016f"},{value:"sparta_product_slider",label:"Sparta Product Slider",description:"Produktov\xfd karusel s fotkami, cenami a tla\u010d\xedtky Koupit"}],footer:[{value:"standard",label:"Standardn\xed",description:"Klasick\xe1 pati\u010dka"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minimalistick\xe1 pati\u010dka"},{value:"extended",label:"Roz\u0161\xed\u0159en\xe1",description:"Roz\u0161\xed\u0159en\xe1 s v\xedce sloupci"},{value:"centered",label:"Centrovan\xe1",description:"Centrovan\xe9 rozlo\u017een\xed"},{value:"sparta_extended",label:"Sparta Extended",description:"Roz\u0161\xed\u0159en\xe1 pati\u010dka s partnery, navigac\xed, newsletterem a soci\xe1ln\xedmi s\xedt\u011bmi"}],sidebar:[{value:"right",label:"Prav\xfd",description:"Prav\xfd bo\u010dn\xed panel"},{value:"left",label:"Lev\xfd",description:"Lev\xfd bo\u010dn\xed panel"},{value:"sticky",label:"P\u0159ilepen\xfd",description:"P\u0159ilepen\xfd p\u0159i scrollov\xe1n\xed"}],banner:[{value:"top",label:"Naho\u0159e",description:"Banner v horn\xed \u010d\xe1sti"},{value:"bottom",label:"Dole",description:"Banner ve spodn\xed \u010d\xe1sti"},{value:"sidebar",label:"Bo\u010dn\xed",description:"Bo\u010dn\xed banner"},{value:"overlay",label:"P\u0159ekryvn\xfd",description:"P\u0159ekryvn\xfd banner"}],table:[{value:"split_news",label:"Rozd\u011blen\xfd s Aktualitami",description:"Dva sloupce - Aktuality vlevo + Tabulka vpravo (v\xfdchoz\xed)"},{value:"standard",label:"Standardn\xed",description:"Klasick\xe1 tabulka - jeden sloupec"},{value:"compact",label:"Kompaktn\xed",description:"Kompaktn\xed zobrazen\xed"},{value:"detailed",label:"Detailn\xed",description:"Detailn\xed informace"}],testimonials:[{value:"carousel",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka referenc\xed"},{value:"wall",label:"Ze\u010f",description:"Ze\u010f ohlas\u016f"}],achievements:[{value:"timeline",label:"\u010casov\xe1 Osa",description:"Chronologick\xe1 osa"},{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka \xfasp\u011bch\u016f"},{value:"showcase",label:"V\xfdloha",description:"V\xfdloha trofej\xed"}],history:[{value:"timeline",label:"\u010casov\xe1 Osa",description:"Historick\xe1 \u010dasov\xe1 osa"},{value:"story",label:"P\u0159\xedb\u011bh",description:"Vypr\xe1v\u011bc\xed form\xe1t"},{value:"milestones",label:"Miln\xedky",description:"Kl\xed\u010dov\xe9 miln\xedky"}],live:[{value:"featured",label:"Zv\xfdrazn\u011bn\xfd",description:"Hlavn\xed live stream"},{value:"embedded",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd p\u0159ehr\xe1va\u010d"},{value:"multi",label:"V\xedce Kamer",description:"V\xedce kamer najednou"}],podcast:[{value:"list",label:"Seznam",description:"Seznam epizod"},{value:"player",label:"P\u0159ehr\xe1va\u010d",description:"Integrovan\xfd p\u0159ehr\xe1va\u010d"},{value:"featured",label:"Zv\xfdrazn\u011bn\xfd",description:"Zv\xfdrazn\u011bn\xe9 epizody"}],contact:[{value:"form",label:"Formul\xe1\u0159",description:"Kontaktn\xed formul\xe1\u0159"},{value:"info",label:"Informace",description:"Kontaktn\xed \xfadaje"},{value:"combined",label:"Kombinovan\xfd",description:"Formul\xe1\u0159 + \xfadaje"}],poll:[{value:"vertical",label:"Vertik\xe1ln\xed",description:"Vertik\xe1ln\xed rozlo\u017een\xed"},{value:"horizontal",label:"Horizont\xe1ln\xed",description:"Horizont\xe1ln\xed rozlo\u017een\xed"},{value:"cards",label:"Karty",description:"Kartov\xe9 rozlo\u017een\xed"}],quiz:[{value:"card",label:"Karta",description:"Karta po kart\u011b"},{value:"form",label:"Formul\xe1\u0159",description:"Formul\xe1\u0159ov\xfd styl"},{value:"interactive",label:"Interaktivn\xed",description:"Pln\u011b interaktivn\xed"}],search:[{value:"header",label:"Hlavi\u010dka",description:"V hlavi\u010dce"},{value:"overlay",label:"P\u0159ekryvn\xfd",description:"P\u0159ekryvn\xe9 vyhled\xe1v\xe1n\xed"},{value:"inline",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd do str\xe1nky"}],calendar:[{value:"month",label:"M\u011bs\xedc",description:"M\u011bs\xed\u010dn\xed zobrazen\xed"},{value:"week",label:"T\xfdden",description:"T\xfddenn\xed zobrazen\xed"},{value:"list",label:"Seznam",description:"Seznam ud\xe1lost\xed"}],weather:[{value:"widget",label:"Widget",description:"Widget po\u010das\xed"},{value:"detailed",label:"Detailn\xed",description:"Detailn\xed p\u0159edpov\u011b\u010f"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Z\xe1kladn\xed info"}],ticketing:[{value:"widget",label:"Widget",description:"Widget vstupenek"},{value:"full",label:"Pln\xfd",description:"Pln\xfd syst\xe9m"},{value:"link",label:"Odkaz",description:"Pouze odkaz"}]},Kt=e=>{const[t,n]=(0,a.useState)({}),[i,o]=(0,a.useState)({}),[r,s]=(0,a.useState)({}),[l,c]=(0,a.useState)([]),[d,u]=(0,a.useState)(!0),[m,p]=(0,a.useState)(0);(0,a.useEffect)(()=>{let t=!0;const a=e=>{const t=document.querySelector(".myuibrix-viewport-wrapper")||document.querySelector(".container");if(!t)return;const n=Array.from(t.querySelectorAll("[data-element]")),a=new Map;n.forEach(e=>{const t=e.getAttribute("data-element");t&&a.set(t,e)}),e.forEach(e=>{const n=a.get(e);n&&n.parentElement===t&&t.appendChild(n)})};(async()=>{try{const i=await Ft(e);if(t){const e={},t={},r=[...i].sort((e,t)=>(e.display_order||0)-(t.display_order||0)),s=r.map(e=>e.element_name);r.forEach(n=>{e[n.element_name]=n.variant,t[n.element_name]=!1!==n.visible}),n(e),o(t),c(s);const l=(()=>{try{var e,t;if("undefined"!==typeof document&&null!==(e=document.body)&&void 0!==e&&null!==(t=e.classList)&&void 0!==t&&t.contains("myuibrix-edit-mode"))return!0;return"edit"===new URLSearchParams(window.location.search).get("myuibrix")}catch(n){return!1}})();s.length>0&&l&&requestAnimationFrame(()=>{a(s)})}}catch(i){console.error("Failed to load page element configs:",i)}finally{t&&u(!1)}})();const i=e=>{const{elementName:t,variant:a,visible:i,previewMode:r,timestamp:s}=e.detail;r&&(console.log("[usePageElementConfig] Variant change: ".concat(t," -> ").concat(a)),n(e=>(0,h.A)((0,h.A)({},e),{},{[t]:a})),o(e=>(0,h.A)((0,h.A)({},e),{},{[t]:i})),p(e=>e+1))},r=e=>{const{order:t}=e.detail;c(t);try{var n,i;((null===(n=document.body)||void 0===n||null===(i=n.classList)||void 0===i?void 0:i.contains("myuibrix-edit-mode"))||!1)&&a(t)}catch(o){}},l=e=>{const{elementName:t,styles:n,previewMode:a}=e.detail;a&&s(e=>(0,h.A)((0,h.A)({},e),{},{[t]:n}))};return window.addEventListener("myuibrix-change",i),window.addEventListener("myuibrix-reorder",r),window.addEventListener("myuibrix-style-change",l),()=>{t=!1,window.removeEventListener("myuibrix-change",i),window.removeEventListener("myuibrix-reorder",r),window.removeEventListener("myuibrix-style-change",l)}},[e]);return{configs:t,visibility:i,styles:r,elementOrder:l,getVariant:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unified";return t[e]||n},isVisible:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return void 0!==i[e]?i[e]:t},getStyles:e=>r[e],loading:d,refreshKey:m}},qt=()=>{const{data:e}=ge(),t=Ye(),n=(0,c.zy)(),[i,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)([]),[l,u]=(0,a.useState)(!0),[m,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const n=await at();if(e&&Array.isArray(n)){const a=n.filter(e=>!e.requires_admin);if(0===a.length)try{await st();const t=await at();if(e&&Array.isArray(t)){const e=t.filter(e=>!e.requires_admin);s(e)}}catch(t){s([])}else s(a)}}catch(n){}finally{e&&u(!1)}})(),()=>{e=!1}},[]),(0,a.useEffect)(()=>{let t=!0;return(async()=>{try{const n=await nt();t&&Array.isArray(n)&&n.length>0?x(n):t&&Array.isArray(null===e||void 0===e?void 0:e.categories)&&x(e.categories)}catch(n){t&&Array.isArray(null===e||void 0===e?void 0:e.categories)&&x(e.categories)}})(),()=>{t=!1}},[null===e||void 0===e?void 0:e.categories]);const g=e=>{const t={label:e.label,to:e.url||"#",external:"external"===e.type};return"dropdown"===e.type&&e.children&&e.children.length>0&&(t.items=e.children.map(e=>({label:e.label,to:e.url||"#"}))),t},v=(0,a.useMemo)(()=>(Array.isArray(m)&&m.length>0?m:[]).map(e=>({label:e.name,to:e.url||(e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog")})),[m]),j=(0,a.useMemo)(()=>{if(!l&&r.length>0){const e=r.map(g);if(v.length>0){const t=e.findIndex(e=>"\u010cl\xe1nky"===e.label||"Blog"===e.label||"/blog"===e.to);-1!==t&&(e[t]=(0,h.A)((0,h.A)({},e[t]),{},{items:v}))}return e}return[{label:"Dom\u016f",to:"/"},...!1===(null===e||void 0===e?void 0:e.show_about_in_nav)?[]:[{label:"O klubu",to:"/o-klubu"}],{label:"Kalend\xe1\u0159",to:"/kalendar"},{label:"Z\xe1pasy",to:"/zapasy"},{label:"Aktivity",to:"/aktivity"},{label:"Hr\xe1\u010di",to:"/hraci"},v.length>0?{label:"\u010cl\xe1nky",to:"/blog",items:v}:{label:"\u010cl\xe1nky",to:"/blog"},{label:"Videa",to:"/videa"},{label:(null===e||void 0===e?void 0:e.gallery_label)||"Fotogalerie",to:"/galerie"},...null!==e&&void 0!==e&&e.shop_url?[{label:"Fanshop",to:e.shop_url,external:!0}]:[],{label:"Sponzo\u0159i",to:"/sponzori"},{label:"Kontakt",to:"/kontakt"}]},[l,r,null===e||void 0===e?void 0:e.show_about_in_nav,null===e||void 0===e?void 0:e.shop_url,null===e||void 0===e?void 0:e.gallery_label,v]),b=W((null===e||void 0===e?void 0:e.club_logo_url)||t.logoUrl)||(null===e||void 0===e?void 0:e.club_logo_url)||t.logoUrl||"/dist/img/logo-club-empty.svg",y=(null===e||void 0===e?void 0:e.club_name)||t.name||"Klub";return(0,p.jsx)("div",{className:"sparta-navbar-container",children:(0,p.jsxs)("div",{className:"sparta-navbar",children:[(0,p.jsx)("button",{"aria-label":"Menu",className:"sparta-navbar-toggle",onClick:()=>o(e=>!e),children:(0,p.jsxs)("div",{className:"sparta-burger-icon","aria-hidden":!0,children:[(0,p.jsx)("div",{className:"sparta-burger-line"}),(0,p.jsx)("div",{className:"sparta-burger-line"}),(0,p.jsx)("div",{className:"sparta-burger-line"})]})}),(0,p.jsx)(d.N_,{to:"/",className:"sparta-navbar-brand",onClick:()=>o(!1),children:(0,p.jsx)("img",{src:b,alt:y})}),(0,p.jsx)("nav",{className:"sparta-navbar-links",style:{display:i?"flex":void 0,flexWrap:"wrap"},children:j.map(e=>{!!(t=e.to)&&(n.pathname===t||n.pathname.startsWith((t||"")+"/"));var t;const a="sparta-button-tertiary";return e.external&&e.to?(0,p.jsx)("a",{href:e.to,target:"_blank",rel:"noreferrer",className:a,onClick:()=>o(!1),children:e.label},e.label):(0,p.jsx)(d.N_,{to:e.to||"#",className:a,onClick:()=>o(!1),children:e.label},e.label)})})]})})},Vt=e=>{let{layout:t="grid",theme:n="light"}=e;const[i,o]=(0,a.useState)([]),[r,s]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch("".concat(m.API_URL,"/sponsors"));if(t.ok){const n=await t.json();if(!e&&Array.isArray(n)){const e=n.map(e=>({id:e.id,name:e.name,logo:W(e.logo_url)||"/images/sponsors/placeholder.png",url:e.website_url||void 0,tier:e.tier}));return o(e),void s(!1)}}}catch(t){}try{const t=await fetch((e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/settings.json"),{cache:"no-cache"});if(t.ok){const n=await t.json();if(!e){const e=(null===n||void 0===n?void 0:n.sponsors)||(null===n||void 0===n?void 0:n.partners)||[];Array.isArray(e)&&e.length&&o(e.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,name:e.name||"Sponsor",logo:e.logo_url||e.logoUrl||e.logo||"/images/sponsors/placeholder.png",url:e.url||e.website||e.link||"#",tier:e.tier}}))}}}catch(n){}e||s(!1)})(),()=>{e=!0}},[]),r||0===i.length)return null;const l=i.find(e=>"title"===e.tier)||i[0],c=i.filter(e=>e!==l);return(0,p.jsxs)("section",{className:"sponsors ".concat("dark"===n?"dark":""),style:{width:"100vw",position:"relative",left:"50%",right:"50%",transform:"translateX(-50%)",paddingLeft:"max(16px, calc((100vw - 1200px) / 2))",paddingRight:"max(16px, calc((100vw - 1200px) / 2))",boxSizing:"border-box",marginTop:"32px",marginBottom:"32px"},children:[(0,p.jsx)("div",{className:"section-head",children:(0,p.jsx)("h3",{children:"Sponzo\u0159i"})}),"grid"===t?(0,p.jsxs)(p.Fragment,{children:[l&&(0,p.jsx)("div",{className:"title-sponsor",children:(0,p.jsx)("a",{className:"sponsor-tile",href:l.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:l.logo,alt:l.name})})}),(0,p.jsx)("div",{className:"divider","aria-hidden":!0}),(0,p.jsx)("div",{className:"sponsors-grid",children:c.map(e=>(0,p.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:e.logo,alt:e.name})},e.id))})]}):(0,p.jsx)("div",{className:"sponsors-slider",children:(0,p.jsx)("div",{className:"track",children:[...i,...i].map((e,t)=>(0,p.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:e.logo,alt:e.name})},"".concat(e.id,"-").concat(t)))})})]})},Ht=e=>{let{children:t,headerInsideContainer:n=!1}=e;const[i,o]=(0,a.useState)(!1),{getStyles:r,getVariant:s}=Kt("homepage"),l=s("header","unified"),c=s("sponsors","grid"),d=s("footer","standard"),u=n&&"fullwidth"!==l;(0,a.useEffect)(()=>{const e=()=>{try{o(window.scrollY>400)}catch(e){}};return window.addEventListener("scroll",e,{passive:!0}),e(),()=>window.removeEventListener("scroll",e)},[]);return(0,p.jsxs)(y.a,{minH:"100vh",bg:"bg.app",overflowX:"hidden",children:[(0,p.jsx)(y.a,{id:"top",position:"absolute",top:0,left:0}),u?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(Z.m,{maxW:"container.xl",py:8,children:[(0,p.jsx)(y.a,{as:"header","data-element":"header","data-variant":l,style:(0,h.A)({},r("header")),children:"sparta_navbar"===l?(0,p.jsx)(qt,{}):(0,p.jsx)(Ct,{fullWidth:"fullwidth"===l})}),t]}),(0,p.jsx)(y.a,{"data-element":"sponsors","data-variant":c,style:(0,h.A)({},r("sponsors")),children:(0,p.jsx)(Vt,{})}),(0,p.jsx)(y.a,{as:"footer","data-element":"footer","data-variant":d,style:(0,h.A)({},r("footer")),children:(0,p.jsx)(Lt,{})})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(y.a,{as:"header","data-element":"header","data-variant":l,style:(0,h.A)({},r("header")),children:"sparta_navbar"===l?(0,p.jsx)(qt,{}):(0,p.jsx)(Ct,{fullWidth:"fullwidth"===l})}),(0,p.jsx)(Z.m,{maxW:"container.xl",py:8,children:t}),(0,p.jsx)(y.a,{"data-element":"sponsors","data-variant":c,style:(0,h.A)({},r("sponsors")),children:(0,p.jsx)(Vt,{})}),(0,p.jsx)(y.a,{as:"footer","data-element":"footer","data-variant":d,style:(0,h.A)({},r("footer")),children:(0,p.jsx)(Lt,{})})]}),i&&(0,p.jsx)(K.K,{"aria-label":"Zp\u011bt nahoru",icon:(0,p.jsx)(q.wAb,{}),position:"fixed",right:{base:4,md:6},bottom:{base:4,md:6},zIndex:1e3,colorScheme:"blue",onClick:()=>{try{window.scrollTo({top:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}},borderRadius:"full",shadow:"md"})]})};function $t(e){var t,n,a,i,o,r,s,l,c,d,h,u,m,p,x,g,v,j,b,y,f,k,z,w,_,S,C,A,E;if(!e)return e;const T=null!==(t=e.id)&&void 0!==t?t:e.ID;return{id:"string"===typeof T?Number(T):T,first_name:null!==(n=null!==(a=e.first_name)&&void 0!==a?a:e.FirstName)&&void 0!==n?n:"",last_name:null!==(i=null!==(o=e.last_name)&&void 0!==o?o:e.LastName)&&void 0!==i?i:"",date_of_birth:null!==(r=null!==(s=e.date_of_birth)&&void 0!==s?s:e.DateOfBirth)&&void 0!==r?r:void 0,position:null!==(l=null!==(c=e.position)&&void 0!==c?c:e.Position)&&void 0!==l?l:void 0,jersey_number:null!==(d=null!==(h=e.jersey_number)&&void 0!==h?h:e.JerseyNumber)&&void 0!==d?d:void 0,team_id:null!==(u=null!==(m=e.team_id)&&void 0!==m?m:e.TeamID)&&void 0!==u?u:void 0,nationality:null!==(p=null!==(x=e.nationality)&&void 0!==x?x:e.Nationality)&&void 0!==p?p:void 0,height:null!==(g=null!==(v=e.height)&&void 0!==v?v:e.Height)&&void 0!==g?g:void 0,weight:null!==(j=null!==(b=e.weight)&&void 0!==b?b:e.Weight)&&void 0!==j?j:void 0,image_url:null!==(y=null!==(f=e.image_url)&&void 0!==f?f:e.ImageURL)&&void 0!==y?y:void 0,is_active:Boolean(null===(k=null!==(z=e.is_active)&&void 0!==z?z:e.IsActive)||void 0===k||k),created_at:null!==(w=null!==(_=e.created_at)&&void 0!==_?_:e.CreatedAt)&&void 0!==w?w:void 0,email:null!==(S=null!==(C=e.email)&&void 0!==C?C:e.Email)&&void 0!==S?S:void 0,phone:null!==(A=null!==(E=e.phone)&&void 0!==E?E:e.Phone)&&void 0!==A?A:void 0}}async function Bt(){const e=await m.Ay.get("/players");return((Array.isArray(e.data)?e.data:e.data.data||e.data.items)||[]).map($t)}async function Jt(){const e=(await m.Ay.get("/sponsors")).data;return((Array.isArray(e)?e:Array.isArray(null===e||void 0===e?void 0:e.data)?e.data:[])||[]).map(e=>{var t,n,a;return(0,h.A)((0,h.A)({},e),{},{id:null!==(t=null!==(n=null!==(a=e.id)&&void 0!==a?a:e.ID)&&void 0!==n?n:e.Id)&&void 0!==t?t:e.iD})})}async function Yt(e){return(await m.Ay.post("/sponsors",e)).data}async function Gt(e,t){return(await m.Ay.put("/sponsors/".concat(e),t)).data}async function Xt(e){return(await m.Ay.delete("/sponsors/".concat(e))).data}var Qt=n(7139),en=n(9032),tn=n(4261),nn=n(3856);const an=e=>{let{title:t,rightAction:n,children:i,draggable:o=!1,autoScroll:r=!1,autoSpeed:s=1.2,rewindLoop:l=!0,pauseOnHover:c=!0,infiniteScroll:d=!1}=e;const h=(0,a.useRef)(null),u=Ye(),[m,x]=((0,b.dU)("white","gray.800"),(0,a.useState)(!1)),g=(0,a.useRef)(!1),v=(0,a.useRef)(0),j=(0,a.useRef)(0),f=(0,a.useRef)(!1),k=(0,a.useRef)(null),w=e=>{const t=h.current;if(!t)return;const n=Math.floor(.7*t.clientWidth)*e;t.scrollBy({left:n,behavior:"smooth"})},_=e=>{const t=h.current;t&&(g.current=!0,f.current=!1,v.current=e,j.current=t.scrollLeft,t.style.scrollSnapType="none",t.style.cursor="grabbing",document.body.style.userSelect="none")},S=e=>{const t=h.current;if(!t||!g.current)return;const n=e-v.current;Math.abs(n)>3&&(f.current=!0),t.scrollLeft=j.current-n},C=()=>{const e=h.current;g.current=!1,e&&(e.style.cursor="grab"),document.body.style.userSelect="",e&&setTimeout(()=>{e&&(e.style.scrollSnapType="x mandatory")},100)};return(0,a.useEffect)(()=>{const e=h.current;if(!r||!e)return;if(d){const t=e.scrollWidth/2;e.scrollLeft=t}let t=!0;const n=()=>{if(!t||!e)return;const a=e.scrollLeft,i=e.scrollWidth,o=e.clientWidth;if(!(c&&m||g.current))if(d){a>=i/2?e.scrollLeft=0:e.scrollLeft+=s}else{const t=a+o>=i-2;t&&l?e.scrollLeft=0:t||(e.scrollLeft+=s)}k.current=requestAnimationFrame(n)};return k.current=requestAnimationFrame(n),()=>{t=!1,null!==k.current&&(cancelAnimationFrame(k.current),k.current=null)}},[r,s,c,m,l,d]),(0,p.jsxs)(y.a,{position:"relative",children:[(t||n)&&(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,children:[t&&(0,p.jsx)(z.D,{size:"lg",letterSpacing:"0.04em",style:{textTransform:"uppercase"},children:t}),n]}),(0,p.jsx)(y.a,{pointerEvents:"none",position:"absolute",left:0,top:0,bottom:0,w:{base:16,md:24},bgGradient:(0,b.dU)("linear(to-r, white, rgba(255,255,255,0.9), rgba(255,255,255,0.4), transparent)","linear(to-r, gray.900, rgba(17,25,40,0.9), rgba(17,25,40,0.4), transparent)"),zIndex:1}),(0,p.jsx)(y.a,{pointerEvents:"none",position:"absolute",right:0,top:0,bottom:0,w:{base:16,md:24},bgGradient:(0,b.dU)("linear(to-l, white, rgba(255,255,255,0.9), rgba(255,255,255,0.4), transparent)","linear(to-l, gray.900, rgba(17,25,40,0.9), rgba(17,25,40,0.4), transparent)"),zIndex:1}),(0,p.jsxs)(ee.z,{ref:h,spacing:4,overflowX:"auto",py:2,px:1,cursor:o?"grab":"default",onMouseEnter:()=>x(!0),onMouseLeave:()=>{x(!1),o&&C()},onMouseDown:e=>{o&&(e.preventDefault(),_(e.clientX))},onMouseMove:e=>{o&&S(e.clientX)},onMouseUp:()=>{o&&C()},onTouchStart:e=>{o&&e.touches[0]&&_(e.touches[0].clientX)},onTouchMove:e=>{o&&e.touches[0]&&S(e.touches[0].clientX)},onTouchEnd:()=>{o&&C()},css:{scrollSnapType:d?"none":"x proximity",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:(0,b.dU)("rgba(0,0,0,0.15)","rgba(255,255,255,0.15)"),borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:(0,b.dU)("rgba(0,0,0,0.25)","rgba(255,255,255,0.25)")}},children:[i,d&&i]}),(0,p.jsx)(K.K,{"aria-label":"scroll left",icon:(0,p.jsx)(tn.Y,{boxSize:6}),onClick:e=>{e.preventDefault(),e.stopPropagation(),w(-1)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onTouchStart:e=>{e.preventDefault(),e.stopPropagation()},position:"absolute",top:"50%",transform:"translateY(-50%)",left:{base:1,md:2},size:"lg",colorScheme:"blackAlpha",bg:(0,b.dU)("rgba(255,255,255,0.95)","rgba(45,55,72,0.95)"),color:(0,b.dU)("gray.800","white"),boxShadow:"xl",_hover:{bg:(0,b.dU)("white","gray.600"),transform:"translateY(-50%) scale(1.15)",boxShadow:"2xl"},_active:{transform:"translateY(-50%) scale(0.95)"},transition:"all 0.2s",zIndex:30,borderRadius:"full",pointerEvents:"auto"}),(0,p.jsx)(K.K,{"aria-label":"scroll right",icon:(0,p.jsx)(nn.v,{boxSize:6}),onClick:e=>{e.preventDefault(),e.stopPropagation(),w(1)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onTouchStart:e=>{e.preventDefault(),e.stopPropagation()},position:"absolute",top:"50%",transform:"translateY(-50%)",right:{base:1,md:2},size:"lg",colorScheme:"blackAlpha",bg:(0,b.dU)("rgba(255,255,255,0.95)","rgba(45,55,72,0.95)"),color:(0,b.dU)("gray.800","white"),boxShadow:"xl",_hover:{bg:(0,b.dU)("white","gray.600"),transform:"translateY(-50%) scale(1.15)",boxShadow:"2xl"},_active:{transform:"translateY(-50%) scale(0.95)"},transition:"all 0.2s",zIndex:30,borderRadius:"full",pointerEvents:"auto"}),(0,p.jsx)(y.a,{mt:2,h:"2px",bg:u.primary,borderRadius:"full"})]})};var on=n(5088),rn=n(5087);const sn=e=>{var t;let{a:n}=e;const a=(0,b.dU)("white","gray.800"),i=(0,b.dU)("gray.200","whiteAlpha.300"),o=(Ye(),n.slug?"/news/".concat(n.slug):"/articles/".concat(n.id)),r=((0,b.dU)("gray.100","whiteAlpha.200"),(null===n||void 0===n||null===(t=n.category)||void 0===t?void 0:t.name)||"");return(0,p.jsxs)(y.a,{as:d.N_,to:o,minW:{base:"85%",md:"60%",lg:"33%"},scrollSnapAlign:"start",bg:a,borderRadius:"xl",overflow:"hidden",boxShadow:"lg",borderWidth:"1px",borderColor:i,_hover:{transform:"translateY(-4px)",boxShadow:"2xl"},transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative",children:[(0,p.jsxs)(y.a,{position:"relative",overflow:"hidden",children:[(0,p.jsx)(k._,{src:W(n.image_url)||"/stadium-placeholder.jpg",alt:n.title,w:"100%",h:{base:"200px",md:"240px"},objectFit:"cover",transition:"transform 0.3s ease",_groupHover:{transform:"scale(1.05)"}}),r&&(0,p.jsx)(Qt.E,{position:"absolute",top:3,left:3,colorScheme:"blue",fontSize:"xs",px:3,py:1,borderRadius:"full",textTransform:"uppercase",fontWeight:"bold",children:r})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,p:5,children:[(0,p.jsx)(z.D,{size:"md",noOfLines:2,lineHeight:"1.3",children:n.title}),n.content&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",noOfLines:3,lineHeight:"1.5",children:n.content.replace(/<[^>]*>/g,"").trim()}),(0,p.jsxs)(ee.z,{spacing:3,pt:2,borderTopWidth:"1px",borderColor:i,flexWrap:"wrap",children:[(n.read_time||n.estimated_read_minutes)&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(on.A,{size:14,color:"gray"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[n.read_time||n.estimated_read_minutes," min"]})]}),void 0!==n.view_count&&n.view_count>0&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(rn.A,{size:14,color:"gray"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:n.view_count})]}),n.published_at&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:new Date(n.published_at).toLocaleDateString("cs-CZ")})]})]})]})},ln=()=>{Ye();const{data:e,isLoading:t}=(0,xe.I)({queryKey:["articles",{page:1,page_size:12,published:!0}],queryFn:()=>xt({page:1,page_size:12,published:!0})}),n=(null===e||void 0===e?void 0:e.data)||[];return(0,p.jsx)(y.a,{children:(0,p.jsxs)(an,{title:"Novinky",rightAction:(0,p.jsx)(T.$,{as:d.N_,to:"/blog",variant:"link",color:"brand.primary",children:"V\xedce"}),children:[t&&Array.from({length:4}).map((e,t)=>(0,p.jsx)(en.E,{minW:{base:"85%",md:"60%",lg:"33%"},h:{base:"260px",md:"300px"},borderRadius:"xl"},t)),!t&&n.map(e=>(0,p.jsx)(sn,{a:e},e.id))]})})};var cn=n(3729),dn=n(6938),hn=n(4688);const un=(0,cn.P)(y.a),mn=(0,cn.P)(k._),pn={enter:e=>({x:e>0?1e3:-1e3,opacity:0}),center:{zIndex:1,x:0,opacity:1},exit:e=>({zIndex:0,x:e<0?1e3:-1e3,opacity:0})},xn=e=>{let{article:t}=e;const n=Ye(),a=(t.content||"").replace(/<[^>]*>/g,"").slice(0,200)+"...",i=t.slug?"/news/".concat(t.slug):"/articles/".concat(t.id);return(0,p.jsxs)(y.a,{position:"relative",w:"100%",h:{base:"500px",md:"600px"},overflow:"hidden",borderRadius:{base:"none",md:"xl"},boxShadow:"lg",children:[(0,p.jsx)(mn,{src:W(t.image_url)||"/stadium-placeholder.jpg",alt:t.title,w:"100%",h:"100%",objectFit:"cover",initial:{opacity:.7},animate:{opacity:1},transition:{duration:.5}}),(0,p.jsx)(y.a,{position:"absolute",bottom:0,left:0,right:0,p:{base:6,md:10},bgGradient:"linear(to-t, blackAlpha.900, blackAlpha.700, transparent)",color:"white",children:(0,p.jsxs)(Z.m,{maxW:"7xl",px:{base:4,md:6},children:[(0,p.jsxs)(ee.z,{spacing:3,mb:4,children:[(0,p.jsx)(T.$,{as:d.N_,to:"/blog",size:"sm",px:3,height:"28px",borderRadius:"full",bg:n.primary,color:"white",_hover:{bg:n.accent},children:"BLOG"}),(0,p.jsx)(U.E,{fontSize:{base:"xs",md:"sm"},opacity:.85,children:"\u2022"}),(0,p.jsx)(U.E,{fontSize:{base:"xs",md:"sm"},opacity:.85,children:"Klubov\xe9 aktuality"})]}),(0,p.jsxs)(y.a,{maxW:{base:"100%",md:"70%",lg:"55%"},children:[(0,p.jsx)(U.E,{fontSize:{base:"sm",md:"md"},fontWeight:"bold",color:n.accent,textTransform:"uppercase",letterSpacing:"0.1em",mb:2,children:"Nejnov\u011bj\u0161\xed aktualita"}),(0,p.jsx)(z.D,{as:"h2",size:{base:"xl",md:"2xl",lg:"3xl"},mb:4,lineHeight:"1.2",textShadow:"0 2px 4px rgba(0,0,0,0.5)",children:t.title}),(0,p.jsx)(U.E,{fontSize:{base:"sm",md:"md"},noOfLines:3,mb:6,textShadow:"0 1px 2px rgba(0,0,0,0.5)",children:a}),(0,p.jsxs)(ee.z,{spacing:4,children:[(0,p.jsx)(T.$,{as:d.N_,to:i,size:"lg",bg:n.primary,color:"white",rightIcon:(0,p.jsx)(nn.v,{}),_hover:{bg:n.accent,transform:"translateY(-2px)",boxShadow:"lg"},children:"\u010c\xedst v\xedce"}),(0,p.jsx)(T.$,{as:d.N_,to:"/blog",size:"lg",variant:"outline",borderColor:"whiteAlpha.700",color:"white",_hover:{bg:"whiteAlpha.200"},children:"V\u0161echny \u010dl\xe1nky"})]})]})]})})]})},gn=e=>{var t;let{fallbackArticles:n=[]}=e;const[[i,o],r]=(0,a.useState)([0,0]),{data:s,isLoading:l}=(0,xe.I)({queryKey:["featured-articles",{page:1,page_size:5}],queryFn:()=>async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(await m.Ay.get("/articles/featured",{params:e})).data||{},n=(Array.isArray(t.items)?t.items:Array.isArray(t.data)?t.data:[]).map(e=>ut(e));return{data:n,total:"number"===typeof t.total?t.total:n.length,page:"number"===typeof t.page?t.page:e.page||1,page_size:"number"===typeof t.page_size?t.page_size:e.page_size||n.length}}({page:1,page_size:5})}),{data:c}=(0,xe.I)({queryKey:["latest-articles",{page:1,page_size:5,published:!0}],queryFn:()=>xt({page:1,page_size:5,published:!0}),enabled:Boolean(!l&&!(null!==s&&void 0!==s&&null!==(t=s.data)&&void 0!==t&&t.length))}),d=(0,a.useMemo)(()=>n.map((e,t)=>{var n,a,i,o,r,s,l,c;return{id:"number"===typeof e.id?e.id:t,title:e.title,content:null!==(n=null!==(a=e.content)&&void 0!==a?a:e.excerpt)&&void 0!==n?n:"",image_url:null!==(i=null!==(o=e.image_url)&&void 0!==o?o:e.image)&&void 0!==i?i:void 0,author:e.author,category:"string"===typeof e.category?{id:t,name:e.category}:e.category,category_name:"string"===typeof e.category?e.category:e.category_name,slug:e.slug,created_at:null!==(r=null!==(s=null!==(l=e.created_at)&&void 0!==l?l:e.published_at)&&void 0!==s?s:e.date)&&void 0!==r?r:(new Date).toISOString(),published:null===(c=e.published)||void 0===c||c}}),[n]),h=(0,a.useMemo)(()=>{var e,t;return null!==s&&void 0!==s&&null!==(e=s.data)&&void 0!==e&&e.length?s.data:null!==c&&void 0!==c&&null!==(t=c.data)&&void 0!==t&&t.length?c.data:[]},[null===s||void 0===s?void 0:s.data,null===c||void 0===c?void 0:c.data]),u=h.length?h:d,x=u.length,g=x>0?(0,hn.L)(0,x,i):0,v=(0,a.useCallback)(e=>{r([i+e,e])},[i]);(0,a.useEffect)(()=>{if(x<=1)return;const e=setInterval(()=>{v(1)},8e3);return()=>clearInterval(e)},[x,v]),(0,a.useEffect)(()=>{(0===x&&0!==i||g>=x&&x>0)&&r([0,0])},[x,g,i]);if(l&&!h.length&&!d.length)return(0,p.jsx)(en.E,{w:"100%",h:{base:"500px",md:"600px"},borderRadius:{base:"none",md:"xl"}});if(!x)return(0,p.jsx)(y.a,{position:"relative",w:"100%",h:{base:"480px",md:"560px"},borderRadius:{base:"none",md:"xl"},bgGradient:"linear(to-br, blackAlpha.600, blackAlpha.800)",display:"flex",alignItems:"center",justifyContent:"center",color:"whiteAlpha.800",textAlign:"center",px:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"\u017d\xe1dn\xe9 \u010dl\xe1nky k zobrazen\xed"}),(0,p.jsx)(U.E,{maxW:"lg",children:"P\u0159idejte pros\xedm nov\xe9 \u010dl\xe1nky nebo nastavte vybran\xe9 p\u0159\xedsp\u011bvky, aby se karusel mohl zobrazit."})]})});const j=u[g];return j?(0,p.jsxs)(y.a,{position:"relative",w:"100%",overflow:"hidden",children:[(0,p.jsx)(dn.N,{initial:!1,custom:o,children:(0,p.jsx)(un,{custom:o,variants:pn,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(e,t)=>{let{offset:n,velocity:a}=t;const i=((e,t)=>Math.abs(e)*t)(n.x,a.x);i<-1e4?v(1):i>1e4&&v(-1)},position:"relative",w:"100%",h:"100%",children:(0,p.jsx)(xn,{article:j})},i)}),u.length>1&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(K.K,{"aria-label":"P\u0159edchoz\xed slide",icon:(0,p.jsx)(tn.Y,{}),position:"absolute",left:4,top:"50%",transform:"translateY(-50%)",zIndex:2,borderRadius:"full",colorScheme:"blackAlpha",onClick:()=>v(-1),size:"lg"}),(0,p.jsx)(K.K,{"aria-label":"Dal\u0161\xed slide",icon:(0,p.jsx)(nn.v,{}),position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",zIndex:2,borderRadius:"full",colorScheme:"blackAlpha",onClick:()=>v(1),size:"lg"}),(0,p.jsx)(Q.s,{position:"absolute",bottom:8,left:"50%",transform:"translateX(-50%)",zIndex:2,gap:2,children:u.map((e,t)=>(0,p.jsx)(y.a,{as:"button",px:2,h:"20px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"xs",fontWeight:"700",color:t===g?"black":"white",bg:t===g?"white":"whiteAlpha.500",borderRadius:"sm",onClick:()=>r([t,t>g?1:-1]),transition:"all 0.3s",_hover:{bg:"white",color:"black"},children:String(t+1).padStart(2,"0")},t))})]})]}):null};var vn=n(2077),jn=n(5011);const bn=e=>{try{if(e.includes("youtube.com")||e.includes("youtu.be")){const t=new URL(e);if(t.hostname.includes("youtu.be")){const e=t.pathname.replace("/","");return"https://www.youtube.com/embed/".concat(e)}const n=t.searchParams.get("v");if(n)return"https://www.youtube.com/embed/".concat(n)}}catch(t){}return"https://www.youtube.com/embed/".concat(e)},yn=e=>{var t,n,i;let{videos:o}=e;const r=(0,b.dU)("white","gray.800"),s=Ye(),{data:l}=ge(),[c,h]=(0,a.useState)([]),{isOpen:u,onOpen:m,onClose:x}=(0,X.j)(),[g,v]=(0,a.useState)(null),j=Boolean((null===l||void 0===l||null===(t=l.videos_items)||void 0===t?void 0:t.length)||(null===l||void 0===l||null===(n=l.videos)||void 0===n?void 0:n.length)),f=Boolean((null===l||void 0===l?void 0:l.youtube_url)||(null===l||void 0===l?void 0:l.social_youtube)),k="boolean"===typeof(null===l||void 0===l?void 0:l.videos_module_enabled)?Boolean(null===l||void 0===l?void 0:l.videos_module_enabled):j||"auto"===((null===l||void 0===l?void 0:l.videos_source)||"auto")&&f,_=(null===l||void 0===l?void 0:l.videos_style)||"slider",S=(null===l||void 0===l?void 0:l.videos_source)||"auto",C=Math.max(1,Math.min(12,null!==(i=null===l||void 0===l?void 0:l.videos_limit)&&void 0!==i?i:6));(null===l||void 0===l?void 0:l.youtube_url)||null===l||void 0===l||l.social_youtube;(0,a.useEffect)(()=>{let e=!1;return(async()=>{if("auto"!==S)return;const t=await bt();if(!t)return;const n=(t.videos||[]).slice().sort((e,t)=>(Date.parse(t.published_date||"")||0)-(Date.parse(e.published_date||"")||0));e||h(n)})(),()=>{e=!0}},[S]);const A=e=>{var t;if(null!==e&&void 0!==e&&e.includes("/embed/"))return null===(t=e.split("/embed/")[1])||void 0===t?void 0:t.split("?")[0]},E=(0,a.useMemo)(()=>{if("auto"===S)return(c||[]).slice(0,C).map(e=>({key:e.video_id,title:e.title,embedUrl:bn(e.video_id),thumbnail:e.thumbnail_url,date:e.published_date,videoId:e.video_id}));const e=((null===l||void 0===l?void 0:l.videos_items)||[]).map((e,t)=>{const n=bn(e.url);return{key:"".concat(t,"-").concat(e.url),title:e.title||"Video ".concat(t+1),embedUrl:n,thumbnail:e.thumbnail_url,date:e.uploaded_at,videoId:A(n)}}),t=(o||(null===l||void 0===l?void 0:l.videos)||[]).map((e,t)=>{const n=bn(e);return{key:"".concat(t,"-").concat(e),title:"Video ".concat(t+1),embedUrl:n,videoId:A(n)}});return(e.length?e:t).slice(0,C)},[S,c,null===l||void 0===l?void 0:l.videos_items,null===l||void 0===l?void 0:l.videos,o,C]);if(!k||0===E.length)return null;const N=e=>{let{it:t,idx:n}=e;const a=t.thumbnail||(t.videoId?"https://i.ytimg.com/vi/".concat(t.videoId,"/hqdefault.jpg"):void 0),i=(0,b.dU)("gray.200","gray.600"),o=(0,b.dU)("gray.100","gray.700"),l=(0,b.dU)("gray.400","gray.500"),c=s.primary;return(0,p.jsxs)(y.a,{bg:r,borderRadius:"xl",overflow:"hidden",boxShadow:"sm",borderWidth:"2px",borderColor:i,transition:"all 0.3s",position:"relative",sx:{"&:hover":{transform:"translateY(-8px)",boxShadow:"0 20px 40px rgba(0,0,0,0.15)",borderColor:"brand.primary"},"&:hover .play-overlay":{opacity:1},"&:hover .play-overlay > div":{transform:"scale(1.05)"}},children:[(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsxs)(y.a,{position:"relative",cursor:"pointer",onClick:()=>(e=>{v(e),m()})(t),children:[a?(0,p.jsx)(y.a,{as:"img",src:a,alt:t.title,width:"100%",height:"100%",style:{objectFit:"cover"}}):(0,p.jsx)(y.a,{bg:o,display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(jn.I,{as:pe.gSK,boxSize:12,color:l})}),(0,p.jsx)(y.a,{className:"play-overlay",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transition:"opacity 0.3s ease",pointerEvents:"none",children:(0,p.jsxs)(y.a,{bg:"white",color:"brand.primary",borderRadius:"full",px:8,py:4,fontWeight:"bold",display:"flex",alignItems:"center",gap:2,transform:"scale(0.9)",transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 12px 32px rgba(0,0,0,0.4)",children:[(0,p.jsx)(jn.I,{as:pe.gSK,boxSize:5}),(0,p.jsx)(U.E,{fontSize:"lg",children:"P\u0159ehr\xe1t"})]})})]})}),(0,p.jsx)(y.a,{p:4,borderTopWidth:"2px",borderTopColor:c,children:(0,p.jsxs)(w.T,{align:"start",spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"md",color:c,noOfLines:2,children:t.title}),(0,p.jsxs)(ee.z,{justify:"space-between",width:"100%",children:[t.date&&(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"0.7rem",children:new Date(t.date).toLocaleDateString("cs-CZ")}),t.videoId&&(0,p.jsx)(L.N,{href:"https://www.youtube.com/watch?v=".concat(t.videoId),isExternal:!0,onClick:e=>e.stopPropagation(),children:(0,p.jsx)(T.$,{size:"xs",variant:"ghost",colorScheme:"red",leftIcon:(0,p.jsx)(jn.I,{as:pe.Vk6}),children:"YouTube"})})]})]})})]})};if("slider"===_)return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(y.a,{className:"section-head",style:{marginTop:8,marginBottom:16},children:[(0,p.jsx)(ee.z,{spacing:3,children:(0,p.jsx)(z.D,{as:"h3",size:"lg",fontWeight:"700",children:"Videa"})}),(0,p.jsx)(L.N,{as:d.N_,to:"/videa",children:(0,p.jsx)(T.$,{size:"md",variant:"solid",bg:s.primary,color:"white",rightIcon:(0,p.jsx)(y.a,{as:"span",children:"\u2192"}),_hover:{opacity:.9,transform:"translateX(4px)"},transition:"all 0.2s",children:"V\xedce vide\xed"})})]}),(0,p.jsx)(an,{draggable:!0,children:E.map((e,t)=>(0,p.jsx)(y.a,{minW:{base:"85%",md:"60%",lg:"33%"},display:"flex",flexDirection:"column",children:(0,p.jsx)(N,{it:e,idx:t})},e.key))}),(0,p.jsxs)(se.aF,{isOpen:u,onClose:x,size:"6xl",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.800"}),(0,p.jsxs)(le.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,p.jsx)(B.s,{color:"white",size:"lg",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"},borderRadius:"full",zIndex:2}),(0,p.jsx)(Y.c,{p:0,children:g&&(0,p.jsx)(vn.g,{ratio:16/9,maxH:"90vh",children:(0,p.jsx)("iframe",{src:"".concat(g.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:g.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin",style:{borderRadius:"8px"}})})})]})]})]});const R="grid3"===_?{base:1,md:3}:{base:1,md:2,lg:3};return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(y.a,{className:"section-head",children:[(0,p.jsx)(z.D,{as:"h3",size:"md",children:"Videa"}),(0,p.jsx)(L.N,{as:d.N_,to:"/videa",children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",colorScheme:"blue",children:"V\xedce vide\xed"})})]}),(0,p.jsx)(Tt.r,{columns:R,spacing:4,children:E.map((e,t)=>(0,p.jsx)(N,{it:e,idx:t},e.key))}),(0,p.jsxs)(se.aF,{isOpen:u,onClose:x,size:"6xl",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.800"}),(0,p.jsxs)(le.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,p.jsx)(B.s,{color:"white",size:"lg",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"},borderRadius:"full",zIndex:2}),(0,p.jsx)(Y.c,{p:0,children:g&&(0,p.jsx)(vn.g,{ratio:16/9,maxH:"90vh",children:(0,p.jsx)("iframe",{src:"".concat(g.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:g.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin",style:{borderRadius:"8px"}})})})]})]})]})},fn=async()=>(await ve.A.get("".concat(m.API_URL,"/clothing"))).data.data,kn=()=>{const[e,t]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),o=(0,b.dU)("white","gray.800");return(0,a.useEffect)(()=>{(async()=>{try{const e=await fn();t(e.slice(0,5))}catch(e){console.error("Failed to fetch clothing items:",e)}finally{i(!1)}})()},[]),n||0===e.length?null:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,children:[(0,p.jsx)(z.D,{as:"h3",size:"md",children:"Oble\u010den\xed t\xfdmu"}),(0,p.jsx)(L.N,{as:d.N_,to:"/obleceni",children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",colorScheme:"blue",children:"Zobrazit v\u0161e"})})]}),(0,p.jsx)(Tt.r,{columns:{base:2,md:3,lg:5},spacing:4,children:e.map(e=>(0,p.jsx)("a",{href:e.url||"/obleceni",target:e.url?"_blank":void 0,rel:e.url?"noreferrer noopener":void 0,children:(0,p.jsxs)(y.a,{bg:o,borderRadius:"xl",overflow:"hidden",boxShadow:"sm",borderWidth:"1px",transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"md"},children:[(0,p.jsx)(y.a,{"aria-hidden":!0,height:{base:140,md:180},bgSize:"cover",bgPos:"center",style:{backgroundImage:"url(".concat(e.image_url,")")}}),(0,p.jsxs)(y.a,{p:3,borderTopWidth:"1px",children:[(0,p.jsx)(U.E,{noOfLines:1,fontWeight:"semibold",fontSize:"sm",children:e.title}),e.price&&e.price>0&&(0,p.jsxs)(Qt.E,{colorScheme:"blue",mt:1,fontSize:"xs",children:[e.price," ",e.currency||"K\u010d"]})]})]})},e.id))})]})};var zn=n(6659);const wn=async e=>(await m.Ay.get("/polls",{params:e,headers:{"X-Session-Token":Nn()}})).data,_n=async e=>{const t=Nn();return(await m.Ay.get("/polls/".concat(e),{headers:{"X-Session-Token":t}})).data},Sn=async e=>{const t=Nn();return(await m.Ay.get("/polls/".concat(e,"/results"),{headers:{"X-Session-Token":t}})).data},Cn=async e=>(await m.Ay.post("/admin/polls",e)).data,An=async(e,t)=>(await m.Ay.put("/admin/polls/".concat(e),t)).data,En=async e=>{await m.Ay.delete("/admin/polls/".concat(e))},Tn=async e=>(await m.Ay.get("/admin/polls/".concat(e,"/stats"))).data,Nn=()=>{const e=localStorage.getItem("poll_session_token");if(e)return e;const t="guest_".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,15));return localStorage.setItem("poll_session_token",t),t};var Rn=n(8019),Pn=n(3053),In=n(6686),Wn=n(2431),Mn=n(2836),Dn=n(2515),Un=n(2293);const Ln=()=>{const[e,t]=(0,a.useState)(null),[n,i]=(0,a.useState)(!1),o=(0,c.zy)(),r=e=>e.startsWith("/admin")||"/login"===e||"/setup"===e;(0,a.useEffect)(()=>{if(r(o.pathname))return void console.log("Umami tracking disabled for admin pages");(async()=>{try{const e=(await ve.A.get("".concat(m.API_URL,"/umami/config"))).data;t(e),e.enabled&&e.website_id&&!n&&s(e.script_url,e.website_id)}catch(e){console.error("Failed to load Umami config:",e)}})()},[o.pathname]),(0,a.useEffect)(()=>{o.pathname&&!r(o.pathname)&&Pt({event_type:"page_view",page_path:o.pathname,page_name:document.title}).catch(e=>{console.debug("Analytics tracking failed:",e)})},[o.pathname]);const s=(e,t)=>{if(document.querySelector('script[data-website-id="'.concat(t,'"]')))return void i(!0);const n=document.createElement("script");n.async=!0,n.defer=!0,n.src=e,n.setAttribute("data-website-id",t),n.onload=()=>{console.log("Umami tracking loaded"),i(!0)},n.onerror=()=>{console.error("Failed to load Umami script")},document.head.appendChild(n)};return{isEnabled:(null===e||void 0===e?void 0:e.enabled)||!1,isLoaded:n,trackEvent:(e,t)=>{r(o.pathname)||(window.umami&&n&&window.umami.track(e,t),Pt({event_type:e,page:o.pathname,data:t}).catch(e=>{console.debug("Backend tracking failed:",e)}))}}},Fn=e=>{var t,n;let{poll:i,hasVoted:o,isActive:r,canShowResults:s,onVoteSuccess:u}=e;const x=(0,j.d)(),g=(0,l.jE)(),{trackEvent:f}=Ln(),{isAuthenticated:A,user:E}=v(),R=(0,c.zy)(),[P,I]=(0,a.useState)([]),[W,M]=(0,a.useState)(o),[D,F]=(0,a.useState)(s),[O,Z]=(0,a.useState)([]),[K,q]=(0,a.useState)(s),[V,H]=(0,a.useState)(""),[$,B]=(0,a.useState)(""),J="rating"===i.type,Y=[...i.options].sort((e,t)=>(e.display_order||0)-(t.display_order||0)),G=Y.length>0?Math.max(...Y.map(e=>e.display_order||0))||Y.length:5,[X,Q]=(0,a.useState)(null),te=i.style||"auto",ne="auto"!==te?te:J?G<=5?"rating-stars":"rating-scale":"choices-list",ae=e=>{Q(e);const t=Y.find(t=>(t.display_order||0)===e),n=Y[e-1],a=t||n;a&&I([a.id])},ie=(0,b.dU)("white","gray.800"),oe=(0,b.dU)("gray.200","gray.600"),re=(0,b.dU)("gray.50","gray.700"),se=D&&K,{data:le}=(0,xe.I)({queryKey:["poll-results",i.id],queryFn:()=>Sn(i.id),enabled:se,refetchInterval:4e3,refetchOnWindowFocus:!0}),ce=(0,Mn.n)({mutationFn:()=>{const e=Nn();return(async(e,t)=>{const n=t.session_token||Nn();return(await m.Ay.post("/polls/".concat(e,"/vote"),(0,h.A)((0,h.A)({},t),{},{session_token:n}),{headers:{"X-Session-Token":n}})).data})(i.id,{option_ids:P,session_token:e,voter_name:A&&(V||(null===E||void 0===E?void 0:E.name))||void 0,voter_email:A&&($||(null===E||void 0===E?void 0:E.email))||void 0})},onSuccess:async()=>{M(!0),F(!0),q(!0);try{const e=await Sn(i.id);Z(e.results)}catch(e){console.error("Failed to fetch results:",e)}g.invalidateQueries({queryKey:["polls"]}),g.invalidateQueries({queryKey:["poll",i.id]}),g.invalidateQueries({queryKey:["poll-results",i.id]}),x({title:"Hlas zaznamen\xe1n!",description:"D\u011bkujeme za va\u0161i \xfa\u010dast v anket\u011b.",status:"success",duration:3e3});try{f("Poll Vote",{poll_id:i.id,poll_title:i.title,type:i.type,option_ids:P,rating:X||void 0})}catch(t){}u&&u()},onError:e=>{var t,n;x({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se zaznamenat v\xe1\u0161 hlas",status:"error",duration:5e3})}}),de=e=>{if(i.allow_multiple){if(P.includes(e))I(P.filter(t=>t!==e));else{if(P.length>=i.max_choices)return void x({title:"P\u0159\xedli\u0161 mnoho voleb",description:"M\u016f\u017eete vybrat maxim\xe1ln\u011b ".concat(i.max_choices," mo\u017enost\xed."),status:"warning",duration:3e3});I([...P,e])}}else I([e])};if(K&&D){var he;const e=null!==(he=null===le||void 0===le?void 0:le.total_votes)&&void 0!==he?he:i.total_votes,t=(null===le||void 0===le?void 0:le.results)||(O.length>0?O:i.options.map(t=>({option_id:t.id,text:t.text,vote_count:t.vote_count,percentage:e?t.vote_count/e*100:0,image_url:t.image_url})));return(0,p.jsx)(y.a,{bg:ie,borderWidth:"1px",borderColor:oe,borderRadius:"xl",p:6,boxShadow:"md",children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[i.image_url&&(0,p.jsx)(k._,{src:i.image_url,alt:i.title,borderRadius:"lg",maxH:"200px",objectFit:"cover"}),(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",children:[(0,p.jsx)(z.D,{size:"md",children:i.title}),W&&(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Dn.S,{boxSize:3}),(0,p.jsx)(U.E,{children:"Hlasov\xe1no"})]})})]}),i.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:i.description}),(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,p.jsxs)(U.E,{fontWeight:"bold",fontSize:"sm",color:"gray.500",children:["V\xfdsledky (",e," hlas\u016f)"]}),t.map(e=>(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:1,children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.text}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:[e.vote_count," (",e.percentage.toFixed(1),"%)"]})]}),(0,p.jsx)(Rn.k,{value:e.percentage,colorScheme:"blue",borderRadius:"full",size:"sm"})]},e.option_id))]})]})})}return(0,p.jsx)(y.a,{bg:ie,borderWidth:"1px",borderColor:oe,borderRadius:"xl",p:6,boxShadow:"md",children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[i.image_url&&(0,p.jsx)(k._,{src:i.image_url,alt:i.title,borderRadius:"lg",maxH:"200px",objectFit:"cover"}),(0,p.jsx)(z.D,{size:"md",children:i.title}),i.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:i.description}),!r&&(0,p.jsx)(Qt.E,{colorScheme:"orange",children:"Anketa je moment\xe1ln\u011b uzav\u0159ena"}),r&&(0,p.jsxs)(p.Fragment,{children:["rating-stars"===ne&&(0,p.jsx)(w.T,{align:"stretch",spacing:2,children:(0,p.jsxs)(ee.z,{children:[Array.from({length:G}).map((e,t)=>(0,p.jsx)(Un.G,{boxSize:6,cursor:"pointer",color:t<(X||0)?"yellow.400":"gray.300",onClick:()=>ae(t+1)},t)),(0,p.jsx)(U.E,{ml:2,children:X?"".concat(X,"/").concat(G):"Vyberte hodnocen\xed"})]})}),"rating-scale"===ne&&(0,p.jsx)(ee.z,{flexWrap:"wrap",spacing:2,children:Array.from({length:G}).map((e,t)=>(0,p.jsx)(T.$,{size:"sm",variant:X===t+1?"solid":"outline",colorScheme:"blue",onClick:()=>ae(t+1),children:t+1},t))}),"choices-chips"===ne&&(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[i.allow_multiple&&(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["Vyberte a\u017e ",i.max_choices," mo\u017enost\xed"]}),(0,p.jsx)(ee.z,{flexWrap:"wrap",spacing:2,children:i.options.map(e=>{const t=P.includes(e.id);return(0,p.jsx)(T.$,{size:"sm",borderRadius:"full",variant:t?"solid":"outline",colorScheme:"blue",onClick:()=>de(e.id),children:e.text},e.id)})})]}),"choices-cards"===ne&&(0,p.jsx)(w.T,{spacing:3,align:"stretch",children:i.options.map(e=>{const t=P.includes(e.id);return(0,p.jsx)(y.a,{p:3,borderWidth:t?"2px":"1px",borderColor:t?"blue.400":oe,borderRadius:"md",_hover:{bg:re},cursor:"pointer",onClick:()=>de(e.id),children:(0,p.jsxs)(ee.z,{align:"start",spacing:3,children:[e.image_url&&(0,p.jsx)(k._,{src:e.image_url,alt:e.text,boxSize:"48px",objectFit:"cover",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.text}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.description})]})]})},e.id)})}),"choices-list"===ne&&(0,p.jsx)(p.Fragment,{children:i.allow_multiple?(0,p.jsx)(Pn.$,{value:P.map(String),onChange:e=>{const t=e.map(e=>"string"===typeof e?parseInt(e):e);t.length<=i.max_choices&&I(t)},children:(0,p.jsxs)(w.T,{spacing:2,align:"stretch",children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["Vyberte a\u017e ",i.max_choices," mo\u017enost\xed"]}),i.options.map(e=>(0,p.jsx)(y.a,{p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:re},cursor:"pointer",role:"button",tabIndex:0,onClick:()=>de(e.id),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),de(e.id))},children:(0,p.jsx)(N.S,{value:String(e.id),onClick:e=>e.stopPropagation(),children:(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{children:e.text}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.description})]})})},e.id))]})}):(0,p.jsx)(In.z,{value:(null===(t=P[0])||void 0===t?void 0:t.toString())||"",onChange:e=>{I([parseInt(e)])},children:(0,p.jsx)(w.T,{spacing:2,align:"stretch",children:i.options.map(e=>(0,p.jsx)(y.a,{p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:re},cursor:"pointer",role:"button",tabIndex:0,onClick:()=>de(e.id),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),de(e.id))},children:(0,p.jsx)(Wn.s,{value:String(e.id),onClick:e=>e.stopPropagation(),children:(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{children:e.text}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.description}),e.player&&(0,p.jsxs)(ee.z,{spacing:2,children:[e.player.image_url&&(0,p.jsx)(k._,{src:e.player.image_url,alt:"".concat(e.player.first_name," ").concat(e.player.last_name),boxSize:"24px",borderRadius:"full"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["#",e.player.jersey_number," ",e.player.first_name," ",e.player.last_name]})]})]})})},e.id))})})}),A?(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Jm\xe9no (voliteln\xe9)"}),(0,p.jsx)(C.p,{size:"sm",value:V||(null===E||void 0===E?void 0:E.name)||"",onChange:e=>H(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"E-mail (voliteln\xe9)"}),(0,p.jsx)(C.p,{size:"sm",type:"email",value:$||(null===E||void 0===E?void 0:E.email)||"",onChange:e=>B(e.target.value)})]})]}):(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["Chcete p\u0159ipojit sv\xe9 jm\xe9no k hlasu?"," ",(0,p.jsx)(L.N,{as:d.N_,color:"blue.500",to:"/login",state:{from:R},children:"P\u0159ihlaste se"}),"."]}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>{0!==P.length?i.allow_multiple&&P.length>i.max_choices?x({title:"P\u0159\xedli\u0161 mnoho voleb",description:"M\u016f\u017eete vybrat maxim\xe1ln\u011b ".concat(i.max_choices," mo\u017enost\xed."),status:"warning",duration:3e3}):ce.mutate():x({title:"Vyberte mo\u017enost",description:"P\u0159ed hlasov\xe1n\xedm vyberte alespo\u0148 jednu mo\u017enost.",status:"warning",duration:3e3})},isLoading:ce.isPending,isDisabled:!r||0===P.length,children:"Hlasovat"})]}),D&&!K&&(0,p.jsx)(T.$,{variant:"outline",onClick:async()=>{try{const e=await Sn(i.id);Z(e.results),q(!0)}catch(e){x({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst v\xfdsledky",status:"error",duration:3e3})}},size:"sm",children:"Zobrazit v\xfdsledky"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:["Celkem hlas\u016f: ",null!==(n=null===le||void 0===le?void 0:le.total_votes)&&void 0!==n?n:i.total_votes]})]})})},On=e=>{let{featuredOnly:t=!0,maxPolls:n=1,title:a="Hlasov\xe1n\xed"}=e;const i=(0,b.dU)("gray.50","gray.900"),{data:o,isLoading:r}=(0,xe.I)({queryKey:["polls",{featured:t}],queryFn:()=>wn(t?{featured:!0}:void 0),staleTime:12e4}),s=(null===o||void 0===o?void 0:o.slice(0,n))||[],{data:l,isLoading:c}=(0,xe.I)({queryKey:["polls-details",s.map(e=>e.id)],queryFn:async()=>{const e=s.map(e=>_n(e.id));return await Promise.all(e)},enabled:s.length>0});return r||c?(0,p.jsx)(y.a,{bg:i,py:12,px:4,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"lg"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed ankety..."})]})}):l&&0!==l.length?(0,p.jsx)(y.a,{bg:i,py:12,px:4,children:(0,p.jsxs)(w.T,{spacing:8,maxW:"4xl",mx:"auto",children:[(0,p.jsx)(z.D,{size:"lg",textAlign:"center",children:a}),(0,p.jsx)(w.T,{spacing:6,w:"full",children:l.map(e=>(0,p.jsx)(y.a,{w:"full",maxW:"600px",children:(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results})},e.poll.id))})]})}):null};var Zn=n(5692),Kn=n(67),qn=n(8646);const Vn=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},Hn=e=>{let{zoneramaUrl:t}=e;const[n,i]=(0,a.useState)([]),[o,r]=(0,a.useState)(!0),[s,l]=(0,a.useState)(null),c=(0,b.dU)("white","gray.800"),h=(0,b.dU)("gray.800","gray.100"),u=(0,b.dU)("gray.600","gray.300"),m=(0,b.dU)("blue.50","blue.900"),x=(0,b.dU)("blue.200","blue.700"),g=(0,b.dU)("blue.700","blue.200");return(0,a.useEffect)(()=>{(async()=>{r(!0);try{const[e,t]=await Promise.allSettled([fetch(Vn("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(Vn("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let n=[];if("fulfilled"===e.status&&e.value.ok){const t=await e.value.json();t&&t.input_link&&l(t.input_link),n=[...t.albums||[]]}if("fulfilled"===t.status&&t.value.ok){const e=await t.value.json(),a=(Array.isArray(e)?e:[]).filter(e=>e.id&&e.title&&!n.some(t=>t.id===e.id));n=[...n,...a]}n.sort((e,t)=>{const n=e=>{if(!e)return new Date(0);const t=e.split(/[.\s]+/).filter(Boolean);if(3===t.length){const[e,n,a]=t;return new Date("".concat(a,"-").concat(n.padStart(2,"0"),"-").concat(e.padStart(2,"0")))}return new Date(e)};return n(t.date).getTime()-n(e.date).getTime()});const a=n.slice(0,3);i(a)}catch(e){console.error("Error loading albums:",e)}finally{r(!1)}})()},[]),o?(0,p.jsx)(y.a,{py:12,children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsx)(z.D,{size:"xl",children:"Galerie"}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:[1,2,3].map(e=>(0,p.jsx)(en.E,{height:"300px",borderRadius:"lg"},e))})]})}):0===n.length?null:(0,p.jsx)(y.a,{py:12,children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",flexWrap:"wrap",children:[(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(z.D,{size:"xl",color:h,children:"Fotogalerie"}),(0,p.jsx)(U.E,{color:u,fontSize:"sm",children:"Nejnov\u011bj\u0161\xed alba z na\u0161ich akc\xed"})]}),(0,p.jsx)(T.$,{as:d.N_,to:"/galerie",rightIcon:(0,p.jsx)(Zn.A,{size:18}),colorScheme:"blue",variant:"outline",size:"md",children:"Zobrazit v\u0161e"})]}),(0,p.jsx)(y.a,{bg:m,borderWidth:"1px",borderColor:x,borderRadius:"md",px:4,py:2,children:(0,p.jsxs)(U.E,{fontSize:"xs",color:g,children:["\ud83d\udcf8 V\u0161echny fotografie jsou z platformy"," ",(0,p.jsx)(U.E,{as:"a",href:t||s||"https://zonerama.com",target:"_blank",rel:"noopener noreferrer",fontWeight:"600",color:"blue.600",_hover:{textDecoration:"underline"},children:"Zonerama"})]})}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:n.map(e=>{const t=e.photos&&e.photos.length>0?e.photos[0]:null;return(0,p.jsxs)(y.a,{as:d.N_,to:"/galerie/album/".concat(e.id),bg:c,borderRadius:"lg",overflow:"hidden",boxShadow:"md",transition:"all 0.3s",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),_hover:{transform:"translateY(-8px)",boxShadow:"2xl",borderColor:(0,b.dU)("gray.300","gray.600")},cursor:"pointer",children:[t?(0,p.jsx)(k._,{src:t.image_1500,alt:e.title,w:"100%",h:"200px",objectFit:"cover",loading:"lazy"}):(0,p.jsx)(y.a,{w:"100%",h:"200px",bg:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(Kn.A,{size:48,color:"gray"})}),(0,p.jsxs)(w.T,{align:"stretch",p:4,spacing:2,children:[(0,p.jsx)(z.D,{size:"sm",color:h,noOfLines:2,minH:"40px",children:e.title}),(0,p.jsxs)(w.T,{spacing:2,fontSize:"xs",color:u,align:"stretch",children:[e.date&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(qn.A,{size:14}),(0,p.jsx)(U.E,{children:e.date})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Kn.A,{size:14}),(0,p.jsxs)(U.E,{children:[e.photos_count," foto"]})]})]}),void 0!==e.views_count&&e.views_count>0&&(0,p.jsxs)(Qt.E,{colorScheme:"purple",fontSize:"2xs",alignSelf:"flex-start",children:[e.views_count," zhl\xe9dnut\xed"]})]})]},e.id)})}),(0,p.jsx)(y.a,{textAlign:"center",pt:4,children:(0,p.jsx)(T.$,{as:d.N_,to:"/galerie",rightIcon:(0,p.jsx)(Zn.A,{size:18}),colorScheme:"blue",size:"lg",children:"Zobrazit v\u0161echna alba"})})]})})};async function $n(){const e=await m.Ay.get("/competition-aliases");return Array.isArray(e.data)?e.data:e.data.data}async function Bn(){const e=await m.Ay.get("/admin/competition-aliases");return Array.isArray(e.data)?e.data:e.data.data}async function Jn(e,t){const n=await m.Ay.put("/admin/competition-aliases/".concat(encodeURIComponent(e)),t);return n.data.code?n.data:n.data.data}var Yn=n(804),Gn=n(4858);function Xn(){const[e,t]=(0,a.useState)(!1),n=(0,j.d)(),{register:i,handleSubmit:o,reset:r,formState:{errors:s}}=(0,Gn.mN)(),l=(0,b.dU)("white","transparent"),c=(0,b.dU)("gray.200","gray.600"),d=(0,b.dU)("gray.800","white"),u=(0,b.dU)("gray.600","gray.300"),x=(0,b.dU)("gray.500","gray.400");return(0,p.jsx)(y.a,{w:"100%",maxW:"xl",mx:"auto",p:4,bg:l,borderRadius:"md",boxShadow:"sm",borderWidth:"1px",borderColor:c,children:(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,p.jsx)(U.E,{fontSize:"xl",fontWeight:"bold",textAlign:"center",color:d,children:"P\u0159ihlaste se k odb\u011bru novinek"}),(0,p.jsx)(U.E,{textAlign:"center",color:u,mb:2,children:"Budeme v\xe1s informovat o novink\xe1ch, z\xe1pasech a akc\xedch na\u0161eho klubu. Sou\u010dasn\u011b pro v\xe1s vytvo\u0159\xedme fanou\u0161kovsk\xfd \xfa\u010det a po\u0161leme heslo e\u2011mailem."}),(0,p.jsx)("form",{onSubmit:o(async e=>{t(!0);try{await async function(e,t){const n={email:e};try{var a,i;const e=null===(a=window)||void 0===a||null===(i=a.location)||void 0===i?void 0:i.origin;e&&(n.site_base_url=e)}catch(o){}return t&&(n.preferences=t),(await m.Ay.post("/newsletter/subscribe",n)).data}(e.email),a=window.location.pathname,It("Newsletter Subscribe",{source:a||window.location.pathname}),Wt("Newsletter Subscribe",!0),n({title:"P\u0159ihl\xe1\u0161en\xed k odb\u011bru prob\u011bhlo \xfasp\u011b\u0161n\u011b",description:"Vytvo\u0159ili jsme v\xe1m fanou\u0161kovsk\xfd \xfa\u010det a poslali e\u2011mail s heslem a odkazy pro spr\xe1vu newsletteru.",status:"success",duration:7e3,isClosable:!0}),r()}catch(i){const e=i instanceof Error?i.message:"Nastala chyba p\u0159i p\u0159ihla\u0161ov\xe1n\xed k odb\u011bru";Wt("Newsletter Subscribe",!1),n({title:"Chyba",description:e,status:"error",duration:5e3,isClosable:!0})}finally{t(!1)}var a}),children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsxs)(_.MJ,{isInvalid:!!s.email,children:[(0,p.jsx)(C.p,(0,h.A)((0,h.A)({id:"email",type:"email",placeholder:"V\xe1\u0161 e-mail"},i("email",{required:"E-mail je povinn\xfd",pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Neplatn\xe1 e-mailov\xe1 adresa"}})),{},{size:"md",disabled:e})),(0,p.jsx)(Yn.Wt,{children:s.email&&s.email.message})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",size:"md",width:"100%",isLoading:e,loadingText:"Odes\xedl\xe1m...","data-umami-event":"Newsletter Submit","data-umami-event-location":window.location.pathname,children:"Odeslat"})]})}),(0,p.jsx)(U.E,{fontSize:"xs",color:x,textAlign:"center",mt:2,children:"Odesl\xe1n\xedm formul\xe1\u0159e souhlas\xedte se zpracov\xe1n\xedm osobn\xedch \xfadaj\u016f. Z odb\u011bru se m\u016f\u017eete kdykoli odhl\xe1sit a nastaven\xed upravit v zaslan\xe9m e\u2011mailu. Heslo lze zm\u011bnit p\u0159es str\xe1nku pro obnoven\xed hesla."})]})})}var Qn=n(2205);const ea=(e,t)=>{try{return!e.contains(t)&&(e.appendChild(t),!0)}catch(n){return console.warn("Failed to append child:",n),!1}},ta=(e,t)=>{try{return!!e.contains(t)&&(e.removeChild(t),!0)}catch(n){return console.warn("Failed to remove child:",n),!1}},na=(e,t,n)=>{try{return!!e.contains(n)&&(e.replaceChild(t,n),!0)}catch(a){return console.warn("Failed to replace child:",a),!1}},aa=e=>{try{return document.querySelector(e)}catch(t){return console.warn("Invalid selector:",e,t),null}},ia=e=>{try{return Array.from(document.querySelectorAll(e))}catch(t){return console.warn("Invalid selector:",e,t),[]}},oa=(e,t,n)=>{try{return n&&!e.contains(n)?(console.warn("Reference child is not a child of parent"),!1):!e.contains(t)&&(e.insertBefore(t,n),!0)}catch(a){return console.warn("Failed to insert before:",a),!1}};var ra=n(3109),sa=n(1411),la=n(4566),ca=n(1794),da=n(227),ha=n(1724),ua=n(7569),ma=n(7360),pa=n(8481),xa=n(8787),ga=n(5871),va=n(9077),ja=n(1751);const ba={hero:{tsx:'\n<section data-element="hero" className="hero-grid">\n {/* variant: grid | scroller | swiper | swiper_full */}\n <a className="hero-card big">\n <div className="bg" />\n <div className="meta">\n <div className="tag">Aktuality</div>\n <h2 className="title">Nadpis</h2>\n </div>\n </a>\n <a className="hero-card" />\n <a className="hero-card" />\n</section>\n'.trim(),selectors:[".hero-grid",".hero-card",".bg",".meta",".tag",".title"],notes:"Full-bleed variants may use negative margins and viewport width tricks."},matches:{tsx:'\n<section data-element="matches" className="next-match">\n <button className="nav prev" />\n <div className="team">\n <img className="logo" />\n <div>Dom\xe1c\xed</div>\n </div>\n <div className="countdown">Za\u010d\xe1tek z\xe1pasu</div>\n <div className="team">\n <img className="logo" />\n <div>Host\xe9</div>\n </div>\n <button className="nav next" />\n</section>\n'.trim(),selectors:[".next-match",".team",".logo",".countdown",".nav.prev",".nav.next"],notes:"Center content, strong contrast on countdown. Keep buttons accessible."},"matches-slider":{tsx:'\n<section data-element="matches-slider" className="matches-slider">\n <div className="section-head">\n <h3>Z\xe1pasy</h3>\n <a className="see-all" />\n </div>\n <div className="matches-grid">\n <div className="matches-track">\n <div className="match-card">\n <div className="match-meta" />\n <div className="teams">\n <div className="team"><img /><div className="name" /></div>\n <div className="score"><span className="home" /><span className="sep" /><span className="away" /></div>\n <div className="team"><img /><div className="name" /></div>\n </div>\n </div>\n </div>\n <div className="matches-tabs"><button className="active" /></div>\n </div>\n</section>\n'.trim(),selectors:[".matches-slider",".section-head",".see-all",".matches-grid",".matches-track",".match-card",".match-meta",".teams",".team",".score",".matches-tabs"],notes:"Horizontal scrolling track with cards; consider responsive card widths and gaps."},news:{tsx:'\n<section data-element="news" className="news-list">\n <div className="section-head"><h3>Dal\u0161\xed aktuality</h3></div>\n <div className="blog-list">\n <a className="card">\n <div className="thumb" />\n <div><h4>Title</h4><div className="excerpt" /></div>\n </a>\n </div>\n <div><a className="btn">Zobrazit v\u0161echny aktuality</a></div>\n</section>\n'.trim(),selectors:[".news-list",".section-head",".blog-list",".card",".thumb",".btn"]},table:{tsx:'\n<section data-element="table" className="standings">\n <div className="table-card">\n <div className="section-head">\n <h3>Tabulky</h3>\n <a className="see-all" />\n </div>\n <div className="standings-table-wrapper">\n <table className="standings-table-compact">\n <thead><tr><th>#</th><th>T\xfdm</th><th>Z</th><th>V</th><th>R</th><th>P</th><th className="hide-mobile">Sk\xf3re</th><th>Body</th></tr></thead>\n <tbody><tr><td>#1</td><td><img />T\xfdm</td><td>\u2026</td></tr></tbody>\n </table>\n </div>\n </div>\n</section>\n'.trim(),selectors:[".standings",".table-card",".section-head",".standings-table-wrapper",".standings-table-compact",".see-all"],notes:"Compact table; mind overflow-x on small screens."},sponsors:{tsx:'\n<section data-element="sponsors" className="sponsors">\n <div className="section-head"><h3>Sponzo\u0159i</h3></div>\n <div className="sponsors-grid"><a className="sponsor-tile"><img /></a></div>\n</section>\n'.trim(),selectors:[".sponsors",".section-head",".sponsors-grid",".sponsor-tile"]}},ya=e=>{let{elementName:t,onCSSChange:n,currentCSS:i="",currentStyles:o={},theme:r={}}=e;const[s,l]=(0,a.useState)(i),[c,d]=(0,a.useState)(!0),[h,u]=(0,a.useState)(!1),[x,g]=(0,a.useState)("Zv\xfdrazni tento blok: modern\xed vzhled, zaoblen\xe9 rohy, st\xedn, lep\u0161\xed hover efekt; respektuj klubov\xe9 barvy a responzivitu."),[v,f]=(0,a.useState)(!1),k=(0,j.d)(),z=((0,b.dU)("white","gray.800"),(0,b.dU)("gray.200","gray.600"));(0,a.useEffect)(()=>{l(i)},[i]);const _=e=>{try{const t='[data-element="'.concat(e,'"]'),n=document.querySelector(t),a=document.querySelector(".myuibrix-viewport-wrapper")||document.querySelector(".container")||null,i=(()=>{const e=getComputedStyle(document.documentElement),t={};return["--primary","--primary-light","--secondary","--text","--bg","--bg-soft","--club-primary","--club-text-on-primary"].forEach(n=>{const a=e.getPropertyValue(n);a&&(t[n]=a.trim())}),t})(),o=n?getComputedStyle(n):null,r=o?{display:o.display,gridTemplateColumns:o.gridTemplateColumns,gridTemplateRows:o.gridTemplateRows,gap:o.gap,justifyItems:o.justifyItems,alignItems:o.alignItems,color:o.color,backgroundColor:o.backgroundColor,padding:"".concat(o.paddingTop," ").concat(o.paddingRight," ").concat(o.paddingBottom," ").concat(o.paddingLeft),margin:"".concat(o.marginTop," ").concat(o.marginRight," ").concat(o.marginBottom," ").concat(o.marginLeft),fontFamily:o.fontFamily,fontSize:o.fontSize}:{},s=n?n.getBoundingClientRect():null,l=(()=>{try{const t=Array.from((a||document).querySelectorAll("[data-element]")).map(e=>e.getAttribute("data-element")),n=t.findIndex(t=>t===e),i=n>0?t[n-1]:null,o=n>=0&&n<t.length-1?t[n+1]:null;return{index:n,total:t.length,previous:i,next:o}}catch(t){return{}}})(),c=a?getComputedStyle(a):null,d=c?{display:c.display,gridTemplateColumns:c.gridTemplateColumns,gridAutoFlow:c.gridAutoFlow,gap:c.gap}:{},h=n?n.outerHTML.slice(0,6e3):"",u=ba[e]||{};return{page_path:"undefined"!==typeof window?window.location.pathname:"",element:{name:e,variant:(null===n||void 0===n?void 0:n.getAttribute("data-variant"))||null,classList:n?Array.from(n.classList):[],attributes:n?Array.from(n.attributes).map(e=>({name:e.name,value:e.value})):[],rect:s?{width:s.width,height:s.height}:void 0,computed:r,root_html_snapshot:h},container:d,neighbors:l,css_variables:i,tsx_snippet:u.tsx||void 0,known_selectors:u.selectors||void 0,design_notes:u.notes||void 0}}catch(t){return{}}},S=e=>{const n=document.getElementById("custom-css-".concat(t));if(n&&n.remove(),e.trim()){const n=document.createElement("style");n.id="custom-css-".concat(t);if(/\{[^}]*\}|@media|@keyframes/.test(e))n.textContent=e;else{const a=e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>/!important\s*$/.test(e)?e:"".concat(e," !important")).join(";\n ");n.textContent='\n [data-element="'.concat(t,'"] {\n ').concat(a,";\n }\n ")}document.head.appendChild(n)}};return(0,p.jsx)(y.a,{width:"100%",height:"100%",children:(0,p.jsxs)(ra.t,{size:"sm",variant:"enclosed",colorScheme:"purple",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.PjK,{}),(0,p.jsx)(U.E,{children:"CSS Editor"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.Vap,{}),(0,p.jsx)(U.E,{children:"Examples"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.FrA,{}),(0,p.jsx)(U.E,{children:"AI (beta)"})]})})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{p:0,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,p:4,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:["Custom CSS for ",t]}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{size:"xs",leftIcon:(0,p.jsx)(q.Vap,{}),variant:h?"solid":"outline",colorScheme:h?"blue":"gray",onClick:()=>{u(!h),!h&&c&&S(s)},children:"Preview"}),(0,p.jsx)(T.$,{size:"xs",leftIcon:(0,p.jsx)(q.jTZ,{}),variant:"ghost",onClick:()=>{l("");const e=document.getElementById("custom-css-".concat(t));e&&e.remove(),n("")},children:"Reset"})]})]}),!c&&(0,p.jsxs)(xa.F,{status:"error",borderRadius:"md",fontSize:"sm",children:[(0,p.jsx)(ga._,{}),"Invalid CSS syntax. Check for missing braces or semicolons."]}),(0,p.jsx)(va.T,{value:s,onChange:e=>(e=>{l(e);const t=(e=>{try{return!e.trim()||(e.match(/{/g)||[]).length===(e.match(/}/g)||[]).length}catch(t){return!1}})(e);d(t),t&&h&&S(e)})(e.target.value),placeholder:"/* Enter custom CSS properties */\nbackground: #f0f0f0;\npadding: 20px;\nborder-radius: 10px;",fontFamily:"monospace",fontSize:"sm",minHeight:"300px",bg:(0,b.dU)("gray.50","gray.900"),borderColor:c?z:"red.300",_focus:{borderColor:c?"purple.400":"red.400",boxShadow:c?"0 0 0 1px var(--chakra-colors-purple-400)":"0 0 0 1px var(--chakra-colors-red-400)"}}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",fontSize:"xs",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Pro tip:"}),(0,p.jsx)(U.E,{children:"Use standard CSS properties. Avoid selectors - styles apply to the element automatically."})]})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),colorScheme:"purple",size:"sm",onClick:()=>{c?(S(s),n(s),k({title:"CSS Applied",description:"Custom styles have been applied",status:"success",duration:2e3})):k({title:"Invalid CSS",description:"Please fix CSS errors before saving",status:"error",duration:3e3})},isDisabled:!c,children:"Apply CSS"})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,p:4,children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:"Quick CSS Examples"}),[{label:"Background Gradient",code:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\ncolor: white;"},{label:"Shadow & Hover",code:"box-shadow: 0 10px 25px rgba(0,0,0,0.1);\ntransition: transform 0.3s;\n\n&:hover {\n transform: translateY(-5px);\n}"},{label:"Border Radius",code:"border-radius: 20px;\noverflow: hidden;"},{label:"Animation",code:"animation: fadeIn 1s ease-in;\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}"}].map((e,t)=>(0,p.jsxs)(y.a,{p:3,borderRadius:"md",border:"1px",borderColor:z,cursor:"pointer",transition:"all 0.2s",_hover:{borderColor:"purple.400",transform:"translateX(4px)"},onClick:()=>l(e.code),children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",mb:2,children:e.label}),(0,p.jsx)(ja.C,{fontSize:"xs",display:"block",whiteSpace:"pre",p:2,borderRadius:"sm",bg:(0,b.dU)("gray.100","gray.900"),children:e.code})]},t))]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,p:4,children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:"Vygenerovat CSS pomoc\xed AI"}),(0,p.jsx)(va.T,{value:x,onChange:e=>g(e.target.value),placeholder:"Popi\u0161te, jak m\xe1 dan\xfd blok vypadat (\u010desky). Nap\u0159.: Tmav\xe9 pozad\xed, sv\u011btl\xfd text, zaoblen\xe9 rohy, 2-sloupcov\xfd layout na desktopu, jeden sloupec na mobilu.",fontSize:"sm",minHeight:"120px",bg:(0,b.dU)("gray.50","gray.900"),borderColor:z}),(0,p.jsx)(ee.z,{spacing:2,flexWrap:"wrap",children:["Tmav\xe9 pozad\xed a sv\u011btl\xfd text","Sklen\u011bn\xfd efekt (glassmorphism)","Zaoblen\xe9 rohy a m\u011bkk\xfd st\xedn","Dvou-sloupcov\xfd grid, mobil 1 sloupec","Akcent klubov\xfdch barev"].map((e,t)=>(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>g(t=>"".concat(t," ").concat(e,".")),children:e},t))}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{leftIcon:v?(0,p.jsx)(zn.y,{size:"xs"}):(0,p.jsx)(q.FrA,{}),colorScheme:"purple",size:"sm",isLoading:v,onClick:async()=>{try{f(!0);const e={prompt:x,element_name:t,root_selector:'[data-element="'.concat(t,'"]'),current_css:s,current_styles:o||{},theme:r||{},breakpoints:[640,960,1200],context:_(t)},a=await async function(e){const{data:t}=await m.Ay.post("/ai/css/generate",e);let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(a){n={css:""}}return n}(e),i=((null===a||void 0===a?void 0:a.css)||"").trim();if(!i)return void k({title:"AI nevr\xe1tila CSS",status:"warning",duration:2500});l(i),d(!0),u(!0),S(i),n(i),k({title:"CSS vygenerov\xe1no",status:"success",duration:1500})}catch(e){k({title:"Chyba p\u0159i generov\xe1n\xed CSS",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to znovu",status:"error",duration:3e3})}finally{f(!1)}},children:"Vygenerovat CSS"}),(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>g(""),children:"Vymazat zad\xe1n\xed"})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",fontSize:"xs",children:[(0,p.jsx)(ga._,{}),'AI v\xfdstup je automaticky scope-nut\xfd pod `[data-element="n\xe1zev"]`. Po vygenerov\xe1n\xed se CSS p\u0159edvypln\xed do editoru a lze ho d\xe1l upravovat.']})]})})]})]})})},fa=e=>{let{elementName:t}=e;const n=(0,b.dU)("blue.50","blue.900"),a=(0,b.dU)("blue.200","blue.700"),i=(o=t,{hero:[{label:"Manage Articles",url:"/admin/articles",icon:q.jH2,description:"Edit featured articles"},{label:"Upload Images",url:"/admin/media",icon:q.fZZ,description:"Manage hero images"}],news:[{label:"Manage Articles",url:"/admin/articles",icon:q.jH2,description:"Create and edit news"},{label:"Categories",url:"/admin/categories",icon:q.cnX,description:"Organize article categories"},{label:"Article Settings",url:"/admin/settings/articles",icon:q.VSk,description:"Configure display options"}],matches:[{label:"Manage Matches",url:"/admin/matches",icon:q.wIk,description:"Schedule and edit matches"},{label:"Match Settings",url:"/admin/settings/matches",icon:q.VSk,description:"Configure match display"}],table:[{label:"Update Table",url:"/admin/table",icon:q.VSk,description:"Refresh league standings"},{label:"Team Settings",url:"/admin/settings/team",icon:q.VSk}],team:[{label:"Manage Players",url:"/admin/team/players",icon:q.cfS,description:"Add and edit players"},{label:"Team Settings",url:"/admin/settings/team",icon:q.VSk,description:"Configure team display"}],videos:[{label:"Manage Videos",url:"/admin/videos",icon:q.pVQ,description:"Add YouTube videos"},{label:"Video Settings",url:"/admin/settings/videos",icon:q.VSk,description:"Configure video player"}],gallery:[{label:"Gallery Settings",url:"/admin/settings/gallery",icon:q.fZZ,description:"Set gallery URL"}],merch:[{label:"Fanshop Settings",url:"/admin/settings/fanshop",icon:q.iHs,description:"Configure merchandise"}],newsletter:[{label:"Newsletter Settings",url:"/admin/settings/newsletter",icon:q.pHD,description:"Email configuration"},{label:"Subscribers",url:"/admin/newsletter/subscribers",icon:q.cfS,description:"View subscribers"}],sponsors:[{label:"Manage Sponsors",url:"/admin/sponsors",icon:q.fZZ,description:"Add and edit sponsors"}]}[o]||[{label:"Administrace",url:"/admin",icon:q.VSk,description:"P\u0159ej\xedt do administrace"}]);var o;return(0,p.jsx)(y.a,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(jn.I,{as:q.HaR,color:"blue.500"}),(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:"Rychl\xe9 odkazy administrace"})]}),(0,p.jsx)(y.a,{p:3,borderRadius:"md",bg:n,border:"1px",borderColor:a,children:(0,p.jsx)(w.T,{align:"stretch",spacing:2,divider:(0,p.jsx)(G.c,{}),children:i.map((e,t)=>(0,p.jsx)(L.N,{href:e.url,_hover:{textDecoration:"none"},isExternal:!0,children:(0,p.jsxs)(ee.z,{p:2,borderRadius:"md",transition:"all 0.2s",_hover:{bg:(0,b.dU)("white","gray.800"),transform:"translateX(4px)"},justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:3,flex:1,children:[(0,p.jsx)(jn.I,{as:e.icon,boxSize:4,color:"blue.500"}),(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:e.label}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.description})]})]}),e.badge&&(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"xs",children:e.badge}),(0,p.jsx)(jn.I,{as:q.HaR,boxSize:3,color:"gray.400"})]})},t))})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:"\ud83d\udca1 Tyto odkazy v\xe1m pomohou spravovat obsah t\xe9to sekce"})]})})};var ka=n(9483);const za=e=>{var t;let{elementName:n,onStyleChange:i,currentStyles:o={}}=e;const r=(0,b.dU)("white","gray.800"),s=((0,b.dU)("gray.200","gray.600"),Ye()),l=s.primary||"#0b5cff",[c,d]=(0,a.useState)((0,h.A)({fontFamily:o.fontFamily||"Inter",fontSize:o.fontSize||16,fontWeight:o.fontWeight||400,lineHeight:o.lineHeight||1.5,letterSpacing:o.letterSpacing||0,textTransform:o.textTransform||"none",color:o.color||"#000000",backgroundColor:o.backgroundColor||"#ffffff",paddingTop:o.paddingTop||0,paddingRight:o.paddingRight||0,paddingBottom:o.paddingBottom||0,paddingLeft:o.paddingLeft||0,marginTop:o.marginTop||0,marginRight:o.marginRight||0,marginBottom:o.marginBottom||0,marginLeft:o.marginLeft||0,width:o.width||"auto",height:o.height||"auto",display:o.display||"block",gridTemplateColumns:o.gridTemplateColumns||"repeat(3, 1fr)",gridTemplateRows:o.gridTemplateRows||"auto",gridColumnGap:o.gridColumnGap||16,gridRowGap:o.gridRowGap||16,gridAutoFlow:o.gridAutoFlow||"row",alignItems:o.alignItems||"stretch",justifyItems:o.justifyItems||"stretch",customCSS:o.customCSS||""},o));(0,a.useEffect)(()=>{d((0,h.A)({fontFamily:o.fontFamily||"Inter",fontSize:o.fontSize||16,fontWeight:o.fontWeight||400,lineHeight:o.lineHeight||1.5,letterSpacing:o.letterSpacing||0,textTransform:o.textTransform||"none",color:o.color||"#000000",backgroundColor:o.backgroundColor||"#ffffff",paddingTop:o.paddingTop||0,paddingRight:o.paddingRight||0,paddingBottom:o.paddingBottom||0,paddingLeft:o.paddingLeft||0,marginTop:o.marginTop||0,marginRight:o.marginRight||0,marginBottom:o.marginBottom||0,marginLeft:o.marginLeft||0,width:o.width||"auto",height:o.height||"auto",display:o.display||"block",gridTemplateColumns:o.gridTemplateColumns||"repeat(3, 1fr)",gridTemplateRows:o.gridTemplateRows||"auto",gridColumnGap:o.gridColumnGap||16,gridRowGap:o.gridRowGap||16,gridAutoFlow:o.gridAutoFlow||"row",alignItems:o.alignItems||"stretch",justifyItems:o.justifyItems||"stretch",customCSS:o.customCSS||""},o))},[n,o]);const u=(e,t)=>{const n=(0,h.A)((0,h.A)({},c),{},{[e]:t});d(n),i(n)},[m,x]=(0,a.useState)((null===(t=ka.qE[0])||void 0===t?void 0:t.id)||""),g=(0,a.useMemo)(()=>ka.qE.find(e=>e.id===m)||ka.qE[0],[m]),v=(0,a.useMemo)(()=>{const e=new Map;return ka.qE.forEach(t=>{e.set(t.heading,{name:t.heading,googleFontsUrl:t.googleFontsUrl}),e.set(t.body,{name:t.body,googleFontsUrl:t.googleFontsUrl})}),Array.from(e.values())},[]);return(0,p.jsx)(y.a,{width:"280px",bg:r,borderRight:"1px",borderColor:l,height:"100vh",overflowY:"auto",pt:"60px",children:(0,p.jsxs)(ra.t,{size:"sm",colorScheme:"blue",children:[(0,p.jsxs)(sa.w,{px:2,flexWrap:"wrap",children:[(0,p.jsxs)(la.o,{children:[(0,p.jsx)(q.MRc,{})," ",(0,p.jsx)(U.E,{ml:1,children:"Obsah"})]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(q.Iy6,{})," ",(0,p.jsx)(U.E,{ml:1,children:"Styl"})]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(q.Dw7,{})," ",(0,p.jsx)(U.E,{ml:1,children:"Rozvr\u017een\xed"})]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(q.PjK,{})," ",(0,p.jsx)(U.E,{ml:1,children:"CSS"})]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(q.HaR,{})," ",(0,p.jsx)(U.E,{ml:1,children:"Admin"})]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:"Typografie"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"P\xe1rov\xe1n\xed font\u016f (Setup)"}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(ha.l,{size:"sm",value:m,onChange:e=>{const t=e.target.value;x(t);const n=ka.qE.find(e=>e.id===t);n&&(0,ka.Fd)(n.googleFontsUrl)},children:ka.qE.map(e=>(0,p.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,p.jsxs)(ee.z,{spacing:2,mt:2,children:[(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>{g&&((0,ka.Fd)(g.googleFontsUrl),u("fontFamily",g.cssHeading))},children:"Pou\u017e\xedt nadpisov\xfd"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>{g&&((0,ka.Fd)(g.googleFontsUrl),u("fontFamily",g.cssBody))},children:"Pou\u017e\xedt textov\xfd"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Dostupn\xe9 fonty (Setup)"}),(0,p.jsx)(ha.l,{size:"sm",value:c.fontFamily,onChange:e=>{const t=e.target.value;u("fontFamily",t);const n=ka.qE.find(e=>e.cssHeading===t||e.cssBody===t);n&&(0,ka.Fd)(n.googleFontsUrl)},children:v.map(e=>(0,p.jsx)("option",{value:e.name,children:e.name},e.name))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"P\xedsmo"}),(0,p.jsxs)(ha.l,{size:"sm",value:c.fontFamily,onChange:e=>u("fontFamily",e.target.value),children:[(0,p.jsx)("option",{value:"Inter",children:"Inter"}),(0,p.jsx)("option",{value:"Roboto",children:"Roboto"}),(0,p.jsx)("option",{value:"Open Sans",children:"Open Sans"}),(0,p.jsx)("option",{value:"Lato",children:"Lato"}),(0,p.jsx)("option",{value:"Montserrat",children:"Montserrat"}),(0,p.jsx)("option",{value:"Poppins",children:"Poppins"}),(0,p.jsx)("option",{value:"Georgia",children:"Georgia"}),(0,p.jsx)("option",{value:"Times New Roman",children:"Times New Roman"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Velikost (px)"}),(0,p.jsx)(ee.z,{children:(0,p.jsxs)(ua.Q7,{size:"sm",value:c.fontSize,min:8,max:128,onChange:(e,t)=>u("fontSize",t),flex:1,children:[(0,p.jsx)(ua.OO,{}),(0,p.jsxs)(ua.lw,{children:[(0,p.jsx)(ua.Q0,{}),(0,p.jsx)(ua.Sh,{})]})]})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Tlou\u0161\u0165ka"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(ma.Ap,{value:c.fontWeight,min:100,max:900,step:100,onChange:e=>u("fontWeight",e),flex:1,children:[(0,p.jsx)(ma.hB,{children:(0,p.jsx)(ma.hJ,{bg:l})}),(0,p.jsx)(ma.OQ,{})]}),(0,p.jsx)(U.E,{fontSize:"xs",minW:"40px",children:c.fontWeight})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"\u0158\xe1dkov\xe1n\xed"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(ma.Ap,{value:c.lineHeight,min:.5,max:3,step:.1,onChange:e=>u("lineHeight",e),flex:1,children:[(0,p.jsx)(ma.hB,{children:(0,p.jsx)(ma.hJ,{bg:l})}),(0,p.jsx)(ma.OQ,{})]}),(0,p.jsx)(U.E,{fontSize:"xs",minW:"40px",children:c.lineHeight.toFixed(1)})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Mezera mezi p\xedsmeny (px)"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(ma.Ap,{value:c.letterSpacing,min:-5,max:10,step:.1,onChange:e=>u("letterSpacing",e),flex:1,children:[(0,p.jsx)(ma.hB,{children:(0,p.jsx)(ma.hJ,{bg:l})}),(0,p.jsx)(ma.OQ,{})]}),(0,p.jsx)(U.E,{fontSize:"xs",minW:"40px",children:c.letterSpacing.toFixed(1)})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Transformace"}),(0,p.jsxs)(ha.l,{size:"sm",value:c.textTransform,onChange:e=>u("textTransform",e.target.value),children:[(0,p.jsx)("option",{value:"none",children:"\u017d\xe1dn\xe9"}),(0,p.jsx)("option",{value:"uppercase",children:"VELK\xc1 P\xcdSMENA"}),(0,p.jsx)("option",{value:"lowercase",children:"mal\xe1 p\xedsmena"}),(0,p.jsx)("option",{value:"capitalize",children:"Prvn\xed p\xedsmena velk\xe1"})]})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:"Barvy"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Barva textu"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"color",value:c.color,onChange:e=>u("color",e.target.value),size:"sm",w:"60px",p:1}),(0,p.jsx)(C.p,{value:c.color,onChange:e=>u("color",e.target.value),size:"sm",placeholder:"#000000"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Barva pozad\xed"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"color",value:c.backgroundColor,onChange:e=>u("backgroundColor",e.target.value),size:"sm",w:"60px",p:1}),(0,p.jsx)(C.p,{value:c.backgroundColor,onChange:e=>u("backgroundColor",e.target.value),size:"sm",placeholder:"#ffffff"})]})]}),(0,p.jsx)(G.c,{my:2}),(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:"Odsazen\xed a okraje"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Vnit\u0159n\xed odsazen\xed (px)"}),(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"N"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.paddingTop,min:0,onChange:(e,t)=>u("paddingTop",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"P"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.paddingRight,min:0,onChange:(e,t)=>u("paddingRight",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"D"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.paddingBottom,min:0,onChange:(e,t)=>u("paddingBottom",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"L"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.paddingLeft,min:0,onChange:(e,t)=>u("paddingLeft",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Vn\u011bj\u0161\xed okraj (px)"}),(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"N"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.marginTop,onChange:(e,t)=>u("marginTop",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"P"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.marginRight,onChange:(e,t)=>u("marginRight",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"D"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.marginBottom,onChange:(e,t)=>u("marginBottom",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(ee.z,{width:"100%",children:[(0,p.jsx)(U.E,{fontSize:"xs",minW:"20px",children:"L"}),(0,p.jsx)(ua.Q7,{size:"xs",value:c.marginLeft,onChange:(e,t)=>u("marginLeft",t),flex:1,children:(0,p.jsx)(ua.OO,{})})]})]})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:"M\u0159\xed\u017ekov\xe9 rozlo\u017een\xed"}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{fontSize:"xs",mb:0,flex:1,children:"Povolit m\u0159\xed\u017ekov\xe9 rozlo\u017een\xed"}),(0,p.jsx)(pa.d,{size:"sm",isChecked:"grid"===c.display,onChange:e=>u("display",e.target.checked?"grid":"block"),sx:{"span[data-checked]":{bg:l,borderColor:l}}})]}),"grid"===c.display&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",fontWeight:"bold",children:"Rychl\xe9 \u0161ablony"}),(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.PCV,{}),(0,p.jsx)(U.E,{children:"Jeden sloupec"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","1fr 1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(pe.vgu,{}),(0,p.jsx)(U.E,{children:"Dva stejn\xe9 (50 % / 50 %)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","2fr 1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.vQY,{}),(0,p.jsx)(U.E,{children:"Vlevo v\u011bt\u0161\xed (66 % / 33 %)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","1fr 2fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.vQY,{style:{transform:"scaleX(-1)"}}),(0,p.jsx)(U.E,{children:"Vpravo v\u011bt\u0161\xed (33 % / 66 %)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","1fr 1fr 1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.QPV,{}),(0,p.jsx)(U.E,{children:"T\u0159i stejn\xe9 (33 % / 33 % / 33 %)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","2fr 1fr 1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(pe.lSZ,{}),(0,p.jsx)(U.E,{children:"Zv\xfdrazn\u011bn\xfd + dva (50 % / 25 % / 25 %)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","repeat(4, 1fr)"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(pe.PVM,{}),(0,p.jsx)(U.E,{children:"\u010cty\u0159i stejn\xe9 (25 % ka\u017ed\xe1)"})]})}),(0,p.jsx)(T.$,{size:"xs",width:"100%",variant:"outline",onClick:()=>u("gridTemplateColumns","3fr 1fr"),justifyContent:"flex-start",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.E19,{}),(0,p.jsx)(U.E,{children:"Hlavn\xed + postrann\xed (75 % / 25 %)"})]})})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Sloupce m\u0159\xed\u017eky"}),(0,p.jsx)(C.p,{size:"sm",value:c.gridTemplateColumns,onChange:e=>u("gridTemplateColumns",e.target.value),placeholder:"nap\u0159. 1fr 2fr nebo 300px 1fr",fontFamily:"monospace",fontSize:"xs"}),(0,p.jsx)(U.E,{fontSize:"10px",color:"gray.500",mt:1,children:"P\u0159\xedklady: 1fr 1fr | 2fr 1fr | 200px 1fr | repeat(3, 1fr)"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"\u0158\xe1dky m\u0159\xed\u017eky"}),(0,p.jsx)(C.p,{size:"sm",value:c.gridTemplateRows,onChange:e=>u("gridTemplateRows",e.target.value),placeholder:"auto nebo 200px 1fr",fontFamily:"monospace",fontSize:"xs"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Mezera mezi sloupci (px)"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(ma.Ap,{value:c.gridColumnGap,min:0,max:100,step:4,onChange:e=>u("gridColumnGap",e),flex:1,children:[(0,p.jsx)(ma.hB,{children:(0,p.jsx)(ma.hJ,{bg:"purple.500"})}),(0,p.jsx)(ma.OQ,{})]}),(0,p.jsxs)(U.E,{fontSize:"xs",minW:"40px",children:[c.gridColumnGap,"px"]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Mezera mezi \u0159\xe1dky (px)"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(ma.Ap,{value:c.gridRowGap,min:0,max:100,step:4,onChange:e=>u("gridRowGap",e),flex:1,children:[(0,p.jsx)(ma.hB,{children:(0,p.jsx)(ma.hJ,{bg:"purple.500"})}),(0,p.jsx)(ma.OQ,{})]}),(0,p.jsxs)(U.E,{fontSize:"xs",minW:"40px",children:[c.gridRowGap,"px"]})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Automatick\xe9 rozm\xedst\u011bn\xed"}),(0,p.jsxs)(ha.l,{size:"sm",value:c.gridAutoFlow,onChange:e=>u("gridAutoFlow",e.target.value),children:[(0,p.jsx)("option",{value:"row",children:"\u0158\xe1dek (vodorovn\u011b)"}),(0,p.jsx)("option",{value:"column",children:"Sloupec (svisle)"}),(0,p.jsx)("option",{value:"row dense",children:"\u0158\xe1dek (zahu\u0161t\u011bn\xfd)"}),(0,p.jsx)("option",{value:"column dense",children:"Sloupec (zahu\u0161t\u011bn\xfd)"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Zarovn\xe1n\xed prvk\u016f (vertik\xe1ln\u011b)"}),(0,p.jsxs)(ha.l,{size:"sm",value:c.alignItems,onChange:e=>u("alignItems",e.target.value),children:[(0,p.jsx)("option",{value:"stretch",children:"Rozt\xe1hnout"}),(0,p.jsx)("option",{value:"start",children:"Za\u010d\xe1tek"}),(0,p.jsx)("option",{value:"center",children:"St\u0159ed"}),(0,p.jsx)("option",{value:"end",children:"Konec"}),(0,p.jsx)("option",{value:"baseline",children:"Z\xe1kladn\xed \u0159\xe1dek"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"xs",children:"Zarovn\xe1n\xed prvk\u016f (horizont\xe1ln\u011b)"}),(0,p.jsxs)(ha.l,{size:"sm",value:c.justifyItems,onChange:e=>u("justifyItems",e.target.value),children:[(0,p.jsx)("option",{value:"stretch",children:"Rozt\xe1hnout"}),(0,p.jsx)("option",{value:"start",children:"Za\u010d\xe1tek"}),(0,p.jsx)("option",{value:"center",children:"St\u0159ed"}),(0,p.jsx)("option",{value:"end",children:"Konec"})]})]})]})]})}),(0,p.jsx)(da.K,{p:0,children:(0,p.jsx)(ya,{elementName:n,onCSSChange:e=>u("customCSS",e),currentCSS:c.customCSS||"",currentStyles:c,theme:{primary:s.primary,secondary:s.secondary,accent:s.accent}})}),(0,p.jsx)(da.K,{children:(0,p.jsx)(fa,{elementName:n})})]})]})})},wa=["style-pack","header","hero-topbar","hero","news","matches","matches-slider","table","team","gallery","videos","merch","newsletter","poll","sponsors","banner"],_a=[{page_type:"homepage",element_name:"style-pack",variant:"default",visible:!0,display_order:-1,settings:{}},{page_type:"homepage",element_name:"header",variant:"unified",visible:!0,display_order:0,settings:{}},{page_type:"homepage",element_name:"hero-topbar",variant:"brand",visible:!0,display_order:1,settings:{}},{page_type:"homepage",element_name:"hero",variant:"grid",visible:!0,display_order:1,settings:{}},{page_type:"homepage",element_name:"news",variant:"grid",visible:!0,display_order:11,settings:{}},{page_type:"homepage",element_name:"matches",variant:"compact",visible:!0,display_order:2,settings:{}},{page_type:"homepage",element_name:"matches-slider",variant:"carousel",visible:!0,display_order:4,settings:{}},{page_type:"homepage",element_name:"sponsors",variant:"grid",visible:!0,display_order:9,settings:{}},{page_type:"homepage",element_name:"gallery",variant:"grid",visible:!1,display_order:5,settings:{}},{page_type:"homepage",element_name:"videos",variant:"grid",visible:!1,display_order:7,settings:{}},{page_type:"homepage",element_name:"team",variant:"grid",visible:!1,display_order:6,settings:{}},{page_type:"homepage",element_name:"merch",variant:"grid",visible:!0,display_order:8,settings:{}},{page_type:"homepage",element_name:"table",variant:"split_news",visible:!0,display_order:3,settings:{}},{page_type:"homepage",element_name:"banner",variant:"top",visible:!1,display_order:10,settings:{}},{page_type:"homepage",element_name:"newsletter",variant:"default",visible:!1,display_order:4,settings:{}},{page_type:"homepage",element_name:"poll",variant:"vertical",visible:!1,display_order:12,settings:{}}],Sa={hero:["grid","scroller","swiper","swiper_full"],news:["grid","scroller"],matches:["compact"],sponsors:["grid","slider","scroller","pyramid"],gallery:["grid"],videos:["grid"],merch:["grid"],table:["split_news"],banner:["top"],sidebar:["right"],newsletter:["default"]},Ca=e=>{var t;let{pageType:n,onConfigChange:i}=e;const{user:o}=v(),r="admin"===(null===o||void 0===o?void 0:o.role),s=Ye(),[l,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)([]),[x,g]=(0,a.useState)({}),[f,k]=(0,a.useState)(!1),[_,S]=(0,a.useState)(null),[A,E]=(0,a.useState)(null),[N,R]=(0,a.useState)(null),[P,I]=(0,a.useState)(!1),[W,M]=(0,a.useState)(!1),[D,L]=(0,a.useState)(new Set),[F,O]=(0,a.useState)([]),[Z,V]=(0,a.useState)(null),[H,$]=(0,a.useState)(null),[B]=(0,a.useState)("desktop"),[J,Y]=(0,a.useState)({}),[X,ne]=(0,a.useState)(!0),[ae,ie]=(0,a.useState)(!1),[oe,re]=(0,a.useState)(""),[se,le]=(0,a.useState)("all"),[ce,de]=(0,a.useState)(!0),[he,ue]=(0,a.useState)({variants:{},visible:new Set,order:[],css:{}}),me=(0,a.useRef)(null),xe=(0,a.useRef)(!1),[ge,je]=(0,a.useState)(!1),[be,ye]=(0,a.useState)(null),[fe,ke]=(0,a.useState)(0),ze=(0,a.useRef)([]);(0,a.useEffect)(()=>{ze.current=F},[F]);const[we,_e]=(0,a.useState)({stylePicker:{x:0,y:0,width:360,height:550},layersPanel:{x:0,y:0,width:320,height:600},visualStylePanel:{x:0,y:60,width:320,height:700},elementPicker:{x:0,y:0,width:600,height:600}}),[Se,Ce]=(0,a.useState)(null),[Ae,Ee]=(0,a.useState)({x:0,y:0}),[Te,Ne]=(0,a.useState)(null),Re=(0,j.d)(),Pe=((0,b.dU)("white","gray.800"),(0,b.dU)("gray.200","gray.600")),Ie=((0,b.dU)("blue.50","blue.900"),s.primary||"#0b5cff"),We=s.secondary||"#ffd200",Me=Ie,De=(0,a.useCallback)(e=>{const t=Zt[e]||[];if("homepage"===n){const n=Sa[e];if(n&&n.length>0)return t.filter(e=>n.includes(e.value))}return t},[n]),Ue=(0,a.useCallback)(e=>{const t=Ot.find(t=>t.name===e),n=null===t||void 0===t?void 0:t.defaultVariant,a=De(e);return 0===a.length?n||"default":n&&a.some(e=>e.value===n)?n:a[0].value},[De]),Le=(0,a.useCallback)((e,t)=>{const n=De(e);return 0===n.length?t||Ue(e):t&&n.some(e=>e.value===t)?t:Ue(e)},[De,Ue]),Fe=(0,a.useCallback)((e,t)=>{const n=t.target;if(!n.closest(".panel-header")&&!n.classList.contains("panel-header"))return;t.preventDefault(),t.stopPropagation();const a=t.currentTarget.getBoundingClientRect();Ce(e),Ee({x:t.clientX-a.left,y:t.clientY-a.top})},[]),Oe=(0,a.useCallback)(e=>{if(!Se)return;const t=e.clientX-Ae.x,n=e.clientY-Ae.y;_e(e=>(0,h.A)((0,h.A)({},e),{},{[Se]:(0,h.A)((0,h.A)({},e[Se]),{},{x:Math.max(0,Math.min(t,window.innerWidth-e[Se].width)),y:Math.max(0,Math.min(n,window.innerHeight-e[Se].height))})}))},[Se,Ae]),Ze=(0,a.useCallback)(()=>{Ce(null),Ne(null)},[]);(0,a.useEffect)(()=>{if(Se)return window.addEventListener("mousemove",Oe),window.addEventListener("mouseup",Ze),()=>{window.removeEventListener("mousemove",Oe),window.removeEventListener("mouseup",Ze)}},[Se,Oe,Ze]);const Ke=(0,a.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation(),Ne(e),Ee({x:t.clientX,y:t.clientY})},[]),qe=(0,a.useCallback)(e=>{if(!Te)return;const t=e.clientX-Ae.x,n=e.clientY-Ae.y;_e(e=>{const a=e[Te];return(0,h.A)((0,h.A)({},e),{},{[Te]:(0,h.A)((0,h.A)({},a),{},{width:Math.max(280,a.width+t),height:Math.max(300,a.height+n)})})}),Ee({x:e.clientX,y:e.clientY})},[Te,Ae]);(0,a.useEffect)(()=>{if(Te)return window.addEventListener("mousemove",qe),window.addEventListener("mouseup",Ze),()=>{window.removeEventListener("mousemove",qe),window.removeEventListener("mouseup",Ze)}},[Te,qe,Ze]),(0,a.useEffect)(()=>{if("edit"===new URLSearchParams(window.location.search).get("myuibrix")){c(!0);const e=window.location.pathname;window.history.replaceState({},"",e),Re({title:"MyUIbrix Editor",description:"Re\u017eim \xfaprav byl aktivov\xe1n. Klikn\u011bte na elementy pro jejich \xfapravu.",status:"info",duration:5e3,isClosable:!0})}},[]),(0,a.useEffect)(()=>{try{l?document.body.classList.add("myuibrix-edit-mode"):document.body.classList.remove("myuibrix-edit-mode")}catch(e){}return()=>{try{document.body.classList.remove("myuibrix-edit-mode")}catch(e){}}},[l]),(0,a.useEffect)(()=>{let e=null;try{l&&(e=document.createElement("style"),e.id="myuibrix-footer-editor-fixes",e.textContent='\n body.myuibrix-edit-mode [data-watermark="myclub"] { display: none !important; }\n body.myuibrix-edit-mode [data-element="footer"] { position: relative; z-index: 0; }\n ',document.head.appendChild(e))}catch(t){}return()=>{try{const e=document.getElementById("myuibrix-footer-editor-fixes");e&&e.remove()}catch(e){}}},[l]),(0,a.useEffect)(()=>{try{ge?document.body.classList.add("myuibrix-cross-container-reorder"):document.body.classList.remove("myuibrix-cross-container-reorder")}catch(e){}return()=>{try{document.body.classList.remove("myuibrix-cross-container-reorder")}catch(e){}}},[ge]),(0,a.useEffect)(()=>{l&&M(!0)},[l]),(0,a.useEffect)(()=>{try{const e=aa(".container");if(!e)return void ke(0);const t=window.getComputedStyle(e);if("grid"!==t.display)return void ke(0);const n=t.gridTemplateColumns||"";let a=0;const i=n.match(/repeat\((\d+)/);i&&(a=parseInt(i[1],10)),a||(a=n.split(" ").filter(Boolean).length||2),ke(a)}catch(e){ke(0)}},[l,J]),(0,a.useEffect)(()=>{if(l&&ce){const e=setTimeout(()=>{de(!1)},5e3);return()=>clearTimeout(e)}},[l,ce]),(0,a.useEffect)(()=>{(async()=>{try{const e=await Ft(n),t=(e.length>0?e:_a).map(e=>(0,h.A)((0,h.A)({},e),{},{variant:Le(e.element_name,e.variant)})),a={};t.forEach(e=>{const t=e.settings&&e.settings.customCSS||"";t&&(a[e.element_name]=String(t))}),u(t);const i={},o=new Set,r=[...t].sort((e,t)=>(e.display_order||0)-(t.display_order||0)),s=[];r.forEach(e=>{i[e.element_name]=e.variant,!1!==e.visible&&o.add(e.element_name),s.push(e.element_name)}),g(i),L(o),O(s),Object.keys(a).length>0&&(Y(e=>{const t=(0,h.A)({},e);return Object.entries(a).forEach(e=>{let[n,a]=e;t[n]=(0,h.A)((0,h.A)({},t[n]||{}),{},{customCSS:a})}),t}),Object.entries(a).forEach(e=>{let[t,n]=e;try{const e="custom-css-".concat(t),a=document.getElementById(e);a&&a.remove();const i=document.createElement("style");i.id=e;if(/\{[^}]*\}|@media|@keyframes/.test(n))i.textContent=n;else{const e=n.split(";").map(e=>e.trim()).filter(Boolean).map(e=>/!important\s*$/.test(e)?e:"".concat(e," !important")).join(";\n ");i.textContent='\n [data-element="'.concat(t,'"] {\n ').concat(e,";\n }\n ")}document.head.appendChild(i)}catch(a){}})),ue({variants:(0,h.A)({},i),visible:new Set(o),order:[...s],css:a}),0===e.length&&(k(!0),ue({variants:{},visible:new Set,order:[],css:{}}))}catch(e){console.error("Failed to load page element configs:",e);const t=_a.map(e=>(0,h.A)((0,h.A)({},e),{},{variant:Le(e.element_name,e.variant)})),n={},a=new Set,i=[];t.forEach(e=>{n[e.element_name]=e.variant,!1!==e.visible&&a.add(e.element_name),i.push(e.element_name)}),u(t),g(n),L(a),O(i),k(!0),ue({variants:{},visible:new Set,order:[],css:{}})}})()},[n,Le]);const Ve=(0,a.useMemo)(()=>{try{const e=he||{variants:{},visible:new Set,order:[],css:{}},t=new Set([...Object.keys(x||{}),...Object.keys(e.variants||{}),...F,...e.order]),n=new Set;t.forEach(t=>{var a,i;(Le(t,x[t])||"")!==(Le(t,e.variants[t])||"")&&n.add(t);D.has(t)!==e.visible.has(t)&&n.add(t);String((null===(a=J[t])||void 0===a?void 0:a.customCSS)||"").trim()!==String((null===(i=e.css)||void 0===i?void 0:i[t])||"").trim()&&n.add(t)});const a=F.length===e.order.length&&F.every((t,n)=>t===e.order[n]);return n.size+(a?0:1)}catch(e){return 0}},[x,D,F,he,Le]);(0,a.useEffect)(()=>{k(Ve>0)},[Ve]),(0,a.useEffect)(()=>{if(!l)return;const e=e=>{"Escape"===e.key&&(P?I(!1):W?M(!1):_?S(null):c(!1)),(e.ctrlKey||e.metaKey)&&"s"===e.key&&f&&(e.preventDefault(),lt()),"l"!==e.key||e.ctrlKey||e.metaKey||e.altKey||M(!W),"a"!==e.key||e.ctrlKey||e.metaKey||e.altKey||I(!0),_&&("ArrowUp"!==e.key||e.shiftKey||(e.preventDefault(),et(_)),"ArrowDown"!==e.key||e.shiftKey||(e.preventDefault(),tt(_)),"Delete"!==e.key&&"Backspace"!==e.key||(e.preventDefault(),Qe(_)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,_,P,W,f]),(0,a.useEffect)(()=>{if(!l)return ia(".elementor-overlay").forEach(e=>{e.replaceWith(e.cloneNode(!0)),e.remove()}),void S(null);const e=e=>{const t='[data-element="'.concat(e,'"]');ia(t).forEach(t=>{if(t.querySelector(".elementor-overlay"))return;const n=document.createElement("div");n.className="elementor-overlay",n.style.cssText="\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: auto;\n border: 2px dashed transparent;\n transition: all 0.2s;\n z-index: 9998;\n cursor: move;\n user-select: none;\n -webkit-user-select: none;\n ";const a=document.createElement("div");a.className="elementor-badge",a.textContent=e.toUpperCase(),a.style.cssText="\n position: absolute;\n top: -1px;\n left: -1px;\n background: ".concat(Ie,";\n color: white;\n padding: 4px 12px;\n font-size: 11px;\n font-weight: 700;\n border-radius: 0 0 6px 0;\n opacity: 0;\n transition: opacity 0.2s;\n pointer-events: none;\n z-index: 9999;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n ");const i=document.createElement("div");i.className="elementor-actions",i.style.cssText="\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n gap: 4px;\n opacity: 0;\n transition: opacity 0.2s;\n z-index: 10000;\n pointer-events: auto;\n ";const o=document.createElement("button");o.innerHTML="\u2699\ufe0f",o.title="Upravit styl",o.style.cssText="\n background: ".concat(Ie,";\n color: white;\n border: none;\n width: 32px;\n height: 32px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n transition: transform 0.2s;\n "),o.onmouseover=()=>o.style.transform="scale(1.1)",o.onmouseout=()=>o.style.transform="scale(1)";const r=document.createElement("button");r.innerHTML="\u2b06\ufe0f",r.title="P\u0159esunout nahoru",r.style.cssText=o.style.cssText,r.onmouseover=()=>r.style.transform="scale(1.1)",r.onmouseout=()=>r.style.transform="scale(1)";const s=document.createElement("button");s.innerHTML="\u2b07\ufe0f",s.title="P\u0159esunout dol\u016f",s.style.cssText=o.style.cssText,s.onmouseover=()=>s.style.transform="scale(1.1)",s.onmouseout=()=>s.style.transform="scale(1)";const l=document.createElement("button");l.innerHTML="\ud83d\uddd1\ufe0f",l.title="Odstranit element",l.style.cssText="\n background: #e53e3e;\n color: white;\n border: none;\n width: 32px;\n height: 32px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n transition: transform 0.2s;\n ",l.onmouseover=()=>l.style.transform="scale(1.1)",l.onmouseout=()=>l.style.transform="scale(1)";const c=document.createElement("button");c.innerHTML="\u2795",c.title="P\u0159idat p\u0159ed",c.style.cssText=o.style.cssText,c.onmouseover=()=>c.style.transform="scale(1.1)",c.onmouseout=()=>c.style.transform="scale(1)";const d=document.createElement("button");d.innerHTML="\u2795",d.title="P\u0159idat za",d.style.cssText=o.style.cssText,d.onmouseover=()=>d.style.transform="scale(1.1)",d.onmouseout=()=>d.style.transform="scale(1)";let h=null;if(fe>1){h=document.createElement("div"),h.className="elementor-col-picker",h.style.cssText="\n display: flex;\n gap: 4px;\n ";for(let e=0;e<fe;e++){const t=document.createElement("button");t.innerHTML="\u2795",t.title="P\u0159idat do sloupce ".concat(e+1),t.style.cssText=o.style.cssText,t.onmouseover=()=>t.style.transform="scale(1.1)",t.onmouseout=()=>t.style.transform="scale(1)",t.addEventListener("click",t=>{t.stopPropagation();try{const t=Math.max(1,fe||1),n=ze.current.length;let a=0;for(let o=0;o<n;o++)o%t===e&&a++;const i=e+a*t;ye(Math.min(i,ze.current.length)),I(!0)}catch(n){}}),ea(h,t)}}ea(i,o),ea(i,r),ea(i,s),ea(i,c),ea(i,d),fe>1&&h&&ea(i,h),ea(i,l),ea(n,a),ea(n,i);"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),ea(t,n)?(n.addEventListener("click",n=>{if(n.target.closest(".elementor-actions"))return;n.stopPropagation();const a=t.getBoundingClientRect();R({top:a.top,left:a.left,width:a.width,height:a.height}),S(e),ne(!0)}),n.addEventListener("mouseenter",()=>{E(e),n.style.border="2px dashed ".concat(Ie),n.style.background="".concat(Ie,"15"),a.style.opacity="1",i.style.opacity="1"}),n.addEventListener("mouseleave",()=>{E(null),_!==e&&(n.style.border="2px dashed transparent",n.style.background="transparent",a.style.opacity="0",i.style.opacity="0")}),o.addEventListener("click",n=>{n.stopPropagation();const a=t.getBoundingClientRect();R({top:a.top,left:a.left,width:a.width,height:a.height}),S(e),ne(!0)}),r.addEventListener("click",t=>{t.stopPropagation(),et(e)}),s.addEventListener("click",t=>{t.stopPropagation(),tt(e)}),l.addEventListener("click",t=>{t.stopPropagation(),confirm('Opravdu chcete odstranit element "'.concat(e,'"?'))&&Qe(e)}),c.addEventListener("click",t=>{t.stopPropagation();try{const t=ze.current.indexOf(e);t>=0&&(ye(t),I(!0))}catch(n){}}),d.addEventListener("click",t=>{t.stopPropagation();try{const t=ze.current.indexOf(e);t>=0&&(ye(t+1),I(!0))}catch(n){}}),n.draggable=!0,n.addEventListener("dragstart",t=>{t.stopPropagation();try{var a;null===(a=t.dataTransfer)||void 0===a||a.setData("text/plain",e)}catch(i){}V(e),n.style.opacity="0.5"}),n.addEventListener("dragend",e=>{e.stopPropagation(),n.style.opacity="1",V(null)}),n.addEventListener("dragover",t=>{t.preventDefault(),t.stopPropagation();try{t.dataTransfer.dropEffect="move"}catch(a){}Z&&Z!==e&&(n.style.border="3px solid ".concat(We),$(e))}),n.addEventListener("dragleave",t=>{t.stopPropagation(),_!==e&&(n.style.border="2px dashed ".concat(Ie)),$(null)}),n.addEventListener("drop",t=>{if(t.preventDefault(),t.stopPropagation(),Z&&Z!==e){const t=[...ze.current],n=t.indexOf(Z),a=t.indexOf(e);-1!==n&&-1!==a&&(t.splice(n,1),t.splice(a,0,Z),O(t),k(!0),$e(t))}n.style.border="2px dashed ".concat(Ie),$(null)})):console.warn("Failed to add overlay to element: ".concat(e))})};try{const t=Array.from(ia("[data-element]"));Array.from(new Set(t.map(e=>e.getAttribute("data-element")).filter(e=>!!e&&"container"!==e))).forEach(t=>e(t))}catch(a){("homepage"===n?wa:Object.keys(Zt)).forEach(t=>{Zt[t]&&e(t)})}const t=e=>{"Escape"===e.key&&S(null)};return document.addEventListener("keydown",t),()=>{try{ia(".elementor-overlay").forEach(e=>{try{const t=e.cloneNode(!1),n=e.parentElement;n&&na(n,t,e)&&ta(n,t)}catch(t){console.warn("Failed to cleanup overlay:",t)}})}catch(e){console.error("Error during cleanup:",e)}try{document.removeEventListener("keydown",t)}catch(e){console.warn("Failed to remove event listener:",e)}Be.current&&clearTimeout(Be.current)}},[l,_,n,F,D]),(0,a.useEffect)(()=>{ia(".elementor-overlay").forEach(e=>{const t=e.parentElement,n=null===t||void 0===t?void 0:t.getAttribute("data-element");if(n===_){e.style.border="3px solid ".concat(Ie),e.style.background="".concat(Ie,"1A");const t=e.querySelector(".elementor-badge");t&&(t.style.opacity="1",t.style.background=Ie)}else if(n===A){e.style.border="2px dashed ".concat(Ie),e.style.background="".concat(Ie,"15");const t=e.querySelector(".elementor-badge");t&&(t.style.opacity="1")}else{e.style.border="2px dashed transparent",e.style.background="transparent";const t=e.querySelector(".elementor-badge");t&&(t.style.opacity="0")}})},[_,A]);const He=(0,a.useCallback)((e,t)=>{const n=De(e);if(!n||0===n.length)return void console.warn('Invalid variant "'.concat(t,'" for element "').concat(e,'"'));const a=Le(e,t),i=()=>{try{const t=(0,h.A)((0,h.A)({},x),{},{[e]:a});g(t),k(!0),u(t=>{const n=t.findIndex(t=>t.element_name===e);if(-1!==n){const e=[...t];return e[n]=(0,h.A)((0,h.A)({},e[n]),{},{variant:a}),e}return t}),l&&requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("myuibrix-change",{detail:{elementName:e,variant:a,visible:D.has(e),previewMode:!0}}))})}catch(t){console.error("Error applying variant change:",t),Re({title:"Chyba p\u0159i aplikaci stylu",description:"Styl se nepoda\u0159ilo aplikovat. Zkuste to pros\xedm znovu.",status:"error",duration:3e3,isClosable:!0})}};if(xe.current){const e=()=>{xe.current?setTimeout(e,50):i()};return void setTimeout(e,50)}i()},[x,D,l,Re,De,Le]),$e=(0,a.useCallback)(e=>{xe.current||(xe.current=!0,requestAnimationFrame(()=>{try{var t,n;if(ge||"undefined"!==typeof document&&(null===(t=document.body)||void 0===t||null===(n=t.classList)||void 0===n?void 0:n.contains("myuibrix-cross-container-reorder"))){const t=aa(".container")||aa(".myuibrix-viewport-wrapper")||aa("main")||null;t&&(e.forEach(e=>{const n=aa('[data-element="'.concat(e,'"]'));n&&n.parentElement!==t&&ea(t,n)}),e.forEach(e=>{const n=aa('[data-element="'.concat(e,'"]'));if(n){try{n.style.order=""}catch(a){}ea(t,n)}}))}else{const t=new Map;e.forEach(e=>{const n=aa('[data-element="'.concat(e,'"]'));if(!n||!n.parentElement)return;const a=n.parentElement;t.has(a)||t.set(a,[]),t.get(a).push(n)}),t.forEach((t,n)=>{t.forEach(e=>{try{e.style.order=""}catch(t){}}),e.forEach(e=>{const t=aa('[data-element="'.concat(e,'"]'));t&&t.parentElement===n&&ea(n,t)})})}window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:e,previewMode:!0}})),setTimeout(()=>{xe.current=!1},50)}catch(a){console.error("Error during DOM reordering:",a),xe.current=!1}}))},[ge]),Be=(0,a.useRef)(null),Je=(0,a.useCallback)((e,t)=>{Y(n=>(0,h.A)((0,h.A)({},n),{},{[e]:t})),k(!0),Be.current&&clearTimeout(Be.current),Be.current=setTimeout(()=>{l&&window.dispatchEvent(new CustomEvent("myuibrix-style-change",{detail:{elementName:e,styles:t,previewMode:!0}}))},100)},[l]),Ge=(0,a.useCallback)(e=>{const t=Math.max(1,fe||1),n=ze.current.length;let a=0;for(let i=0;i<n;i++)i%t===e&&a++;return e+a*t},[fe]),Xe=(0,a.useCallback)((e,t)=>{const a=Ot.find(t=>t.name===e),i=x[e],o=Le(e,(null===a||void 0===a?void 0:a.defaultVariant)||"default"),r=Le(e,i||o);x[e]||g(t=>(0,h.A)((0,h.A)({},t),{},{[e]:r})),L(t=>{const n=new Set(t);return n.add(e),n}),u(t=>{const a=t.findIndex(t=>t.element_name===e);if(-1!==a){const e=[...t];return e[a]=(0,h.A)((0,h.A)({},e[a]),{},{variant:r,visible:!0}),e}return[...t,{page_type:n,element_name:e,variant:r,visible:!0,display_order:t.length}]}),k(!0),I(!1),re(""),le("all"),O(n=>{const a="number"===typeof t?t:null!=be?be:void 0;if(n.includes(e)){try{Re({title:"Duplicitn\xed element",description:"Tento element ji\u017e na str\xe1nce existuje. P\u0159esouv\xe1m existuj\xedc\xed na zvolen\xe9 m\xedsto.",status:"warning",duration:2500,isClosable:!0})}catch(o){}const t=n.indexOf(e);if("number"===typeof a&&a!==t){const i=[...n];return i.splice(t,1),i.splice(Math.min(a,i.length),0,e),l&&requestAnimationFrame(()=>{$e(i),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:i,previewMode:!0}}))}),i}return l&&requestAnimationFrame(()=>{$e(n),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:n,previewMode:!0}}))}),n}const i=[...n];return"number"===typeof a?i.splice(Math.min(a,i.length),0,e):i.push(e),l&&requestAnimationFrame(()=>{$e(i),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:i,previewMode:!0}}))}),setTimeout(()=>{try{const t=aa('[data-element="'.concat(e,'"]'));t&&(t.style.display="")}catch(t){}},0),i}),l&&window.dispatchEvent(new CustomEvent("myuibrix-change",{detail:{elementName:e,variant:r,visible:!0,previewMode:!0}})),ye(null);try{S(e),setTimeout(()=>{const t=aa('[data-element="'.concat(e,'"]'));if(t){const e=t.getBoundingClientRect();R({top:e.top,left:e.left,width:e.width,height:e.height}),ne(!0)}},0)}catch(s){}},[x,l,Le,n,$e,be]),Qe=(0,a.useCallback)(e=>{const t=new Set(D);t.delete(e),L(t),k(!0),S(null),l&&window.dispatchEvent(new CustomEvent("myuibrix-change",{detail:{elementName:e,variant:x[e],visible:!1,previewMode:!0}})),setTimeout(()=>{const t=aa('[data-element="'.concat(e,'"]'));t&&(t.style.display="none")},0)},[D,x,l]),et=(0,a.useCallback)(e=>{const t=F.indexOf(e);if(t<=0)return;const n=[...F];[n[t-1],n[t]]=[n[t],n[t-1]],O(n),k(!0),l&&($e(n),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:n,previewMode:!0}})))},[F,l,$e]),tt=(0,a.useCallback)(e=>{const t=F.indexOf(e);if(t<0||t>=F.length-1)return;const n=[...F];[n[t],n[t+1]]=[n[t+1],n[t]],O(n),k(!0),l&&($e(n),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:n,previewMode:!0}})))},[F,l,$e]),nt=(0,a.useCallback)((e,t)=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/html",e),V(e)},[]),at=(0,a.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",Z!==t&&$(t)},[Z]),it=(0,a.useCallback)(e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||$(null)},[]),ot=(0,a.useCallback)(()=>{V(null),$(null)},[]),rt=(0,a.useCallback)((e,t)=>{if(e.preventDefault(),!Z||Z===t)return V(null),void $(null);const n=[...F],a=n.indexOf(Z),i=n.indexOf(t);if(-1===a||-1===i)return V(null),void $(null);n.splice(a,1),n.splice(i,0,Z),O(n),k(!0),V(null),$(null),l&&($e(n),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:n,previewMode:!0}})))},[Z,F,l,$e]),st=(0,a.useCallback)(()=>{try{if(!confirm("Za\u010d\xedt s pr\xe1zdn\xfdm rozlo\u017een\xedm? V\u0161echny sekce (krom\u011b hlavi\u010dky a pati\u010dky) budou skryt\xe9."))return}catch(i){}const e=Array.from(D),t=new Set(["header","footer"]),n=e.filter(e=>!t.has(e)),a=new Set;e.forEach(e=>{t.has(e)&&a.add(e)}),L(a),O(e=>e.filter(e=>t.has(e))),k(!0),l&&(n.forEach(e=>{try{window.dispatchEvent(new CustomEvent("myuibrix-change",{detail:{elementName:e,variant:x[e],visible:!1,previewMode:!0}}));const t=aa('[data-element="'.concat(e,'"]'));t&&(t.style.display="none")}catch(t){}}),requestAnimationFrame(()=>{const e=Array.from(a).filter(e=>t.has(e));$e(e),window.dispatchEvent(new CustomEvent("myuibrix-reorder",{detail:{order:e,previewMode:!0}}))}));try{Re({title:"Pr\xe1zdn\xe9 rozlo\u017een\xed",description:"V\u0161echny sekce byly skryty. M\u016f\u017eete za\u010d\xedt p\u0159id\xe1vat prvky.",status:"info",duration:2500,isClosable:!0})}catch(o){}I(!0)},[D,l,x,$e,Re]),lt=async()=>{try{const e=F.map((e,t)=>{var a,i;return{page_type:n,element_name:e,variant:x[e]||"default",visible:D.has(e),display_order:t,settings:(0,h.A)((0,h.A)({},(null===(a=d.find(t=>t.element_name===e))||void 0===a?void 0:a.settings)||{}),{},{customCSS:(null===(i=J[e])||void 0===i?void 0:i.customCSS)||""})}});await(async e=>(await ve.A.post("".concat(m.API_URL,"/admin/page-elements/batch"),e,{withCredentials:!0})).data)(e),Re({title:"Zm\u011bny \xfasp\u011b\u0161n\u011b ulo\u017eeny!",description:"Zm\u011bny jsou nyn\xed viditeln\xe9 na produkci.",status:"success",duration:3e3,isClosable:!0}),ue({variants:(0,h.A)({},x),visible:new Set(D),order:[...F],css:Object.fromEntries(Object.entries(J).map(e=>{let[t,n]=e;return[t,String((null===n||void 0===n?void 0:n.customCSS)||"")]}))}),k(!1),setTimeout(()=>{window.location.reload()},1500)}catch(e){Re({title:"Nepoda\u0159ilo se ulo\u017eit zm\u011bny",description:"Zkuste to pros\xedm znovu nebo kontaktujte podporu.",status:"error",duration:5e3,isClosable:!0})}},ct=(0,a.useMemo)(()=>_?De(_):[],[_,De]),dt=(0,a.useMemo)(()=>_?Le(_,x[_]):null,[_,x,Le]),ht=(0,a.useCallback)(()=>({width:"100%",label:"Desktop (100%)"}),[]),ut=(0,a.useMemo)(()=>ht(),[ht]);return(0,a.useEffect)(()=>{if(!l)return;const e=e=>{const t=e.target;if(t.closest(".myuibrix-panel")||t.closest(".myuibrix-toolbar")||t.closest(".elementor-overlay")||t.closest('[role="dialog"]')||t.closest(".chakra-portal")||t.closest(".chakra-modal")||t.classList.contains("elementor-overlay"))return;const n=aa(".myuibrix-viewport-wrapper");n&&n.contains(t)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())};return document.addEventListener("click",e,!0),document.addEventListener("mousedown",e,!0),()=>{document.removeEventListener("click",e,!0),document.removeEventListener("mousedown",e,!0)}},[l]),(0,a.useEffect)(()=>{if(l){if(document.body.style.paddingTop="60px",document.body.style.backgroundColor="#e2e8f0",document.body.style.userSelect="none",!aa(".myuibrix-viewport-wrapper")){const e=ia(".chakra-container"),t=aa(".container");if(e.length>0&&t){const t=document.createElement("div");t.className="myuibrix-viewport-wrapper",t.style.cssText="\n margin: 0 auto;\n transition: all 0.3s ease;\n background: white;\n min-height: 100vh;\n position: relative;\n overflow: visible;\n cursor: default;\n width: 100%;\n max-width: 100%;\n ";const n=e[0],a=n.parentElement,i=n.nextSibling;a&&(a.setAttribute("data-myuibrix-restore","true"),e.forEach(e=>{e.setAttribute("data-myuibrix-original-maxw",e.style.maxWidth||""),e.setAttribute("data-myuibrix-original-width",e.style.width||""),e.style.maxWidth="none",e.style.width="100%",ea(t,e)}),i?oa(a,t,i):ea(a,t))}}}else{document.body.style.paddingTop="0",document.body.style.backgroundColor="",document.body.style.userSelect="";const e=aa(".myuibrix-viewport-wrapper");if(e){const t=aa("[data-myuibrix-restore]");if(t){Array.from(e.children).forEach(e=>{const n=e.getAttribute("data-myuibrix-original-maxw"),a=e.getAttribute("data-myuibrix-original-width");null!==n&&(e.style.maxWidth=n,e.removeAttribute("data-myuibrix-original-maxw")),null!==a&&(e.style.width=a,e.removeAttribute("data-myuibrix-original-width")),ea(t,e)}),t.removeAttribute("data-myuibrix-restore"),e.parentElement&&ta(e.parentElement,e)}}}return()=>{document.body.style.paddingTop="0",document.body.style.backgroundColor="",document.body.style.userSelect="";const e=aa(".myuibrix-viewport-wrapper");if(e){const t=aa("[data-myuibrix-restore]");if(t){Array.from(e.children).forEach(e=>{const n=e.getAttribute("data-myuibrix-original-maxw"),a=e.getAttribute("data-myuibrix-original-width");null!==n&&(e.style.maxWidth=n,e.removeAttribute("data-myuibrix-original-maxw")),null!==a&&(e.style.width=a,e.removeAttribute("data-myuibrix-original-width")),ea(t,e)}),t.removeAttribute("data-myuibrix-restore"),e.parentElement&&ta(e.parentElement,e)}}}},[l]),(0,a.useEffect)(()=>{if(!l)return;const e=aa(".myuibrix-viewport-wrapper");e&&(e.style.width="100%",e.style.maxWidth="100%",e.style.transition="all 0.3s ease",e.style.margin="0 auto",e.style.transform="none",e.style.transformOrigin="","desktop"!==B?(e.style.border="3px solid ".concat(Ie),e.style.boxShadow="0 0 0 9999px rgba(0,0,0,0.25), 0 8px 32px rgba(0,0,0,0.2)",e.style.marginTop="20px",e.style.marginBottom="20px",e.style.minHeight="calc(100vh - 100px)"):(e.style.border="none",e.style.boxShadow="none",e.style.marginTop="0",e.style.marginBottom="0",e.style.minHeight="100vh"),Re({title:"Viewport nastaven na Desktop",description:"Zobrazen\xed na plnou \u0161\xed\u0159ku (100%)",status:"info",duration:2e3,isClosable:!0,position:"bottom-right"}))},[l,B,Ie,Re,ut]),r?(0,p.jsxs)(p.Fragment,{children:[l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(y.a,{className:"myuibrix-toolbar",position:"fixed",top:0,left:0,right:0,bgGradient:"linear(to-r, ".concat(Ie,", ").concat(Ie,"dd)"),color:"white",p:3,zIndex:9999,boxShadow:"0 4px 20px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",backdropFilter:"blur(10px)",borderBottom:"1px solid rgba(255,255,255,0.1)",fontFamily:"var(--chakra-fonts-body)",children:(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",maxW:"100%",children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(y.a,{bgGradient:"linear(135deg, ".concat(We,", ").concat(We,"dd)"),px:4,py:2,borderRadius:"xl",color:s.textOnSecondary||"black",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",border:"2px solid rgba(255,255,255,0.2)",transition:"all 0.3s",_hover:{transform:"translateY(-1px)",boxShadow:"0 6px 16px rgba(0,0,0,0.25)"},children:(0,p.jsxs)(ee.z,{spacing:2,align:"center",children:[(0,p.jsx)(jn.I,{as:pe.i0U,color:"white",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"800",fontSize:"md",color:"white",letterSpacing:"tight",children:"MyUIbrix"})]})}),(0,p.jsxs)(Qt.E,{bg:"orange.500",color:"white",fontSize:"xs",px:3,py:1.5,borderRadius:"full",fontWeight:"700",display:"flex",alignItems:"center",gap:1,boxShadow:"0 2px 8px rgba(237, 137, 54, 0.4)",border:"1px solid rgba(255,255,255,0.3)",sx:{"@keyframes pulseBadge":{"0%, 100%":{transform:"scale(1)",opacity:1},"50%":{transform:"scale(1.05)",opacity:.9}},animation:"pulseBadge 2s infinite"},children:[(0,p.jsx)(jn.I,{as:q.F5$,boxSize:3}),"RE\u017dIM N\xc1HLEDU"]}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"600",color:"whiteAlpha.800",children:"Zm\u011bny vid\xedte pouze vy"})]}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"700",color:"whiteAlpha.900",children:"N\xe1hled: Desktop (100%)"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(pe.IFh,{}),size:"sm",variant:X?"solid":"outline",colorScheme:X?"blue":"whiteAlpha",onClick:()=>ne(!X),borderRadius:"xl",children:"Vizu\xe1ln\xed styly"}),(0,p.jsx)(te.m,{label:ae?"Ukotvit vlevo":"Ukotvit vpravo",children:(0,p.jsx)(K.K,{"aria-label":"Dock panel",icon:ae?(0,p.jsx)(pe.ed2,{}):(0,p.jsx)(pe.FDZ,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>ie(!ae)})}),Ve>0&&(0,p.jsxs)(Qt.E,{bg:"yellow.400",color:"gray.900",fontSize:"sm",px:3,py:1.5,borderRadius:"full",fontWeight:"700",boxShadow:"0 2px 8px rgba(250, 204, 21, 0.4)",border:"1px solid rgba(255,255,255,0.5)",sx:{"@keyframes bounce":{"0%, 100%":{transform:"translateY(0)"},"50%":{transform:"translateY(-2px)"}},animation:"bounce 1s infinite"},children:[Ve," neulo\u017een\xfdch zm\u011bn"]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),bgGradient:"linear(135deg, ".concat(We,", ").concat(We,"dd)"),color:"white",size:"sm",onClick:lt,isDisabled:!f,fontWeight:"700",px:6,borderRadius:"xl",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",border:"2px solid rgba(255,255,255,0.2)",_hover:{transform:"translateY(-2px)",boxShadow:"0 6px 16px rgba(0,0,0,0.25)"},_active:{transform:"translateY(0)"},transition:"all 0.2s",children:"Publikovat"}),(0,p.jsx)(K.K,{"aria-label":"Ukon\u010dit",icon:(0,p.jsx)(q.yGN,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>c(!1)})]})]})}),X&&(0,p.jsxs)(y.a,{className:"myuibrix-panel",position:"fixed",left:ae?void 0:4,right:ae?4:void 0,top:64,bottom:4,width:"380px",zIndex:9998,overflow:"hidden",display:"flex",flexDirection:"column",fontFamily:"var(--chakra-fonts-body)",bg:"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(12px) saturate(180%)",borderRadius:"2xl",boxShadow:"0 20px 60px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2)",border:"1px solid rgba(255,255,255,0.3)",sx:{"@keyframes slideInLeft":{from:{opacity:0,transform:"translateX(-40px)"},to:{opacity:1,transform:"translateX(0)"}},animation:"slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,p.jsxs)(y.a,{className:"panel-header",bgGradient:"linear(135deg, ".concat(Ie,", ").concat(Ie,"dd)"),color:"white",p:3,cursor:"default",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,borderTopRadius:"2xl",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderBottom:"1px solid rgba(255,255,255,0.2)",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(jn.I,{as:pe.IFh}),(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:"Vizu\xe1ln\xed Styly"})]}),(0,p.jsx)(K.K,{"aria-label":"Zav\u0159\xedt",icon:(0,p.jsx)(q.yGN,{}),size:"xs",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>ne(!1)})]}),(0,p.jsx)(y.a,{flex:"1",overflow:"auto",children:_?(0,p.jsx)(za,{elementName:_,onStyleChange:e=>Je(_,e),currentStyles:J[_]}):(0,p.jsxs)(y.a,{p:4,color:"gray.600",fontSize:"sm",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,children:"Vyberte sekci"}),(0,p.jsx)(U.E,{children:"Vyberte sekci na str\xe1nce pro \xfapravu vizu\xe1ln\xedch styl\u016f. Klikn\u011bte na zv\xfdrazn\u011bn\xfd p\u0159ekryv sekce nebo vyberte ze seznamu vrstev."})]})})]})]}),(0,p.jsx)(y.a,{className:"myuibrix-toolbar",position:"fixed",left:4,bottom:4,zIndex:1e4,bg:l?"rgba(255,255,255,0.95)":Ie,borderRadius:"full",boxShadow:"0 12px 40px rgba(0,0,0,0.25), 0 4px 16px rgba(0,0,0,0.15)",border:"2px solid",borderColor:l?Me:Ie,backdropFilter:"blur(12px)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",_hover:{transform:"scale(1.05)",boxShadow:"0 16px 48px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.2)"},children:(0,p.jsxs)(w.T,{spacing:0,children:[(0,p.jsx)(te.m,{label:l?"Ukon\u010dit re\u017eim \xfaprav (ESC)":"Aktivovat MyUIbrix Editor",placement:"right",children:(0,p.jsx)(K.K,{"aria-label":"Toggle edit mode",icon:l?(0,p.jsx)(q.yGN,{}):(0,p.jsx)(q.SG1,{}),colorScheme:l?"red":"whiteAlpha",size:"lg",onClick:()=>{c(!l),l&&(S(null),M(!1),I(!1))},borderRadius:"full",variant:"solid",color:l?void 0:"white",_hover:{transform:"scale(1.1)",boxShadow:"lg"},transition:"all 0.2s"})}),l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{my:1}),(0,p.jsx)(te.m,{label:"P\u0159idat element (A)",placement:"right",children:(0,p.jsx)(K.K,{"aria-label":"P\u0159idat element",icon:(0,p.jsx)(pe.OiG,{}),bgGradient:"linear(135deg, ".concat(Ie,", ").concat(Ie,"dd)"),color:"white",_hover:{transform:"scale(1.15) rotate(90deg)",boxShadow:"lg"},size:"md",onClick:()=>I(!0),borderRadius:"full",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"})}),(0,p.jsx)(G.c,{my:1}),(0,p.jsx)(te.m,{label:"Vrstvy element\u016f (L)",placement:"right",children:(0,p.jsx)(K.K,{"aria-label":"Zobrazit vrstvy",icon:(0,p.jsx)(q.PfQ,{}),bg:W?We:void 0,color:W?s.textOnSecondary||"black":void 0,_hover:{bg:We,color:s.textOnSecondary||"black"},size:"md",onClick:()=>M(!W),borderRadius:"full",variant:W?"solid":"ghost",sx:{"&:hover":{transform:"scale(1.1)",boxShadow:"md"}},transition:"all 0.2s"})}),f&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{my:1}),(0,p.jsx)(te.m,{label:"Ulo\u017eit zm\u011bny (Ctrl+S)",placement:"right",children:(0,p.jsx)(K.K,{"aria-label":"Ulo\u017eit",icon:(0,p.jsx)(q.Bc_,{}),bgGradient:"linear(135deg, green.400, green.600)",color:"white",_hover:{transform:"scale(1.2)",bgGradient:"linear(135deg, green.500, green.700)"},size:"md",onClick:lt,borderRadius:"full",boxShadow:"0 0 0 0 rgba(72, 187, 120, 0.4)",transition:"all 0.2s",sx:{"@keyframes pulseGreen":{"0%, 100%":{boxShadow:"0 0 0 0 rgba(72, 187, 120, 0.6), 0 4px 12px rgba(72, 187, 120, 0.4)"},"50%":{boxShadow:"0 0 0 10px rgba(72, 187, 120, 0), 0 6px 16px rgba(72, 187, 120, 0.2)"}},animation:"pulseGreen 2s infinite"}})})]})]})]})}),l&&_&&N&&(0,p.jsx)(Qn.Z,{children:(0,p.jsxs)(y.a,{className:"myuibrix-panel",ref:me,position:"fixed",top:0===we.stylePicker.y?"".concat(Math.min(N.top+N.height+10,window.innerHeight-450),"px"):"".concat(we.stylePicker.y,"px"),left:0===we.stylePicker.x?"".concat(Math.min(N.left,window.innerWidth-380),"px"):"".concat(we.stylePicker.x,"px"),width:"".concat(we.stylePicker.width,"px"),height:"".concat(we.stylePicker.height,"px"),bg:"rgba(255, 255, 255, 0.98)",backdropFilter:"blur(16px) saturate(180%)",borderRadius:"2xl",boxShadow:"0 24px 70px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.5)",border:"2px solid",borderColor:"rgba(255,255,255,0.4)",zIndex:10001,overflow:"hidden",onMouseDown:e=>Fe("stylePicker",e),cursor:"stylePicker"===Se?"grabbing":"default",fontFamily:"var(--chakra-fonts-body)",sx:{"@keyframes slideInBounce":{"0%":{opacity:0,transform:"translateY(-30px) scale(0.9)"},"60%":{opacity:1,transform:"translateY(5px) scale(1.02)"},"100%":{opacity:1,transform:"translateY(0) scale(1)"}},animation:"slideInBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"2px",background:"linear-gradient(90deg, ".concat(Me,", transparent)"),opacity:.6}},children:[(0,p.jsxs)(Q.s,{className:"panel-header",bgGradient:"linear(135deg, ".concat(Me,", ").concat(Me,"dd)"),color:"white",p:4,align:"center",justify:"space-between",cursor:"move",borderTopRadius:"2xl",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",borderBottom:"1px solid rgba(255,255,255,0.2)",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.VSk,{}),(0,p.jsx)(z.D,{size:"sm",textTransform:"uppercase",letterSpacing:"wider",fontWeight:"800",children:(null===(t=Ot.find(e=>e.name===_))||void 0===t?void 0:t.label)||_})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(te.m,{label:"P\u0159esunout nahoru",children:(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout nahoru",icon:(0,p.jsx)(q.wAb,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>et(_),isDisabled:0===F.indexOf(_)})}),(0,p.jsx)(te.m,{label:"P\u0159esunout dol\u016f",children:(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout dol\u016f",icon:(0,p.jsx)(q.fK4,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>tt(_),isDisabled:F.indexOf(_)===F.length-1})}),(0,p.jsx)(G.c,{orientation:"vertical",h:"20px",borderColor:"whiteAlpha.400"}),(0,p.jsx)(te.m,{label:"Odebrat element",children:(0,p.jsx)(K.K,{"aria-label":"Odebrat element",icon:(0,p.jsx)(q.IXo,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>Qe(_)})}),(0,p.jsx)(K.K,{"aria-label":"Zav\u0159\xedt",icon:(0,p.jsx)(q.yGN,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>S(null),borderRadius:"full"})]})]}),(0,p.jsxs)(w.T,{align:"stretch",p:4,spacing:3,maxH:"450px",overflowY:"auto",children:[(0,p.jsxs)(Q.s,{justify:"space-between",align:"center",pb:2,children:[(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(q.PfQ,{size:14}),(0,p.jsxs)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:["Pozice ",F.indexOf(_)+1," z ",F.length]})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout nahoru",icon:(0,p.jsx)(q.wAb,{}),size:"xs",variant:"ghost",onClick:()=>et(_),isDisabled:0===F.indexOf(_)}),(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout dol\u016f",icon:(0,p.jsx)(q.fK4,{}),size:"xs",variant:"ghost",onClick:()=>tt(_),isDisabled:F.indexOf(_)===F.length-1})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",children:"Vyberte Styl"}),(0,p.jsx)(Tt.r,{columns:2,spacing:3,children:ct.map(e=>{const t=dt===e.value;return(0,p.jsxs)(y.a,{p:3,borderRadius:"lg",border:"2px",borderColor:t?Me:Pe,bg:t?(0,b.dU)("blue.50","blue.900"):"transparent",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",_hover:{borderColor:Me,transform:"translateY(-4px) scale(1.02)",boxShadow:"lg"},_active:{transform:"translateY(-2px) scale(0.98)"},onClick:()=>He(_,e.value),position:"relative",children:[t&&(0,p.jsx)(Qt.E,{position:"absolute",top:1,right:1,colorScheme:"green",fontSize:"9px",children:"AKTIVN\xcd"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:e.label}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",noOfLines:2,children:e.description})]})]},e.value)})}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[ct.length," dostupn\xfdch styl\u016f"]}),(0,p.jsx)(Qt.E,{colorScheme:f?"orange":"gray",children:f?"Zm\u011bn\u011bno":"Ulo\u017eeno"})]})]}),(0,p.jsx)(y.a,{position:"absolute",bottom:0,right:0,width:"24px",height:"24px",cursor:"nwse-resize",bgGradient:"linear(135deg, transparent, rgba(0,0,0,0.15))",opacity:.4,_hover:{opacity:1,bgGradient:"linear(135deg, transparent, rgba(0,0,0,0.25))"},onMouseDown:e=>Ke("stylePicker",e),sx:{clipPath:"polygon(100% 0, 100% 100%, 0 100%)"},transition:"all 0.2s"})]})}),l&&f&&(0,p.jsxs)(y.a,{position:"fixed",top:4,right:4,zIndex:1e4,bgGradient:"linear(135deg, orange.400, orange.600)",color:"white",px:5,py:2.5,borderRadius:"full",boxShadow:"0 8px 24px rgba(237, 137, 54, 0.4), 0 4px 12px rgba(0,0,0,0.2)",fontSize:"sm",fontWeight:"800",display:"flex",alignItems:"center",gap:2,border:"2px solid rgba(255,255,255,0.3)",backdropFilter:"blur(8px)",sx:{"@keyframes wiggle":{"0%, 100%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(-3deg)"},"75%":{transform:"rotate(3deg)"}},animation:"wiggle 2s infinite"},children:[(0,p.jsx)(jn.I,{as:q.eHT,boxSize:4}),"Neulo\u017een\xe9 zm\u011bny: ",Object.keys(x).filter(e=>{var t;return x[e]!==(null===(t=d.find(t=>t.element_name===e))||void 0===t?void 0:t.variant)}).length]}),l&&ce&&!_&&(0,p.jsxs)(y.a,{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bg:"rgba(255, 255, 255, 0.98)",backdropFilter:"blur(20px) saturate(180%)",p:8,borderRadius:"3xl",boxShadow:"0 30px 90px rgba(0,0,0,0.3), 0 12px 40px rgba(0,0,0,0.22)",border:"2px solid",borderColor:"rgba(255,255,255,0.4)",zIndex:9999,maxW:"450px",textAlign:"center",fontFamily:"var(--chakra-fonts-body)",sx:{"@keyframes fadeInScale":{"0%":{opacity:0,transform:"translate(-50%, -50%) scale(0.8)"},"100%":{opacity:1,transform:"translate(-50%, -50%) scale(1)"}},animation:"fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)"},children:[(0,p.jsx)(K.K,{"aria-label":"Zav\u0159\xedt n\xe1pov\u011bdu",icon:(0,p.jsx)(q.yGN,{}),size:"sm",position:"absolute",top:2,right:2,variant:"ghost",onClick:()=>de(!1)}),(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsx)(y.a,{fontSize:"48px",children:"\ud83d\udc46"}),(0,p.jsx)(z.D,{size:"md",children:"Klikn\u011bte na element pro \xfapravu"}),(0,p.jsxs)(U.E,{color:"gray.500",fontSize:"sm",children:["\u2022 P\u0159ejet\xedm my\u0161i zv\xfdrazn\xedte sekce",(0,p.jsx)("br",{}),"\u2022 Klikn\u011bte p\u0159\xedmo na element pro \xfapravu stylu",(0,p.jsx)("br",{}),"\u2022 Pou\u017eijte tla\u010d\xedtka \u2b06\ufe0f\u2b07\ufe0f pro zm\u011bnu pozice",(0,p.jsx)("br",{}),"\u2022 Klikn\u011bte na \ud83d\uddd1\ufe0f pro odstran\u011bn\xed",(0,p.jsx)("br",{}),"\u2022 P\u0159epn\u011bte viewport pro test responzivity"]}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:()=>{de(!1),I(!0)},leftIcon:(0,p.jsx)(pe.OiG,{}),children:"P\u0159idat nov\xfd element"})]})]}),fe>1&&(0,p.jsx)(y.a,{p:4,borderBottom:"1px",borderColor:"gray.100",bg:"white",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"bold",color:"gray.600",children:"Vlo\u017eit do sloupce"}),(0,p.jsxs)(ee.z,{spacing:2,flexWrap:"wrap",children:[Array.from({length:fe}).map((e,t)=>(0,p.jsxs)(T.$,{size:"sm",variant:null!=be&&be%fe===t?"solid":"outline",colorScheme:null!=be&&be%fe===t?"blue":"gray",onClick:e=>{e.stopPropagation();const n=Ge(t);ye(n),Re({title:"Pozice zvolena",description:"Sloupec ".concat(t+1),status:"info",duration:1500})},children:["Sloupec ",t+1]},t)),(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>ye(null),children:"Zru\u0161it pozici"})]})]})}),l&&W&&(0,p.jsxs)(y.a,{className:"myuibrix-panel",position:"fixed",left:0===we.layersPanel.x?void 0:"".concat(we.layersPanel.x,"px"),right:0===we.layersPanel.x?4:void 0,top:0===we.layersPanel.y?4:"".concat(we.layersPanel.y,"px"),bottom:0===we.layersPanel.y?4:void 0,transform:void 0,width:"".concat(we.layersPanel.width,"px"),height:0===we.layersPanel.y?"auto":"".concat(we.layersPanel.height,"px"),bg:"rgba(255, 255, 255, 0.97)",backdropFilter:"blur(16px) saturate(180%)",borderRadius:"2xl",boxShadow:"0 24px 70px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.22)",border:"2px solid",borderColor:"rgba(255,255,255,0.4)",zIndex:10001,overflow:"hidden",onMouseDown:e=>Fe("layersPanel",e),cursor:"layersPanel"===Se?"grabbing":"default",fontFamily:"var(--chakra-fonts-body)",display:"flex",flexDirection:"column",sx:{"@keyframes slideInRight":{from:{opacity:0,transform:"translateX(40px)"},to:{opacity:1,transform:"translateX(0)"}},animation:"slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,p.jsxs)(Q.s,{className:"panel-header",bgGradient:"linear(135deg, ".concat(We,", ").concat(We,"dd)"),color:"white",p:4,align:"center",justify:"space-between",cursor:"move",borderTopRadius:"2xl",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",borderBottom:"1px solid rgba(255,255,255,0.2)",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.PfQ,{}),(0,p.jsx)(z.D,{size:"sm",fontWeight:"800",letterSpacing:"wide",children:"Vrstvy Element\u016f"})]}),(0,p.jsx)(K.K,{"aria-label":"Zav\u0159\xedt",icon:(0,p.jsx)(q.yGN,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>M(!1)})]}),(0,p.jsx)(y.a,{p:2,borderBottom:"1px",borderColor:"whiteAlpha.400",bg:"whiteAlpha.200",children:(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontSize:"xs",opacity:.85,children:"Za\u010d\xedt s pr\xe1zdn\xfdm rozlo\u017een\xedm"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:st,children:"Za\u010d\xedt s pr\xe1zdn\xfdm rozlo\u017een\xedm"})]})}),(0,p.jsxs)(w.T,{align:"stretch",p:3,spacing:2,flex:1,overflowY:"auto",children:[F.map((e,t)=>{const n=Ot.find(t=>t.name===e),a=D.has(e),i=_===e,o=Z===e,r=H===e;return(0,p.jsx)(y.a,{p:3,borderRadius:"lg",border:"2px",borderColor:r?Ie:i?We:"gray.200",bgGradient:o?"linear(to-r, gray.100, gray.200)":i?"linear(135deg, ".concat(We,"15, ").concat(We,"25)"):a?"linear(to-r, white, gray.50)":"linear(to-r, gray.100, gray.150)",cursor:o?"grabbing":"grab",opacity:o?.6:a?1:.5,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",transform:r?"scale(1.03) translateX(8px)":void 0,boxShadow:i?"0 4px 12px rgba(0,0,0,0.1)":"0 2px 4px rgba(0,0,0,0.05)",_hover:{borderColor:We,transform:r?"scale(1.03) translateX(8px)":"translateX(6px) translateY(-2px)",boxShadow:"0 6px 16px rgba(0,0,0,0.12)"},draggable:!0,onDragStart:t=>{nt(e,t),t.target.style.cursor="grabbing"},onDragEnd:e=>{e.target.style.cursor="grab",ot()},onDragOver:t=>at(t,e),onDragLeave:e=>it(e),onDrop:t=>rt(t,e),onClick:()=>{S(e);const t=aa('[data-element="'.concat(e,'"]'));if(t){const e=t.getBoundingClientRect();R({top:e.top,left:e.left,width:e.width,height:e.height})}},children:(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",children:[(0,p.jsxs)(ee.z,{flex:1,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.WhN,boxSize:4,color:"gray.400",cursor:"grab",_active:{cursor:"grabbing"}}),(0,p.jsx)(y.a,{p:2,bg:i?We:"".concat(We,"20"),borderRadius:"lg",transition:"all 0.2s",children:(0,p.jsx)(jn.I,{as:(null===n||void 0===n?void 0:n.icon)||pe.$ZR,boxSize:5,color:i?"white":We})}),(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:(null===n||void 0===n?void 0:n.label)||e}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["Pozice ",t+1]})]})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout nahoru",icon:(0,p.jsx)(q.wAb,{}),size:"xs",variant:"ghost",onClick:t=>{t.stopPropagation(),et(e)},isDisabled:0===t}),(0,p.jsx)(K.K,{"aria-label":"P\u0159esunout dol\u016f",icon:(0,p.jsx)(q.fK4,{}),size:"xs",variant:"ghost",onClick:t=>{t.stopPropagation(),tt(e)},isDisabled:t===F.length-1}),(0,p.jsx)(K.K,{"aria-label":a?"Skr\xfdt":"Zobrazit",icon:(0,p.jsx)(q._NO,{}),size:"xs",variant:"ghost",colorScheme:a?"gray":"red",onClick:t=>{if(t.stopPropagation(),a)Qe(e);else{const t=new Set(D);t.add(e),L(t),k(!0),l&&window.dispatchEvent(new CustomEvent("myuibrix-change",{detail:{elementName:e,variant:x[e],visible:!0,previewMode:!0}})),setTimeout(()=>{const t=aa('[data-element="'.concat(e,'"]'));t&&(t.style.display=""),$e(F)},0)}}})]})]})},e)}),0===F.length&&(0,p.jsxs)(y.a,{textAlign:"center",py:8,children:[(0,p.jsx)(jn.I,{as:pe.rrY,boxSize:12,color:"gray.300",mb:3}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",fontWeight:"bold",children:"Zat\xedm \u017e\xe1dn\xe9 elementy"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.400",mb:3,children:"Za\u010dn\u011bte p\u0159id\xe1n\xedm prv\xe9ho elementu"}),(0,p.jsx)(T.$,{size:"sm",bg:Ie,color:"white",_hover:{opacity:.9},leftIcon:(0,p.jsx)(pe.OiG,{}),onClick:()=>{M(!1),I(!0)},children:"P\u0159idat Element"})]})]}),(0,p.jsx)(y.a,{position:"absolute",bottom:0,right:0,width:"20px",height:"20px",cursor:"nwse-resize",bg:"gray.400",opacity:.6,_hover:{opacity:1},onMouseDown:e=>Ke("layersPanel",e),sx:{clipPath:"polygon(100% 0, 100% 100%, 0 100%)"}})]}),P&&(0,p.jsxs)(Qn.Z,{children:[(0,p.jsx)(y.a,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"blackAlpha.700",backdropFilter:"blur(8px)",zIndex:10002,onClick:()=>{I(!1),re(""),le("all")},sx:{"@keyframes fadeInBackdrop":{from:{opacity:0},to:{opacity:1}},animation:"fadeInBackdrop 0.2s ease-out"}}),(0,p.jsxs)(y.a,{className:"myuibrix-panel",position:"fixed",left:0===we.elementPicker.x?"50%":"".concat(we.elementPicker.x,"px"),top:0===we.elementPicker.y?"50%":"".concat(we.elementPicker.y,"px"),transform:0===we.elementPicker.x&&0===we.elementPicker.y?"translate(-50%, -50%)":void 0,width:"".concat(we.elementPicker.width,"px"),height:"".concat(we.elementPicker.height,"px"),maxWidth:"90vw",bg:"rgba(255, 255, 255, 0.98)",backdropFilter:"blur(20px) saturate(180%)",borderRadius:"3xl",boxShadow:"0 40px 120px rgba(0,0,0,0.4), 0 16px 50px rgba(0,0,0,0.3)",border:"2px solid",borderColor:"rgba(255,255,255,0.5)",zIndex:10003,overflow:"hidden",onMouseDown:e=>Fe("elementPicker",e),cursor:"elementPicker"===Se?"grabbing":"default",fontFamily:"var(--chakra-fonts-body)",sx:{"@keyframes modalZoomIn":{"0%":{opacity:0,transform:0===we.elementPicker.x&&0===we.elementPicker.y?"translate(-50%, -50%) scale(0.85)":"scale(0.85)"},"100%":{opacity:1,transform:0===we.elementPicker.x&&0===we.elementPicker.y?"translate(-50%, -50%) scale(1)":"scale(1)"}},animation:"modalZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"},children:[(0,p.jsxs)(Q.s,{className:"panel-header",bgGradient:"linear(135deg, ".concat(Ie,", ").concat(Ie,"dd)"),color:"white",p:5,align:"center",justify:"space-between",cursor:"move",borderTopRadius:"3xl",boxShadow:"0 6px 16px rgba(0,0,0,0.15)",borderBottom:"1px solid rgba(255,255,255,0.2)",children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(y.a,{p:2,bg:"whiteAlpha.300",borderRadius:"lg",backdropFilter:"blur(8px)",children:(0,p.jsx)(jn.I,{as:pe.OiG,boxSize:6})}),(0,p.jsx)(z.D,{size:"md",fontWeight:"900",letterSpacing:"tight",children:"P\u0159idat Element"})]}),(0,p.jsx)(K.K,{"aria-label":"Zav\u0159\xedt",icon:(0,p.jsx)(q.yGN,{}),size:"sm",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>{I(!1),re(""),le("all")}})]}),(0,p.jsx)(y.a,{p:5,borderBottom:"1px",borderColor:"gray.100",bg:"gray.50",children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(C.p,{placeholder:"\ud83d\udd0d Hledat element...",value:oe,onChange:e=>re(e.target.value),size:"lg",bg:"white",borderRadius:"xl",border:"2px solid",borderColor:"gray.200",_hover:{borderColor:Ie},_focus:{borderColor:Ie,boxShadow:"0 0 0 3px ".concat(Ie,"33")},fontSize:"md",fontWeight:"500",transition:"all 0.2s"}),(0,p.jsx)(ee.z,{spacing:2,w:"full",overflowX:"auto",pb:1,children:[{value:"all",label:"V\u0161echny",icon:pe.$ZR},{value:"layout",label:"Rozvr\u017een\xed",icon:pe.x7F},{value:"content",label:"Obsah",icon:pe.Nhm},{value:"media",label:"M\xe9dia",icon:pe.T0M},{value:"interactive",label:"Interaktivn\xed",icon:pe.pBr}].map(e=>(0,p.jsx)(T.$,{size:"md",variant:se===e.value?"solid":"outline",bgGradient:se===e.value?"linear(135deg, ".concat(Ie,", ").concat(Ie,"dd)"):void 0,color:se===e.value?"white":"gray.700",borderColor:se===e.value?"transparent":"gray.300",borderRadius:"xl",fontWeight:"700",boxShadow:se===e.value?"0 4px 12px rgba(0,0,0,0.15)":"none",_hover:{bg:se===e.value?void 0:"gray.100",transform:"translateY(-2px)",boxShadow:se===e.value?"0 6px 16px rgba(0,0,0,0.2)":"0 2px 8px rgba(0,0,0,0.1)"},onClick:()=>le(e.value),leftIcon:(0,p.jsx)(jn.I,{as:e.icon}),minW:"fit-content",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",children:e.label},e.value))})]})}),(0,p.jsxs)(w.T,{align:"stretch",p:4,spacing:4,maxH:"calc(80vh - 200px)",overflowY:"auto",children:[["layout","content","media","interactive"].map(e=>{if("all"!==se&&se!==e)return null;const t="homepage"===n?wa:[],a=Ot.filter(n=>n.category===e&&(0===t.length||t.includes(n.name))).filter(e=>{if(oe){const t=oe.toLowerCase();return e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)}return!0});if(0===a.length)return null;return(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"bold",color:"gray.500",textTransform:"uppercase",mb:2,children:{layout:"Rozvr\u017een\xed",content:"Obsah",media:"M\xe9dia",interactive:"Interaktivn\xed"}[e]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:3,children:a.map(e=>(0,p.jsx)(y.a,{p:4,borderRadius:"xl",border:"2px solid",borderColor:"gray.200",bg:"white",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",_hover:{borderColor:Ie,transform:"translateY(-4px) scale(1.02)",boxShadow:"0 8px 24px rgba(0,0,0,0.12), 0 0 0 2px ".concat(Ie,"22"),bg:"".concat(Ie,"05")},_active:{transform:"translateY(-2px) scale(1)"},onClick:()=>Xe(e.name),children:(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(y.a,{p:3,bgGradient:"linear(135deg, ".concat(Ie,"15, ").concat(Ie,"25)"),borderRadius:"xl",transition:"all 0.2s",children:(0,p.jsx)(jn.I,{as:e.icon,boxSize:6,color:Ie})}),(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:e.label}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.description})]}),(0,p.jsx)(jn.I,{as:pe.OiG,color:Ie})]})},e.name))})]},e)}),Ot.every(e=>D.has(e.name))&&(0,p.jsxs)(y.a,{textAlign:"center",py:8,children:[(0,p.jsx)(jn.I,{as:pe.Ky9,boxSize:8,color:Ie,mb:2}),(0,p.jsx)(U.E,{fontSize:"lg",fontWeight:"bold",mb:2,children:"V\u0161echny elementy p\u0159id\xe1ny!"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Pou\u017e\xedv\xe1te v\u0161echny dostupn\xe9 elementy"})]}),!Ot.some(e=>{const t="all"===se||e.category===se,n=!oe||e.label.toLowerCase().includes(oe.toLowerCase())||e.description.toLowerCase().includes(oe.toLowerCase());return!D.has(e.name)&&t&&n})&&!Ot.every(e=>D.has(e.name))&&(0,p.jsxs)(y.a,{textAlign:"center",py:8,children:[(0,p.jsx)(jn.I,{as:pe.TNq,boxSize:8,color:"gray.400",mb:2}),(0,p.jsx)(U.E,{fontSize:"md",fontWeight:"bold",mb:1,children:"\u017d\xe1dn\xe9 v\xfdsledky"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Zkuste zm\u011bnit vyhled\xe1vac\xed dotaz nebo filtr"})]})]}),(0,p.jsx)(y.a,{position:"absolute",bottom:0,right:0,width:"24px",height:"24px",cursor:"nwse-resize",bgGradient:"linear(135deg, transparent, rgba(0,0,0,0.15))",opacity:.4,_hover:{opacity:1,bgGradient:"linear(135deg, transparent, rgba(0,0,0,0.25))"},onMouseDown:e=>Ke("elementPicker",e),sx:{clipPath:"polygon(100% 0, 100% 100%, 0 100%)"},transition:"all 0.2s"})]})]})]}):null};class Aa extends a.Component{constructor(e){super(e),this.resetTimeout=null,this.scheduleAutoReset=()=>{this.resetTimeout&&clearTimeout(this.resetTimeout),this.resetTimeout=setTimeout(()=>{this.handleReset()},3e3)},this.handleReset=()=>{this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=null),this.cleanupDOMElements(),this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onReset&&this.props.onReset()},this.cleanupDOMElements=()=>{try{document.querySelectorAll(".elementor-overlay").forEach(e=>{try{e.remove()}catch(t){console.warn("Failed to remove overlay:",t)}});const t=document.querySelector(".myuibrix-viewport-wrapper");if(t&&t.parentElement)try{const e=t.parentElement;Array.from(t.children).forEach(t=>{try{e.appendChild(t)}catch(n){console.warn("Failed to move child:",n)}}),t.remove()}catch(e){console.warn("Failed to cleanup viewport wrapper:",e)}document.body.style.paddingTop="0",document.body.style.backgroundColor="",document.body.style.userSelect=""}catch(e){console.error("Error during DOM cleanup:",e)}},this.state={hasError:!1,error:null,errorInfo:null,errorCount:0}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("MyUIbrix Error Boundary caught an error:",e,t),this.setState(e=>({errorInfo:t,errorCount:e.errorCount+1})),(e.message.includes("removeChild")||e.message.includes("insertBefore")||e.message.includes("replaceChild")||"DOMException"===e.name)&&(console.warn("DOM manipulation error detected - will auto-reset in 3 seconds"),this.scheduleAutoReset())}componentWillUnmount(){this.resetTimeout&&clearTimeout(this.resetTimeout)}render(){if(this.state.hasError&&this.state.error){const e=this.state.error.message.includes("removeChild")||this.state.error.message.includes("insertBefore")||this.state.error.message.includes("replaceChild")||"DOMException"===this.state.error.name;return(0,p.jsx)(y.a,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",bg:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999,children:(0,p.jsxs)(w.T,{spacing:6,bg:"white",p:8,borderRadius:"2xl",boxShadow:"0 20px 60px rgba(0,0,0,0.5)",maxW:"600px",w:"90%",children:[(0,p.jsx)(jn.I,{as:q.eHT,boxSize:16,color:"orange.500"}),(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(z.D,{size:"lg",color:"gray.800",children:e?"Chyba p\u0159i manipulaci s prvky":"Chyba editoru"}),(0,p.jsx)(U.E,{color:"gray.600",textAlign:"center",children:e?"Nastala chyba p\u0159i p\u0159esouv\xe1n\xed nebo upravov\xe1n\xed prvk\u016f. Editor se automaticky obnov\xed za 3 sekundy.":"V editoru nastala neo\u010dek\xe1van\xe1 chyba. Klikn\u011bte na tla\u010d\xedtko pro obnoven\xed."})]}),!1,(0,p.jsxs)(w.T,{spacing:3,w:"100%",children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.jTZ,{}),colorScheme:"blue",size:"lg",w:"100%",onClick:this.handleReset,children:"Obnovit editor"}),this.state.errorCount>3&&(0,p.jsxs)(U.E,{fontSize:"sm",color:"orange.600",textAlign:"center",children:["\u26a0\ufe0f Opakovan\xe9 chyby (",this.state.errorCount,"x). Zva\u017ete obnoven\xed str\xe1nky."]}),this.state.errorCount>3&&(0,p.jsx)(T.$,{size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>window.location.reload(),children:"Obnovit celou str\xe1nku"})]})]})})}return this.props.children}}const Ea=Aa;var Ta=n(6529);const Na=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"medium";var a;if((a=e,Boolean(null===a||void 0===a?void 0:a.includes("logoapi.sportcreative.eu")))&&t){return{padding:{small:"2px",medium:"4px",large:"6px"}[n],boxSizing:"border-box",objectFit:"contain"}}return{objectFit:"contain"}},Ra=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"medium";const n=[];return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&n.push("circular-logo-container"),n.push("match-logo-".concat(t)),n.join(" ")},Pa=["teamId","teamName","facrLogo","size","fallbackIcon","alt"];let Ia=null;const Wa=e=>{var t;let{teamId:n,teamName:i,facrLogo:o,size:r="medium",fallbackIcon:s,alt:l}=e,c=(0,O.A)(e,Pa);const[d,u]=(0,a.useState)(null),[m,x]=(0,a.useState)(!0),[g,v]=(0,a.useState)(!1),{data:j}=ge();(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{var t,a,i;x(!0),v(!1);let s={};try{s=await(async()=>{const e=Date.now();if(Ia&&e-Ia.ts<6e4)return Ia.data||{};try{const t=await fetch("/api/v1/public/team-logo-overrides?t=".concat(e),{cache:"no-cache"});if(t.ok){const n=await t.json();return Ia={ts:e,data:n||{}},n||{}}}catch(t){}try{const t=await fetch("/cache/prefetch/team_logo_overrides.json",{cache:"no-cache"});if(t.ok){const n=await t.json();return Ia={ts:e,data:n||{}},n||{}}}catch(n){}return Ia={ts:e,data:{}},{}})()}catch(r){}if(n&&null!==j&&void 0!==j&&j.club_id&&String(n)===String(j.club_id)&&null!==j&&void 0!==j&&j.club_logo_url)e&&u(W(j.club_logo_url)||j.club_logo_url);else if(n&&null!==(t=s)&&void 0!==t&&null!==(a=t.by_id)&&void 0!==a&&null!==(i=a[n])&&void 0!==i&&i.logo_url){const t=s.by_id[n].logo_url;e&&("string"===typeof t&&t.startsWith("/")?u(W(t)||t):u(t))}else{const t=await(async(e,t,n)=>{if(e){const t=await He(e);if(t)return t}return n||"/logo192.png"})(n,0,o);e&&u(t)}}catch(s){console.error("Failed to fetch logo:",s),e&&(v(!0),u(o||"/logo192.png"))}finally{e&&x(!1)}})(),()=>{e=!1}},[n,i,o,null===j||void 0===j?void 0:j.club_id,null===j||void 0===j?void 0:j.club_logo_url]);const b="custom"!==r?{small:{boxSize:"24px"},medium:{boxSize:"32px"},large:{boxSize:"48px"},custom:{}}[r]:{},y="match-logo-".concat(r," ").concat(c.className||"").trim();if(m)return(0,p.jsx)(en.E,(0,h.A)((0,h.A)({},b),{},{borderRadius:"4px",className:"logo-loading"}));const f="full"===c.borderRadius||"50%"===(null===(t=c.style)||void 0===t?void 0:t.borderRadius),z="custom"!==r?r:"medium",w=Na(d,f,z),_=Ra(d,f,z);return(0,p.jsx)(k._,(0,h.A)((0,h.A)((0,h.A)({src:W(d||void 0)||d||"/logo192.png",alt:l||i||"Team logo"},b),c),{},{className:"".concat(y," ").concat(_),objectFit:"contain",loading:"lazy",fallback:s,style:(0,h.A)((0,h.A)({},c.style),w),onError:()=>{g||(v(!0),u(o||"/logo192.png"))}}))},Ma=Wa,Da=e=>{let{isOpen:t,onClose:n,club:a,clubType:i="football"}=e;if(!a)return null;const o=(0,b.dU)("white","gray.800"),r=(0,b.dU)("gray.200","whiteAlpha.300"),s=(0,b.dU)("gray.100","gray.700"),l=(0,b.dU)("gray.600","gray.300");return(0,p.jsxs)(se.aF,{isOpen:t,onClose:n,size:"lg",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.600",backdropFilter:"blur(4px)"}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(Q.s,{align:"center",gap:3,children:[(0,p.jsx)(Wa,{teamId:a.team_id,teamName:a.team,facrLogo:a.team_logo_url,size:"large",alt:a.team,borderRadius:"full",bg:o,borderWidth:"1px",borderColor:r,fallbackIcon:(0,p.jsx)(y.a,{w:"48px",h:"48px",bg:s,borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",color:l,fontSize:"lg",fontWeight:"bold",borderWidth:"1px",borderColor:r,children:a.team.substring(0,2).toUpperCase()})}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"xl",fontWeight:"bold",children:a.team}),a.rank&&(0,p.jsxs)(Qt.E,{colorScheme:"blue",fontSize:"sm",children:[a.rank,". m\xedsto"]})]})]})}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,b.dU)("gray.50","gray.700"),borderColor:r,children:[(0,p.jsx)(U.E,{fontSize:"md",fontWeight:"semibold",mb:3,color:(0,b.dU)("gray.700","gray.200"),children:"Statistiky"}),(0,p.jsxs)(w.T,{spacing:2,align:"stretch",children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Odehr\xe1no z\xe1pas\u016f:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:(0,b.dU)("gray.800","gray.100"),children:a.played||0})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"V\xfdhry:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"green.600",children:a.wins||0})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Rem\xedzy:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:(0,b.dU)("gray.600","gray.400"),children:a.draws||0})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Prohry:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"red.600",children:a.losses||0})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Sk\xf3re:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:(0,b.dU)("gray.800","gray.100"),children:a.score||"0:0"})]}),(void 0!==a.goals_scored||void 0!==a.goals_conceded)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Vst\u0159elen\xe9 g\xf3ly:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"green.500",children:a.goals_scored||0})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Obdr\u017een\xe9 g\xf3ly:"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"red.500",children:a.goals_conceded||0})]})]}),void 0!==a.goal_difference&&(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.300"),children:"Sk\xf3re rozd\xedl:"}),(0,p.jsxs)(U.E,{fontWeight:"bold",color:Number(a.goal_difference)>=0?"green.600":"red.600",children:[Number(a.goal_difference)>0?"+":"",a.goal_difference]})]}),(0,p.jsxs)(ee.z,{justify:"space-between",pt:2,borderTopWidth:"1px",borderColor:r,children:[(0,p.jsx)(U.E,{color:(0,b.dU)("gray.700","gray.200"),fontWeight:"semibold",children:"Body:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"lg",px:3,py:1,children:a.points||0})]})]})]}),a.form&&(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,b.dU)("gray.50","gray.700"),borderColor:r,children:[(0,p.jsx)(U.E,{fontSize:"md",fontWeight:"semibold",mb:3,color:(0,b.dU)("gray.700","gray.200"),children:"Forma (posledn\xedch 5 z\xe1pas\u016f)"}),(0,p.jsx)(ee.z,{spacing:2,justify:"center",children:a.form.split("").map((e,t)=>(0,p.jsx)(Qt.E,{colorScheme:"W"===e?"green":"D"===e?"yellow":"red",fontSize:"md",px:3,py:1,borderRadius:"md",children:"W"===e?"V":"D"===e?"R":"P"},t))})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{colorScheme:"gray",onClick:n,children:"Zav\u0159\xedt"})})]})]})},Ua=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;const[n,i]=(0,a.useState)(0),[o,r]=(0,a.useState)(!1),s=(0,a.useMemo)(()=>{if(!e)return null;const t="string"===typeof e?new Date(e):e;return isNaN(t.getTime())?null:t.getTime()},[e]);(0,a.useEffect)(()=>{if(!s)return i(0),void r(!1);const e=()=>{const e=Date.now(),t=s-e;if(t<=0)return i(0),void r(!1);i(t),r(!0)};e();const n=setInterval(()=>{e()},t);return()=>clearInterval(n)},[s,t]);return{countdownString:(0,a.useMemo)(()=>{if(n<=0)return"";const e=Math.floor(n/864e5),t=Math.floor(n%864e5/36e5),a=Math.floor(n%36e5/6e4),i=Math.floor(n%6e4/1e3);return e>0?"".concat(e,"d ").concat(t,"h"):t>0?"".concat(t,"h ").concat(a,"m"):a>0?"".concat(a,"m ").concat(i,"s"):"".concat(i,"s")},[n]),timeRemaining:n,isActive:o,targetTime:s}},La=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;const[n,i]=(0,a.useState)({});return(0,a.useEffect)(()=>{if(!e.length)return void i({});const n=()=>{const t=Date.now(),n={};e.forEach(e=>{const a=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();if(isNaN(a)||a<=t)return;const i=a-t,o=Math.floor(i/864e5),r=Math.floor(i%864e5/36e5),s=Math.floor(i%36e5/6e4);n[String(e.id)]=o>0?"".concat(o,"d ").concat(r,"h"):r>0?"".concat(r,"h ").concat(s,"m"):"".concat(s,"m")}),i(n)};n();const a=setInterval(n,t);return()=>clearInterval(a)},[e,t]),n},Fa=e=>{let{isOpen:t,match:n,onClose:i,onTeamClick:o}=e;const r=(0,a.useMemo)(()=>{if(!n)return null;if(n.date&&n.time)return"".concat(n.date,"T").concat(n.time||"00:00",":00");if(n.date_time){const e=String(n.date_time),[t,a]=e.split(" "),[i,o,r]=(t||"").split(".");return i&&o&&r?"".concat(r,"-").concat(o.padStart(2,"0"),"-").concat(i.padStart(2,"0"),"T").concat(a||"00:00",":00"):n.date_time}return null},[n]),{countdownString:s,isActive:l,timeRemaining:c}=Ua(r,1e3),d=(null===n||void 0===n?void 0:n.facr_link)||(null===n||void 0===n?void 0:n.report_url)||null,h=(e=>{if(!e)return"";try{if(e.date&&e.time){const t=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00"));if(!isNaN(t.getTime()))return t.toLocaleString()}if(e.date_time){const t=String(e.date_time),[n,a]=t.split(" "),[i,o,r]=(n||"").split(".");if(i&&o&&r){const e="".concat(r,"-").concat(o.padStart(2,"0"),"-").concat(i.padStart(2,"0"),"T").concat(a||"00:00",":00"),t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleString()}return e.date_time}}catch(t){}return""})(n),u=!!r&&new Date(r).getTime()<=Date.now(),m=(null===n||void 0===n?void 0:n.score)&&""!==n.score.trim();return(0,p.jsxs)(se.aF,{isOpen:t,onClose:i,isCentered:!0,size:{base:"md",md:"lg"},children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsxs)(J.r,{children:[M(null===n||void 0===n?void 0:n.home)||"Dom\xe1c\xed"," vs ",M(null===n||void 0===n?void 0:n.away)||"Host\xe9"]}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:n&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsxs)(w.T,{align:"center",spacing:2,flex:1,minW:0,cursor:o?"pointer":"default",onClick:()=>o&&o(n.home||"",n.home_logo_url),_hover:o?{opacity:.8,transform:"scale(1.05)"}:{},transition:"all 0.2s",role:o?"button":void 0,tabIndex:o?0:void 0,children:[(0,p.jsx)(Wa,{teamId:n.home_id,teamName:n.home,facrLogo:n.home_logo_url,size:"custom",alt:n.home||"Dom\xe1c\xed",boxSize:"56px",borderRadius:"full"}),(0,p.jsx)(U.E,{fontWeight:"semibold",noOfLines:1,textAlign:"center",children:M(n.home)||"Dom\xe1c\xed"})]}),(0,p.jsxs)(w.T,{spacing:1,minW:"120px",children:[u?m?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:n.score}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Skon\u010deno"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:"\u2014:\u2014"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"green.600",children:"Prob\xedh\xe1"})]}):l&&s?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"lg",color:"gray.600",children:"Za\u010d\xe1tek za"}),(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:s})]}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:"vs"})}),(n.competition||n.competitionName)&&(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",children:n.competition||n.competitionName})]}),(0,p.jsxs)(w.T,{align:"center",spacing:2,flex:1,minW:0,cursor:o?"pointer":"default",onClick:()=>o&&o(n.away||"",n.away_logo_url),_hover:o?{opacity:.8,transform:"scale(1.05)"}:{},transition:"all 0.2s",role:o?"button":void 0,tabIndex:o?0:void 0,children:[(0,p.jsx)(Wa,{teamId:n.away_id,teamName:n.away,facrLogo:n.away_logo_url,size:"custom",alt:n.away||"Host\xe9",boxSize:"56px",borderRadius:"full"}),(0,p.jsx)(U.E,{fontWeight:"semibold",noOfLines:1,textAlign:"center",children:M(n.away)||"Host\xe9"})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(w.T,{align:"stretch",spacing:1,color:"gray.700",children:[h&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("strong",{children:"Kdy:"})," ",h]}),n.venue&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("strong",{children:"Kde:"})," ",n.venue]})]})]})}),(0,p.jsxs)(Ta.j,{children:[d&&(0,p.jsx)(T.$,{colorScheme:"blue",mr:3,onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=d,t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"Detail na FA\u010cR"}),(0,p.jsx)(T.$,{onClick:i,children:"Zav\u0159\xedt"})]})]})]})},Oa=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")},Za=e=>{let{variant:t="brand",fullBleed:n=!1}=e;const{data:a}=ge(),i=Ye(),o=(null===a||void 0===a?void 0:a.club_name)||i.name||"Fotbalov\xfd klub",r=W((null===a||void 0===a?void 0:a.club_logo_url)||i.logoUrl)||(null===a||void 0===a?void 0:a.club_logo_url)||i.logoUrl||"/dist/img/logo-club-empty.svg",s=(null===a||void 0===a?void 0:a.shop_url)||void 0;return(0,p.jsxs)("div",{className:Oa("club-hero-topbar",n&&"full-bleed","brand"===t&&"club-hero-topbar--brand","minimal"===t&&"club-hero-topbar--minimal","badge"===t&&"club-hero-topbar--badge"),children:[(0,p.jsx)("div",{className:"club-hero-topbar__logo",children:(0,p.jsx)("img",{src:r,alt:o,style:{width:36,height:36,objectFit:"contain"}})}),(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,p.jsx)("div",{className:"club-hero-topbar__title",children:o}),(0,p.jsx)("div",{className:"club-hero-topbar__tagline",children:"Ofici\xe1ln\xed web klubu"})]}),(0,p.jsx)("div",{className:"club-hero-topbar__spacer"}),(0,p.jsxs)("div",{className:"club-hero-topbar__actions",children:[(0,p.jsx)("a",{href:"/kalendar",className:"sparta-button-tertiary",children:"Kalend\xe1\u0159"}),s&&(0,p.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"sparta-button-primary",children:"Fanshop"})]})]})},Ka=e=>{let{items:t,emptyText:n="Zat\xedm nejsou k dispozici \u017e\xe1dn\xe9 aktuality.",seeAllHref:a,seeAllLabel:i="Zobrazit v\u0161echny aktuality"}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:"blog-list",children:t&&t.length>0?t.slice(0,4).map(e=>(0,p.jsxs)("a",{href:"/news/".concat(e.slug||e.id),className:"card",style:{textDecoration:"none",color:"inherit"},children:[(0,p.jsx)("div",{className:"thumb",style:{backgroundImage:"url(".concat(W(e.image)||"/images/news/placeholder.jpg",")")}}),(0,p.jsxs)("div",{children:[(0,p.jsx)("h4",{children:e.title}),e.excerpt&&(0,p.jsx)("div",{style:{color:"var(--dark-gray)",fontSize:"0.9rem"},children:e.excerpt})]})]},e.id)):(0,p.jsx)("div",{style:{padding:"24px",textAlign:"center",color:"var(--dark-gray)",background:"var(--bg-soft)",borderRadius:"12px"},children:(0,p.jsx)("p",{children:n})})}),a&&t&&t.length>0&&(0,p.jsx)("div",{style:{marginTop:12},children:(0,p.jsx)("a",{className:"btn",href:a,children:i})})]})},qa=e=>{let{rows:t,onRowClick:n}=e;const a=Array.isArray(t)?t:[];return(0,p.jsx)("div",{className:"table-card",children:(0,p.jsx)("div",{className:"standings-table-wrapper",style:{overflowX:"auto"},children:(0,p.jsxs)("table",{className:"standings-table-compact",style:{width:"100%",borderCollapse:"separate",borderSpacing:"0 4px"},children:[(0,p.jsx)("thead",{children:(0,p.jsxs)("tr",{style:{fontSize:"0.75rem",color:"var(--dark-gray)",textTransform:"uppercase"},children:[(0,p.jsx)("th",{style:{padding:"6px 8px",textAlign:"left",fontWeight:600},children:"#"}),(0,p.jsx)("th",{style:{padding:"6px 8px",textAlign:"left",fontWeight:600},children:"T\xfdm"}),(0,p.jsx)("th",{style:{padding:"6px 4px",textAlign:"center",fontWeight:600},children:"Z"}),(0,p.jsx)("th",{style:{padding:"6px 4px",textAlign:"center",fontWeight:600},children:"V"}),(0,p.jsx)("th",{style:{padding:"6px 4px",textAlign:"center",fontWeight:600},children:"R"}),(0,p.jsx)("th",{style:{padding:"6px 4px",textAlign:"center",fontWeight:600},children:"P"}),(0,p.jsx)("th",{style:{padding:"6px 4px",textAlign:"center",fontWeight:600,display:"none"},className:"hide-mobile",children:"Sk\xf3re"}),(0,p.jsx)("th",{style:{padding:"6px 8px",textAlign:"center",fontWeight:600},children:"Body"})]})}),(0,p.jsx)("tbody",{children:a.slice(0,8).map((e,t)=>{var a,i,o,r,s,l,c,d,h,u,m,x,g,v,j,b,y,f;return(0,p.jsxs)("tr",{onClick:()=>null===n||void 0===n?void 0:n(e,t),style:{cursor:n?"pointer":"default",background:"var(--card-bg)",border:"1px solid var(--card-border)",borderRadius:"8px",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor="var(--primary)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderColor="var(--card-border)"},children:[(0,p.jsx)("td",{style:{padding:"10px 8px",fontWeight:700,color:"var(--secondary)"},children:null!==(a=null!==(i=null!==(o=e.position)&&void 0!==o?o:e.pos)&&void 0!==i?i:e.rank)&&void 0!==a?a:t+1}),(0,p.jsx)("td",{style:{padding:"10px 8px",fontWeight:600},children:null!==(r=null!==(s=null!==(l=null===(c=e.team)||void 0===c?void 0:c.name)&&void 0!==l?l:e.team)&&void 0!==s?s:e.club)&&void 0!==r?r:"-"}),(0,p.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(d=null!==(h=e.played)&&void 0!==h?h:e.matches)&&void 0!==d?d:"-"}),(0,p.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(u=null!==(m=e.wins)&&void 0!==m?m:e.win)&&void 0!==u?u:"-"}),(0,p.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(x=null!==(g=e.draws)&&void 0!==g?g:e.draw)&&void 0!==x?x:"-"}),(0,p.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(v=null!==(j=e.losses)&&void 0!==j?j:e.loss)&&void 0!==v?v:"-"}),(0,p.jsx)("td",{style:{padding:"10px 4px",textAlign:"center",display:"none"},className:"hide-mobile",children:null!==(b=e.score)&&void 0!==b?b:"-"}),(0,p.jsx)("td",{style:{padding:"10px 8px",textAlign:"center",fontWeight:800},children:null!==(y=null!==(f=e.points)&&void 0!==f?f:e.pts)&&void 0!==y?y:"-"})]},t)})})]})})})},Va=e=>{let{data:t,competitionName:n,countdown:a,onPrev:i,onNext:o,onOpen:r,elementProps:s}=e;const l=t;return(0,p.jsxs)("section",(0,h.A)((0,h.A)({className:"next-match"},s),{},{onClick:e=>{e.stopPropagation(),null===r||void 0===r||r()},style:(0,h.A)({cursor:r?"pointer":"default",position:"relative"},(null===s||void 0===s?void 0:s.style)||{}),children:[i&&(0,p.jsx)("button",{"aria-label":"P\u0159edchoz\xed sout\u011b\u017e",onClick:e=>{e.stopPropagation(),null===i||void 0===i||i()},className:"nav prev",style:{background:"transparent",border:"none",color:"var(--text-on-primary)"},children:(0,p.jsx)(q.irw,{size:24})}),(0,p.jsxs)("div",{className:"team",children:[(0,p.jsx)(Wa,{className:"logo",teamId:null===l||void 0===l?void 0:l.home_id,teamName:null===l||void 0===l?void 0:l.home,facrLogo:null===l||void 0===l?void 0:l.home_logo_url,size:"custom",alt:"Dom\xe1c\xed",borderRadius:"full"}),(0,p.jsx)("div",{children:M((null===l||void 0===l?void 0:l.home)||"")})]}),(0,p.jsxs)("div",{className:"countdown",children:[n&&(0,p.jsx)("div",{style:{fontSize:"0.8rem",opacity:.85,marginBottom:4},children:n}),a||"\u2014",(0,p.jsx)("div",{style:{fontSize:"0.8rem",opacity:.85},children:"Za\u010d\xe1tek z\xe1pasu"})]}),(0,p.jsxs)("div",{className:"team",children:[(0,p.jsx)(Wa,{className:"logo",teamId:null===l||void 0===l?void 0:l.away_id,teamName:null===l||void 0===l?void 0:l.away,facrLogo:null===l||void 0===l?void 0:l.away_logo_url,size:"custom",alt:"Host\xe9",borderRadius:"full"}),(0,p.jsx)("div",{children:M((null===l||void 0===l?void 0:l.away)||"")})]}),o&&(0,p.jsx)("button",{"aria-label":"Dal\u0161\xed sout\u011b\u017e",onClick:e=>{e.stopPropagation(),null===o||void 0===o||o()},className:"nav next",style:{background:"transparent",border:"none",color:"var(--text-on-primary)"},children:(0,p.jsx)(q.fOo,{size:24})})]}))},Ha=e=>{let{title:t="Z\xe1pasy",comps:n,activeIndex:i,onActiveChange:o,onMatchClick:r,elementProps:s}=e;const l=(0,a.useRef)(null),c=n[Math.max(0,Math.min(i,n.length-1))];return(0,a.useEffect)(()=>{try{var e;const t=l.current;if(!t)return;const n=Array.isArray(null===c||void 0===c?void 0:c.matches)?c.matches:[],a=Date.now();let i=0,o=Number.POSITIVE_INFINITY;n.forEach((e,t)=>{const n="".concat(e.date||"","T").concat(e.time||"00:00",":00"),r=new Date(n).getTime();if(!isNaN(r)){const e=Math.abs(r-a);e<o&&(o=e,i=t)}});const r=null===(e=t.children)||void 0===e?void 0:e[i];if(!r)return;const s=()=>{const e=r.offsetLeft-(t.clientWidth-r.clientWidth)/2;t.scrollTo({left:Math.max(0,e),behavior:"smooth"})};"undefined"!==typeof requestAnimationFrame?requestAnimationFrame(s):setTimeout(s,0)}catch(t){}},[i,JSON.stringify(null===c||void 0===c?void 0:c.matches)]),(0,p.jsxs)("section",(0,h.A)((0,h.A)({className:"matches-slider"},s||{}),{},{children:[(0,p.jsxs)("div",{className:"section-head",style:{marginTop:16,marginBottom:16},children:[(0,p.jsx)("h3",{children:t}),(0,p.jsx)("a",{href:"/kalendar",className:"see-all",children:"V\u0161echny z\xe1pasy"})]}),(0,p.jsxs)("div",{className:"matches-grid",children:[(0,p.jsx)("div",{className:"matches-track",ref:l,children:((null===c||void 0===c?void 0:c.matches)||[]).map((e,t)=>(0,p.jsxs)("div",{className:"match-card",onClick:t=>{t.preventDefault(),null===r||void 0===r||r(e,null===c||void 0===c?void 0:c.name)},style:{cursor:r?"pointer":"default"},children:[(0,p.jsxs)("div",{className:"match-meta",children:[(0,p.jsx)("span",{children:(e.venue||"").split(",")[0]||""}),(0,p.jsx)("span",{children:"\u2022"}),(0,p.jsx)("span",{children:e.date?new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).toLocaleDateString():e.time||""})]}),(0,p.jsxs)("div",{className:"teams",children:[(0,p.jsxs)("div",{className:"team",children:[(0,p.jsx)(Wa,{teamId:e.home_id,teamName:e.home,facrLogo:e.home_logo_url,size:"custom",alt:e.home,borderRadius:"full"}),(0,p.jsx)("div",{className:"name",children:M(e.home||"")})]}),(0,p.jsx)("div",{className:"score",children:e.score?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("span",{className:"home",children:String(e.score).split(":")[0]}),(0,p.jsx)("span",{className:"sep",children:":"}),(0,p.jsx)("span",{className:"away",children:String(e.score).split(":")[1]})]}):(0,p.jsx)("span",{className:"time",children:e.time})}),(0,p.jsxs)("div",{className:"team",children:[(0,p.jsx)(Wa,{teamId:e.away_id,teamName:e.away,facrLogo:e.away_logo_url,size:"custom",alt:e.away,borderRadius:"full"}),(0,p.jsx)("div",{className:"name",children:M(e.away||"")})]})]})]},e.id||t))}),(0,p.jsx)("div",{className:"matches-tabs",children:n.map((e,t)=>(0,p.jsx)("button",{className:t===i?"active":"",onClick:()=>o(t),children:e.name},"".concat(e.name,"-").concat(t)))})]})]}))},$a=e=>{let{items:t}=e;const n=Array.isArray(t)?t.slice(0,4):[];return(0,p.jsx)("div",{className:"blog-list",children:n.map(e=>(0,p.jsxs)("a",{href:"/aktivita/".concat(e.id),className:"card",style:{textDecoration:"none",color:"inherit"},children:[(0,p.jsx)("div",{className:"thumb",style:{backgroundImage:"url(".concat(W(e.image_url)||"/images/news/placeholder.jpg",")")}}),(0,p.jsxs)("div",{children:[(0,p.jsx)("h4",{children:e.title}),(0,p.jsxs)("div",{style:{color:"var(--dark-gray)",fontSize:"0.9rem"},children:[new Date(e.start_time).toLocaleDateString()," ",e.location?"\u2022 ".concat(e.location):""]})]})]},e.id))})},Ba=["__ts"],Ja=()=>{var e,t,n,i;const[o,r]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(""),[u,x]=(0,a.useState)(""),[g,v]=(0,a.useState)(""),[j,b]=(0,a.useState)([]),[y,f]=(0,a.useState)(0),[k,z]=(0,a.useState)("grid"),[w,_]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),[A,E]=(0,a.useState)(null),[T,N]=(0,a.useState)(null),[P,I]=(0,a.useState)(null),[M,D]=(0,a.useState)("Fotogalerie"),[U,L]=(0,a.useState)("light"),[F,Z]=(0,a.useState)("V\u0161e"),[K,V]=(0,a.useState)("grid"),[H,$]=(0,a.useState)(0),[B,J]=(0,a.useState)(0),[Y,G]=(0,a.useState)(!1),[X,Q]=(0,a.useState)(0),[ee,te]=((0,a.useRef)(null),(0,a.useState)([])),[ne,ae]=(0,a.useState)(0),[ie,oe]=(0,a.useState)(null),[re,se]=(0,a.useState)(!1),[le,ce]=(0,a.useState)(null),[de,he]=(0,a.useState)(!1),[ue,me]=(0,a.useState)(0),[pe,xe]=(0,a.useState)(void 0),[ge,ve]=(0,a.useState)([]),[je,be]=(0,a.useState)([]),[ye,fe]=(0,a.useState)([]),[ke,ze]=(0,a.useState)([]),[we,_e]=(0,a.useState)([]),[Se,Ce]=(0,a.useState)([]),[Ae,Ee]=(0,a.useState)([]),[Te,Ne]=(0,a.useState)(!1),[Re,Pe]=(0,a.useState)([]),[Ie,We]=(0,a.useState)([]),[Me,De]=(0,a.useState)({}),[Ue,Le]=(0,a.useState)(null),[Fe,Oe]=(0,a.useState)(!0),{getVariant:Ze,isVisible:Ke,getStyles:qe,loading:Ve,refreshKey:He}=Kt("homepage"),$e=Ze("style-pack","default");(0,a.useEffect)(()=>{try{const e="style-pack-".concat($e);["style-pack-default","style-pack-modern","style-pack-minimal","style-pack-sparta"].forEach(e=>document.body.classList.remove(e)),document.body.classList.add(e)}catch(e){}},[$e]);const Be=(0,a.useMemo)(()=>ke.map((e,t)=>({id:"number"===typeof e.id?e.id:t,title:e.title,excerpt:e.excerpt,image:e.image,date:e.date,category:e.category?{id:t,name:e.category}:void 0,slug:e.slug})),[ke]);return(0,a.useEffect)(()=>{let e=!1;const t=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},n=async e=>{try{const n=await fetch(t(e),{cache:"no-cache"});if(!n.ok)throw new Error("HTTP ".concat(n.status));return await n.json()}catch(n){return null}};return(async()=>{const[a,i,o,s,c,d,m]=await Promise.all([n("/cache/prefetch/articles.json"),n("/cache/prefetch/matches.json"),n("/cache/prefetch/settings.json"),n("/cache/prefetch/facr_club_info.json"),n("/cache/prefetch/facr_tables.json"),n("/api/v1/public/team-logo-overrides?t=".concat(Date.now())),n("/cache/prefetch/team_logo_overrides.json")]);let p=[];try{p=await $n()}catch(M){}const j={};(p||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(j[e.code]={alias:e.alias,original_name:e.original_name})});let y=null;try{y=await R()}catch(U){}if(!e){var f,k;r((P=a)?(Array.isArray(P)?P:Array.isArray(null===P||void 0===P?void 0:P.items)?P.items:Array.isArray(null===P||void 0===P?void 0:P.data)?P.data:[]).slice(0,6).map((e,t)=>{var n,a,i,o,r,s,l,c,d,h,u,m,p,x,g,v,j,b,y,f,k;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,title:null!==(a=null!==(i=e.title)&&void 0!==i?i:e.name)&&void 0!==a?a:"Article",excerpt:null!==(o=null!==(r=null!==(s=e.excerpt)&&void 0!==s?s:e.summary)&&void 0!==r?r:null===(l=e.content)||void 0===l||null===(c=l.slice)||void 0===c?void 0:c.call(l,0,140))&&void 0!==o?o:"",image:null!==(d=null!==(h=null!==(u=e.imageUrl)&&void 0!==u?u:e.image_url)&&void 0!==h?h:e.cover)&&void 0!==d?d:"/images/news/placeholder.jpg",date:null!==(m=null!==(p=null!==(x=null!==(g=e.createdAt)&&void 0!==g?g:e.created_at)&&void 0!==x?x:e.publishedAt)&&void 0!==p?p:e.published_at)&&void 0!==m?m:(new Date).toISOString(),category:null!==(v=null!==(j=null===(b=e.category)||void 0===b?void 0:b.name)&&void 0!==j?j:e.category)&&void 0!==v?v:"News",slug:null!==(y=null!==(f=null!==(k=e.slug)&&void 0!==k?k:e.urlSlug)&&void 0!==f?f:e.seoSlug)&&void 0!==y?y:void 0}}):[]),We(p||[]),De(j);const e=d&&d.by_name?d:m||{},n=(null===e||void 0===e?void 0:e.by_name)||{},R=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),M=e=>{let t=R(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},U=Object.keys(n||{}).reduce((e,t)=>(e[R(t)]=n[t],e),{}),q=Object.keys(n||{}).map(e=>({keyNorm:M(e),url:n[e]})),H=(e,a)=>{if(!e)return a;const i=(n||{})[e],o=R(e);let r=i||U[o];if(!r){const t=M(e);for(const{keyNorm:e,url:n}of q)if(e&&(t.endsWith(e)||e.endsWith(t))){r=n;break}}const s=r||a;return"string"===typeof s&&s.startsWith("/")?t(s):s};if(null!==s&&void 0!==s&&null!==(f=s.competitions)&&void 0!==f&&f.length){var w;const e=(s.competitions||[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map((t,n)=>{const a=String(t.date_time||""),[i,o]=a.includes(" ")?a.split(" "):[a,""],[r,l,c]=i.split("."),d=r&&l&&c?"".concat(c,"-").concat(l.padStart(2,"0"),"-").concat(r.padStart(2,"0")):(new Date).toISOString().slice(0,10),h=(o||"18:00").slice(0,5);return{id:t.match_id||n+1,homeTeam:t.home,awayTeam:t.away,competition:t.competition||t.competition_name||(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||"",date:d,time:h,venue:t.venue||"",isHome:null===s||void 0===s||!s.name||(t.home||"").toLowerCase().includes(String(s.name).toLowerCase()),homeLogoURL:H(t.home,t.home_logo_url),awayLogoURL:H(t.away,t.away_logo_url),score:t.score,facr_link:t.facr_link,report_url:t.report_url}})),t=(e,t)=>new Date("".concat(e,"T").concat(t||"00:00",":00")).getTime(),n=Date.now(),a=12096e5,i=n-a,o=n+a,r=e.map(e=>(0,h.A)((0,h.A)({},e),{},{__ts:t(e.date,e.time)})).filter(e=>{const t=e.__ts;return"number"===typeof t&&!isNaN(t)&&t>=i&&t<=o}).sort((e,t)=>e.__ts-t.__ts).map(e=>{let{__ts:t}=e;return(0,O.A)(e,Ba)});l(r);const c=(s.competitions||[]).map(e=>{var t;const n=(Array.isArray(e.matches)?e.matches:[]).map((e,t)=>{const n=String(e.date_time||""),[a,i]=n.includes(" ")?n.split(" "):[n,""],[o,r,s]=(a||"").split("."),l=o&&r&&s?"".concat(s,"-").concat(r.padStart(2,"0"),"-").concat(o.padStart(2,"0")):(new Date).toISOString().slice(0,10),c=(i||"18:00").slice(0,5);return{id:e.match_id||t+1,date:l,time:c,home:e.home,away:e.away,home_id:e.home_id,away_id:e.away_id,home_logo_url:H(e.home,e.home_logo_url),away_logo_url:H(e.away,e.away_logo_url),score:e.score,facr_link:e.facr_link,report_url:e.report_url,venue:e.venue||""}}).filter(e=>{const t=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();return!isNaN(t)&&t>=i&&t<=o});return{name:(null===j||void 0===j||null===(t=j[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||e.name||e.code||"Sout\u011b\u017e",matches_link:e.matches_link,matches:n}});te(c);const d=null===r||void 0===r?void 0:r[0];xe(d&&(d.facr_link||d.report_url)||(null===c||void 0===c||null===(w=c[0])||void 0===w?void 0:w.matches_link)||(null===s||void 0===s?void 0:s.url))}else l((e=>e?(Array.isArray(e)?e:Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:Array.isArray(null===e||void 0===e?void 0:e.data)?e.data:[]).slice(0,2).map((e,t)=>{var n,a,i,o,r,s,l,c,d,h,u,m,p,x,g,v,j,b,y,f,k,z,w,_,S,C,A,E;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,homeTeam:null!==(a=null!==(i=null!==(o=e.homeTeam)&&void 0!==o?o:e.home_team)&&void 0!==i?i:e.home)&&void 0!==a?a:"Home",awayTeam:null!==(r=null!==(s=null!==(l=e.awayTeam)&&void 0!==l?l:e.away_team)&&void 0!==s?s:e.away)&&void 0!==r?r:"Away",competition:null!==(c=null!==(d=e.competition)&&void 0!==d?d:e.league)&&void 0!==c?c:"Match",date:null!==(h=null!==(u=null!==(m=e.date)&&void 0!==m?m:e.kickoffDate)&&void 0!==u?u:e.kickoff_date)&&void 0!==h?h:(new Date).toISOString().slice(0,10),time:null!==(p=null!==(x=null!==(g=e.time)&&void 0!==g?g:e.kickoffTime)&&void 0!==x?x:e.kickoff_time)&&void 0!==p?p:"18:00",venue:null!==(v=e.venue)&&void 0!==v?v:"Stadium",isHome:Boolean(null===(j=null!==(b=e.isHome)&&void 0!==b?b:e.is_home)||void 0===j||j),homeLogoURL:null!==(y=null!==(f=null!==(k=null!==(z=null!==(w=e.homeLogoURL)&&void 0!==w?w:e.HomeLogoURL)&&void 0!==z?z:e.home_logo_url)&&void 0!==k?k:e.home_logo)&&void 0!==f?f:e.homeLogo)&&void 0!==y?y:void 0,awayLogoURL:null!==(_=null!==(S=null!==(C=null!==(A=null!==(E=e.awayLogoURL)&&void 0!==E?E:e.AwayLogoURL)&&void 0!==A?A:e.away_logo_url)&&void 0!==C?C:e.away_logo)&&void 0!==S?S:e.awayLogo)&&void 0!==_?_:void 0}}):[])(i));const $=y||o;if(Le($),$){var S,A,T;const e=(null===$||void 0===$?void 0:$.club_name)||(null===$||void 0===$?void 0:$.clubName)||(null===$||void 0===$?void 0:$.name)||(null===$||void 0===$?void 0:$.siteName),t=(null===$||void 0===$?void 0:$.club_logo_url)||(null===$||void 0===$?void 0:$.clubLogo)||(null===$||void 0===$?void 0:$.logo)||(null===$||void 0===$?void 0:$.logoUrl)||(null===$||void 0===$?void 0:$.logoURL);e&&x(e),t&&v(t);try{const e=(await Bt()||[]).map(e=>({id:e.id,name:[e.first_name,e.last_name].filter(Boolean).join(" "),number:e.jersey_number,position:e.position,image:W(e.image_url)||void 0}));ve(e)}catch(F){}try{const e=await Jt(),t=(e||[]).map(e=>({id:e.id,name:e.name,logo:W(e.logo_url)||"/images/sponsors/placeholder.png",url:e.website_url||void 0}));be(t);const n=(e||[]).filter(e=>e&&e.placement).map(e=>({id:e.id,name:e.name,image:W(e.logo_url)||"/images/sponsors/placeholder.png",url:e.website_url||void 0,placement:e.placement,width:"number"===typeof e.width?e.width:void 0,height:"number"===typeof e.height?e.height:void 0}));n.length&&fe(n)}catch(Z){}try{const e=await xt({featured:!0,page_size:3}),t=((null===e||void 0===e?void 0:e.data)||[]).map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,title:e.title,excerpt:e.excerpt||(e.content||"").slice(0,140),image:e.image||e.image_url||"/images/news/placeholder.jpg",date:e.created_at||(new Date).toISOString(),category:"Aktuality",slug:e.slug}});ze(t),r(e=>{const n=new Set(t.map(e=>e.slug?"s:".concat(e.slug):"i:".concat(e.id)));return(e||[]).filter(e=>!n.has(e.slug?"s:".concat(e.slug):"i:".concat(e.id)))})}catch(K){}const n=(null===$||void 0===$?void 0:$.shop_url)||(null===$||void 0===$?void 0:$.shopUrl)||(null===$||void 0===$?void 0:$.eshop_url)||(null===$||void 0===$?void 0:$.e_shop_url)||null;n&&_(String(n));const a=(null===$||void 0===$?void 0:$.hero_style)||(null===$||void 0===$||null===(S=$.homepage)||void 0===S?void 0:S.hero_style)||(null===$||void 0===$?void 0:$.frontpage_hero_style);"grid"!==a&&"scroller"!==a&&"swiper"!==a&&"swiper_full"!==a||V(a);const i=(null===$||void 0===$||null===(A=$.homepage)||void 0===A?void 0:A.sponsors_layout)||(null===$||void 0===$?void 0:$.sponsors_layout)||(null===$||void 0===$?void 0:$.sponsorsLayout);"slider"!==i&&"grid"!==i&&"scroller"!==i&&"pyramid"!==i||z(i);const o=(null===$||void 0===$?void 0:$.sponsors_theme)||(null===$||void 0===$||null===(T=$.homepage)||void 0===T?void 0:T.sponsors_theme)||(null===$||void 0===$?void 0:$.sponsorsTheme);"dark"!==o&&"light"!==o||L(o);const s=(null===$||void 0===$?void 0:$.sponsors)||(null===$||void 0===$?void 0:$.partners)||null;Array.isArray(s)&&s.length&&be(s.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,name:e.name||"Sponsor",logo:e.logo_url||e.logoUrl||e.logo||"/images/sponsors/placeholder.png",url:e.url||e.website||e.link||"#"}})),C((null===$||void 0===$?void 0:$.facebook_url)||null),E((null===$||void 0===$?void 0:$.instagram_url)||null),N((null===$||void 0===$?void 0:$.youtube_url)||null),I((null===$||void 0===$?void 0:$.gallery_url)||(null===$||void 0===$?void 0:$.zonerama_url)||null),D((null===$||void 0===$?void 0:$.gallery_label)||"Fotogalerie"),Array.isArray(null===$||void 0===$?void 0:$.videos)&&_e($.videos),Array.isArray(null===$||void 0===$?void 0:$.videos_items)&&Ce($.videos_items),"boolean"===typeof(null===$||void 0===$?void 0:$.merch_module_enabled)&&Ne(!!$.merch_module_enabled),Array.isArray(null===$||void 0===$?void 0:$.merch_items)&&Ee($.merch_items.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t,title:e.title,image_url:e.image_url,url:e.url}}))}if(null!==c&&void 0!==c&&null!==(k=c.competitions)&&void 0!==k&&k.length){const e=(c.competitions||[]).map(e=>{var t,n;return{name:(null===j||void 0===j||null===(t=j[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||e.name||e.code,table:((null===(n=e.table)||void 0===n?void 0:n.overall)||[]).map((e,t)=>({position:Number(e.rank||t+1),team:e.team||e.team_name||"-",team_logo_url:H(e.team||e.team_name,e.team_logo_url),team_id:e.team_id,points:Number(e.points||e.pts||0),played:Number(e.played||0),wins:Number(e.wins||0),draws:Number(e.draws||0),losses:Number(e.losses||0),score:e.score||"0:0"}))}});b(e)}s&&(s.name&&!u&&x(s.name),s.logo_url&&!g&&v(s.logo_url),s.name&&x(s.name),s.logo_url&&v(s.logo_url)),Oe(!1)}var P})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{const e=()=>{if(ee.length){const e=(e=>{var t;const n=(Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[]).map(e=>({m:e,t:new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()})).filter(e=>!isNaN(e.t)&&e.t>Date.now()).sort((e,t)=>e.t-t.t);return(null===(t=n[0])||void 0===t?void 0:t.m)||null})(ee[Math.max(0,Math.min(ne,ee.length-1))]);if(e){const t="".concat(e.date,"T").concat(e.time||"00:00",":00"),n=new Date(t);return isNaN(n.getTime())?null:n}}if(!s.length)return null;const e=s[0],t="".concat(e.date,"T").concat(e.time||"00:00",":00"),n=new Date(t);return isNaN(n.getTime())?null:n},t=()=>{const t=e();if(!t)return void d("");const n=t.getTime()-Date.now();if(n<=0)return void d("Za\u010d\xe1tek");const a=Math.floor(n/1e3),i=Math.floor(a/86400),o=Math.floor(a%86400/3600),r=Math.floor(a%3600/60),s=a%60;d("".concat(i," d ").concat(o," h ").concat(r," m ").concat(s," s"))};t();const n=setInterval(t,1e3);return()=>clearInterval(n)},[s,ee,ne]),(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=(await lt()||[]).map(e=>({id:e.id,title:e.title,start_time:e.start_time,end_time:e.end_time,location:e.location,type:e.type,image_url:e.image_url}));e&&Pe(t)}catch(t){}})(),()=>{e=!1}},[]),(0,p.jsxs)(Ht,{headerInsideContainer:!0,children:[(0,p.jsxs)("div",{className:"container","data-element":"container",style:(0,h.A)({},qe("container")),children:[(0,p.jsx)("div",{"data-element":"style-pack","data-variant":$e,style:{display:"none"}}),Ke("hero-topbar",!0)&&(0,p.jsx)("section",{"data-element":"hero-topbar","data-variant":Ze("hero-topbar","brand"),style:(0,h.A)({},qe("hero-topbar")),children:(0,p.jsx)(Za,{variant:Ze("hero-topbar","brand"),fullBleed:"fullwidth"===Ze("header","unified")})}),!Ke("hero-topbar",!0)&&(0,p.jsxs)("div",{className:"home-header",children:[(0,p.jsx)(Wa,{teamId:null===Ue||void 0===Ue?void 0:Ue.club_id,teamName:u,facrLogo:W(g)||void 0,size:"custom",alt:"Klub",borderRadius:"full",style:{width:56,height:56}}),(0,p.jsxs)("div",{children:[(0,p.jsx)("h1",{style:{margin:0},children:u}),(0,p.jsx)("div",{className:"subtitle",style:{fontSize:"0.95rem"},children:"Ofici\xe1ln\xed web klubu"})]})]}),"grid"===Ze("hero",K)&&Ke("hero",!0)&&(0,p.jsxs)("section",{"data-element":"hero","data-variant":Ze("hero",K),className:"hero-grid",style:(0,h.A)({position:"relative"},qe("hero")),children:[ke[0]?(0,p.jsxs)("a",{href:"/news/".concat(ke[0].slug||ke[0].id),className:"hero-card big",style:{textDecoration:"none"},children:[(0,p.jsx)("div",{className:"bg",style:{backgroundImage:"url(".concat(W(ke[0].image)||"/images/news/placeholder.jpg",")")}}),(0,p.jsxs)("div",{className:"overlay",children:[(0,p.jsx)("div",{style:{opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:ke[0].category||"Aktuality"}),(0,p.jsx)("h2",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:ke[0].title})]})]}):(0,p.jsxs)("a",{href:"/news",className:"hero-card big",style:{textDecoration:"none"},children:[(0,p.jsx)("div",{className:"bg",style:{backgroundImage:"url('/images/news/placeholder.jpg')"}}),(0,p.jsxs)("div",{className:"overlay",children:[(0,p.jsx)("div",{style:{opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:"Aktuality"}),(0,p.jsx)("h2",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:"Nejnov\u011bj\u0161\xed titulek"})]})]}),(0,p.jsxs)("div",{className:"small-col",children:[ke.slice(1,3).map((e,t)=>(0,p.jsxs)("a",{href:"/news/".concat(e.slug||e.id),className:"hero-card small",style:{textDecoration:"none"},children:[(0,p.jsx)("div",{className:"bg",style:{backgroundImage:"url(".concat(W(e.image)||"/images/news/placeholder.jpg",")")}}),(0,p.jsxs)("div",{className:"overlay",children:[(0,p.jsx)("div",{style:{opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:e.category||"Aktuality"}),(0,p.jsx)("h3",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:e.title})]})]},e.id)),Array.from({length:Math.max(0,2-Math.min(2,Math.max(0,ke.length-1)))}).map((e,t)=>(0,p.jsxs)("a",{href:"/news",className:"hero-card small",style:{textDecoration:"none"},children:[(0,p.jsx)("div",{className:"bg",style:{backgroundImage:"url('/images/news/placeholder.jpg')",filter:"grayscale(50%) brightness(0.7)"}}),(0,p.jsxs)("div",{className:"overlay",children:[(0,p.jsx)("div",{style:{opacity:.8,fontSize:"0.8rem",color:"#fff"},children:"Aktuality"}),(0,p.jsx)("h3",{style:{margin:"4px 0 0 0",color:"#fff"},children:"P\u0159ipravujeme..."})]})]},"placeholder-".concat(t)))]})]},"hero-grid-".concat(He)),(ye||[]).some(e=>"homepage_middle"===e.placement)&&Ke("banner",!0)&&(0,p.jsx)("section",{"data-element":"banner","data-variant":Ze("banner","top"),className:"banner banner-middle",style:(0,h.A)({margin:"24px 0",textAlign:"center"},qe("banner")),children:(ye||[]).filter(e=>"homepage_middle"===e.placement).map(e=>(0,p.jsx)("a",{href:e.url||"#",target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,style:{display:"inline-block",margin:8},children:(0,p.jsx)("img",{src:e.image,alt:e.name,style:{maxWidth:"100%",width:e.width?"".concat(e.width,"px"):void 0,height:e.height?"".concat(e.height,"px"):"auto"}})},e.id))}),(ye||[]).some(e=>"homepage_sidebar"===e.placement)&&(0,p.jsx)("section",{"data-element":"sidebar","data-variant":Ze("sidebar","right"),className:"banner banner-sidebar",style:(0,h.A)({margin:"24px 0"},qe("sidebar")),children:(0,p.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,p.jsx)("div",{style:{width:320,maxWidth:"100%",position:"sticky",top:96},children:(ye||[]).filter(e=>"homepage_sidebar"===e.placement).map(e=>(0,p.jsx)("a",{href:e.url||"#",target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,style:{display:"block",marginBottom:12},children:(0,p.jsx)("img",{loading:"lazy",src:e.image,alt:e.name,style:{width:e.width?"".concat(e.width,"px"):"100%",height:e.height?"".concat(e.height,"px"):"auto",maxWidth:"100%"}})},e.id))})})}),"scroller"===Ze("hero",K)&&Ke("hero",!0)&&(0,p.jsx)("section",{"data-element":"hero","data-variant":Ze("hero",K),style:(0,h.A)({position:"relative"},qe("hero")),children:(0,p.jsx)(ln,{})},"hero-scroller-".concat(He)),("swiper"===Ze("hero",K)||"swiper_full"===Ze("hero",K))&&Ke("hero",!0)&&(0,p.jsx)("section",{"data-element":"hero","data-variant":Ze("hero",K),style:"swiper_full"===Ze("hero",K)?(0,h.A)({position:"relative",marginLeft:"calc(50% - 50vw)",marginRight:"calc(50% - 50vw)"},qe("hero")):(0,h.A)({position:"relative"},qe("hero")),children:(0,p.jsx)(gn,{fallbackArticles:Be})},"hero-swiper-".concat(He)),ee.length>0&&Ke("matches",!0)?(e=>{const t=ee[Math.max(0,Math.min(ne,ee.length-1))],n=Array.isArray(null===t||void 0===t?void 0:t.matches)?t.matches:[],a=null===(e=n.map(e=>({m:e,t:new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()})).filter(e=>!isNaN(e.t)&&e.t>Date.now()).sort((e,t)=>e.t-t.t)[0])||void 0===e?void 0:e.m,i=a||n[0]||null,o=i&&(i.facr_link||i.report_url)||(null===t||void 0===t?void 0:t.matches_link)||pe;return(0,p.jsx)(Va,{data:i,competitionName:null===t||void 0===t?void 0:t.name,countdown:c,onPrev:()=>ae(e=>(e-1+ee.length)%ee.length),onNext:()=>ae(e=>(e+1)%ee.length),onOpen:()=>{i?(ce((0,h.A)((0,h.A)({},i),{},{competition:null===t||void 0===t?void 0:t.name})),he(!0)):o&&window.open(o,"_blank","noopener,noreferrer")},elementProps:{"data-element":"matches","data-variant":Ze("matches","compact"),style:(0,h.A)({},qe("matches"))}})})():Ke("matches",!0)?(0,p.jsx)(Va,{data:{home:(null===(e=s[0])||void 0===e?void 0:e.homeTeam)||u,home_logo_url:(null===(t=s[0])||void 0===t?void 0:t.homeLogoURL)||g,away:(null===(n=s[0])||void 0===n?void 0:n.awayTeam)||"Soupe\u0159",away_logo_url:null===(i=s[0])||void 0===i?void 0:i.awayLogoURL},countdown:c,elementProps:{"data-element":"matches","data-variant":Ze("matches","compact"),style:(0,h.A)({position:"relative"},qe("matches"))}}):null,ee.length>0&&(0,p.jsx)(Ha,{comps:ee,activeIndex:ne,onActiveChange:ae,onMatchClick:(e,t)=>{ce((0,h.A)((0,h.A)({},e),{},{competition:t,competitionName:t})),he(!0)},elementProps:{"data-element":"matches-slider","data-variant":Ze("matches-slider","carousel"),style:(0,h.A)({position:"relative"},qe("matches-slider"))}}),(()=>{const e=ee[ne],t=(null===e||void 0===e?void 0:e.name)||"",n=j.find(e=>e.name===t),a=!!n&&(n.table&&n.table.length>0||n.rows&&n.rows.length>0),i=Ke("news",!0),r=Ke("table",!0)&&a,s=i&&r?void 0:"standard";return i||r?(0,p.jsxs)("section",{className:"standings","data-variant":s,style:{marginTop:32},children:[i&&(0,p.jsxs)("section",{"data-element":"news","data-variant":Ze("news","grid"),className:"news-list",style:(0,h.A)({},qe("news")),children:[(0,p.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,p.jsx)("h3",{children:"Dal\u0161\xed aktuality"}),(0,p.jsxs)("a",{href:"/news",className:"see-all",style:{fontSize:"0.85rem"},children:["Zobrazit v\u0161e ",(0,p.jsx)(q.dyV,{size:14})]})]}),(0,p.jsx)(Ka,{items:o})]}),r&&(0,p.jsxs)("div",{"data-element":"table","data-variant":Ze("table","split_news"),style:(0,h.A)({},qe("table")),children:[(0,p.jsxs)("div",{className:"section-head",style:{marginTop:0,marginBottom:12},children:[(0,p.jsx)("h3",{children:"Tabulky"}),(0,p.jsxs)("a",{href:"/tabulky",className:"see-all",style:{fontSize:"0.85rem"},children:["Zobrazit v\u0161e ",(0,p.jsx)(q.dyV,{size:14})]})]}),(0,p.jsx)(qa,{rows:(null===n||void 0===n?void 0:n.table)||(null===n||void 0===n?void 0:n.rows)||[],onRowClick:e=>{var t,n,a,i,o,r,s,l,c,d,h,u,m,p,x,g,v,j;const b={team:null!==(t=null!==(n=null!==(a=null===(i=e.team)||void 0===i?void 0:i.name)&&void 0!==a?a:e.team)&&void 0!==n?n:e.club)&&void 0!==t?t:"-",team_id:e.team_id||"",team_logo_url:e.team_logo_url,rank:null!==(o=null!==(r=null!==(s=e.position)&&void 0!==s?s:e.pos)&&void 0!==r?r:e.rank)&&void 0!==o?o:0,played:null!==(l=null!==(c=e.played)&&void 0!==c?c:e.matches)&&void 0!==l?l:"-",wins:null!==(d=null!==(h=e.wins)&&void 0!==h?h:e.win)&&void 0!==d?d:"-",draws:null!==(u=null!==(m=e.draws)&&void 0!==m?m:e.draw)&&void 0!==u?u:"-",losses:null!==(p=null!==(x=e.losses)&&void 0!==x?x:e.loss)&&void 0!==p?p:"-",score:null!==(g=e.score)&&void 0!==g?g:"-",points:null!==(v=null!==(j=e.points)&&void 0!==j?j:e.pts)&&void 0!==v?v:"-"};oe(b),se(!0)}})]})]}):null})(),Re.length>0&&Ke("activities",!0)&&(0,p.jsx)("section",{"data-element":"activities","data-variant":Ze("activities","list"),style:(0,h.A)({marginTop:32,marginBottom:16,position:"relative"},qe("activities")),children:(0,p.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:[(0,p.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,p.jsx)("h3",{children:"Aktivity"}),(0,p.jsxs)("a",{href:"/aktivity",className:"see-all",children:["Zobrazit v\u0161e ",(0,p.jsx)(q.dyV,{})]})]}),(0,p.jsx)($a,{items:Re})]})}),ge.length>0&&Ke("team",!1)&&(0,p.jsxs)("section",{"data-element":"team","data-variant":Ze("team","grid"),className:"players-scroller",style:(0,h.A)({marginTop:32,position:"relative"},qe("team")),children:[(0,p.jsxs)("div",{className:"section-head",children:[(0,p.jsx)("h3",{children:"Hr\xe1\u010di"}),(0,p.jsxs)("a",{href:"/players",className:"see-all",children:["Zobrazit v\u0161e ",(0,p.jsx)(q.dyV,{})]})]}),(0,p.jsx)("div",{className:"scroll-x",children:ge.map(e=>(0,p.jsxs)("a",{href:e.slug?"/players/".concat(e.slug):"/players/".concat(e.id),className:"player-card",children:[(0,p.jsx)("div",{className:"photo",style:{backgroundImage:"url(".concat(W(e.image)||e.image,")")}}),(0,p.jsxs)("div",{className:"meta",children:[(0,p.jsxs)("span",{className:"nr",children:["#",e.number]})," ",e.name]}),(0,p.jsx)("div",{className:"pos",children:e.position})]},e.id))})]}),Ke("gallery",!1)&&(0,p.jsx)("section",{"data-element":"gallery","data-variant":Ze("gallery","grid"),style:(0,h.A)({marginTop:32,marginBottom:32,position:"relative"},qe("gallery")),children:(0,p.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:(0,p.jsx)(Hn,{zoneramaUrl:P})})}),Ke("videos",!1)&&(0,p.jsx)("section",{"data-element":"videos","data-variant":Ze("videos","grid"),style:(0,h.A)({marginTop:32,marginBottom:32,position:"relative"},qe("videos")),children:(0,p.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:(0,p.jsx)(yn,{})})}),Ke("merch",!0)&&(0,p.jsx)("section",{"data-element":"merch","data-variant":Ze("merch","grid"),style:(0,h.A)({marginTop:24,marginBottom:24,position:"relative"},qe("merch")),children:(0,p.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:(0,p.jsx)(kn,{})})}),Ke("poll",!1)&&(0,p.jsx)("section",{"data-element":"poll","data-variant":Ze("poll","vertical"),style:(0,h.A)({marginTop:32,marginBottom:32,position:"relative"},qe("poll")),children:(0,p.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:(0,p.jsx)(On,{featuredOnly:!0,maxPolls:1,title:"Anketa"})})}),(ye||[]).some(e=>"homepage_footer"===e.placement)&&(0,p.jsx)("section",{"data-element":"banner","data-variant":Ze("banner","bottom"),className:"banner banner-footer",style:(0,h.A)({margin:"24px 0",textAlign:"center"},qe("banner")),children:(ye||[]).filter(e=>"homepage_footer"===e.placement).map(e=>(0,p.jsx)("a",{href:e.url||"#",target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,style:{display:"inline-block",margin:8},children:(0,p.jsx)("img",{src:e.image,alt:e.name,style:{maxWidth:"100%",width:e.width?"".concat(e.width,"px"):void 0,height:e.height?"".concat(e.height,"px"):"auto"}})},e.id))}),Ke("newsletter",!1)&&(0,p.jsx)("section",{"data-element":"newsletter","data-variant":Ze("newsletter","default"),className:"newsletter-cta",style:(0,h.A)({marginTop:24,marginBottom:24,position:"relative"},qe("newsletter")),children:(0,p.jsx)("div",{className:"card",style:{maxWidth:960,margin:"0 auto"},children:(0,p.jsx)(Xn,{})})}),Ke("sponsors",!0)&&(0,p.jsxs)("section",{"data-element":"sponsors",className:"sponsors ".concat("dark"===U?"dark":""),style:(0,h.A)({width:"100vw",position:"relative",left:"50%",right:"50%",transform:"translateX(-50%)",paddingLeft:"max(16px, calc((100vw - 1200px) / 2))",paddingRight:"max(16px, calc((100vw - 1200px) / 2))",boxSizing:"border-box"},qe("sponsors")),children:[(0,p.jsx)("div",{className:"section-head",children:(0,p.jsx)("h3",{children:"Sponzo\u0159i"})}),"grid"===k?(()=>{const e=je.find(e=>"title"===e.tier)||je[0],t=je.filter(t=>t!==e);return(0,p.jsxs)(p.Fragment,{children:[e&&(0,p.jsx)("div",{className:"title-sponsor",children:(0,p.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:W(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})})}),(0,p.jsx)("div",{className:"divider","aria-hidden":!0}),(0,p.jsx)("div",{className:"sponsors-grid",children:t.map(e=>(0,p.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:W(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},e.id))})]})})():(0,p.jsx)("div",{className:"sponsors-slider",children:(0,p.jsx)("div",{className:"track",children:[...je,...je].map((e,t)=>(0,p.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,p.jsx)("img",{src:W(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"".concat(e.id,"-").concat(t)))})})]})]}),(0,p.jsx)(Da,{isOpen:re,onClose:()=>se(!1),club:ie,clubType:(null===Ue||void 0===Ue?void 0:Ue.club_type)||"football"}),(0,p.jsx)(Fa,{isOpen:de,onClose:()=>he(!1),match:le,onTeamClick:(e,t)=>{console.log("Team clicked:",e)}}),(0,p.jsx)(Ea,{children:(0,p.jsx)(Ca,{pageType:"homepage"})})]})};var Ya=n(5081),Ga=n(1100);async function Xa(){const e=(await m.Ay.get("/categories")).data;return Array.isArray(e)?e:e&&Array.isArray(e.items)?e.items:e&&Array.isArray(e.data)?e.data:[]}const Qa=()=>(0,p.jsx)("section",{className:"newsletter-cta",style:{marginTop:24,marginBottom:24},children:(0,p.jsx)("div",{className:"card",style:{maxWidth:960,margin:"0 auto"},children:(0,p.jsx)(Xn,{})})}),ei=e=>{let{article:t}=e;const n=t.slug?"/news/".concat(t.slug):"/articles/".concat(t.id),a=t.read_time||t.estimated_read_minutes,i=t.view_count,o=(0,b.dU)("white","gray.800");return(0,p.jsx)(Ya.Q,{as:d.N_,to:n,borderRadius:"md",overflow:"hidden",bg:o,borderWidth:"0",_hover:{boxShadow:"xl",transform:"translateY(-3px)"},transition:"all 0.25s ease",children:(0,p.jsxs)(y.a,{position:"relative",children:[(0,p.jsx)(k._,{src:W(t.image_url)||"/stadium-placeholder.jpg",alt:t.title,w:"100%",h:{base:"200px",md:"220px"},objectFit:"cover"}),(0,p.jsx)(y.a,{position:"absolute",inset:0,bgGradient:"linear(to-t, rgba(0,0,0,0.55), rgba(0,0,0,0.15))"}),(a||i&&i>0)&&(0,p.jsxs)(ee.z,{position:"absolute",top:2,right:2,spacing:1,children:[a&&(0,p.jsxs)(Qt.E,{display:"flex",alignItems:"center",gap:1,bg:"rgba(0,0,0,0.7)",color:"white",fontSize:"xs",px:2,py:1,borderRadius:"md",children:[(0,p.jsx)(on.A,{size:12}),a," min"]}),i&&i>0&&(0,p.jsxs)(Qt.E,{display:"flex",alignItems:"center",gap:1,bg:"rgba(0,0,0,0.7)",color:"white",fontSize:"xs",px:2,py:1,borderRadius:"md",children:[(0,p.jsx)(rn.A,{size:12}),i]})]}),(0,p.jsx)(z.D,{as:"h3",fontSize:{base:"lg",md:"xl"},fontWeight:"800",letterSpacing:"0.3px",textTransform:"uppercase",position:"absolute",bottom:3,left:4,right:4,color:"white",noOfLines:2,children:t.title})]})})},ti=()=>{var e;const[t,n]=a.useState([]),[i,o]=(0,d.ok)(),r=a.useMemo(()=>{const e=i.get("category_id");return e?Number(e):""},[]),[s,l]=a.useState(r),c=i.get("month")||"",u=i.get("match_id")||"",m=(0,b.dU)("gray.200","gray.700"),x=(0,b.dU)("gray.500","gray.400");a.useEffect(()=>{(async()=>{try{const e=await Xa();n(e||[])}catch(e){}})()},[]);const{data:g,isLoading:v,isFetchingNextPage:j,hasNextPage:f,fetchNextPage:k}=(0,Ga.q)(["articles-public",{page_size:18,published:!0,category_id:s||void 0,month:c||void 0,match_id:u||void 0}],e=>{let{pageParam:t=1}=e;return xt((0,h.A)((0,h.A)((0,h.A)({page:t,page_size:18,published:!0},s?{category_id:Number(s)}:{}),c?{month:c}:{}),u?{match_id:u}:{}))},{getNextPageParam:(e,t)=>{const n=t.reduce((e,t)=>{var n;return e+((null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.length)||0)},0);if(e)return n<(e.total||0)?t.length+1:void 0}}),_=(null===g||void 0===g||null===(e=g.pages)||void 0===e?void 0:e.flatMap(e=>(null===e||void 0===e?void 0:e.data)||[]))||[],S=a.useRef(null);return a.useEffect(()=>{if(!f||!S.current)return;const e=S.current,t=new IntersectionObserver(e=>{e[0].isIntersecting&&f&&!j&&k()},{rootMargin:"400px"});return t.observe(e),()=>t.disconnect()},[f,j,k]),(0,p.jsx)(Ht,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(y.a,{bg:"transparent",color:"inherit",py:{base:8,md:10},mb:4,borderBottom:"1px",borderColor:m,children:(0,p.jsx)(Z.m,{maxW:"7xl",children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsx)(z.D,{as:"h1",size:{base:"xl",md:"2xl"},children:"Blog"}),!!t.length&&(0,p.jsx)(ha.l,{maxW:{base:"52%",md:"320px"},placeholder:"V\u0161echny kategorie",value:s,onChange:e=>{const t=e.target.value?Number(e.target.value):"";l(t);const n={};t&&(n.category_id=String(t)),c&&(n.month=c),u&&(n.match_id=u),o(n)},children:t.map(e=>(0,p.jsx)("option",{value:e.id,children:e.name},e.id))})]})})}),(0,p.jsxs)(Z.m,{maxW:"7xl",children:[(0,p.jsxs)(y.a,{sx:{columnCount:{base:1,sm:2,lg:3},columnGap:"28px"},children:[v&&Array.from({length:9}).map((e,t)=>(0,p.jsx)(en.E,{h:{base:"220px",md:"260px"},borderRadius:"md",mb:7},t)),!v&&_.map(e=>(0,p.jsx)(y.a,{mb:7,sx:{breakInside:"avoid",WebkitColumnBreakInside:"avoid",pageBreakInside:"avoid"},children:(0,p.jsx)(ei,{article:e})},e.id))]}),!v&&!_.length&&(0,p.jsx)(w.T,{py:16,children:(0,p.jsx)(U.E,{color:x,children:"\u017d\xe1dn\xe9 \u010dl\xe1nky k zobrazen\xed."})}),(0,p.jsx)(y.a,{ref:S,h:"1px"}),j&&(0,p.jsx)(w.T,{py:6,children:(0,p.jsx)(U.E,{color:x,children:"Na\u010d\xedt\xe1n\xed\u2026"})})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})})};var ni=n(8239),ai=n(7977),ii=n(9367);const oi=e=>{let{articleId:t,eventId:n,videoUrl:i,title:o="Hlasov\xe1n\xed",showTitle:r=!0,maxPolls:s}=e;const l=(0,b.dU)("gray.50","gray.900"),c={};t&&(c.article_id=t),n&&(c.event_id=n),i&&(c.video_url=i);const{data:d,isLoading:h}=(0,xe.I)({queryKey:["embedded-polls",c],queryFn:()=>wn(c),enabled:!!(t||n||i),staleTime:12e4}),u=d||[],m=a.useMemo(()=>{const e=[...u].sort((e,t)=>{const n="rating"===e.type?1:0,a="rating"===t.type?1:0;if(n!==a)return a-n;const i=e.featured?1:0,o=t.featured?1:0;if(i!==o)return o-i;const r=new Date(e.created_at).getTime();return new Date(t.created_at).getTime()-r});return"number"===typeof s?e.slice(0,s):e},[u,s]),{data:x,isLoading:g}=(0,xe.I)({queryKey:["embedded-polls-details",m.map(e=>e.id)],queryFn:async()=>{const e=m.map(e=>_n(e.id));return await Promise.all(e)},enabled:m.length>0});return t||n||i?h?(0,p.jsx)(y.a,{py:4,children:(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Na\u010d\xedt\xe1n\xed hlasov\xe1n\xed..."})]})}):d&&0!==d.length&&x&&0!==x.length?(0,p.jsx)(y.a,{bg:l,py:8,px:4,borderRadius:"xl",my:8,children:(0,p.jsxs)(w.T,{spacing:6,maxW:"6xl",mx:"auto",children:[r&&(0,p.jsx)(z.D,{size:"md",textAlign:"center",children:o}),g?(0,p.jsxs)(w.T,{py:8,children:[(0,p.jsx)(zn.y,{}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed..."})]}):(()=>{const e=[...x||[]].sort((e,t)=>{const n="rating"===e.poll.type?1:0,a="rating"===t.poll.type?1:0;if(n!==a)return a-n;const i=e.poll.featured?1:0,o=t.poll.featured?1:0;if(i!==o)return o-i;const r=new Date(e.poll.created_at).getTime();return new Date(t.poll.created_at).getTime()-r}),t="number"===typeof s?e.slice(0,s):e,n=t.length;if(1===n){const e=t[0];return(0,p.jsx)(y.a,{w:"full",children:(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results})})}return 2===n?(0,p.jsx)(Tt.r,{w:"full",columns:{base:1,md:2},spacing:4,children:t.map(e=>(0,p.jsx)(y.a,{children:(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results})},e.poll.id))}):(0,p.jsx)(Tt.r,{w:"full",columns:{base:1,sm:2,lg:3},spacing:4,children:t.map(e=>(0,p.jsx)(y.a,{children:(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results})},e.poll.id))})})()]})}):null:null};var ri=n(764);const si=e=>{let{url:t,name:n,mimeType:a="",size:i}=e;const o=W(t)||t,r=n||t.split("/").pop()||"file",s=a.toLowerCase(),l=(0,b.dU)("gray.200","gray.700"),c=(0,b.dU)("white","gray.800"),d=(0,b.dU)("gray.600","gray.300"),h=s.startsWith("image/")?{type:"image",icon:q.fZZ,color:"purple.500",canPreview:!0}:"application/pdf"===s?{type:"pdf",icon:q.jH2,color:"red.500",canPreview:!0}:s.startsWith("video/")?{type:"video",icon:q.pVQ,color:"pink.500",canPreview:!0}:s.startsWith("audio/")?{type:"audio",icon:q.$Mw,color:"green.500",canPreview:!0}:s.includes("word")||s.includes("document")?{type:"document",icon:q.jH2,color:"blue.500",canPreview:!1}:s.includes("sheet")||s.includes("excel")?{type:"spreadsheet",icon:q.QuH,color:"green.600",canPreview:!1}:s.includes("presentation")||s.includes("powerpoint")?{type:"presentation",icon:q.QuH,color:"orange.500",canPreview:!1}:{type:"other",icon:q.QuH,color:"gray.500",canPreview:!1},u="number"===typeof i?Math.round(i/1024):void 0,m=u&&u>1024?(u/1024).toFixed(1):void 0,x=m?"".concat(m," MB"):u?"".concat(u," kB"):"";return(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderColor:l,borderRadius:"md",bg:c,children:[(0,p.jsxs)(ee.z,{flex:1,minW:0,children:[(0,p.jsx)(jn.I,{as:h.icon,color:h.color,flexShrink:0}),(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,minW:0,children:[(0,p.jsx)(U.E,{fontWeight:"medium",isTruncated:!0,maxW:"100%",children:r}),x&&(0,p.jsx)(U.E,{fontSize:"xs",color:d,children:x})]})]}),(0,p.jsx)(ee.z,{spacing:2,flexShrink:0,children:(0,p.jsx)(T.$,{as:L.N,href:o,isExternal:!0,size:"sm",leftIcon:(0,p.jsx)(q.HaR,{}),colorScheme:"blue",children:"Otev\u0159\xedt v nov\xe9m okn\u011b"})})]})},li=()=>{var e,t,n,i,o,r,s;const{id:l,slug:u}=(0,c.g)(),{data:x,isLoading:g,isError:v}=(0,xe.I)({queryKey:["article",u?"slug:".concat(u):"id:".concat(l)],queryFn:()=>u?async function(e){try{return(await m.Ay.get("/articles/slug/".concat(encodeURIComponent(e)))).data}catch(n){var t;return null===(t=(await xt({slug:e})).data)||void 0===t?void 0:t[0]}}(u):async function(e){const t=await m.Ay.get("/articles/".concat(e));return ut(t.data)}(l),enabled:Boolean(u||l)}),{data:j}=ge(),f=(0,b.dU)("white","gray.900"),_=(0,b.dU)("gray.50","gray.800"),S=(0,b.dU)("gray.600","gray.400"),C=(0,b.dU)("gray.700","gray.300"),A=(0,b.dU)("blue.50","blue.900"),E=(0,b.dU)("blue.200","blue.700"),N=(0,b.dU)("gray.50","gray.800"),[R,P]=a.useState(null);a.useEffect(()=>{var e,t;x&&x.id&&(!async function(e){try{await m.Ay.post("/articles/".concat(e,"/track-view"))}catch(t){console.debug("Failed to track article view:",t)}}(x.id),e=x.id,t=x.title,It("Article View",{id:e,title:t}))},[x]);const I=a.useRef(null);a.useEffect(()=>{const e=I.current;if(!e)return;const t=e=>{let t=e.target;if(!t)return;const n=t.closest?t.closest("a"):null;if(n&&n.href)try{const e=n.getAttribute("href")||n.href;It("Link Click",{href:e,page:window.location.pathname,context:"article_content"})}catch(a){}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[I.current]);const M=(0,xe.I)({queryKey:["article-match-link",null===x||void 0===x?void 0:x.id],queryFn:()=>mt(null===x||void 0===x?void 0:x.id),enabled:Boolean(null===x||void 0===x?void 0:x.id),staleTime:6e4});a.useEffect(()=>{var e;const t=null===(e=M.data)||void 0===e?void 0:e.external_match_id;t&&It("Match View",{id:t})},[null===(e=M.data)||void 0===e?void 0:e.external_match_id]);const D=(0,xe.I)({queryKey:["facr-cached-match",null===(t=M.data)||void 0===t?void 0:t.external_match_id],enabled:Boolean(null===(n=M.data)||void 0===n?void 0:n.external_match_id),queryFn:async()=>{const e=new URL(m.API_URL,window.location.origin).origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return null;const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[];for(const r of i){const e=Array.isArray(r.matches)?r.matches:[];for(const t of e){var o;if(String(t.match_id||t.id)===String(null===(o=M.data)||void 0===o?void 0:o.external_match_id))return(0,h.A)((0,h.A)({},t),{},{competitionName:r.name})}}return null},staleTime:6e4}),F=(0,xe.I)({queryKey:["article-gallery-album",(null===x||void 0===x?void 0:x.gallery_album_id)||(null===x||void 0===x?void 0:x.gallery_album_url)],enabled:Boolean((null===x||void 0===x?void 0:x.gallery_album_id)||(null===x||void 0===x?void 0:x.gallery_album_url)),queryFn:async()=>{const e=null===x||void 0===x?void 0:x.gallery_album_id;let t=[];const n=null===x||void 0===x?void 0:x.gallery_photo_ids;if(Array.isArray(n))t=n;else if("string"===typeof n)try{const e=JSON.parse(n);t=Array.isArray(e)?e.map(String):n.split(",").map(e=>e.trim()).filter(Boolean)}catch(l){t=n.split(",").map(e=>e.trim()).filter(Boolean)}const a=new URL(m.API_URL,window.location.origin).origin,[i,o]=await Promise.allSettled([fetch("".concat(a,"/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch("".concat(a,"/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);if("fulfilled"===i.status&&i.value.ok){const n=((await i.value.json()).albums||[]).find(t=>t.id===e);if(n){const e=t.length>0?n.photos.filter(e=>t.includes(e.id)):n.photos;return(0,h.A)((0,h.A)({},n),{},{photos:e})}}if("fulfilled"===o.status&&o.value.ok){const n=await o.value.json(),a=(Array.isArray(n)?n:[]).find(t=>t.id===e);if(a){const e=t.length>0?a.photos.filter(e=>t.includes(e.id)):a.photos;return(0,h.A)((0,h.A)({},a),{},{photos:e})}}const r=null===x||void 0===x?void 0:x.gallery_album_url;if(r){const e=new URLSearchParams({link:r,photo_limit:"12",rendered:"true"}),n=await fetch("".concat(m.API_URL,"/zonerama-album?").concat(e.toString()));if(n.ok){const e=await n.json();let a=[];var s;if(Array.isArray(null===e||void 0===e?void 0:e.albums)&&e.albums.length>0)a=(null===(s=e.albums[0])||void 0===s?void 0:s.photos)||[];else Array.isArray(null===e||void 0===e?void 0:e.photos)&&(a=e.photos);return t.length>0&&(a=a.filter(e=>t.includes(e.id))),{id:r,title:"Album",date:"",photos:a}}}return null},staleTime:6e4});a.useEffect(()=>{const e=null===x||void 0===x?void 0:x.gallery_album_id;var t,n;e&&F.data&&It("Gallery Section Shown",{album_id:e,photos:(null===(t=F.data)||void 0===t||null===(n=t.photos)||void 0===n?void 0:n.length)||0})},[null===x||void 0===x?void 0:x.gallery_album_id,F.data]);const O=a.useCallback(e=>{if(!e)return"";try{const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return e.replace(/src=("|')\s*(\/uploads\/[^"']+)("|')/g,(e,n,a,i)=>"src=".concat(n).concat(t).concat(a).concat(i)).replace(/href=("|')\s*(\/uploads\/[^"']+)("|')/g,(e,n,a,i)=>"href=".concat(n).concat(t).concat(a).concat(i))}catch(t){return e}},[]),K=a.useMemo(()=>{const e=O(null===x||void 0===x?void 0:x.content);return ai.A.sanitize(e||"",{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["target","rel","allow","allowfullscreen"]})},[null===x||void 0===x?void 0:x.content,O]);if(g)return(0,p.jsx)(zn.y,{});if(v||!x)return(0,p.jsx)(U.E,{color:"red.500",children:"\u010cl\xe1nek nenalezen"});const q=x.seo_title||x.title,V=x.seo_description||(e=>{if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,(t.textContent||t.innerText||"").replace(/\s+/g," ").trim()})(x.content).slice(0,160),H=x.og_image_url||x.image_url||"/logo512.png",$=W(H)||H,B="undefined"!==typeof window?window.location.href:void 0,J=x.published_at||x.created_at,Y=(()=>{if(!J)return"";try{const e=new Date(J);return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"))}catch(e){return""}})();return(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ii.mg,{children:[(0,p.jsx)("title",{children:q}),(0,p.jsx)("meta",{name:"description",content:V}),(0,p.jsx)("meta",{property:"og:type",content:"article"}),(0,p.jsx)("meta",{property:"og:title",content:q}),(0,p.jsx)("meta",{property:"og:description",content:V}),(0,p.jsx)("meta",{property:"og:image",content:$}),(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("meta",{name:"twitter:title",content:q}),(0,p.jsx)("meta",{name:"twitter:description",content:V}),(0,p.jsx)("meta",{name:"twitter:image",content:$}),B&&(0,p.jsx)("link",{rel:"canonical",href:B}),(0,p.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"NewsArticle",headline:q,image:[$],datePublished:x.published_at||x.created_at,dateModified:x.updated_at||x.published_at||x.created_at,author:x.author?{"@type":"Person",name:"".concat(x.author.first_name||""," ").concat(x.author.last_name||"").trim()||x.author.email}:void 0,description:V,mainEntityOfPage:B||void 0})}),(0,p.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Dom\u016f",item:("undefined"!==typeof window?window.location.origin:"")+"/"},{"@type":"ListItem",position:2,name:"Blog",item:("undefined"!==typeof window?window.location.origin:"")+"/blog"},{"@type":"ListItem",position:3,name:q,item:B||void 0}]})})]}),(0,p.jsx)(y.a,{bg:"transparent",color:"inherit",py:{base:6,md:8},mb:2,children:(0,p.jsxs)(Z.m,{maxW:"7xl",children:[(0,p.jsx)(z.D,{as:"h1",size:{base:"xl",md:"2xl"},mb:2,children:x.title}),(0,p.jsxs)(ee.z,{spacing:2,rowGap:2,wrap:"wrap",fontSize:"sm",color:S,children:[x.read_time||x.estimated_read_minutes?(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(on.A,{size:16}),(0,p.jsxs)(U.E,{children:[x.read_time||x.estimated_read_minutes," min \u010dten\xed"]})]}):null,J&&(0,p.jsx)(ni.vw,{as:d.N_,to:"/news?month=".concat(Y),size:"sm",variant:"subtle",children:new Date(J).toLocaleDateString("cs-CZ")}),(null===x||void 0===x||null===(i=x.category)||void 0===i?void 0:i.id)&&(0,p.jsx)(ni.vw,{as:d.N_,to:"/news?category_id=".concat(x.category.id),size:"sm",variant:"subtle",children:x.category.name||"Kategorie"}),(null===(o=M.data)||void 0===o?void 0:o.external_match_id)&&(0,p.jsx)(ni.vw,{as:d.N_,to:"/news?match_id=".concat(M.data.external_match_id),size:"sm",variant:"subtle",children:"Z\xe1pas"}),x.view_count?(0,p.jsxs)(ee.z,{spacing:1,ml:{base:0,md:2},children:[(0,p.jsx)(rn.A,{size:16}),(0,p.jsxs)(U.E,{children:[x.view_count," zobrazen\xed"]})]}):null]})]})}),(0,p.jsx)(Z.m,{maxW:"7xl",children:(0,p.jsxs)(At.B,{spacing:6,children:[x.image_url&&(0,p.jsxs)(y.a,{position:"relative",borderRadius:"xl",overflow:"hidden",children:[(0,p.jsx)(k._,{src:W(x.image_url)||x.image_url,alt:x.title,w:"100%",h:{base:"220px",md:"360px"},objectFit:"cover"}),(0,p.jsx)(y.a,{position:"absolute",inset:0,bg:"brand.primary",opacity:.08,pointerEvents:"none"}),(0,p.jsx)(y.a,{position:"absolute",inset:0,bgGradient:"linear(to-b, rgba(0,0,0,0.12), rgba(0,0,0,0.02))",pointerEvents:"none"})]}),(null===x||void 0===x?void 0:x.youtube_video_id)&&(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:{base:3,md:4},bg:_,children:[(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,children:"\ud83c\udfac Video k \u010dl\xe1nku"}),(0,p.jsx)(y.a,{maxW:"3xl",mx:"auto",borderRadius:"lg",overflow:"hidden",children:(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsx)(y.a,{as:"iframe",src:"https://www.youtube-nocookie.com/embed/".concat(x.youtube_video_id),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,title:x.youtube_video_title||"YouTube video",onLoad:()=>It("Video Widget Shown",{id:x.youtube_video_id,title:x.youtube_video_title}),onClick:()=>{return e=x.youtube_video_id,t=x.youtube_video_title,void It("Video Play",{id:e,title:t});var e,t}})})}),x.youtube_video_title?(0,p.jsx)(U.E,{mt:2,color:C,children:x.youtube_video_title}):null]}),(null===(r=M.data)||void 0===r?void 0:r.external_match_id)&&(0,p.jsxs)(y.a,{position:"relative",borderWidth:"1px",borderRadius:"lg",p:{base:4,md:5},bg:f,overflow:"hidden",children:[(0,p.jsx)(y.a,{position:"absolute",top:0,left:0,bottom:0,w:{base:"6px",md:"12px"},bgGradient:"linear(to-r, var(--club-primary, #0b5cff), transparent)",pointerEvents:"none"}),R&&(0,p.jsx)(y.a,{position:"absolute",top:0,right:0,bottom:0,w:{base:"6px",md:"12px"},bgGradient:"linear(to-l, ".concat(R,", transparent)"),pointerEvents:"none"}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:3,children:"Z\xe1pas k \u010dl\xe1nku"}),D.isLoading?(0,p.jsx)(U.E,{color:S,children:"Na\u010d\xedt\xe1m \xfadaje o z\xe1pasu\u2026"}):D.data?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(ee.z,{spacing:2,wrap:"wrap",mb:3,children:[D.data.competitionName&&(0,p.jsx)(Qt.E,{colorScheme:"blue",children:String(D.data.competitionName)}),(0,p.jsx)(Qt.E,{children:String(D.data.date_time||D.data.date||"")})]}),(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",gap:4,children:[(0,p.jsxs)(w.T,{flex:1,spacing:2,minW:"0",children:[(0,p.jsx)(Ma,{size:"custom",style:{width:64,height:64},teamId:String(D.data.home_team_id||D.data.home_id||""),teamName:String(D.data.home||D.data.home_team||"")}),(0,p.jsx)(U.E,{fontWeight:"600",noOfLines:2,textAlign:"center",children:String(D.data.home||D.data.home_team||"")})]}),(0,p.jsxs)(w.T,{minW:{base:"100px",md:"140px"},children:[(()=>{const e=String(D.data.date_time||D.data.date||""),t=new Date(e);if(null!=D.data.result_home&&null!=D.data.result_away||Boolean(D.data.score&&"vs"!==D.data.score)){const e=String(D.data.score||"".concat(D.data.result_home,":").concat(D.data.result_away));return(0,p.jsx)(z.D,{size:"2xl",children:e})}const n=Date.now(),a=t.getTime()-n,i=Math.max(0,Math.floor(a/864e5)),o=Math.max(0,Math.floor(a%864e5/36e5)),r=Math.max(0,Math.floor(a%36e5/6e4));return(0,p.jsxs)(U.E,{fontSize:"lg",fontWeight:"700",children:["Za ",i," d ",o," h ",r," min"]})})(),D.data.venue&&(0,p.jsx)(U.E,{fontSize:"sm",color:S,children:String(D.data.venue)}),(()=>{const e=String(D.data.date_time||D.data.date||""),t=new Date(e);return(0,p.jsxs)(U.E,{fontSize:"sm",color:S,children:[t.toLocaleDateString("cs-CZ")," ",t.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"})]})})()]}),(0,p.jsxs)(w.T,{flex:1,spacing:2,minW:"0",children:[(0,p.jsx)(Ma,{size:"custom",style:{width:64,height:64},teamId:String(D.data.away_team_id||D.data.away_id||""),teamName:String(D.data.away||D.data.away_team||"")}),(0,p.jsx)(U.E,{fontWeight:"600",noOfLines:2,textAlign:"center",children:String(D.data.away||D.data.away_team||"")})]})]}),D.data.report_url&&(0,p.jsx)(y.a,{mt:3,children:(0,p.jsx)(L.N,{href:String(D.data.report_url),isExternal:!0,color:"blue.600",children:"Protokol z\xe1pasu (fotbal.cz)"})})]}):(0,p.jsxs)(U.E,{color:S,children:["Propojeno s FACR ID: ",null===(s=M.data)||void 0===s?void 0:s.external_match_id]})]}),(0,p.jsx)(y.a,{className:"article-content",bg:(0,b.dU)("white","gray.900"),borderRadius:"lg",p:{base:4,md:6},ref:I,sx:{"ul, ol":{pl:6,listStylePosition:"outside"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},li:{mb:2}},dangerouslySetInnerHTML:{__html:K}}),((null===x||void 0===x?void 0:x.gallery_album_id)||(null===x||void 0===x?void 0:x.gallery_album_url))&&(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"lg",p:{base:3,md:4},bg:A,borderColor:E,children:(0,p.jsxs)(y.a,{mb:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",mb:2,children:[(0,p.jsx)(z.D,{as:"h3",size:"md",children:"Fotogalerie k \u010dl\xe1nku"}),(0,p.jsx)(T.$,{as:d.N_,to:x.gallery_album_id?"/galerie/album/".concat(x.gallery_album_id):"#",size:"sm",colorScheme:"blue",variant:"outline",rightIcon:(0,p.jsx)(Zn.A,{size:16}),onClick:()=>It("Gallery Link Click",{album_id:x.gallery_album_id}),children:"Zobrazit galerii"})]}),F.data.photos&&F.data.photos.length>0&&(()=>{const e=F.data.photos.slice(0,5);return e.length<5?(0,p.jsx)(Tt.r,{columns:{base:2,sm:3},spacing:2,children:e.map(e=>(0,p.jsx)(k._,{src:e.image_1500,alt:String(e.id),w:"100%",h:"140px",objectFit:"cover",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"}},e.id))}):(0,p.jsxs)(y.a,{position:"relative",sx:{display:"grid",gridTemplateColumns:"1fr 1.2fr 1fr",gridTemplateRows:"repeat(2, 140px)",gap:"8px"},children:[(0,p.jsx)(k._,{src:e[0].image_1500,alt:String(e[0].id),sx:{gridColumn:1,gridRow:1},objectFit:"cover",w:"100%",h:"100%",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"},borderRadius:"md"}),(0,p.jsx)(k._,{src:e[1].image_1500,alt:String(e[1].id),sx:{gridColumn:1,gridRow:2},objectFit:"cover",w:"100%",h:"100%",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"},borderRadius:"md"}),(0,p.jsx)(k._,{src:e[2].image_1500,alt:String(e[2].id),sx:{gridColumn:2,gridRow:"1 / span 2"},objectFit:"cover",w:"100%",h:"100%",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"},borderRadius:"md"}),(0,p.jsx)(k._,{src:e[3].image_1500,alt:String(e[3].id),sx:{gridColumn:3,gridRow:1},objectFit:"cover",w:"100%",h:"100%",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"},borderRadius:"md"}),(0,p.jsx)(k._,{src:e[4].image_1500,alt:String(e[4].id),sx:{gridColumn:3,gridRow:2},objectFit:"cover",w:"100%",h:"100%",filter:"grayscale(100%)",_hover:{filter:"grayscale(0%)"},borderRadius:"md"}),(0,p.jsx)(T.$,{as:d.N_,to:x.gallery_album_id?"/galerie/album/".concat(x.gallery_album_id):"#",size:"sm",colorScheme:"blue",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",onClick:()=>It("Gallery Link Click",{album_id:x.gallery_album_id}),children:"Zobrazit galerii"})]})})(),(0,p.jsxs)(ee.z,{mt:3,spacing:1,fontSize:"xs",color:"blue.700",children:[(0,p.jsx)(U.E,{children:"\ud83d\udcf8 Fotografie z"}),(0,p.jsxs)(L.N,{href:x.gallery_album_url||"https://zonerama.com",isExternal:!0,fontWeight:"600",color:"blue.600",display:"inline-flex",alignItems:"center",gap:1,children:["Zonerama",(0,p.jsx)(ri.A,{size:12})]})]})]})}),(null===x||void 0===x?void 0:x.id)&&(0,p.jsx)(oi,{articleId:x.id,maxPolls:3})]})})]}),Array.isArray(null===x||void 0===x?void 0:x.attachments)&&x.attachments.length>0&&(0,p.jsx)(Z.m,{maxW:"7xl",mt:4,children:(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:{base:3,md:4},bg:N,children:[(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,children:"P\u0159\xedlohy"}),(0,p.jsx)(At.B,{spacing:2,children:x.attachments.map((e,t)=>(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{noOfLines:1,children:e.name||e.url}),(0,p.jsx)(si,{url:W(e.url)||e.url,name:e.name||"",mimeType:e.mime_type||"",size:e.size})]},t))})]})}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})};let ci=null;const di={positron:{name:"Positron (Light)",url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Clean light map, perfect for overlays"},"positron-no-labels":{name:"Positron No Labels",url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Minimal light map without labels"},dark:{name:"Dark Matter",url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Dark theme, great for night mode"},"dark-no-labels":{name:"Dark No Labels",url:"https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Dark map without labels"},toner:{name:"Toner (B&W)",url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}{r}.png",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"High contrast black and white"},"toner-lite":{name:"Toner Lite (B&W)",url:"https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.png",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Subtle black and white"},voyager:{name:"Voyager",url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Balanced colors, good readability"},terrain:{name:"Terrain",url:"https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.jpg",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Natural terrain visualization"},watercolor:{name:"Watercolor",url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Artistic watercolor style"},default:{name:"OpenStreetMap",url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors",description:"Standard OpenStreetMap"},satellite:{name:"Satellite",url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"\xa9 Esri",description:"Satellite imagery"}},hi=e=>{let{latitude:t,longitude:n,zoom:i=15,address:o,clubName:r,mapStyle:s="default",height:l=400,clubPrimaryColor:c,clubSecondaryColor:d}=e;const h=(0,a.useRef)(null),u=(0,a.useRef)(null),[m,x]=a.useState(!1),[g,v]=a.useState(null);return(0,a.useEffect)(()=>{(async()=>{try{if(window.L)return ci=window.L,void x(!0);if(!document.getElementById("leaflet-css")){const e=document.createElement("link");e.id="leaflet-css",e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e)}if(!document.getElementById("leaflet-js")){const e=document.createElement("script");e.id="leaflet-js",e.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",e.integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=",e.crossOrigin="",e.onload=()=>{ci=window.L,x(!0)},e.onerror=()=>{v("Failed to load map library")},document.head.appendChild(e)}}catch(e){v("Error loading map")}})()},[]),(0,a.useEffect)(()=>{if(m&&ci&&h.current&&!u.current){try{const e=ci.map(h.current,{center:[t,n],zoom:i,scrollWheelZoom:!1});u.current=e;let a="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",l='\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';if(s&&di[s]){const e=di[s];a=e.url,l=e.attribution}else s&&s.startsWith("http")&&(a=s);ci.tileLayer(a,{attribution:l,maxZoom:19}).addTo(e);if(c&&""!==c){const t=function(e){try{const t=document.createElement("div");t.style.color=e,document.body.appendChild(t);const n=window.getComputedStyle(t).color;return document.body.removeChild(t),n}catch(t){return null}}(c);if(t){const n=e.createPane("colorOverlay");n.style.zIndex="400",n.style.pointerEvents="none",n.style.mixBlendMode="multiply",n.style.backgroundColor=t,n.style.opacity="0.15"}}const d=function(e,t){const n='\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 36" width="36" height="54">\n <defs>\n <filter id="shadow" x="-50%" y="-50%" width="200%" height="200%">\n <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>\n <feOffset dx="0" dy="2" result="offsetblur"/>\n <feComponentTransfer>\n <feFuncA type="linear" slope="0.3"/>\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n <path fill="'.concat(e,'" stroke="#fff" stroke-width="1.5" filter="url(#shadow)"\n d="M12 0C7.03 0 3 4.03 3 9c0 7.5 9 18 9 18s9-10.5 9-18c0-4.97-4.03-9-9-9z"/>\n <circle cx="12" cy="9" r="3" fill="#fff"/>\n </svg>\n '),a="data:image/svg+xml;base64,"+btoa(n);return t.icon({iconUrl:a,iconSize:[36,54],iconAnchor:[18,54],popupAnchor:[0,-54]})}(c||"#3388ff",ci),m=ci.marker([t,n],{icon:d}).addTo(e);if(r||o){let e="";r&&(e+="<b>".concat(r,"</b><br>")),o&&(e+=o),m.bindPopup(e)}e.on("click",()=>{e.scrollWheelZoom.enable()}),e.on("mouseout",()=>{e.scrollWheelZoom.disable()})}catch(e){console.error("Error initializing map:",e),v("Failed to initialize map")}return()=>{u.current&&(u.current.remove(),u.current=null)}}},[m,t,n,i,o,r,s,c,d]),g?(0,p.jsx)(y.a,{ref:h,w:"100%",h:"".concat(l,"px"),bg:"gray.100",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",children:g}):(0,p.jsx)(y.a,{ref:h,w:"100%",h:"".concat(l,"px"),borderRadius:"md",overflow:"hidden",boxShadow:"md"})},ui={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_NOMINATIM_URL||"https://nominatim.openstreetmap.org",mi={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_NOMINATIM_EMAIL,pi=new Map;const xi=()=>(0,p.jsxs)(y.a,{display:"flex",alignItems:"center",gap:2,color:"gray.500",children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m mapu\u2026"})]}),gi=e=>{let{location:t,title:n,latitude:i,longitude:o}=e;const[r,s]=a.useState(!1),[l,c]=a.useState(null),[d,h]=a.useState(null),[u,m]=a.useState(null);if(a.useEffect(()=>{R().then(m).catch(()=>{})},[]),a.useEffect(()=>{const e=(t||"").trim();if(!e)return h(null),void c(null);if(null!=i&&null!=o&&Number.isFinite(i)&&Number.isFinite(o))return h({lat:i,lon:o,displayName:e}),s(!1),void c(null);let n=!0;const a=new AbortController;return s(!0),c(null),async function(e,t){const n=e.trim().toLowerCase();if(pi.has(n))return pi.get(n);const a=new URLSearchParams({format:"jsonv2",limit:"1",q:e,"accept-language":"cs"});mi&&a.append("email",mi);const i="".concat(ui,"/search?").concat(a.toString()),o=await fetch(i,{headers:{Accept:"application/json"},signal:t});if(!o.ok)throw new Error("Nepoda\u0159ilo se na\u010d\xedst mapov\xe1 data.");const r=await o.json();if(!Array.isArray(r)||0===r.length)throw new Error("Poloha nebyla nalezena.");const s=r[0],l=Number(s.lat),c=Number(s.lon);if(!Number.isFinite(l)||!Number.isFinite(c))throw new Error("Neplatn\xe9 sou\u0159adnice.");const d={lat:l,lon:c,displayName:String(s.display_name||e)};return pi.set(n,d),d}(e,a.signal).then(e=>{n&&h(e)}).catch(e=>{n&&(h(null),c((null===e||void 0===e?void 0:e.message)||"Mapu se nepoda\u0159ilo na\u010d\xedst."))}).finally(()=>{n&&s(!1)}),()=>{n=!1,a.abort()}},[t,i,o]),null===t||void 0===t||!t.trim())return null;const x=encodeURIComponent(t.trim()),g=d?"https://www.openstreetmap.org/?mlat=".concat(d.lat,"&mlon=").concat(d.lon,"#map=17/").concat(d.lat,"/").concat(d.lon):"https://www.openstreetmap.org/search?query=".concat(x),v=d?"https://www.google.com/maps/search/?api=1&query=".concat(d.lat,",").concat(d.lon):"https://www.google.com/maps/search/?api=1&query=".concat(x),j=d?"https://mapy.cz/zakladni?x=".concat(d.lon,"&y=").concat(d.lat,"&z=17"):"https://mapy.cz/zakladni?q=".concat(x);return(0,p.jsxs)(w.T,{align:"stretch",spacing:3,mt:4,"data-testid":"event-location-map",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"lg",children:"Mapa m\xedsta"}),r&&(0,p.jsx)(xi,{}),!r&&l&&(0,p.jsxs)(xa.F,{status:"error",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{mb:1,children:l}),(0,p.jsxs)(U.E,{children:[(0,p.jsx)(L.N,{href:g,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v OpenStreetMap"})," \xb7 ",(0,p.jsx)(L.N,{href:v,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v Google Maps"})," \xb7 ",(0,p.jsx)(L.N,{href:j,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v Mapy.cz"})]})]})]}),!r&&!l&&d&&(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",borderColor:"border.subtle",children:(0,p.jsx)(hi,{latitude:d.lat,longitude:d.lon,zoom:15,address:d.displayName,clubName:n,height:320,mapStyle:(null===u||void 0===u?void 0:u.map_style)||"default",clubPrimaryColor:null===u||void 0===u?void 0:u.primary_color,clubSecondaryColor:null===u||void 0===u?void 0:u.accent_color})}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["P\u0159esnost ur\u010dena pomoc\xed otev\u0159en\xfdch mapov\xfdch dat. Zobrazit v"," ",(0,p.jsx)(L.N,{href:g,isExternal:!0,color:"blue.400",children:"OpenStreetMap"})," \xb7 ",(0,p.jsx)(L.N,{href:v,isExternal:!0,color:"blue.400",children:"Google Maps"})," \xb7 ",(0,p.jsx)(L.N,{href:j,isExternal:!0,color:"blue.400",children:"Mapy.cz"})]})]})},vi=()=>{const{id:e}=(0,c.g)(),[t,n]=a.useState(!0),[i,o]=a.useState(null),[r,s]=a.useState(null);a.useEffect(()=>{let t=!0;return(async()=>{try{if(!e)return;const n=await(async e=>(await m.FH.get("/events/".concat(e))).data)(e);t&&s(n)}catch(a){t&&o((null===a||void 0===a?void 0:a.message)||"Nelze na\u010d\xedst aktivitu")}finally{t&&n(!1)}})(),()=>{t=!1}},[e]);const l=a.useRef(null);a.useEffect(()=>{const e=l.current;if(!e)return;const t=e=>{const t=e.target;if(!t)return;const n=t.closest?t.closest("a"):null;if(n&&n.href){const e=n.getAttribute("href")||n.href;try{It("Link Click",{href:e,page:window.location.pathname,context:"activity_content"})}catch(a){}}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[l.current]);const h=e=>{if(!e)return null;if(e.includes("youtube.com/embed/"))return e;let t=null;const n=e.match(/[?&]v=([^&#]+)/);n&&(t=n[1]);const a=e.match(/youtu\.be\/([^?&#]+)/);a&&(t=a[1]);const i=e.match(/youtube\.com\/embed\/([^?&#]+)/);return i&&(t=i[1]),t?"https://www.youtube.com/embed/".concat(t):null},u=(0,b.dU)("white","gray.800"),x=(0,b.dU)("gray.200","gray.700"),g=(0,b.dU)("gray.600","gray.300"),v=(0,b.dU)("blue.600","blue.300"),j=(0,b.dU)("blue.700","blue.200");return(0,p.jsx)(Ht,{children:(0,p.jsx)(y.a,{py:10,bg:"transparent",children:(0,p.jsxs)(Z.m,{maxW:"3xl",children:[t&&(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})]}),!t&&i&&(0,p.jsx)(U.E,{color:"red.500",children:i}),!t&&!i&&r&&(0,p.jsxs)(w.T,{align:"stretch",spacing:5,children:[r.image_url&&(0,p.jsx)(y.a,{borderRadius:"xl",overflow:"hidden",borderWidth:"1px",children:(0,p.jsx)(k._,{src:W(r.image_url)||r.image_url,alt:r.title,w:"100%",maxH:"420px",objectFit:"cover",fallbackSrc:"/dist/img/logo-club-empty.svg"})}),(0,p.jsxs)(w.T,{align:"stretch",spacing:1,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",children:[(0,p.jsx)(z.D,{as:"h1",size:"lg",lineHeight:1.2,children:r.title}),(0,p.jsx)(Qt.E,{colorScheme:(f=r.type,"match"===f?"red":"training"===f?"blue":"meeting"===f?"green":"gray"),children:(e=>"match"===e?"Z\xe1pas":"training"===e?"Tr\xe9nink":"meeting"===e?"Sch\u016fzka":"Jin\xe9")(r.type)})]}),(0,p.jsxs)(ee.z,{spacing:4,color:g,fontSize:"sm",children:[r.location&&(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(jn.I,{as:q.HzC}),(0,p.jsx)(U.E,{children:r.location})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(jn.I,{as:q.Ohp}),(0,p.jsxs)(U.E,{children:[new Date(r.start_time).toLocaleString()," ",r.end_time?"\u2013 ".concat(new Date(r.end_time).toLocaleString()):""]})]})]})]}),r.description&&(0,p.jsx)(y.a,{bg:u,borderWidth:"1px",borderColor:x,borderRadius:"lg",p:5,className:"blog-content",sx:{" h1, h2, h3, h4":{fontWeight:"bold",mt:3}," p":{lineHeight:1.8,mb:3}," ul, ol":{pl:6,mb:3}," a":{color:v,textDecoration:"underline",_hover:{color:j}}," img":{maxWidth:"100%",borderRadius:"md"}},ref:l,dangerouslySetInnerHTML:{__html:ai.A.sanitize(String(r.description))}}),r.youtube_url&&h(r.youtube_url)&&(0,p.jsx)(y.a,{borderRadius:"lg",overflow:"hidden",boxShadow:"md",children:(0,p.jsx)(y.a,{position:"relative",paddingBottom:"56.25%",height:0,children:(0,p.jsx)("iframe",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},src:h(r.youtube_url)||"",title:r.title,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}),r.location&&(0,p.jsx)(gi,{location:r.location,title:r.title,latitude:r.latitude,longitude:r.longitude}),(null===r||void 0===r?void 0:r.id)&&(0,p.jsx)(oi,{eventId:r.id,maxPolls:2}),Array.isArray(r.attachments)&&r.attachments.length>0&&(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",children:"P\u0159\xedlohy"}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:r.attachments.map((e,t)=>{var n;return(0,p.jsx)(si,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size,showInline:null===(n=e.mime_type)||void 0===n?void 0:n.startsWith("image/")},t)})})]}),r.file_url&&(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{as:L.N,href:W(r.file_url)||r.file_url,isExternal:!0,variant:"outline",leftIcon:(0,p.jsx)(q.a4x,{}),children:"St\xe1hnout p\u0159\xedlohu"})}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{as:d.N_,to:"/aktivity",variant:"outline",children:"Zp\u011bt na aktivity"}),(0,p.jsx)(T.$,{as:d.N_,to:"/",variant:"ghost",children:"Dom\u016f"})]})]})]})})});var f};var ji=n(9027),bi=n(6806),yi=n(2332);const fi=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},ki=()=>{const{id:e}=(0,c.g)(),t=(0,j.d)(),{data:n}=ge(),[i,o]=(0,a.useState)(!0),[r,s]=(0,a.useState)(null),[l,h]=(0,a.useState)(""),[u,m]=(0,a.useState)(""),[x,g]=(0,a.useState)(""),[v,b]=(0,a.useState)(null),[f,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{let a=!1;return(async()=>{if(e){o(!0);try{const t=await fetch(fi("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});let i=null,o=[];if(t.ok){const n=await t.json();for(const t of(null===n||void 0===n?void 0:n.competitions)||[]){const n=[];for(const a of(null===t||void 0===t?void 0:t.matches)||[]){const o=String(a.match_id||"");if(o&&o===String(e)){const e=String(a.date_time||""),[n,r]=e.includes(" ")?e.split(" "):[e,""],[s,l,c]=n.split("."),d=s&&l&&c?"".concat(c,"-").concat(l.padStart(2,"0"),"-").concat(s.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(r||"00:00").slice(0,5),p=(a.score||a.result||("number"===typeof a.goals_home&&"number"===typeof a.goals_away?"".concat(a.goals_home,":").concat(a.goals_away):"")||"").toString();i={id:o,date:d,time:u,home:a.home,away:a.away,venue:a.venue,home_logo_url:a.home_logo_url,away_logo_url:a.away_logo_url,report_url:a.report_url,facr_link:a.facr_link,score:p&&/\d+\s*:\s*\d+/.test(p)?p.replace(/\s+/g,""):void 0},h(String((null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.code)||"")),null!=(null===t||void 0===t?void 0:t.id)&&m(String(t.id)),null!==t&&void 0!==t&&t.code&&g(String(t.code));break}const r=String(a.date_time||""),[s,l]=r.includes(" ")?r.split(" "):[r,""],[c,d,u]=s.split("."),p=c&&d&&u?"".concat(u,"-").concat(d.padStart(2,"0"),"-").concat(c.padStart(2,"0")):(new Date).toISOString().slice(0,10),x=(l||"00:00").slice(0,5);n.push({id:a.match_id||"",date:p,time:x,home:a.home,away:a.away})}if(i)break;o=n}}if(!i&&null!==n&&void 0!==n&&n.club_id){const t=n.club_type||"football",a="/cache/facr/".concat(t,"_").concat(n.club_id,"_info.json"),r=await fetch(fi(a),{cache:"no-cache"});if(r.ok){const t=await r.json();for(const n of(null===t||void 0===t?void 0:t.competitions)||[]){const t=[];for(const a of(null===n||void 0===n?void 0:n.matches)||[]){const o=String(a.match_id||"");if(o&&o===String(e)){const e=String(a.date_time||""),[t,r]=e.includes(" ")?e.split(" "):[e,""],[s,l,c]=t.split("."),d=s&&l&&c?"".concat(c,"-").concat(l.padStart(2,"0"),"-").concat(s.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(r||"00:00").slice(0,5),p=(a.score||a.result||("number"===typeof a.goals_home&&"number"===typeof a.goals_away?"".concat(a.goals_home,":").concat(a.goals_away):"")||"").toString();i={id:o,date:d,time:u,home:a.home,away:a.away,venue:a.venue,home_logo_url:a.home_logo_url,away_logo_url:a.away_logo_url,report_url:a.report_url,facr_link:a.facr_link,score:p&&/\d+\s*:\s*\d+/.test(p)?p.replace(/\s+/g,""):void 0},h(String((null===n||void 0===n?void 0:n.name)||(null===n||void 0===n?void 0:n.code)||"")),null!=(null===n||void 0===n?void 0:n.id)&&m(String(n.id)),null!==n&&void 0!==n&&n.code&&g(String(n.code));break}const r=String(a.date_time||""),[s,l]=r.includes(" ")?r.split(" "):[r,""],[c,d,u]=s.split("."),p=c&&d&&u?"".concat(u,"-").concat(d.padStart(2,"0"),"-").concat(c.padStart(2,"0")):(new Date).toISOString().slice(0,10),x=(l||"00:00").slice(0,5);t.push({id:a.match_id||"",date:p,time:x,home:a.home,away:a.away})}if(i)break;o=t}}}if(i&&o.length){const e=o.sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime()),t=e.findIndex(e=>String(e.id)===String(i.id));b(t>0?e[t-1]:null),w(t>=0&&t<e.length-1?e[t+1]:null)}else b(null),w(null);a||s(i)}catch(i){a||t({title:"Chyba",description:(null===i||void 0===i?void 0:i.message)||"Nelze na\u010d\xedst z\xe1pas",status:"error"})}finally{a||o(!1)}}})(),()=>{a=!0}},[e,n,t]);const _=(0,a.useMemo)(()=>!!r&&new Date("".concat(r.date,"T").concat(r.time||"00:00",":00")).getTime()<Date.now(),[r]),{data:S}=(0,xe.I)({queryKey:["public-competition-aliases"],queryFn:$n}),C=(0,a.useMemo)(()=>{if(!x)return l;const e=(S||[]).find(e=>e.code===x);return(null===e||void 0===e?void 0:e.alias)||l},[S,x,l]);return(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(Z.m,{maxW:"3xl",py:{base:6,md:10},children:[(0,p.jsxs)(ji.Q,{fontSize:"sm",mb:4,separator:"/",children:[(0,p.jsx)(bi.J,{children:(0,p.jsx)(yi.w,{as:d.N_,to:"/",children:"Dom\u016f"})}),(0,p.jsx)(bi.J,{children:(0,p.jsx)(yi.w,{as:d.N_,to:u?"/kalendar?comp=".concat(u):"/kalendar",children:"Kalend\xe1\u0159"})}),C&&(0,p.jsx)(bi.J,{children:(0,p.jsx)(yi.w,{as:d.N_,to:u?"/kalendar?comp=".concat(u):"/kalendar",children:C})}),r&&(0,p.jsx)(bi.J,{isCurrentPage:!0,children:(0,p.jsxs)(yi.w,{children:[r.home," vs ",r.away]})})]}),(0,p.jsx)(y.a,{mb:4,children:(0,p.jsx)(T.$,{as:d.N_,to:u?"/kalendar?comp=".concat(u):"/kalendar",size:"sm",variant:"outline",children:"Zp\u011bt na kalend\xe1\u0159"})}),i&&(0,p.jsxs)(Q.s,{align:"center",gap:3,color:"gray.600",children:[(0,p.jsx)(zn.y,{size:"sm"})," Na\u010d\xedt\xe1m\u2026"]}),!i&&!r&&(0,p.jsx)(y.a,{color:"gray.600",children:"Z\xe1pas nebyl nalezen."}),r&&(0,p.jsxs)(At.B,{spacing:5,children:[(0,p.jsxs)(z.D,{size:"lg",children:[r.home," vs ",r.away]}),(0,p.jsxs)(Q.s,{align:"center",justify:"center",gap:4,children:[r.home_logo_url&&(0,p.jsx)(k._,{src:r.home_logo_url,alt:r.home,boxSize:"56px",borderRadius:"full"}),(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:_&&r.score?r.score:"vs"}),r.away_logo_url&&(0,p.jsx)(k._,{src:r.away_logo_url,alt:r.away,boxSize:"56px",borderRadius:"full"})]}),(0,p.jsxs)(U.E,{textAlign:"center",color:"gray.700",children:[r.date," ",r.time," ",r.venue?"\u2022 ".concat(r.venue):""]}),(v||f)&&(0,p.jsxs)(Q.s,{justify:"space-between",mt:2,children:[(0,p.jsx)(y.a,{children:v&&(0,p.jsxs)(T.$,{as:d.N_,to:"/zapas/".concat(v.id),size:"sm",variant:"ghost",children:["\u2190 ",v.home," vs ",v.away]})}),(0,p.jsx)(y.a,{children:f&&(0,p.jsxs)(T.$,{as:d.N_,to:"/zapas/".concat(f.id),size:"sm",variant:"ghost",children:[f.home," vs ",f.away," \u2192"]})})]}),(r.facr_link||r.report_url)&&(0,p.jsxs)(Q.s,{justify:"center",gap:3,children:[r.facr_link&&(0,p.jsx)(T.$,{colorScheme:"red",variant:"outline",onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=r.facr_link||"",t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"FA\u010cR detail"}),r.report_url&&(0,p.jsx)(T.$,{variant:"outline",onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=r.report_url||"",t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"Z\xe1pis"})]})]})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})},zi=()=>{const{data:e}=ge();return(0,p.jsxs)(Ht,{children:[(0,p.jsx)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:(0,p.jsxs)(At.B,{spacing:8,children:[(0,p.jsxs)(At.B,{direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},spacing:6,children:[(null===e||void 0===e?void 0:e.club_logo_url)&&(0,p.jsx)(k._,{src:W(e.club_logo_url),alt:(null===e||void 0===e?void 0:e.club_name)||"Logo",boxSize:{base:"64px",md:"80px"},objectFit:"contain"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",children:(null===e||void 0===e?void 0:e.club_name)||"O klubu"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Ofici\xe1ln\xed informace o klubu"})]})]}),null!==e&&void 0!==e&&e.about_html?(0,p.jsx)(y.a,{children:(0,p.jsx)(y.a,{className:"prose",color:"gray.800",dangerouslySetInnerHTML:{__html:e.about_html}})}):(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mb:3,children:"Zna\u010dka a identita"}),(0,p.jsx)(U.E,{color:"gray.700",children:"Zde m\u016f\u017ee b\xfdt popis historie, vize a hodnot klubu. Dopln\xedme dle pot\u0159eby v dal\u0161\xed iteraci."})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mb:3,children:"Stadion"}),(0,p.jsx)(U.E,{color:"gray.700",children:"Informace o stadionu, adresa, kapacita a fotografie (voliteln\xe9)."})]})]})}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})};var wi=n(3533),_i=n(6351),Si=n(4912),Ci=n(1620),Ai=n(2885),Ei=n(9023),Ti=n(5757),Ni=n(6465),Ri=n(6175);function Pi(e){if(!e)return 9999;if(function(e){if(!e)return!1;const t=e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");return/\b(muzi|mu\u017e|muze|dospeli|dosp\u011bl\xed|a[\s-]?team|a[\s-]?tym|senior)\b/i.test(t)}(e))return 0;const t=function(e){if(!e)return null;const t=e.match(/\bU(\d+)\b/i);return t?parseInt(t[1],10):null}(e);return null!==t?1e3-t:2e3}function Ii(e,t){const n=e.alias||e.name||"",a=t.alias||t.name||"",i=Pi(n),o=Pi(a);return i!==o?i-o:n.localeCompare(a,"cs")}function Wi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display_order";return[...e].sort((e,n)=>{const a=e[t],i=n[t];return"number"===typeof a&&"number"===typeof i&&a!==i?a-i:"number"===typeof a?-1:"number"===typeof i?1:Ii(e,n)})}const Mi=["Po","\xdat","St","\u010ct","P\xe1","So","Ne"],Di=()=>{var e;const[t,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)([]),[r,s]=(0,a.useState)(null),[l,c]=(0,a.useState)({}),[u,x]=(0,a.useState)({}),[g,v]=(0,a.useState)(0),[f]=(0,d.ok)(),w=(0,j.d)(),[_,S]=(0,a.useState)(""),[A,E]=(0,a.useState)(""),[N,R]=(0,a.useState)("football"),[P,I]=(0,a.useState)([]),M=(0,b.dU)("white","gray.800"),D=(0,b.dU)("gray.200","gray.700"),F=(0,b.dU)("gray.50","gray.700"),O=(0,b.dU)("blue.50","blue.900"),q=(0,b.dU)("white","gray.800"),V=(0,b.dU)("gray.200","gray.700"),H=(0,b.dU)("gray.50","gray.700"),$=(0,b.dU)("blue.50","blue.900"),G=(0,b.dU)("gray.300","gray.600"),ee=(0,b.dU)("gray.800","gray.100"),te=(0,b.dU)("gray.50","gray.700"),ne=(0,b.dU)("gray.200","gray.600"),ae=(0,b.dU)("blue.50","blue.900"),ie=(0,b.dU)("gray.800","gray.100"),oe=(0,b.dU)("gray.600","gray.400"),re=(0,b.dU)("gray.700","gray.300"),{isOpen:ce,onOpen:de,onClose:he}=(0,X.j)(),[ue,me]=(0,a.useState)(null),[pe,xe]=(0,a.useState)(""),[ge,ve]=(0,a.useState)(!1),[je,be]=(0,a.useState)(!1),[ye,fe]=(0,a.useState)(null),ke=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},ze=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),we=e=>{let t=ze(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},_e=(e,t)=>{try{const n=ze(e);let a=null;for(const e of P){const t=e.table||e.rows||[];for(const e of t){const t=ze(e.team_name||e.team||"");if(t===n||t.includes(n)||n.includes(t)){a=e;break}}if(a)break}if(a){const n={team:a.team_name||a.team||e,team_id:a.team_id||String(a.position||0),team_logo_url:a.logo_url?W(a.logo_url)||a.logo_url:t,rank:a.position||a.rank||a.pos,played:a.played||a.matches,wins:a.wins||a.win,draws:a.draws||a.draw,losses:a.losses||a.loss,score:a.score||((a.goals_for||a.gf)&&(a.goals_against||a.ga)?"".concat(a.goals_for||a.gf,":").concat(a.goals_against||a.ga):void 0),points:a.points||a.pts};fe(n),be(!0)}else{fe({team:e,team_id:e,team_logo_url:t,rank:"-",played:"-",wins:"-",draws:"-",losses:"-",score:"-",points:"-"}),be(!0)}}catch(n){}};(0,a.useEffect)(()=>{let e=!1;return(async()=>{n(!0),s(null);try{var t,a;let n={};try{(await $n()||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(n[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})})}catch(r){}const s=Date.now();let p=null;try{const e=await fetch(ke("/api/v1/public/team-logo-overrides?t=".concat(s)),{cache:"no-cache"});e.ok&&(p=await e.json())}catch(l){}if(!p)try{const e=await fetch(ke("/cache/prefetch/team_logo_overrides.json"),{cache:"no-cache"});e.ok&&(p=await e.json())}catch(d){}const g=(null===(t=p)||void 0===t?void 0:t.by_name)||{},j=(null===(a=p)||void 0===a?void 0:a.by_id)||{},b=Object.keys(g||{}).reduce((e,t)=>(e[ze(t)]=g[t],e),{}),y=Object.keys(g||{}).map(e=>({keyNorm:we(e),url:g[e]})),k=(e,t,n)=>{var a;if(n&&null!==j&&void 0!==j&&null!==(a=j[n])&&void 0!==a&&a.logo_url){const e=j[n].logo_url;return"string"===typeof e&&e.startsWith("/")?ke(e):e}if(!e)return t;const i=(g||{})[e],o=ze(e);let r=i||b[o];if(!r){const t=we(e);for(const{keyNorm:e,url:n}of y)if(e&&(t.endsWith(e)||e.endsWith(t))){r=n;break}}const s=r||t;return"string"===typeof s&&s.startsWith("/")?ke(s):s},z=await fetch(ke("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(!z.ok)throw new Error("HTTP ".concat(z.status));const w=await z.json(),_={},C=Array.isArray(null===w||void 0===w?void 0:w.competitions)?w.competitions.map((e,t)=>{var a,i;const o=String(e.id||t);e.matches_link&&(_[o]=String(e.matches_link));const r=(Array.isArray(e.matches)?e.matches:[]).map((e,n)=>{var a,i;const o=String(e.date_time||""),[r,s]=o.includes(" ")?o.split(" "):[o,""],[l,c,d]=r.split("."),h=l&&c&&d?"".concat(d,"-").concat(c.padStart(2,"0"),"-").concat(l.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(s||"00:00").slice(0,5),m=(e.score||e.result||("number"===typeof e.goals_home&&"number"===typeof e.goals_away?"".concat(e.goals_home,":").concat(e.goals_away):"")||"").toString(),p=null!==j&&void 0!==j&&null!==(a=j[e.home_id])&&void 0!==a&&a.name&&String(j[e.home_id].name).trim()?String(j[e.home_id].name):e.home,x=null!==j&&void 0!==j&&null!==(i=j[e.away_id])&&void 0!==i&&i.name&&String(j[e.away_id].name).trim()?String(j[e.away_id].name):e.away;return{id:e.match_id||"".concat(t,"-").concat(n),date:h,time:u,home:p,away:x,home_id:e.home_id,away_id:e.away_id,venue:e.venue,home_logo_url:k(p,e.home_logo_url,e.home_id),away_logo_url:k(x,e.away_logo_url,e.away_id),report_url:e.report_url,facr_link:e.facr_link,score:m&&/\d+\s*:\s*\d+/.test(m)?m.replace(/\s+/g,""):void 0}}).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime());return{id:o,code:e.code,name:(null===n||void 0===n||null===(a=n[null===e||void 0===e?void 0:e.code])||void 0===a?void 0:a.alias)||(null===n||void 0===n||null===(i=n[o])||void 0===i?void 0:i.alias)||e.name||e.code||"Sout\u011b\u017e ".concat(t+1),matches:r}}):[];let A=C;try{const e=null===w||void 0===w?void 0:w.club_id,t=(null===w||void 0===w?void 0:w.club_type)||"football";if(e){const n="/cache/facr/".concat(t,"_").concat(e,"_info.json"),a=await fetch(ke(n),{cache:"no-cache"});if(a.ok){const e=await a.json();if(Array.isArray(null===e||void 0===e?void 0:e.competitions)){const t=(e,t)=>{const n=(Array.isArray(e.matches)?e.matches:[]).map((e,n)=>{var a,i;const o=String(e.date_time||""),[r,s]=o.includes(" ")?o.split(" "):[o,""],[l,c,d]=r.split("."),h=l&&c&&d?"".concat(d,"-").concat(c.padStart(2,"0"),"-").concat(l.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(s||"00:00").slice(0,5),m=(e.score||e.result||("number"===typeof e.goals_home&&"number"===typeof e.goals_away?"".concat(e.goals_home,":").concat(e.goals_away):"")||"").toString();return{id:e.match_id||"".concat(t,"-").concat(n),date:h,time:u,home:null!==j&&void 0!==j&&null!==(a=j[e.home_id])&&void 0!==a&&a.name&&String(j[e.home_id].name).trim()?String(j[e.home_id].name):e.home,away:null!==j&&void 0!==j&&null!==(i=j[e.away_id])&&void 0!==i&&i.name&&String(j[e.away_id].name).trim()?String(j[e.away_id].name):e.away,home_id:e.home_id,away_id:e.away_id,venue:e.venue,home_logo_url:k(e.home,e.home_logo_url,e.home_id),away_logo_url:k(e.away,e.away_logo_url,e.away_id),report_url:e.report_url,score:m&&/\d+\s*:\s*\d+/.test(m)?m.replace(/\s+/g,""):void 0}}).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime());return n};A=C.map(n=>{if(n.matches.length)return n;const a=e.competitions.find(e=>String(e.id)===String(n.id)||e.name===n.name||e.code===n.name||e.code===n.id);if(!a)return n;const i=t(a,0);return(0,h.A)((0,h.A)({},n),{},{matches:i})})}}}}catch(u){}const T=Wi(A.map(e=>{var t,a,i,o,r;return(0,h.A)((0,h.A)({},e),{},{alias:(null===n||void 0===n||null===(t=n[(null===e||void 0===e?void 0:e.code)||""])||void 0===t?void 0:t.alias)||(null===n||void 0===n||null===(a=n[null===e||void 0===e?void 0:e.id])||void 0===a?void 0:a.alias),display_order:null!==(i=null===n||void 0===n||null===(o=n[(null===e||void 0===e?void 0:e.code)||""])||void 0===o?void 0:o.display_order)&&void 0!==i?i:null===n||void 0===n||null===(r=n[null===e||void 0===e?void 0:e.id])||void 0===r?void 0:r.display_order})})),N={id:"all",name:"V\u0161echny sout\u011b\u017ee",matches:(T||[]).flatMap((e,t)=>(e.matches||[]).map(n=>{var a;return(0,h.A)((0,h.A)({},n),{},{__compId:e.id,__compName:e.name,__compDisplayOrder:null!==(a=e.display_order)&&void 0!==a?a:1e3+t})})).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime())};let P=[];try{const e=await fetch(ke("/cache/prefetch/facr_tables.json"),{cache:"no-cache"});if(e.ok){var i;const t=await e.json();null!==t&&void 0!==t&&null!==(i=t.competitions)&&void 0!==i&&i.length&&(P=(t.competitions||[]).map(e=>{var t,a,i;return{name:(null===n||void 0===n||null===(t=n[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||(null===n||void 0===n||null===(a=n[null===e||void 0===e?void 0:e.id])||void 0===a?void 0:a.alias)||e.name||e.code,table:((null===(i=e.table)||void 0===i?void 0:i.overall)||[]).map((e,t)=>{var n,a,i,o,r,s,l,c,d,h,u;const m=(()=>{const t=e.team;return"string"===typeof t?t:t&&"object"===typeof t?t.name||t.Name||t.team_name||t.TeamName||"-":e.team_name||e.TeamName||"-"})(),p=(()=>{const t=e.team;return t&&"object"===typeof t&&(t.id||t.team_id||t.teamId)||e.team_id})();return{position:Number(e.rank||t+1),team_name:p&&null!==j&&void 0!==j&&null!==(n=j[p])&&void 0!==n&&n.name&&String(j[p].name).trim()?String(j[p].name):m,team_id:p,points:Number(e.points||e.pts||0),played:Number(e.played||e.matches||0),wins:Number(e.wins||e.win||0),draws:Number(e.draws||e.draw||0),losses:Number(e.losses||e.loss||0),goals_for:Number(null!==(a=null!==(i=null!==(o=null!==(r=null!==(s=e.goals_for)&&void 0!==s?s:e.gf)&&void 0!==r?r:e.goalsFor)&&void 0!==o?o:e.scored)&&void 0!==i?i:e.goals)&&void 0!==a?a:0),goals_against:Number(null!==(l=null!==(c=null!==(d=null!==(h=e.goals_against)&&void 0!==h?h:e.ga)&&void 0!==d?d:e.goalsAgainst)&&void 0!==c?c:e.conceded)&&void 0!==l?l:0),logo_url:p&&null!==j&&void 0!==j&&null!==(u=j[p])&&void 0!==u&&u.logo_url?String(j[p].logo_url):e.team_logo_url||void 0}})}}))}}catch(m){}if(!e){x(n);const e=[N,...T];o(e),c(_),I(P),null!==w&&void 0!==w&&w.name&&S(String(w.name)),null!==w&&void 0!==w&&w.club_internal_id&&E(String(w.club_internal_id)),null!==w&&void 0!==w&&w.club_type&&R(w.club_type);const t=f.get("comp");if(t){const n=e.findIndex(e=>String(e.id)===String(t));v(n>=0?n:0)}else v(0)}}catch(p){e||s((null===p||void 0===p?void 0:p.message)||"Nepoda\u0159ilo se na\u010d\xedst kalend\xe1\u0159.")}finally{e||n(!1)}})(),()=>{e=!0}},[]);const Se=Ua(ue?"".concat(ue.match.date,"T").concat(ue.match.time||"00:00",":00"):null,1e3),Ce=(0,a.useMemo)(()=>i.flatMap(e=>e.matches.filter(e=>new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()>Date.now())),[i]),Ae=La(Ce,3e4),Ee=(e,t)=>{me({match:e,comp:t}),de()},Te=e=>{if(1===e.button){var t;const n=e.currentTarget,a=n.getAttribute&&n.getAttribute("data-href")||(null===(t=n.dataset)||void 0===t?void 0:t.href);a&&window.open(a,"_blank","noopener")}},Ne=(0,a.useMemo)(()=>i.some(e=>e.matches.length),[i]),[Re,Pe]=(0,a.useState)((0,Si.w)(new Date)),[Ie,We]=(0,a.useState)("calendar"),[Me,De]=(0,a.useState)({}),[Ue,Le]=(0,a.useState)(!1),Fe=(0,a.useMemo)(()=>{const e=(0,Ci.k)((0,Si.w)(Re),{weekStartsOn:1}),t=[];for(let n=0;n<42;n++)t.push(new Date(e.getTime()+864e5*n));return t},[Re]),Oe=e=>{try{const t=we(e),n=we(_||"");return!(!t||!n)&&(t===n||t.endsWith(n)||n.endsWith(t))}catch(t){return!1}},Ze=e=>{const t=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00"));if(!(Date.now()>=t.getTime()))return null;const n=(e=>{if(!e)return null;const t=e.match(/^(\d+)\s*[:\-]\s*(\d+)$/);return t?{h:parseInt(t[1],10),a:parseInt(t[2],10)}:null})(e.score);if(!n)return null;let a=!1,i=!1;if(A&&(e.home_id&&(a=e.home_id===A),e.away_id&&(i=e.away_id===A)),a||i||(a=Oe(e.home),i=Oe(e.away)),!a&&!i)return null;if(n.h===n.a)return{label:"Rem\xedza",color:"blue"};return(a?n.h:n.a)>(a?n.a:n.h)?{label:"V\xfdhra",color:"green"}:{label:"Prohra",color:"red"}};return(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,children:"Kalend\xe1\u0159"}),(0,p.jsx)(U.E,{color:"gray.600",mb:6,children:"P\u0159ehled z\xe1pas\u016f podle sout\u011b\u017e\xed (FACR)."}),t&&(0,p.jsxs)(Q.s,{align:"center",gap:3,color:"gray.600",mb:6,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)("span",{children:"Na\u010d\xedt\xe1m rozpis\u2026"})]}),r&&(0,p.jsx)(y.a,{color:"red.600",mb:4,children:r}),!t&&!Ne&&!r&&(0,p.jsx)(y.a,{color:"gray.600",children:"Zat\xedm nem\xe1me \u017e\xe1dn\xe9 z\xe1pasy k zobrazen\xed."}),!!i.length&&(0,p.jsxs)(ra.t,{variant:"soft-rounded",colorScheme:"blue",index:g,onChange:e=>v(e),children:[(0,p.jsx)(y.a,{mb:3,position:"relative",zIndex:1,children:(0,p.jsx)(sa.w,{flexWrap:"wrap",gap:2,justifyContent:"flex-start",sx:{"& > button":{minW:"auto",px:{base:3,md:4},py:{base:1.5,md:2},fontSize:{base:"xs",md:"sm"},fontWeight:600,borderRadius:"md",transition:"all 0.2s",_selected:{bg:"brand.primary",color:"white",transform:"translateY(-2px)",boxShadow:"md"},_hover:{transform:"translateY(-1px)",boxShadow:"sm"}}},children:i.map(e=>(0,p.jsx)(la.o,{children:e.name},e.id))})}),(0,p.jsx)(ca.T,{children:i.map(e=>{const t=(e=>{const t=new Map;return e.forEach(e=>{const n=e.date,a=t.get(n)||[];a.push(e),t.set(n,a)}),t.forEach((e,t)=>{e.sort((e,t)=>{var n,a;const i=null!==(n=e.__compDisplayOrder)&&void 0!==n?n:9999,o=null!==(a=t.__compDisplayOrder)&&void 0!==a?a:9999;if(i!==o)return i-o;const r=e.time||"00:00",s=t.time||"00:00";return r.localeCompare(s)})}),t})(e.matches),n=e=>{var t;return null!==(t=e.facr_link||e.report_url||void 0)&&void 0!==t?t:"/zapas/".concat(e.id)},a=Date.now(),i=(e,t)=>new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()-new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();let o=[];if("all"===e.id){const t={};(e.matches||[]).forEach(e=>{if(!e.score)return;const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();if(isNaN(n)||n>a)return;const i=e.__compId||"na";t[i]=t[i]||[],t[i].push(e)}),o=Object.values(t).map(e=>e.sort(i)[0]).filter(Boolean).sort(i)}else o=(e.matches||[]).filter(e=>!!e.score&&new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()<=a).sort(i).slice(0,1);return(0,p.jsxs)(da.K,{px:0,children:[o.length>0&&(0,p.jsxs)(y.a,{mb:4,children:[(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,children:"Nejnov\u011bj\u0161\xed v\xfdsledky"}),(0,p.jsx)(wi.x,{templateColumns:{base:"1fr",sm:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gap:3,children:o.map(t=>{var a;const i=n(t);return(0,p.jsxs)(y.a,{"data-href":i||void 0,onMouseDown:Te,onClick:()=>Ee(t,e),borderWidth:"1px",borderRadius:"md",p:2,_hover:{textDecoration:"none",bg:"rgba(0,0,0,0.03)",borderColor:"brand.primary",cursor:"pointer"},children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:2,children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.700",children:[t.date," ",t.time||""]}),(0,p.jsx)(Qt.E,{colorScheme:"purple",children:t.__compName||e.name})]}),(0,p.jsxs)(Q.s,{align:"center",gap:2,justify:"center",children:[(0,p.jsx)(Wa,{teamId:t.home_id,teamName:t.home,facrLogo:t.home_logo_url,size:"custom",boxSize:"18px",alt:t.home,borderRadius:"full"}),(0,p.jsx)(U.E,{fontSize:"sm",children:t.home}),(0,p.jsx)(Qt.E,{colorScheme:(null===(a=Ze(t))||void 0===a?void 0:a.color)||"gray",children:t.score||"vs"}),(0,p.jsx)(Wa,{teamId:t.away_id,teamName:t.away,facrLogo:t.away_logo_url,size:"custom",boxSize:"18px",alt:t.away,borderRadius:"full"}),(0,p.jsx)(U.E,{fontSize:"sm",children:t.away})]}),i&&(0,p.jsx)(L.N,{href:i,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]},"latest-".concat(e.id,"-").concat(t.id))})})]}),(0,p.jsx)(Q.s,{align:"center",justify:"flex-end",mb:3,children:(0,p.jsxs)(_i.e,{size:"sm",isAttached:!0,children:[(0,p.jsx)(T.$,{variant:"calendar"===Ie?"solid":"outline",bg:"calendar"===Ie?"brand.primary":void 0,color:"calendar"===Ie?"text.onPrimary":void 0,_hover:{filter:"calendar"===Ie?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"calendar"===Ie?"text.onPrimary":void 0},onClick:()=>We("calendar"),children:"Kalend\xe1\u0159"}),(0,p.jsx)(T.$,{variant:"list"===Ie?"solid":"outline",bg:"list"===Ie?"brand.primary":void 0,color:"list"===Ie?"text.onPrimary":void 0,_hover:{filter:"list"===Ie?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"list"===Ie?"text.onPrimary":void 0},onClick:()=>We("list"),children:"Seznam"})]})}),"calendar"===Ie?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,p.jsx)(K.K,{"aria-label":"P\u0159edchoz\xed m\u011bs\xedc",size:"sm",onClick:()=>Pe((0,Ai.P)(Re,-1)),icon:(0,p.jsx)(tn.Y,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>Pe(new Date),variant:"solid",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Dnes"}),(0,p.jsx)(K.K,{"aria-label":"Dal\u0161\xed m\u011bs\xedc",size:"sm",onClick:()=>Pe((0,Ai.P)(Re,1)),icon:(0,p.jsx)(nn.v,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}})]}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsx)(wi.x,{templateColumns:"repeat(7, 1fr)",gap:3,minW:"980px",children:Mi.map(e=>(0,p.jsx)(y.a,{textAlign:"center",fontWeight:"semibold",color:"gray.600",fontSize:{base:"xs",md:"sm"},children:e},e))})}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsx)(wi.x,{templateColumns:"repeat(7, 1fr)",gap:{base:1,md:2},minW:"980px",children:Fe.map((a,i)=>{const o=(0,Ei.GP)(a,"yyyy-MM-dd"),r=t.get(o)||[],s=!(0,Ti.t)(a,Re),l=(0,Ni.r)(a,new Date);return(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:2,minH:"120px",minW:"130px",bg:l?"rgba(59,130,246,0.06)":M,borderColor:l?"brand.primary":D,opacity:s?.6:1,children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:(0,Ei.GP)(a,"d")}),!!r.length&&(0,p.jsx)(Qt.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"full",children:r.length})]}),(0,p.jsxs)(At.B,{spacing:2,children:[(Me[o]?r:r.slice(0,3)).map(t=>{var a;const i=n(t),o=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()<Date.now(),r=Ae[String(t.id)];return(0,p.jsxs)(y.a,{_hover:{textDecoration:"none"},"data-href":i||void 0,onMouseDown:Te,onClick:()=>Ee(t,e),children:[(0,p.jsx)(y.a,{p:2,borderWidth:"1px",borderRadius:"md",bg:F,_hover:{bg:O,borderColor:"brand.primary",cursor:"pointer"},textAlign:"center",children:!o&&r?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(Q.s,{align:"center",justify:"center",gap:2,mb:1,children:[t.home_logo_url&&(0,p.jsx)(k._,{src:t.home_logo_url,alt:t.home,boxSize:"18px",borderRadius:"full",objectFit:"cover"}),(0,p.jsxs)(Qt.E,{colorScheme:"orange",children:["za ",r]}),t.away_logo_url&&(0,p.jsx)(k._,{src:t.away_logo_url,alt:t.away,boxSize:"18px",borderRadius:"full",objectFit:"cover"})]}),(0,p.jsx)(U.E,{fontSize:"xs",color:"text.secondary",children:t.time||"\u2014"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(Q.s,{align:"center",justify:"center",gap:2,mb:1,children:[t.home_logo_url&&(0,p.jsx)(k._,{src:t.home_logo_url,alt:t.home,boxSize:"18px",borderRadius:"full",objectFit:"cover"}),(0,p.jsx)(Qt.E,{colorScheme:o&&t.score&&(null===(a=Ze(t))||void 0===a?void 0:a.color)||"gray",children:o&&t.score?t.score:"vs"}),t.away_logo_url&&(0,p.jsx)(k._,{src:t.away_logo_url,alt:t.away,boxSize:"18px",borderRadius:"full",objectFit:"cover"})]}),(0,p.jsx)(U.E,{fontSize:"xs",color:"text.secondary",children:t.time||"\u2014"})]})}),i&&(0,p.jsx)(L.N,{href:i,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]},t.id)}),r.length>3&&!Me[o]&&(0,p.jsxs)(T.$,{size:"xs",variant:"link",colorScheme:"gray",onClick:()=>De(e=>(0,h.A)((0,h.A)({},e),{},{[o]:!0})),children:["+",r.length-3," dal\u0161\xed\u2026"]}),Me[o]&&r.length>3&&(0,p.jsx)(T.$,{size:"xs",variant:"link",colorScheme:"gray",onClick:()=>De(e=>(0,h.A)((0,h.A)({},e),{},{[o]:!1})),children:"Zobrazit m\xe9n\u011b"})]})]},i)})})})]}):(0,p.jsx)(At.B,{spacing:4,children:(()=>{const a=Array.from(t.keys()),i=(0,Ei.GP)(new Date,"yyyy-MM-dd"),o=a.filter(e=>e<i).sort().reverse(),r=a.filter(e=>e>=i).sort(),s=(a,i)=>{const o=t.get(a)||[];return(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",bg:q,borderColor:V,children:[(0,p.jsx)(y.a,{px:3,py:2,bg:i?$:H,borderLeftWidth:"4px",borderLeftColor:i?"brand.primary":G,children:(0,p.jsxs)(Q.s,{align:"center",gap:2,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",color:i?"brand.primary":ee,children:(0,Ei.GP)(new Date(a),"EEEE d. M. yyyy",{locale:Ri.cs})}),i&&(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",borderRadius:"full",children:"Dnes"})]})}),(0,p.jsx)(At.B,{spacing:3,children:o.map(t=>{var a;const i=n(t),o=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()<Date.now(),r=o?Ze(t):null,s=Ae[String(t.id)];return(0,p.jsxs)(y.a,{_hover:{textDecoration:"none"},"data-href":i||void 0,onMouseDown:Te,onClick:()=>Ee(t,e),children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",bg:te,borderColor:ne,_hover:{bg:ae,borderColor:"brand.primary",cursor:"pointer",transform:"translateY(-2px)",boxShadow:"md"},transition:"all 0.2s",gap:3,children:[(0,p.jsxs)(Q.s,{direction:"column",minW:"100px",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",color:ie,fontSize:"sm",children:t.date}),(0,p.jsx)(U.E,{color:re,fontSize:"sm",children:t.time||"\u2014"}),t.venue&&(0,p.jsx)(U.E,{color:oe,fontSize:"xs",mt:1,children:t.venue})]}),(0,p.jsxs)(Q.s,{align:"center",gap:3,flex:"1",children:[(0,p.jsxs)(Q.s,{align:"center",gap:2,flex:"1",justify:"flex-end",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",textAlign:"right",color:ie,children:t.home}),t.home_logo_url&&(0,p.jsx)(k._,{src:t.home_logo_url,alt:t.home,boxSize:"32px",borderRadius:"full",objectFit:"cover",border:"2px solid",borderColor:"gray.200"})]}),(0,p.jsxs)(Q.s,{direction:"column",align:"center",gap:1,minW:"80px",children:[!o&&s?(0,p.jsxs)(Qt.E,{colorScheme:"orange",fontSize:"sm",px:2,children:["za ",s]}):(0,p.jsx)(Qt.E,{colorScheme:o&&t.score&&(null===(a=Ze(t))||void 0===a?void 0:a.color)||"gray",fontSize:"md",px:3,py:1,children:o&&t.score?t.score:"vs"}),r&&(0,p.jsx)(U.E,{fontSize:"xs",color:"".concat(r.color,".600"),fontWeight:"semibold",children:r.label})]}),(0,p.jsxs)(Q.s,{align:"center",gap:2,flex:"1",justify:"flex-start",children:[t.away_logo_url&&(0,p.jsx)(k._,{src:t.away_logo_url,alt:t.away,boxSize:"32px",borderRadius:"full",objectFit:"cover",border:"2px solid",borderColor:"gray.200"}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",textAlign:"left",color:ie,children:t.away})]})]})]}),i&&(0,p.jsx)(L.N,{href:i,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]},t.id)})})]},a)};return(0,p.jsxs)(p.Fragment,{children:[!!o.length&&(0,p.jsxs)(y.a,{children:[Ue?(0,p.jsx)(T.$,{size:"sm",variant:"link",onClick:()=>Le(!1),children:"Skr\xfdt p\u0159edchoz\xed z\xe1pasy"}):(0,p.jsxs)(T.$,{size:"sm",variant:"link",onClick:()=>Le(!0),children:["Zobrazit p\u0159edchoz\xed z\xe1pasy (",o.reduce((e,n)=>{var a;return e+((null===(a=t.get(n))||void 0===a?void 0:a.length)||0)},0),")"]}),Ue&&(0,p.jsx)(At.B,{spacing:4,mt:2,children:o.map(e=>s(e,!1))})]}),(0,p.jsx)(At.B,{spacing:4,children:r.map(e=>s(e,e===i))})]})})()})]},e.id)})})]}),(0,p.jsx)(se.aF,{isOpen:ce,onClose:he,size:"lg",isCentered:!0,returnFocusOnClose:!1,children:(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:ue&&(ue.match.__compName||(null===(e=ue.comp)||void 0===e?void 0:e.name))||"Detail z\xe1pasu"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:ue&&(0,p.jsxs)(At.B,{spacing:4,children:[(e=>{const t=Ze(ue.match);if(t)return(0,p.jsx)(Q.s,{justify:"center",children:(0,p.jsx)(Qt.E,{colorScheme:t.color,variant:"subtle",children:t.label})});const n=(null===(e=ue.comp)||void 0===e?void 0:e.name)||ue.match.__compName;return n&&"V\u0161echny sout\u011b\u017ee"!==n?(0,p.jsx)(Q.s,{justify:"center",children:(0,p.jsx)(Qt.E,{colorScheme:"purple",children:n})}):null})(),(0,p.jsxs)(Q.s,{align:"center",justify:"center",gap:3,children:[ue.match.home_logo_url&&(0,p.jsx)(k._,{src:ue.match.home_logo_url,alt:ue.match.home,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>_e(ue.match.home,ue.match.home_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(ue.match.home)}),(e=>{const t=new Date("".concat(ue.match.date,"T").concat(ue.match.time||"00:00",":00")),n=Date.now()>=t.getTime(),a=Boolean(ue.match.score);return n?(0,p.jsx)(Qt.E,{colorScheme:a&&(null===(e=Ze(ue.match))||void 0===e?void 0:e.color)||"gray",fontSize:"md",px:3,py:1,children:a?ue.match.score:"vs"}):Se.countdownString?(0,p.jsxs)(Qt.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:["za ",Se.countdownString]}):(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"vs"})})(),ue.match.away_logo_url&&(0,p.jsx)(k._,{src:ue.match.away_logo_url,alt:ue.match.away,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>_e(ue.match.away,ue.match.away_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(ue.match.away)})]}),(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(U.E,{fontSize:"lg",fontWeight:"semibold",color:"gray.800",mb:1,children:(()=>{try{return(0,Ei.GP)(new Date(ue.match.date),"EEEE d. MMMM yyyy",{locale:Ri.cs})}catch(e){return ue.match.date}})()}),(0,p.jsx)(U.E,{fontSize:"md",color:"gray.700",children:ue.match.time||"\u2014"})]}),(()=>{const e=new Date("".concat(ue.match.date,"T").concat(ue.match.time||"00:00",":00")),t=Date.now()>=e.getTime();if(!Boolean(ue.match.score)&&!t&&Se.isActive&&Se.timeRemaining>0){const e=Math.floor(Se.timeRemaining/864e5),t=Math.floor(Se.timeRemaining%864e5/36e5),n=Math.floor(Se.timeRemaining%36e5/6e4),a=Math.floor(Se.timeRemaining%6e4/1e3);return(0,p.jsxs)(y.a,{mt:4,p:4,bg:"orange.50",borderRadius:"lg",borderWidth:"2px",borderColor:"orange.200",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",color:"orange.800",mb:3,textAlign:"center",children:"Z\xe1pas za\u010d\xedn\xe1 za"}),(0,p.jsxs)(wi.x,{templateColumns:e>0?"repeat(4, 1fr)":"repeat(3, 1fr)",gap:3,children:[e>0&&(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(y.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:e})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===e?"den":e<5?"dny":"dn\xed"})]}),(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(y.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(t).padStart(2,"0")})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===t?"hodina":t<5?"hodiny":"hodin"})]}),(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(y.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(n).padStart(2,"0")})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===n?"minuta":n<5?"minuty":"minut"})]}),(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(y.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(a).padStart(2,"0")})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===a?"sekunda":a<5?"sekundy":"sekund"})]})]})]})}return null})(),(0,p.jsx)(y.a,{h:"1px",bg:"gray.200"}),(0,p.jsx)(z.D,{as:"h3",size:"sm",children:"Odb\u011br notifikac\xed pro fanou\u0161ky"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Zadejte sv\u016fj email a budeme v\xe1s informovat o novink\xe1ch a z\xe1pasech."}),(0,p.jsxs)(Q.s,{gap:2,align:"center",children:[(0,p.jsx)(C.p,{type:"email",placeholder:"v\xe1\u0161@email.cz",value:pe,onChange:e=>xe(e.target.value)}),(0,p.jsx)(T.$,{colorScheme:"red",onClick:async()=>{if(pe){ve(!0);try{const e=await fetch(ke("/api/v1/newsletter/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:pe})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error((null===t||void 0===t?void 0:t.error)||"HTTP ".concat(e.status))}w({title:"P\u0159ihl\xe1\u0161eno k odb\u011bru",status:"success"}),xe("")}catch(e){w({title:"Chyba p\u0159ihl\xe1\u0161en\xed",description:(null===e||void 0===e?void 0:e.message)||String(e),status:"error"})}finally{ve(!1)}}else w({title:"Zadejte email",status:"warning"})},isLoading:ge,children:"Odeb\xedrat"})]})]})}),(0,p.jsxs)(Ta.j,{children:[ue&&(ue.match.facr_link||ue.match.report_url)&&(0,p.jsx)(T.$,{colorScheme:"blue",mr:3,onClick:e=>{e.preventDefault();const t=ue.match.facr_link||ue.match.report_url;if(t){const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener noreferrer",e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},children:"Detail na FA\u010cR"}),(0,p.jsx)(T.$,{onClick:he,children:"Zav\u0159\xedt"})]})]})})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{}),(0,p.jsx)(Da,{isOpen:je,onClose:()=>be(!1),club:ye,clubType:N})]})};var Ui=n(511),Li=n(3313),Fi=n(5395),Oi=n(3201),Zi=n(2595),Ki=n(194);const qi=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:void 0);return new URL(e,"".concat(t.protocol,"//").concat(t.host)).toString()}return e}catch(t){return e}},Vi=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(null),[o,r]=(0,a.useState)([]),[s,l]=(0,a.useState)({}),[c,d]=(0,a.useState)(null),[h,u]=(0,a.useState)(!1),{data:m}=ge(),x=(0,b.dU)("white","gray.800"),g=(0,b.dU)("gray.200","gray.700"),v=(0,b.dU)("gray.600","gray.400"),j=(0,b.dU)("white","gray.800"),f=(0,b.dU)("var(--primary, #C53030)","var(--primary, #9b2c2c)"),k=(0,b.dU)("gray.800","gray.200"),w=(0,b.dU)("white","gray.800"),_=(0,b.dU)("gray.50","gray.700");return(0,a.useEffect)(()=>{let e=!1;return(async()=>{t(!0),i(null);try{let t={};try{(await $n()||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(t[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})})}catch(n){}const a=await fetch(qi("/cache/prefetch/facr_tables.json"),{cache:"no-cache"});if(!a.ok)throw new Error("HTTP ".concat(a.status));const i=await a.json(),o=Array.isArray(null===i||void 0===i?void 0:i.competitions)?i.competitions.map((e,n)=>{var a,i,o,r,s,l,c,d;const h=(null===e||void 0===e||null===(a=e.table)||void 0===a?void 0:a.overall)||[],u=Array.isArray(h)?h.map(e=>{var t,n,a,i,o,r,s,l;return{rank:String(null!==(t=e.rank)&&void 0!==t?t:""),team:String(null!==(n=e.team)&&void 0!==n?n:""),team_id:e.team_id,team_logo_url:e.team_logo_url?qi(e.team_logo_url):void 0,played:String(null!==(a=e.played)&&void 0!==a?a:""),wins:String(null!==(i=e.wins)&&void 0!==i?i:""),draws:String(null!==(o=e.draws)&&void 0!==o?o:""),losses:String(null!==(r=e.losses)&&void 0!==r?r:""),score:String(null!==(s=e.score)&&void 0!==s?s:""),points:String(null!==(l=e.points)&&void 0!==l?l:"")}}):[];return{id:String(e.id||n),name:(null===t||void 0===t||null===(i=t[null===e||void 0===e?void 0:e.code])||void 0===i?void 0:i.alias)||(null===t||void 0===t||null===(o=t[String(e.id||n)])||void 0===o?void 0:o.alias)||e.name||e.code||"Sout\u011b\u017e ".concat(n+1),alias:(null===t||void 0===t||null===(r=t[null===e||void 0===e?void 0:e.code])||void 0===r?void 0:r.alias)||(null===t||void 0===t||null===(s=t[String(e.id||n)])||void 0===s?void 0:s.alias),display_order:null!==(l=null===t||void 0===t||null===(c=t[null===e||void 0===e?void 0:e.code])||void 0===c?void 0:c.display_order)&&void 0!==l?l:null===t||void 0===t||null===(d=t[String(e.id||n)])||void 0===d?void 0:d.display_order,code:e.code,matches_link:e.matches_link,rows:u}}):[];if(!e){l(t);const e=Wi((o||[]).filter(e=>Array.isArray(e.rows)&&e.rows.length>0));r(e)}}catch(a){e||i((null===a||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se na\u010d\xedst tabulky.")}finally{e||t(!1)}})(),()=>{e=!0}},[]),(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,children:"Tabulky"}),(0,p.jsx)(U.E,{color:v,mb:6,children:"Ofici\xe1ln\xed tabulky FACR podle sout\u011b\u017e\xed."}),e&&(0,p.jsxs)(Q.s,{align:"center",gap:3,color:v,mb:6,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)("span",{children:"Na\u010d\xedt\xe1m tabulky\u2026"})]}),n&&(0,p.jsx)(y.a,{color:"red.600",mb:6,children:n}),!!o.length&&(0,p.jsxs)(ra.t,{variant:"enclosed",size:"sm",children:[(0,p.jsx)(sa.w,{px:2,pt:2,overflowX:"auto",overflowY:"hidden",css:{"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-gray-300)",borderRadius:"4px"}},children:o.map(e=>(0,p.jsx)(la.o,{_selected:{bg:"brand.primary",color:"text.onPrimary",borderColor:"brand.primary"},_hover:{bg:"rgba(0,0,0,0.04)"},flex:"0 0 auto",px:3,py:2,children:(0,p.jsx)(U.E,{as:"span",noOfLines:1,maxW:"300px",title:e.name,children:e.name})},e.id))}),(0,p.jsx)(ca.T,{children:o.map(e=>(0,p.jsxs)(da.K,{px:0,children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:3,children:[(0,p.jsx)(z.D,{as:"h2",size:"md",children:e.name}),e.matches_link&&(0,p.jsx)(L.N,{href:e.matches_link,isExternal:!0,color:"brand.primary",_hover:{filter:"brightness(0.9)"},children:"Rozpis a detail sout\u011b\u017ee"})]}),(0,p.jsx)(y.a,{borderWidth:"1px",borderColor:g,borderRadius:"lg",overflowX:"auto",boxShadow:"sm",bg:j,children:(0,p.jsxs)(Ui.X,{size:"sm",variant:"unstyled",color:k,children:[(0,p.jsx)(Li.d,{position:"sticky",top:0,zIndex:2,children:(0,p.jsxs)(Fi.Tr,{bg:f,color:"white",children:[(0,p.jsx)(Oi.Th,{w:"56px",color:"white",children:"#"}),(0,p.jsx)(Oi.Th,{color:"white",children:"T\xfdm"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"Z"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"V"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"R"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"P"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"Sk\xf3re"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,color:"white",children:"Body"})]})}),(0,p.jsx)(Zi.N,{children:e.rows.map((t,n)=>(0,p.jsxs)(Fi.Tr,{transition:"all 0.15s",_hover:{transform:"translateY(-3px)",boxShadow:"lg",zIndex:3,cursor:"pointer"},position:"relative",bg:n%2===0?w:_,onClick:()=>(d(t),void u(!0)),children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{variant:"subtle",bg:(0,b.dU)("gray.100","gray.700"),color:k,borderWidth:"1px",borderColor:g,children:t.rank})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(Q.s,{align:"center",gap:3,children:[(0,p.jsx)(Wa,{teamId:t.team_id,teamName:t.team,facrLogo:t.team_logo_url,size:"small",alt:t.team,borderRadius:"full",bg:x,borderWidth:"1px",borderColor:g}),(0,p.jsx)(U.E,{fontWeight:"medium",color:k,children:t.team})]})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,color:k,children:t.played}),(0,p.jsx)(Ki.Td,{isNumeric:!0,color:k,children:t.wins}),(0,p.jsx)(Ki.Td,{isNumeric:!0,color:k,children:t.draws}),(0,p.jsx)(Ki.Td,{isNumeric:!0,color:k,children:t.losses}),(0,p.jsx)(Ki.Td,{isNumeric:!0,color:k,children:t.score}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsx)(Qt.E,{variant:"solid",bg:"blue.600",color:"white",children:t.points})})]},"".concat(e.id,"-").concat(t.rank,"-").concat(t.team)))})]})})]},e.id))})]}),!e&&!n&&0===o.length&&(0,p.jsx)(U.E,{color:v,children:"Pro tento klub nejsou dostupn\xe9 tabulky."})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{}),(0,p.jsx)(Da,{isOpen:h,onClose:()=>u(!1),club:c,clubType:(null===m||void 0===m?void 0:m.club_type)||"football"})]})},Hi=()=>{const[e,t]=(0,a.useState)(""),[n,i]=(0,a.useState)(""),[o,r]=(0,a.useState)("football"),[s,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),[j,y]=(0,a.useState)([]),[f,k]=(0,a.useState)({}),[z,w]=(0,a.useState)(!0),[_,S]=(0,a.useState)({}),C=12,A=(0,b.dU)("#f8f9fb","#0f1115"),E=(0,b.dU)("#fff","#1a1d29"),T=(0,b.dU)("#e5e7eb","#2a2e3a"),N=(0,b.dU)("#1a1a1a","#e8eaf0"),P=(0,b.dU)("#666","#9ca3af"),I=(0,b.dU)("#000","#fff"),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35;if(!e)return e;const n=M(e);return n.length<=t?n:n.substring(0,t).trim()+"\u2026"},U=(e,t)=>{try{return new Date("".concat(e,"T").concat(t,":00")).toLocaleDateString("cs-CZ",{day:"numeric",month:"numeric",year:"numeric"})}catch(n){return e}},L=e=>{let t=(e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase())(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},F=t=>{try{const n=L(t),a=L(e||"");return!(!n||!a)&&(n===a||n.endsWith(a)||a.endsWith(n))}catch(n){return!1}},O=e=>{const t=(e=>{if(!e)return null;const t=e.match(/^(\d+)\s*[:\-]\s*(\d+)$/);return t?{h:parseInt(t[1],10),a:parseInt(t[2],10)}:null})(e.score);if(!t)return null;let a=!1,i=!1;if(n&&(e.home_id&&(a=e.home_id===n),e.away_id&&(i=e.away_id===n)),a||i||(a=F(e.home),i=F(e.away)),!a&&!i)return null;if(t.h===t.a)return{label:"Rem\xedza",colorScheme:"blue"};return(a?t.h:t.a)>(a?t.a:t.h)?{label:"V\xfdhra",colorScheme:"green"}:{label:"Prohra",colorScheme:"red"}},Z=((0,a.useMemo)(()=>Date.now(),[]),(0,a.useMemo)(()=>{const e=s.map(e=>(0,h.A)((0,h.A)({},e),{},{matches:[...e.matches].sort((e,t)=>{const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime(),a=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime();return z?n-a:a-n})}));if(e.length>0){const t=e.flatMap(e=>e.matches.map(t=>(0,h.A)((0,h.A)({},t),{},{competitionName:e.name})));return t.sort((e,t)=>{const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime(),a=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime();return z?n-a:a-n}),[{name:"V\u0161echny kategorie",matches:t,matches_link:void 0},...e]}return e},[s,z]));(0,a.useEffect)(()=>{const e={};Z.forEach((t,n)=>{void 0===_[n]&&(e[n]=C)}),Object.keys(e).length>0&&S(t=>(0,h.A)((0,h.A)({},t),e))},[Z.length]);const K=(0,a.useMemo)(()=>{if(c>=Z.length)return[];const e=Z[c],t=Date.now();return((null===e||void 0===e?void 0:e.matches)||[]).filter(e=>new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()>t)},[Z,c]),q=La(K,3e4);return(0,a.useEffect)(()=>{let e=!1;const n=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:void 0);return new URL(e,"".concat(t.protocol,"//").concat(t.host)).toString()}return e}catch(t){return e}},a=async e=>{try{const t=await fetch(n(e),{cache:"no-cache"});if(!t.ok)throw new Error("HTTP ".concat(t.status));return await t.json()}catch(t){return null}};return(async()=>{const[o,s,c,d]=await Promise.all([a("/cache/prefetch/settings.json"),a("/cache/prefetch/facr_club_info.json"),a("/api/v1/public/team-logo-overrides?t=".concat(Date.now())),a("/cache/prefetch/team_logo_overrides.json")]);let h=[];try{h=await $n()}catch(x){}const u={};(h||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(u[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})});let m=null;try{m=await R()}catch(g){}if(!e){var p;y(h||[]),k(u);const e=c&&(c.by_name||c.by_id)?c:d||{},a=(null===e||void 0===e?void 0:e.by_name)||{},x=(null===e||void 0===e?void 0:e.by_id)||{},g=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),v=e=>{let t=g(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},j=Object.keys(a||{}).reduce((e,t)=>(e[g(t)]=a[t],e),{}),b=Object.keys(a||{}).map(e=>({keyNorm:v(e),url:a[e]})),f=(e,t)=>{if(e){const t=(a||{})[e],i=g(e);let o=t||j[i];if(!o){const t=v(e);for(const{keyNorm:e,url:n}of b)if(e&&(t.endsWith(e)||e.endsWith(t))){o=n;break}}if(o)return"string"===typeof o&&o.startsWith("/")?n(o):o}if(t)return"string"===typeof t&&t.startsWith("/")?n(t):t},z=(e,t,a)=>{var i;if(t&&null!==x&&void 0!==x&&null!==(i=x[t])&&void 0!==i&&i.logo_url){const e=x[t].logo_url;return"string"===typeof e&&e.startsWith("/")?n(e):e}try{if(t&&null!==w&&void 0!==w&&w.club_id&&String(t)===String(w.club_id)&&null!==w&&void 0!==w&&w.club_logo_url){const e=w.club_logo_url;return"string"===typeof e&&e.startsWith("/")?n(e):e}}catch(o){}return t?"http://logoapi.sportcreative.eu/logos/".concat(t):f(e,a)},w=m||o;if(w){const e=(null===w||void 0===w?void 0:w.club_name)||(null===w||void 0===w?void 0:w.clubName)||"",n=(null===w||void 0===w?void 0:w.club_id)||(null===w||void 0===w?void 0:w.clubId)||"",a=(null===w||void 0===w?void 0:w.club_type)||"football";e&&t(e),n&&i(n),"football"!==a&&"futsal"!==a||r(a)}if(null!==s&&void 0!==s&&null!==(p=s.competitions)&&void 0!==p&&p.length){const e=Wi((s.competitions||[]).map(e=>{var t,n,a,i,o,r,s;return{name:(null===u||void 0===u||null===(t=u[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||(null===u||void 0===u||null===(n=u[null===e||void 0===e?void 0:e.id])||void 0===n?void 0:n.alias)||e.name||e.code||"Sout\u011b\u017e",alias:(null===u||void 0===u||null===(a=u[null===e||void 0===e?void 0:e.code])||void 0===a?void 0:a.alias)||(null===u||void 0===u||null===(i=u[null===e||void 0===e?void 0:e.id])||void 0===i?void 0:i.alias),display_order:null!==(o=null===u||void 0===u||null===(r=u[null===e||void 0===e?void 0:e.code])||void 0===r?void 0:r.display_order)&&void 0!==o?o:null===u||void 0===u||null===(s=u[null===e||void 0===e?void 0:e.id])||void 0===s?void 0:s.display_order,matches_link:e.matches_link,matches:(Array.isArray(e.matches)?e.matches:[]).map((t,n)=>{var a,i;const o=String(t.date_time||""),[r,s]=o.includes(" ")?o.split(" "):[o,""],[l,c,d]=(r||"").split("."),h=l&&c&&d?"".concat(d,"-").concat(c.padStart(2,"0"),"-").concat(l.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(s||"18:00").slice(0,5),m=null!==x&&void 0!==x&&null!==(a=x[t.home_id])&&void 0!==a&&a.name&&String(x[t.home_id].name).trim()?String(x[t.home_id].name):t.home,p=null!==x&&void 0!==x&&null!==(i=x[t.away_id])&&void 0!==i&&i.name&&String(x[t.away_id].name).trim()?String(x[t.away_id].name):t.away,g=new Date("".concat(h,"T").concat(u,":00")).getTime()>Date.now()?null:t.score;return{id:t.match_id||n+1,date:h,time:u,home:m,away:p,home_id:t.home_id,away_id:t.away_id,home_logo_url:z(m,t.home_id,t.home_logo_url),away_logo_url:z(p,t.away_id,t.away_logo_url),score:g,facr_link:t.facr_link,report_url:t.report_url,venue:t.venue||"",competition:e.name||e.code||""}})}}));l(e)}}})(),()=>{e=!0}},[]),(0,p.jsxs)(Ht,{children:[(0,p.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"24px 16px",background:A,minHeight:"100vh"},children:[(0,p.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24,flexWrap:"wrap",gap:16},children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("h1",{style:{fontSize:"2rem",fontWeight:800,marginBottom:8,color:I},children:"V\u0161echny z\xe1pasy"}),(0,p.jsx)("p",{style:{color:P},children:e||"Klub"})]}),(0,p.jsxs)("button",{onClick:()=>w(!z),style:{padding:"10px 20px",background:"var(--primary-color, #3b82f6)",color:"white",border:"none",borderRadius:8,fontWeight:600,fontSize:"0.9rem",cursor:"pointer",transition:"all 0.2s",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:8},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 8px rgba(0,0,0,0.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)"},children:[(0,p.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:z?(0,p.jsx)("path",{d:"M11 5h4M11 9h7M11 13h10M3 17l3 3m0 0l3-3m-3 3V4"}):(0,p.jsx)("path",{d:"M11 5h10M11 9h7M11 13h4M3 17l3-3m0 0l3 3m-3-3v16"})}),z?"Nejstar\u0161\xed prvn\xed":"Nejnov\u011bj\u0161\xed prvn\xed"]})]}),Z.length>0?(0,p.jsxs)(ra.t,{variant:"soft-rounded",colorScheme:"blue",index:c,onChange:d,children:[(0,p.jsx)(sa.w,{mb:4,flexWrap:"wrap",gap:2,justifyContent:"flex-start",sx:{"& > button":{minW:"auto",px:{base:3,md:4},py:{base:1.5,md:2},fontSize:{base:"xs",md:"sm"},fontWeight:600,borderRadius:"md",transition:"all 0.2s",_selected:{bg:"brand.primary",color:"white",transform:"translateY(-2px)",boxShadow:"md"},_hover:{transform:"translateY(-1px)",boxShadow:"sm"}}},children:Z.map((e,t)=>(0,p.jsx)(la.o,{children:e.name},"".concat(e.name,"-").concat(t)))}),(0,p.jsx)(ca.T,{children:Z.map((e,t)=>(0,p.jsx)(da.K,{px:0,children:0===e.matches.length?(0,p.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:P},children:"\u017d\xe1dn\xe9 z\xe1pasy k zobrazen\xed"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:e.matches.slice(0,_[t]||C).map((t,n)=>{var a,i;const o=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime(),r=Date.now(),s=o>r,l=o<r,d=t.score&&""!==t.score.trim(),u=q[String(t.id)];return(0,p.jsxs)("div",{onClick:()=>(e=>{try{v(e),x(!0)}catch(t){}})((0,h.A)((0,h.A)({},t),{},{competitionName:e.name})),style:{background:E,border:"2px solid ".concat(T),borderRadius:16,padding:20,cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 2px 8px rgba(0,0,0,0.08)",color:N,position:"relative",overflow:"hidden"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-8px)",e.currentTarget.style.boxShadow="0 16px 40px rgba(0,0,0,0.12), 0 6px 16px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor="var(--chakra-colors-brand-primary, #3b82f6)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor=T},children:[(0,p.jsxs)("div",{style:{fontSize:"0.85rem",color:P,marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:[(0,p.jsx)("span",{children:U(t.date,t.time||"00:00")}),(0,p.jsx)("span",{style:{background:"var(--chakra-colors-brand-primary, #3b82f6)",color:"white",padding:"4px 10px",borderRadius:8,fontSize:"0.8rem",fontWeight:700},children:t.time})]}),(0,p.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flex:1,minWidth:0},children:[(0,p.jsx)("div",{style:{width:48,height:48,borderRadius:"50%",overflow:"hidden",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",background:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,p.jsx)("img",{src:W(t.home_logo_url)||"/images/club-logo.png",alt:t.home,style:{width:40,height:40,objectFit:"contain",padding:null!==(a=W(t.home_logo_url))&&void 0!==a&&a.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"},onError:e=>{e.target.src="/images/club-logo.png"}})}),(0,p.jsx)("span",{style:{fontWeight:700,fontSize:"1rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.home,children:D(t.home)})]})}),(0,p.jsx)("div",{style:{textAlign:"center",margin:"20px 0",fontSize:"1.8rem",fontWeight:"bold"},children:s?u?(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[(0,p.jsx)("span",{style:{fontSize:"0.7rem",color:"#f97316",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Za\u010d\xe1tek za"}),(0,p.jsx)("span",{style:{fontSize:"1.4rem",color:"#f97316",fontWeight:800,fontFamily:"monospace"},children:u})]}):(0,p.jsx)("span",{style:{fontSize:"1.2rem",color:"#3b82f6",fontWeight:600},children:"vs"}):d?(0,p.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:(0,p.jsx)("span",{style:{fontSize:"2rem",fontWeight:800,background:"linear-gradient(135deg, #3b82f6, #2563eb)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:t.score})}):(0,p.jsx)("span",{style:{fontSize:"1.2rem",color:"#9ca3af",fontWeight:600},children:"\u2014:\u2014"})}),(0,p.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flex:1,minWidth:0},children:[(0,p.jsx)("div",{style:{width:48,height:48,borderRadius:"50%",overflow:"hidden",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",background:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,p.jsx)("img",{src:W(t.away_logo_url)||"/images/club-opponent.png",alt:t.away,style:{width:40,height:40,objectFit:"contain",padding:null!==(i=W(t.away_logo_url))&&void 0!==i&&i.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"},onError:e=>{e.target.src="/images/club-opponent.png"}})}),(0,p.jsx)("span",{style:{fontWeight:700,fontSize:"1rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.away,children:D(t.away)})]})}),t.venue&&(0,p.jsx)("div",{style:{fontSize:"0.85rem",color:P,marginTop:12,textAlign:"center"},children:t.venue}),t.competitionName&&0===c&&(0,p.jsx)("div",{style:{marginTop:12,textAlign:"center"},children:(0,p.jsx)("span",{style:{fontSize:"0.75rem",color:"white",background:"var(--chakra-colors-brand-primary, #3b82f6)",padding:"4px 12px",borderRadius:12,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px"},children:t.competitionName})}),(()=>{const e=d&&l?O(t):null;if(e){const t={green:{bg:"linear-gradient(135deg, #10b981 0%, #059669 100%)",shadow:"rgba(16, 185, 129, 0.3)"},blue:{bg:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",shadow:"rgba(59, 130, 246, 0.3)"},red:{bg:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",shadow:"rgba(239, 68, 68, 0.3)"}}[e.colorScheme];return(0,p.jsx)("div",{style:{fontSize:"0.75rem",background:t.bg,color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px ".concat(t.shadow)},children:e.label})}return!d&&l?(0,p.jsx)("div",{style:{fontSize:"0.75rem",background:"linear-gradient(135deg, #6b7280 0%, #4b5563 100%)",color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px rgba(107, 114, 128, 0.3)"},children:"Odehr\xe1no"}):d||!s||u?null:(0,p.jsx)("div",{style:{fontSize:"0.75rem",background:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},children:"Nadch\xe1zej\xedc\xed"})})()]},t.id||n)})}),e.matches.length>(_[t]||C)&&(0,p.jsxs)("div",{style:{textAlign:"center",marginTop:32},children:[(0,p.jsxs)("button",{onClick:()=>{return e=t,void S(t=>(0,h.A)((0,h.A)({},t),{},{[e]:(t[e]||C)+C}));var e},style:{padding:"14px 32px",background:"var(--primary-color, #3b82f6)",color:"white",border:"none",borderRadius:12,fontWeight:700,fontSize:"1rem",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 4px 12px rgba(59, 130, 246, 0.3)",display:"inline-flex",alignItems:"center",gap:10},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 8px 20px rgba(59, 130, 246, 0.4)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 12px rgba(59, 130, 246, 0.3)"},children:[(0,p.jsx)("span",{children:"Na\u010d\xedst dal\u0161\xed z\xe1pasy"}),(0,p.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,p.jsxs)("div",{style:{marginTop:12,fontSize:"0.875rem",color:P,fontWeight:600},children:["Zobrazeno ",Math.min(_[t]||C,e.matches.length)," z ",e.matches.length," z\xe1pas\u016f"]})]})]})},"panel-".concat(e.name,"-").concat(t)))})]}):(0,p.jsxs)("div",{style:{textAlign:"center",padding:"60px 0",color:P},children:[(0,p.jsx)("p",{style:{fontSize:"1.2rem",marginBottom:8,color:I},children:"\u017d\xe1dn\xe9 z\xe1pasy k zobrazen\xed"}),(0,p.jsx)("p",{style:{fontSize:"0.9rem",color:P},children:"Zkontrolujte nastaven\xed klubu v administraci"})]})]}),(0,p.jsx)(Fa,{isOpen:u,match:g,onClose:()=>x(!1)})]})},$i=()=>{const{data:e,isLoading:t,isError:n}=(0,xe.I)({queryKey:["players"],queryFn:Qe}),a=(0,b.dU)("white","gray.800"),i=(0,b.dU)("gray.200","gray.700"),o=(0,b.dU)("gray.600","gray.400");return t?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsx)(zn.y,{})})}):n?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsx)(U.E,{color:"red.500",children:"Chyba p\u0159i na\u010d\xedt\xe1n\xed hr\xe1\u010d\u016f"})})}):(0,p.jsx)(Ht,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsx)(z.D,{as:"h1",size:{base:"xl",md:"2xl"},children:"Hr\xe1\u010di"}),(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:6,children:null===e||void 0===e?void 0:e.map(e=>(0,p.jsxs)(At.B,{as:d.N_,to:"/hraci/".concat(e.id),borderWidth:"1px",borderColor:i,borderRadius:"lg",p:4,bg:a,_hover:{boxShadow:"lg",transform:"translateY(-4px)"},transition:"all 0.2s ease",spacing:3,children:[(0,p.jsx)(k._,{src:W(e.image_url)||"/logo512.png",alt:"".concat(e.first_name," ").concat(e.last_name),objectFit:"cover",borderRadius:"md",w:"100%",h:"240px"}),(0,p.jsxs)(U.E,{fontWeight:"bold",fontSize:"lg",children:[e.first_name," ",e.last_name]}),(0,p.jsx)(U.E,{color:o,children:e.position}),e.jersey_number?(0,p.jsxs)(U.E,{color:"brand.primary",fontWeight:"600",children:["#",e.jersey_number]}):null]},e.id))})]})}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})})};function Bi(e){if(!e)return"";const t={CZ:"\u010cesk\xe1 republika",SK:"Slovensko",PL:"Polsko",DE:"N\u011bmecko",AT:"Rakousko",UA:"Ukrajina",FR:"Francie",ES:"\u0160pan\u011blsko",IT:"It\xe1lie",GB:"Anglie",UK:"Velk\xe1 Brit\xe1nie",US:"USA",BR:"Braz\xedlie",AR:"Argentina",PT:"Portugalsko",NL:"Nizozemsko",BE:"Belgie",CH:"\u0160v\xfdcarsko",SE:"\u0160v\xe9dsko",NO:"Norsko",DK:"D\xe1nsko",FI:"Finsko",RU:"Rusko",HR:"Chorvatsko",RS:"Srbsko",SI:"Slovinsko",HU:"Ma\u010farsko",RO:"Rumunsko",BG:"Bulharsko",GR:"\u0158ecko",TR:"Turecko",JP:"Japonsko",CN:"\u010c\xedna",KR:"Ji\u017en\xed Korea",AU:"Austr\xe1lie",NZ:"Nov\xfd Z\xe9land",CA:"Kanada",MX:"Mexiko",IE:"Irsko",IS:"Island"},n={Czechia:"\u010cesk\xe1 republika","Czech Republic":"\u010cesk\xe1 republika",Slovakia:"Slovensko",Poland:"Polsko",Germany:"N\u011bmecko",Austria:"Rakousko",Ukraine:"Ukrajina",France:"Francie",Spain:"\u0160pan\u011blsko",Italy:"It\xe1lie",England:"Anglie","United Kingdom":"Velk\xe1 Brit\xe1nie","United States":"USA",Brazil:"Braz\xedlie",Argentina:"Argentina",Portugal:"Portugalsko",Netherlands:"Nizozemsko",Belgium:"Belgie",Switzerland:"\u0160v\xfdcarsko",Sweden:"\u0160v\xe9dsko",Norway:"Norsko",Denmark:"D\xe1nsko",Finland:"Finsko",Russia:"Rusko",Croatia:"Chorvatsko",Serbia:"Srbsko",Slovenia:"Slovinsko",Hungary:"Ma\u010farsko",Romania:"Rumunsko",Bulgaria:"Bulharsko",Greece:"\u0158ecko",Turkey:"Turecko",Japan:"Japonsko",China:"\u010c\xedna","South Korea":"Ji\u017en\xed Korea",Australia:"Austr\xe1lie","New Zealand":"Nov\xfd Z\xe9land",Canada:"Kanada",Mexico:"Mexiko",Ireland:"Irsko",Iceland:"Island","Bosnia and Herzegovina":"Bosna a Hercegovina",Montenegro:"\u010cern\xe1 Hora","North Macedonia":"Severn\xed Makedonie",Albania:"Alb\xe1nie",Luxembourg:"Lucembursko",Moldova:"Moldavsko",Lithuania:"Litva",Latvia:"Loty\u0161sko",Estonia:"Estonsko",Belarus:"B\u011blorusko"},a=e.toUpperCase();if(t[a])return t[a];const i=e.toLowerCase();for(const[o,r]of Object.entries(n))if(o.toLowerCase()===i)return r;return e}const Ji=()=>{const{id:e}=(0,c.g)(),{data:t,isLoading:n,isError:a}=(0,xe.I)({queryKey:["player",e],queryFn:()=>async function(e){return Xe((await m.Ay.get("/players/".concat(e))).data)}(String(e))});if(n)return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsx)(en.E,{height:"320px"})})});if(a||!t)return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsx)(U.E,{color:"red.500",children:"Hr\xe1\u010de se nepoda\u0159ilo na\u010d\xedst."})})});const i=[t.first_name,t.last_name].filter(Boolean).join(" ");return(0,p.jsx)(Ht,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(z.D,{as:"h1",size:{base:"xl",md:"2xl"},children:i}),!t.is_active&&(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"Neaktivn\xed"})]}),(0,p.jsx)(T.$,{as:d.N_,to:"/hraci",variant:"outline",children:"Zp\u011bt na p\u0159ehled"})]}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:6,children:[(0,p.jsx)(y.a,{children:(0,p.jsx)(k._,{src:W(t.image_url)||"/logo512.png",alt:i,borderRadius:"lg",objectFit:"cover",w:"100%",h:{base:"300px",md:"400px"}})}),(0,p.jsxs)(At.B,{spacing:3,bg:"white",borderWidth:"1px",borderRadius:"lg",p:6,shadow:"sm",children:[(0,p.jsx)(z.D,{size:"md",mb:2,children:"Informace o hr\xe1\u010di"}),t.position&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Pozice:"})," ",t.position]}),"number"===typeof t.jersey_number&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"\u010c\xedslo dresu:"})," ",(0,p.jsxs)(U.E,{as:"span",color:"brand.primary",fontWeight:"700",children:["#",t.jersey_number]})]}),t.nationality&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"N\xe1rodnost:"})," ",Bi(t.nationality)]}),t.date_of_birth&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Datum narozen\xed:"})," ",new Date(t.date_of_birth).toLocaleDateString("cs-CZ")]}),(t.height||t.weight)&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"V\xfd\u0161ka/V\xe1ha:"})," ",t.height?"".concat(t.height," cm"):"-"," / ",t.weight?"".concat(t.weight," kg"):"-"]}),t.email&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Email:"})," ",t.email]}),t.phone&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Telefon:"})," ",t.phone]}),"number"===typeof t.team_id&&t.team_id>0&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"T\xfdm ID:"})," ",t.team_id]})]})]})]})}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})})},Yi=()=>{var e,t,n,a;const{data:i,isLoading:o,isError:r,error:s}=(0,xe.I)({queryKey:["sponsors-page"],queryFn:et}),l=(0,j.d)(),c=(0,b.dU)("white","gray.800"),d=(0,b.dU)("gray.200","gray.700"),u=(0,b.dU)("gray.50","gray.900"),m=(0,b.dU)("gray.600","gray.400"),x=(0,b.dU)("gray.700","gray.300"),{register:g,handleSubmit:v,reset:f,formState:{errors:A}}=(0,Gn.mN)(),{mutate:E,isLoading:N}=(0,Mn.n)({mutationFn:e=>tt((0,h.A)((0,h.A)({},e),{},{source:"sponsor"})),onSuccess:()=>{f(),l({title:"Zpr\xe1va odesl\xe1na",description:"D\u011bkujeme za zpr\xe1vu.",status:"success"})},onError:e=>{var t,n,a,i;const o=(null===e||void 0===e?void 0:e.code)||"",r=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message),s="ECONNABORTED"===o||/timeout/i.test(String((null===e||void 0===e?void 0:e.message)||"")),c=!(null===e||void 0===e||!e.isAxiosError)&&!(null!==e&&void 0!==e&&e.response),d=r||(s?"Vypr\u0161el \u010dasov\xfd limit po\u017eadavku. Zkuste to pros\xedm znovu.":c?"Po\u017eadavek se nezda\u0159il (s\xed\u0165/CORS). Obnovte str\xe1nku a zkuste znovu.":(null===e||void 0===e?void 0:e.message)||"Odesl\xe1n\xed se nezda\u0159ilo");l({title:"Chyba",description:d,status:"error"})}});if(o)return(0,p.jsx)(zn.y,{});if(r){var R,P;const e=(null===s||void 0===s||null===(R=s.response)||void 0===R||null===(P=R.data)||void 0===P?void 0:P.error)||(null===s||void 0===s?void 0:s.message)||"Chyba p\u0159i na\u010d\xedt\xe1n\xed sponzor\u016f";return(0,p.jsx)(U.E,{color:"red.500",children:e})}const I=(null===i||void 0===i?void 0:i.filter(e=>"general"===e.tier))||[],W=(null===i||void 0===i?void 0:i.filter(e=>"general"!==e.tier))||[];return(0,p.jsx)(Ht,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:10,maxW:"7xl",mx:"auto",px:{base:4,md:6},py:{base:6,md:10},children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:6,children:"Na\u0161i partne\u0159i"}),I.length>0&&(0,p.jsxs)(y.a,{mb:8,children:[(0,p.jsx)(z.D,{size:"md",mb:4,color:"brand.600",children:"Hlavn\xed partne\u0159i"}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:8,children:I.map(e=>(0,p.jsxs)(At.B,{align:"center",bg:c,p:6,borderRadius:"lg",borderWidth:"2px",borderColor:d,boxShadow:"md",children:[(0,p.jsx)(L.N,{href:e.website_url||"#",isExternal:!0,children:(0,p.jsx)(k._,{src:e.logo_url||"/logo192.png",alt:e.name,height:"100px",objectFit:"contain"})}),(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"lg",children:e.name})]},e.id))})]}),W.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"md",mb:4,color:x,children:"Partne\u0159i"}),(0,p.jsx)(Tt.r,{columns:{base:2,md:3,lg:5},spacing:6,children:W.map(e=>(0,p.jsxs)(At.B,{align:"center",bg:c,p:4,borderRadius:"md",borderWidth:"1px",borderColor:d,children:[(0,p.jsx)(L.N,{href:e.website_url||"#",isExternal:!0,children:(0,p.jsx)(k._,{src:e.logo_url||"/logo192.png",alt:e.name,height:"60px",objectFit:"contain"})}),(0,p.jsx)(U.E,{fontSize:"sm",children:e.name})]},e.id))})]})]}),(0,p.jsxs)(y.a,{bg:u,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:d,maxW:"600px",mx:"auto",w:"full",children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"Sta\u0148te se partnerem"}),(0,p.jsx)(U.E,{fontSize:"sm",color:m,mb:4,children:"M\xe1te z\xe1jem o spolupr\xe1ci? Kontaktujte n\xe1s."}),(0,p.jsx)("form",{onSubmit:v(e=>E((0,h.A)({},e))),children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsxs)(_.MJ,{isInvalid:!!A.name,size:"sm",children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Jm\xe9no"}),(0,p.jsx)(C.p,(0,h.A)((0,h.A)({size:"sm"},g("name",{required:"Vypl\u0148te pros\xedm jm\xe9no"})),{},{placeholder:"Jan Nov\xe1k"})),(0,p.jsx)(Yn.Wt,{fontSize:"xs",children:null===(e=A.name)||void 0===e?void 0:e.message})]}),(0,p.jsxs)(_.MJ,{isInvalid:!!A.email,size:"sm",children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"E\u2011mail"}),(0,p.jsx)(C.p,(0,h.A)((0,h.A)({size:"sm",type:"email"},g("email",{required:"Vypl\u0148te pros\xedm e\u2011mail"})),{},{placeholder:"vas@email.cz"})),(0,p.jsx)(Yn.Wt,{fontSize:"xs",children:null===(t=A.email)||void 0===t?void 0:t.message})]}),(0,p.jsxs)(_.MJ,{size:"sm",children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"P\u0159edm\u011bt"}),(0,p.jsx)(C.p,(0,h.A)((0,h.A)({size:"sm"},g("subject",{required:"P\u0159edm\u011bt je povinn\xfd"})),{},{placeholder:"Partnerstv\xed"})),(0,p.jsx)(Yn.Wt,{fontSize:"xs",children:null===(n=A.subject)||void 0===n?void 0:n.message})]}),(0,p.jsxs)(_.MJ,{isInvalid:!!A.message,size:"sm",children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Zpr\xe1va"}),(0,p.jsx)(va.T,(0,h.A)((0,h.A)({size:"sm",rows:3},g("message",{required:"Napi\u0161te pros\xedm kr\xe1tkou zpr\xe1vu"})),{},{placeholder:"R\xe1di bychom nav\xe1zali spolupr\xe1ci..."})),(0,p.jsx)(Yn.Wt,{fontSize:"xs",children:null===(a=A.message)||void 0===a?void 0:a.message})]}),(0,p.jsx)(T.$,{type:"submit",size:"sm",colorScheme:"brand",isLoading:N,w:"full",children:"Odeslat"})]})})]})]})})},Gi=async()=>{const{data:e}=await m.FH.get("/settings");return e},Xi=async e=>{const{data:t}=await m.FH.put("/settings",e);return t},Qi={id:"default",clubId:"",clubType:"",primaryColor:"#3182ce",theme:{primaryColor:"#3182ce",secondaryColor:"#2b6cb0",fontFamily:"Inter, sans-serif"},socialLinks:{},contactInfo:{address:"Ulice a \u010d\xedslo, M\u011bsto, PS\u010c",phone:"+420 123 456 789",email:"info@vas-klub.cz",website:"www.vas-klub.cz",workingHours:"Pond\u011bl\xed - P\xe1tek: 9:00 - 17:00"},features:{darkMode:!1,notifications:!0,analytics:!1},updatedAt:(new Date).toISOString(),createdAt:(new Date).toISOString()},eo=()=>{const e=(0,l.jE)(),{data:t=Qi,isLoading:n}=(0,xe.I)({queryKey:["settings"],queryFn:Gi,staleTime:3e5,onError:e=>{console.error("Failed to load settings:",e)}}),a=(0,Mn.n)({mutationFn:Xi,onSuccess:t=>{e.setQueryData(["settings"],e=>(0,h.A)((0,h.A)((0,h.A)({},Qi),e),t))}});return{settings:t,isLoading:n,updateTheme:e=>{a.mutate({theme:(0,h.A)((0,h.A)({},t.theme),e)})},updateSocialLinks:e=>{a.mutate({socialLinks:(0,h.A)((0,h.A)({},t.socialLinks),e)})},updateFeatures:e=>{a.mutate({features:(0,h.A)((0,h.A)({},t.features),e)})},updateSettings:a.mutateAsync,isUpdating:a.isLoading}},to=async()=>(await m.Ay.get("/admin/contacts/categories")).data,no=async()=>(await m.Ay.get("/admin/contacts")).data,ao=()=>{const e=(0,j.d)(),{settings:t}=eo(),n=(0,b.dU)("white","gray.800"),i=(0,b.dU)("gray.200","gray.700"),o=(0,b.dU)("white","gray.800"),r=(0,b.dU)("gray.200","gray.700"),[s,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0),{register:u,handleSubmit:x,reset:g,formState:{errors:v,isSubmitting:f}}=(0,Gn.mN)(),{mutate:k,isLoading:A}=(0,Mn.n)({mutationFn:e=>tt((0,h.A)((0,h.A)({},e),{},{source:"contact"})),onSuccess:()=>{g(),Dt(!0),Wt("Contact Form",!0),e({title:"Zpr\xe1va odesl\xe1na",description:"D\u011bkujeme za va\u0161i zpr\xe1vu. Brzy se v\xe1m ozveme zp\u011bt.",status:"success",duration:5e3,isClosable:!0})},onError:t=>{var n,a,i,o;const r=(null===t||void 0===t?void 0:t.code)||"",s=(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===t||void 0===t||null===(i=t.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.message),l="ECONNABORTED"===r||/timeout/i.test(String((null===t||void 0===t?void 0:t.message)||"")),c=!(null===t||void 0===t||!t.isAxiosError)&&!(null!==t&&void 0!==t&&t.response),d=s||(l?"Vypr\u0161el \u010dasov\xfd limit po\u017eadavku. Zkuste to pros\xedm znovu za chv\xedli.":c?"Po\u017eadavek se nezda\u0159il (s\xed\u0165/CORS). Zkuste to znovu nebo obnovte str\xe1nku.":"N\u011bco se pokazilo. Zkuste to pros\xedm znovu pozd\u011bji.");Dt(!1),Wt("Contact Form",!1),e({title:"Chyba",description:d,status:"error",duration:6e3,isClosable:!0})}});(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(async()=>(await m.Ay.get("/contacts")).data)();e&&l(t)}catch(t){console.error("Failed to load contacts",t)}finally{e&&d(!1)}})(),()=>{e=!1}},[]);return(0,p.jsxs)(Ht,{children:[(0,p.jsx)(Z.m,{maxW:"container.xl",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:8,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"xl",mb:4,children:"Kontakt"}),(()=>{const e=null===t||void 0===t?void 0:t.location_latitude,n=null===t||void 0===t?void 0:t.location_longitude,a=!!e&&!!n,i=Object.entries((null===s||void 0===s?void 0:s.categories)||{}),l=(null===s||void 0===s?void 0:s.uncategorized)||[],c=i.length>0||l.length>0,d=!!(null!==t&&void 0!==t&&t.contact_address||null!==t&&void 0!==t&&t.contact_phone||null!==t&&void 0!==t&&t.contact_email);return a||c||d?(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:8,children:[a&&(0,p.jsx)(y.a,{borderRadius:"lg",overflow:"hidden",boxShadow:"md",children:(0,p.jsx)(hi,{latitude:e,longitude:n,zoom:(null===t||void 0===t?void 0:t.map_zoom_level)||15,address:null===t||void 0===t?void 0:t.contact_address,clubName:(null===t||void 0===t?void 0:t.club_name)||(null===t||void 0===t?void 0:t.site_title),mapStyle:(null===t||void 0===t?void 0:t.map_style)||"default",clubPrimaryColor:null===t||void 0===t?void 0:t.primary_color,clubSecondaryColor:null===t||void 0===t?void 0:t.accent_color})}),(d||c)&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[d&&(0,p.jsxs)(y.a,{bg:o,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:r,boxShadow:"sm",children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Kontaktn\xed \xfadaje"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(null===t||void 0===t?void 0:t.contact_address)&&(0,p.jsxs)(ee.z,{align:"start",children:[(0,p.jsx)(jn.I,{as:q.HzC,boxSize:5,color:"blue.500",mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Adresa"}),(0,p.jsx)(U.E,{children:null===t||void 0===t?void 0:t.contact_address}),(null===t||void 0===t?void 0:t.contact_city)&&(0,p.jsxs)(U.E,{children:[(null===t||void 0===t?void 0:t.contact_zip)&&"".concat(null===t||void 0===t?void 0:t.contact_zip," "),null===t||void 0===t?void 0:t.contact_city]}),(null===t||void 0===t?void 0:t.contact_country)&&(0,p.jsx)(U.E,{children:null===t||void 0===t?void 0:t.contact_country})]})]}),(null===t||void 0===t?void 0:t.contact_phone)&&(0,p.jsxs)(ee.z,{align:"start",children:[(0,p.jsx)(jn.I,{as:q.QFc,boxSize:5,color:"blue.500",mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Telefon"}),(0,p.jsx)(L.N,{href:"tel:".concat(null===t||void 0===t?void 0:t.contact_phone),color:"blue.500",children:null===t||void 0===t?void 0:t.contact_phone})]})]}),(null===t||void 0===t?void 0:t.contact_email)&&(0,p.jsxs)(ee.z,{align:"start",children:[(0,p.jsx)(jn.I,{as:q.pHD,boxSize:5,color:"blue.500",mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Email"}),(0,p.jsx)(L.N,{href:"mailto:".concat(null===t||void 0===t?void 0:t.contact_email),color:"blue.500",children:null===t||void 0===t?void 0:t.contact_email})]})]})]})]}),c&&(0,p.jsxs)(y.a,{bg:o,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:r,boxShadow:"sm",children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Kontaktn\xed osoby"}),(0,p.jsxs)(ra.t,{colorScheme:"blue",isFitted:!0,children:[(0,p.jsxs)(sa.w,{children:[i.map(e=>{let[t]=e;return(0,p.jsx)(la.o,{children:t},t)}),l.length>0&&(0,p.jsx)(la.o,{children:"Ostatn\xed"})]}),(0,p.jsxs)(ca.T,{children:[i.map(e=>{let[t,n]=e;return(0,p.jsx)(da.K,{pt:4,children:(0,p.jsx)(Tt.r,{columns:{base:1,sm:2},spacing:4,children:n.map(e=>(0,p.jsx)(y.a,{bg:o,p:4,borderRadius:"md",borderWidth:"1px",borderColor:r,children:(0,p.jsxs)(w.T,{align:"start",spacing:3,children:[e.image_url&&(0,p.jsx)(ie.e,{src:e.image_url,name:e.name,size:"lg"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",children:e.name}),e.position&&(0,p.jsx)(Qt.E,{colorScheme:"blue",mt:1,children:e.position})]}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:e.description}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[e.email&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.pHD,color:"blue.500"}),(0,p.jsx)(L.N,{href:"mailto:".concat(e.email),color:"blue.500",fontSize:"sm",children:e.email})]}),e.phone&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.QFc,color:"blue.500"}),(0,p.jsx)(L.N,{href:"tel:".concat(e.phone),color:"blue.500",fontSize:"sm",children:e.phone})]})]})]})},e.id))})},t)}),l.length>0&&(0,p.jsx)(da.K,{pt:4,children:(0,p.jsx)(Tt.r,{columns:{base:1,sm:2},spacing:4,children:l.map(e=>(0,p.jsx)(y.a,{bg:o,p:4,borderRadius:"md",borderWidth:"1px",borderColor:r,children:(0,p.jsxs)(w.T,{align:"start",spacing:3,children:[e.image_url&&(0,p.jsx)(ie.e,{src:e.image_url,name:e.name,size:"lg"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",children:e.name}),e.position&&(0,p.jsx)(Qt.E,{colorScheme:"blue",mt:1,children:e.position})]}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:e.description}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[e.email&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.pHD,color:"blue.500"}),(0,p.jsx)(L.N,{href:"mailto:".concat(e.email),color:"blue.500",fontSize:"sm",children:e.email})]}),e.phone&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.QFc,color:"blue.500"}),(0,p.jsx)(L.N,{href:"tel:".concat(e.phone),color:"blue.500",fontSize:"sm",children:e.phone})]})]})]})},e.id))})})]})]})]})]})]}):null})()]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:2,color:(null===t||void 0===t?void 0:t.primaryColor)||"brand.500",children:"Kontaktujte n\xe1s"}),(0,p.jsx)(U.E,{color:"gray.500",children:"M\xe1te dotaz nebo p\u0159ipom\xednku? Napi\u0161te n\xe1m zpr\xe1vu a my se v\xe1m ozveme co nejd\u0159\xedve zp\u011bt."})]}),(0,p.jsx)(y.a,{bg:n,borderRadius:"lg",borderWidth:"1px",borderColor:i,boxShadow:"sm",p:6,children:(0,p.jsx)("form",{onSubmit:x(e=>{k(e)}),children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(_.MJ,{isInvalid:!!v.name,children:[(0,p.jsx)(S.l,{htmlFor:"name",children:"Jm\xe9no a p\u0159\xedjmen\xed *"}),(0,p.jsx)(C.p,(0,h.A)({id:"name",placeholder:"Jan Nov\xe1k"},u("name",{required:"Toto pole je povinn\xe9",minLength:{value:2,message:"Jm\xe9no mus\xed m\xedt alespo\u0148 2 znaky"}}))),(0,p.jsx)(Yn.Wt,{children:v.name&&v.name.message})]}),(0,p.jsxs)(_.MJ,{isInvalid:!!v.email,children:[(0,p.jsx)(S.l,{htmlFor:"email",children:"E-mailov\xe1 adresa *"}),(0,p.jsx)(C.p,(0,h.A)({id:"email",type:"email",placeholder:"vas@email.cz"},u("email",{required:"Toto pole je povinn\xe9",pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Neplatn\xe1 e-mailov\xe1 adresa"}}))),(0,p.jsx)(Yn.Wt,{children:v.email&&v.email.message})]}),(0,p.jsxs)(_.MJ,{isInvalid:!!v.subject,children:[(0,p.jsx)(S.l,{htmlFor:"subject",children:"P\u0159edm\u011bt"}),(0,p.jsx)(C.p,(0,h.A)({id:"subject",placeholder:"P\u0159edm\u011bt zpr\xe1vy"},u("subject",{required:"P\u0159edm\u011bt je povinn\xfd",maxLength:{value:100,message:"P\u0159edm\u011bt m\u016f\u017ee m\xedt maxim\xe1ln\u011b 100 znak\u016f"}}))),(0,p.jsx)(Yn.Wt,{children:v.subject&&v.subject.message})]}),(0,p.jsxs)(_.MJ,{isInvalid:!!v.message,children:[(0,p.jsx)(S.l,{htmlFor:"message",children:"Zpr\xe1va *"}),(0,p.jsx)(va.T,(0,h.A)({id:"message",rows:6,placeholder:"Napi\u0161te n\xe1m zpr\xe1vu..."},u("message",{required:"Toto pole je povinn\xe9",minLength:{value:10,message:"Zpr\xe1va mus\xed m\xedt alespo\u0148 10 znak\u016f"},maxLength:{value:2e3,message:"Zpr\xe1va m\u016f\u017ee m\xedt maxim\xe1ln\u011b 2000 znak\u016f"}}))),(0,p.jsx)(Yn.Wt,{children:v.message&&v.message.message})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:(null===t||void 0===t?void 0:t.primaryColor)||"brand",size:"lg",width:"full",mt:4,isLoading:A,loadingText:"Odes\xedl\xe1m...","data-umami-event":"Contact Form Submit",children:"Odeslat zpr\xe1vu"})]})})})]})}),(0,p.jsx)(Vt,{})]})},io=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},oo=()=>{const[e,t]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[o,r]=(0,a.useState)(""),[s,l]=(0,a.useState)("https://zonerama.com"),c=(0,b.dU)("#f8f9fb","#0f1115"),h=(0,b.dU)("white","#1a1d29"),u=(0,b.dU)("#e5e7eb","#2a2e3a"),m=(0,b.dU)("gray.800","gray.100"),x=(0,b.dU)("gray.600","gray.300"),g=(0,b.dU)("blue.50","blue.900"),v=(0,b.dU)("blue.200","blue.700"),j=(0,b.dU)("blue.800","blue.200"),f=(0,b.dU)("red.50","red.900"),_=(0,b.dU)("red.200","red.700"),S=(0,b.dU)("red.600","red.300");return(0,a.useEffect)(()=>{(async()=>{i(!0),r("");try{const[e,n]=await Promise.allSettled([fetch(io("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(io("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let a=[];if("fulfilled"===e.status&&e.value.ok){const t=await e.value.json();a=[...t.albums||[]],t.input_link&&l(t.input_link)}if("fulfilled"===n.status&&n.value.ok){const e=await n.value.json(),t=(Array.isArray(e)?e:[]).filter(e=>e.id&&e.title&&!a.some(t=>t.id===e.id));a=[...a,...t]}a.sort((e,t)=>{const n=e=>{if(!e)return new Date(0);const t=e.split(/[.\s]+/).filter(Boolean);if(3===t.length){const[e,n,a]=t;return new Date("".concat(a,"-").concat(n.padStart(2,"0"),"-").concat(e.padStart(2,"0")))}return new Date(e)};return n(t.date).getTime()-n(e.date).getTime()}),t(a)}catch(e){r(e.message||"Nepoda\u0159ilo se na\u010d\xedst alba")}finally{i(!1)}})()},[]),(0,p.jsxs)(Ht,{children:[(0,p.jsx)(y.a,{bg:c,minH:"100vh",py:8,children:(0,p.jsxs)(Z.m,{maxW:"7xl",children:[(0,p.jsxs)(w.T,{align:"stretch",spacing:6,mb:8,children:[(0,p.jsx)(z.D,{size:"2xl",color:m,children:"Fotogalerie"}),(0,p.jsx)(y.a,{bg:g,borderWidth:"1px",borderColor:v,borderRadius:"md",p:4,children:(0,p.jsxs)(U.E,{fontSize:"sm",color:j,children:["\ud83d\udcf8 V\u0161echny fotografie jsou z platformy"," ",(0,p.jsx)(U.E,{as:"a",href:"https://zonerama.com",target:"_blank",rel:"noopener noreferrer",fontWeight:"600",color:"blue.600",_hover:{textDecoration:"underline"},children:"Zonerama"})]})})]}),n&&(0,p.jsxs)(w.T,{spacing:4,py:12,children:[(0,p.jsx)(zn.y,{size:"xl",color:"brand.primary"}),(0,p.jsx)(U.E,{color:x,children:"Na\u010d\xedt\xe1m alba..."})]}),o&&!n&&(0,p.jsx)(y.a,{bg:f,borderWidth:"1px",borderColor:_,borderRadius:"md",p:4,textAlign:"center",children:(0,p.jsx)(U.E,{color:S,children:o})}),!n&&!o&&0===e.length&&(0,p.jsx)(y.a,{bg:h,borderWidth:"1px",borderColor:u,borderRadius:"lg",p:12,textAlign:"center",children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(Kn.A,{size:48,color:"gray"}),(0,p.jsx)(z.D,{size:"md",color:x,children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 alba"}),(0,p.jsx)(U.E,{color:x,children:"Alba se zde zobraz\xed po jejich na\u010dten\xed ze Zonerama."})]})}),!n&&!o&&e.length>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:e.map(e=>{const t=e.photos&&e.photos.length>0?e.photos[0]:null;return(0,p.jsxs)(y.a,{as:d.N_,to:"/galerie/album/".concat(e.id),bg:h,borderRadius:"lg",overflow:"hidden",boxShadow:"md",borderWidth:"1px",borderColor:u,transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:(0,b.dU)("gray.300","gray.600")},cursor:"pointer",children:[t?(0,p.jsx)(k._,{src:io(t.image_1500),alt:e.title,w:"100%",h:"250px",objectFit:"cover",loading:"lazy"}):(0,p.jsx)(y.a,{w:"100%",h:"250px",bg:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(Kn.A,{size:48,color:"gray"})}),(0,p.jsxs)(w.T,{align:"stretch",p:4,spacing:3,children:[(0,p.jsx)(z.D,{size:"md",color:m,noOfLines:2,children:e.title}),(0,p.jsxs)(ee.z,{spacing:4,flexWrap:"wrap",fontSize:"sm",color:x,children:[e.date&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(qn.A,{size:16}),(0,p.jsx)(U.E,{children:e.date})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Kn.A,{size:16}),(0,p.jsxs)(U.E,{children:[e.photos_count," foto"]})]})]}),void 0!==e.views_count&&e.views_count>0&&(0,p.jsx)(ee.z,{children:(0,p.jsxs)(Qt.E,{colorScheme:"purple",fontSize:"xs",children:[e.views_count," zhl\xe9dnut\xed"]})})]})]},e.id)})}),(0,p.jsx)(y.a,{textAlign:"center",mt:8,children:(0,p.jsx)(T.$,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,p.jsx)(ri.A,{size:18}),colorScheme:"blue",size:"lg",variant:"outline",children:"Zobrazit dal\u0161\xed alba na Zonerama"})})]})]})}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})};var ro=n(8326),so=n(7104);const lo=e=>{let{isOpen:t,onClose:n,photoUrl:a,pageUrl:i,albumTitle:o}=e;const r=(0,j.d)();return(0,p.jsxs)(se.aF,{isOpen:t,onClose:n,size:"6xl",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.800",backdropFilter:"blur(10px)"}),(0,p.jsxs)(le.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,p.jsx)(B.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.800"},size:"lg",top:2,right:2,zIndex:2}),(0,p.jsx)(Y.c,{p:0,children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsx)(y.a,{position:"relative",borderRadius:"lg",overflow:"hidden",maxH:"80vh",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(k._,{src:a,alt:o||"Fotka",maxH:"80vh",maxW:"100%",objectFit:"contain",loading:"lazy"})}),(0,p.jsx)(y.a,{bg:"bg.elevated",borderWidth:"1px",borderColor:"border.subtle",borderRadius:"lg",p:4,boxShadow:"xl",children:(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[o&&(0,p.jsx)(U.E,{fontSize:"md",fontWeight:"600",color:"gray.700",children:o}),(0,p.jsx)(ee.z,{spacing:2,justify:"space-between",flexWrap:"wrap",children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(so.A,{size:18}),onClick:async()=>{try{const e=await fetch((e=>"".concat(m.API_URL,"/gallery/proxy-image?url=").concat(encodeURIComponent(e)))(a));if(!e.ok)throw new Error("Failed to fetch image");const t=await e.blob(),n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download="fotka-".concat(Date.now(),".jpg"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n),r({title:"Stahov\xe1n\xed zah\xe1jeno",description:"Fotka se stahuje",status:"success",duration:2e3,isClosable:!0})}catch(e){console.error("Failed to download image:",e),r({title:"Chyba",description:"Nepoda\u0159ilo se st\xe1hnout obr\xe1zek",status:"error",duration:2e3,isClosable:!0})}},colorScheme:"green",size:"sm",children:"St\xe1hnout"}),(0,p.jsx)(T.$,{as:"a",href:i,target:"_blank",rel:"noopener noreferrer",leftIcon:(0,p.jsx)(ri.A,{size:18}),colorScheme:"purple",size:"sm",children:"Zobrazit origin\xe1l"})]})}),(0,p.jsx)(y.a,{pt:2,borderTopWidth:"1px",borderColor:"gray.200",children:(0,p.jsx)(ee.z,{spacing:2,fontSize:"xs",color:"gray.500",children:(0,p.jsxs)(U.E,{children:["\xa9 Fotografie z"," ",(0,p.jsx)(U.E,{as:"a",href:"https://zonerama.com",target:"_blank",rel:"noopener noreferrer",color:"blue.500",fontWeight:"600",_hover:{textDecoration:"underline"},children:"Zonerama"})]})})})]})})]})})]})]})},co=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},ho=()=>{const{id:e}=(0,c.g)(),[t,n]=(0,a.useState)(null),[i,o]=(0,a.useState)(!0),[r,s]=(0,a.useState)(""),[l,h]=(0,a.useState)(null),{isOpen:u,onOpen:m,onClose:x}=(0,X.j)(),g=(0,b.dU)("#f8f9fb","#0f1115"),v=(0,b.dU)("white","#1a1d29"),j=(0,b.dU)("#e5e7eb","#2a2e3a"),f=(0,b.dU)("gray.800","gray.100"),_=(0,b.dU)("gray.600","gray.300"),S=(0,b.dU)("blue.50","blue.900"),C=(0,b.dU)("blue.200","blue.700"),A=(0,b.dU)("blue.800","blue.200");(0,a.useEffect)(()=>{(async()=>{if(e){o(!0),s("");try{const[t,a]=await Promise.allSettled([fetch(co("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(co("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let i=null;if("fulfilled"===t.status&&t.value.ok){const n=await t.value.json();i=(n.albums||[]).find(t=>t.id===e)}if(!i&&"fulfilled"===a.status&&a.value.ok){const t=await a.value.json();i=(Array.isArray(t)?t:[]).find(t=>t.id===e)}if(!i)throw new Error("Album nenalezen");n(i)}catch(t){s(t.message||"Chyba p\u0159i na\u010d\xedt\xe1n\xed alba")}finally{o(!1)}}})()},[e]);return i?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl",color:"brand.primary"}),(0,p.jsx)(U.E,{color:_,children:"Na\u010d\xedt\xe1m album..."})]})})}):r||!t?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(U.E,{color:"red.500",fontSize:"lg",children:r||"Album nenalezeno"}),(0,p.jsx)(T.$,{as:d.N_,to:"/galerie",colorScheme:"blue",children:"Zp\u011bt na galerii"})]})})}):(0,p.jsxs)(Ht,{children:[(0,p.jsx)(y.a,{bg:g,minH:"100vh",py:8,children:(0,p.jsxs)(Z.m,{maxW:"7xl",children:[(0,p.jsxs)(ji.Q,{spacing:2,separator:(0,p.jsx)(ro.A,{size:16,color:"gray"}),mb:6,fontSize:"sm",children:[(0,p.jsx)(bi.J,{children:(0,p.jsx)(yi.w,{as:d.N_,to:"/",children:"Dom\u016f"})}),(0,p.jsx)(bi.J,{children:(0,p.jsx)(yi.w,{as:d.N_,to:"/galerie",children:"Galerie"})}),(0,p.jsx)(bi.J,{isCurrentPage:!0,children:(0,p.jsx)(yi.w,{children:t.title})})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:8,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",flexWrap:"wrap",gap:4,children:[(0,p.jsxs)(w.T,{align:"start",spacing:2,flex:1,children:[(0,p.jsx)(z.D,{size:"xl",color:f,children:t.title}),(0,p.jsxs)(ee.z,{spacing:4,flexWrap:"wrap",fontSize:"sm",color:_,children:[t.date&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(qn.A,{size:16}),(0,p.jsx)(U.E,{children:t.date})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Kn.A,{size:16}),(0,p.jsxs)(U.E,{children:[t.photos_count," fotografi\xed"]})]}),void 0!==t.views_count&&t.views_count>0&&(0,p.jsxs)(Qt.E,{colorScheme:"purple",children:[t.views_count," zhl\xe9dnut\xed"]})]})]}),(0,p.jsx)(T.$,{as:"a",href:t.url,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,p.jsx)(ri.A,{size:18}),colorScheme:"purple",size:"md",children:"Zobrazit na Zonerama"})]}),(0,p.jsx)(y.a,{bg:S,borderWidth:"1px",borderColor:C,borderRadius:"md",p:3,children:(0,p.jsxs)(U.E,{fontSize:"sm",color:A,children:["\ud83d\udcf8 V\u0161echny fotografie jsou z platformy"," ",(0,p.jsx)(U.E,{as:"a",href:"https://zonerama.com",target:"_blank",rel:"noopener noreferrer",fontWeight:"600",color:"blue.600",_hover:{textDecoration:"underline"},children:"Zonerama"})]})})]}),t.photos&&t.photos.length>0?(0,p.jsx)(Tt.r,{columns:{base:2,md:3,lg:4,xl:5},spacing:4,children:t.photos.map(e=>(0,p.jsx)(y.a,{cursor:"pointer",onClick:()=>(e=>{h(e),m()})(e),borderRadius:"lg",overflow:"hidden",boxShadow:"md",borderWidth:"1px",borderColor:j,transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:(0,b.dU)("gray.300","gray.600")},bg:v,children:(0,p.jsx)(k._,{src:co(e.image_1500),alt:"Fotka ".concat(e.id),w:"100%",h:"200px",objectFit:"cover",loading:"lazy"})},e.id))}):(0,p.jsx)(y.a,{bg:"bg.card",borderWidth:"1px",borderColor:"border.subtle",borderRadius:"lg",p:8,textAlign:"center",children:(0,p.jsx)(U.E,{color:"gray.500",children:"V tomto albu nejsou \u017e\xe1dn\xe9 fotografie."})})]})}),l&&(0,p.jsx)(lo,{isOpen:u,onClose:()=>{x(),h(null)},photoUrl:co(l.image_1500),pageUrl:l.page_url,albumTitle:t.title})]})};var uo=n(464);const mo=()=>{const[e,t]=(0,a.useState)(""),[n,i]=(0,a.useState)(""),[o,r]=(0,a.useState)(""),[s,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[h,u]=(0,a.useState)("email"),x=(0,j.d)(),g=async t=>{if(t.preventDefault(),e){d(!0);try{await m.Ay.post("/auth/initiate-password-reset",{email:e}),u("code"),x({title:"K\xf3d odesl\xe1n",description:"Ov\u011b\u0159ovac\xed k\xf3d byl odesl\xe1n na v\xe1\u0161 e-mail.",status:"success",duration:5e3,isClosable:!0})}catch(i){var n,a;x({title:"Chyba",description:(null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se odeslat ov\u011b\u0159ovac\xed k\xf3d",status:"error",duration:5e3,isClosable:!0})}finally{d(!1)}}},v=async t=>{if(t.preventDefault(),6===n.length){d(!0);try{await m.Ay.post("/auth/verify-reset-code",{email:e,code:n}),u("new_password")}catch(o){var a,i;x({title:"Chyba",description:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Neplatn\xfd ov\u011b\u0159ovac\xed k\xf3d",status:"error",duration:5e3,isClosable:!0})}finally{d(!1)}}},b=async t=>{if(t.preventDefault(),o===s)if(o.length<8)x({title:"Chyba",description:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f",status:"error",duration:5e3,isClosable:!0});else{d(!0);try{await m.Ay.post("/auth/complete-password-reset",{email:e,code:n,new_password:o}),u("success"),x({title:"\xdasp\u011bch",description:"Va\u0161e heslo bylo \xfasp\u011b\u0161n\u011b zm\u011bn\u011bno. Nyn\xed se m\u016f\u017eete p\u0159ihl\xe1sit.",status:"success",duration:5e3,isClosable:!0})}catch(r){var a,i;x({title:"Chyba",description:(null===(a=r.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Nepoda\u0159ilo se zm\u011bnit heslo",status:"error",duration:5e3,isClosable:!0})}finally{d(!1)}}else x({title:"Chyba",description:"Hesla se neshoduj\xed",status:"error",duration:5e3,isClosable:!0})};return(0,p.jsx)(y.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.50",p:4,children:(0,p.jsx)(y.a,{w:"100%",maxW:"md",p:8,bg:"white",borderWidth:1,borderRadius:8,boxShadow:"lg",children:(()=>{switch(h){case"email":return(0,p.jsxs)(w.T,{as:"form",onSubmit:g,spacing:4,align:"stretch",children:[(0,p.jsx)(z.D,{as:"h2",size:"lg",textAlign:"center",mb:4,children:"Obnova hesla"}),(0,p.jsx)(U.E,{textAlign:"center",mb:4,children:"Zadejte e-mailovou adresu va\u0161eho \xfa\u010dtu. Po\u0161leme v\xe1m ov\u011b\u0159ovac\xed k\xf3d pro obnovu hesla."}),(0,p.jsxs)(_.MJ,{id:"email",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"E-mail"}),(0,p.jsx)(C.p,{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"vas@email.cz",size:"lg"})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",size:"lg",isLoading:c,loadingText:"Odes\xedl\xe1n\xed...",children:"Odeslat ov\u011b\u0159ovac\xed k\xf3d"})]});case"code":return(0,p.jsxs)(w.T,{as:"form",onSubmit:v,spacing:6,align:"center",children:[(0,p.jsx)(z.D,{as:"h2",size:"lg",textAlign:"center",children:"Ov\u011b\u0159te svou identitu"}),(0,p.jsxs)(U.E,{textAlign:"center",children:["Zadejte 6m\xedstn\xfd ov\u011b\u0159ovac\xed k\xf3d, kter\xfd jsme zaslali na adresu ",e]}),(0,p.jsx)(ee.z,{spacing:3,justify:"center",children:(0,p.jsx)(uo.c,{value:n,onChange:e=>i(e),isDisabled:c,autoFocus:!0,otp:!0,children:[...Array(6)].map((e,t)=>(0,p.jsx)(uo.M,{},t))})}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",size:"lg",isDisabled:6!==n.length,isLoading:c,loadingText:"Ov\u011b\u0159ov\xe1n\xed...",width:"100%",children:"Ov\u011b\u0159it k\xf3d"}),(0,p.jsx)(T.$,{variant:"link",onClick:()=>u("email"),isDisabled:c,children:"Zm\u011bnit e-mail"})]});case"new_password":return(0,p.jsxs)(w.T,{as:"form",onSubmit:b,spacing:4,align:"stretch",children:[(0,p.jsx)(z.D,{as:"h2",size:"lg",textAlign:"center",children:"Nastaven\xed nov\xe9ho hesla"}),(0,p.jsxs)(U.E,{textAlign:"center",mb:4,children:["Zadejte nov\xe9 heslo pro v\xe1\u0161 \xfa\u010det ",e]}),(0,p.jsxs)(_.MJ,{id:"newPassword",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Nov\xe9 heslo"}),(0,p.jsx)(C.p,{type:"password",value:o,onChange:e=>r(e.target.value),placeholder:"Zadejte nov\xe9 heslo",size:"lg"})]}),(0,p.jsxs)(_.MJ,{id:"confirmPassword",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Potvrzen\xed hesla"}),(0,p.jsx)(C.p,{type:"password",value:s,onChange:e=>l(e.target.value),placeholder:"Zadejte heslo znovu",size:"lg"})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",size:"lg",isLoading:c,loadingText:"Ukl\xe1d\xe1n\xed...",isDisabled:!o||o!==s,children:"Nastavit nov\xe9 heslo"})]});case"success":return(0,p.jsxs)(w.T,{spacing:6,textAlign:"center",children:[(0,p.jsx)(y.a,{p:4,bg:"green.50",borderRadius:"md",width:"100%",children:(0,p.jsx)(U.E,{color:"green.800",fontWeight:"medium",children:"Va\u0161e heslo bylo \xfasp\u011b\u0161n\u011b zm\u011bn\u011bno!"})}),(0,p.jsx)(U.E,{children:"Nyn\xed se m\u016f\u017eete p\u0159ihl\xe1sit pomoc\xed sv\xe9ho nov\xe9ho hesla."}),(0,p.jsx)(T.$,{as:"a",href:"/login",colorScheme:"blue",size:"lg",width:"100%",children:"P\u0159ej\xedt na p\u0159ihl\xe1\u0161en\xed"})]});default:return null}})()})})},po=()=>{const[e]=(0,d.ok)(),t=(0,c.Zp)(),n=e.get("token")||"",[i,o]=(0,a.useState)(""),[r,s]=(0,a.useState)(""),[l,h]=(0,a.useState)(!1),u=(0,j.d)();(0,a.useEffect)(()=>{n||u({title:"Chyb\xed token",description:"Odkaz pro reset je neplatn\xfd.",status:"error"})},[n,u]);return(0,p.jsx)(y.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(y.a,{w:"100%",maxW:"md",p:8,borderWidth:1,borderRadius:8,boxShadow:"lg",children:(0,p.jsxs)(w.T,{as:"form",onSubmit:async e=>{if(e.preventDefault(),i.length<8)u({title:"Slab\xe9 heslo",description:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f.",status:"warning"});else if(i===r){h(!0);try{await m.Ay.post("/auth/reset-password",{token:n,new_password:i}),u({title:"Hotovo",description:"Heslo bylo zm\u011bn\u011bno. P\u0159ihlaste se nov\xfdm heslem.",status:"success"}),t("/login")}catch(s){var a,o;u({title:"Chyba",description:(null===(a=s.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.error)||"Reset hesla se nezda\u0159il.",status:"error"})}finally{h(!1)}}else u({title:"Nesoulad hesel",description:"Hesla se neshoduj\xed.",status:"warning"})},spacing:4,align:"stretch",children:[(0,p.jsx)(z.D,{as:"h2",size:"lg",textAlign:"center",children:"Nastavit nov\xe9 heslo"}),!n&&(0,p.jsx)(U.E,{textAlign:"center",color:"red.500",children:"Chyb\xed token v URL. Zkontrolujte odkaz v e-mailu."}),(0,p.jsxs)(_.MJ,{id:"password",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Nov\xe9 heslo"}),(0,p.jsx)(C.p,{type:"password",value:i,onChange:e=>o(e.target.value),placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"})]}),(0,p.jsxs)(_.MJ,{id:"confirm",isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Potvrzen\xed hesla"}),(0,p.jsx)(C.p,{type:"password",value:r,onChange:e=>s(e.target.value),placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",isLoading:l,isDisabled:!n,children:"Zm\u011bnit heslo"})]})})})},xo=["Po","\xdat","St","\u010ct","P\xe1","So","Ne"],go=e=>"match"===e?"Z\xe1pas":"training"===e?"Tr\xe9nink":"meeting"===e?"Sch\u016fzka":"Jin\xe9",vo=e=>"match"===e?"red":"training"===e?"blue":"meeting"===e?"green":"gray",jo=e=>{try{return(0,Ei.GP)(new Date(e),"yyyy-MM-dd")}catch(t){return e.slice(0,10)}},bo=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(null),[o,r]=(0,a.useState)([]),[s,l]=(0,a.useState)("all"),[c,h]=(0,a.useState)("calendar"),u=((0,j.d)(),(0,b.dU)("gray.600","gray.300")),m=(0,b.dU)("gray.500","gray.400"),x=(0,b.dU)("rgba(0,0,0,0.08)","rgba(255,255,255,0.16)"),g=(0,b.dU)("white","gray.800"),v=(0,b.dU)("rgba(0,0,0,0.03)","rgba(255,255,255,0.08)"),f=(0,b.dU)("gray.50","whiteAlpha.100"),k=(0,b.dU)("rgba(59,130,246,0.08)","rgba(59,130,246,0.16)"),[w,_]=(0,a.useState)((0,Si.w)(new Date)),S=(0,a.useMemo)(()=>{const e=(0,Ci.k)((0,Si.w)(w),{weekStartsOn:1}),t=[];for(let n=0;n<42;n++)t.push(new Date(e.getTime()+864e5*n));return t},[w]),C=(0,a.useMemo)(()=>"all"===s?o:o.filter(e=>e.type===s),[o,s]),A=(0,a.useMemo)(()=>{const e=new Map;return C.forEach(t=>{const n=jo(t.start_time),a=t.end_time?jo(t.end_time):n;if(n===a)return void e.set(n,[...e.get(n)||[],t]);const i=new Date(n),o=new Date(a);if(Number.isNaN(i.getTime())||Number.isNaN(o.getTime()))e.set(n,[...e.get(n)||[],t]);else for(let r=new Date(i);r.getTime()<=o.getTime();r.setDate(r.getDate()+1)){const n=(0,Ei.GP)(r,"yyyy-MM-dd");e.set(n,[...e.get(n)||[],t])}}),Array.from(e.keys()).forEach(t=>{const n=e.get(t)||[];n.sort((e,t)=>new Date(e.start_time).getTime()-new Date(t.start_time).getTime()),e.set(t,n)}),e},[C]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{t(!0),i(null);try{const t=(await dt()||[]).map(e=>({id:e.id,title:e.title,start_time:e.start_time,end_time:e.end_time,location:e.location,type:e.type,image_url:e.image_url}));e&&r(t)}catch(n){e&&i((null===n||void 0===n?void 0:n.message)||"Nepoda\u0159ilo se na\u010d\xedst aktivity.")}finally{e&&t(!1)}})(),()=>{e=!1}},[]);const E=C.length>0;return(0,p.jsx)(Ht,{children:(0,p.jsxs)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,children:"Aktivity"}),(0,p.jsx)(U.E,{color:u,mb:6,children:"Kalend\xe1\u0159 tr\xe9nink\u016f, sch\u016fzek a dal\u0161\xedch klubov\xfdch aktivit."}),(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,p.jsx)(Q.s,{align:"center",gap:2,children:(0,p.jsxs)(ha.l,{size:"sm",value:s,onChange:e=>l(e.target.value),width:{base:"100%",sm:"220px"},children:[(0,p.jsx)("option",{value:"all",children:"V\u0161echny typy"}),(0,p.jsx)("option",{value:"match",children:"Z\xe1pasy"}),(0,p.jsx)("option",{value:"training",children:"Tr\xe9ninky"}),(0,p.jsx)("option",{value:"meeting",children:"Sch\u016fzky"}),(0,p.jsx)("option",{value:"other",children:"Ostatn\xed"})]})}),(0,p.jsxs)(_i.e,{size:"sm",isAttached:!0,children:[(0,p.jsx)(T.$,{variant:"calendar"===c?"solid":"outline",bg:"calendar"===c?"brand.primary":void 0,color:"calendar"===c?"text.onPrimary":void 0,_hover:{filter:"calendar"===c?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"calendar"===c?"text.onPrimary":void 0},onClick:()=>h("calendar"),children:"Kalend\xe1\u0159"}),(0,p.jsx)(T.$,{variant:"list"===c?"solid":"outline",bg:"list"===c?"brand.primary":void 0,color:"list"===c?"text.onPrimary":void 0,_hover:{filter:"list"===c?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"list"===c?"text.onPrimary":void 0},onClick:()=>h("list"),children:"Seznam"})]})]}),e&&(0,p.jsxs)(Q.s,{align:"center",gap:3,color:u,mb:6,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)("span",{children:"Na\u010d\xedt\xe1m aktivity\u2026"})]}),n&&(0,p.jsx)(y.a,{color:"red.400",mb:4,children:n}),!e&&!E&&!n&&(0,p.jsx)(y.a,{color:u,children:"Zat\xedm nem\xe1me \u017e\xe1dn\xe9 aktivity k zobrazen\xed."}),!e&&E&&("calendar"===c?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,p.jsx)(K.K,{"aria-label":"P\u0159edchoz\xed m\u011bs\xedc",size:"sm",onClick:()=>_((0,Ai.P)(w,-1)),icon:(0,p.jsx)(tn.Y,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>_(new Date),variant:"solid",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Dnes"}),(0,p.jsx)(K.K,{"aria-label":"Dal\u0161\xed m\u011bs\xedc",size:"sm",onClick:()=>_((0,Ai.P)(w,1)),icon:(0,p.jsx)(nn.v,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}})]}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsx)(wi.x,{templateColumns:"repeat(7, 1fr)",gap:3,minW:"980px",children:xo.map(e=>(0,p.jsx)(y.a,{textAlign:"center",fontWeight:"semibold",color:u,fontSize:{base:"xs",md:"sm"},children:e},e))})}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsx)(wi.x,{templateColumns:"repeat(7, 1fr)",gap:{base:1,md:2},minW:"980px",children:S.map((e,t)=>{const n=(0,Ei.GP)(e,"yyyy-MM-dd"),a=A.get(n)||[],i=!(0,Ti.t)(e,w),o=(0,Ni.r)(e,new Date);return(0,p.jsxs)(y.a,{borderWidth:"1px",borderColor:o?"brand.primary":x,borderRadius:"md",p:2,minH:"120px",minW:"130px",bg:o?k:void 0,opacity:i?.6:1,children:[(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:(0,Ei.GP)(e,"d")}),!!a.length&&(0,p.jsx)(Qt.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"full",children:a.length})]}),(0,p.jsxs)(At.B,{spacing:2,children:[a.slice(0,3).map(e=>(0,p.jsxs)(y.a,{as:d.N_,to:"/aktivita/".concat(e.id),p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"rgba(0,0,0,0.03)",borderColor:"brand.primary"},children:[(0,p.jsxs)(Q.s,{align:"center",gap:2,children:[(0,p.jsx)(Qt.E,{colorScheme:vo(e.type),children:go(e.type)}),(0,p.jsxs)(U.E,{fontSize:"xs",children:[(0,Ei.GP)(new Date(e.start_time),"HH:mm"),e.end_time&&!(0,Ni.r)(new Date(e.start_time),new Date(e.end_time))?" \u2013 ".concat((0,Ei.GP)(new Date(e.end_time),"d.M.")):e.end_time?" \u2013 ".concat((0,Ei.GP)(new Date(e.end_time),"HH:mm")):""]})]}),(0,p.jsx)(U.E,{fontSize:"sm",mt:1,children:e.title})]},e.id)),a.length>3&&(0,p.jsxs)(U.E,{fontSize:"xs",color:m,children:["+",a.length-3," dal\u0161\xed\u2026"]})]})]},t)})})})]}):(0,p.jsx)(At.B,{spacing:4,children:Array.from(A.keys()).sort().map(e=>{const t=A.get(e)||[];return(0,p.jsxs)(y.a,{borderWidth:"1px",borderColor:x,borderRadius:"md",overflow:"hidden",bg:g,children:[(0,p.jsx)(y.a,{px:3,py:2,bg:f,borderLeftWidth:"4px",borderLeftColor:"brand.primary",children:(0,p.jsxs)(Q.s,{align:"center",gap:2,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:(0,Ei.GP)(new Date(e),"EEEE d. M. yyyy",{locale:Ri.cs})}),(0,p.jsx)(Qt.E,{colorScheme:"purple",borderRadius:"full",children:t.length})]})}),(0,p.jsx)(At.B,{spacing:3,children:t.map(e=>(0,p.jsxs)(Q.s,{as:d.N_,to:"/aktivita/".concat(e.id),align:"center",justify:"space-between",p:3,borderWidth:"1px",borderColor:x,borderRadius:"md",bg:g,_hover:{bg:v,borderColor:"brand.primary"},children:[(0,p.jsxs)(Q.s,{direction:"column",minW:"200px",children:[(0,p.jsxs)(U.E,{fontWeight:"semibold",children:[(0,Ei.GP)(new Date(e.start_time),"HH:mm"),e.end_time&&!(0,Ni.r)(new Date(e.start_time),new Date(e.end_time))?" \u2013 ".concat((0,Ei.GP)(new Date(e.end_time),"d.M. HH:mm")):e.end_time?" \u2013 ".concat((0,Ei.GP)(new Date(e.end_time),"HH:mm")):""]}),e.location&&(0,p.jsx)(U.E,{color:u,fontSize:"sm",children:e.location})]}),(0,p.jsxs)(Q.s,{align:"center",gap:2,flex:"1",justify:"center",children:[(0,p.jsx)(Qt.E,{colorScheme:vo(e.type),children:go(e.type)}),(0,p.jsx)(U.E,{children:e.title})]})]},e.id))})]},e)})}))]})})};var yo=n(4217),fo=n(3332),ko=n(8149),zo=n(4085),wo=n(3430),_o=n(4334);const So=e=>{let{icon:t,to:n,children:a,onClick:i}=e;const o=(0,c.zy)(),r=!!n&&o.pathname.startsWith(n),s=(0,b.dU)("blue.50","blue.900"),l=(0,b.dU)("blue.600","blue.300"),u=n?d.N_:"a",m=n?{to:n}:{href:"#"};return(0,p.jsxs)(L.N,(0,h.A)((0,h.A)({as:u},m),{},{display:"flex",alignItems:"center",px:3,py:2.5,borderRadius:"lg",bg:r?s:"transparent",color:r?l:"inherit",fontWeight:r?"semibold":"medium",fontSize:"sm",_hover:{textDecoration:"none",bg:r?s:(0,b.dU)("gray.100","gray.700"),transform:"translateX(2px)"},transition:"all 0.2s ease",onClick:e=>{!i||(i(e),e.isDefaultPrevented())},"data-navitem":"true","data-active":r?"true":void 0,position:"relative",_before:r?{content:'""',position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:"3px",height:"60%",bg:l,borderRadius:"full"}:{},children:[(0,p.jsx)(jn.I,{as:t,mr:3,boxSize:4}),(0,p.jsx)(U.E,{flex:1,children:a})]}))},Co=e=>{let{isOpen:t,onClose:n,bg:i,borderRight:o="1px",borderColor:r}=e;const{logout:s,user:l}=v(),{data:d}=ge(),h="admin"===(null===l||void 0===l?void 0:l.role),u=(0,b.dU)("white","#1a1d29"),m=(0,b.dU)("gray.200","rgba(255, 255, 255, 0.12)"),x=((0,b.dU)("gray.800","#e2e8f0"),i||u),g=r||m,{data:j}=(0,xe.I)({queryKey:["admin-sidebar-upcoming-events"],queryFn:lt}),f=Array.isArray(j)?j.length:0,z=(0,a.useRef)(null),_=(0,c.zy)(),S="admin-sidebar-scroll",[C,A]=(0,a.useState)([]),[E,T]=(0,a.useState)(!0),N=(0,a.useMemo)(()=>C.some(e=>"shortlinks"===e.page_type||"/admin/shortlinks"===e.url),[C]);(0,a.useEffect)(()=>{const e=z.current;if(!e)return;const t=sessionStorage.getItem(S);if(t)try{const n=parseInt(t,10);Number.isNaN(n)||(e.scrollTop=n)}catch(n){}},[]);const R=(0,a.useCallback)(()=>{const e=z.current;e&&sessionStorage.setItem(S,String(e.scrollTop))},[]);return(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const n=await it();if(e&&Array.isArray(n)){const a=n.filter(e=>e.requires_admin);if(0===a.length&&h)try{console.log("Admin navigation empty, auto-seeding..."),await st();const t=await it();if(e&&Array.isArray(t)){const e=t.filter(e=>e.requires_admin);A(e)}}catch(t){console.error("Auto-seed failed:",t),A(a)}else A(a)}}catch(n){console.error("Failed to load admin navigation:",n)}finally{e&&T(!1)}})(),()=>{e=!1}},[h]),(0,a.useEffect)(()=>{const e=z.current;if(!e)return;const t=e.querySelector('[data-navitem][data-active="true"]');if(t){const n=e.getBoundingClientRect(),a=t.getBoundingClientRect();a.top>=n.top&&a.bottom<=n.bottom||t.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[_.pathname]),(0,p.jsx)(y.a,{as:"nav",position:"fixed",left:0,top:0,bottom:0,width:"260px",bg:x,borderRightWidth:o,borderColor:g,pt:5,display:{base:t?"block":"none",md:"block"},zIndex:10,overflowY:"auto",overflowX:"hidden",boxShadow:"lg",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",ref:z,onScroll:R,css:{"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:(0,b.dU)("gray.300","gray.600"),borderRadius:"2px"},"&::-webkit-scrollbar-thumb:hover":{background:(0,b.dU)("gray.400","gray.500")}},children:(0,p.jsxs)(w.T,{align:"stretch",spacing:1,px:3,pb:6,children:[(0,p.jsx)(y.a,{px:3,mb:8,children:(0,p.jsxs)(Q.s,{align:"center",gap:3,mb:2,children:[(0,p.jsx)(k._,{src:W(null===d||void 0===d?void 0:d.club_logo_url)||(null===d||void 0===d?void 0:d.club_logo_url)||"/dist/img/logo-club-empty.svg",alt:"Club Logo",boxSize:"48px",objectFit:"contain",fallbackSrc:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%23e2e8f0'/%3E%3Ctext x='50' y='55' text-anchor='middle' font-size='40' fill='%23718096'%3EMC%3C/text%3E%3C/svg%3E",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"xl",fontWeight:"extrabold",color:(0,b.dU)("gray.800","white"),letterSpacing:"tight",children:"My Club"}),(0,p.jsx)(U.E,{fontSize:"xs",color:(0,b.dU)("gray.500","gray.400"),fontWeight:"semibold",textTransform:"uppercase",letterSpacing:"wider",children:"Admin Panel"})]})]})}),(0,p.jsx)(So,{icon:pe.rQ8,to:"/",onClick:n,children:"Zp\u011bt na web"}),(0,p.jsx)(G.c,{my:2}),E?(0,p.jsx)(Q.s,{justify:"center",py:8,children:(0,p.jsx)(zn.y,{size:"sm"})}):C.length>0?(0,p.jsxs)(p.Fragment,{children:[C.filter(e=>e.visible).map((e,t)=>{const a=(i=e.page_type,{dashboard:pe.$BV,analytics:pe.v$b,teams:pe.YXz,matches:pe.bfZ,activities:pe.bfZ,players:pe.i0U,articles:pe.Nhm,categories:pe.t69,about:pe.vd0,videos:pe.HiP,gallery:pe.dkL,scoreboard:pe.$BV,scoreboard_remote:pe.rle,clothing:pe.umw,sponsors:pe.DDN,banners:pe.sdT,messages:pe.maD,contacts:pe.toK,newsletter:pe.Cer,polls:pe.l2R,navigation:pe.OXb,competition_aliases:pe.Z0L,prefetch:pe.KP4,users:pe.e7y,settings:pe.lV_,files:pe.M1W,docs:pe.vd0,shortlinks:pe.AnD}[i||""]||pe.t69);var i;const o=e.url||"#",r="activities"===e.page_type&&f>0;return(0,p.jsx)(So,{icon:a,to:o,onClick:n,children:(0,p.jsxs)(U.E,{as:"span",children:[e.label,r&&(0,p.jsx)(U.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:(0,b.dU)("green.100","green.900"),color:(0,b.dU)("green.700","green.200"),borderWidth:"1px",borderColor:(0,b.dU)("green.200","green.700"),children:f})]})},e.id||t)}),(0,p.jsx)(So,{icon:pe.IFh,onClick:e=>{null===e||void 0===e||e.preventDefault(),window.open("/?myuibrix=edit","_blank")},children:"MyUIbrix Editor"}),!N&&(0,p.jsx)(So,{icon:pe.AnD,to:"/admin/shortlinks",onClick:n,children:"Zkr\xe1cen\xe9 odkazy"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:(0,b.dU)("gray.500","gray.400"),textTransform:"uppercase",letterSpacing:"wider",children:"Hlavn\xed"}),(0,p.jsx)(So,{icon:pe.$BV,to:"/admin",onClick:n,children:"N\xe1st\u011bnka"}),h&&(0,p.jsx)(So,{icon:pe.v$b,to:"/admin/analytika",onClick:n,children:"Analytika"}),(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:(0,b.dU)("gray.500","gray.400"),textTransform:"uppercase",letterSpacing:"wider",mt:4,children:"Obsah"}),(0,p.jsx)(So,{icon:pe.YXz,to:"/admin/tymy",onClick:n,children:"T\xfdmy"}),(0,p.jsx)(So,{icon:pe.bfZ,to:"/admin/zapasy",onClick:n,children:(0,p.jsxs)(U.E,{as:"span",children:["Z\xe1pasy",(0,p.jsx)(U.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:(0,b.dU)("gray.100","whiteAlpha.200"),color:(0,b.dU)("gray.700","gray.300"),borderWidth:"1px",borderColor:(0,b.dU)("gray.200","whiteAlpha.300"),children:"scroller"})]})}),(0,p.jsx)(So,{icon:pe.bfZ,to:"/admin/aktivity",onClick:n,children:(0,p.jsxs)(U.E,{as:"span",children:["Aktivity",f>0&&(0,p.jsx)(U.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:(0,b.dU)("green.100","green.900"),color:(0,b.dU)("green.700","green.200"),borderWidth:"1px",borderColor:(0,b.dU)("green.200","green.700"),children:f})]})}),(0,p.jsx)(So,{icon:pe.i0U,to:"/admin/hraci",onClick:n,children:"Hr\xe1\u010di"}),(0,p.jsx)(So,{icon:pe.Nhm,to:"/admin/clanky",onClick:n,children:"\u010cl\xe1nky"}),(0,p.jsx)(So,{icon:pe.t69,to:"/admin/kategorie",onClick:n,children:"Kategorie"}),(0,p.jsx)(So,{icon:pe.vd0,to:"/admin/o-klubu",onClick:n,children:"O klubu"}),(0,p.jsx)(So,{icon:pe.dkL,to:"/admin/videa",onClick:n,children:"Videa"}),(0,p.jsx)(So,{icon:pe.dkL,to:"/admin/galerie",onClick:n,children:"Galerie (Zonerama)"}),(0,p.jsx)(So,{icon:pe.$BV,to:"/admin/scoreboard",onClick:n,children:"Tabule (Scoreboard)"}),(0,p.jsx)(So,{icon:pe.rle,to:"/admin/scoreboard/remote",onClick:n,children:"Scoreboard Remote"}),(0,p.jsx)(So,{icon:pe.lV_,to:"/admin/obleceni",onClick:n,children:"Oble\u010den\xed"}),(0,p.jsx)(So,{icon:pe.DDN,to:"/admin/sponzori",onClick:n,children:"Sponzo\u0159i"}),(0,p.jsx)(So,{icon:pe.dkL,to:"/admin/bannery",onClick:n,children:"Bannery"}),(0,p.jsx)(So,{icon:pe.maD,to:"/admin/zpravy",onClick:n,children:"Zpr\xe1vy"}),(0,p.jsx)(So,{icon:pe.toK,to:"/admin/kontakty",onClick:n,children:"Kontakty"}),(0,p.jsx)(So,{icon:pe.Cer,to:"/admin/newsletter",onClick:n,children:"Zpravodaj"}),(0,p.jsx)(So,{icon:pe.l2R,to:"/admin/ankety",onClick:n,children:"Ankety"}),(0,p.jsx)(G.c,{my:2}),h&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:(0,b.dU)("gray.500","gray.400"),textTransform:"uppercase",letterSpacing:"wider",mt:4,children:"Nastaven\xed"}),(0,p.jsx)(So,{icon:pe.IFh,onClick:e=>{null===e||void 0===e||e.preventDefault(),window.open("/?myuibrix=edit","_blank")},children:"MyUIbrix Editor"}),(0,p.jsx)(So,{icon:pe.OXb,to:"/admin/navigace",onClick:n,children:"Navigace"}),(0,p.jsx)(So,{icon:pe.Z0L,to:"/admin/aliasy-soutezi",onClick:n,children:"Alias sout\u011b\u017e\xed"}),(0,p.jsx)(So,{icon:pe.KP4,to:"/admin/prefetch",onClick:n,children:"Prefetch & Cache"}),(0,p.jsx)(So,{icon:pe.YXz,to:"/admin/uzivatele",onClick:n,children:"U\u017eivatel\xe9"}),(0,p.jsx)(So,{icon:pe.lV_,to:"/admin/nastaveni",onClick:n,children:"Nastaven\xed"}),(0,p.jsx)(So,{icon:pe.AnD,to:"/admin/shortlinks",onClick:n,children:"Zkr\xe1cen\xe9 odkazy"}),(0,p.jsx)(So,{icon:pe.M1W,to:"/admin/soubory",onClick:n,children:"Soubory"})]})]}),(0,p.jsx)(y.a,{mt:"auto",mb:4,px:2,children:(0,p.jsxs)(L.N,{as:"button",display:"flex",alignItems:"center",w:"100%",px:4,py:2,borderRadius:"md",_hover:{textDecoration:"none",bg:(0,b.dU)("red.50","red.900"),color:"red.500"},onClick:s,color:(0,b.dU)("red.500","red.300"),children:[(0,p.jsx)(jn.I,{as:pe.axc,mr:3}),(0,p.jsx)(U.E,{children:"Odhl\xe1sit se"})]})})]})})},Ao=["onMenuToggle","rightContent"],Eo=e=>{let{onMenuToggle:t,rightContent:n}=e,a=(0,O.A)(e,Ao);const{colorMode:i,toggleColorMode:o}=(0,b.G6)(),{user:r,logout:s}=v(),l=(0,b.dU)("white","#1a1d29"),c=(0,b.dU)("gray.200","rgba(255, 255, 255, 0.12)"),u=((0,b.dU)("gray.800","#e2e8f0"),r),m=(0,b.dU)("sm","none");return(0,p.jsx)(y.a,(0,h.A)((0,h.A)({as:"header",position:"sticky",top:0,left:0,right:0,bg:l,borderBottomWidth:"1px",borderColor:c,zIndex:20,height:"60px",px:{base:3,md:6},boxShadow:m,transition:"all 0.2s"},a),{},{children:(0,p.jsxs)(Q.s,{h:"100%",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsxs)(Q.s,{alignItems:"center",children:[(0,p.jsx)(K.K,{display:{base:"flex",md:"none"},"aria-label":"Otev\u0159\xedt menu",icon:(0,p.jsx)(pe.OXb,{}),variant:"ghost",onClick:t,mr:2}),(0,p.jsx)(U.E,{fontSize:"xl",fontWeight:"bold",display:{base:"none",md:"block"},children:"Fotbal Admin"})]}),(0,p.jsx)(ee.z,{spacing:4,children:n||(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(te.m,{label:"Dokumentace",hasArrow:!0,children:(0,p.jsx)(L.N,{as:d.N_,to:"/admin/docs",children:(0,p.jsx)(K.K,{"aria-label":"Dokumentace",icon:(0,p.jsx)(pe.vd0,{}),variant:"ghost",size:"sm",mr:1})})}),(0,p.jsx)(K.K,{"aria-label":"P\u0159epnout barevn\xe9 sch\xe9ma",icon:"light"===i?(0,p.jsx)(pe.V6H,{}):(0,p.jsx)(pe.wQq,{}),variant:"ghost",onClick:o,size:"sm"}),(0,p.jsxs)(ne.W,{children:[(0,p.jsx)(ae.I,{children:(0,p.jsx)(ie.e,{size:"sm",name:(null===u||void 0===u?void 0:u.name)||"U\u017eivatel",src:null===u||void 0===u?void 0:u.avatar,cursor:"pointer",border:"2px solid",borderColor:(0,b.dU)("gray.200","gray.600"),_hover:{transform:"scale(1.05)",transition:"transform 0.2s"}})}),(0,p.jsxs)(oe.c,{zIndex:30,children:[(null===u||void 0===u?void 0:u.name)&&(0,p.jsxs)(y.a,{px:3,py:2,borderBottomWidth:"1px",borderColor:c,children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:u.name}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:u.email})]}),(0,p.jsx)(re.D,{icon:(0,p.jsx)(pe.aBc,{}),_hover:{bg:(0,b.dU)("gray.100","gray.700")},children:"M\u016fj \xfa\u010det"}),(0,p.jsx)(re.D,{icon:(0,p.jsx)(pe.axc,{}),color:"red.500",_hover:{bg:(0,b.dU)("red.50","red.900")},onClick:s,children:"Odhl\xe1sit se"})]})]})]})})]})}))};var To=n(2555),No=n(7781);const Ro=[{label:"Dashboard",path:"/admin",section:"Core",keywords:["overview","stat","dashboard"],icon:pe.xdT},{label:"\u010cl\xe1nky",path:"/admin/clanky",section:"Obsah",keywords:["articles","posts","blog"],icon:pe.Nhm},{label:"Hr\xe1\u010di",path:"/admin/hraci",section:"K\xe1dry",keywords:["players"],icon:pe.YXz},{label:"T\xfdmy",path:"/admin/tymy",section:"K\xe1dry",keywords:["teams"],icon:pe.YXz},{label:"Z\xe1pasy",path:"/admin/zapasy",section:"FA\u010cR",keywords:["matches","facr"],icon:pe.bfZ},{label:"M\xe9dia",path:"/admin/media",section:"Obsah",keywords:["uploads","images"],icon:pe.dkL},{label:"Sponzo\u0159i",path:"/admin/sponzori",section:"Marketing",keywords:["sponsors","partners"],icon:pe.DDN},{label:"Bannery",path:"/admin/bannery",section:"Marketing",keywords:["banners"],icon:pe.dkL},{label:"Kategorie",path:"/admin/kategorie",section:"Obsah",keywords:["categories"],icon:pe.Z0L},{label:"Nastaven\xed",path:"/admin/nastaveni",section:"Syst\xe9m",keywords:["settings","config"],icon:pe.Pcn},{label:"Newsletter",path:"/admin/newsletter",section:"Komunikace",keywords:["email","campaign"],icon:pe.maD},{label:"U\u017eivatel\xe9",path:"/admin/uzivatele",section:"Syst\xe9m",keywords:["users","accounts"],icon:pe.pXu},{label:"Prefetch",path:"/admin/prefetch",section:"Syst\xe9m",keywords:["cache","fetch"],icon:pe.KP4},{label:"Galerie",path:"/admin/galerie",section:"M\xe9dia",keywords:["gallery","zonerama"],icon:pe.dkL},{label:"Videa",path:"/admin/videa",section:"M\xe9dia",keywords:["youtube","videos"],icon:pe.HiP},{label:"Analytika",path:"/admin/analytika",section:"SEO",keywords:["analytics","umami"],icon:pe.YYR},{label:"O klubu",path:"/admin/o-klubu",section:"Obsah",keywords:["about"],icon:pe.lV_},{label:"Navigace",path:"/admin/navigace",section:"Syst\xe9m",keywords:["navigation","menu","sidebar"],icon:pe.OXb},{label:"Notifikace: Z\xe1pasy",path:"/admin/notifications",section:"Komunikace",keywords:["notifications","match"],icon:pe.jNV},{label:"Dokumentace (\xdavod)",path:"/admin/docs#uvod",section:"Docs",keywords:["docs","documentation"],icon:pe.vd0},{label:"Dokumentace (Nastaven\xed)",path:"/admin/docs#nastaveni",section:"Docs",keywords:["docs","settings"],icon:pe.vd0},{label:"Dokumentace (\u010cl\xe1nky)",path:"/admin/docs#clanky",section:"Docs",keywords:["docs","articles"],icon:pe.vd0},{label:"Dokumentace (Newsletter)",path:"/admin/docs#newsletter",section:"Docs",keywords:["docs","email"],icon:pe.vd0},{label:"Dokumentace (\u0158e\u0161en\xed probl\xe9m\u016f)",path:"/admin/docs#troubleshooting",section:"Docs",keywords:["docs","troubleshooting"],icon:pe.vd0}];function Po(e,t){if(!t)return e;try{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(n,"gi"),i=e.split(a),o=e.match(a)||[],r=[];return i.forEach((e,t)=>{r.push(e),t<o.length&&r.push((0,p.jsx)("mark",{style:{backgroundColor:"#fde68a"},children:o[t]},t))}),(0,p.jsx)(p.Fragment,{children:r})}catch(n){return e}}function Io(e,t){const n=(e.label||"").toLowerCase(),a=t.toLowerCase(),i=(e.keywords||[]).join(" ").toLowerCase();let o=0;return a?(n===a&&(o+=200),n.startsWith(a)&&(o+=120),n.includes(a)&&(o+=80-n.indexOf(a)),i.includes(a)&&(o+=40),"Docs"===e.section&&e.path.includes("#")&&(o+=5),o):o}function Wo(e){let{isOpen:t,onClose:n,onSelectPath:i}=e;const[o,r]=(0,a.useState)(""),[s,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(-1),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=setTimeout(()=>l(o.trim()),250);return()=>clearTimeout(e)},[o]),(0,a.useEffect)(()=>{t&&(r(""),l(""),d(-1),setTimeout(()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.focus()},50))},[t]);const u=(0,a.useMemo)(()=>Ro.map(e=>({it:e,s:Io(e,s)})).filter(e=>e.s>0||!s).sort((e,t)=>t.s-e.s||e.it.label.localeCompare(t.it.label)).slice(0,12).map(e=>e.it),[s]),m=(0,a.useCallback)(e=>{n(),i(e)},[n,i]);return(0,p.jsxs)(se.aF,{isOpen:t,onClose:n,size:"lg",motionPreset:"scale",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsxs)(J.r,{children:["Admin vyhled\xe1v\xe1n\xed",(0,p.jsxs)(y.a,{as:"span",ml:3,color:"gray.500",fontSize:"sm",children:[(0,p.jsx)(To.u,{children:"Ctrl"}),"+",(0,p.jsx)(To.u,{children:"K"})]})]}),(0,p.jsx)(B.s,{}),(0,p.jsxs)(Y.c,{pb:4,children:[(0,p.jsxs)(A.M,{size:"lg",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(jn.I,{as:pe.KSO})}),(0,p.jsx)(C.p,{placeholder:"Hledat v administraci (str\xe1nky, nastaven\xed, dokumentace)",value:o,onChange:e=>{r(e.target.value),d(-1)},onKeyDown:e=>{const t=u.length;if("ArrowDown"===e.key)e.preventDefault(),d(e=>Math.min(t-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),d(e=>Math.max(-1,e-1));else if("Enter"===e.key){const e=c>=0?u[c]:u[0];e&&m(e.path)}else(e.ctrlKey||e.metaKey)&&"k"===e.key.toLowerCase()?(e.preventDefault(),n()):"Escape"===e.key&&n()},ref:h,autoFocus:!0})]}),(0,p.jsxs)(No.B8,{mt:4,spacing:1,children:[u.map((e,t)=>(0,p.jsx)(No.ck,{px:3,py:2,borderRadius:"md",cursor:"pointer",bg:t===c?"blackAlpha.50":"transparent",_hover:{bg:"blackAlpha.50"},onClick:()=>m(e.path),children:(0,p.jsxs)(ee.z,{children:[e.icon?(0,p.jsx)(jn.I,{as:e.icon,color:"blue.500"}):null,(0,p.jsx)(U.E,{fontWeight:"semibold",children:Po(e.label,s)}),(0,p.jsx)(Qt.E,{ml:"auto",colorScheme:"gray",children:e.section})]})},e.path)),0===u.length&&(0,p.jsx)(y.a,{color:"gray.500",fontSize:"sm",px:1,py:2,children:"\u017d\xe1dn\xe9 v\xfdsledky"})]})]})]})]})}const Mo=e=>{let{children:t,requireAdmin:n=!0}=e;const{isOpen:i,onOpen:o,onClose:r}=(0,X.j)(),{isOpen:s,onOpen:l,onClose:d}=(0,X.j)(),{isAuthenticated:h,isLoading:u,user:m}=v(),x=(0,c.Zp)(),g=(0,c.zy)(),{colorMode:j,toggleColorMode:f}=(0,b.G6)(),k=(0,b.dU)("gray.50","#0f1115"),z=((0,b.dU)("white","#1a1d29"),(0,b.dU)("gray.200","rgba(255, 255, 255, 0.12)")),w=(0,b.dU)("white","#1a1d29");return(0,a.useEffect)(()=>{u||h||x("/login",{state:{from:g.pathname}})},[h,u,x,g]),(0,a.useEffect)(()=>{const e=e=>{const t=e.key.toLowerCase();(e.ctrlKey||e.metaKey)&&"k"===t&&(e.preventDefault(),l())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]),(0,a.useEffect)(()=>{if(!u&&h&&n){const e=null===m||void 0===m?void 0:m.role;e&&"admin"!==e&&x("/403",{replace:!0,state:{from:g.pathname}})}},[u,h,m,x,n]),u?(0,p.jsxs)(Q.s,{minH:"100vh",bg:k,children:[(0,p.jsx)(en.E,{width:"250px",height:"100vh",position:"fixed"}),(0,p.jsxs)(y.a,{ml:{base:0,md:"250px"},flex:1,p:6,children:[(0,p.jsx)(en.E,{height:"60px",mb:6}),(0,p.jsx)(en.E,{height:"400px"})]})]}):h?(0,p.jsxs)(y.a,{minH:"100vh",bg:k,className:"admin-layout",children:[(0,p.jsx)(Co,{isOpen:i,onClose:r,bg:w,borderRight:"1px",borderColor:z}),(0,p.jsxs)(y.a,{ml:{base:0,md:"260px"},transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",minH:"100vh",children:[(0,p.jsx)(Eo,{onMenuToggle:o,rightContent:(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(K.K,{"aria-label":"Vyhled\xe1v\xe1n\xed v administraci",icon:(0,p.jsx)(pe.KSO,{}),onClick:l,variant:"ghost",size:"sm",borderRadius:"full",_hover:{bg:(0,b.dU)("gray.100","gray.700"),transform:"scale(1.05)"},transition:"all 0.2s"}),(0,p.jsx)(K.K,{"aria-label":"Switch to ".concat("light"===j?"dark":"light"," mode"),icon:"light"===j?(0,p.jsx)(he.r,{}):(0,p.jsx)(ue.g,{}),onClick:f,variant:"ghost",size:"sm",borderRadius:"full",_hover:{bg:(0,b.dU)("gray.100","gray.700"),transform:"scale(1.05)"},transition:"all 0.2s"})]})}),(0,p.jsx)(y.a,{as:"main",className:"admin-main",p:{base:4,md:8},pb:{base:8,md:12},children:t}),(0,p.jsx)(Wo,{isOpen:s,onClose:d,onSelectPath:e=>x(e)})]})]}):null},Do=["title","icon","children"],Uo=e=>{let{title:t,icon:n,children:a}=e,i=(0,O.A)(e,Do);return(0,p.jsxs)(y.a,(0,h.A)((0,h.A)({bg:(0,b.dU)("white","gray.800"),p:4,borderRadius:"lg",boxShadow:"sm",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),_hover:{boxShadow:"md"},transition:"all 0.2s"},i),{},{children:[(0,p.jsxs)(z.D,{size:"md",mb:4,display:"flex",alignItems:"center",children:[n&&(0,p.jsx)(jn.I,{as:n,mr:2}),t]}),a]}))};var Lo=n(2410),Fo=n(8344),Oo=n(4178),Zo=n(7735);async function Ko(){var e,t;const n=await m.Ay.get("/admin/matches");return Array.isArray(n.data)?n.data:null!==(e=null===(t=n.data)||void 0===t?void 0:t.data)&&void 0!==e?e:[]}async function qo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const a=new FormData,i=n.filename||(t instanceof File?t.name:"logo.png");a.append("file",t,i),a.append("club_name",n.clubName||"Nezn\xe1m\xfd klub"),n.clubType&&a.append("club_type",n.clubType);const o=await fetch("https://logoapi.sportcreative.eu/logos/".concat(e),{method:"POST",body:a}),r=await o.json().catch(()=>({}));if(!o.ok)return{success:!1,error:r.error||"HTTP ".concat(o.status,": ").concat(o.statusText)};return{success:!0,url:r.logo_url||r.logo_url_svg||r.logo_url_png||"https://logoapi.sportcreative.eu/logos/".concat(e,"/logo.svg")}}catch(a){return console.error("Error uploading logo:",a),{success:!1,error:(null===a||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se nahr\xe1t logo. Zkuste to pros\xedm znovu."}}}async function Vo(e){try{let n=e;if(e.startsWith("/")){const t=new URL(m.API_URL).origin;n="".concat(t).concat(e)}const a=new URL(m.API_URL).origin;let i=n;try{new URL(n).origin!==a&&(i="".concat(a,"/api/v1/proxy/image?url=").concat(encodeURIComponent(n)))}catch(t){}const o=await fetch(i);return o.ok?await o.blob():null}catch(n){return console.error("Failed to fetch logo as blob:",n),null}}async function Ho(e){const t=new FormData;t.append("file",e);const n=(await m.Ay.post("/upload",t,{headers:{"Content-Type":"multipart/form-data"}})).data;let a=(null===n||void 0===n?void 0:n.url)||"";try{const e=new URL(a,window.location.origin),t=window.location.origin,n=new URL(m.API_URL).origin;e.origin!==t&&e.origin!==n||(a=e.pathname+e.search+e.hash)}catch(i){}return(0,h.A)((0,h.A)({},n||{}),{},{url:a})}async function $o(e){var t,n,a;if(!e||e.trim().length<2)return[];const i=await m.Ay.get("/facr/club/search",{params:{q:e}}),o=null!==(t=null!==(n=null===(a=i.data)||void 0===a?void 0:a.results)&&void 0!==n?n:i.data)&&void 0!==t?t:[];return(Array.isArray(o)?o.map(e=>{var t,n,a,i,o,r,s;return{id:null!==(t=null!==(n=null!==(a=null===e||void 0===e?void 0:e.id)&&void 0!==a?a:null===e||void 0===e?void 0:e.club_id)&&void 0!==n?n:null===e||void 0===e?void 0:e.ClubID)&&void 0!==t?t:"",name:null!==(i=null!==(o=null===e||void 0===e?void 0:e.name)&&void 0!==o?o:null===e||void 0===e?void 0:e.Name)&&void 0!==i?i:"",logo_url:null!==(r=null!==(s=null===e||void 0===e?void 0:e.logo_url)&&void 0!==s?s:null===e||void 0===e?void 0:e.LogoURL)&&void 0!==r?r:void 0}}):[]).filter(e=>e.id&&e.name)}async function Bo(){try{var e;return null!==(e=(await m.Ay.get("/public/team-logo-overrides",{params:{t:Date.now()}})).data)&&void 0!==e?e:{}}catch(t){try{const e=(await m.Ay.get("/admin/team-logo-overrides",{params:{t:Date.now()}})).data;if(Array.isArray(e)){const t={};for(const n of e){const e=(null===n||void 0===n?void 0:n.team_name)||(null===n||void 0===n?void 0:n.TeamName),a=(null===n||void 0===n?void 0:n.logo_url)||(null===n||void 0===n?void 0:n.LogoURL);e&&a&&(t[String(e)]=String(a))}return{by_name:t}}return e&&"object"===typeof e&&e.by_name?e:{}}catch(n){return{}}}}const Jo="dd.MM.yyyy HH:mm",Yo=e=>{try{const t=(0,Lo.qg)(e,Jo,new Date);return(0,Fo.c)(t)?(0,Ei.GP)(t,"HH:mm"):(0,Oo.e)(t)?(0,Ei.GP)(t,"HH:mm '(z\xedtra)'"):(0,Ei.GP)(t,"dd.MM. HH:mm")}catch(t){return console.error("Error formatting date:",t,e),e}},Go=()=>{const e=(0,j.d)(),[t,n]=(0,a.useState)(""),[i,o]=(0,a.useState)(!0),[r,s]=(0,a.useState)(!0),[l,d]=(0,a.useState)(!1),u=(0,c.zy)(),x=String(u.pathname||"").startsWith("/admin"),{settings:g}=eo(),{data:v={}}=(0,xe.I)({queryKey:["teamLogoOverrides"],queryFn:Bo,staleTime:3e5}),b=(null===v||void 0===v?void 0:v.by_id)||{},f=(e,t)=>{const n=(null===v||void 0===v?void 0:v.by_name)||{},a=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),i=e=>{let t=a(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},o=Object.keys(n||{}).reduce((e,t)=>(e[a(t)]=n[t],e),{}),r=Object.keys(n||{}).map(e=>({key:i(e),url:n[e]}));return((e,t)=>{if(!e)return t;let s=n[e]||o[a(e)];if(!s){const t=i(e);for(const{key:e,url:n}of r)if(e&&(t.endsWith(e)||e.endsWith(t))){s=n;break}}const l=s||t;if("string"===typeof l&&l.startsWith("/")){return new URL(m.API_URL,window.location.origin).origin+l}return l||W("/dist/img/logo-club-empty.svg")})(e,t)},{data:k=[],isLoading:z,error:_}=(0,xe.I)({queryKey:["upcomingMatchesCache"],queryFn:async()=>{const e=new URL(m.API_URL,window.location.origin).origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});if(!n.ok)throw new Error("Failed to load cache: ".concat(n.status));const a=await n.json(),i=(Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map(t=>(0,h.A)((0,h.A)({},t),{},{competitionName:e.name,competition_id:e.id}))),o=new Date;return i.map(e=>(0,h.A)((0,h.A)({},e),{},{__dt:(0,Lo.qg)(String(e.date_time||e.date),Jo,new Date)})).filter(e=>(0,Zo.d)(e.__dt,o)).sort((e,t)=>e.__dt.getTime()-t.__dt.getTime()).slice(0,5).map(e=>{var t,n,a,i;return{id:e.match_id,date_time:e.date_time||e.date,competitionName:e.competitionName,home:e.home_id&&null!==b&&void 0!==b&&null!==(t=b[e.home_id])&&void 0!==t&&t.name&&String(b[e.home_id].name).trim()?String(b[e.home_id].name):e.home||e.home_team,away:e.away_id&&null!==b&&void 0!==b&&null!==(n=b[e.away_id])&&void 0!==n&&n.name&&String(b[e.away_id].name).trim()?String(b[e.away_id].name):e.away||e.away_team,score:e.score,venue:e.venue,home_logo_url:e.home_id&&null!==b&&void 0!==b&&null!==(a=b[e.home_id])&&void 0!==a&&a.logo_url?String(b[e.home_id].logo_url):f(e.home||e.home_team,e.home_logo_url),away_logo_url:e.away_id&&null!==b&&void 0!==b&&null!==(i=b[e.away_id])&&void 0!==i&&i.logo_url?String(b[e.away_id].logo_url):f(e.away||e.away_team,e.away_logo_url),home_id:e.home_id,away_id:e.away_id}})}});return z?(0,p.jsx)(Uo,{title:"Nadch\xe1zej\xedc\xed z\xe1pasy",children:(0,p.jsxs)(w.T,{p:4,children:[(0,p.jsx)(zn.y,{size:"md"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m z\xe1pasy..."})]})}):_?(0,p.jsx)(Uo,{title:"Nadch\xe1zej\xedc\xed z\xe1pasy",children:(0,p.jsxs)(xa.F,{status:"error",variant:"left-accent",children:[(0,p.jsx)(ga._,{}),"Nepoda\u0159ilo se na\u010d\xedst z\xe1pasy. Zkuste to pros\xedm pozd\u011bji."]})}):k&&0!==k.length?(0,p.jsx)(Uo,{title:"Nadch\xe1zej\xedc\xed z\xe1pasy",children:(0,p.jsxs)(w.T,{spacing:{base:2,md:3},align:"stretch",divider:(0,p.jsx)(y.a,{borderBottomWidth:"1px",borderColor:"gray.200"}),children:[k.map(e=>(0,p.jsxs)(y.a,{p:{base:3,md:4},bg:"gray.50",_hover:{bg:"gray.100"},borderRadius:"lg",transition:"background-color 0.2s",shadow:"sm",children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:1,spacing:2,flexWrap:"wrap",children:[(0,p.jsx)(U.E,{fontSize:{base:"xs",sm:"sm"},color:"gray.700",fontWeight:"medium",whiteSpace:"nowrap",children:Yo(e.date_time)}),(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",fontSize:"xs",bg:"blue.50",color:"blue.700",children:e.competitionName})]}),(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsxs)(ee.z,{flex:1,minW:0,spacing:2,children:[(0,p.jsx)(y.a,{flexShrink:0,className:"match-widget-logo",children:(0,p.jsx)(Wa,{teamId:e.home_id,teamName:e.home,facrLogo:e.home_logo_url,size:"small",fallbackIcon:(0,p.jsx)(jn.I,{as:pe.i0U,color:"gray.400",boxSize:{base:4,md:5}})})}),(0,p.jsx)(U.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"medium",isTruncated:!0,color:"gray.800",children:M(e.home)})]}),(0,p.jsx)(U.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"bold",minW:{base:"32px",sm:"40px"},textAlign:"center",color:"gray.900",flexShrink:0,children:e.score||"vs"}),(0,p.jsxs)(ee.z,{flex:1,justify:"flex-end",spacing:2,minW:0,children:[(0,p.jsx)(U.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"medium",isTruncated:!0,textAlign:"right",color:"gray.800",children:M(e.away)}),(0,p.jsx)(y.a,{flexShrink:0,className:"match-widget-logo",children:(0,p.jsx)(Wa,{teamId:e.away_id,teamName:e.away,facrLogo:e.away_logo_url,size:"small",fallbackIcon:(0,p.jsx)(jn.I,{as:pe.i0U,color:"gray.400",boxSize:{base:4,md:5}})})})]})]}),e.venue&&(0,p.jsxs)(ee.z,{mt:2,spacing:2,color:"gray.500",fontSize:"sm",children:[(0,p.jsx)(jn.I,{as:pe.vq8,boxSize:3}),(0,p.jsx)(U.E,{isTruncated:!0,children:e.venue})]})]},e.id)),!x&&(0,p.jsxs)(w.T,{p:3,spacing:2,align:"stretch",children:[(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Chcete dost\xe1vat novinky o z\xe1pasech e\u2011mailem?"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"email",placeholder:"v\xe1\u0161@email.cz",value:t,onChange:e=>n(e.target.value)}),(0,p.jsx)(T.$,{colorScheme:"red",onClick:async()=>{if(t){d(!0);try{const a=await fetch((e=>{try{return/^https?:\/\//i.test(e)?e:new URL(m.API_URL,window.location.origin).origin+e}catch(t){return e}})("/api/v1/newsletter/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,preferences:{weekly:i,matches:r}})});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error((null===e||void 0===e?void 0:e.error)||"HTTP ".concat(a.status))}e({title:"P\u0159ihl\xe1\u0161eno k odb\u011bru",status:"success"}),n("")}catch(a){e({title:"Chyba p\u0159ihl\xe1\u0161en\xed",description:(null===a||void 0===a?void 0:a.message)||String(a),status:"error"})}finally{d(!1)}}else e({title:"Zadejte email",status:"warning"})},isLoading:l,children:"Odeb\xedrat"})]})]})]})}):(0,p.jsx)(Uo,{title:"Nadch\xe1zej\xedc\xed z\xe1pasy",children:(0,p.jsxs)(w.T,{p:4,spacing:4,children:[(0,p.jsx)(jn.I,{as:pe.bfZ,boxSize:8,color:"gray.400"}),(0,p.jsx)(U.E,{color:"gray.500",textAlign:"center",children:"\u017d\xe1dn\xe9 nadch\xe1zej\xedc\xed z\xe1pasy nebyly nalezeny."})]})})};var Xo=n(4653);const Qo=()=>{const{data:e=[],isLoading:t,error:n}=(0,xe.I)({queryKey:["recentArticles"],queryFn:async()=>{try{const{data:e}=await m.FH.get("/articles",{params:{page:1,page_size:3,published:!0}});return e.items||[]}catch(e){return console.error("Error fetching articles:",e),[]}},staleTime:3e5});return t?(0,p.jsx)(Uo,{title:"Posledn\xed \u010dl\xe1nky",icon:pe.Nhm,children:(0,p.jsx)(w.T,{spacing:4,align:"stretch",children:[1,2,3].map(e=>(0,p.jsxs)(y.a,{children:[(0,p.jsx)(en.E,{height:"120px",mb:2,borderRadius:"md"}),(0,p.jsx)(en.E,{height:"20px",mb:2,width:"80%"}),(0,p.jsx)(en.E,{height:"16px",width:"60%"})]},e))})}):n||!e.length?(0,p.jsx)(Uo,{title:"Posledn\xed \u010dl\xe1nky",icon:pe.Nhm,children:(0,p.jsx)(w.T,{p:4,spacing:4,children:(0,p.jsxs)(y.a,{p:4,bg:"gray.50",borderRadius:"md",textAlign:"center",w:"full",children:[(0,p.jsx)(jn.I,{as:pe.Nhm,boxSize:6,color:"gray.400",mb:2}),(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 \u010dl\xe1nky nebyly nalezeny"})]})})}):(0,p.jsx)(Uo,{title:"Posledn\xed \u010dl\xe1nky",icon:pe.Nhm,children:(0,p.jsxs)(w.T,{spacing:3,align:"stretch",divider:(0,p.jsx)(y.a,{borderBottomWidth:"1px",borderColor:"gray.100"}),children:[e.map(e=>{var t,n,a;return(0,p.jsx)(L.N,{as:d.N_,to:"/clanky/".concat(e.slug),_hover:{textDecoration:"none"},display:"block",children:(0,p.jsx)(y.a,{_hover:{bg:"gray.50"},borderRadius:"md",p:2,children:(0,p.jsxs)(ee.z,{align:"flex-start",spacing:3,children:[(0,p.jsx)(y.a,{flexShrink:0,width:"60px",height:"60px",bg:"gray.100",borderRadius:"md",overflow:"hidden",position:"relative",children:e.image_url?(0,p.jsx)(k._,{src:e.image_url,alt:e.title,width:"100%",height:"100%",objectFit:"cover"}):(0,p.jsx)(y.a,{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.200",children:(0,p.jsx)(jn.I,{as:pe.Nhm,color:"gray.400",boxSize:5})})}),(0,p.jsxs)(y.a,{flex:1,minW:0,children:[(0,p.jsx)(U.E,{fontWeight:"medium",fontSize:"sm",noOfLines:2,mb:1,children:e.title}),(0,p.jsxs)(ee.z,{spacing:3,fontSize:"xs",color:"gray.500",children:[(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.x$1,boxSize:3}),(0,p.jsx)(U.E,{children:null!==(t=e.author)&&void 0!==t&&t.first_name&&null!==(n=e.author)&&void 0!==n&&n.last_name?"".concat(e.author.first_name," ").concat(e.author.last_name):(null===(a=e.author)||void 0===a?void 0:a.email)||"Autor"})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.bfZ,boxSize:3}),(0,p.jsx)(U.E,{children:e.created_at&&(0,Ei.GP)((0,Xo.H)(e.created_at),"d. M. yyyy",{locale:Ri.cs})})]})]})]})]})})},e.id)}),(0,p.jsx)(y.a,{textAlign:"right",mt:2,children:(0,p.jsx)(L.N,{as:d.N_,to:"/admin/clanky",color:"blue.500",fontWeight:"medium",fontSize:"sm",_hover:{textDecoration:"underline"},children:"Zobrazit v\u0161echny \u010dl\xe1nky \u2192"})})]})})},er=()=>(0,p.jsx)(y.a,{mt:6,children:(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(U.E,{children:["Pro kompletn\xed dokumentaci nav\u0161tivte"," ",(0,p.jsx)(L.N,{href:"/docs",color:"blue.600",fontWeight:"semibold",textDecoration:"underline",children:"dokumentaci administrace"})]})]})});function tr(e){try{if(/^https?:\/\//i.test(e))return e;const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e.startsWith("/")?e:"/".concat(e),t).toString()}catch(t){return e}}async function nr(){const e=tr("/cache/prefetch/facr_club_info.json"),t=await fetch(e,{cache:"no-cache"});return t.ok?t.json():null}async function ar(){const e=tr("/cache/prefetch/facr_tables.json"),t=await fetch(e,{cache:"no-cache"});return t.ok?t.json():null}const ir=e=>{let{colorA:t="#1e3a8a",left:n,right:a,children:i}=e;return(0,p.jsx)(ee.z,{px:2,py:.5,borderRadius:"full",bgGradient:"linear(to-r, ".concat(t,", ").concat(lr(t,20),")"),color:"white",spacing:1.5,position:"relative",_before:n?{content:'""',position:"absolute",left:"-10px",top:0,bottom:0,width:"14px",bgGradient:"linear(to-r, ".concat(t,", ").concat(lr(t,20),")"),borderTopLeftRadius:"999px",borderBottomLeftRadius:"999px"}:void 0,_after:a?{content:'""',position:"absolute",right:"-10px",top:0,bottom:0,width:"14px",bgGradient:"linear(to-r, ".concat(t,", ").concat(lr(t,20),")"),borderTopRightRadius:"999px",borderBottomRightRadius:"999px"}:void 0,minW:"46px",children:i})},or=e=>{let{children:t}=e;return(0,p.jsx)(y.a,{px:2,py:.5,borderRadius:"md",bg:"gray.50",borderWidth:"1px",borderColor:"gray.200",fontWeight:"800",minW:"58px",textAlign:"center",fontSize:"sm",children:t})},rr=e=>{let{leftCount:t,rightCount:n,leftColor:a,rightColor:i}=e;const o=e=>{let{active:t,color:n}=e;return(0,p.jsx)(y.a,{w:"8px",h:"8px",borderRadius:"full",bg:t?n:"gray.200",borderWidth:t?0:1,borderColor:"gray.300"})};return(0,p.jsxs)(ee.z,{spacing:6,justify:"center",mt:2,width:"100%",children:[(0,p.jsx)(ee.z,{spacing:1,children:Array.from({length:5}).map((e,n)=>(0,p.jsx)(o,{active:n<t,color:a},n))}),(0,p.jsx)(ee.z,{spacing:1,children:Array.from({length:5}).map((e,t)=>(0,p.jsx)(o,{active:t<n,color:i},t))})]})};function sr(e){if(!e)return"---";const t=String(e).trim().toUpperCase();if(!t)return"---";const n={"\xc1":"A","\xc4":"A","\xc5":"A","\xc2":"A","\xc0":"A","\u010c":"C","\u0106":"C","\xc7":"C","\u010e":"D","\xc9":"E","\u011a":"E","\xc8":"E","\xcb":"E","\xca":"E","\xcd":"I","\xcc":"I","\xcf":"I","\xce":"I","\u0147":"N","\u0143":"N","\xd3":"O","\xd6":"O","\xd4":"O","\xd2":"O","\u0158":"R","\u0160":"S","\u015a":"S","\u0164":"T","\xda":"U","\u016e":"U","\xd9":"U","\xdc":"U","\xdb":"U","\xdd":"Y","\u017d":"Z"};let a="";for(const i of t){const e=n[i]||i;if(e>="A"&&e<="Z"&&(a+=e,3===a.length))break}for(;a.length<3;)a+="-";return a}function lr(e,t){try{const n=e.replace("#",""),a=parseInt(3===n.length?n.split("").map(e=>e+e).join(""):n,16);let i=a>>16&255,o=a>>8&255,r=255&a;return i=Math.min(255,Math.max(0,Math.round(i+t/100*255))),o=Math.min(255,Math.max(0,Math.round(o+t/100*255))),r=Math.min(255,Math.max(0,Math.round(r+t/100*255))),"#".concat([i,o,r].map(e=>e.toString(16).padStart(2,"0")).join(""))}catch(n){return e}}const cr=e=>{let{state:t}=e;const n=t.theme||"pill",a=!!t.sidesFlipped,i={short:(a?t.awayShort:t.homeShort)||sr(a?t.awayName:t.homeName),logo:a?t.awayLogo:t.homeLogo,color:(a?t.secondaryColor:t.primaryColor)||"#1e3a8a",score:a?t.awayScore:t.homeScore,fouls:Math.max(0,Math.min(5,a?t.awayFouls||0:t.homeFouls||0)),name:a?t.awayName:t.homeName},o={short:(a?t.homeShort:t.awayShort)||sr(a?t.homeName:t.awayName),logo:a?t.homeLogo:t.awayLogo,color:(a?t.primaryColor:t.secondaryColor)||"#2563eb",score:a?t.homeScore:t.awayScore,fouls:Math.max(0,Math.min(5,a?t.homeFouls||0:t.awayFouls||0)),name:a?t.homeName:t.awayName},r=t.timer||"00:00";switch(n){case"pill":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:2,px:1.5,py:1,borderRadius:"full",bg:"white",borderWidth:"1px",borderColor:"gray.200",boxShadow:"sm",width:"max-content",children:[(0,p.jsx)(or,{children:r}),(0,p.jsxs)(ir,{colorA:i.color,left:!0,children:[i.logo?(0,p.jsx)(k._,{src:i.logo,alt:"home",boxSize:"16px",objectFit:"contain"}):null,(0,p.jsx)(U.E,{textTransform:"uppercase",fontSize:"sm",lineHeight:1,children:i.short})]}),(0,p.jsxs)(or,{children:[i.score," \u2013 ",o.score]}),(0,p.jsxs)(ir,{colorA:o.color,right:!0,children:[(0,p.jsx)(U.E,{textTransform:"uppercase",fontSize:"sm",lineHeight:1,children:o.short}),o.logo?(0,p.jsx)(k._,{src:o.logo,alt:"away",boxSize:"16px",objectFit:"contain"}):null]})]}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]});case"classic":case"var1":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:3,bgGradient:"linear(to-b, #c8d4dc, #a8b8c4)",px:5,py:3,borderRadius:"lg",boxShadow:"md",width:"max-content",children:[(0,p.jsx)(y.a,{bg:"white",color:"black",fontWeight:"bold",px:3,py:1,borderRadius:"md",fontSize:"lg",children:r}),(0,p.jsx)(y.a,{bg:i.color,color:"white",px:4,py:2,borderRadius:"md",fontWeight:"bold",children:i.short}),(0,p.jsxs)(U.E,{fontWeight:"bold",color:"black",children:[i.score,"-",o.score]}),(0,p.jsx)(y.a,{bg:o.color,color:"white",px:4,py:2,borderRadius:"md",fontWeight:"bold",children:o.short})]}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]});case"var2":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:0,borderRadius:"md",overflow:"hidden",boxShadow:"md",width:"max-content",children:[(0,p.jsx)(y.a,{bgGradient:"linear(135deg, #4a5568, #2d3748)",color:"white",px:3,py:2,fontWeight:"bold",children:r}),(0,p.jsx)(y.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:4,py:2,fontWeight:"bold",children:i.short}),(0,p.jsxs)(y.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:3,py:2,fontWeight:"bold",children:[i.score,"-",o.score]}),(0,p.jsx)(y.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:4,py:2,fontWeight:"bold",children:o.short})]}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]});case"var3":return(0,p.jsxs)(y.a,{textAlign:"center",fontFamily:"Poppins, Arial, sans-serif",children:[(0,p.jsxs)(ee.z,{spacing:0,justify:"center",children:[(0,p.jsxs)(y.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",position:"relative",children:[(0,p.jsx)(y.a,{position:"absolute",left:"-8px",top:0,w:"6px",h:"38px",bg:i.color}),(0,p.jsx)(U.E,{children:i.short})]}),(0,p.jsx)(y.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",zIndex:2,boxShadow:"0 3px 10px rgba(0,0,0,0.7)",children:(0,p.jsxs)(U.E,{fontWeight:"bold",children:[i.score,"-",o.score]})}),(0,p.jsxs)(y.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",position:"relative",children:[(0,p.jsx)(y.a,{position:"absolute",right:"-8px",top:0,w:"6px",h:"38px",bg:o.color}),(0,p.jsx)(U.E,{children:o.short})]})]}),(0,p.jsx)(y.a,{mt:2,w:"306px",mx:"auto",bg:"#F6F6F6",children:(0,p.jsx)(U.E,{children:r})}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]});case"var4":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(y.a,{w:"340px",borderWidth:"1px",borderRadius:"xl",boxShadow:"xl",p:4,bg:"white",color:"gray.900",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:i.name}),(0,p.jsx)(U.E,{ml:"auto",fontWeight:"extrabold",children:i.score})]}),(0,p.jsx)(y.a,{textAlign:"center",fontWeight:"extrabold",py:1,children:"VS"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:o.name}),(0,p.jsx)(U.E,{ml:"auto",fontWeight:"extrabold",children:o.score})]}),(0,p.jsx)(ee.z,{justify:"flex-end",fontSize:"sm",opacity:.8,pt:2,children:(0,p.jsx)(U.E,{children:r})})]}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]});default:return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:3,bg:"gray.900",color:"white",px:4,py:3,borderRadius:"lg",boxShadow:"lg",width:"max-content",children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:i.name}),(0,p.jsxs)(U.E,{fontWeight:"black",children:[i.score," : ",o.score]}),(0,p.jsx)(U.E,{fontWeight:"bold",children:o.name})]}),(0,p.jsx)(rr,{leftCount:i.fouls,rightCount:o.fouls,leftColor:i.color,rightColor:o.color})]})}},dr={homeName:"DOM\xc1C\xcd",awayName:"HOST\xc9",homeLogo:"",awayLogo:"",homeShort:"DOM",awayShort:"HOS",primaryColor:"#1e3a8a",secondaryColor:"#2563eb",homeScore:0,awayScore:0,homeFouls:0,awayFouls:0,halfLength:45,theme:"pill",externalMatchId:"",active:!1,timer:"00:00",running:!1,sidesFlipped:!1,half:1,qrEvery:5,qrDuration:60},hr="scoreboard_state_v1";async function ur(){try{const e=br((await m.Ay.get("/admin/scoreboard")).data);return localStorage.setItem(hr,JSON.stringify(e)),(0,h.A)((0,h.A)({},dr),e)}catch(e){try{const e=(m.API_URL||"").replace(/\/$/,""),t=await fetch("".concat(e,"/scoreboard"),{credentials:"include"});if(t.ok){const e=br(await t.json());return localStorage.setItem(hr,JSON.stringify(e)),(0,h.A)((0,h.A)({},dr),e)}}catch(t){}try{const e=localStorage.getItem(hr);if(!e)return dr;const t=JSON.parse(e);return(0,h.A)((0,h.A)({},dr),t)}catch(n){return dr}}}async function mr(e){const t=await ur(),n=(0,h.A)((0,h.A)({},t),e);localStorage.setItem(hr,JSON.stringify(n));try{await m.Ay.put("/admin/scoreboard",yr(e))}catch(a){}return n}async function pr(){const e=br((await m.Ay.get("/admin/scoreboard")).data);return localStorage.setItem(hr,JSON.stringify(e)),(0,h.A)((0,h.A)({},dr),e)}async function xr(e){const t=br((await m.Ay.put("/admin/scoreboard",yr(e))).data);return localStorage.setItem(hr,JSON.stringify(t)),(0,h.A)((0,h.A)({},dr),t)}async function gr(){const e=(m.API_URL||"").replace(/\/$/,""),t=await fetch("".concat(e,"/scoreboard"),{credentials:"include"});if(!t.ok)throw new Error("Failed to load public scoreboard");const n=br(await t.json());return(0,h.A)((0,h.A)({},dr),n)}function vr(e){if(!e)return"---";const t=String(e).trim().toUpperCase();if(!t)return"---";const n={"\xc1":"A","\xc4":"A","\xc5":"A","\xc2":"A","\xc0":"A","\u010c":"C","\u0106":"C","\xc7":"C","\u010e":"D","\xc9":"E","\u011a":"E","\xc8":"E","\xcb":"E","\xca":"E","\xcd":"I","\xcc":"I","\xcf":"I","\xce":"I","\u0147":"N","\u0143":"N","\xd3":"O","\xd6":"O","\xd4":"O","\xd2":"O","\u0158":"R","\u0160":"S","\u015a":"S","\u0164":"T","\xda":"U","\u016e":"U","\xd9":"U","\xdc":"U","\xdb":"U","\xdd":"Y","\u017d":"Z"};let a="";for(const i of t){let e=n[i]||i;if(e>="A"&&e<="Z"&&(a+=e,3===a.length))break}for(;a.length<3;)a+="-";return a}async function jr(e){if(!e)return null;try{const t=await Ae(e,5);return(null===t||void 0===t?void 0:t[0])||null}catch(t){return null}}function br(e){return e?{homeName:e.homeName||e.home_name||e.HomeName||"",awayName:e.awayName||e.away_name||e.AwayName||"",homeLogo:e.homeLogo||e.home_logo||e.home_logo_url||e.HomeLogoURL||"",awayLogo:e.awayLogo||e.away_logo||e.away_logo_url||e.AwayLogoURL||"",homeShort:e.homeShort||e.home_short||e.HomeShort||"",awayShort:e.awayShort||e.away_short||e.AwayShort||"",primaryColor:e.primaryColor||e.primary_color||e.PrimaryColor||void 0,secondaryColor:e.secondaryColor||e.secondary_color||e.SecondaryColor||void 0,homeScore:"number"===typeof e.homeScore?e.homeScore:"number"===typeof e.home_score?e.home_score:0,awayScore:"number"===typeof e.awayScore?e.awayScore:"number"===typeof e.away_score?e.away_score:0,homeFouls:"number"===typeof e.homeFouls?e.homeFouls:"number"===typeof e.home_fouls?e.home_fouls:0,awayFouls:"number"===typeof e.awayFouls?e.awayFouls:"number"===typeof e.away_fouls?e.away_fouls:0,halfLength:"number"===typeof e.halfLength?e.halfLength:"number"===typeof e.half_length?e.half_length:45,theme:e.theme||"pill",externalMatchId:e.externalMatchId||e.external_match_id||e.ExternalMatchID||"",active:"boolean"===typeof e.active?e.active:void 0,timer:e.timer||e.Timer||"00:00",running:"boolean"===typeof e.running?e.running:void 0,sidesFlipped:"boolean"===typeof e.sidesFlipped?e.sidesFlipped:"boolean"===typeof e.sides_flipped?e.sides_flipped:void 0,half:"number"===typeof e.half?e.half:void 0,qrEvery:"number"===typeof e.qrEvery?e.qrEvery:"number"===typeof e.qr_show_every_minutes?e.qr_show_every_minutes:void 0,qrDuration:"number"===typeof e.qrDuration?e.qrDuration:"number"===typeof e.qr_show_duration_seconds?e.qr_show_duration_seconds:void 0}:{}}function yr(e){const t={};return void 0!==e.homeName&&(t.homeName=e.homeName),void 0!==e.awayName&&(t.awayName=e.awayName),void 0!==e.homeLogo&&(t.homeLogo=e.homeLogo),void 0!==e.awayLogo&&(t.awayLogo=e.awayLogo),void 0!==e.homeShort&&(t.homeShort=e.homeShort),void 0!==e.awayShort&&(t.awayShort=e.awayShort),void 0!==e.primaryColor&&(t.primaryColor=e.primaryColor),void 0!==e.secondaryColor&&(t.secondaryColor=e.secondaryColor),void 0!==e.homeScore&&(t.homeScore=e.homeScore),void 0!==e.awayScore&&(t.awayScore=e.awayScore),void 0!==e.homeFouls&&(t.homeFouls=e.homeFouls),void 0!==e.awayFouls&&(t.awayFouls=e.awayFouls),void 0!==e.halfLength&&(t.halfLength=e.halfLength),void 0!==e.theme&&(t.theme=e.theme),void 0!==e.externalMatchId&&(t.externalMatchId=e.externalMatchId),void 0!==e.active&&(t.active=e.active),void 0!==e.timer&&(t.timer=e.timer),void 0!==e.sidesFlipped&&(t.sidesFlipped=e.sidesFlipped),void 0!==e.half&&(t.half=e.half),void 0!==e.qrEvery&&(t.qrEvery=e.qrEvery),void 0!==e.qrDuration&&(t.qrDuration=e.qrDuration),t}const fr=e=>{let{label:t,value:n,help:a,icon:i,color:o="blue"}=e;const r=(0,b.dU)("white","gray.800"),s=(0,b.dU)("gray.200","gray.700"),l=(0,b.dU)("".concat(o,".50"),"".concat(o,".900")),c=(0,b.dU)("".concat(o,".600"),"".concat(o,".300"));return(0,p.jsx)(y.a,{bg:r,p:6,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:s,_hover:{shadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",mb:3,children:[(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{fontSize:"sm",fontWeight:"medium",color:"gray.500",children:t}),(0,p.jsx)(ko.k,{fontSize:"3xl",fontWeight:"bold",mt:2,children:n}),a&&(0,p.jsx)(zo.h,{fontSize:"xs",mt:1,children:a})]}),i&&(0,p.jsx)(y.a,{p:3,bg:l,borderRadius:"xl",children:(0,p.jsx)(jn.I,{as:i,boxSize:6,color:c})})]})})},kr=()=>{var e,t,n,a,i,o,r,s,l,c,h,u,x,g,v,j,f;const{data:k,isLoading:_,error:S,refetch:C,isFetching:A}=(0,xe.I)({queryKey:["admin","analytics"],queryFn:Nt,staleTime:3e5}),{data:E,isLoading:N}=(0,xe.I)({queryKey:["admin","analytics","overview"],queryFn:Rt,staleTime:3e5}),{data:R}=(0,xe.I)({queryKey:["admin","analytics","top-pages"],queryFn:()=>async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return(await m.Ay.get("/admin/analytics/top-pages",{params:{limit:e}})).data}(5),staleTime:6e5}),{data:P}=(0,xe.I)({queryKey:["admin","analytics","umami-events"],queryFn:async()=>(await m.Ay.get("/admin/umami/metrics/event?days=7")).data||[],staleTime:6e5}),{data:I}=(0,xe.I)({queryKey:["facr-tables-cache"],queryFn:ar,staleTime:3e5}),{data:W}=(Array.isArray(null===I||void 0===I?void 0:I.competitions)&&I.competitions.length,(()=>{try{const t=Array.isArray(null===I||void 0===I?void 0:I.competitions)?I.competitions:[],n=new Set;for(const a of t){var e;const t=Array.isArray(null===a||void 0===a||null===(e=a.table)||void 0===e?void 0:e.overall)?a.table.overall:[];for(const e of t){const t=String((null===e||void 0===e?void 0:e.team)||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase();t&&n.add(t)}}return n.size}catch(t){return 0}})(),(0,xe.I)({queryKey:["scoreboard-state"],queryFn:ur,staleTime:6e4}));return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{maxW:"1600px",mx:"auto",children:[(0,p.jsxs)(y.a,{mb:8,children:[(0,p.jsxs)(ee.z,{spacing:3,mb:2,children:[(0,p.jsx)(U.E,{fontSize:"3xl",children:"\ud83d\udc4b"}),(0,p.jsx)(z.D,{size:"xl",children:"V\xedtejte v administraci"})]}),(0,p.jsx)(U.E,{color:"gray.500",fontSize:"lg",children:"P\u0159ehled kl\xed\u010dov\xfdch statistik a rychl\xfd p\u0159\xedstup k nejd\u016fle\u017eit\u011bj\u0161\xedm funkc\xedm"})]}),!!S&&(0,p.jsxs)(xa.F,{status:"error",mb:4,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Nelze na\u010d\xedst statistiky"}),(0,p.jsx)(_o.T,{children:"Zkontrolujte p\u0159ipojen\xed nebo p\u0159ihl\xe1\u0161en\xed spr\xe1vce a zkuste to znovu."})]}),(0,p.jsx)(T.$,{onClick:()=>C(),ml:"auto",size:"sm",isLoading:A,children:"Zkusit znovu"})]}),(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,lg:3},spacing:4,mb:6,children:_?(0,p.jsx)(p.Fragment,{children:[1,2,3].map(e=>(0,p.jsxs)(y.a,{bg:"white",p:4,borderRadius:"lg",boxShadow:"sm",borderWidth:"1px",children:[(0,p.jsx)(en.E,{height:"20px",width:"40%",mb:2}),(0,p.jsx)(en.E,{height:"28px",width:"50%",mb:2}),(0,p.jsx)(en.E,{height:"16px",width:"35%"})]},e))}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(fr,{label:"U\u017eivatel\xe9 (admin)",value:null!==(e=null===k||void 0===k||null===(t=k.users)||void 0===t?void 0:t.total)&&void 0!==e?e:"\u2014",help:null!==k&&void 0!==k&&k.users?"Nov\xfdch tento t\xfdden: ".concat(null!==(n=k.users.new_this_week)&&void 0!==n?n:0):void 0,icon:pe.YXz,color:"blue"}),(0,p.jsx)(fr,{label:"Ud\xe1losti",value:null!==(a=null===k||void 0===k||null===(i=k.events)||void 0===i?void 0:i.total)&&void 0!==a?a:"\u2014",help:null!==k&&void 0!==k&&k.events?"Nadch\xe1zej\xedc\xed: ".concat(null!==(o=k.events.upcoming)&&void 0!==o?o:0):void 0,icon:pe.bfZ,color:"green"}),(0,p.jsx)(fr,{label:"\u010cl\xe1nky",value:null!==(r=null===k||void 0===k||null===(s=k.articles)||void 0===s?void 0:s.total)&&void 0!==r?r:"\u2014",help:null!==k&&void 0!==k&&k.articles?"Publikovan\xfdch: ".concat(null!==(l=k.articles.published)&&void 0!==l?l:0):void 0,icon:pe.Nhm,color:"purple"}),(0,p.jsx)(fr,{label:"Zobrazen\xed str\xe1nek",value:null!==(c=null===E||void 0===E||null===(h=E.total_page_views)||void 0===h?void 0:h.toLocaleString("cs-CZ"))&&void 0!==c?c:"\u2014",help:E?"Dnes: ".concat(null!==(u=E.page_views_today)&&void 0!==u?u:0):void 0,icon:pe.Ny1,color:"cyan"}),(0,p.jsx)(fr,{label:"Unik\xe1tn\xed n\xe1v\u0161t\u011bvn\xedci",value:null!==(x=null===E||void 0===E||null===(g=E.unique_visitors)||void 0===g?void 0:g.toLocaleString("cs-CZ"))&&void 0!==x?x:"\u2014",help:E?"Tento t\xfdden: ".concat(null!==(v=E.unique_visitors_week)&&void 0!==v?v:0):void 0,icon:pe.YYR,color:"teal"}),(0,p.jsx)(fr,{label:"Zobrazen\xed (t\xfdden)",value:null!==(j=null===E||void 0===E||null===(f=E.page_views_week)||void 0===f?void 0:f.toLocaleString("cs-CZ"))&&void 0!==j?j:"\u2014",help:"Za posledn\xedch 7 dn\xed",icon:pe.ugv,color:"orange"})]})}),(0,p.jsxs)(y.a,{mb:8,children:[(0,p.jsx)(z.D,{size:"md",mb:4,children:"Rychl\xe9 akce"}),(0,p.jsx)(Tt.r,{columns:{base:2,md:4},spacing:4,children:[{label:"Nastaven\xed",icon:pe.Pcn,to:"/admin/nastaveni",color:"blue"},{label:"Dokumentace",icon:pe.vd0,to:"/admin/docs",color:"purple"},{label:"Nov\xfd \u010dl\xe1nek",icon:pe.uoG,to:"/admin/clanky",color:"green"},{label:"Prefetch",icon:pe.YYR,to:"/admin/prefetch",color:"orange"}].map((e,t)=>(0,p.jsx)(L.N,{as:d.N_,to:e.to,_hover:{textDecoration:"none"},children:(0,p.jsx)(y.a,{bg:(0,b.dU)("white","gray.800"),p:4,borderRadius:"lg",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),textAlign:"center",cursor:"pointer",_hover:{shadow:"lg",transform:"translateY(-2px)",borderColor:"".concat(e.color,".400")},transition:"all 0.2s",children:(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(y.a,{p:3,bg:(0,b.dU)("".concat(e.color,".50"),"".concat(e.color,".900")),borderRadius:"lg",children:(0,p.jsx)(jn.I,{as:e.icon,boxSize:6,color:(0,b.dU)("".concat(e.color,".600"),"".concat(e.color,".300"))})}),(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",children:e.label})]})})},t))})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsx)(z.D,{size:"md",mb:4,children:"Analytika n\xe1v\u0161t\u011bvnosti"}),(0,p.jsxs)(Tt.r,{columns:{base:1,lg:2},spacing:6,mb:8,children:[(0,p.jsxs)(y.a,{bg:(0,b.dU)("white","gray.800"),p:5,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky"}),(0,p.jsx)(L.N,{as:d.N_,to:"/admin/analytika",color:"blue.500",fontSize:"sm",fontWeight:"semibold",children:"V\xedce \u2192"})]}),R&&R.length>0?(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Str\xe1nka"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Zobrazen\xed"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"N\xe1v\u0161t\u011bvn\xedci"})]})}),(0,p.jsx)(Zi.N,{children:R.map((e,t)=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{fontSize:"sm",children:(0,p.jsx)(U.E,{isTruncated:!0,maxW:"200px",title:e.page_name||e.page_path,children:e.page_name||e.page_path})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,fontWeight:"semibold",children:e.view_count}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.unique_visitors})]},t))})]}):(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",children:"Zat\xedm \u017e\xe1dn\xe1 data"})]}),(0,p.jsxs)(y.a,{bg:(0,b.dU)("white","gray.800"),p:5,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:"Nej\u010dast\u011bj\u0161\xed interakce"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",children:"7 dn\xed"})]}),P&&P.length>0?(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Akce"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,p.jsx)(Zi.N,{children:P.slice(0,10).map((e,t)=>{const n=(e=>({"Contact Form Submit":{name:"Odesl\xe1n\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel odeslal kontaktn\xed formul\xe1\u0159 na str\xe1nce Kontakt"},"Contact Form":{name:"Zobrazen\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel zobrazil kontaktn\xed formul\xe1\u0159"},"Form Submit":{name:"Odesl\xe1n\xed formul\xe1\u0159e",source:"R\u016fzn\xe9 str\xe1nky",description:"Obecn\xe9 odesl\xe1n\xed formul\xe1\u0159e na webu"},"Newsletter Subscribe":{name:"Odb\u011br newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel se p\u0159ihl\xe1sil k odb\u011bru newsletteru"},"Newsletter Submit":{name:"Potvrzen\xed newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel potvrdil p\u0159ihl\xe1\u0161en\xed k newsletteru"},"Newsletter Unsubscribe":{name:"Odhl\xe1\u0161en\xed z newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru newsletteru"},"Newsletter Preferences Saved":{name:"Ulo\u017een\xed p\u0159edvoleb newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby pro newsletter"},Unsubscribe:{name:"Odhl\xe1\u0161en\xed z odb\u011bru",source:"Nastaven\xed",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru"},"Save Preferences":{name:"Ulo\u017een\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby (souhlas s cookies apod.)"},"Refresh Preferences":{name:"Obnoven\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel obnovil nebo zm\u011bnil sv\xe9 p\u0159edvolby"},"Article View":{name:"Zobrazen\xed \u010dl\xe1nku",source:"Blog",description:"U\u017eivatel si zobrazil \u010dl\xe1nek na blogu"},"Match View":{name:"Zobrazen\xed z\xe1pasu",source:"Str\xe1nka z\xe1pas\u016f",description:"U\u017eivatel si zobrazil detail z\xe1pasu"},"Gallery View":{name:"Zobrazen\xed galerie",source:"Galerie",description:"U\u017eivatel si otev\u0159el galerii fotografi\xed"},"Video Play":{name:"P\u0159ehr\xe1n\xed videa",source:"Video sekce",description:"U\u017eivatel spustil p\u0159ehr\xe1v\xe1n\xed videa"},"Social Share":{name:"Sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch",source:"Sd\xedlec\xed tla\u010d\xedtka",description:"U\u017eivatel sd\xedlel obsah na soci\xe1ln\xed s\xed\u0165"},Download:{name:"Sta\u017een\xed souboru",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel st\xe1hl soubor"},"External Link Click":{name:"Kliknut\xed na extern\xed odkaz",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na odkaz vedouc\xed mimo web"}}[e]||{name:e,source:"Nezn\xe1m\xfd zdroj",description:"Ud\xe1lost: ".concat(e)}))(e.x||"");return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{fontSize:"sm",children:(0,p.jsx)(te.m,{label:n.description,placement:"top",hasArrow:!0,children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:n.name}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:n.source})]})})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsx)(Qt.E,{colorScheme:"blue",fontWeight:"semibold",children:e.y})})]},t)})})]}):(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",children:"Zat\xedm \u017e\xe1dn\xe1 data"})]})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsx)(z.D,{size:"md",mb:4,children:"P\u0159ehled aktivit"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2,xl:3},spacing:6,mb:8,children:[(0,p.jsx)(Go,{}),(0,p.jsx)(Qo,{}),(0,p.jsxs)(y.a,{bg:(0,b.dU)("white","gray.800"),p:5,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:(0,b.dU)("gray.200","gray.700"),children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:"Aktu\xe1ln\xed tabule"}),(0,p.jsx)(L.N,{as:d.N_,to:"/admin/scoreboard",color:"blue.500",fontSize:"sm",fontWeight:"semibold",children:"Upravit \u2192"})]}),W?(0,p.jsx)(y.a,{display:"flex",justifyContent:"center",children:(0,p.jsx)(cr,{state:W})}):(0,p.jsx)(en.E,{height:"40px"})]})]}),(0,p.jsx)(er,{})]})})};var zr=n(3171),wr=n(3913),_r=n(2468),Sr=n(8655),Cr=n(9218),Ar=n(2823),Er=n.n(Ar),Tr=n(1586),Nr=n(7365),Rr=n(614),Pr=n(3149),Ir=n(1441),Wr=n(4348),Mr=n(4805),Dr=n(86),Ur=n(8864),Lr=n(8638),Fr=n(9855),Or=n(7940),Zr=n(5034),Kr=n(4699),qr=n(8298),Vr=n(6099),Hr=n(6210);const $r=async e=>(await m.Ay.post("/image-processing/quick-edit",e)).data,Br=e=>{let{value:t,onChange:n,placeholder:i="Za\u010dn\u011bte ps\xe1t...",height:o="400px",readOnly:r=!1,onImageUpload:s,showImageResize:l=!0,toolbar:c="full"}=e;const d=(0,j.d)(),u=(0,a.useRef)(null),x=(0,a.useRef)(null),g=(0,a.useRef)(n),v=(0,a.useRef)(null),b=(0,a.useRef)(()=>{}),[f,z]=(0,a.useState)(!1);(0,a.useEffect)(()=>(z(!0),()=>z(!1)),[]),(0,a.useEffect)(()=>{g.current=n},[n]);const[A,E]=(0,a.useState)(!1),[N,R]=(0,a.useState)(null),[P,I]=(0,a.useState)(null),[M,D]=(0,a.useState)({unit:"%",width:80,height:80,x:10,y:10}),[L,F]=(0,a.useState)(85),[O,Z]=(0,a.useState)(1500),[q,V]=(0,a.useState)(!1),$=(0,a.useRef)(null),G="gray.200",[X,Q]=(0,a.useState)(null),[ne,ae]=(0,a.useState)({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1}),[ie,oe]=(0,a.useState)(!1),[re,ce]=(0,a.useState)({top:0,left:0}),[de,he]=(0,a.useState)(null),[ue,me]=(0,a.useState)(!1),[pe,xe]=(0,a.useState)(0),[ge,ve]=(0,a.useState)(""),[je,be]=(0,a.useState)(0),ye={full:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link","image"],["blockquote"],["clean"]],basic:[[{header:[1,2,3,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link","image"],["clean"]],minimal:[["bold","italic","underline"],[{list:"bullet"}],["link"],["clean"]]},fe=(0,a.useMemo)(()=>ye[c]||ye.full,[c]),ke=(0,a.useCallback)(()=>{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=async()=>{const t=(e.files||[])[0];if(!t)return;I(t);const n=new FileReader;n.onload=()=>{R(n.result),E(!0)},n.readAsDataURL(t)},e.click()},[]),ze=(0,a.useMemo)(()=>({toolbar:{container:fe,handlers:{image:s?ke:void 0}},clipboard:{matchVisual:!1}}),[fe,s,ke]);(0,a.useEffect)(()=>{var e,t;if(!f)return;const n=null===(e=u.current)||void 0===e?void 0:e.getEditor();if(!n)return;const a=null===(t=n.root)||void 0===t?void 0:t.parentElement,i=null===a||void 0===a?void 0:a.previousElementSibling;if(!i)return;const o=(e,t)=>{i.querySelectorAll(e).forEach(e=>{e.setAttribute("title",t),e.setAttribute("aria-label",t)})};o("button.ql-bold","Tu\u010dn\xe9"),o("button.ql-italic","Kurz\xedva"),o("button.ql-underline","Podtr\u017een\xed"),o("button.ql-strike","P\u0159e\u0161krtnut\xed"),o("button.ql-link","Vlo\u017eit odkaz"),o("button.ql-image","Vlo\u017eit obr\xe1zek"),o("button.ql-blockquote","Citace"),o("button.ql-clean","Vy\u010distit form\xe1tov\xe1n\xed"),o('button.ql-list[value="ordered"]',"\u010c\xedslovan\xfd seznam"),o('button.ql-list[value="bullet"]',"Odr\xe1\u017ekov\xfd seznam"),o("button.ql-align","Zarovn\xe1n\xed"),o('button.ql-align[value=""]',"Zarovnat vlevo"),o('button.ql-align[value="center"]',"Zarovnat na st\u0159ed"),o('button.ql-align[value="right"]',"Zarovnat vpravo"),o('button.ql-align[value="justify"]',"Do bloku"),o(".ql-color .ql-picker-label","Barva textu"),o(".ql-background .ql-picker-label","Barva pozad\xed"),o(".ql-header .ql-picker-label","Nadpis"),o('.ql-header .ql-picker-item[data-value="1"]',"Nadpis 1"),o('.ql-header .ql-picker-item[data-value="2"]',"Nadpis 2"),o('.ql-header .ql-picker-item[data-value="3"]',"Nadpis 3")},[f,c]);(0,a.useEffect)(()=>{var e;const t=null===(e=u.current)||void 0===e?void 0:e.getEditor();if(!t||r)return;let n=null,a=null,i=!1,o=!1,s=0,l=0,c=0;const h=()=>{a&&a.parentNode&&(a.parentNode.removeChild(a),a=null)},m=e=>{n&&(n.style.outline="",n.style.cursor="",n.style.boxShadow=""),n=e;let o=e.getAttribute("data-img-id")||"";if(!o){o="img-"+Date.now()+"-"+Math.random().toString(36).slice(2);try{e.setAttribute("data-img-id",o)}catch(f){}}v.current=o,e.style.outline="3px solid #3182ce",e.style.cursor="move",e.style.boxShadow="0 4px 12px rgba(49, 130, 206, 0.3)",e.setAttribute("draggable","false"),(e=>{h();const n=document.createElement("div");n.className="custom-image-resize-container",n.style.cssText="\n position: absolute;\n pointer-events: none;\n z-index: 1000;\n ",e.getBoundingClientRect(),t.root.getBoundingClientRect(),t.root.scrollTop,t.root.scrollLeft;const o=document.createElement("div");o.style.cssText="\n position: absolute;\n top: -26px;\n right: 0;\n background: rgba(26,32,44,0.9);\n color: #fff;\n font-size: 11px;\n line-height: 1;\n padding: 4px 6px;\n border-radius: 4px;\n pointer-events: none;\n box-shadow: 0 2px 6px rgba(0,0,0,0.3);\n ";const r=e=>{try{const n=t.root.clientWidth||e||1,a=Math.max(1,Math.min(100,Math.round(e/n*100)));o.textContent="".concat(Math.round(e)," px (").concat(a,"%)")}catch(n){o.textContent="".concat(Math.round(e)," px")}},d=()=>{const a=e.getBoundingClientRect(),i=t.root.getBoundingClientRect(),o=t.root.scrollTop,r=t.root.scrollLeft;n.style.left="".concat(a.left-i.left+r,"px"),n.style.top="".concat(a.top-i.top+o,"px"),n.style.width="".concat(a.width,"px"),n.style.height="".concat(a.height,"px")};[{position:"right",cursor:"ew-resize",width:"12px",height:"60%"},{position:"bottom",cursor:"ns-resize",width:"60%",height:"12px"},{position:"left",cursor:"ew-resize",width:"12px",height:"60%"},{position:"top",cursor:"ns-resize",width:"60%",height:"12px"},{position:"bottom-right",cursor:"nwse-resize",width:"20px",height:"20px",isCorner:!0},{position:"bottom-left",cursor:"nesw-resize",width:"20px",height:"20px",isCorner:!0},{position:"top-right",cursor:"nesw-resize",width:"20px",height:"20px",isCorner:!0},{position:"top-left",cursor:"nwse-resize",width:"20px",height:"20px",isCorner:!0}].forEach(a=>{let{position:o,cursor:h,width:u,height:m,isCorner:p}=a;const x=document.createElement("div");x.className="custom-image-resize-handle custom-resize-".concat(o);let j="position: absolute; pointer-events: auto; transition: all 0.2s;";p?(j+="\n width: ".concat(u,";\n height: ").concat(m,";\n background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);\n border: 3px solid white;\n border-radius: 50%;\n box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(49, 130, 206, 0.3);\n "),"bottom-right"===o?j+="right: -8px; bottom: -8px;":"bottom-left"===o?j+="left: -8px; bottom: -8px;":"top-right"===o?j+="right: -8px; top: -8px;":"top-left"===o&&(j+="left: -8px; top: -8px;")):(j+="\n background: rgba(49, 130, 206, 0.6);\n border: 1px solid rgba(49, 130, 206, 0.8);\n ","right"===o?j+="width: ".concat(u,"; height: ").concat(m,"; right: -4px; top: 50%; transform: translateY(-50%);"):"bottom"===o?j+="width: ".concat(u,"; height: ").concat(m,"; bottom: -4px; left: 50%; transform: translateX(-50%);"):"left"===o?j+="width: ".concat(u,"; height: ").concat(m,"; left: -4px; top: 50%; transform: translateY(-50%);"):"top"===o&&(j+="width: ".concat(u,"; height: ").concat(m,"; top: -4px; left: 50%; transform: translateX(-50%);"))),j+="cursor: ".concat(h,";"),x.style.cssText=j,p?(x.addEventListener("mouseenter",()=>{x.style.transform="scale(1.3)",x.style.boxShadow="0 3px 12px rgba(0,0,0,0.5), 0 0 0 2px rgba(49, 130, 206, 0.5)"}),x.addEventListener("mouseleave",()=>{i||(x.style.transform="scale(1)",x.style.boxShadow="0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(49, 130, 206, 0.3)")})):(x.addEventListener("mouseenter",()=>{x.style.background="rgba(49, 130, 206, 0.9)"}),x.addEventListener("mouseleave",()=>{i||(x.style.background="rgba(49, 130, 206, 0.6)")})),x.addEventListener("pointerdown",n=>{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i=!0,s=n.clientX,l=n.clientY,c=e.offsetWidth;const a=e.offsetHeight,h=c/a,u=n=>{if(!i)return;const a=n.clientX-s,u=n.clientY-l;let m=c;o.includes("right")?m=c+a:o.includes("left")?m=c-a:(o.includes("bottom")||o.includes("top"))&&(m=c+u*h),m=Math.max(50,Math.min(m,t.root.clientWidth-40)),e.style.width="".concat(m,"px"),e.style.maxWidth="100%",e.style.height="auto";try{e.setAttribute("width",String(Math.round(m)))}catch(p){}xe(m),ve(m.toString());try{const e=t.root.clientWidth||m||1;be(Math.max(1,Math.min(100,Math.round(m/e*100))))}catch(x){}d(),r(m)},m=()=>{i=!1,document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",m),g.current(t.root.innerHTML);const e=v.current;setTimeout(()=>{if(e)try{var t;null===(t=b.current)||void 0===t||t.call(b,e)}catch(n){}},30)};document.addEventListener("pointermove",u),document.addEventListener("pointerup",m)}),n.appendChild(x)}),d(),r(e.offsetWidth||e.width||0),t.root.style.position="relative",t.root.appendChild(n),n.appendChild(o),a=n})(e),Q(e);const r=e.offsetWidth||e.width;xe(r),ve(r.toString());try{const e=t.root.clientWidth||r||1;be(Math.max(1,Math.min(100,Math.round(r/e*100))))}catch(k){}const d=e.getAttribute("data-filters");if(d)try{const e=JSON.parse(d);ae(e)}catch(z){ae({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1})}const u=e.getBoundingClientRect(),m=t.root.getBoundingClientRect(),p=t.root.scrollTop,x=t.root.scrollLeft;let j=window.innerWidth-u.right>400?u.right-m.left+x+10:u.left-m.left+x-380-10;j=Math.max(10,Math.min(j,m.width-380-10));let y=u.top-m.top+p;y=Math.max(10,y),ce({top:y,left:j}),oe(!0)};b.current=e=>{var t;const n=null===(t=u.current)||void 0===t?void 0:t.getEditor();if(!n)return;const a=n.root.querySelector('img[data-img-id="'.concat(e,'"]'));a&&m(a)};const p=()=>{n&&(n.style.outline="",n.style.cursor="",n.style.boxShadow="",n=null),h(),Q(null),oe(!1),xe(0),ve("")},j=e=>{const t=e.target;if("IMG"!==t.tagName)return t.classList.contains("custom-image-resize-handle")||t.classList.contains("custom-image-resize-container")||x.current&&(x.current===t||x.current.contains(t))?(e.preventDefault(),void e.stopPropagation()):void p();if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),r){const e=t.src;return he(e),void me(!0)}m(t)},y=e=>{const a=e.target;if("IMG"===a.tagName&&n===a){const r=a.getBoundingClientRect(),d=e.clientX<r.left+16,h=e.clientX>r.right-16,u=e.clientY<r.top+16,m=e.clientY>r.bottom-16;if(d||h||u||m){e.preventDefault(),e.stopPropagation(),i=!0,s=e.clientX,l=e.clientY,c=a.offsetWidth;const n=a.offsetHeight,o=c/Math.max(1,n),r=h?"right":d?"left":m?"bottom":"top",u=e=>{if(!i)return;const n=e.clientX-s,d=e.clientY-l;let h=c;"right"===r?h=c+n:"left"===r?h=c-n:"bottom"===r?h=c+d*o:"top"===r&&(h=c-d*o);const u=t.root.clientWidth-40;h=Math.max(50,Math.min(h,u));const m=a;m.style.width="".concat(h,"px"),m.style.maxWidth="100%",m.style.height="auto";try{m.setAttribute("width",String(Math.round(h)))}catch(p){}xe(h),ve(String(Math.round(h)));try{const e=t.root.clientWidth||h||1;be(Math.max(1,Math.min(100,Math.round(h/e*100))))}catch(x){}k()},p=()=>{i=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p),g.current(t.root.innerHTML)};return document.addEventListener("mousemove",u),void document.addEventListener("mouseup",p)}e.preventDefault(),e.stopPropagation(),o=!0,s=e.clientX,l=e.clientY;const p=n.style.marginLeft||"",x=n.style.marginRight||"";let v="center";"0"===p||"0px"===p?v="left":"0"!==x&&"0px"!==x||(v="right"),a.setAttribute("draggable","false");const j=e=>{if(!o||!n)return;const t=e.clientX-s;if(Math.abs(t)>50){const a=t>0?"right":"left";a!==v&&(v=a,s=e.clientX,n.style.display="block",n.style.float="none","right"===a?(n.style.marginLeft="auto",n.style.marginRight="0"):(n.style.marginLeft="0",n.style.marginRight="auto"))}},b=()=>{o=!1,document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",b),n&&g.current(t.root.innerHTML)};document.addEventListener("mousemove",j),document.addEventListener("mouseup",b)}},f=e=>{const a=e.target,i=null===a||void 0===a?void 0:a.tagName;"INPUT"===i||"TEXTAREA"===i||a&&a.isContentEditable||!n||"Delete"!==e.key&&"Backspace"!==e.key||(e.preventDefault(),n.remove(),p(),g.current(t.root.innerHTML),d({title:"Obr\xe1zek odstran\u011bn",status:"info",duration:1500}))},k=()=>{if(n&&a){const e=n.getBoundingClientRect(),i=t.root.getBoundingClientRect(),o=t.root.scrollTop,r=t.root.scrollLeft;a.style.left="".concat(e.left-i.left+r,"px"),a.style.top="".concat(e.top-i.top+o,"px"),a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px")}},z=e=>{if("IMG"===e.target.tagName)return e.preventDefault(),e.stopPropagation(),!1};return t.root.addEventListener("click",j),t.root.addEventListener("mousedown",y),t.root.addEventListener("scroll",k),t.root.addEventListener("dragstart",z),document.addEventListener("keydown",f),window.addEventListener("resize",k),document.addEventListener("scroll",k,!0),()=>{t.root.removeEventListener("click",j),t.root.removeEventListener("mousedown",y),t.root.removeEventListener("scroll",k),t.root.removeEventListener("dragstart",z),document.removeEventListener("keydown",f),window.removeEventListener("resize",k),document.removeEventListener("scroll",k,!0),h(),p()}},[r,d,f]);const we=(0,a.useCallback)((e,t)=>{const n="\n brightness(".concat(t.brightness,"%)\n contrast(").concat(t.contrast,"%)\n saturate(").concat(t.saturation,"%)\n blur(").concat(t.blur,"px)\n grayscale(").concat(t.grayscale,"%)\n sepia(").concat(t.sepia,"%)\n hue-rotate(").concat(t.hueRotate,"deg)\n ").trim(),a="\n rotate(".concat(t.rotation,"deg)\n scaleX(").concat(t.flipH?-1:1,")\n scaleY(").concat(t.flipV?-1:1,")\n ").trim();e.style.filter=n,e.style.transform=a,e.setAttribute("data-filters",JSON.stringify(t))},[]),_e=(0,a.useCallback)(()=>{const e={brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1};ae(e),X&&we(X,e)},[X,we]),Se=(0,a.useCallback)((e,t)=>{ae(n=>{const a=(0,h.A)((0,h.A)({},n),{},{[e]:t});return X&&we(X,a),a})},[X,we]),[Ce,Ae]=(0,a.useState)(!1),Ee=(0,a.useCallback)(async()=>{if(X)try{var e;Ae(!0),d({title:"Zpracov\xe1n\xed filtry...",status:"info",duration:2e3});const t=X.src,n=ne.brightness-100,i=ne.contrast-100,o=ne.saturation-100,r=await $r({image_url:t,width:X.offsetWidth||void 0,rotation:ne.rotation,flip_h:ne.flipH,flip_v:ne.flipV,brightness:n,contrast:i,saturation:o,grayscale:ne.grayscale>0,quality:85}),s=W(r.url)||r.url;X.src=s,ae({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1}),X.style.filter="",X.style.transform="",X.removeAttribute("data-filters");const l=null===(e=u.current)||void 0===e?void 0:e.getEditor();if(l){g.current(l.root.innerHTML);try{l.root.dispatchEvent(new Event("scroll"))}catch(a){}}Ne(),d({title:"Filtry aplikov\xe1ny",status:"success",duration:2e3})}catch(i){var t,n;console.error("Apply filters error:",i),d({title:"Aplikace filtr\u016f selhala",description:(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===i||void 0===i?void 0:i.message),status:"error"})}finally{Ae(!1)}},[X,ne,d]),Te=(0,a.useCallback)(e=>{if(X){var t;X.style.display="block",X.style.float="none","left"===e?(X.style.marginLeft="0",X.style.marginRight="auto"):"center"===e?(X.style.marginLeft="auto",X.style.marginRight="auto"):"right"===e&&(X.style.marginLeft="auto",X.style.marginRight="0");const a=null===(t=u.current)||void 0===t?void 0:t.getEditor();if(a){g.current(a.root.innerHTML);try{a.root.dispatchEvent(new Event("scroll"))}catch(n){}}Ne(),d({title:"Obr\xe1zek zarovn\xe1n ".concat("left"===e?"vlevo":"center"===e?"na st\u0159ed":"vpravo"),status:"success",duration:1500})}},[X,d]),Ne=(0,a.useCallback)(()=>{const e=v.current;e&&setTimeout(()=>{try{var t;null===(t=b.current)||void 0===t||t.call(b,e)}catch(n){}},30)},[]),Re=(0,a.useCallback)((e,t)=>{var n;if(!X)return;const a=null===(n=u.current)||void 0===n?void 0:n.getEditor(),i=a?a.root.clientWidth-40:1200,o=Math.min(Math.max(50,Math.round(e)),i);if(X.style.width="".concat(o,"px"),X.style.height="auto",X.style.maxWidth="100%",X.setAttribute("width",String(o)),xe(o),ve(o.toString()),a){g.current(a.root.innerHTML);try{a.root.dispatchEvent(new Event("scroll"))}catch(r){}}Ne(),null!==t&&void 0!==t&&t.silent||d({title:"\u0160\xed\u0159ka nastavena",description:"".concat(o,"px"),status:"success",duration:1500})},[X,d]),Pe=(0,a.useCallback)(()=>{var e;if(!X)return;const t=null===(e=u.current)||void 0===e?void 0:e.getEditor();X.style.width="",X.style.height="",X.style.maxWidth="100%",X.removeAttribute("width");const n=X.offsetWidth||X.width||0;if(xe(n),ve(""),t){g.current(t.root.innerHTML);try{t.root.dispatchEvent(new Event("scroll"))}catch(a){}}Ne(),d({title:"\u0160\xed\u0159ka resetov\xe1na",status:"info",duration:1200})},[X,d]),Ie=(0,a.useCallback)((e,t)=>{var n;const a=Math.max(5,Math.min(100,Math.round(e)));be(a);const i=null===(n=u.current)||void 0===n?void 0:n.getEditor();if(i&&X){const e=i.root.clientWidth*a/100;Re(e,t)}},[Re,X]),We=(0,a.useCallback)(()=>{if(X&&ge){const t=ge.trim();if(t.endsWith("%")){var e;const n=parseFloat(t.slice(0,-1)),a=null===(e=u.current)||void 0===e?void 0:e.getEditor();if(a&&!isNaN(n)&&n>0){const e=a.root.clientWidth*n/100;return void Re(e)}}const n=parseInt(t,10);!isNaN(n)&&n>0?Re(n):d({title:"Neplatn\xe1 \u0161\xed\u0159ka",description:"Zadejte kladn\xe9 \u010d\xedslo nebo procenta (nap\u0159. 50%)",status:"warning",duration:1500})}},[X,ge,d,Re]),Me=(0,a.useCallback)(()=>{if(X){var e;X.remove(),Q(null),oe(!1);const t=null===(e=u.current)||void 0===e?void 0:e.getEditor();t&&g.current(t.root.innerHTML),d({title:"Obr\xe1zek odstran\u011bn",status:"info",duration:1500})}},[X,d]);return(0,p.jsxs)(y.a,{children:[!r&&s&&(0,p.jsxs)(ee.z,{mb:2,spacing:2,justify:"flex-start",flexWrap:"wrap",children:[(0,p.jsx)(T.$,{size:"sm",leftIcon:(0,p.jsx)(Kn.A,{size:16}),colorScheme:"purple",onClick:ke,children:"Vlo\u017eit obr\xe1zek"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"nebo pou\u017eijte tla\u010d\xedtko obr\xe1zku v n\xe1strojov\xe9 li\u0161t\u011b"})]}),(0,p.jsx)(y.a,{position:"relative",borderWidth:"1px",borderColor:G,borderRadius:"md",overflow:"hidden",bg:"white",sx:{".ql-toolbar":{borderBottom:"1px solid",borderColor:G,bg:"gray.50",display:"flex",flexWrap:"wrap",gap:"4px",padding:"12px","& button":{color:"gray.700 !important",width:"32px !important",height:"32px !important",borderRadius:"6px",transition:"all 0.2s","&:hover":{background:"rgba(49, 130, 206, 0.1) !important",transform:"scale(1.05)"},"&.ql-active":{background:"rgba(49, 130, 206, 0.2) !important",color:"#3182ce !important"}},"& .ql-stroke":{stroke:"gray.700 !important"},"& .ql-fill":{fill:"gray.700 !important"},"& .ql-active .ql-stroke":{stroke:"#3182ce !important"},"& .ql-active .ql-fill":{fill:"#3182ce !important"},"& .ql-picker":{color:"gray.700 !important"},"& .ql-picker-label":{borderRadius:"6px",padding:"4px 8px",transition:"all 0.2s","&:hover":{background:"rgba(49, 130, 206, 0.1) !important"}},"& .ql-picker-options":{background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"8px"}},".ql-container":{fontSize:"16px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',bg:"white"},".ql-editor":{minHeight:o,maxHeight:"70vh",overflowY:"auto",bg:"white !important",color:"#1a202c !important",padding:"16px",lineHeight:"1.6","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{bg:"gray.100"},"&::-webkit-scrollbar-thumb":{bg:"gray.400",borderRadius:"4px"},"h1, h2, h3, h4, h5, h6":{color:"#1a202c !important"},h1:{fontSize:"2em !important",fontWeight:"bold !important",marginTop:"0.67em !important",marginBottom:"0.67em !important",lineHeight:"1.2 !important"},h2:{fontSize:"1.5em !important",fontWeight:"bold !important",marginTop:"0.83em !important",marginBottom:"0.83em !important",lineHeight:"1.3 !important"},h3:{fontSize:"1.17em !important",fontWeight:"bold !important",marginTop:"1em !important",marginBottom:"1em !important",lineHeight:"1.4 !important"},"p, li, span, div":{color:"#2d3748 !important"},"strong, b":{color:"#1a202c !important",fontWeight:"bold !important"},a:{color:"#3182ce !important",textDecoration:"underline"},blockquote:{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:"#4a5568 !important",fontStyle:"italic",backgroundColor:"#f7fafc",padding:"12px 16px",borderRadius:"4px"},code:{backgroundColor:"#f7fafc",padding:"2px 6px",borderRadius:"3px",color:"#e53e3e !important",fontFamily:"monospace"},pre:{backgroundColor:"#2d3748",color:"#f7fafc !important",padding:"16px",borderRadius:"6px",overflow:"auto"},"ul, ol":{paddingLeft:"1.5em",margin:"0.5em 0"},img:{cursor:"pointer",maxWidth:"100%",height:"auto",display:"block",margin:"12px 0",transition:"all 0.2s ease",borderRadius:"4px",userSelect:"none",pointerEvents:"auto",WebkitUserDrag:"none",userDrag:"none","&:hover":{opacity:.95,transform:"scale(1.01)"}}},".ql-editor.ql-blank::before":{color:"#a0aec0 !important",fontStyle:"italic"},'.ql-editor [style*="color: rgb(255, 255, 255)"]':{color:"#1a202c !important"},'.ql-editor [style*="color: white"]':{color:"#1a202c !important"},'.ql-editor [style*="color: #fff"]':{color:"#1a202c !important"},'.ql-editor [style*="color: #ffffff"]':{color:"#1a202c !important"},'.ql-editor [style*="color: rgb(255,255,255)"]':{color:"#1a202c !important"}},children:f&&(0,p.jsx)(Er(),{theme:"snow",value:t,onChange:e=>{let t=ai.A.sanitize(e,{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["target","rel","allow","allowfullscreen","style","data-filters"]});[/color:\s*rgb\(255,\s*255,\s*255\)/gi,/color:\s*rgb\(255\s*,\s*255\s*,\s*255\)/gi,/color:\s*white/gi,/color:\s*#fff(?:fff)?(?=[;\s"'])/gi,/color:\s*rgba?\(255,\s*255,\s*255/gi,/color:\s*rgb\(25[0-4],\s*25[0-4],\s*25[0-4]\)/gi,/color:\s*rgb\(24[5-9],\s*24[5-9],\s*24[5-9]\)/gi].forEach(e=>{t=t.replace(e,"color: #1a202c")}),g.current(t)},readOnly:r,placeholder:i,ref:u,modules:ze})}),!r&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:["\ud83d\udca1 ",(0,p.jsx)("strong",{children:"Tip:"})," Klikn\u011bte na obr\xe1zek pro v\xfdb\u011br. Pot\xe9 m\u016f\u017eete: \u2022 P\u0159et\xe1hnout pro zarovn\xe1n\xed \u2022 Zm\u011bnit velikost ta\u017een\xedm modr\xe9ho bodu \u2022 Upravit filtry a transformace \u2022 Stisknout Delete pro smaz\xe1n\xed"]}),ie&&X&&!r&&(0,p.jsx)(y.a,{ref:x,position:"absolute",top:"".concat(re.top,"px"),left:"".concat(re.left,"px"),bg:"white",borderWidth:"2px",borderColor:"blue.400",borderRadius:"lg",boxShadow:"2xl",p:3,zIndex:9999,minW:"320px",maxW:"380px",maxH:"80vh",overflowY:"auto",pointerEvents:"auto",onClick:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},css:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#888",borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:"#555"}},children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(Nr.A,{size:16}),(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:"\xdaprava obr\xe1zku"})]}),(0,p.jsx)(K.K,{"aria-label":"Close",icon:(0,p.jsx)(Rr.A,{size:16}),size:"xs",onClick:()=>oe(!1),variant:"ghost"})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"Zarovn\xe1n\xed"}),(0,p.jsxs)(ee.z,{spacing:2,justify:"stretch",children:[(0,p.jsx)(te.m,{label:"Zarovnat vlevo",children:(0,p.jsx)(K.K,{"aria-label":"Align left",icon:(0,p.jsx)(Pr.A,{size:16}),size:"sm",onClick:()=>Te("left"),colorScheme:"teal",variant:"outline",flex:1})}),(0,p.jsx)(te.m,{label:"Zarovnat na st\u0159ed",children:(0,p.jsx)(K.K,{"aria-label":"Align center",icon:(0,p.jsx)(Ir.A,{size:16}),size:"sm",onClick:()=>Te("center"),colorScheme:"teal",variant:"outline",flex:1})}),(0,p.jsx)(te.m,{label:"Zarovnat vpravo",children:(0,p.jsx)(K.K,{"aria-label":"Align right",icon:(0,p.jsx)(Wr.A,{size:16}),size:"sm",onClick:()=>Te("right"),colorScheme:"teal",variant:"outline",flex:1})})]})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"\u0160\xed\u0159ka obr\xe1zku"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(C.p,{size:"sm",type:"number",value:ge,onChange:e=>ve(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),We())},placeholder:"\u0160\xed\u0159ka v px",min:50}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:We,minW:"80px",children:"Nastavit"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["Aktu\xe1ln\xed: ",pe,"px (",je||0,"%)"]}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>Ie(25,{silent:!0}),children:"25%"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>Ie(50,{silent:!0}),children:"50%"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>Ie(75,{silent:!0}),children:"75%"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>Ie(100,{silent:!0}),children:"100%"}),(0,p.jsx)(T.$,{size:"xs",colorScheme:"gray",variant:"ghost",onClick:Pe,children:"Reset"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(S.l,{fontSize:"xs",mb:0,children:"\u0160\xed\u0159ka (%)"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[je||0,"%"]})]}),(0,p.jsx)("input",{type:"range",min:"5",max:"100",value:je||0,onChange:e=>Ie(Number(e.target.value),{silent:!0}),style:{width:"100%"}})]})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"Transformace"}),(0,p.jsxs)(ee.z,{spacing:2,flexWrap:"wrap",children:[(0,p.jsx)(te.m,{label:"Oto\u010dit doleva",children:(0,p.jsx)(K.K,{"aria-label":"Rotate left",icon:(0,p.jsx)(Mr.A,{size:16}),size:"sm",onClick:()=>Se("rotation",(ne.rotation-90)%360),colorScheme:"blue",variant:"outline"})}),(0,p.jsx)(te.m,{label:"Oto\u010dit doprava",children:(0,p.jsx)(K.K,{"aria-label":"Rotate right",icon:(0,p.jsx)(Dr.A,{size:16}),size:"sm",onClick:()=>Se("rotation",(ne.rotation+90)%360),colorScheme:"blue",variant:"outline"})}),(0,p.jsx)(te.m,{label:"P\u0159evr\xe1tit horizont\xe1ln\u011b",children:(0,p.jsx)(K.K,{"aria-label":"Flip horizontal",icon:(0,p.jsx)(Ur.A,{size:16}),size:"sm",onClick:()=>Se("flipH",!ne.flipH),colorScheme:"blue",variant:ne.flipH?"solid":"outline"})}),(0,p.jsx)(te.m,{label:"P\u0159evr\xe1tit vertik\xe1ln\u011b",children:(0,p.jsx)(K.K,{"aria-label":"Flip vertical",icon:(0,p.jsx)(Lr.A,{size:16}),size:"sm",onClick:()=>Se("flipV",!ne.flipV),colorScheme:"blue",variant:ne.flipV?"solid":"outline"})}),(0,p.jsx)(te.m,{label:"Smazat obr\xe1zek",children:(0,p.jsx)(K.K,{"aria-label":"Delete image",icon:(0,p.jsx)(Fr.A,{size:16}),size:"sm",onClick:Me,colorScheme:"red",variant:"outline"})}),(0,p.jsx)(te.m,{label:"Resetovat filtry",children:(0,p.jsx)(K.K,{"aria-label":"Reset filters",icon:(0,p.jsx)(Mr.A,{size:16}),size:"sm",onClick:_e,colorScheme:"gray",variant:"outline"})})]})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Or.A,{size:14}),(0,p.jsx)(S.l,{fontSize:"xs",mb:0,children:"Jas"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[ne.brightness,"%"]})]}),(0,p.jsx)("input",{type:"range",min:"0",max:"200",value:ne.brightness,onChange:e=>Se("brightness",Number(e.target.value)),style:{width:"100%"}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Zr.A,{size:14}),(0,p.jsx)(S.l,{fontSize:"xs",mb:0,children:"Kontrast"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[ne.contrast,"%"]})]}),(0,p.jsx)("input",{type:"range",min:"0",max:"200",value:ne.contrast,onChange:e=>Se("contrast",Number(e.target.value)),style:{width:"100%"}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Kr.A,{size:14}),(0,p.jsx)(S.l,{fontSize:"xs",mb:0,children:"Sytost"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[ne.saturation,"%"]})]}),(0,p.jsx)("input",{type:"range",min:"0",max:"200",value:ne.saturation,onChange:e=>Se("saturation",Number(e.target.value)),style:{width:"100%"}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(rn.A,{size:14}),(0,p.jsx)(S.l,{fontSize:"xs",mb:0,children:"Rozost\u0159en\xed"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[ne.blur,"px"]})]}),(0,p.jsx)("input",{type:"range",min:"0",max:"10",step:"0.5",value:ne.blur,onChange:e=>Se("blur",Number(e.target.value)),style:{width:"100%"}})]})]}),(0,p.jsxs)(ee.z,{spacing:2,flexWrap:"wrap",children:[(0,p.jsx)(T.$,{size:"xs",onClick:()=>{Se("grayscale",100===ne.grayscale?0:100)},colorScheme:100===ne.grayscale?"purple":"gray",variant:100===ne.grayscale?"solid":"outline",leftIcon:(0,p.jsx)(qr.A,{size:12}),children:"\u010cernob\xedl\xe1"}),(0,p.jsx)(T.$,{size:"xs",onClick:()=>{Se("sepia",100===ne.sepia?0:100)},colorScheme:100===ne.sepia?"orange":"gray",variant:100===ne.sepia?"solid":"outline",leftIcon:(0,p.jsx)(Vr.A,{size:12}),children:"Sepia"})]}),(0,p.jsx)(T.$,{colorScheme:"green",size:"md",width:"full",onClick:Ee,isLoading:Ce,loadingText:"Zpracov\xe1n\xed...",leftIcon:(0,p.jsx)(Hr.A,{size:16}),children:"Aplikovat v\u0161echny zm\u011bny"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:"\ud83d\udca1 Filtry jsou pouze n\xe1hled. Klikn\u011bte pro trvalou aplikaci."})]})}),(0,p.jsxs)(se.aF,{isOpen:ue,onClose:()=>me(!1),size:"6xl",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.800",backdropFilter:"blur(4px)"}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",bg:"transparent",boxShadow:"none",children:[(0,p.jsx)(B.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"}}),(0,p.jsx)(Y.c,{display:"flex",alignItems:"center",justifyContent:"center",p:0,children:de&&(0,p.jsx)(k._,{src:de,alt:"Preview",maxW:"100%",maxH:"90vh",objectFit:"contain",borderRadius:"md",boxShadow:"2xl"})})]})]}),(0,p.jsxs)(se.aF,{isOpen:A,onClose:()=>{E(!1),R(null)},size:"6xl",children:[(0,p.jsx)(H.m,{bg:"blackAlpha.700",backdropFilter:"blur(4px)"}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",children:[(0,p.jsx)(J.r,{children:"O\u0159\xedznout a upravit obr\xe1zek"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{maxH:"calc(90vh - 140px)",overflowY:"auto",overflowX:"hidden",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[N&&(0,p.jsx)(y.a,{display:"flex",justifyContent:"center",alignItems:"center",p:4,bg:"gray.50",borderRadius:"md",children:(0,p.jsx)(Tr.Ay,{crop:M,onChange:e=>D(e),minWidth:50,minHeight:50,keepSelection:!0,children:(0,p.jsx)("img",{ref:$,src:N||"",alt:"Crop preview",style:{maxWidth:"100%",maxHeight:"60vh",display:"block",margin:"auto"}})})}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Max. \u0161\xed\u0159ka (px)"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"number",value:O,onChange:e=>Z(Math.max(100,Math.min(3e3,Number(e.target.value)))),min:100,max:3e3,step:100,size:"sm"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",whiteSpace:"nowrap",children:"px"})]}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"V\u011bt\u0161\xed obr\xe1zky budou zmen\u0161eny (optimalizace v\xfdkonu)"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Kvalita JPEG"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"number",value:L,onChange:e=>F(Math.max(1,Math.min(100,Number(e.target.value)))),min:1,max:100,step:5,size:"sm"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",whiteSpace:"nowrap",children:"%"})]}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"85% je doporu\u010den\xe1 hodnota (men\u0161\xed velikost souboru)"})]})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"\ud83d\udca1 P\u0159et\xe1hn\u011bte rohy a hrany modr\xe9 oblasti pro v\xfdb\u011br \u010d\xe1sti obr\xe1zku k o\u0159\xedznut\xed."})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:()=>{E(!1),R(null),I(null)},isDisabled:q,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{try{var e;if(V(!0),!P)return void d({title:"Chyba",description:"Soubor nen\xed na\u010dten",status:"error"});if(!$.current)return void d({title:"Chyba",description:"Obr\xe1zek nen\xed na\u010dten",status:"error"});const t=$.current,n=t.width,a=t.height,i=t.naturalWidth||n,o=t.naturalHeight||a,r=i/Math.max(1,n),s=o/Math.max(1,a),l=(e,t)=>"%"===M.unit?e/100*t:e;let c;if(M.width&&M.height&&M.width>0&&M.height>0){const e=Math.max(0,l(M.x||0,n)),t=Math.max(0,l(M.y||0,a)),d=Math.min(n,l(M.width||n,n)),h=Math.min(a,l(M.height||a,a));let u=Math.round(e*r),m=Math.round(t*s),p=Math.round(d*r),x=Math.round(h*s);u+p>i&&(p=i-u),m+x>o&&(x=o-m),p=Math.max(1,p),x=Math.max(1,x),c={x:u,y:m,width:p,height:x}}d({title:"Zpracov\xe1n\xed obr\xe1zku...",status:"info",duration:2e3});const h=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:85,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1500;const i=new FormData;return i.append("image",e),t&&i.append("crop_data",JSON.stringify(t)),i.append("quality",n.toString()),i.append("max_width",a.toString()),(await m.Ay.post("/image-processing/crop-upload",i,{headers:{"Content-Type":"multipart/form-data"}})).data}(P,c,L,O);if(!h.url)throw new Error("Upload failed - no URL returned");const p=null===(e=u.current)||void 0===e?void 0:e.getEditor();p&&(p.focus(),setTimeout(()=>{try{const e=p.getSelection(),t=e?e.index:p.getLength(),n=W(h.url)||h.url,a=new Image;a.onload=()=>{try{p.insertEmbed(t,"image",n,"api"),p.setSelection(t+1,0,"api"),g.current(p.root.innerHTML),d({title:"Obr\xe1zek vlo\u017een",status:"success",duration:2e3})}catch(e){console.error("Insert after preload error:",e),d({title:"Chyba p\u0159i vkl\xe1d\xe1n\xed obr\xe1zku",description:String(e),status:"error"})}},a.onerror=()=>{d({title:"Obr\xe1zek nelze na\u010d\xedst",description:n,status:"error"})},a.src=n}catch(e){console.error("Error inserting image:",e),d({title:"Chyba p\u0159i vkl\xe1d\xe1n\xed obr\xe1zku",description:String(e),status:"error"})}},50))}catch(a){var t,n;console.error("Crop and insert error:",a),d({title:"Zpracov\xe1n\xed obr\xe1zku selhalo",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===a||void 0===a?void 0:a.message)||"Chyba",status:"error"})}finally{V(!1),E(!1),R(null),I(null),D({unit:"%",width:80,height:80,x:10,y:10}),F(85),Z(1500)}},isLoading:q,loadingText:"Zpracov\xe1n\xed...",children:"O\u0159\xedznout a vlo\u017eit"})]})]})]})]})},Jr=e=>{let{value:t,onChange:n,placeholder:a="Za\u010dn\u011bte ps\xe1t...",height:i="400px",readOnly:o=!1,onImageUpload:r=jt,showImageResize:s=!0,toolbar:l="full"}=e;return(0,p.jsx)(Br,{value:t,onChange:n,placeholder:a,height:i,readOnly:o,onImageUpload:async e=>{const t=await r(e);return{url:W(t.url)||t.url}},showImageResize:s,toolbar:l})},Yr=e=>{let{isOpen:t,onClose:n,onPhotosSelected:i}=e;const[o,r]=(0,a.useState)(""),[s,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),[h,u]=(0,a.useState)(new Set),x=(0,j.d)(),g=async()=>{if(o.trim())if(o.includes("/Album/")){l(!0);try{const e=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={link:e};return"number"===typeof t.photo_limit&&(n.photo_limit=String(t.photo_limit)),"boolean"===typeof t.rendered&&(n.rendered=String(t.rendered)),(await m.Ay.get("/zonerama/album",{params:n})).data}(o,{photo_limit:100});let t=null,n=[];if(e.albums&&Array.isArray(e.albums)&&e.albums.length>0)t=e.albums[0],n=t.photos||[];else{if(!e.album||!e.photos)throw new Error("Album nenalezeno - neplatn\xe1 odpov\u011b\u010f ze serveru");t=e.album,n=e.photos}if(!t)throw new Error("Album nenalezeno");const a=n.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||""}));d({id:t.id||"",title:t.title||"",url:t.url||o,date:t.date||"",photos_count:a.length,photos:a}),u(new Set),x({title:"Album na\u010dteno",description:"".concat(a.length," fotografi\xed"),status:"success",duration:2e3})}catch(e){console.error("Album fetch error:",e),x({title:"Chyba na\u010d\xedt\xe1n\xed alba",description:e.message||"Nepoda\u0159ilo se na\u010d\xedst album",status:"error",duration:5e3})}finally{l(!1)}}else x({title:"Neplatn\xfd odkaz",description:'URL mus\xed obsahovat "/Album/"',status:"error",duration:3e3});else x({title:"Zadejte URL alba",status:"warning",duration:3e3})},v=()=>{r(""),d(null),u(new Set),n()};return(0,p.jsxs)(se.aF,{isOpen:t,onClose:v,size:"6xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxH:"90vh",children:[(0,p.jsx)(J.r,{children:"Vybrat fotografie z alba"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{overflowY:"auto",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL Zonerama alba"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{value:o,onChange:e=>r(e.target.value),placeholder:"https://eu.zonerama.com/Account/Album/12345",onKeyPress:e=>"Enter"===e.key&&g()}),(0,p.jsx)(T.$,{onClick:g,isLoading:s,colorScheme:"blue",leftIcon:(0,p.jsx)(so.A,{size:18}),children:"Na\u010d\xedst"})]}),(0,p.jsx)(_.eK,{children:"Vlo\u017ete odkaz na Zonerama album (mus\xed obsahovat /Album/)"})]}),s&&(0,p.jsxs)(w.T,{py:8,children:[(0,p.jsx)(zn.y,{size:"xl",color:"blue.500"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m album..."})]}),c&&!s&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(y.a,{p:4,bg:"blue.50",borderRadius:"md",borderWidth:"1px",borderColor:"blue.200",children:(0,p.jsxs)(w.T,{align:"start",spacing:2,children:[(0,p.jsxs)(ee.z,{justify:"space-between",w:"full",children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:c.title}),(0,p.jsx)(T.$,{as:"a",href:c.url,target:"_blank",rel:"noopener noreferrer",size:"sm",variant:"ghost",rightIcon:(0,p.jsx)(ri.A,{size:14}),children:"Zonerama"})]}),(0,p.jsxs)(ee.z,{spacing:4,fontSize:"sm",color:"gray.700",children:[c.date&&(0,p.jsxs)(U.E,{children:["\ud83d\udcc5 ",c.date]}),(0,p.jsxs)(Qt.E,{colorScheme:"blue",children:[c.photos.length," fotografi\xed"]})]})]})}),(0,p.jsx)(ee.z,{justify:"space-between",children:(0,p.jsxs)(N.S,{isChecked:h.size===c.photos.length,isIndeterminate:h.size>0&&h.size<c.photos.length,onChange:()=>{c&&(h.size===c.photos.length?u(new Set):u(new Set(c.photos.map(e=>e.id))))},children:["Vybrat v\u0161e (",h.size,"/",c.photos.length,")"]})}),(0,p.jsx)(Tt.r,{columns:{base:3,md:4,lg:5},spacing:3,children:c.photos.map(e=>(0,p.jsxs)(y.a,{position:"relative",cursor:"pointer",onClick:()=>(e=>{const t=new Set(h);t.has(e)?t.delete(e):t.add(e),u(t)})(e.id),borderRadius:"md",overflow:"hidden",borderWidth:"2px",borderColor:h.has(e.id)?"blue.500":"transparent",transition:"all 0.2s",_hover:{transform:"scale(1.05)"},children:[(0,p.jsx)(k._,{src:e.image_1500,alt:e.id,w:"100%",h:"150px",objectFit:"cover"}),(0,p.jsx)(N.S,{position:"absolute",top:2,right:2,isChecked:h.has(e.id),pointerEvents:"none",bg:"white",borderRadius:"sm"})]},e.id))})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(T.$,{variant:"ghost",onClick:v,children:"Zru\u0161it"}),(0,p.jsxs)(T.$,{colorScheme:"blue",onClick:()=>{if(!c||0===h.size)return void x({title:"Vyberte fotografie",status:"warning",duration:3e3});const e=c.photos.filter(e=>h.has(e.id));i(e,c),v()},isDisabled:!c||0===h.size,children:["Vybrat (",h.size,")"]})]})})]})]})};var Gr=n(3407),Xr=n(4937),Qr=n(8584),es=n(349),ts=n(7575);const ns=e=>{let{articleId:t,eventId:n,onPollsChanged:i}=e;const o=(0,j.d)(),r=(0,l.jE)(),[s,c]=(0,a.useState)(!0),[d,u]=(0,a.useState)(""),[m,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)({title:"",description:"",type:"single",style:"auto",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),f=(0,b.dU)("gray.50","gray.700"),k=(0,b.dU)("gray.200","gray.600"),z=t?{article_id:t}:n?{event_id:n}:{},{data:A,isLoading:E}=(0,xe.I)({queryKey:["linked-polls",z],queryFn:()=>wn(z),enabled:!(!t&&!n)}),{data:N,isLoading:R}=(0,xe.I)({queryKey:["all-admin-polls"],queryFn:()=>wn({status:"active"})}),P=(0,Mn.n)({mutationFn:async e=>{const a={};return t&&(a.related_article_id=t),n&&(a.related_event_id=n),An(e,a)},onSuccess:()=>{r.invalidateQueries({queryKey:["linked-polls"]}),r.invalidateQueries({queryKey:["all-admin-polls"]}),o({title:"Anketa propojena",status:"success",duration:3e3}),u(""),i&&i()},onError:e=>{var t,n;o({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se propojit anketu",status:"error",duration:5e3})}}),I=(0,Mn.n)({mutationFn:async e=>{const a={};return t&&(a.related_article_id=null),n&&(a.related_event_id=null),An(e,a)},onSuccess:()=>{r.invalidateQueries({queryKey:["linked-polls"]}),r.invalidateQueries({queryKey:["all-admin-polls"]}),o({title:"Anketa odpojena",status:"success",duration:3e3}),i&&i()},onError:e=>{var t,n;o({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se odpojit anketu",status:"error",duration:5e3})}}),W=(0,Mn.n)({mutationFn:async e=>{const a=(0,h.A)({},e);return t&&(a.related_article_id=t),n&&(a.related_event_id=n),Cn(a)},onSuccess:()=>{r.invalidateQueries({queryKey:["linked-polls"]}),r.invalidateQueries({queryKey:["all-admin-polls"]}),o({title:"Anketa vytvo\u0159ena a propojena",status:"success",duration:3e3}),x(!1),M(),i&&i()},onError:e=>{var t,n;o({title:"Chyba p\u0159i vytv\xe1\u0159en\xed ankety",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se vytvo\u0159it anketu",status:"error",duration:5e3})}}),M=()=>{v({title:"",description:"",type:"single",style:"auto",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]})},D=new Set((null===A||void 0===A?void 0:A.map(e=>e.id))||[]),L=(null===N||void 0===N?void 0:N.filter(e=>!D.has(e.id)))||[];return t||n?(0,p.jsx)(y.a,{borderWidth:"1px",borderColor:k,borderRadius:"md",p:4,bg:f,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsxs)(U.E,{fontWeight:"bold",fontSize:"sm",children:["Ankety (",(null===A||void 0===A?void 0:A.length)||0,")"]}),((null===A||void 0===A?void 0:A.length)||0)>0&&(0,p.jsxs)(Qt.E,{colorScheme:"blue",children:[A.length," p\u0159ipojeno"]})]}),(0,p.jsx)(K.K,{"aria-label":s?"Skr\xfdt":"Zobrazit",icon:s?(0,p.jsx)(Xr.M,{}):(0,p.jsx)(me.D,{}),size:"sm",variant:"ghost",onClick:()=>c(!s)})]}),(0,p.jsx)(Gr.S,{in:s,children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[E?(0,p.jsxs)(ee.z,{justify:"center",py:4,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Na\u010d\xedt\xe1n\xed anket..."})]}):A&&A.length>0?(0,p.jsxs)(w.T,{spacing:2,align:"stretch",children:[(0,p.jsx)(U.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",children:"P\u0159ipojen\xe9 ankety:"}),A.map(e=>(0,p.jsxs)(ee.z,{p:2,borderWidth:"1px",borderRadius:"md",justify:"space-between",bg:"white",_dark:{bg:"gray.800"},children:[(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:e.title}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(Qt.E,{size:"sm",colorScheme:"active"===e.status?"green":"gray",children:e.status}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[e.total_votes," hlas\u016f"]})]})]}),(0,p.jsx)(K.K,{"aria-label":"Odpojit anketu",icon:(0,p.jsx)(Qr.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>{return t=e.id,void(window.confirm("Opravdu chcete odpojit tuto anketu?")&&I.mutate(t));var t},isLoading:I.isPending})]},e.id))]}):(0,p.jsxs)(xa.F,{status:"info",size:"sm",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"\u017d\xe1dn\xe9 ankety nejsou p\u0159ipojeny"})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(ra.t,{size:"sm",variant:"enclosed",defaultIndex:1,children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Propojit existuj\xedc\xed"}),(0,p.jsx)(la.o,{children:"Vytvo\u0159it novou"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{px:0,py:3,children:R?(0,p.jsx)(ee.z,{justify:"center",py:4,children:(0,p.jsx)(zn.y,{size:"sm"})}):L.length>0?(0,p.jsx)(w.T,{spacing:3,align:"stretch",children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(ha.l,{value:d,onChange:e=>u(e.target.value),placeholder:"Vyberte anketu...",size:"sm",flex:1,children:L.map(e=>(0,p.jsxs)("option",{value:e.id,children:[e.title," (",e.status,") - ",e.total_votes," hlas\u016f"]},e.id))}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),onClick:()=>{d?P.mutate(parseInt(d)):o({title:"Vyberte anketu",description:"Pros\xedm vyberte anketu ze seznamu",status:"warning",duration:3e3})},size:"sm",colorScheme:"blue",isLoading:P.isPending,isDisabled:!d,children:"P\u0159ipojit"})]})}):(0,p.jsxs)(xa.F,{status:"info",size:"sm",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"\u017d\xe1dn\xe9 dostupn\xe9 ankety. Vytvo\u0159te novou v druh\xe9 z\xe1lo\u017ece."})]})}),(0,p.jsx)(da.K,{px:0,py:3,children:(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"N\xe1zev ankety"}),(0,p.jsx)(C.p,{size:"sm",placeholder:"nap\u0159. Doraz\xed\u0161 na p\u0159\xed\u0161t\xed tr\xe9nink?",value:g.title,onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{title:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Popis (voliteln\xe9)"}),(0,p.jsx)(va.T,{size:"sm",placeholder:"Dopl\u0148uj\xedc\xed informace k anket\u011b...",rows:2,value:g.description,onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{description:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Typ ankety"}),(0,p.jsxs)(ha.l,{size:"sm",value:g.type,onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{type:e.target.value})),children:[(0,p.jsx)("option",{value:"single",children:"Jedna odpov\u011b\u010f"}),(0,p.jsx)("option",{value:"multiple",children:"V\xedce odpov\u011bd\xed"}),(0,p.jsx)("option",{value:"rating",children:"Hodnocen\xed"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Styl"}),(0,p.jsxs)(ha.l,{size:"sm",value:g.style||"auto",onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{style:e.target.value})),children:[(0,p.jsx)("option",{value:"auto",children:"Automaticky"}),"rating"===g.type?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"rating-stars",children:"Hv\u011bzdi\u010dky"}),(0,p.jsx)("option",{value:"rating-scale",children:"\u010c\xedseln\xe1 stupnice"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"choices-list",children:"Seznam"}),(0,p.jsx)("option",{value:"choices-chips",children:"\u0160t\xedtky"}),(0,p.jsx)("option",{value:"choices-cards",children:"Karty"})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Mo\u017enosti (min. 2)"}),(0,p.jsxs)(w.T,{spacing:2,align:"stretch",children:[g.options.map((e,t)=>(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{size:"sm",placeholder:"Mo\u017enost ".concat(t+1),value:e.text,onChange:e=>((e,t)=>{v(n=>(0,h.A)((0,h.A)({},n),{},{options:n.options.map((n,a)=>a===e?(0,h.A)((0,h.A)({},n),{},{text:t}):n)}))})(t,e.target.value)}),g.options.length>2&&(0,p.jsx)(K.K,{"aria-label":"Odebrat mo\u017enost",icon:(0,p.jsx)(ts.U,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(e=>{g.options.length<=2?o({title:"Anketa mus\xed m\xedt alespo\u0148 2 mo\u017enosti",status:"warning",duration:2e3}):v(t=>(0,h.A)((0,h.A)({},t),{},{options:t.options.filter((t,n)=>n!==e).map((e,t)=>(0,h.A)((0,h.A)({},e),{},{display_order:t}))}))})(t)})]},t)),(0,p.jsx)(T.$,{size:"sm",variant:"outline",leftIcon:(0,p.jsx)(es.R,{}),onClick:()=>{v(e=>(0,h.A)((0,h.A)({},e),{},{options:[...e.options,{text:"",display_order:e.options.length}]}))},children:"P\u0159idat mo\u017enost"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"xs",onClick:()=>v(e=>(0,h.A)((0,h.A)({},e),{},{title:"Hodnocen\xed z\xe1pasu",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 5 = nejlep\u0161\xed)",type:"rating",style:"rating-stars",allow_multiple:!1,max_choices:1,options:Array.from({length:5}).map((e,t)=>({text:String(t+1),display_order:t+1}))})),children:"\u2b50 5"}),(0,p.jsx)(T.$,{size:"xs",onClick:()=>v(e=>(0,h.A)((0,h.A)({},e),{},{title:"Hodnocen\xed (1\u201310)",description:"Ohodno\u0165te (1 = nejhor\u0161\xed, 10 = nejlep\u0161\xed)",type:"rating",style:"rating-scale",allow_multiple:!1,max_choices:1,options:Array.from({length:10}).map((e,t)=>({text:String(t+1),display_order:t+1}))})),children:"1\u201310"}),(0,p.jsx)(T.$,{size:"xs",onClick:()=>v(e=>(0,h.A)((0,h.A)({},e),{},{title:"Doch\xe1zka",description:"Dej v\u011bd\u011bt, zda doraz\xed\u0161.",type:"single",style:"choices-chips",allow_multiple:!1,max_choices:1,options:[{text:"Ano",display_order:0},{text:"Ne",display_order:1},{text:"Mo\u017en\xe1",display_order:2}]})),children:"Doch\xe1zka"})]})]})]}),(0,p.jsxs)(ee.z,{spacing:4,children:[(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{fontSize:"sm",mb:"0",mr:2,children:"Povolit hlasov\xe1n\xed host\u016f"}),(0,p.jsx)(pa.d,{size:"sm",isChecked:g.allow_guest_vote,onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{allow_guest_vote:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{fontSize:"sm",mb:"0",mr:2,children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{size:"sm",isChecked:"active"===g.status,onChange:e=>v(t=>(0,h.A)((0,h.A)({},t),{},{status:e.target.checked?"active":"draft"}))})]})]}),(0,p.jsx)(T.$,{colorScheme:"green",size:"sm",leftIcon:(0,p.jsx)(es.R,{}),onClick:()=>{if(!g.title.trim())return void o({title:"Chyb\xed n\xe1zev ankety",status:"warning",duration:3e3});const e=g.options.filter(e=>e.text.trim());e.length<2?o({title:"Anketa mus\xed m\xedt alespo\u0148 2 mo\u017enosti",status:"warning",duration:3e3}):W.mutate((0,h.A)((0,h.A)({},g),{},{options:e}))},isLoading:W.isPending,children:"Vytvo\u0159it anketu"})]})})]})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:["\ud83d\udca1 Tip: Ankety se zobraz\xed automaticky na konci ",t?"\u010dl\xe1nku":"aktivity"]})]})})]})}):null};var as=n(2846),is=n(5780),os=n(1765),rs=n(3192);const ss=e=>{let{src:t,alt:n,size:a="48px",previewSize:i="300px",borderRadius:o="md",objectFit:r="cover"}=e;const s=(0,b.dU)("gray.200","gray.700"),l=(0,b.dU)("white","gray.800");return(0,p.jsxs)(as.A,{trigger:"hover",placement:"right",openDelay:200,closeDelay:100,children:[(0,p.jsx)(is.W,{children:(0,p.jsx)(y.a,{cursor:"pointer",transition:"all 0.2s",_hover:{transform:"scale(1.05)",boxShadow:"md"},children:(0,p.jsx)(k._,{src:t,alt:n,boxSize:a,objectFit:r,borderRadius:o,borderWidth:"1px",borderColor:s,fallbackSrc:"/dist/img/logo-club-empty.svg",loading:"lazy"})})}),(0,p.jsx)(Qn.Z,{children:(0,p.jsx)(os.h,{width:i,borderColor:s,boxShadow:"2xl",bg:l,_focus:{boxShadow:"2xl"},children:(0,p.jsx)(rs.e,{p:0,children:(0,p.jsx)(k._,{src:t,alt:"".concat(n," - preview"),width:"100%",maxH:"400px",objectFit:"contain",borderRadius:"md",fallbackSrc:"/dist/img/logo-club-empty.svg",loading:"lazy"})})})})]})},ls=e=>{let{status:t,lastSaved:n,compact:a=!1}=e;const{icon:i,text:o,color:r}=(()=>{switch(t){case"saving":return{icon:(0,p.jsx)(zn.y,{size:"xs",color:"blue.500"}),text:"Ukl\xe1d\xe1n\xed...",color:"blue.500"};case"saved":return{icon:(0,p.jsx)(jn.I,{as:q.YrT,color:"green.500"}),text:"Ulo\u017eeno",color:"green.500"};case"error":return{icon:(0,p.jsx)(jn.I,{as:q.y3G,color:"orange.500"}),text:"Ulo\u017eeno lok\xe1ln\u011b",color:"orange.500"};default:return{icon:(0,p.jsx)(jn.I,{as:q.Ohp,color:"gray.400"}),text:"\u010cek\xe1 se na zm\u011bny...",color:"gray.400"}}})(),s=(()=>{if(!n)return null;const e=new Date,t=Math.floor((e.getTime()-n.getTime())/1e3);return t<60?"p\u0159ed chv\xedl\xed":t<3600?"p\u0159ed ".concat(Math.floor(t/60)," min"):t<86400?"p\u0159ed ".concat(Math.floor(t/3600)," h"):n.toLocaleString("cs-CZ",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})})();return a?(0,p.jsx)(te.m,{label:s?"".concat(o," ").concat(s):o,hasArrow:!0,children:(0,p.jsx)(ee.z,{spacing:1,children:i})}):(0,p.jsxs)(ee.z,{spacing:2,fontSize:"sm",children:[i,(0,p.jsx)(U.E,{color:r,fontWeight:"medium",children:o}),s&&"saved"===t&&(0,p.jsx)(U.E,{color:"gray.500",fontSize:"xs",children:s})]})},cs=e=>{let{isOpen:t,onClose:n,onRecover:a,onDiscard:i,onDeleteOnly:o,draftAge:r,entityType:s="polo\u017eku"}=e;const l=(0,b.dU)("white","gray.800");return(0,p.jsxs)(se.aF,{isOpen:t,onClose:n,isCentered:!0,closeOnOverlayClick:!1,closeOnEsc:!1,children:[(0,p.jsx)(H.m,{backdropFilter:"blur(4px)"}),(0,p.jsxs)(le.$,{bg:l,maxW:"500px",children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.Ohp,color:"blue.500",boxSize:6}),(0,p.jsx)(U.E,{children:"Nalezen neulo\u017een\xfd koncept"})]})}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(_o.T,{children:["M\xe1me ulo\u017een\xfd neulo\u017een\xfd koncept pro tuto ",s,", vytvo\u0159en\xfd"," ",(0,p.jsx)("strong",{children:null===r?"ned\xe1vno":r<1?"p\u0159ed chv\xedl\xed":r<60?"p\u0159ed ".concat(r," min"):r<1440?"p\u0159ed ".concat(Math.floor(r/60)," h"):"p\u0159ed ".concat(Math.floor(r/1440)," dny")}),"."]})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Co chcete ud\u011blat?"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.a4x,{}),colorScheme:"blue",size:"lg",onClick:()=>{a(),n()},children:"Obnovit koncept"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:"Na\u010dte ulo\u017een\xe1 data a m\u016f\u017eete pokra\u010dovat v pr\xe1ci"})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.IXo,{}),variant:"outline",colorScheme:"orange",size:"sm",onClick:()=>{o(),n()},children:"Smazat koncept a zav\u0159\xedt"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:["Sma\u017ee ulo\u017een\xfd koncept bez vytvo\u0159en\xed nov\xe9 ",s]})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.IXo,{}),variant:"outline",colorScheme:"red",size:"sm",onClick:()=>{i(),n()},children:"Zahodit koncept a za\u010d\xedt znovu"}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:["Sma\u017ee ulo\u017een\xfd koncept a vytvo\u0159\xed novou pr\xe1zdnou ",s]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.400",children:"\ud83d\udca1 Tip: Va\u0161e pr\xe1ce se nyn\xed ukl\xe1d\xe1 automaticky p\u0159i ka\u017ed\xe9 zm\u011bn\u011b"})})]})]})};function ds(e){let{data:t,storageKey:n,onSave:i,onError:o,debounceMs:r=2e3,enabled:s=!0,requiresId:l=!1}=e;const c=(0,j.d)(),[d,h]=(0,a.useState)("idle"),[u,m]=(0,a.useState)(null),[p,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),b=(0,a.useRef)(),y=(0,a.useRef)(""),f=(0,a.useRef)(!1);(0,a.useEffect)(()=>{try{const e=localStorage.getItem(n);if(e){const t=JSON.parse(e);if(x(!0),t.timestamp){const e=Math.floor((Date.now()-t.timestamp)/6e4);v(e)}}}catch(e){console.warn("Failed to check for draft:",e)}},[n]);const k=(0,a.useCallback)(e=>{try{const t={data:e,timestamp:Date.now(),version:1};localStorage.setItem(n,JSON.stringify(t)),x(!0),v(0)}catch(t){console.error("Failed to save to localStorage:",t)}},[n]),z=(0,a.useCallback)(async e=>{if(!l||e.id)if(f.current)console.log("Save already in progress, skipping...");else try{f.current=!0,h("saving");const t=await i(e);h("saved"),m(new Date),null!==t&&void 0!==t&&t.id&&!e.id&&console.log("Draft saved with new ID:",t.id),setTimeout(()=>h("idle"),2e3)}catch(r){if(console.error("Auto-save error:",r),h("error"),o)o(r);else{var t;const e=null===r||void 0===r||null===(t=r.response)||void 0===t?void 0:t.status;var n,a;if(401!==e&&403!==e)c({title:"Automatick\xe9 ulo\u017een\xed selhalo",description:(null===r||void 0===r||null===(n=r.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===r||void 0===r?void 0:r.message)||"Koncept je ulo\u017een lok\xe1ln\u011b",status:"warning",duration:3e3,isClosable:!0})}setTimeout(()=>h("idle"),3e3)}finally{f.current=!1}else console.log("Skipping backend save - no ID yet")},[i,o,c,l]);(0,a.useEffect)(()=>{if(!s)return;const e=JSON.stringify(t);return e!==y.current?(y.current=e,k(t),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{z(t)},r),()=>{b.current&&clearTimeout(b.current)}):void 0},[t,s,r,k,z]);const w=(0,a.useCallback)(async()=>{b.current&&clearTimeout(b.current),k(t),await z(t)},[t,k,z]),_=(0,a.useCallback)(()=>{try{localStorage.removeItem(n),x(!1),v(null),b.current&&clearTimeout(b.current)}catch(e){console.error("Failed to clear draft:",e)}},[n]);return(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]),{saveStatus:d,lastSaved:u,forceSave:w,clearDraft:_,hasDraft:p,draftAge:g}}function hs(e){try{const t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t).data||null}catch(t){return console.error("Failed to load draft:",t),null}}function us(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);if(!n.timestamp)return null;const a=Math.floor((Date.now()-n.timestamp)/6e4);return{timestamp:n.timestamp,age:a}}catch(t){return console.error("Failed to get draft metadata:",t),null}}async function ms(e){try{return(await m.Ay.post("/shortlinks",e)).data}catch(t){return(await m.Ay.post("/admin/shortlinks",e)).data}}async function ps(){return(await m.Ay.get("/admin/shortlinks")).data}const xs=e=>{var t;let{articleId:n}=e;const a=(0,xe.I)({queryKey:["article-match-link",n],queryFn:()=>mt(n),enabled:"undefined"!==typeof n&&null!==n&&("number"===typeof n?n>0:""!==String(n).trim()),staleTime:6e4,retry:!1}),i=null===(t=a.data)||void 0===t?void 0:t.external_match_id,o=(0,xe.I)({queryKey:["facr-cached-match",i],enabled:!!i,staleTime:6e4,retry:!1,queryFn:async()=>{try{const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return null;const a=await n.json(),o=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[];for(const r of o){const e=Array.isArray(r.matches)?r.matches:[];for(const t of e){if(String(t.match_id||t.id)===String(i))return(0,h.A)((0,h.A)({},t),{},{competitionName:r.name})}}return null}catch(e){return console.error("Failed to fetch FACR match data:",e),null}}});if(a.isLoading)return(0,p.jsx)(Qt.E,{colorScheme:"gray",children:"Na\u010d\xedt\xe1n\xed..."});if(!i)return(0,p.jsx)(Qt.E,{colorScheme:"gray",children:"Nepropojeno"});if(o.isError||a.isError)return(0,p.jsx)(Qt.E,{colorScheme:"red",children:"Chyba na\u010d\xedt\xe1n\xed"});const r=o.data,s=r?r.score||(null!=r.result_home&&null!=r.result_away?"".concat(r.result_home,":").concat(r.result_away):"vs"):"",l=!!r&&!!s&&"vs"!==s?"green":"yellow",c=r?"".concat(String(r.home||r.home_team||"")," ").concat(String(s)," ").concat(String(r.away||r.away_team||"")):"ID: ".concat(String(i));return(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(Qt.E,{colorScheme:l,title:null!==r&&void 0!==r&&r.competitionName?String(r.competitionName):void 0,children:["Z\xe1pas: ",c]}),null!==r&&void 0!==r&&r.report_url?(0,p.jsx)(K.K,{"aria-label":"Otev\u0159\xedt FACR",size:"xs",as:"a",href:String(r.report_url),target:"_blank",rel:"noopener noreferrer",icon:(0,p.jsx)(q.HaR,{}),variant:"ghost"}):null]})},gs="white",vs=()=>{var e;const t=(0,j.d)(),n=(0,l.jE)(),[i,o]=(0,a.useState)(1),[r,s]=(0,a.useState)(""),[c,d]=(0,a.useState)(null),[u,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)("");a.useEffect(()=>{(async()=>{try{const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});if(!n.ok)return;const a=await n.json(),i=(Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map(t=>{const n=t.score||(null!=t.result_home&&null!=t.result_away?"".concat(t.result_home,":").concat(t.result_away):"vs");return{id:String(t.match_id||t.id||""),date:t.date_time||t.date||"",label:"".concat(t.date_time||t.date||""," \u2022 ").concat(t.home||t.home_team||""," ").concat(n," ").concat(t.away||t.away_team||""," ").concat(null!==e&&void 0!==e&&e.name?"("+e.name+")":"").trim(),competition:(null===e||void 0===e?void 0:e.name)||"",home:t.home||t.home_team||"",away:t.away||t.away_team||"",score:n}}));ge(i.slice(-200).reverse())}catch(e){}})()},[]);const{data:f,isLoading:N}=(0,xe.I)({queryKey:["admin-articles",{page:i,page_size:10,q:r,published:!1}],queryFn:()=>xt({page:i,page_size:10,published:!1,q:r}),keepPreviousData:!0}),P=(0,xe.I)({queryKey:["public-settings"],queryFn:R,staleTime:3e5}),{isOpen:I,onOpen:M,onClose:D}=(0,X.j)(),[F,O]=(0,a.useState)(""),[Z,V]=(0,a.useState)("Fanou\u0161ci klubu"),[$,G]=(0,a.useState)(500),[Q,te]=(0,a.useState)(!1),[ne,ae]=(0,a.useState)([]),[ie,oe]=(0,a.useState)({}),[re,ce]=(0,a.useState)(""),[de,he]=(0,a.useState)(""),[ue,me]=(0,a.useState)(""),[pe,ge]=(0,a.useState)([]),[ve,je]=(0,a.useState)(""),[be,ye]=(0,a.useState)(0),[fe,ke]=(0,a.useState)(""),[ze,we]=(0,a.useState)(""),[_e,Ce]=(0,a.useState)(""),[Ae,Ee]=(0,a.useState)([]),[Te,Ne]=(0,a.useState)(!1),[Re,Pe]=(0,a.useState)(!1),{isOpen:Ie,onOpen:We,onClose:Me}=(0,X.j)(),{isOpen:De,onOpen:Ue,onClose:Le}=(0,X.j)(),[Fe,Oe]=(0,a.useState)([]),[Ze,Ke]=(0,a.useState)(!1),[qe,Ve]=(0,a.useState)([]),[He,$e]=(0,a.useState)(!1),[Be,Je]=(0,a.useState)(""),[Ye,Ge]=(0,a.useState)(""),{isOpen:Xe,onOpen:Qe,onClose:et}=(0,X.j)(),{saveStatus:tt,lastSaved:nt,forceSave:at,clearDraft:it}=ds({data:c||{},storageKey:g,onSave:async e=>{var t;if(e.id)return await vt(e.id,(0,h.A)((0,h.A)({},e),{},{published:!1}));if(null!==(t=e.title)&&void 0!==t&&t.trim()){const t={title:e.title||"Koncept \u010dl\xe1nku",content:e.content||"",image_url:e.image_url||"",category_name:e.category_name,published:!1,slug:e.slug||"",seo_title:e.seo_title||"",seo_description:e.seo_description||"",og_image_url:e.og_image_url||"",featured:e.featured||!1},n=await gt(t);return null!==n&&void 0!==n&&n.id&&d(e=>(0,h.A)((0,h.A)({},e),{},{id:n.id})),n}return{}},debounceMs:2e3,enabled:I&&null!==c});a.useEffect(()=>{const e="draft-article-new";v(e);const t=us(e);t&&t.age<1440&&x(!0)},[]);const ot=(0,a.useCallback)(async()=>{try{Ke(!0);const e=new URL("/api/v1").origin,n="".concat(e,"/cache/prefetch/zonerama_profile.json"),a=await fetch(n,{cache:"no-cache"});if(!a.ok)throw new Error("Failed to load gallery cache");const i=await a.json(),o=(Array.isArray(null===i||void 0===i?void 0:i.albums)?i.albums:[]).filter(e=>Array.isArray(e.photos)&&e.photos.length>0);Oe(o),0===o.length&&t({title:"\u017d\xe1dn\xe9 alba nenalezena",description:"Cache galerie je pr\xe1zdn\xe1 nebo neobsahuje fotografie.",status:"info",duration:4e3})}catch(e){t({title:"Na\u010dten\xed galerie selhalo",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to pros\xedm znovu.",status:"error"})}finally{Ke(!1)}},[]),rt=(0,a.useCallback)(async()=>{try{$e(!0);const e=await bt();let n=[];e&&Array.isArray(e.videos)&&(n=e.videos),Ve(n),e&&0!==n.length||t({title:"YouTube videa nenalezena",description:"Zkontrolujte nastaven\xed YouTube kan\xe1lu nebo zkuste obnovit cache.",status:"info",duration:4e3})}catch(e){t({title:"Na\u010dten\xed YouTube vide\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to pros\xedm znovu.",status:"error"})}finally{$e(!1)}},[]);a.useEffect(()=>{Xe&&0===qe.length&&!He&&rt()},[Xe,qe.length,He,rt]),a.useEffect(()=>{De&&0===Fe.length&&!Ze&&ot()},[De,Fe.length,Ze,ot]);const st=(0,a.useMemo)(()=>{const e=Be.trim().toLowerCase();return e?qe.filter(t=>(t.title||"").toLowerCase().includes(e)||t.video_id.toLowerCase().includes(e)):qe},[qe,Be]),lt=(0,a.useCallback)(e=>{d(t=>(0,h.A)((0,h.A)({},t),{},{youtube_video_id:e.video_id,youtube_video_title:e.title,youtube_video_url:"https://www.youtube.com/watch?v=".concat(e.video_id),youtube_video_thumbnail:e.thumbnail_url})),t({title:"Video p\u0159id\xe1no k \u010dl\xe1nku",description:e.title,status:"success"}),et()},[t,et]),ct=(0,a.useCallback)(()=>{d(e=>(0,h.A)((0,h.A)({},e),{},{youtube_video_id:"",youtube_video_title:"",youtube_video_url:"",youtube_video_thumbnail:""})),t({title:"Video odstran\u011bno",status:"info"})},[t]),dt=(0,a.useCallback)(()=>{const e=(e=>{const t=String(e||"").trim();if(!t)return"";try{const e=new URL(t.startsWith("http")?t:"https://".concat(t));if(e.hostname.includes("youtu.be")){const t=e.pathname.split("/").filter(Boolean);if(t.length>0)return t[0]}if(e.pathname.includes("/shorts/")){const t=e.pathname.split("/shorts/");if(t.length>1){const e=t[1].split(/[?&]/)[0];if(/^[0-9A-Za-z_-]{11}$/.test(e))return e}}const n=e.searchParams.get("v");if(n&&/^[0-9A-Za-z_-]{11}$/.test(n))return n}catch(a){}const n=t.match(/(?:v=|\/)([0-9A-Za-z_-]{11})(?![0-9A-Za-z_-])/);return n&&n[1]?n[1]:/^[0-9A-Za-z_-]{11}$/.test(t)?t:""})(Ye);if(!e)return void t({title:"Neplatn\xfd YouTube odkaz",description:"Zadejte pros\xedm platn\xe9 ID nebo odkaz na video.",status:"warning"});const n=qe.find(t=>t.video_id===e),a=(null===n||void 0===n?void 0:n.title)||"YouTube video",i=(null===n||void 0===n?void 0:n.thumbnail_url)||"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg");d(t=>(0,h.A)((0,h.A)({},t),{},{youtube_video_id:e,youtube_video_title:a,youtube_video_url:"https://www.youtube.com/watch?v=".concat(e),youtube_video_thumbnail:i})),t({title:"Video nastaveno",description:a,status:"success"}),Ge("")},[Ye,qe,t]),ht=(0,a.useCallback)(async e=>{try{d(t=>(0,h.A)((0,h.A)({},t),{},{image_url:e.image_url})),await async function(e){return(await m.Ay.post("/admin/zonerama/pick",e)).data}({id:e.id,album_id:e.album_id,album_url:e.album_url,page_url:e.page_url,image_url:e.image_url,title:e.title}),t({title:"Obr\xe1zek vybr\xe1n ze Zonerama",status:"success"})}catch(i){var n,a;t({title:"Ulo\u017een\xed v\xfdb\u011bru selhalo",description:(null===i||void 0===i||null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message)||"Chyba",status:"error"})}},[t]),ut=(0,a.useCallback)(async(e,n)=>{try{var a;t({title:"Ukl\xe1d\xe1m album...",status:"info",duration:2e3}),await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return(await m.Ay.post("/admin/zonerama/save-album",{link:e,photo_limit:t})).data}(n.url,e.length),d(t=>{const a=(null===t||void 0===t?void 0:t.content)||"",i=e.map(e=>'<img src="'.concat(e.image_1500,'" alt="Gallery photo" />')).join("\n");return(0,h.A)((0,h.A)({},t),{},{gallery_album_id:n.id,gallery_album_url:n.url,gallery_photo_ids:e.map(e=>e.id),content:a+"\n"+i})});const i=(null===(a=n.photos)||void 0===a?void 0:a.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||"",title:e.title||""})))||e.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||"",title:""}));Ce(n.url||""),Ee(i),t({title:"Album p\u0159id\xe1no",description:"".concat(e.length," fotografi\xed vlo\u017eeno do \u010dl\xe1nku. Album dostupn\xe9 tak\xe9 v sekci M\xe9dia."),status:"success",duration:4e3})}catch(i){t({title:"Chyba",description:i.message||"Nepoda\u0159ilo se p\u0159idat album",status:"error",duration:5e3})}},[t]),mt=(0,a.useCallback)(async()=>{const e=_e.trim();if(e)try{Ne(!0);const a=new URLSearchParams({link:e,photo_limit:"48",rendered:"true"}),i=await fetch("".concat(m.API_URL,"/zonerama-album?").concat(a.toString()));if(!i.ok)throw new Error("Failed to fetch album");const o=await i.json();let r=[];var n;if(Array.isArray(null===o||void 0===o?void 0:o.albums)&&o.albums.length>0)r=(null===(n=o.albums[0])||void 0===n?void 0:n.photos)||[];else Array.isArray(null===o||void 0===o?void 0:o.photos)&&(r=o.photos);0===r.length&&t({title:"Album na\u010dteno, ale neobsahuje \u017e\xe1dn\xe9 fotografie",status:"info"}),Ee(r)}catch(a){t({title:"Na\u010dten\xed alba selhalo",description:(null===a||void 0===a?void 0:a.message)||"Chyba",status:"error"})}finally{Ne(!1)}},[_e,t]),yt=(0,a.useMemo)(()=>{let e=pe;const t=String((null===c||void 0===c?void 0:c.category_name)||"").trim().toLowerCase();if(t){const n=Object.entries(ie).filter(e=>{let[n,a]=e;return a.toLowerCase()===t}).map(e=>{let[t]=e;return t}),a=ne.filter(e=>e.name.toLowerCase()===t).map(e=>e.code).filter(Boolean),i=[...new Set([...n,...a])];e=e.filter(e=>{var n;const a=(e.competition||"").toLowerCase();if(a.includes(t))return!0;const o=null===(n=Object.entries(ie).find(e=>{let[t,n]=e;return a.includes(n.toLowerCase())}))||void 0===n?void 0:n[0];return!(!o||!i.includes(o))||i.some(e=>{const t=ie[e]||"";return a.includes(e.toLowerCase())||a.includes(t.toLowerCase())})})}const n=ve.trim().toLowerCase();n&&(e=e.filter(e=>e.label.toLowerCase().includes(n))),fe&&(e=e.filter(e=>(e.date||"").includes(fe)));const a=Date.now(),i=e=>{if(!e)return Number.MAX_SAFE_INTEGER;const t=e.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?/);if(t){const e=parseInt(t[1],10),n=parseInt(t[2],10)-1,a=parseInt(t[3],10),i=t[4]?parseInt(t[4],10):0,o=t[5]?parseInt(t[5],10):0;return new Date(a,n,e,i,o).getTime()}const n=Date.parse(e);return isNaN(n)?Number.MAX_SAFE_INTEGER:n};return e=e.sort((e,t)=>{const n=i(e.date),o=i(t.date),r=n-a,s=o-a,l=r>=0;return l!==s>=0?l?-1:1:l?r-s:Math.abs(r)-Math.abs(s)}),e},[pe,ve,fe,null===c||void 0===c?void 0:c.category_name,ie,ne]);a.useEffect(()=>{(async()=>{try{const n=await R(),a=(null===n||void 0===n?void 0:n.club_id)||"",i=(null===n||void 0===n?void 0:n.club_type)||"football";let o=[];if(a)try{const e=await Se.getClub(String(a),i);o=((null===e||void 0===e?void 0:e.competitions)||[]).map(e=>({code:e.code,name:e.name||e.code}))}catch(e){}let r={};try{(await $n()).forEach(e=>{e.code&&e.alias&&(r[e.code]=e.alias)})}catch(t){}const s=o.map(e=>({code:e.code,name:e.code&&r[e.code]?r[e.code]:e.name}));oe(r),ae(s)}catch(n){}})()},[]);const ft=(0,Mn.n)({mutationFn:()=>async function(e){const{data:t}=await m.Ay.post("/ai/blog/generate",e);let n=t;if("string"===typeof t)try{n=JSON.parse(t)}catch(a){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}return n}({prompt:F,audience:Z,min_words:$}),onSuccess:e=>{console.log("AI blog response:",e);const n=String((null===e||void 0===e?void 0:e.title)||"").trim(),a=String((null===e||void 0===e?void 0:e.slug)||"").trim(),i=String((null===e||void 0===e?void 0:e.html)||"").trim();if(!n||!i)return console.error("AI response missing title or html:",e),void t({title:"AI odpov\u011b\u010f ne\xfapln\xe1",description:"AI nevr\xe1tila v\u0161echny po\u017eadovan\xe9 \xfadaje. Zkuste to pros\xedm znovu.",status:"warning"});const{seoTitle:o,seoDescription:r}=Ct(n);d(e=>(0,h.A)((0,h.A)((0,h.A)({},e||{}),{},{title:n,content:i},a?{slug:a}:{}),{},{seo_title:o,seo_description:r})),O(""),ye(1),t({title:"\u010cl\xe1nek hotov",description:"AI rozvinula v\xe1\u0161 text a vyplnila n\xe1zev, slug a obsah. Zkontrolujte v\xfdsledek v z\xe1lo\u017ece Z\xe1kladn\xed.",status:"success",duration:5e3})},onError:e=>{var n,a;console.error("AI generation error:",e),t({title:"Generov\xe1n\xed selhalo",description:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===e||void 0===e?void 0:e.message)||"Zkuste to pros\xedm znovu.",status:"error"})}}),kt=()=>{we(""),me(""),d(null),D()},zt=(0,Mn.n)({mutationFn:e=>gt(e),onSuccess:async e=>{console.log("Article created successfully in mutation callback:",e),we(""),me(""),n.invalidateQueries({queryKey:["admin-articles"]}),n.invalidateQueries({queryKey:["articles"]}),n.invalidateQueries({queryKey:["recentArticles"]}),n.invalidateQueries({queryKey:["article-match-link"]})},onError:e=>{var n,a;console.error("Error creating article:",e),t({title:"Chyba p\u0159i vytv\xe1\u0159en\xed \u010dl\xe1nku",description:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.message)||"Do\u0161lo k chyb\u011b p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:5e3,isClosable:!0})}}),wt=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return vt(t,n)},onSuccess:(e,t)=>{const a=t.id;console.log("Article updated successfully in mutation callback:",a),n.invalidateQueries({queryKey:["admin-articles"]}),n.invalidateQueries({queryKey:["articles"]}),n.invalidateQueries({queryKey:["recentArticles"]}),n.invalidateQueries({queryKey:["article-match-link",a]}),n.invalidateQueries({queryKey:["article","id:".concat(a)]})},onError:e=>{var n,a;console.error("Error updating article:",e),t({title:"Chyba p\u0159i aktualizaci \u010dl\xe1nku",description:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.message)||"Do\u0161lo k chyb\u011b p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:5e3,isClosable:!0})}}),_t=(0,Mn.n)({mutationFn:e=>async function(e){return(await m.Ay.delete("/articles/".concat(e))).data}(e),onSuccess:()=>{t({title:"\u010cl\xe1nek smaz\xe1n",status:"success"}),n.invalidateQueries({queryKey:["admin-articles"]})},onError:e=>{var n,a,i,o;return t({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.message)||(null===e||void 0===e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.chyba)||"Chyba",status:"error"})}}),St=(0,a.useCallback)(e=>{var n,a,i;const o=null!==(n=null!==(a=null!==(i=null===e||void 0===e?void 0:e.id)&&void 0!==i?i:null===e||void 0===e?void 0:e.ID)&&void 0!==a?a:null===e||void 0===e?void 0:e.article_id)&&void 0!==n?n:null===e||void 0===e?void 0:e.articleId;if(void 0===o||null===o||""===o)return void t({title:"Chyb\u011bj\xedc\xed ID \u010dl\xe1nku",description:"Nepoda\u0159ilo se zjistit identifik\xe1tor \u010dl\xe1nku pro smaz\xe1n\xed.",status:"error"});const r="number"===typeof o||"string"===typeof o?o:Number(o);void 0===r||null===r||"number"===typeof r&&Number.isNaN(r)?t({title:"Neplatn\xe9 ID \u010dl\xe1nku",description:"Zadan\xfd identifik\xe1tor \u010dl\xe1nku nen\xed platn\xfd.",status:"error"}):_t.mutate(r)},[_t,t]),Ct=e=>{const t=e?"".concat(e," | ").concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_SITE_NAME||"Fotbalov\xfd klub"):{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_SITE_NAME||"Fotbalov\xfd klub",n=e?"P\u0159e\u010dt\u011bte si v\xedce o ".concat(e.toLowerCase(),". Aktu\xe1ln\xed informace, novinky a zaj\xedmavosti z na\u0161eho fotbalov\xe9ho klubu."):"Ofici\xe1ln\xed str\xe1nky na\u0161eho fotbalov\xe9ho klubu. Aktuality, z\xe1pasy, v\xfdsledky a dal\u0161\xed informace.";return{seoTitle:t,seoDescription:n.length>160?n.substring(0,157)+"...":n}},At=e=>{const t={"\xe1":"a","\u010d":"c","\u010f":"d","\xe9":"e","\u011b":"e","\xed":"i","\u0148":"n","\xf3":"o","\u0159":"r","\u0161":"s","\u0165":"t","\xfa":"u","\u016f":"u","\xfd":"y","\u017e":"z","\xc1":"a","\u010c":"c","\u010e":"d","\xc9":"e","\u011a":"e","\xcd":"i","\u0147":"n","\xd3":"o","\u0158":"r","\u0160":"s","\u0164":"t","\xda":"u","\u016e":"u","\xdd":"y","\u017d":"z"};return e.toLowerCase().split("").map(e=>t[e]||e).join("").replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/--+/g,"-").trim()},Et=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!c)return;if(!String((null===c||void 0===c?void 0:c.category_name)||"").trim())return void t({title:"Vyberte kategorii",description:"Nejprve vyberte kategorii \u010dl\xe1nku (sout\u011b\u017e).",status:"warning"});const n=String(c.content||"").trim();if(n.includes('"title":')&&n.includes('"slug":')&&n.includes('"html":'))t({title:"Neplatn\xfd obsah",description:'Obsah obsahuje nezpracovanou AI odpov\u011b\u010f. Zkuste AI generov\xe1n\xed znovu nebo pou\u017eijte z\xe1lo\u017eku "Z\xe1kladn\xed" pro ru\u010dn\xed vytvo\u0159en\xed.',status:"error",duration:8e3});else try{let n=c.image_url;n||(n=await(async()=>{try{var e;const a=String((null===(e=P.data)||void 0===e?void 0:e.club_logo_url)||"/dist/img/logo-club-empty.svg"),i=document.createElement("canvas"),o=1200,r=630;i.width=o,i.height=r;const s=i.getContext("2d");if(!s)return;s.fillStyle="#ffffff",s.fillRect(0,0,o,r),s.strokeStyle="#000000",s.lineWidth=6,s.strokeRect(3,3,o-6,r-6);const l=new window.Image;l.crossOrigin="anonymous";const c=()=>new Promise((e,t)=>{l.onload=()=>e(l),l.onerror=t,l.src=a});try{await c()}catch(t){}const d=Math.round(.5*o),h=Math.round(.5*r),u=Math.round((o-d)/2),m=Math.round((r-h)/2);try{s.drawImage(l,u,m,d,h)}catch(n){}const p=await new Promise(e=>i.toBlob(t=>e(t),"image/jpeg",.92));if(!p)return;const x=new File([p],"article-cover.jpg",{type:"image/jpeg"}),g=await jt(x);return(null===g||void 0===g?void 0:g.url)||void 0}catch(a){return}})(),n&&d(e=>(0,h.A)((0,h.A)({},e||{}),{},{image_url:n})));const r=ai.A.sanitize(c.content||"",{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["target","rel","allow","allowfullscreen"]}),s=(0,h.A)((0,h.A)((0,h.A)((0,h.A)((0,h.A)((0,h.A)((0,h.A)((0,h.A)((0,h.A)({title:c.title||"",content:r,image_url:n||""},"number"===typeof c.category_id?{category_id:c.category_id}:{}),{},{category_name:c.category_name||void 0,published:!0,slug:c.slug||At(c.title||""),seo_title:c.seo_title||"",seo_description:c.seo_description||"",og_image_url:c.og_image_url||n||"",featured:!(null===c||void 0===c||!c.featured)},c.gallery_album_id?{gallery_album_id:c.gallery_album_id}:{}),c.gallery_album_url?{gallery_album_url:c.gallery_album_url}:{}),Array.isArray(c.gallery_photo_ids)&&c.gallery_photo_ids.length>0?{gallery_photo_ids:c.gallery_photo_ids}:{}),c.youtube_video_id?{youtube_video_id:c.youtube_video_id}:{}),c.youtube_video_title?{youtube_video_title:c.youtube_video_title}:{}),c.youtube_video_url?{youtube_video_url:c.youtube_video_url}:{}),c.youtube_video_thumbnail?{youtube_video_thumbnail:c.youtube_video_thumbnail}:{}),Array.isArray(null===c||void 0===c?void 0:c.attachments)&&c.attachments.length>0?{attachments:c.attachments.map(e=>({name:e.name,url:e.url,mime_type:e.mime_type,size:e.size}))}:{});if(console.log("Saving article with payload:",JSON.stringify(s,null,2)),console.log("Match link state before submit:",{tempMatchLink:ze,matchIdInput:ue,linkedMatchId:re,isNewArticle:!(null!==c&&void 0!==c&&c.id)}),null!==c&&void 0!==c&&c.id){await wt.mutateAsync({id:c.id,payload:s});const e=String(ue||re||"").trim();let n=!1;if(e)try{await pt(c.id,{external_match_id:e,title:c.title||""}),console.log("Match link updated for existing article"),n=!0}catch(o){console.error("Failed to update match link:",o)}t({title:n?"\u010cl\xe1nek aktualizov\xe1n a propojen se z\xe1pasem":"\u010cl\xe1nek byl \xfasp\u011b\u0161n\u011b aktualizov\xe1n",status:"success",duration:3e3,isClosable:!0})}else{const e=await zt.mutateAsync(s),n=String(ze||ue||"").trim();if(n&&null!==e&&void 0!==e&&e.id){console.log("Linking new article",e.id,"with match",n);try{await pt(e.id,{external_match_id:n,title:c.title||""}),console.log("Match link created for new article"),ce(n),t({title:"\u010cl\xe1nek vytvo\u0159en a propojen se z\xe1pasem",description:"Match ID: ".concat(n),status:"success",duration:3e3,isClosable:!0})}catch(o){var a,i;console.error("Failed to link match:",o),t({title:"\u010cl\xe1nek vytvo\u0159en, ale propojen\xed se z\xe1pasem selhalo",description:(null===o||void 0===o||null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===o||void 0===o?void 0:o.message)||"Zkuste propojit z\xe1pas ru\u010dn\u011b",status:"warning",duration:5e3,isClosable:!0})}}else null!==e&&void 0!==e&&e.id&&t({title:"\u010cl\xe1nek byl \xfasp\u011b\u0161n\u011b vytvo\u0159en",status:"success",duration:3e3,isClosable:!0})}e.keepOpen||kt()}catch(r){console.error("Error saving article:",r)}},Nt=(null===f||void 0===f?void 0:f.data)||[],Rt=(null===f||void 0===f?void 0:f.total)||0,Pt=Math.max(1,Math.ceil(Rt/10)),It=(0,b.dU)("blue.50","blue.900"),Wt=(0,b.dU)("white","gray.700"),Mt=(0,b.dU)("blue.50","gray.600"),Dt=(0,b.dU)("green.50","green.900"),Ut=(0,b.dU)("white","gray.700");return(0,p.jsxs)(Mo,{requireAdmin:!1,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"\u010cl\xe1nky"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>{const e="draft-article-new";v(e);const t=us(e);t&&t.age<1440?x(!0):(d({title:"",content:"",featured:!1,published:!1}),ye(0),O(""),M())},children:"Nov\xfd \u010dl\xe1nek"})]}),(0,p.jsx)(U.E,{color:"gray.500",mb:6,children:"Spr\xe1va \u010dl\xe1nk\u016f a novinek na webu. M\u016f\u017eete vytv\xe1\u0159et, upravovat a publikovat \u010dl\xe1nky."}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,mb:6,children:(0,p.jsx)(C.p,{placeholder:"Hledat \u010dl\xe1nky...",value:r,onChange:e=>s(e.target.value),mr:2})}),(0,p.jsx)(y.a,{bg:(0,b.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Obr\xe1zek"}),(0,p.jsx)(Oi.Th,{children:"Titulek"}),(0,p.jsx)(Oi.Th,{children:"Kategorie"}),(0,p.jsx)(Oi.Th,{children:"\u2b50 Prim\xe1rn\xed"}),(0,p.jsx)(Oi.Th,{children:"Z\xe1pas"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[N&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,children:(0,p.jsx)(zn.y,{size:"sm"})})}),!N&&Nt.map(e=>{var a;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(ss,{src:W(e.image_url)||"/dist/img/logo-club-empty.svg",alt:e.title,size:"48px",previewSize:"350px"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.title}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.published?"\u2713 Publikov\xe1no":"\u25cb Koncept"})]})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"xs",children:(null===(a=e.category)||void 0===a?void 0:a.name)||e.category_name||"Bez kategorie"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(pa.d,{size:"sm",isChecked:!!e.featured,onChange:async a=>{try{await vt(e.id,{featured:a.target.checked}),n.invalidateQueries({queryKey:["admin-articles"]}),n.invalidateQueries({queryKey:["articles"]}),n.invalidateQueries({queryKey:["featured-articles"]}),t({title:a.target.checked?"\u010cl\xe1nek nastaven jako prim\xe1rn\xed":"\u010cl\xe1nek odstran\u011bn z prim\xe1rn\xedch",status:"success",duration:2e3})}catch(r){var i,o;t({title:"Chyba p\u0159i aktualizaci",description:(null===r||void 0===r||null===(i=r.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.error)||"Nepoda\u0159ilo se zm\u011bnit stav",status:"error"})}}})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(xs,{articleId:e.id})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",size:"sm",icon:(0,p.jsx)(q.WXf,{}),onClick:()=>(e=>{var t,n;const a="draft-article-".concat(e.id);if(v(a),d((0,h.A)((0,h.A)({},e),{},{category_name:(null===(t=e.category)||void 0===t?void 0:t.name)||e.category_name||""})),null!==e&&void 0!==e&&null!==(n=e.match_link)&&void 0!==n&&n.external_match_id){const t=String(e.match_link.external_match_id);ce(t),me(t)}else ce(""),me("");ye(1),O(""),M()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,p.jsx)(q.IXo,{}),onClick:()=>St(e)}),(0,p.jsx)(K.K,{"aria-label":"Zkr\xe1tit odkaz",size:"sm",icon:(0,p.jsx)(q.ayE,{}),title:"Zkr\xe1tit odkaz pro sd\xedlen\xed",onClick:async()=>{try{const n=window.location.origin,a=(null===e||void 0===e?void 0:e.slug)||(null===e||void 0===e?void 0:e.Slug),i=a?"/news/".concat(a):"/articles/".concat(e.id),o="".concat(n).concat(i),r=await ms({target_url:o,title:e.title,source_type:"article",source_id:e.id});await navigator.clipboard.writeText(r.short_url),t({title:"Zkr\xe1cen\xfd odkaz zkop\xedrov\xe1n",description:r.short_url,status:"success",duration:4e3})}catch(n){t({title:"Vytvo\u0159en\xed odkazu selhalo",description:(null===n||void 0===n?void 0:n.message)||"Zkuste to znovu",status:"error"})}}})]})})]},e.id)})]})]})}),(0,p.jsxs)(ee.z,{mt:4,justify:"flex-end",children:[(0,p.jsx)(T.$,{onClick:()=>o(e=>Math.max(1,e-1)),isDisabled:i<=1,children:"P\u0159edchoz\xed"}),(0,p.jsx)(T.$,{onClick:()=>o(e=>Math.min(Pt,e+1)),isDisabled:i>=Pt,children:"Dal\u0161\xed"})]})]}),(0,p.jsxs)(se.aF,{isOpen:I,onClose:kt,size:"xl",isCentered:!0,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",w:"full",pr:8,children:[(0,p.jsx)(U.E,{children:null!==c&&void 0!==c&&c.id?"Upravit \u010dl\xe1nek":"Nov\xfd \u010dl\xe1nek"}),(0,p.jsx)(ls,{status:tt,lastSaved:nt})]})}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{maxH:"calc(90vh - 120px)",overflowY:"auto",children:(0,p.jsxs)(ra.t,{variant:"enclosed",colorScheme:"blue",isFitted:!0,index:be,onChange:e=>ye(e),children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"AI"}),(0,p.jsx)(la.o,{children:"Z\xe1kladn\xed"}),(0,p.jsx)(la.o,{children:"Obsah"}),(0,p.jsx)(la.o,{children:"M\xe9dia"}),(0,p.jsx)(la.o,{children:"Anketa"}),(0,p.jsx)(la.o,{children:"SEO"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"blue.50",children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",mb:2,children:"\u270d\ufe0f AI: Rozvi\u0148te V\xc1\u0160 TEXT na \u010dl\xe1nek"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.700",mb:3,children:[(0,p.jsx)("strong",{children:"Napi\u0161te sv\u016fj text"})," s d\u016fle\u017eit\xfdmi informacemi - fakta, jm\xe9na, v\xfdsledky, ud\xe1losti. AI v\xe1\u0161 text pou\u017eije jako z\xe1klad, p\u0159id\xe1 strukturu a pokud je text kr\xe1tk\xfd, roz\u0161\xed\u0159\xed ho o kontext a detaily kolem va\u0161ich informac\xed. ",(0,p.jsx)("strong",{children:"\u010c\xedm v\xedce nap\xed\u0161ete, t\xedm m\xe9n\u011b AI p\u0159id\xe1v\xe1."})," Dlouh\xfd text = jen form\xe1tov\xe1n\xed."]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontWeight:"bold",children:"V\xe1\u0161 text (\u010desky)"}),(0,p.jsx)(va.T,{rows:8,placeholder:"Napi\u0161te sv\u016fj text s d\u016fle\u017eit\xfdmi informacemi. P\u0159\xedklad: Dnes na\u0161e mu\u017estvo zvl\xe1dlo d\u016fle\u017eit\xfd z\xe1pas proti TJ Sokol P\u0159\xedbram. Kone\u010dn\xfd v\xfdsledek 3:1 pro n\xe1s. Prvn\xed poloasu jsme dominovali, Jana Nov\xe1k dal dva g\xf3ly. Ve druh\xe9 poloasu sice soupe\u0159 sn\xed\u017eil, ale Petr \u010cern\xfd sv\xfdm t\u0159et\xedm g\xf3lem rozhodl. AI v\xe1\u0161 text roz\u0161\xed\u0159\xed, p\u0159id\xe1 strukturu a dopln\xed kontext pokud je kr\xe1tk\xfd.",value:F,onChange:e=>O(e.target.value),fontSize:"md",bg:gs}),(0,p.jsx)(_.eK,{children:"\ud83d\udca1 Kr\xe1tk\xfd text: AI ho roz\u0161\xed\u0159\xed o atmosf\xe9ru a detaily. Dlouh\xfd text: AI jen p\u0159id\xe1 HTML strukturu. V\u017edy zachov\xe1 va\u0161e informace."})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Publikum"}),(0,p.jsx)(C.p,{value:Z,onChange:e=>V(e.target.value),bg:gs})]}),(0,p.jsxs)(_.MJ,{w:"180px",children:[(0,p.jsx)(S.l,{children:"Min. slov"}),(0,p.jsx)(C.p,{type:"number",value:$,onChange:e=>G(Math.max(200,Number(e.target.value||0))),bg:gs})]})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"md",colorScheme:"purple",onClick:()=>ft.mutate(),isLoading:ft.isLoading,isDisabled:!F.trim(),children:"Rozvinout text na \u010dl\xe1nek"}),(0,p.jsx)(y.a,{fontSize:"sm",color:"gray.600",children:"AI zachov\xe1 v\xe1\u0161 text a roz\u0161\xed\u0159\xed ho pokud je kr\xe1tk\xfd, p\u0159id\xe1 strukturu a vygeneruje n\xe1zev."})]})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{fontWeight:"bold",children:"N\xe1zev \u010dl\xe1nku"}),(0,p.jsx)(C.p,{value:(null===c||void 0===c?void 0:c.title)||"",onChange:e=>(e=>{if(!c)return;const{seoTitle:t,seoDescription:n}=Ct(e);d(a=>(0,h.A)((0,h.A)({},a),{},{title:e,seo_title:t,seo_description:n},null!==a&&void 0!==a&&a.slugModified?{}:{slug:At(e)}))})(e.target.value),placeholder:"Zadejte n\xe1zev \u010dl\xe1nku",size:"lg"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL adresa (slug)"}),(0,p.jsx)(C.p,{placeholder:"moje-clanek-slug",value:(null===c||void 0===c?void 0:c.slug)||"",onChange:e=>{return t=e.target.value,void(c&&d(e=>(0,h.A)((0,h.A)({},e),{},{slug:t,slugModified:!0})));var t}}),(0,p.jsx)(_.eK,{children:"Automaticky generov\xe1no z n\xe1zvu \u010dl\xe1nku"})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{fontWeight:"bold",children:"Kategorie (sout\u011b\u017e)"}),(0,p.jsx)(ha.l,{placeholder:"Vyberte kategorii \u010dl\xe1nku",value:(null===c||void 0===c?void 0:c.category_name)||"",onChange:e=>d(t=>(0,h.A)((0,h.A)({},t),{},{category_name:e.target.value})),size:"lg",children:ne.map((e,t)=>(0,p.jsx)("option",{value:e.code&&ie[e.code]?ie[e.code]:e.name,children:e.code&&ie[e.code]?ie[e.code]:e.name},(e.code||e.name)+"_"+t))}),(0,p.jsx)(_.eK,{children:"Kategorie ur\u010duje, ve kter\xe9 sekci se \u010dl\xe1nek zobraz\xed"}),!(null!==c&&void 0!==c&&c.category_name)&&(0,p.jsx)(U.E,{color:"orange.500",fontSize:"sm",mt:1,children:"\u26a0\ufe0f Kategorie je povinn\xe1"})]}),(0,p.jsx)(y.a,{borderWidth:"2px",borderRadius:"lg",p:4,bg:(0,b.dU)("orange.50","orange.900"),borderColor:(0,b.dU)("orange.300","orange.600"),children:(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(S.l,{mb:"1",fontSize:"lg",fontWeight:"bold",children:"\u2b50 Prim\xe1rn\xed na \xfavodn\xed str\xe1nce"}),(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("gray.600","gray.400"),children:"Zv\xfdrazn\xed \u010dl\xe1nek jako hlavn\xed p\u0159\xedsp\u011bvek na domovsk\xe9 str\xe1nce"})]}),(0,p.jsx)(pa.d,{size:"lg",isChecked:!(null===c||void 0===c||!c.featured),isDisabled:Q,onChange:e=>(async a=>{if(!c)return;const i=!(null===c||void 0===c||!c.featured);if(a&&a!==i)try{te(!0);let a=(Nt||[]).filter(e=>e.featured);if(a.length>=3)try{a=(await xt({page:1,page_size:50,featured:!0,published:!1})).data||a}catch(s){}if(a.length>=3){const i=e=>{const t=(null===e||void 0===e?void 0:e.published_at)||(null===e||void 0===e?void 0:e.created_at)||(null===e||void 0===e?void 0:e.updated_at)||"",n=Date.parse(t);return isNaN(n)?0:n},s=[...a].sort((e,t)=>{const n=i(e)-i(t);return 0!==n?n:(e.id||0)-(t.id||0)})[0];if(s&&s.id!==(null===c||void 0===c?void 0:c.id))try{await vt(s.id,{featured:!1}),t({title:"Uvoln\u011bno m\xedsto pro prim\xe1rn\xed",description:"Zru\u0161ena prim\xe1rnost: ".concat(s.title),status:"info"}),n.invalidateQueries({queryKey:["admin-articles"]}),n.invalidateQueries({queryKey:["articles"]}),n.invalidateQueries({queryKey:["featured-articles"]})}catch(e){var o,r;return t({title:"Nelze uvolnit m\xedsto",description:(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)||"Zkuste znovu.",status:"error"}),void te(!1)}}d(e=>(0,h.A)((0,h.A)({},e),{},{featured:!0}))}finally{te(!1)}else d(e=>(0,h.A)((0,h.A)({},e),{},{featured:a}))})(e.target.checked)})]})}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,b.dU)("blue.50","blue.900"),borderColor:"blue.200",children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",children:"\u26bd Propojit se z\xe1pasem (voliteln\xe9)"}),re&&(0,p.jsx)(Qt.E,{colorScheme:"green",children:"Propojeno"})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[!(null!==c&&void 0!==c&&c.category_name)&&(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.600",fontWeight:"bold",children:"\u26a0\ufe0f Nejprve vyberte kategorii v\xfd\u0161e pro zobrazen\xed relevantn\xedch z\xe1pas\u016f"}),(0,p.jsxs)(_.MJ,{isDisabled:!(null!==c&&void 0!==c&&c.category_name),children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"Rychl\xe9 vyhled\xe1v\xe1n\xed"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(C.p,{placeholder:"Hledat z\xe1pas (t\xfdm, soupe\u0159...)",value:ve,onChange:e=>je(e.target.value),bg:gs,size:"sm"}),(0,p.jsx)(C.p,{type:"date",value:fe,onChange:e=>ke(e.target.value),bg:gs,size:"sm",w:"160px"})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:2,children:[(0,p.jsxs)(U.E,{fontSize:"sm",fontWeight:"medium",mb:0,children:["Vyberte z\xe1pas (",yt.length,")"]}),re&&(null===c||void 0===c?void 0:c.id)&&(0,p.jsx)(T.$,{size:"xs",variant:"ghost",colorScheme:"red",onClick:async()=>{try{await async function(e){return(await m.Ay.delete("/articles/".concat(e,"/match-link"))).data}(c.id),ce(""),me(""),we(""),t({title:"Propojen\xed zru\u0161eno",status:"success"})}catch(a){var e,n;t({title:"Zru\u0161en\xed selhalo",description:(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.error)||(null===a||void 0===a?void 0:a.message),status:"error"})}},children:"Zru\u0161it propojen\xed"})]}),(0,p.jsxs)(y.a,{maxH:"400px",overflowY:"auto",bg:(0,b.dU)("white","gray.800"),borderRadius:"md",borderWidth:"1px",p:2,children:[0===yt.length&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",textAlign:"center",py:4,children:"\u017d\xe1dn\xe9 z\xe1pasy pro vybranou kategorii"}),(0,p.jsx)(w.T,{spacing:2,align:"stretch",children:yt.slice(0,100).map(e=>{const n=String(e.id||""),a=ue===n||re===n,i=new Date(e.date||""),o=!isNaN(i.getTime()),r=o?i.toLocaleDateString("cs-CZ",{day:"numeric",month:"short",year:"numeric"}):e.date||"N/A",s=o?i.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"}):"",l=e.home||"",d=e.away||"",h=e.score||"vs",u="vs"!==h,m="".concat(l," ").concat(h," ").concat(d).trim();return(0,p.jsx)(y.a,{p:3,borderWidth:"2px",borderRadius:"md",borderColor:a?"blue.500":"gray.200",bg:a?It:Wt,cursor:"pointer",_hover:{borderColor:"blue.300",bg:Mt},transition:"all 0.2s",onClick:async()=>{const e=n;if(me(e),we(e),e&&null!==c&&void 0!==c&&c.id)try{const n=await pt(c.id,{external_match_id:String(e).trim(),title:(null===c||void 0===c?void 0:c.title)||""});ce(n.external_match_id||String(e).trim()),t({title:"Propojeno se z\xe1pasem",status:"success",duration:2e3})}catch(o){var a,i;t({title:"Propojen\xed selhalo",description:(null===o||void 0===o||null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===o||void 0===o?void 0:o.message),status:"error"})}else!e||null!==c&&void 0!==c&&c.id||t({title:"Propojen\xed bude ulo\u017eeno po vytvo\u0159en\xed \u010dl\xe1nku",status:"info",duration:2e3})},children:(0,p.jsxs)(ee.z,{justify:"space-between",spacing:3,children:[(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(Qt.E,{colorScheme:u?"green":"gray",fontSize:"xs",children:r}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"xs",children:s})]}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"bold",noOfLines:1,children:m}),e.competition&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.competition})]}),a&&(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"sm",p:2,children:"\u2713"})]})},e.id)})})]}),yt.length>100&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Zobrazeno prvn\xedch 100 z\xe1pas\u016f. Pou\u017eijte vyhled\xe1v\xe1n\xed pro z\xfa\u017een\xed v\xfdsledk\u016f."})]})]})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Obsah"}),(0,p.jsx)(ee.z,{justify:"space-between",mb:2,children:(0,p.jsx)(T.$,{size:"sm",colorScheme:"purple",leftIcon:(0,p.jsx)(q.GGD,{}),onClick:We,children:"Vlo\u017eit fotografie z alba"})}),(0,p.jsx)(Jr,{value:(null===c||void 0===c?void 0:c.content)||"",onChange:e=>d(t=>(0,h.A)((0,h.A)({},t),{},{content:e})),placeholder:"Za\u010dn\u011bte ps\xe1t obsah \u010dl\xe1nku...",height:"60vh",onImageUpload:jt,toolbar:"full"})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",mb:2,children:"Zonerama v\xfdb\u011br"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Odkaz na album Zonerama"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(jn.I,{as:q.CKj,color:"gray.400"})}),(0,p.jsx)(C.p,{placeholder:"https://eu.zonerama.com/\u2026",value:_e,onChange:e=>Ce(e.target.value),bg:Ae.length>0?Dt:void 0})]}),(0,p.jsx)(_.eK,{fontSize:"xs",children:Ae.length>0?"\u2713 Album na\u010dteno (".concat(Ae.length," fotografi\xed). M\u016f\u017eete vlo\u017eit jin\xe9 album nebo vybrat fotky n\xed\u017ee."):"Vlo\u017ete odkaz na album, nebo album se automaticky na\u010dte p\u0159i v\xfdb\u011bru fotografi\xed v sekci Obsah."}),(null===c||void 0===c?void 0:c.gallery_album_url)&&_e&&c.gallery_album_url===_e&&(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.600",fontWeight:"bold",mt:1,children:"\ud83d\udd17 Album propojeno s \u010dl\xe1nkem (zobrazeno v sekci Obsah)"})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"sm",onClick:mt,isLoading:Te,children:"Na\u010d\xedst album"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"purple",onClick:Ue,children:"Vybrat z galerie"}),_e?(0,p.jsx)(T.$,{size:"sm",as:"a",href:_e,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,p.jsx)(q.HaR,{}),children:"Otev\u0159\xedt album"}):null]}),Te&&0===Ae.length&&(0,p.jsxs)(ee.z,{spacing:2,color:"gray.600",mt:2,children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{children:"Album se na\u010d\xedt\xe1\u2026"})]}),!Te&&0===Ae.length&&_e&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",mt:2,children:'Zadejte odkaz na Zonerama album a klikn\u011bte na "Na\u010d\xedst album"'}),Ae.length>0&&(0,p.jsx)(Tt.r,{columns:{base:3,md:6},spacing:2,mt:2,children:Ae.map(e=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",_hover:{boxShadow:"md"},cursor:"pointer",onClick:()=>ht({id:e.id,album_id:"",album_url:_e,page_url:e.page_url,image_url:e.image_1500||"",title:e.title}),children:(0,p.jsx)(k._,{src:e.image_1500||"",alt:e.id,w:"100%",h:"100px",objectFit:"cover"})},e.id))})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontWeight:"bold",children:"Tituln\xed obr\xe1zek"}),(0,p.jsx)(_.eK,{mb:2,children:"Vyberte obr\xe1zek ze Zonerama v\xfd\u0161e nebo nahrajte vlastn\xed soubor."}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(k._,{src:W(null===c||void 0===c?void 0:c.image_url)||"/dist/img/logo-club-empty.svg",alt:"cover",boxSize:"80px",objectFit:"cover",borderRadius:"md"}),(0,p.jsxs)(T.$,{as:"label",leftIcon:(0,p.jsx)(q.B88,{}),colorScheme:"blue",variant:"outline",children:["Nahr\xe1t soubor",(0,p.jsx)(C.p,{type:"file",display:"none",accept:"image/*",onChange:e=>{var t;return(async e=>{if(!e)return;const t=await jt(e);d(e=>(0,h.A)((0,h.A)({},e||{}),{},{image_url:t.url}))})(null===(t=e.target.files)||void 0===t?void 0:t[0])}})]})]})]}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",mb:2,children:[(0,p.jsxs)(z.D,{as:"h3",size:"sm",display:"flex",alignItems:"center",gap:2,children:[(0,p.jsx)(jn.I,{as:q.pVQ}),"YouTube video k \u010dl\xe1nku"]}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",leftIcon:(0,p.jsx)(q.pVQ,{}),onClick:Qe,children:"Vybrat z kan\xe1lu"})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"P\u0159idat ru\u010dn\u011b (ID nebo odkaz)"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{placeholder:"https://www.youtube.com/watch?v=...",value:Ye,onChange:e=>Ge(e.target.value),bg:gs}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:dt,children:"P\u0159idat"})]}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Podporujeme pln\xe9 URL, zkr\xe1cen\xe9 odkazy i ID videa."})]}),null!==c&&void 0!==c&&c.youtube_video_id?(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:gs,children:(0,p.jsxs)(ee.z,{align:"start",spacing:3,children:[(0,p.jsx)(vn.g,{ratio:16/9,w:"160px",children:(0,p.jsx)(k._,{src:(null===c||void 0===c?void 0:c.youtube_video_thumbnail)||"https://i.ytimg.com/vi/".concat(null===c||void 0===c?void 0:c.youtube_video_id,"/hqdefault.jpg"),alt:(null===c||void 0===c?void 0:c.youtube_video_title)||"YouTube thumbnail",objectFit:"cover",borderRadius:"md"})}),(0,p.jsxs)(w.T,{align:"stretch",spacing:1,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:(null===c||void 0===c?void 0:c.youtube_video_title)||"YouTube video"}),(0,p.jsx)(L.N,{href:null===c||void 0===c?void 0:c.youtube_video_url,isExternal:!0,color:"blue.500",children:null===c||void 0===c?void 0:c.youtube_video_url}),(0,p.jsx)(ee.z,{spacing:2,children:(0,p.jsxs)(Qt.E,{colorScheme:"red",children:["ID: ",null===c||void 0===c?void 0:c.youtube_video_id]})})]}),(0,p.jsx)(K.K,{"aria-label":"Odebrat video",icon:(0,p.jsx)(q.yGN,{}),size:"sm",onClick:ct})]})}):(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"\u017d\xe1dn\xe9 video nen\xed p\u0159ipojeno. Vyberte video z kan\xe1lu nebo vlo\u017ete odkaz."})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"OG obr\xe1zek pro sd\xedlen\xed (voliteln\xe9)"}),(0,p.jsx)(_.eK,{mb:2,children:"Speci\xe1ln\xed obr\xe1zek pro sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch. Pokud nen\xed nastaveno, pou\u017eije se tituln\xed obr\xe1zek."}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(k._,{src:W(null===c||void 0===c?void 0:c.og_image_url)||W(null===c||void 0===c?void 0:c.image_url)||"/dist/img/logo-club-empty.svg",alt:"og",boxSize:"80px",objectFit:"cover",borderRadius:"md"}),(0,p.jsxs)(T.$,{as:"label",leftIcon:(0,p.jsx)(q.B88,{}),variant:"outline",children:["Nahr\xe1t OG obr\xe1zek",(0,p.jsx)(C.p,{type:"file",display:"none",accept:"image/*",onChange:e=>{var t;return(async e=>{if(!e)return;const t=await jt(e);d(e=>(0,h.A)((0,h.A)({},e||{}),{},{og_image_url:t.url}))})(null===(t=e.target.files)||void 0===t?void 0:t[0])}})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontWeight:"bold",children:"P\u0159\xedlohy"}),(0,p.jsx)(_.eK,{mb:2,children:"P\u0159idejte dokumenty, obr\xe1zky nebo jin\xe9 soubory k \u010dl\xe1nku (PDF, Word, Excel, PowerPoint, obr\xe1zky, ZIP)"}),(0,p.jsx)(ee.z,{children:(0,p.jsxs)(T.$,{as:"label",leftIcon:(0,p.jsx)(q.B88,{}),colorScheme:"teal",variant:"outline",children:["Nahr\xe1t soubory",(0,p.jsx)(C.p,{type:"file",display:"none",multiple:!0,accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.webp,.txt,.zip,.rar",onChange:async e=>{const n=Array.from(e.target.files||[]);if(0===n.length)return;const a=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/jpeg","image/png","image/gif","image/webp","text/plain","application/zip","application/x-zip-compressed","application/x-rar-compressed","application/vnd.rar"];for(const o of n)if(a.includes(o.type)||o.name.match(/\.(pdf|docx?|xlsx?|pptx?|jpe?g|png|gif|webp|txt|zip|rar)$/i))try{const e=await jt(o);d(t=>(0,h.A)((0,h.A)({},t||{}),{},{attachments:[...(null===t||void 0===t?void 0:t.attachments)||[],{name:o.name,url:e.url,mime_type:o.type,size:o.size}]})),t({title:"Soubor nahr\xe1n",description:o.name,status:"success",duration:2e3})}catch(i){t({title:"Chyba p\u0159i nahr\xe1v\xe1n\xed",description:'Soubor "'.concat(o.name,'": ').concat((null===i||void 0===i?void 0:i.message)||"Nezn\xe1m\xe1 chyba"),status:"error",duration:4e3})}else t({title:"Nepodporovan\xfd form\xe1t souboru",description:'Soubor "'.concat(o.name,'" nelze nahr\xe1t.'),status:"warning",duration:4e3});e.target.value=""}})]})}),(0,p.jsx)(y.a,{mt:2,children:Array.isArray(null===c||void 0===c?void 0:c.attachments)&&c.attachments.length>0?(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"Velikost"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:c.attachments.map((e,t)=>(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:3,p:2,children:(0,p.jsxs)(ee.z,{justify:"space-between",w:"full",children:[(0,p.jsx)(y.a,{flex:1,children:(0,p.jsx)(si,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size})}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",colorScheme:"red",flexShrink:0,ml:2,onClick:()=>d(e=>(0,h.A)((0,h.A)({},e),{},{attachments:(e.attachments||[]).filter((e,n)=>n!==t)})),children:"Odebrat"})]})})},t))})]}):(0,p.jsx)(y.a,{color:"gray.500",fontSize:"sm",children:"\u017d\xe1dn\xe9 p\u0159\xedlohy"})})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:(0,b.dU)("purple.50","purple.900"),children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",mb:2,children:"\ud83d\udcca Ankety k \u010dl\xe1nku"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.700",mb:3,children:"Vytvo\u0159te nebo p\u0159ipojte ankety p\u0159\xedmo k tomuto \u010dl\xe1nku. Ankety se zobraz\xed automaticky na konci \u010dl\xe1nku a \u010dten\xe1\u0159i mohou hlasovat."})]}),null!==c&&void 0!==c&&c.id?(0,p.jsx)(ns,{articleId:c.id,onPollsChanged:()=>{n.invalidateQueries({queryKey:["linked-polls"]})}}):(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(w.T,{align:"start",spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"saving"===tt?"Ukl\xe1d\xe1n\xed \u010dl\xe1nku...":"\u010cl\xe1nek se ukl\xe1d\xe1 automaticky"}),(0,p.jsx)(U.E,{fontSize:"sm",children:'Za\u010dn\u011bte ps\xe1t \u010dl\xe1nek na z\xe1lo\u017ek\xe1ch v\xfd\u0161e. Syst\xe9m automaticky ukl\xe1d\xe1 ka\u017edou zm\u011bnu jako koncept. Jakmile bude \u010dl\xe1nek ulo\u017een (v z\xe1hlav\xed se zobraz\xed "Ulo\u017eeno"), budete moci p\u0159idat ankety.'}),"saving"===tt&&(0,p.jsx)(zn.y,{size:"sm",color:"blue.500"}),"idle"===tt&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",children:"\ud83d\udca1 Vypl\u0148te n\xe1zev \u010dl\xe1nku pro aktivaci automatick\xe9ho ukl\xe1d\xe1n\xed"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:async()=>{try{await at(),ye(4)}catch(e){}},isLoading:zt.isLoading,children:"Ulo\u017eit jako koncept a p\u0159idat ankety"})]})]})]})}),(0,p.jsxs)(da.K,{children:[(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:4,children:"SEO metadata jsou automaticky generov\xe1na z n\xe1zvu a obsahu \u010dl\xe1nku. Upravujte pouze pokud pot\u0159ebujete specifick\xe9 hodnoty."}),(0,p.jsx)(zr.n,{allowToggle:!0,children:(0,p.jsxs)(wr.A,{borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)("h2",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsx)(y.a,{flex:"1",textAlign:"left",fontWeight:"semibold",children:"\ud83d\udcca Pokro\u010dil\xe1 SEO metadata (voliteln\xe9)"}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"SEO titulek"}),(0,p.jsx)(C.p,{placeholder:"SEO titulek",value:(null===c||void 0===c?void 0:c.seo_title)||"",onChange:e=>d(t=>(0,h.A)((0,h.A)({},t),{},{seo_title:e.target.value})),size:"sm"}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Automaticky generov\xe1no z n\xe1zvu \u010dl\xe1nku"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"SEO popis"}),(0,p.jsx)(va.T,{placeholder:"SEO popis",value:(null===c||void 0===c?void 0:c.seo_description)||"",onChange:e=>d(t=>(0,h.A)((0,h.A)({},t),{},{seo_description:e.target.value})),rows:3,size:"sm"}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Automaticky generov\xe1no z obsahu \u010dl\xe1nku"})]})]})})]})})]})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:kt,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>Et(),isLoading:zt.isLoading||wt.isLoading,children:"Ulo\u017eit"})]})]})]}),(0,p.jsx)(Yr,{isOpen:Ie,onClose:Me,onPhotosSelected:ut}),(0,p.jsxs)(se.aF,{isOpen:Xe,onClose:et,size:"6xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxH:"90vh",children:[(0,p.jsx)(J.r,{children:"Vybrat video z YouTube kan\xe1lu"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{overflowY:"auto",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Vyhledat video"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(jn.I,{as:q.CKj,color:"gray.400"})}),(0,p.jsx)(C.p,{placeholder:"N\xe1zev videa nebo ID...",value:Be,onChange:e=>Je(e.target.value)})]})]}),He&&(0,p.jsxs)(ee.z,{spacing:2,justify:"center",py:8,children:[(0,p.jsx)(zn.y,{size:"lg",color:"blue.500"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m videa z kan\xe1lu..."})]}),!He&&st.length>0&&(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:4,children:st.map(e=>(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",cursor:"pointer",transition:"all 0.2s",_hover:{boxShadow:"lg",transform:"scale(1.02)"},onClick:()=>lt(e),children:[(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsx)(k._,{src:e.thumbnail_url,alt:e.title,objectFit:"cover"})}),(0,p.jsxs)(y.a,{p:3,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:2,children:e.title}),e.published_date&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:new Date(e.published_date).toLocaleDateString("cs-CZ")})]})]},e.video_id))}),!He&&0===st.length&&0===qe.length&&(0,p.jsxs)(w.T,{py:8,spacing:3,children:[(0,p.jsx)(jn.I,{as:q.pVQ,boxSize:12,color:"gray.400"}),(0,p.jsx)(U.E,{color:"gray.600",textAlign:"center",children:"\u017d\xe1dn\xe1 videa nebyla nalezena."}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",textAlign:"center",children:"Zkontrolujte nastaven\xed YouTube kan\xe1lu v administraci."}),(0,p.jsx)(T.$,{size:"sm",onClick:rt,leftIcon:(0,p.jsx)(q.wO2,{}),children:"Obnovit seznam"})]}),!He&&0===st.length&&qe.length>0&&(0,p.jsxs)(w.T,{py:8,children:[(0,p.jsx)(U.E,{color:"gray.600",children:"\u017d\xe1dn\xe1 videa neodpov\xeddaj\xed va\u0161emu hled\xe1n\xed."}),(0,p.jsx)(T.$,{size:"sm",variant:"link",onClick:()=>Je(""),children:"Zobrazit v\u0161echna videa"})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{variant:"ghost",onClick:et,children:"Zav\u0159\xedt"})})]})]}),(0,p.jsxs)(se.aF,{isOpen:De,onClose:Le,size:"6xl",scrollBehavior:"inside",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxH:"90vh",children:[(0,p.jsx)(J.r,{children:"Vybrat fotku z galerie"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{overflowY:"auto",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[Ze&&(0,p.jsxs)(ee.z,{spacing:2,justify:"center",py:8,children:[(0,p.jsx)(zn.y,{size:"lg",color:"purple.500"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m alba z galerie..."})]}),!Ze&&Fe.length>0&&(0,p.jsx)(w.T,{align:"stretch",spacing:6,children:Fe.map(e=>(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:Ut,children:[(0,p.jsx)(ee.z,{justify:"space-between",mb:3,children:(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:e.title||"Album bez n\xe1zvu"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:[e.date," \u2022 ",e.photos.length," fotografi\xed"]})]})}),(0,p.jsx)(Tt.r,{columns:{base:3,md:4,lg:6},spacing:2,children:e.photos.map(t=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",cursor:"pointer",transition:"all 0.2s",_hover:{boxShadow:"lg",transform:"scale(1.05)"},onClick:()=>{ht({id:t.id,album_id:e.id,album_url:"https://eu.zonerama.com/FKKofolaKrnov/Album/".concat(e.id),page_url:t.page_url,image_url:t.image_1500,title:e.title}),Le()},children:(0,p.jsx)(vn.g,{ratio:1,children:(0,p.jsx)(k._,{src:t.image_1500,alt:t.id,objectFit:"cover"})})},t.id))})]},e.id))}),!Ze&&0===Fe.length&&(0,p.jsxs)(w.T,{py:8,spacing:3,children:[(0,p.jsx)(jn.I,{as:q.CKj,boxSize:12,color:"gray.400"}),(0,p.jsx)(U.E,{color:"gray.600",textAlign:"center",children:"\u017d\xe1dn\xe1 alba nebyla nalezena v cache."}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",textAlign:"center",children:"Zkontrolujte nastaven\xed Zonerama nebo obnovte cache."}),(0,p.jsx)(T.$,{size:"sm",onClick:ot,leftIcon:(0,p.jsx)(q.wO2,{}),children:"Obnovit seznam"})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{variant:"ghost",onClick:Le,children:"Zav\u0159\xedt"})})]})]}),(0,p.jsx)(cs,{isOpen:u,onClose:()=>x(!1),onRecover:()=>{const e=hs(g);e&&(d(e),ye(1),M()),x(!1)},onDiscard:()=>{it(),d({title:"",content:"",featured:!1,published:!1}),ye(0),x(!1),M()},onDeleteOnly:()=>{it(),x(!1)},draftAge:(null===(e=us(g))||void 0===e?void 0:e.age)||null,entityType:"\u010dl\xe1nek"})]})},js=()=>{var e;(0,b.dU)("white","gray.800"),(0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700");const t=e=>{if(!e||""===e)return"/logo192.png";if(/^https?:\/\//i.test(e))return e;const t=new URL(m.API_URL,window.location.origin).origin;return e.startsWith("/uploads/")?"".concat(t).concat(e):"".concat(t).concat(e.startsWith("/")?"":"/").concat(e)},n=(0,j.d)(),i=(0,l.jE)(),{data:o,isLoading:r}=(0,xe.I)({queryKey:["admin-sponsors"],queryFn:Jt}),[s,c]=(0,a.useState)(null),{isOpen:d,onOpen:u,onClose:x}=(0,X.j)(),g=()=>{c(null),x()},v=(0,Mn.n)({mutationFn:e=>Yt(e),onSuccess:e=>{try{i.setQueryData(["admin-sponsors"],t=>{const n=Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[],a=[e,...n];return t&&t.data?(0,h.A)((0,h.A)({},t),{},{data:a}):a})}catch(t){}n({title:"Sponzor vytvo\u0159en",status:"success"}),i.invalidateQueries({queryKey:["admin-sponsors"]}),g()},onError:e=>{var t,a;return n({title:"Vytvo\u0159en\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}}),f=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return Gt(t,n)},onSuccess:e=>{try{i.setQueryData(["admin-sponsors"],t=>{const n=((Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[])||[]).map(t=>(null===t||void 0===t?void 0:t.id)===(null===e||void 0===e?void 0:e.id)?(0,h.A)((0,h.A)({},t),e):t);return t&&t.data?(0,h.A)((0,h.A)({},t),{},{data:n}):n})}catch(t){}n({title:"Sponzor aktualizov\xe1n",status:"success"}),i.invalidateQueries({queryKey:["admin-sponsors"]}),g()},onError:e=>{var t,a;return n({title:"Aktualizace selhala",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}}),A=(0,Mn.n)({mutationFn:e=>Xt(e),onSuccess:()=>{n({title:"Sponzor smaz\xe1n",status:"success"}),i.invalidateQueries({queryKey:["admin-sponsors"]})},onError:e=>{var t,a;return n({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}});return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va sponzor\u016f"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>{c({name:"",is_active:!0,tier:"standard",display_order:0}),u()},children:"Nov\xfd sponzor"})]}),(0,p.jsx)(U.E,{color:"gray.500",mb:6,children:"Spr\xe1va sponzor\u016f a partner\u016f klubu. M\u016f\u017eete p\u0159id\xe1vat, upravovat a odeb\xedrat sponzory, kte\u0159\xed se zobrazuj\xed na webu."}),(0,p.jsx)(y.a,{bg:(0,b.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"80px",children:"Logo"}),(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"\xdarove\u0148"}),(0,p.jsx)(Oi.Th,{children:"Po\u0159ad\xed"}),(0,p.jsx)(Oi.Th,{children:"Web"}),(0,p.jsx)(Oi.Th,{w:"120px",children:"Aktivn\xed"}),(0,p.jsx)(Oi.Th,{w:"160px",children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[r&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:7,children:"Na\u010d\xedt\xe1m..."})}),!r&&(o||[]).map(e=>{var a;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(k._,{src:t(e.logo_url),alt:e.name,boxSize:"48px",objectFit:"contain"})}),(0,p.jsx)(Ki.Td,{children:e.name}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"general"===e.tier?"green":"blue",children:"general"===e.tier?"Hlavn\xed partner":"Partner"})}),(0,p.jsx)(Ki.Td,{children:null!==(a=e.display_order)&&void 0!==a?a:0}),(0,p.jsx)(Ki.Td,{children:e.website_url?(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(L.N,{href:e.website_url,color:"blue.500",isExternal:!0,fontSize:"sm",children:e.website_url}),(0,p.jsx)(q.HaR,{})]}):"-"}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(pa.d,{isChecked:!!e.is_active,onChange:()=>(async e=>{if(null!=e.id)try{await f.mutateAsync({id:e.id,payload:{is_active:!e.is_active}}),n({title:"Stav sponzora aktualizov\xe1n",status:"success"})}catch(t){n({title:"Aktualizace selhala",status:"error"})}})(e)})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",icon:(0,p.jsx)(q.WXf,{}),size:"sm",onClick:()=>(e=>{c((0,h.A)({},e)),u()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),size:"sm",colorScheme:"red",variant:"outline",onClick:async()=>{if(window.confirm('Opravdu chcete smazat sponzora "'.concat(e.name,'"?')))try{await A.mutateAsync(e.id),n({title:"Sponzor smaz\xe1n",status:"success"})}catch(t){n({title:"Smaz\xe1n\xed sponzora selhalo",status:"error"})}}})]})})]},e.id)})]})]})}),(0,p.jsxs)(se.aF,{isOpen:d,onClose:g,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:null!==s&&void 0!==s&&s.id?"Upravit sponzora":"Nov\xfd sponzor"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev"}),(0,p.jsx)(C.p,{value:(null===s||void 0===s?void 0:s.name)||"",onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{name:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Web (URL)"}),(0,p.jsx)(C.p,{value:(null===s||void 0===s?void 0:s.website_url)||"",onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{website_url:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Logo"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(k._,{src:t(null===s||void 0===s?void 0:s.logo_url),alt:"logo",boxSize:"56px",objectFit:"contain"}),(0,p.jsxs)(T.$,{as:"label",type:"button",leftIcon:(0,p.jsx)(q.B88,{}),children:["Upload",(0,p.jsx)(C.p,{type:"file",display:"none",accept:"image/*",onChange:async e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];await(async e=>{if(e)try{const t=await jt(e);c(e=>(0,h.A)((0,h.A)({},e||{}),{},{logo_url:t.url||""})),n({title:"Logo nahr\xe1no",status:"success"})}catch(t){n({title:"Nahr\xe1n\xed loga selhalo",status:"error"})}})(a),e.target.value=""}})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"\xdarove\u0148 partnera"}),(0,p.jsxs)(ha.l,{value:(null===s||void 0===s?void 0:s.tier)||"standard",onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{tier:e.target.value})),children:[(0,p.jsx)("option",{value:"general",children:"Hlavn\xed partner"}),(0,p.jsx)("option",{value:"standard",children:"Partner"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Po\u0159ad\xed zobrazen\xed"}),(0,p.jsx)(ua.Q7,{value:null!==(e=null===s||void 0===s?void 0:s.display_order)&&void 0!==e?e:0,onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{display_order:parseInt(e)||0})),min:0,children:(0,p.jsx)(ua.OO,{})}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Men\u0161\xed \u010d\xedslo = vy\u0161\u0161\xed pozice"})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:!(null===s||void 0===s||!s.is_active),onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:g,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{var e,t;if(!s)return;const n={name:s.name||"",website_url:s.website_url||"",logo_url:s.logo_url||"",is_active:null===(e=s.is_active)||void 0===e||e,tier:s.tier||"standard",display_order:null!==(t=s.display_order)&&void 0!==t?t:0};null!=s.id?await f.mutateAsync({id:s.id,payload:n}):await v.mutateAsync(n)},isLoading:v.isLoading||f.isLoading,children:"Ulo\u017eit"})]})]})]})]})})},bs=e=>{let{title:t,description:n,icon:a,badge:i,action:o,children:r}=e;const s=(0,b.dU)("gray.200","gray.700"),l=(0,b.dU)("blue.50","blue.900"),c=(0,b.dU)("blue.600","blue.300");return(0,p.jsxs)(y.a,{mb:8,pb:6,borderBottomWidth:"1px",borderColor:s,children:[(0,p.jsxs)(Q.s,{justify:"space-between",align:"flex-start",wrap:"wrap",gap:4,children:[(0,p.jsxs)(ee.z,{spacing:4,align:"flex-start",flex:1,children:[a&&(0,p.jsx)(y.a,{p:3,bg:l,borderRadius:"xl",display:{base:"none",md:"block"},children:(0,p.jsx)(jn.I,{as:a,boxSize:6,color:c})}),(0,p.jsxs)(w.T,{align:"flex-start",spacing:2,flex:1,children:[(0,p.jsxs)(ee.z,{spacing:3,wrap:"wrap",children:[(0,p.jsx)(z.D,{size:"xl",fontWeight:"extrabold",bgGradient:(0,b.dU)("linear(to-r, gray.800, gray.600)","linear(to-r, white, gray.300)"),bgClip:"text",children:t}),i&&(0,p.jsx)(Qt.E,{colorScheme:i.colorScheme||"blue",fontSize:"sm",px:3,py:1,borderRadius:"full",children:i.label})]}),n&&(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.400"),fontSize:"md",maxW:"2xl",children:n})]})]}),o&&(0,p.jsx)(T.$,{leftIcon:o.icon,onClick:o.onClick,colorScheme:o.colorScheme||"blue",isLoading:o.isLoading,isDisabled:o.isDisabled,size:"lg",shadow:"sm",_hover:{shadow:"md",transform:"translateY(-1px)"},transition:"all 0.2s",children:o.label})]}),r]})},ys=()=>{const e=(0,j.d)(),t=(0,l.jE)(),{data:n,isLoading:i}=(0,xe.I)({queryKey:["admin-categories"],queryFn:Xa}),[o,r]=(0,a.useState)(null),{isOpen:s,onOpen:c,onClose:d}=(0,X.j)(),u=(0,b.dU)("white","gray.800"),x=(0,b.dU)("gray.200","gray.700"),g=()=>{r(null),d()},v=(0,Mn.n)({mutationFn:e=>async function(e){return(await m.Ay.post("/admin/categories",e)).data}(e),onSuccess:()=>{e({title:"Kategorie vytvo\u0159ena",status:"success",duration:3e3}),t.invalidateQueries({queryKey:["admin-categories"]}),g()},onError:t=>{var n,a;return e({title:"Vytvo\u0159en\xed selhalo",description:(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.chyba)||(null===t||void 0===t?void 0:t.message)||"Chyba",status:"error",duration:5e3})}}),f=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return async function(e,t){return(await m.Ay.put("/admin/categories/".concat(e),t)).data}(t,n)},onSuccess:()=>{e({title:"Kategorie aktualizov\xe1na",status:"success",duration:3e3}),t.invalidateQueries({queryKey:["admin-categories"]}),g()},onError:t=>{var n,a;return e({title:"Aktualizace selhala",description:(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.chyba)||(null===t||void 0===t?void 0:t.message)||"Chyba",status:"error",duration:5e3})}}),k=(0,Mn.n)({mutationFn:e=>async function(e){await m.Ay.delete("/admin/categories/".concat(e))}(e),onSuccess:()=>{e({title:"Kategorie smaz\xe1na",status:"success",duration:3e3}),t.invalidateQueries({queryKey:["admin-categories"]})},onError:t=>{var n,a,i,o;return e({title:"Smaz\xe1n\xed selhalo",description:(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.chyba)||(null===t||void 0===t||null===(i=t.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.detail)||(null===t||void 0===t?void 0:t.message)||"Chyba",status:"error",duration:5e3})}});return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{maxW:"1200px",mx:"auto",children:[(0,p.jsx)(bs,{title:"Kategorie \u010dl\xe1nk\u016f",description:"Spravujte kategorie pro \u010dl\xe1nky. Kategorie lze p\u0159i\u0159adit p\u0159i vytv\xe1\u0159en\xed nebo \xfaprav\u011b \u010dl\xe1nku.",icon:q.cnX,action:{label:"P\u0159idat kategorii",icon:(0,p.jsx)(q.GGD,{}),onClick:()=>{r({name:"",description:""}),c()},colorScheme:"blue"}}),i?(0,p.jsx)(w.T,{spacing:3,children:[1,2,3].map(e=>(0,p.jsx)(en.E,{height:"60px",w:"100%",borderRadius:"md"},e))}):n&&0!==n.length?(0,p.jsx)(y.a,{bg:u,borderWidth:"1px",borderColor:x,borderRadius:"xl",overflow:"hidden",shadow:"md",children:(0,p.jsxs)(Ui.X,{variant:"simple",size:"md",children:[(0,p.jsx)(Li.d,{bg:(0,b.dU)("gray.50","gray.700"),children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{width:"40%",children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{width:"50%",children:"Popis"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:n.map(e=>(0,p.jsxs)(Fi.Tr,{_hover:{bg:(0,b.dU)("gray.50","gray.700")},transition:"background 0.2s",children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(ee.z,{children:(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"sm",px:3,py:1,borderRadius:"full",children:e.name})})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:e.description||(0,p.jsx)(U.E,{as:"span",fontStyle:"italic",color:"gray.400",children:"Bez popisu"})})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsxs)(ee.z,{justify:"flex-end",spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",icon:(0,p.jsx)(q.WXf,{}),size:"sm",colorScheme:"blue",variant:"ghost",onClick:()=>(e=>{r((0,h.A)({},e)),c()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>(async e=>{window.confirm('Opravdu chcete smazat kategorii "'.concat(e.name,'"?'))&&await k.mutateAsync(e.id)})(e),isLoading:k.isPending})]})})]},e.id))})]})}):(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Zat\xedm nejsou \u017e\xe1dn\xe9 kategorie"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Kategorie se vytvo\u0159\xed automaticky p\u0159i psan\xed \u010dl\xe1nk\u016f, nebo je m\u016f\u017eete vytvo\u0159it ru\u010dn\u011b."})]})]}),(0,p.jsxs)(se.aF,{isOpen:s,onClose:g,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:null!==o&&void 0!==o&&o.id?"Upravit kategorii":"Nov\xe1 kategorie"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev kategorie"}),(0,p.jsx)(C.p,{placeholder:"nap\u0159. Novinky, A-t\xfdm, Ml\xe1de\u017e...",value:(null===o||void 0===o?void 0:o.name)||"",onChange:e=>r(t=>(0,h.A)((0,h.A)({},t),{},{name:e.target.value})),autoFocus:!0})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis (voliteln\xe9)"}),(0,p.jsx)(va.T,{placeholder:"Kr\xe1tk\xfd popis kategorie...",value:(null===o||void 0===o?void 0:o.description)||"",onChange:e=>r(t=>(0,h.A)((0,h.A)({},t),{},{description:e.target.value})),rows:3})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:g,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{var t,n;if(!o)return;if(null===(t=o.name)||void 0===t||!t.trim())return void e({title:"N\xe1zev je povinn\xfd",status:"warning"});const a={name:o.name.trim(),description:(null===(n=o.description)||void 0===n?void 0:n.trim())||""};null!=o.id?await f.mutateAsync({id:o.id,payload:a}):await v.mutateAsync(a)},isLoading:v.isPending||f.isPending,children:null!==o&&void 0!==o&&o.id?"Ulo\u017eit":"Vytvo\u0159it"})]})]})]})]})})},fs=async e=>(await ve.A.get("".concat(m.API_URL,"/admin/files"),{params:e,withCredentials:!0})).data,ks=async()=>(await ve.A.get("".concat(m.API_URL,"/admin/files/unused"),{withCredentials:!0})).data,zs=async()=>(await ve.A.get("".concat(m.API_URL,"/admin/files/duplicates"),{withCredentials:!0})).data,ws=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];await ve.A.delete("".concat(m.API_URL,"/admin/files/").concat(e),{params:{force:t},withCredentials:!0})},_s=async()=>(await ve.A.post("".concat(m.API_URL,"/admin/files/scan"),{},{withCredentials:!0})).data,Ss=async e=>(await ve.A.post("".concat(m.API_URL,"/admin/files/refresh-tracking"),{},{params:e?{entity_type:e}:{},withCredentials:!0})).data,Cs=e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["B","KB","MB","GB"][t]},As=()=>{var e;const t=(0,j.d)(),n=(0,l.jE)(),[i,o]=(0,a.useState)(""),[r,s]=(0,a.useState)("all"),[c,d]=(0,a.useState)(null),[h,u]=(0,a.useState)(null),[m,x]=(0,a.useState)(null),[g,v]=(0,a.useState)(!1),{isOpen:f,onOpen:_,onClose:S}=(0,X.j)(),{isOpen:N,onOpen:R,onClose:P}=(0,X.j)(),{isOpen:I,onOpen:W,onClose:M}=(0,X.j)(),D=(0,b.dU)("gray.200","gray.600"),L=((0,b.dU)("gray.50","gray.700"),(0,b.dU)("white","gray.800")),F=(0,a.useMemo)(()=>"images"===r?"image/":"videos"===r?"video/":"documents"===r?"application/":"",[r]),{data:O=[],isLoading:Z,refetch:V}=(0,xe.I)({queryKey:["admin-media-files",i,F],queryFn:()=>fs({search:i,mime_type:F})}),$=(0,a.useMemo)(()=>O.filter(e=>{var t;return!(i&&(null===(t=e.filename)||void 0===t||!t.toLowerCase().includes(i.toLowerCase())))}),[O,i]),ne=$.filter(e=>{var t;return null===(t=e.mime_type)||void 0===t?void 0:t.startsWith("image/")}),ae=$.filter(e=>{var t;return null===(t=e.mime_type)||void 0===t?void 0:t.startsWith("video/")}),ie=$.filter(e=>{var t,n;return(null===(t=e.mime_type)||void 0===t?void 0:t.startsWith("application/"))||(null===(n=e.mime_type)||void 0===n?void 0:n.startsWith("text/"))}),oe=(0,Mn.n)({mutationFn:e=>{let{id:t,force:n}=e;return ws(t,n)},onSuccess:()=>{t({title:"Soubor smaz\xe1n",status:"success"}),n.invalidateQueries({queryKey:["admin-media-files"]}),P(),u(null)},onError:e=>{var n,a;t({title:"Chyba p\u0159i maz\xe1n\xed",description:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Nepoda\u0159ilo se smazat soubor",status:"error"})}}),re=(0,Mn.n)({mutationFn:_s,onSuccess:e=>{t({title:"Skenov\xe1n\xed dokon\u010deno",description:"P\u0159id\xe1no: ".concat(e.new_files||0,", Smaz\xe1no: ").concat(e.orphaned_files||0),status:"success"}),n.invalidateQueries({queryKey:["admin-media-files"]})},onError:()=>{t({title:"Chyba p\u0159i skenov\xe1n\xed",status:"error"})}}),ce=e=>{u(e),R()},de=e=>{navigator.clipboard.writeText(e),t({title:"Zkop\xedrov\xe1no do schr\xe1nky",status:"success",duration:2e3})},he=e=>{if(e.url.startsWith("http"))return e.url;const t=window.location.origin;return"".concat(t).concat(e.url)},ue=e=>{var t,n,a;let{file:i}=e;const o=null===(t=i.mime_type)||void 0===t?void 0:t.startsWith("image/"),r=null===(n=i.mime_type)||void 0===n?void 0:n.startsWith("video/");return(0,p.jsxs)(y.a,{bg:L,borderRadius:"lg",borderWidth:"1px",borderColor:D,overflow:"hidden",cursor:"pointer",onClick:()=>(e=>{d(e),_()})(i),_hover:{shadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsx)(y.a,{bg:"gray.100",display:"flex",alignItems:"center",justifyContent:"center",children:o?(0,p.jsx)(k._,{src:he(i),alt:i.filename,objectFit:"cover",w:"100%",h:"100%"}):r?(0,p.jsx)(y.a,{fontSize:"48px",color:"gray.400",children:(0,p.jsx)(q.pVQ,{})}):(0,p.jsx)(y.a,{fontSize:"48px",color:"gray.400",children:(0,p.jsx)(q.QuH,{})})})}),(0,p.jsxs)(w.T,{align:"stretch",p:3,spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",noOfLines:1,children:i.filename}),(0,p.jsxs)(ee.z,{justify:"space-between",fontSize:"xs",color:"gray.500",children:[(0,p.jsx)(U.E,{children:Cs(i.size||0)}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"9px",children:null===(a=i.mime_type)||void 0===a?void 0:a.split("/")[0]})]}),(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(te.m,{label:"Kop\xedrovat URL",children:(0,p.jsx)(K.K,{"aria-label":"Copy URL",icon:(0,p.jsx)(q.nxz,{}),size:"xs",variant:"ghost",onClick:e=>{e.stopPropagation(),de(he(i))}})}),(0,p.jsx)(te.m,{label:"Smazat",children:(0,p.jsx)(K.K,{"aria-label":"Delete",icon:(0,p.jsx)(q.IXo,{}),size:"xs",variant:"ghost",colorScheme:"red",onClick:e=>{e.stopPropagation(),ce(i)}})})]})]})]})};return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(Q.s,{justify:"space-between",align:"center",mb:6,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:1,children:"M\xe9dia"}),(0,p.jsx)(U.E,{color:"gray.500",children:"Spr\xe1va obr\xe1zk\u016f, vide\xed a dal\u0161\xedch soubor\u016f"})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.jTZ,{}),onClick:()=>re.mutate(),isLoading:re.isPending,size:"sm",children:"Skenovat"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.B88,{}),colorScheme:"blue",onClick:W,size:"sm",children:"Nahr\xe1t"})]})]}),(0,p.jsxs)(ee.z,{spacing:4,mb:6,children:[(0,p.jsx)(y.a,{p:4,bg:L,borderRadius:"lg",borderWidth:"1px",borderColor:D,children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.fZZ,{}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:ne.length}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Obr\xe1zk\u016f"})]})]})}),(0,p.jsx)(y.a,{p:4,bg:L,borderRadius:"lg",borderWidth:"1px",borderColor:D,children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.pVQ,{}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:ae.length}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Vide\xed"})]})]})}),(0,p.jsx)(y.a,{p:4,bg:L,borderRadius:"lg",borderWidth:"1px",borderColor:D,children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.QuH,{}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"2xl",fontWeight:"bold",children:ie.length}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Dokument\u016f"})]})]})})]}),(0,p.jsxs)(ee.z,{mb:6,spacing:4,children:[(0,p.jsxs)(A.M,{maxW:"400px",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(q.CKj,{color:"gray"})}),(0,p.jsx)(C.p,{placeholder:"Hledat soubory...",value:i,onChange:e=>o(e.target.value)})]}),(0,p.jsxs)(ha.l,{maxW:"200px",value:r,onChange:e=>s(e.target.value),children:[(0,p.jsx)("option",{value:"all",children:"V\u0161echny typy"}),(0,p.jsx)("option",{value:"images",children:"Pouze obr\xe1zky"}),(0,p.jsx)("option",{value:"videos",children:"Pouze videa"}),(0,p.jsx)("option",{value:"documents",children:"Pouze dokumenty"})]})]}),(0,p.jsxs)(ra.t,{children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsxs)(la.o,{children:["V\u0161echny (",$.length,")"]}),(0,p.jsxs)(la.o,{children:["Obr\xe1zky (",ne.length,")"]}),(0,p.jsxs)(la.o,{children:["Videa (",ae.length,")"]}),(0,p.jsxs)(la.o,{children:["Dokumenty (",ie.length,")"]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{px:0,children:Z?(0,p.jsx)(Tt.r,{columns:{base:1,md:3,lg:4},spacing:4,children:[...Array(8)].map((e,t)=>(0,p.jsx)(en.E,{height:"250px",borderRadius:"lg"},t))}):0===$.length?(0,p.jsx)(y.a,{textAlign:"center",py:12,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 soubory"})}):(0,p.jsx)(Tt.r,{columns:{base:1,md:3,lg:4},spacing:4,children:$.map(e=>(0,p.jsx)(ue,{file:e},e.id))})}),(0,p.jsx)(da.K,{px:0,children:0===ne.length?(0,p.jsx)(y.a,{textAlign:"center",py:12,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 obr\xe1zky"})}):(0,p.jsx)(Tt.r,{columns:{base:1,md:3,lg:4},spacing:4,children:ne.map(e=>(0,p.jsx)(ue,{file:e},e.id))})}),(0,p.jsx)(da.K,{px:0,children:0===ae.length?(0,p.jsx)(y.a,{textAlign:"center",py:12,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe1 videa"})}):(0,p.jsx)(Tt.r,{columns:{base:1,md:3,lg:4},spacing:4,children:ae.map(e=>(0,p.jsx)(ue,{file:e},e.id))})}),(0,p.jsx)(da.K,{px:0,children:0===ie.length?(0,p.jsx)(y.a,{textAlign:"center",py:12,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 dokumenty"})}):(0,p.jsx)(Tt.r,{columns:{base:1,md:3,lg:4},spacing:4,children:ie.map(e=>(0,p.jsx)(ue,{file:e},e.id))})})]})]}),(0,p.jsxs)(se.aF,{isOpen:f,onClose:S,size:"2xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Detail souboru"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:c&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(null===(e=c.mime_type)||void 0===e?void 0:e.startsWith("image/"))&&(0,p.jsx)(k._,{src:he(c),alt:c.filename,borderRadius:"lg",maxH:"400px",objectFit:"contain"}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(At.B,{spacing:2,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"N\xe1zev:"}),(0,p.jsx)(U.E,{children:c.filename})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Velikost:"}),(0,p.jsx)(U.E,{children:Cs(c.size||0)})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Typ:"}),(0,p.jsx)(Qt.E,{children:c.mime_type})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Vytvo\u0159eno:"}),(0,p.jsx)(U.E,{fontSize:"sm",children:c.created_at?new Date(c.created_at).toLocaleString("cs-CZ"):"N/A"})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"URL:"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(ja.C,{flex:1,p:2,fontSize:"xs",borderRadius:"md",children:he(c)}),(0,p.jsx)(K.K,{"aria-label":"Copy URL",icon:(0,p.jsx)(q.nxz,{}),size:"sm",onClick:()=>de(he(c))})]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[c&&(0,p.jsx)(T.$,{as:"a",href:he(c),target:"_blank",leftIcon:(0,p.jsx)(q.HaR,{}),size:"sm",children:"Otev\u0159\xedt"}),(0,p.jsx)(T.$,{colorScheme:"red",leftIcon:(0,p.jsx)(q.IXo,{}),onClick:()=>{c&&(S(),ce(c))},size:"sm",children:"Smazat"}),(0,p.jsx)(T.$,{onClick:S,size:"sm",children:"Zav\u0159\xedt"})]})})]})]}),(0,p.jsxs)(se.aF,{isOpen:N,onClose:P,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Smazat soubor"}),(0,p.jsx)(B.s,{}),(0,p.jsxs)(Y.c,{children:[(0,p.jsxs)(U.E,{children:["Opravdu chcete smazat soubor ",(0,p.jsx)("strong",{children:null===h||void 0===h?void 0:h.filename}),"?"]}),(0,p.jsx)(U.E,{mt:2,fontSize:"sm",color:"gray.500",children:"Tato akce je nevratn\xe1."})]}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{onClick:P,size:"sm",children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"red",onClick:()=>{h&&oe.mutate({id:h.id,force:!1})},isLoading:oe.isPending,size:"sm",children:"Smazat"})]})})]})]}),(0,p.jsxs)(se.aF,{isOpen:I,onClose:M,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Nahr\xe1t soubory"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Vyberte jeden nebo v\xedce soubor\u016f k nahr\xe1n\xed."}),(0,p.jsx)(C.p,{type:"file",multiple:!0,accept:"image/*,video/*,application/pdf",onChange:e=>x(e.target.files),p:1}),m&&m.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(U.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:["Vybran\xe9 soubory (",m.length,"):"]}),(0,p.jsx)(w.T,{align:"stretch",spacing:1,children:Array.from(m).map((e,t)=>(0,p.jsxs)(U.E,{fontSize:"sm",children:["\u2022 ",e.name," (",Cs(e.size),")"]},t))})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{onClick:M,size:"sm",children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{if(m&&0!==m.length){v(!0);try{const e=Array.from(m).map(e=>jt(e));await Promise.all(e),t({title:"Soubory nahr\xe1ny",description:"\xdasp\u011b\u0161n\u011b nahr\xe1no ".concat(m.length," soubor\u016f"),status:"success"}),n.invalidateQueries({queryKey:["admin-media-files"]}),M(),x(null)}catch(e){t({title:"Chyba p\u0159i nahr\xe1v\xe1n\xed",status:"error"})}finally{v(!1)}}},isLoading:g,isDisabled:!m||0===m.length,size:"sm",children:"Nahr\xe1t"})]})})]})]})]})})};var Es=n(8876);const Ts=()=>{const e=(0,l.jE)(),t=(0,j.d)(),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(null),[s,c]=(0,a.useState)(null),[u,x]=(0,a.useState)({home_name_override:"",away_name_override:"",venue_override:"",date_time_override:"",home_logo_url:"",away_logo_url:"",notes:""}),{data:g={}}=(0,xe.I)({queryKey:["teamLogoOverrides"],queryFn:Bo,staleTime:3e5}),v=e=>{let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)".concat(a,"(\\b|$)"),"g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk)\b\.?/g," "),t=t.replace(/[\.,!;:()\[\]{}]/g," "),t=t.replace(/\s+/g," ").trim(),t},f=(null===g||void 0===g?void 0:g.by_name)||{},w=(0,a.useMemo)(()=>{const e={};for(const t of Object.keys(f))e[v(t)]=f[t];return e},[f]),[N,P]=(0,a.useState)({}),I=(e,t,n)=>{if(!e)return W("/dist/img/logo-club-empty.svg");if(t&&N[String(t)])return N[String(t)];let a=f[e];return a||(a=w[v(e)]),a?a.startsWith("/")?W(a):a:n||"/dist/img/logo-club-empty.svg"},[M,D]=(0,a.useState)(""),[L,F]=(0,a.useState)(""),[O,Z]=(0,a.useState)(null),[K,q]=(0,a.useState)(null),[B,G]=(0,a.useState)(""),[X,Q]=(0,a.useState)(""),[te,ne]=(0,a.useState)(""),[ae,ie]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=setTimeout(()=>ne(B),300);return()=>clearTimeout(e)},[B]),(0,a.useEffect)(()=>{const e=setTimeout(()=>ie(X),300);return()=>clearTimeout(e)},[X]);const{data:oe=[]}=(0,xe.I)({queryKey:["club-search-home",te],queryFn:()=>$o(te),enabled:te.trim().length>=2}),{data:re=[]}=(0,xe.I)({queryKey:["club-search-away",ae],queryFn:()=>$o(ae),enabled:ae.trim().length>=2}),se=(0,a.useRef)(null),le=(0,a.useRef)(null),{data:ce=[],isLoading:de,error:he}=(0,xe.I)({queryKey:["admin-matches-list-cache"],queryFn:async()=>{const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});if(!n.ok)throw new Error("Failed to load cache: ".concat(n.status));const a=await n.json(),i=(Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map(t=>(0,h.A)((0,h.A)({},t),{},{competitionName:e.name,competition_id:e.id}))),o="dd.MM.yyyy HH:mm";return i.sort((e,t)=>(0,Lo.qg)(String(e.date_time||e.date),o,new Date).getTime()-(0,Lo.qg)(String(t.date_time||t.date),o,new Date).getTime()),i.map(e=>({id:e.match_id,date_time:e.date_time||e.date,competitionName:e.competitionName,competition_id:e.competition_id,home:e.home||e.home_team,home_id:e.home_id||e.home_team_id||e.home_team_facr_id,away:e.away||e.away_team,away_id:e.away_id||e.away_team_id||e.away_team_facr_id,score:e.score,venue:e.venue,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url}))}});(0,a.useEffect)(()=>{if(!Array.isArray(ce)||0===ce.length)return;const e=new Set;for(const t of ce)t.home_id&&e.add(String(t.home_id)),t.away_id&&e.add(String(t.away_id));0!==e.size&&(async()=>{try{const t=await $e(Array.from(e));P(t)}catch(t){console.warn("Failed to batch fetch logos:",t)}})()},[ce]);const[ue,me]=(0,a.useState)(""),[pe,ge]=(0,a.useState)(""),[ve,je]=(0,a.useState)(""),[be,ye]=(0,a.useState)(""),[fe,ke]=(0,a.useState)(""),ze=ue.trim().toLowerCase(),we="dd.MM.yyyy HH:mm",{data:_e}=(0,xe.I)({queryKey:["public-settings"],queryFn:R}),{data:Se}=(0,xe.I)({queryKey:["facr-club-info-name"],queryFn:async()=>{const e=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});return n.ok?await n.json():null}}),Ce=(null===_e||void 0===_e?void 0:_e.club_name)||(null===Se||void 0===Se?void 0:Se.name)||"",Ae=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ee=e=>{let t=Ae(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},Te=Ae(Ce),Ne=Ee(Ce),Re=e=>{const t=Ae(e),n=Ee(e);return!!Te&&(t.includes(Te)||n.includes(Ne)||t.endsWith(Ne)||Ne.endsWith(n))},Pe=(0,a.useMemo)(()=>{const e=new Set;for(const t of ce)t.competitionName&&e.add(String(t.competitionName));return Array.from(e).sort((e,t)=>e.localeCompare(t))},[ce]),Ie=ce.filter(e=>{if(!(!ze||("home"===fe?[e.home,e.home_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ze)):"away"===fe?[e.away,e.away_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ze)):[e.home,e.home_team,e.away,e.away_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ze)))))return!1;if(be&&String(e.competitionName||"")!==be)return!1;if(fe&&Te){const t=String(e.home||e.home_team||""),n=String(e.away||e.away_team||"");if("home"===fe&&!Re(t))return!1;if("away"===fe&&!Re(n))return!1}const t=String(e.date_time||e.date||"");let n=NaN;try{n=(0,Lo.qg)(t,we,new Date).getTime()}catch(a){n=new Date(t).getTime()}if(isNaN(n))return!0;if(pe){const e=new Date(pe+"T00:00:00").getTime();if(!isNaN(e)&&n<e)return!1}if(ve){const e=new Date(ve+"T23:59:59").getTime();if(!isNaN(e)&&n>e)return!1}return!0}),[We,Me]=(0,a.useState)(50),[De,Ue]=(0,a.useState)(50),[Le,Fe]=(0,d.ok)();(0,a.useEffect)(()=>{const e=Le.get("team")||"",t=Le.get("from")||"",n=Le.get("to")||"",a=Le.get("comp")||"",i=(Le.get("venue"),Le.get("side")||""),o=parseInt(Le.get("size")||"")||void 0,r=parseInt(Le.get("limit")||"")||void 0;e&&me(e),t&&ge(t),n&&je(n),a&&ye(a),"home"!==i&&"away"!==i||ke(i),o&&(Me(o),Ue(o)),r&&Ue(r)},[]),(0,a.useEffect)(()=>{const e={};ue&&(e.team=ue),pe&&(e.from=pe),ve&&(e.to=ve),be&&(e.comp=be),fe&&(e.side=fe),50!==We&&(e.size=String(We)),De!==We&&(e.limit=String(De)),Fe(e,{replace:!0})},[ue,pe,ve,be,fe,We,De,Fe]),(0,a.useEffect)(()=>{Ue(We)},[ze,pe,ve,be,fe,Te,We]);const Oe=Ie.slice(0,De),Ze=""!==u.date_time_override.trim()&&isNaN(Date.parse(u.date_time_override)),Ke=(0,Mn.n)({mutationFn:async()=>{const e=(null===s||void 0===s?void 0:s.match_id)||(null===s||void 0===s?void 0:s.id);if(!e)throw new Error("Chyb\xed match_id");const t=(0,h.A)({},u);Object.keys(t).forEach(e=>{""===t[e]&&(t[e]=null)}),await async function(e,t){const n=(0,h.A)({},t);if("string"===typeof n.date_time_override&&""!==n.date_time_override.trim()){const e=new Date(n.date_time_override);isNaN(e.getTime())||(n.date_time_override=e.toISOString())}return(await m.Ay.put("/admin/match-overrides/".concat(encodeURIComponent(e)),n)).data}(e,t);const n={},a=async(t,n,a,i,o)=>{try{if(!n)return{success:!1,error:"Chyb\xed ID t\xfdmu"};let r=a;if(!r&&o&&(r=await Vo(o)),!r)return{success:!1,error:"Nelze z\xedskat soubor loga"};const s=await qo(n,r,{filename:r instanceof File?r.name:"".concat(n,".png"),clubName:i||"Nezn\xe1m\xfd klub",clubType:"football"});return s.success?(s.url&&await async function(e,t){const n=(0,h.A)({},t);if("string"===typeof n.date_time_override&&""!==n.date_time_override.trim()){const e=new Date(n.date_time_override);isNaN(e.getTime())||(n.date_time_override=e.toISOString())}return(await m.Ay.patch("/admin/match-overrides/".concat(encodeURIComponent(e)),n)).data}(e,"home"===t?{home_logo_url:s.url}:{away_logo_url:s.url}),{success:!0}):{success:!1,error:s.error||"Upload selhal"}}catch(r){return{success:!1,error:(null===r||void 0===r?void 0:r.message)||"Chyba p\u0159i uploadu"}}};return M&&(u.home_logo_url||O)&&(n.home=await a("home",M,O,u.home_name_override,u.home_logo_url)),L&&(u.away_logo_url||K)&&(n.away=await a("away",L,K,u.away_name_override,u.away_logo_url)),{ok:!0,results:n}},onSuccess:n=>{const a=(null===n||void 0===n?void 0:n.results)||{},o=[];a.home&&o.push(a.home.success?"Logo dom\xe1c\xedch nahr\xe1no":"Dom\xe1c\xed: ".concat(a.home.error||"chyba")),a.away&&o.push(a.away.success?"Logo host\u016f nahr\xe1no":"Host\xe9: ".concat(a.away.error||"chyba"));const r=o.length?o.join(" \u2022 "):void 0;t({title:"Ulo\u017eeno",description:r,status:"success"}),i(!1),c(null),Z(null),q(null),e.invalidateQueries({queryKey:["admin-matches-list-cache"]})},onError:e=>{t({title:"Ulo\u017een\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to znovu",status:"error"})}}),qe=(e,t)=>{c(e);const n=e.date_time||e.date||"";let a="";if(n)try{const e=(0,Lo.qg)(String(n),"dd.MM.yyyy HH:mm",new Date);isNaN(e.getTime())||(a=e.toISOString())}catch(o){const e=new Date(n);isNaN(e.getTime())||(a=e.toISOString())}x({home_name_override:e.home||e.home_team||"",away_name_override:e.away||e.away_team||"",venue_override:e.venue||"",date_time_override:a,home_logo_url:e.home_logo_url||"",away_logo_url:e.away_logo_url||"",notes:""}),i(!0),r(null!==t&&void 0!==t?t:null),D(""),F(""),Z(null),q(null)},Ve=(0,a.useRef)(null),He=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(n&&o){const e=setTimeout(()=>{var e,t;"home"===o&&(null===(e=Ve.current)||void 0===e||e.focus()),"away"===o&&(null===(t=He.current)||void 0===t||t.focus())},50);return()=>clearTimeout(e)}},[n,o]);const Be=(0,Es.A)({base:"full",md:"md"}),Je=(0,a.useRef)(null),[Ye,Ge]=(0,a.useState)(!1),[Xe,Qe]=(0,a.useState)(!1),[et,tt]=(0,a.useState)(!0),[nt,at]=(0,a.useState)(!1),[it,ot]=(0,a.useState)(0),[rt,st]=(0,a.useState)(0),lt=(0,a.useRef)(0),ct=(0,a.useRef)(0),dt=(0,a.useRef)(0),ht=(0,a.useRef)(null),ut=(0,a.useRef)(null),mt=()=>{const e=Je.current;if(!e)return;const t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;t!==Ye&&Ge(t),n!==Xe&&Qe(n)};(0,a.useEffect)(()=>{mt();const e=()=>mt();return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),ht.current&&cancelAnimationFrame(ht.current)}},[]);const pt=(0,b.dU)("brand.primary","gray.700"),xt=(0,b.dU)("text.onPrimary","white"),gt=(0,b.dU)("white","gray.800"),vt=(0,b.dU)("gray.200","gray.700"),jt=(0,b.dU)("linear(to-r, white, transparent)","linear(to-r, gray.800, transparent)"),bt=(0,b.dU)("linear(to-l, white, transparent)","linear(to-l, gray.800, transparent)"),yt=(0,b.dU)("gray.100","gray.700"),ft=(0,b.dU)("white","gray.800"),kt=(0,b.dU)("gray.200","gray.600"),zt=(0,b.dU)("gray.50","gray.700");return(0,p.jsxs)(Mo,{requireAdmin:!1,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(y.a,{mb:6,children:[(0,p.jsx)(z.D,{size:"lg",mb:2,children:"Spr\xe1va z\xe1pas\u016f"}),(0,p.jsx)(U.E,{color:(0,b.dU)("gray.600","gray.400"),children:"Spr\xe1va a \xfaprava z\xe1pas\u016f. M\u016f\u017eete upravovat informace o z\xe1pasech, v\u010detn\u011b n\xe1zv\u016f t\xfdm\u016f, term\xedn\u016f, log a dal\u0161\xedch detail\u016f."})]}),de?(0,p.jsxs)(ee.z,{spacing:3,mb:4,children:[(0,p.jsx)(zn.y,{}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m z\xe1pasy\u2026"})]}):he?(0,p.jsxs)(xa.F,{status:"error",variant:"left-accent",mb:4,children:[(0,p.jsx)(ga._,{}),"Nepoda\u0159ilo se na\u010d\xedst z\xe1pasy."]}):(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(Et.B,{mb:4,spacing:3,align:"center",children:[(0,p.jsx)(Et.Q,{minW:"160px",children:(0,p.jsxs)(ha.l,{size:"sm",value:fe,onChange:e=>ke(e.target.value||""),children:[(0,p.jsx)("option",{value:"",children:"V\u0161echny strany"}),(0,p.jsx)("option",{value:"home",children:"Dom\xe1c\xed"}),(0,p.jsx)("option",{value:"away",children:"Host\xe9"})]})}),(0,p.jsx)(Et.Q,{flex:1,minW:"220px",children:(0,p.jsx)(C.p,{placeholder:"Filtrovat podle t\xfdmu\u2026",value:ue,onChange:e=>me(e.target.value),size:"sm"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"date",size:"sm",value:pe,onChange:e=>ge(e.target.value)}),(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",children:"\u2013"}),(0,p.jsx)(C.p,{type:"date",size:"sm",value:ve,onChange:e=>je(e.target.value)})]})}),(0,p.jsx)(Et.Q,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>{const e=new Date,t=e.getDay(),n=0===t?-6:1-t,a=new Date(e);a.setDate(e.getDate()+n);const i=new Date(a);i.setDate(a.getDate()+6);const o=a.toISOString().slice(0,10),r=i.toISOString().slice(0,10);ge(o),je(r)},borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"Tento t\xfdden"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()+30);const n=e.toISOString().slice(0,10),a=t.toISOString().slice(0,10);ge(n),je(a)},borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"Dal\u0161\xedch 30 dn\xed"})]})}),(0,p.jsx)(Et.Q,{minW:"220px",children:(0,p.jsxs)(ha.l,{size:"sm",value:be,onChange:e=>ye(e.target.value),children:[(0,p.jsx)("option",{value:"",children:"V\u0161echny sout\u011b\u017ee"}),Pe.map(e=>(0,p.jsx)("option",{value:e,children:e},e))]})}),(ue||pe||ve||be||fe)&&(0,p.jsx)(Et.Q,{children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",colorScheme:"red",onClick:()=>{me(""),ge(""),je(""),ye(""),ke("")},borderRadius:"md",children:"Vymazat filtry"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{fontSize:"sm",children:"Na str\xe1nku:"}),(0,p.jsxs)(ha.l,{size:"sm",value:We,onChange:e=>Me(parseInt(e.target.value)||25),width:"auto",children:[(0,p.jsx)("option",{value:25,children:"25"}),(0,p.jsx)("option",{value:50,children:"50"}),(0,p.jsx)("option",{value:100,children:"100"}),(0,p.jsx)("option",{value:200,children:"200"})]})]})}),(0,p.jsx)(Et.Q,{children:(0,p.jsx)(T.$,{size:"sm",onClick:()=>{const e=Ie.map(e=>({date:e.date_time||e.date||"",competition:e.competitionName||"",home:e.home||e.home_team||"",away:e.away||e.away_team||"",score:e.score||(null!=e.result_home&&null!=e.result_away?"".concat(e.result_home,":").concat(e.result_away):""),venue:e.venue||""})),t=["date","competition","home","away","score","venue"],n=[t.join(","),...e.map(e=>t.map(t=>(e=>{const t=String(null!==e&&void 0!==e?e:"");return/[",\n]/.test(t)?'"'+t.replace(/"/g,'""')+'"':t})(e[t])).join(","))].join("\n"),a=new Blob([n],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(a),o=document.createElement("a");o.href=i,o.download="matches.csv",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)},bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"md",children:"Export CSV"})}),(0,p.jsx)(Et.Q,{children:(0,p.jsxs)(U.E,{color:"gray.500",fontSize:"sm",children:["Zobrazeno ",Oe.length," / ",Ie.length]})})]}),et&&(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.600",fontWeight:"600",mb:2,display:"flex",alignItems:"center",gap:1,children:"\ud83d\udca1 Tip: Tabulku m\u016f\u017eete plynule posouvat ta\u017een\xedm my\u0161\xed nebo prstem \u2192"}),(0,p.jsxs)(y.a,{ref:Je,overflowX:"auto",borderWidth:"2px",borderRadius:"xl",borderColor:vt,w:"full",bg:gt,boxShadow:"md",maxW:"100%",position:"relative",cursor:"grab",onMouseDown:e=>{Je.current&&(ht.current&&(cancelAnimationFrame(ht.current),ht.current=null),at(!0),ot(e.pageX-Je.current.offsetLeft),st(Je.current.scrollLeft),lt.current=e.pageX,ct.current=Date.now(),dt.current=0,Je.current.style.cursor="grabbing",Je.current.style.userSelect="none",Je.current.style.scrollBehavior="auto")},onMouseLeave:()=>{at(!1),Je.current&&(Je.current.style.cursor="grab",Je.current.style.userSelect="auto")},onMouseUp:()=>{if(at(!1),Je.current){Je.current.style.cursor="grab",Je.current.style.userSelect="auto",Je.current.style.scrollBehavior="smooth";const e=dt.current;if(Math.abs(e)>.5){const e=()=>{Je.current&&(dt.current*=.95,Je.current.scrollLeft-=dt.current,Math.abs(dt.current)>.5?ht.current=requestAnimationFrame(e):ht.current=null)};ht.current=requestAnimationFrame(e)}}},onMouseMove:e=>{if(!nt||!Je.current)return;e.preventDefault();const t=1.5*(e.pageX-Je.current.offsetLeft-it);Je.current.scrollLeft=rt-t;const n=Date.now(),a=n-ct.current;if(a>0){const t=e.pageX,i=t-lt.current;dt.current=i/a*16,lt.current=t,ct.current=n}},onTouchStart:e=>{if(!Je.current)return;ht.current&&(cancelAnimationFrame(ht.current),ht.current=null);const t=e.touches[0];at(!0),ot(t.pageX-Je.current.offsetLeft),st(Je.current.scrollLeft),lt.current=t.pageX,ct.current=Date.now(),dt.current=0,Je.current&&(Je.current.style.scrollBehavior="auto")},onTouchMove:e=>{if(!nt||!Je.current)return;const t=e.touches[0],n=1.5*(t.pageX-Je.current.offsetLeft-it);Je.current.scrollLeft=rt-n;const a=Date.now(),i=a-ct.current;if(i>0){const e=t.pageX,n=e-lt.current;dt.current=n/i*16,lt.current=e,ct.current=a}},onTouchEnd:()=>{if(at(!1),Je.current){Je.current.style.scrollBehavior="smooth";const e=dt.current;if(Math.abs(e)>.5){const e=()=>{Je.current&&(dt.current*=.95,Je.current.scrollLeft-=dt.current,Math.abs(dt.current)>.5?ht.current=requestAnimationFrame(e):ht.current=null)};ht.current=requestAnimationFrame(e)}}},onScroll:e=>{null==ut.current&&(ut.current=requestAnimationFrame(()=>{const e=Je.current;e&&(mt(),e.scrollLeft>0&&et&&tt(!1)),ut.current=null}))},sx:{WebkitOverflowScrolling:"touch",scrollBehavior:"smooth",transform:"translateZ(0)",willChange:"transform",overscrollBehaviorX:"contain",touchAction:"pan-x","th, td":{whiteSpace:"nowrap"},"::-webkit-scrollbar":{height:"14px"},"::-webkit-scrollbar-thumb":{background:"#3182ce",borderRadius:"10px",border:"3px solid transparent",backgroundClip:"content-box",transition:"background 0.2s ease","&:hover":{background:"#2c5aa0",backgroundClip:"content-box"},"&:active":{background:"#2a4e8a",backgroundClip:"content-box"}},"::-webkit-scrollbar-track":{background:(0,b.dU)("#f7fafc","#2d3748"),borderRadius:"10px",margin:"0 8px",border:"1px solid",borderColor:(0,b.dU)("#e2e8f0","#4a5568")}},children:[Ye&&(0,p.jsx)(y.a,{position:"sticky",left:0,top:0,bottom:0,w:"24px",pointerEvents:"none",bgGradient:jt,zIndex:1}),Xe&&(0,p.jsx)(y.a,{position:"sticky",right:0,top:0,bottom:0,w:"24px",pointerEvents:"none",bgGradient:bt,zIndex:1}),(0,p.jsxs)(Ui.X,{size:"sm",sx:{width:"max-content"},children:[(0,p.jsx)(Li.d,{sx:{position:"sticky",top:0,zIndex:2,backgroundColor:pt,th:{bg:pt,color:xt,fontWeight:"bold",textTransform:"uppercase",fontSize:"xs",letterSpacing:"0.05em"}},children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{minW:"140px",children:"Datum"}),(0,p.jsx)(Oi.Th,{minW:"200px",children:"Sout\u011b\u017e"}),(0,p.jsx)(Oi.Th,{minW:"260px",children:"Dom\xe1c\xed"}),(0,p.jsx)(Oi.Th,{minW:"80px",textAlign:"center",children:"Sk\xf3re"}),(0,p.jsx)(Oi.Th,{minW:"260px",children:"Host\xe9"}),(0,p.jsx)(Oi.Th,{minW:"220px",children:"M\xedsto"}),(0,p.jsx)(Oi.Th,{minW:"180px",children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:0===Ie.length?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 z\xe1pasy k zobrazen\xed."})})}):Oe.map((e,t)=>{var n;const a=(e=>{if(!e)return!1;try{const t=(0,Lo.qg)(e,we,new Date);if(!isNaN(t.getTime()))return t.getTime()<Date.now()}catch(t){const n=new Date(e);if(!isNaN(n.getTime()))return n.getTime()<Date.now()}return!1})(e.date_time||e.date||""),i=e.score||null!=e.result_home&&null!=e.result_away;return(0,p.jsxs)(Fi.Tr,{bg:a?yt:ft,_hover:{bg:a?kt:zt},opacity:a?.85:1,transition:"all 0.2s",children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(U.E,{children:e.date_time||e.date||""}),a&&(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"xs",children:"Odehr\xe1no"}),!a&&(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"xs",children:"Nadch\xe1zej\xedc\xed"})]})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(ee.z,{spacing:2,children:(0,p.jsx)(Qt.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"md",children:e.competitionName})})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(k._,{src:I(e.home||e.home_team||"",e.home_id,e.home_logo_url),alt:e.home||e.home_team||"",boxSize:"24px",objectFit:"contain",loading:"lazy",decoding:"async",draggable:!1}),(0,p.jsx)(U.E,{fontWeight:a?"normal":"medium",children:e.home||e.home_team||""}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>qe(e,"home"),borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"T\xfdm"})]})}),(0,p.jsx)(Ki.Td,{textAlign:"center",children:(0,p.jsx)(U.E,{fontWeight:i?"bold":"normal",color:i?"blue.600":"gray.500",children:e.score||(null!=e.result_home&&null!=e.result_away?"".concat(e.result_home,":").concat(e.result_away):"\u2013:\u2013")})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(k._,{src:I(e.away||e.away_team||"",e.away_id,e.away_logo_url),alt:e.away||e.away_team||"",boxSize:"24px",objectFit:"contain",loading:"lazy",decoding:"async",draggable:!1}),(0,p.jsx)(U.E,{fontWeight:a?"normal":"medium",children:e.away||e.away_team||""}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>qe(e,"away"),borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"T\xfdm"})]})}),(0,p.jsx)(Ki.Td,{children:e.venue||""}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(ee.z,{spacing:2,children:(0,p.jsx)(T.$,{size:"xs",onClick:()=>qe(e),bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"md",children:"Upravit"})})})]},null!==(n=e.id)&&void 0!==n?n:t)})})]})]}),Ie.length>Oe.length&&(0,p.jsx)(ee.z,{justify:"center",mt:6,children:(0,p.jsxs)(T.$,{onClick:()=>Ue(e=>e+We),size:"lg",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"lg",px:8,children:["Na\u010d\xedst dal\u0161\xed (",Ie.length-Oe.length," z\xe1pas\u016f)"]})})]})]}),(0,p.jsxs)(V._s,{isOpen:n,placement:"right",onClose:()=>i(!1),size:Be,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)($.z,{children:[(0,p.jsx)(J.r,{children:"Upravit z\xe1pas"}),(0,p.jsx)(Y.c,{children:s?(0,p.jsxs)(At.B,{spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Datum a \u010das (ISO)"}),(0,p.jsx)(C.p,{placeholder:"YYYY-MM-DDTHH:mm:ss.sssZ",value:u.date_time_override,onChange:e=>x(t=>(0,h.A)((0,h.A)({},t),{},{date_time_override:e.target.value}))}),Ze&&(0,p.jsx)(Yn.Wt,{children:"Neplatn\xfd form\xe1t data/\u010dasu"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"M\xedsto"}),(0,p.jsx)(C.p,{placeholder:"M\xedsto kon\xe1n\xed",value:u.venue_override,onChange:e=>x(t=>(0,h.A)((0,h.A)({},t),{},{venue_override:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Dom\xe1c\xed t\xfdm (n\xe1zev)"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{ref:Ve,placeholder:"Zadejte n\xe1zev t\xfdmu",value:u.home_name_override,onChange:e=>{x(t=>(0,h.A)((0,h.A)({},t),{},{home_name_override:e.target.value})),(e=>{G(e.target.value)})(e)}}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>{var e;return null===(e=se.current)||void 0===e?void 0:e.click()},children:"Logo"})})]}),(0,p.jsx)("input",{type:"file",accept:"image/*",hidden:!0,ref:se,onChange:async e=>{var n;const a=null===(n=e.target.files)||void 0===n?void 0:n[0];if(a)try{const e=await Ho(a);x(t=>(0,h.A)((0,h.A)({},t),{},{home_logo_url:e.url})),Z(a),t({title:"Logo nahr\xe1no (dom\xe1c\xed)",status:"success"})}catch(i){t({title:"Nahr\xe1n\xed se nezda\u0159ilo",description:(null===i||void 0===i?void 0:i.message)||"",status:"error"})}finally{se.current&&(se.current.value="")}}}),oe.length>0&&(0,p.jsx)(y.a,{mt:2,borderWidth:"1px",borderRadius:"md",p:2,maxH:"180px",overflowY:"auto",children:(0,p.jsx)(No.B8,{spacing:1,children:oe.map(e=>(0,p.jsx)(No.ck,{children:(0,p.jsx)(T.$,{size:"xs",variant:"ghost",onClick:()=>{x(t=>(0,h.A)((0,h.A)({},t),{},{home_name_override:e.name,home_logo_url:e.logo_url||t.home_logo_url})),G(e.name),D(String(e.id||""))},children:e.name})},e.id))})}),u.home_logo_url&&(0,p.jsxs)(ee.z,{mt:2,spacing:3,children:[(0,p.jsx)(k._,{src:u.home_logo_url,alt:"home logo",boxSize:"28px",objectFit:"contain"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>x(e=>(0,h.A)((0,h.A)({},e),{},{home_logo_url:""})),children:"Odebrat logo"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Hostuj\xedc\xed t\xfdm (n\xe1zev)"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{ref:He,placeholder:"Zadejte n\xe1zev t\xfdmu",value:u.away_name_override,onChange:e=>{x(t=>(0,h.A)((0,h.A)({},t),{},{away_name_override:e.target.value})),(e=>{Q(e.target.value)})(e)}}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>{var e;return null===(e=le.current)||void 0===e?void 0:e.click()},children:"Logo"})})]}),(0,p.jsx)("input",{type:"file",accept:"image/*",hidden:!0,ref:le,onChange:async e=>{var n;const a=null===(n=e.target.files)||void 0===n?void 0:n[0];if(a)try{const e=await Ho(a);x(t=>(0,h.A)((0,h.A)({},t),{},{away_logo_url:e.url})),q(a),t({title:"Logo nahr\xe1no (host\xe9)",status:"success"})}catch(i){t({title:"Nahr\xe1n\xed se nezda\u0159ilo",description:(null===i||void 0===i?void 0:i.message)||"",status:"error"})}finally{le.current&&(le.current.value="")}}}),re.length>0&&(0,p.jsx)(y.a,{mt:2,borderWidth:"1px",borderRadius:"md",p:2,maxH:"180px",overflowY:"auto",children:(0,p.jsx)(No.B8,{spacing:1,children:re.map(e=>(0,p.jsx)(No.ck,{children:(0,p.jsx)(T.$,{size:"xs",variant:"ghost",onClick:()=>{x(t=>(0,h.A)((0,h.A)({},t),{},{away_name_override:e.name,away_logo_url:e.logo_url||t.away_logo_url})),Q(e.name),F(String(e.id||""))},children:e.name})},e.id))})}),u.away_logo_url&&(0,p.jsxs)(ee.z,{mt:2,spacing:3,children:[(0,p.jsx)(k._,{src:u.away_logo_url,alt:"away logo",boxSize:"28px",objectFit:"contain"}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>x(e=>(0,h.A)((0,h.A)({},e),{},{away_logo_url:""})),children:"Odebrat logo"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Pozn\xe1mka"}),(0,p.jsx)(C.p,{placeholder:"Libovoln\xe1 pozn\xe1mka (intern\xed)",value:u.notes,onChange:e=>x(t=>(0,h.A)((0,h.A)({},t),{},{notes:e.target.value}))})]})]}):(0,p.jsx)(U.E,{color:"gray.500",children:"Nen\xed vybr\xe1n \u017e\xe1dn\xfd z\xe1pas."})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(T.$,{variant:"outline",onClick:()=>i(!1),children:"Zav\u0159\xedt"}),(0,p.jsx)(T.$,{colorScheme:"blue",isLoading:Ke.isPending,onClick:()=>Ke.mutate(),isDisabled:Ze,children:"Ulo\u017eit zm\u011bny"})]})})]})]})]})},Ns=()=>{const e=(0,b.dU)("white","gray.800"),t=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700"),(0,j.d)()),n=e=>{if(!e||""===e)return"/logo192.png";if(/^https?:\/\//i.test(e))return e;const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return e.startsWith("/uploads/")?"".concat(t).concat(e):"".concat(t).concat(e.startsWith("/")?"":"/").concat(e)};function i(e){return e?e.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0))):""}const[o,r]=(0,a.useState)([]),[s,c]=(0,a.useState)(""),d=(0,a.useRef)(null),u=(0,a.useRef)(null);function x(e,t){if(!t)return 0;const n=e.toLowerCase(),a=t.toLowerCase();if(n===a)return 1e3;if(n.startsWith(a))return 800-(n.length-a.length);let i=0,o=0,r=0,s=0;for(;i<n.length&&o<a.length;)n[i]===a[o]?(s+=1,r+=10+s,o++):s=0,i++;return o===a.length?r-Math.abs(n.length-a.length):-1/0}const g=(0,a.useMemo)(()=>{const e=s.trim();if(!e)return o;const t=o.map(t=>({c:t,s:Math.max(x(t.name,e),x(t.cca2,e))})).filter(e=>e.s>-1/0).sort((e,t)=>t.s-e.s||e.c.name.localeCompare(t.c.name,"cs",{sensitivity:"base"})).map(e=>e.c);return t},[o,s]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let n=null;const a=["https://restcountries.com/v3.1/all?fields=name,cca2","https://restcountries.com/v2/all?fields=name,alpha2Code","https://restcountries.com/v3.1/all"];let o=null;for(const e of a)try{const t=await fetch(e);if(!t.ok)throw new Error("countries ".concat(t.status));const a=await t.json();if(Array.isArray(a)){n=a;break}}catch(t){o=t}if(!e)return;if(!n)throw o||new Error("countries fetch failed");const s=(n||[]).map(e=>{var t;const n=(null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.common)||(null===e||void 0===e?void 0:e.name)||"",a=(null===e||void 0===e?void 0:e.cca2)||(null===e||void 0===e?void 0:e.alpha2Code)||"";return{name:n,cca2:a,emoji:i(a)}}).filter(e=>e.name&&e.cca2).sort((e,t)=>e.name.localeCompare(t.name,"cs",{sensitivity:"base"}));r(s)}catch(n){const e=[{name:"Czechia",cca2:"CZ",emoji:i("CZ")},{name:"Slovakia",cca2:"SK",emoji:i("SK")},{name:"Poland",cca2:"PL",emoji:i("PL")},{name:"Germany",cca2:"DE",emoji:i("DE")},{name:"Austria",cca2:"AT",emoji:i("AT")},{name:"Ukraine",cca2:"UA",emoji:i("UA")},{name:"France",cca2:"FR",emoji:i("FR")},{name:"Spain",cca2:"ES",emoji:i("ES")},{name:"Italy",cca2:"IT",emoji:i("IT")},{name:"England",cca2:"GB",emoji:i("GB")}];r(e)}})(),()=>{e=!1}},[]),(0,a.useEffect)(()=>{try{const e=localStorage.getItem("playersAdmin.countryQuery");e&&c(e)}catch(e){}},[]),(0,a.useEffect)(()=>{try{localStorage.setItem("playersAdmin.countryQuery",s)}catch(e){}},[s]);const v=async e=>{const t=await function(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const e=new window.Image;e.onload=()=>t(e),e.onerror=n,e.src=a.result},a.onerror=n,a.readAsDataURL(e)})}(e),n=1400;let{width:a,height:i}=t;if(a>n||i>n){const e=Math.min(n/a,n/i);a=Math.round(a*e),i=Math.round(i*e)}const o=document.createElement("canvas");o.width=a,o.height=i;o.getContext("2d").drawImage(t,0,0,a,i);const r=await new Promise(e=>o.toBlob(e,"image/jpeg",.78));if(!r)throw new Error("compression failed");const s=new File([r],e.name.replace(/\.[^/.]+$/,"")+".jpg",{type:"image/jpeg"});return await jt(s)};const f=(0,l.jE)(),{data:A,isLoading:E}=(0,xe.I)({queryKey:["admin-players"],queryFn:Bt}),[N,R]=(0,a.useState)(null),{isOpen:P,onOpen:I,onClose:W}=(0,X.j)(),M=250,D=400,[U,L]=(0,a.useState)({day:"",month:"",year:""}),F=()=>{R(null),W()},O=(0,Mn.n)({mutationFn:e=>async function(e){return $t((await m.Ay.post("/players",e)).data)}(e),onSuccess:e=>{try{f.setQueryData(["admin-players"],t=>{const n=Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[],a=[e,...n];return t&&t.data?(0,h.A)((0,h.A)({},t),{},{data:a}):a})}catch(n){}t({title:"Hr\xe1\u010d vytvo\u0159en",status:"success"}),f.invalidateQueries({queryKey:["admin-players"]}),F()},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Vytvo\u0159en\xed selhalo",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}}),Z=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return async function(e,t){return $t((await m.Ay.put("/players/".concat(e),t)).data)}(t,n)},onSuccess:()=>{t({title:"Hr\xe1\u010d upraven",status:"success"}),f.invalidateQueries({queryKey:["admin-players"]}),F()},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Aktualizace selhala",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}}),V=(0,Mn.n)({mutationFn:e=>async function(e){return(await m.Ay.delete("/players/".concat(e))).data}(e),onSuccess:()=>{t({title:"Hr\xe1\u010d smaz\xe1n",status:"success"}),f.invalidateQueries({queryKey:["admin-players"]})},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Smaz\xe1n\xed selhalo",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}});return(0,p.jsxs)(Mo,{requireAdmin:!1,children:[(0,p.jsx)(z.D,{size:"lg",mb:4,children:"Hr\xe1\u010di"}),(0,p.jsx)(ee.z,{mb:4,children:(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>{R({first_name:"",last_name:"",is_active:!0,email:"",phone:""}),$(""),I()},children:"Nov\xfd hr\xe1\u010d"})}),(0,p.jsx)(y.a,{bg:e,borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"80px",children:"Fotka"}),(0,p.jsx)(Oi.Th,{children:"Jm\xe9no"}),(0,p.jsx)(Oi.Th,{children:"Pozice"}),(0,p.jsx)(Oi.Th,{children:"N\xe1rodnost"}),(0,p.jsx)(Oi.Th,{w:"120px",children:"\u010c\xedslo"}),(0,p.jsx)(Oi.Th,{w:"120px",children:"Aktivn\xed"}),(0,p.jsx)(Oi.Th,{w:"160px",children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[E&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:7,children:"Na\u010d\xedt\xe1m..."})}),!E&&(A||[]).map(e=>{var t;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(ss,{src:n(e.image_url),alt:"".concat(e.first_name," ").concat(e.last_name),size:"48px",previewSize:"300px",borderRadius:"md"})}),(0,p.jsxs)(Ki.Td,{children:[e.first_name," ",e.last_name]}),(0,p.jsx)(Ki.Td,{children:e.position||"-"}),(0,p.jsx)(Ki.Td,{children:e.nationality?Bi(e.nationality):"-"}),(0,p.jsx)(Ki.Td,{children:null!==(t=e.jersey_number)&&void 0!==t?t:"-"}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(pa.d,{isChecked:!!e.is_active,onChange:()=>{null!=e.id&&Z.mutate({id:e.id,payload:{is_active:!e.is_active}})}})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",size:"sm",icon:(0,p.jsx)(q.WXf,{}),onClick:()=>(e=>{R((0,h.A)({},e)),$(e.date_of_birth||""),I()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,p.jsx)(q.IXo,{}),onClick:async()=>{confirm("Opravdu smazat z\xe1znam?")&&null!=e.id&&await V.mutateAsync(e.id)}})]})})]},e.id)})]})]})}),(0,p.jsxs)(se.aF,{isOpen:P,onClose:F,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:null!==N&&void 0!==N&&N.id?"Upravit hr\xe1\u010de":"Nov\xfd hr\xe1\u010d"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(Tt.r,{columns:[1,2],spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Jm\xe9no"}),(0,p.jsx)(C.p,{value:(null===N||void 0===N?void 0:N.first_name)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{first_name:e.target.value})),onBlur:()=>{R(e=>{if(!e)return e;const t=(e.first_name||"").trim();if(!(e.last_name||"").trim()&&t.includes(" ")){const n=t.split(/\s+/).filter(Boolean);if(n.length>=2)return(0,h.A)((0,h.A)({},e),{},{first_name:n[0],last_name:n[n.length-1]})}return e})}})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"P\u0159\xedjmen\xed"}),(0,p.jsx)(C.p,{value:(null===N||void 0===N?void 0:N.last_name)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{last_name:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Datum narozen\xed"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsxs)(ha.l,{value:U.day,onChange:e=>G("day",e.target.value),children:[(0,p.jsx)("option",{value:"",disabled:!0,children:"Den"}),Array.from({length:31}).map((e,t)=>(0,p.jsx)("option",{value:(t+1).toString(),children:t+1},t+1))]}),(0,p.jsxs)(ha.l,{value:U.month,onChange:e=>G("month",e.target.value),children:[(0,p.jsx)("option",{value:"",disabled:!0,children:"M\u011bs\xedc"}),Array.from({length:12}).map((e,t)=>(0,p.jsx)("option",{value:(t+1).toString(),children:t+1},t+1))]}),(0,p.jsxs)(ha.l,{value:U.year,onChange:e=>G("year",e.target.value),children:[(0,p.jsx)("option",{value:"",disabled:!0,children:"Rok"}),Array.from({length:80}).map((e,t)=>{const n=(new Date).getFullYear()-t;return(0,p.jsx)("option",{value:String(n),children:n},n)})]})]}),(0,p.jsx)(y.a,{mt:2,fontSize:"sm",color:"gray.500",children:function(e){const t=e.day?e.day.toString().padStart(2,"0"):"__",n=e.month?e.month.toString().padStart(2,"0"):"__",a=e.year||"____";return"".concat(t,".").concat(n,".").concat(a)}(U)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Pozice"}),(0,p.jsxs)(ha.l,{value:(null===N||void 0===N?void 0:N.position)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{position:e.target.value})),children:[(0,p.jsx)("option",{value:"",children:"\u2014 vyberte pozici \u2014"}),(0,p.jsx)("option",{value:"Brank\xe1\u0159",children:"Brank\xe1\u0159"}),(0,p.jsx)("option",{value:"Obr\xe1nce",children:"Obr\xe1nce"}),(0,p.jsx)("option",{value:"Z\xe1lo\u017en\xedk",children:"Z\xe1lo\u017en\xedk"}),(0,p.jsx)("option",{value:"\xdato\u010dn\xedk",children:"\xdato\u010dn\xedk"}),(0,p.jsx)("option",{value:"Univerz\xe1l",children:"Univerz\xe1l"})]})]}),(0,p.jsxs)(_.MJ,{isInvalid:"number"===typeof(null===N||void 0===N?void 0:N.jersey_number)&&(null===N||void 0===N?void 0:N.jersey_number)>99,children:[(0,p.jsx)(S.l,{children:"\u010c\xedslo dresu"}),(0,p.jsx)(ua.Q7,{min:0,max:99,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===N||void 0===N?void 0:N.jersey_number)?null===N||void 0===N?void 0:N.jersey_number:"",onChange:(e,t)=>R(e=>(0,h.A)((0,h.A)({},e),{},{jersey_number:Number.isFinite(t)?t:void 0})),children:(0,p.jsx)(ua.OO,{inputMode:"numeric"})}),(0,p.jsxs)(Yn.Wt,{children:["Maxim\xe1ln\xed \u010d\xedslo dresu je ",99,"."]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1rodnost"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(C.p,{placeholder:"Hledat zemi (nap\u0159. cz, czechia)\u2026",value:s,onChange:e=>c(e.target.value),ref:d,onKeyDown:e=>{var t;if("ArrowDown"===e.key)e.preventDefault(),null===(t=u.current)||void 0===t||t.focus();else if("Escape"===e.key)c("");else if("Enter"===e.key&&1===g.length){var n;const e=g[0];R(t=>(0,h.A)((0,h.A)({},t),{},{nationality:e.name})),null===(n=u.current)||void 0===n||n.focus()}}}),(0,p.jsx)(ha.l,{placeholder:"\u2014 vyberte zemi \u2014",value:(null===N||void 0===N?void 0:N.nationality)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{nationality:e.target.value})),ref:u,onKeyDown:e=>{var t;"ArrowUp"===e.key&&0===e.target.selectedIndex&&(e.preventDefault(),null===(t=d.current)||void 0===t||t.focus())},children:g.map(e=>(0,p.jsxs)("option",{value:e.name,children:[e.emoji," ",Bi(e.name)," (",e.name,")"]},e.cca2))})]})]}),(0,p.jsxs)(_.MJ,{isInvalid:"number"===typeof(null===N||void 0===N?void 0:N.height)&&(null===N||void 0===N?void 0:N.height)>M,children:[(0,p.jsx)(S.l,{children:"V\xfd\u0161ka (cm)"}),(0,p.jsx)(ua.Q7,{min:0,max:M,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===N||void 0===N?void 0:N.height)?null===N||void 0===N?void 0:N.height:"",onChange:(e,t)=>R(e=>(0,h.A)((0,h.A)({},e),{},{height:Number.isFinite(t)?t:void 0})),children:(0,p.jsx)(ua.OO,{inputMode:"numeric"})}),(0,p.jsxs)(Yn.Wt,{children:["Maxim\xe1ln\xed v\xfd\u0161ka je ",M," cm."]})]}),(0,p.jsxs)(_.MJ,{isInvalid:"number"===typeof(null===N||void 0===N?void 0:N.weight)&&(null===N||void 0===N?void 0:N.weight)>D,children:[(0,p.jsx)(S.l,{children:"V\xe1ha (kg)"}),(0,p.jsx)(ua.Q7,{min:0,max:D,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===N||void 0===N?void 0:N.weight)?null===N||void 0===N?void 0:N.weight:"",onChange:(e,t)=>R(e=>(0,h.A)((0,h.A)({},e),{},{weight:Number.isFinite(t)?t:void 0})),children:(0,p.jsx)(ua.OO,{inputMode:"numeric"})}),(0,p.jsxs)(Yn.Wt,{children:["Maxim\xe1ln\xed v\xe1ha je ",D," kg."]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Email (nepovinn\xe9)"}),(0,p.jsx)(C.p,{type:"email",value:(null===N||void 0===N?void 0:N.email)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{email:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Telefon (nepovinn\xe9)"}),(0,p.jsx)(C.p,{type:"tel",value:(null===N||void 0===N?void 0:N.phone)||"",onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{phone:e.target.value}))})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Fotka"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(k._,{src:n(null===N||void 0===N?void 0:N.image_url),alt:"photo",boxSize:"56px",objectFit:"cover",borderRadius:"md",fallbackSrc:"/dist/img/logo-club-empty.svg"}),(0,p.jsxs)(T.$,{as:"label",type:"button",leftIcon:(0,p.jsx)(q.B88,{}),children:["Nahr\xe1t",(0,p.jsx)(C.p,{type:"file",display:"none",accept:"image/*,image/svg+xml",onChange:async e=>{var n;e.preventDefault(),e.stopPropagation();const a=null===(n=e.target.files)||void 0===n?void 0:n[0];if(a)try{const t="image/svg+xml"===a.type?await jt(a):await v(a);R(e=>(0,h.A)((0,h.A)({},e),{},{image_url:t.url})),e.target.value=""}catch(i){t({title:"Nahr\xe1n\xed selhalo",status:"error"})}}})]})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:!(null===N||void 0===N||!N.is_active),onChange:e=>R(t=>(0,h.A)((0,h.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:F,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{if(!N)return;let e=(N.first_name||"").trim(),n=(N.last_name||"").trim();if(!n&&e.includes(" ")){const t=e.split(/\s+/).filter(Boolean);t.length>=2&&(e=t[0],n=t[t.length-1])}if(!e||!n)return void t({title:"Jm\xe9no a p\u0159\xedjmen\xed jsou povinn\xe9",status:"warning"});if("number"===typeof N.jersey_number&&Number.isFinite(N.jersey_number)&&N.jersey_number>99||"number"===typeof N.height&&Number.isFinite(N.height)&&N.height>M||"number"===typeof N.weight&&Number.isFinite(N.weight)&&N.weight>D)return void t({title:"Neplatn\xe1 \u010d\xedsla",description:"Maxima: \u010d\xedslo dresu ".concat(99,", v\xfd\u0161ka ").concat(M," cm, v\xe1ha ").concat(D," kg"),status:"warning"});if(!U.day||!U.month||!U.year)return void t({title:"Datum narozen\xed je povinn\xe9",description:"Vyberte den, m\u011bs\xedc i rok.",status:"warning"});const a={first_name:e,last_name:n};N.date_of_birth&&(a.date_of_birth=N.date_of_birth),N.position&&(a.position=N.position),"number"===typeof N.jersey_number&&Number.isFinite(N.jersey_number)&&N.jersey_number>0&&(a.jersey_number=N.jersey_number),N.nationality&&(a.nationality=N.nationality),"number"===typeof N.height&&Number.isFinite(N.height)&&N.height>0&&(a.height=N.height),"number"===typeof N.weight&&Number.isFinite(N.weight)&&N.weight>0&&(a.weight=N.weight),N.image_url&&(a.image_url=N.image_url),"boolean"===typeof N.is_active&&(a.is_active=N.is_active);const i=(N.email||"").trim(),o=(N.phone||"").trim();i&&(a.email=i),o&&(a.phone=o);try{null!=N.id?await Z.mutateAsync({id:N.id,payload:a}):await O.mutateAsync(a)}catch(r){}},isLoading:O.isLoading||Z.isLoading,children:"Ulo\u017eit"})]})]})]})]});function $(e){const t=function(e){if(!e)return null;const t=String(e).match(/^(\d{4})-(\d{2})-(\d{2})(?:$|T)/);if(!t)return null;const n=Number(t[1]),a=Number(t[2]),i=Number(t[3]);return n&&a&&i?{y:n,m:a,d:i}:null}(e||null);L(t?{day:String(t.d),month:String(t.m),year:String(t.y)}:{day:"",month:"",year:""})}function G(e,t){L(n=>{let a=(0,h.A)((0,h.A)({},n),{},{[e]:t});const i=Number(a.year||"0"),o=Number(a.month||"0"),r=Number(a.day||"0");if(i&&o&&r){const e=new Date(i,o,0).getDate();r>e&&(a.day=String(e))}const s=Number(a.year||"0"),l=Number(a.month||"0"),c=Number(a.day||"0");if(s&&l&&c){const e="".concat(s,"-").concat(String(l).padStart(2,"0"),"-").concat(String(c).padStart(2,"0"));R(t=>(0,h.A)((0,h.A)({},t),{},{date_of_birth:e}))}else R(e=>(0,h.A)((0,h.A)({},e),{},{date_of_birth:""}));return a})}},Rs=()=>{const e=(0,j.d)(),t=(0,l.jE)(),{data:n,isLoading:i,error:o}=(0,xe.I)({queryKey:["facr-tables-cache"],queryFn:()=>ar(),staleTime:3e5}),r=Array.isArray(null===n||void 0===n?void 0:n.competitions)?n.competitions:[],s=null!==n&&void 0!==n&&n.club_id?String(n.club_id).toLowerCase():void 0,c=(0,a.useMemo)(()=>R(String((null===n||void 0===n?void 0:n.name)||"")),[null===n||void 0===n?void 0:n.name]),d=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,{data:u={}}=(0,xe.I)({queryKey:["teamLogoOverrides"],queryFn:Bo,staleTime:3e5}),x=(null===u||void 0===u?void 0:u.by_id)||{},[g,v]=(0,a.useState)({}),[f,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!r||0===r.length)return;const e=new Set;for(const n of r){var t;const a=(null===n||void 0===n||null===(t=n.table)||void 0===t?void 0:t.overall)||[];for(const t of a)if(t.team_id)e.add(t.team_id);else{const n=M(t.team_logo_url);n&&e.add(n)}}0!==e.size&&(N(!0),$e(Array.from(e)).then(e=>v(e)).catch(e=>console.error("Failed to fetch sport logos:",e)).finally(()=>N(!1)))},[r]);const R=e=>{let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-"),t=t.replace(/[,,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)"+a+"(\\b|$)","g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk)\b\.?/g," "),t=t.replace(/[\.,!;:()\[\]{}]/g," "),t=t.replace(/\s+/g," ").trim(),t},P=(null===u||void 0===u?void 0:u.by_name)||{},I=(0,a.useMemo)(()=>{const e={};for(const t of Object.keys(P))e[R(t)]=P[t];return e},[P]),M=e=>{try{const t=String(e||"");if(!t)return;const n=t.match(/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/);return n?n[0].toLowerCase():void 0}catch(t){return}},D=(e,t,n)=>{var a;if(!e)return W("/dist/img/logo-club-empty.svg");if(t&&x[t]&&null!==(a=x[t])&&void 0!==a&&a.logo_url){const e=String(x[t].logo_url);return e.startsWith("/")?W(e):e}let i=P[e];if(!i){const t=R(e);i=I[t]}return i?"string"===typeof i&&i.startsWith("/")?W(i):i:t&&g[t]?g[t]:n||"/dist/img/logo-club-empty.svg"},L=(e,t)=>{var n;return t&&x[t]&&null!==(n=x[t])&&void 0!==n&&n.name&&String(x[t].name||"").trim()||String(e||"")},[F,O]=(0,a.useState)("table"),[Z,K]=(0,a.useState)(0),[q,B]=(0,a.useState)(""),[G,X]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=setTimeout(()=>X(q),250);return()=>clearTimeout(e)},[q]);const ne=(0,a.useMemo)(()=>{const e={};for(const n of r){var t;const a=(null===n||void 0===n||null===(t=n.table)||void 0===t?void 0:t.overall)||[];for(const t of a){const n=(t.team||"").trim();let a=t.team_id||M(t.team_logo_url);if(!a&&s){const e=R(n);(e===c||e.endsWith(" "+c)||e.startsWith(c+" ")||e.includes(" "+c+" "))&&(a=s)}const i=L(n,a);if(!i)continue;const o=a?"id:".concat(a):R(i),r=D(i,a,t.team_logo_url);if(e[o]){e[o].variants.push(n),e[o].variants.push(i);const t=!e[o].logo||/logo-club-empty\.svg$/.test(String(e[o].logo)),s=r&&!/logo-club-empty\.svg$/.test(String(r));t&&s&&(e[o].logo=r),!e[o].teamId&&a&&(e[o].teamId=a)}else e[o]={key:o,name:i,logo:r,variants:[n,i],teamId:a}}}return Object.values(e).sort((e,t)=>e.name.localeCompare(t.name,"cs",{sensitivity:"base"}))},[r,D,c,s]),ae=(0,a.useMemo)(()=>{const e={};for(const t of ne)e[t.key]=Array.from(new Set(t.variants));return e},[ne]),[ie,oe]=(0,a.useState)(!1),[re,se]=(0,a.useState)(null),[le,ce]=(0,a.useState)({external_team_id:"",team_name:"",logo_url:""}),de=(0,a.useRef)(null),[he,ue]=(0,a.useState)(null),[me,pe]=(0,a.useState)("idle"),[ge,ve]=(0,a.useState)(null),je=(0,a.useMemo)(()=>{try{if(he)return!0;const e=(le.logo_url||"").trim();if(!e)return!1;const t=e.startsWith("/")?new URL(e,d).toString():e,n=new URL(t),a=n.hostname.toLowerCase(),i=n.pathname,o=new URL(d).hostname.toLowerCase(),r=a.endsWith("fotbal.cz")||"is1.fotbal.cz"===a,s="logoapi.sportcreative.eu"===a,l=a===o&&i.startsWith("/uploads/");return!r&&!s&&l}catch(e){return!1}},[he,le.logo_url,d]),[be,ye]=(0,a.useState)(""),[fe,ke]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=setTimeout(()=>ke(be),300);return()=>clearTimeout(e)},[be]);const{data:ze=[]}=(0,xe.I)({queryKey:["club-search",fe],queryFn:()=>$o(fe),enabled:fe.trim().length>=2}),we=(e,t,n,a)=>{let i=n;if(!i||0===i.length){const t=R(e||"");i=ae[t]||[]}se({teamName:e,teamLogoUrl:t,variantNames:i}),ce({external_team_id:a||"",team_name:e||"",logo_url:t||""}),ye(e||""),oe(!0)},_e=(0,Mn.n)({mutationFn:async()=>{if(!le.external_team_id)throw new Error("Vyberte t\xfdm ze seznamu vyhled\xe1v\xe1n\xed (chyb\xed ID).");let e=(le.logo_url||"").trim();const t=(le.team_name||(null===re||void 0===re?void 0:re.teamName)||"").trim();Array.from(new Set([t,...(null===re||void 0===re?void 0:re.variantNames)||[]])).map(e=>e.trim()).filter(Boolean);try{if(!he&&le.external_team_id){const t=await He(le.external_team_id);t&&(e=t)}}catch(n){}if(e){let t=Boolean(he);try{const n=e.startsWith("/")?new URL(e,d).toString():e,a=new URL(n),i=a.hostname.toLowerCase(),o=a.pathname,r=new URL(d).hostname.toLowerCase(),s=i.endsWith("fotbal.cz")||"is1.fotbal.cz"===i,l="logoapi.sportcreative.eu"===i,c=i===r&&o.startsWith("/uploads/");t||(t=c),(s||l)&&(t=!1)}catch(a){}if(t){pe("uploading"),ve(null);try{let t=he;if(!t&&e&&(t=await Vo(e)),t){const n=await qo(le.external_team_id,t,{filename:"".concat(le.external_team_id,".").concat(t instanceof File?t.name.split(".").pop():"png"),clubName:le.team_name||(null===re||void 0===re?void 0:re.teamName)||"Nezn\xe1m\xfd klub"});n.success?(pe("success"),n.url&&(e=n.url)):(pe("error"),ve(n.error||"Nepoda\u0159ilo se nahr\xe1t logo"))}else pe("error"),ve("Could not fetch logo file")}catch(o){pe("error"),ve((null===o||void 0===o?void 0:o.message)||"Upload failed")}}}return await async function(e,t,n){return(await m.Ay.put("/admin/team-logo-overrides/".concat(encodeURIComponent(e)),{team_name:t,logo_url:n})).data}(le.external_team_id,t,e),!0},onSuccess:()=>{let n="Zm\u011bna byla aplikov\xe1na na v\u0161echny duplicitn\xed varianty.";"success"===me?n+=" Logo bylo \xfasp\u011b\u0161n\u011b nahr\xe1no.":"error"===me&&(n+=" \u26a0\ufe0f ".concat(ge||"Nepoda\u0159ilo se nahr\xe1t logo")),e({title:"Ulo\u017eeno",description:n,status:"error"===me?"warning":"success",duration:6e3,isClosable:!0}),oe(!1),se(null),ue(null),pe("idle"),ve(null),t.invalidateQueries({queryKey:["facr-tables-cache"]}),t.invalidateQueries({queryKey:["teamLogoOverrides"]})},onError:t=>{e({title:"Ulo\u017een\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}});return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(ee.z,{justify:"space-between",mb:4,children:(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va t\xfdm\u016f"})}),(0,p.jsx)(U.E,{color:"gray.500",mb:4,fontSize:"sm",children:"P\u0159ehled tabulek z FA\u010cR. Kompaktn\xed zobrazen\xed s rychl\xfdm p\u0159ep\xedn\xe1n\xedm sout\u011b\u017e\xed."}),(0,p.jsxs)(Q.s,{mb:4,gap:3,align:"center",wrap:"wrap",children:[(0,p.jsxs)(_i.e,{isAttached:!0,size:"sm",variant:"outline",children:[(0,p.jsx)(T.$,{colorScheme:"table"===F?"blue":"gray",variant:"table"===F?"solid":"outline",onClick:()=>O("table"),size:"sm",children:"Tabulky"}),(0,p.jsx)(T.$,{colorScheme:"grid"===F?"blue":"gray",variant:"grid"===F?"solid":"outline",onClick:()=>O("grid"),size:"sm",children:"M\u0159\xed\u017eka"})]}),(0,p.jsxs)(A.M,{maxW:{base:"100%",md:"300px"},size:"sm",children:[(0,p.jsx)(C.p,{placeholder:"Filtrovat podle n\xe1zvu t\xfdmu\u2026",value:q,onChange:e=>B(e.target.value)}),q&&(0,p.jsx)(E.t,{width:"3rem",children:(0,p.jsx)(T.$,{size:"xs",variant:"ghost",onClick:()=>B(""),children:"Vymazat"})})]}),f&&(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"xs",children:(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(zn.y,{size:"xs"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m loga z logoapi.sportcreative.eu..."})]})}),!f&&Object.keys(g).length>0&&(0,p.jsxs)(Qt.E,{colorScheme:"green",fontSize:"xs",children:["\u2713 ",Object.keys(g).length," log z logoapi.sportcreative.eu"]})]}),i&&(0,p.jsxs)(w.T,{align:"start",spacing:3,mb:6,children:[(0,p.jsx)(zn.y,{}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m tabulky\u2026"})]}),Boolean(o)&&(0,p.jsxs)(xa.F,{status:"error",variant:"left-accent",mb:4,children:[(0,p.jsx)(ga._,{}),"Nepoda\u0159ilo se na\u010d\xedst data z cache."]}),!i&&!o&&"table"===F&&(0,p.jsx)(y.a,{children:(0,p.jsxs)(ra.t,{index:Z,onChange:K,variant:"soft-rounded",colorScheme:"blue",size:"sm",children:[(0,p.jsx)(sa.w,{mb:4,overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap",pb:2,children:r.map((e,t)=>(0,p.jsx)(la.o,{fontSize:"xs",px:3,py:1.5,minW:"fit-content",whiteSpace:"nowrap",children:e.name},e.id))}),(0,p.jsx)(ca.T,{children:r.map(e=>{var t;const n=(null===e||void 0===e||null===(t=e.table)||void 0===t?void 0:t.overall)||[],a=R(G),i=a?n.filter(e=>R(e.team||"").includes(a)):n;return(0,p.jsx)(da.K,{p:0,children:(0,p.jsx)(y.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",w:"full",sx:{WebkitOverflowScrolling:"touch"},children:(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{bg:(0,b.dU)("gray.50","gray.700"),children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"40px",fontSize:"xs",py:2,children:"#"}),(0,p.jsx)(Oi.Th,{fontSize:"xs",py:2,children:"T\xfdm"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"Z"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"V"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"R"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"P"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"70px",fontSize:"xs",py:2,children:"Sk\xf3re"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,w:"50px",fontSize:"xs",py:2,children:"Body"}),(0,p.jsx)(Oi.Th,{w:"90px",fontSize:"xs",py:2,children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[i.map((t,n)=>(0,p.jsxs)(Fi.Tr,{_hover:{bg:(0,b.dU)("gray.50","gray.700")},children:[(0,p.jsx)(Ki.Td,{py:1.5,fontSize:"xs",children:t.rank}),(0,p.jsx)(Ki.Td,{py:1.5,children:(0,p.jsxs)(ee.z,{spacing:2,align:"center",children:[(0,p.jsx)(k._,{src:D(t.team,t.team_id||M(t.team_logo_url),t.team_logo_url),alt:L(t.team,t.team_id||M(t.team_logo_url)),boxSize:"24px",objectFit:"contain"}),(0,p.jsx)(U.E,{fontSize:"xs",noOfLines:1,children:L(t.team,t.team_id||M(t.team_logo_url))})]})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.played}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.wins}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.draws}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.losses}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.score}),(0,p.jsx)(Ki.Td,{isNumeric:!0,py:1.5,fontSize:"xs",fontWeight:"bold",children:t.points}),(0,p.jsx)(Ki.Td,{py:1.5,children:(0,p.jsx)(T.$,{size:"xs",fontSize:"xs",onClick:()=>{const e=t.team_id||M(t.team_logo_url),n=L(t.team,e),a=e?"id:".concat(e):R(n);we(n||"",D(t.team,e,t.team_logo_url),ae[a],e)},children:"Upravit"})})]},"".concat(e.id,"-").concat(n))),0===i.length&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:9,py:4,children:(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",textAlign:"center",children:"\u017d\xe1dn\xfd t\xfdm neodpov\xedd\xe1 filtru."})})})]})]})})},e.id)})})]})}),!i&&!o&&"grid"===F&&(0,p.jsx)(y.a,{children:(()=>{const e=R(G),t=e?ne.filter(t=>R(t.name).includes(e)||(t.variants||[]).some(t=>R(t).includes(e))):ne;return(0,p.jsxs)(Tt.r,{columns:{base:2,sm:3,md:4,lg:6},spacing:3,children:[t.map(e=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:2.5,_hover:{boxShadow:"md",borderColor:"blue.300"},transition:"all 0.2s",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",children:[(0,p.jsxs)(ee.z,{spacing:2,flex:1,minW:0,children:[(0,p.jsx)(k._,{src:e.logo,alt:e.name,boxSize:"24px",objectFit:"contain",flexShrink:0}),(0,p.jsx)(U.E,{fontSize:"xs",noOfLines:2,fontWeight:"medium",children:e.name})]}),e.variants.length>1&&(0,p.jsx)(te.m,{label:"Varianty: ".concat(Array.from(new Set(e.variants)).join(", ")),hasArrow:!0,children:(0,p.jsx)(ni.vw,{size:"sm",colorScheme:"purple",variant:"subtle",fontSize:"xs",children:(0,p.jsx)(ni.d1,{children:e.variants.length})})})]}),(0,p.jsx)(T.$,{size:"xs",fontSize:"xs",onClick:()=>we(e.name,e.logo,e.variants,e.teamId),w:"full",children:"Upravit"})]})},e.key)),0===t.length&&(0,p.jsx)(y.a,{gridColumn:{base:"span 2",sm:"span 3",md:"span 4",lg:"span 6"},children:(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",textAlign:"center",py:8,children:"\u017d\xe1dn\xfd t\xfdm neodpov\xedd\xe1 filtru."})})]})})()}),(0,p.jsxs)(V._s,{isOpen:ie,placement:"right",onClose:()=>{oe(!1),se(null)},size:"md",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)($.z,{children:[(0,p.jsx)(J.r,{children:"Upravit logo t\xfdmu"}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Hledat t\xfdm (FA\u010cR)"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{value:be,onChange:e=>{ye(e.target.value)},placeholder:"Zadejte n\xe1zev t\xfdmu"}),(0,p.jsx)(E.t,{width:"8rem",children:(0,p.jsx)(T.$,{size:"xs",onClick:()=>{var e;return null===(e=de.current)||void 0===e?void 0:e.click()},children:"Nahr\xe1t logo"})})]}),ze.length>0&&(0,p.jsx)(y.a,{mt:4,bg:(0,b.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,p.jsx)(No.B8,{spacing:0,children:ze.map(e=>(0,p.jsx)(No.ck,{px:3,py:2,_hover:{bg:"gray.50",cursor:"pointer"},onClick:async()=>{ce(t=>(0,h.A)((0,h.A)({},t),{},{external_team_id:e.id,team_name:e.name,logo_url:e.logo_url||t.logo_url})),ye(e.name);try{const t=await He(e.id,e.name);t&&ce(e=>(0,h.A)((0,h.A)({},e),{},{logo_url:t}))}catch(t){}},children:(0,p.jsxs)(ee.z,{justify:"space-between",spacing:3,children:[(0,p.jsxs)(ee.z,{spacing:3,maxW:"80%",children:[e.logo_url?(0,p.jsx)(k._,{src:e.logo_url,alt:e.name,boxSize:"20px",objectFit:"contain"}):(0,p.jsx)(Qt.E,{colorScheme:"gray",children:"bez loga"}),(0,p.jsx)(U.E,{noOfLines:1,children:e.name})]}),e.logo_url&&(0,p.jsx)(Qt.E,{colorScheme:"green",children:"logo"})]})},e.id))})}),(0,p.jsx)("input",{ref:de,type:"file",accept:"image/png,image/svg+xml,image/jpeg,application/pdf",style:{display:"none"},onChange:async t=>{var n;const a=null===(n=t.target.files)||void 0===n?void 0:n[0];if(a)try{const{url:t}=await Ho(a);ce(e=>(0,h.A)((0,h.A)({},e),{},{logo_url:t})),ue(a),e({title:"Logo nahr\xe1no",status:"success"})}catch(i){e({title:"Nahr\xe1v\xe1n\xed selhalo",description:(null===i||void 0===i?void 0:i.message)||"Zkuste to znovu",status:"error"})}finally{de.current&&(de.current.value="")}}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1zev t\xfdmu"}),(0,p.jsx)(C.p,{value:le.team_name,onChange:e=>ce((0,h.A)((0,h.A)({},le),{},{team_name:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Logo URL"}),(0,p.jsx)(C.p,{value:le.logo_url,onChange:e=>ce((0,h.A)((0,h.A)({},le),{},{logo_url:e.target.value}))})]}),(null===re||void 0===re?void 0:re.variantNames)&&re.variantNames.length>1&&(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),"Uprav\xedte tak\xe9 duplicitn\xed n\xe1zvy: ",Array.from(new Set(re.variantNames)).join(", ")]}),je&&(0,p.jsxs)(xa.F,{status:"info",variant:"left-accent",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:"Logo bude automaticky nahr\xe1no na logoapi.sportcreative.eu"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",children:"Toto poskytuje z\xe1lohu a sd\xedlen\xed log mezi aplikacemi."})]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{variant:"outline",onClick:()=>{oe(!1),se(null)},children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",isLoading:_e.isPending,onClick:()=>_e.mutate(),children:"Ulo\u017eit"})]})})]})]})]})})},Ps=[{value:"homepage_top",label:"Hlavn\xed banner (Homepage - vrchol)",description:"Hlavn\xed reklamn\xed plocha naho\u0159e, zobrazena v\u0161em n\xe1v\u0161t\u011bvn\xedk\u016fm",width:1200,height:200,aspectRatio:6,position:"top"},{value:"homepage_middle",label:"St\u0159edn\xed banner (Homepage - st\u0159ed)",description:"Banner ve st\u0159edu str\xe1nky mezi obsahem",width:970,height:250,aspectRatio:3.88,position:"middle"},{value:"homepage_sidebar",label:"Postrann\xed banner (Homepage - sidebar)",description:"Men\u0161\xed banner v prav\xe9m postrann\xedm panelu",width:300,height:250,aspectRatio:1.2,position:"sidebar"},{value:"homepage_footer",label:"Spodn\xed banner (Homepage - z\xe1pat\xed)",description:"Banner v doln\xed \u010d\xe1sti str\xe1nky p\u0159ed z\xe1pat\xedm",width:1200,height:200,aspectRatio:6,position:"footer"},{value:"article_inline",label:"Banner v \u010dl\xe1nc\xedch",description:"Banner zobrazen\xfd v textu \u010dl\xe1nk\u016f",width:728,height:90,aspectRatio:8.09,position:"article"}],Is=()=>{(0,b.dU)("white","gray.800");const e=(0,b.dU)("gray.200","gray.700"),t=(0,b.dU)("white","gray.700"),n=(0,j.d)(),i=(0,l.jE)(),{data:o,isLoading:r}=(0,xe.I)({queryKey:["admin-banners"],queryFn:Jt}),[s,c]=(0,a.useState)(null),[d,u]=(0,a.useState)(null),[m,x]=(0,a.useState)([]),[g,v]=(0,a.useState)(!1),f=(0,a.useRef)(null),{isOpen:A,onOpen:E,onClose:N}=(0,X.j)(),R=e=>Ps.find(t=>t.value===e),P=()=>{c(null),u(null),x([]),f.current&&(f.current.value=""),N()},I=(0,Mn.n)({mutationFn:e=>Yt(e),onSuccess:()=>{n({title:"Banner vytvo\u0159en",status:"success"}),i.invalidateQueries({queryKey:["admin-banners"]}),P()},onError:e=>{var t,a;return n({title:"Vytvo\u0159en\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),M=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return Gt(t,n)},onSuccess:()=>{n({title:"Banner upraven",status:"success"}),i.invalidateQueries({queryKey:["admin-banners"]}),P()},onError:e=>{var t,a;return n({title:"Aktualizace selhala",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),D=(0,Mn.n)({mutationFn:e=>Xt(e),onSuccess:()=>{n({title:"Banner smaz\xe1n",status:"success"}),i.invalidateQueries({queryKey:["admin-banners"]})},onError:e=>{var t,a;return n({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),L=async e=>{if(e){v(!0);try{const t=new window.Image,a=new Promise((n,a)=>{t.onload=()=>n({width:t.width,height:t.height}),t.onerror=a,t.src=URL.createObjectURL(e)}),i=await a;u(i);const o=((e,t)=>{const n=e/t;return Ps.map(a=>({preset:a,score:2*Math.abs(a.aspectRatio-n)+Math.abs(a.width-e)/a.width+Math.abs(a.height-t)/a.height})).sort((e,t)=>e.score-t.score).slice(0,3).map(e=>e.preset)})(i.width,i.height);x(o);const r=await jt(e);if(c(e=>(0,h.A)((0,h.A)({},e||{}),{},{logo_url:r.url})),(null===s||void 0===s||!s.placement)&&o.length>0){const e=o[0];c(t=>(0,h.A)((0,h.A)({},t||{}),{},{placement:e.value,width:e.width,height:e.height})),n({title:"Obr\xe1zek nahr\xe1n",description:"Rozli\u0161en\xed: ".concat(i.width,"\xd7").concat(i.height,". Doporu\u010deno um\xedst\u011bn\xed: ").concat(e.label),status:"success",duration:6e3})}else n({title:"Obr\xe1zek nahr\xe1n",description:"Rozli\u0161en\xed: ".concat(i.width,"\xd7").concat(i.height),status:"success"});URL.revokeObjectURL(t.src)}catch(t){n({title:"Nahr\xe1n\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}finally{v(!1)}}},F=o||[];return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"Bannery a reklamn\xed plochy"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>{const e=Ps[0];c({name:"",is_active:!0,placement:e.value,width:e.width,height:e.height}),u(null),x([]),E()},children:"Nov\xfd banner"})]}),(0,p.jsx)(U.E,{color:"gray.500",mb:6,children:"Spr\xe1va banner\u016f a reklamn\xedch ploch zobrazovan\xfdch na webu. M\u016f\u017eete p\u0159id\xe1vat, upravovat a odeb\xedrat bannery."}),(0,p.jsx)(y.a,{bg:(0,b.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"100px",children:"N\xe1hled"}),(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"Um\xedst\u011bn\xed"}),(0,p.jsx)(Oi.Th,{children:"Rozm\u011bry"}),(0,p.jsx)(Oi.Th,{w:"100px",children:"Aktivn\xed"}),(0,p.jsx)(Oi.Th,{w:"160px",children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[r&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsxs)(Ki.Td,{colSpan:6,textAlign:"center",children:[(0,p.jsx)(zn.y,{size:"sm",mr:2}),"Na\u010d\xedt\xe1n\xed\u2026"]})}),!r&&F.map(e=>{const n=R(e.placement);return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(k._,{src:W(e.logo_url)||"/logo192.png",alt:e.name,boxSize:"56px",objectFit:"contain",bg:t,borderRadius:"md"})}),(0,p.jsxs)(Ki.Td,{children:[(0,p.jsx)(U.E,{fontWeight:"500",children:e.name}),e.website_url&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.website_url})]}),(0,p.jsx)(Ki.Td,{children:n?(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"500",children:n.label}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"xs",children:n.position})]}):(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"-"})}),(0,p.jsx)(Ki.Td,{children:e.width&&e.height?(0,p.jsxs)(U.E,{fontSize:"xs",children:[e.width," \xd7 ",e.height]}):"-"}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:e.is_active?"green":"gray",children:e.is_active?"Ano":"Ne"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",size:"sm",icon:(0,p.jsx)(q.WXf,{}),onClick:()=>{return t=e,c((0,h.A)({},t)),u(null),x([]),void E();var t}}),(0,p.jsx)(K.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,p.jsx)(q.IXo,{}),onClick:()=>{null!=e.id&&D.mutate(e.id)}})]})})]},e.id)})]})]})}),(0,p.jsxs)(se.aF,{isOpen:A,onClose:P,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:null!==s&&void 0!==s&&s.id?"Upravit banner":"Nov\xfd banner"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev"}),(0,p.jsx)(C.p,{value:(null===s||void 0===s?void 0:s.name)||"",onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{name:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Odkaz (po kliku)"}),(0,p.jsx)(C.p,{type:"url",value:(null===s||void 0===s?void 0:s.website_url)||"",onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{website_url:e.target.value})),placeholder:"https://partner.cz"})]}),d&&(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{flex:"1",children:[(0,p.jsxs)(wo.X,{fontSize:"sm",children:["Rozli\u0161en\xed obr\xe1zku: ",d.width," \xd7 ",d.height," px"]}),(0,p.jsxs)(_o.T,{fontSize:"xs",children:["Pom\u011br stran: ",(d.width/d.height).toFixed(2),":1"]})]})]}),m.length>0&&(0,p.jsxs)(y.a,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"md",children:[(0,p.jsxs)(U.E,{fontSize:"sm",fontWeight:"600",mb:2,color:(0,b.dU)("blue.700","blue.200"),children:[(0,p.jsx)(q.A3x,{style:{display:"inline",marginRight:"6px"}}),"Doporu\u010den\xe1 um\xedst\u011bn\xed na z\xe1klad\u011b rozli\u0161en\xed:"]}),(0,p.jsx)(w.T,{align:"stretch",spacing:1,children:m.map((e,t)=>(0,p.jsxs)(ee.z,{justify:"space-between",fontSize:"xs",children:[(0,p.jsxs)(U.E,{children:[(0,p.jsx)(Qt.E,{colorScheme:0===t?"green":"blue",mr:2,children:0===t?"Nejlep\u0161\xed":"#".concat(t+1)}),e.label," (",e.width,"\xd7",e.height,")"]}),(null===s||void 0===s?void 0:s.placement)!==e.value&&(0,p.jsx)(T.$,{size:"xs",variant:"link",colorScheme:"blue",onClick:()=>{c(t=>(0,h.A)((0,h.A)({},t),{},{placement:e.value,width:e.width,height:e.height}))},children:"Pou\u017e\xedt"})]},e.value))})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Um\xedst\u011bn\xed na webu"}),(0,p.jsxs)(ha.l,{value:(null===s||void 0===s?void 0:s.placement)||"",onChange:e=>{const t=e.target.value,n=R(t);c(e=>(0,h.A)((0,h.A)({},e),{},{placement:t,width:null===n||void 0===n?void 0:n.width,height:null===n||void 0===n?void 0:n.height}))},children:[(0,p.jsx)("option",{value:"",children:"\u2014 vyberte um\xedst\u011bn\xed \u2014"}),Ps.map(e=>(0,p.jsxs)("option",{value:e.value,children:[e.label," (",e.width,"\xd7",e.height,")"]},e.value))]}),(null===s||void 0===s?void 0:s.placement)&&(()=>{const e=R(s.placement);return e?(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:e.description}):null})()]}),(null===s||void 0===s?void 0:s.placement)&&(()=>{const n=R(s.placement);return n?(0,p.jsxs)(y.a,{p:3,bg:t,borderRadius:"md",borderWidth:"1px",borderColor:e,children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"600",children:"Rozm\u011bry banneru:"}),(0,p.jsxs)(Qt.E,{colorScheme:"blue",children:[n.width," \xd7 ",n.height," px"]})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["Pom\u011br stran: ",n.aspectRatio.toFixed(2),":1 \u2022 Pozice: ",n.position]})]}):null})(),(0,p.jsx)(G.c,{}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Obr\xe1zek banneru"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(null===s||void 0===s?void 0:s.logo_url)&&(()=>{const n=R(null===s||void 0===s?void 0:s.placement),a=n?Math.min(n.width,600):300,i=n?a/n.aspectRatio:150;return(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mb:2,children:"N\xe1hled banneru:"}),(0,p.jsx)(y.a,{borderWidth:"2px",borderColor:e,borderRadius:"md",p:2,bg:t,children:(0,p.jsx)(k._,{src:W(null===s||void 0===s?void 0:s.logo_url)||"/logo192.png",alt:"banner preview",width:"".concat(a,"px"),height:"".concat(i,"px"),objectFit:"contain",mx:"auto",display:"block"})}),n&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:1,textAlign:"center",children:["Zobrazen\xed v pozici: ",n.label]})]})})(),(0,p.jsxs)(ee.z,{children:[(0,p.jsxs)(T.$,{as:"label",type:"button",leftIcon:(0,p.jsx)(q.B88,{}),colorScheme:"blue",variant:"outline",isLoading:g,loadingText:"Nahr\xe1v\xe1n\xed...",children:[null!==s&&void 0!==s&&s.logo_url?"Zm\u011bnit obr\xe1zek":"Nahr\xe1t obr\xe1zek",(0,p.jsx)(C.p,{ref:f,type:"file",display:"none",accept:"image/*",onChange:async e=>{var t;await L(null===(t=e.target.files)||void 0===t?void 0:t[0])}})]}),g&&(0,p.jsx)(zn.y,{size:"sm"})]}),!(null!==s&&void 0!==s&&s.logo_url)&&(0,p.jsxs)(xa.F,{status:"warning",fontSize:"xs",children:[(0,p.jsx)(ga._,{boxSize:"12px"}),(0,p.jsx)(U.E,{fontSize:"xs",children:"Nahrajte obr\xe1zek pro automatick\xe9 doporu\u010den\xed um\xedst\u011bn\xed"})]})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:!(null===s||void 0===s||!s.is_active),onChange:e=>c(t=>(0,h.A)((0,h.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:P,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{var e;if(!s)return;const t={name:s.name||"",logo_url:s.logo_url,website_url:s.website_url,is_active:null===(e=s.is_active)||void 0===e||e,placement:s.placement||"",width:s.width||void 0,height:s.height||void 0};null!=s.id?await M.mutateAsync({id:s.id,payload:t}):await I.mutateAsync(t)},isLoading:I.isLoading||M.isLoading,children:"Ulo\u017eit"})]})]})]})]})})};var Ws=n(4495),Ms=n(4245),Ds=n(2835);const Us=async e=>{await m.FH.patch("/admin/contact-messages/".concat(e,"/read"),{isRead:!0})},Ls=async e=>{await m.FH.delete("/admin/contact-messages/".concat(e))},Fs=async e=>{const t=e.map(e=>"string"===typeof e?Number(e):e);await m.FH.delete("/admin/contact-messages",{data:t})},Os=async e=>(await m.FH.post("/admin/contact-messages/forward-all",{to_email:e})).data;function Zs(e){let{currentPage:t,totalPages:n,onPageChange:a,maxVisiblePages:i=5}=e;if(n<=1)return null;const o=(()=>{const e=[];let a=Math.max(1,t-Math.floor(i/2));const o=Math.min(n,a+i-1);o-a+1<i&&(a=Math.max(1,o-i+1));for(let t=a;t<=o;t++)e.push(t);return e})();return(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>a(t-1),isDisabled:1===t,"aria-label":"P\u0159edchoz\xed str\xe1nka",children:(0,p.jsx)(tn.Y,{})}),!o.includes(1)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{size:"sm",variant:1===t?"solid":"outline",onClick:()=>a(1),children:"1"}),!o.includes(2)&&(0,p.jsx)(U.E,{children:"..."})]}),o.map(e=>(0,p.jsx)(T.$,{size:"sm",variant:t===e?"solid":"outline",colorScheme:t===e?"blue":"gray",onClick:()=>a(e),"aria-current":t===e?"page":void 0,children:e},e)),!o.includes(n)&&(0,p.jsxs)(p.Fragment,{children:[!o.includes(n-1)&&(0,p.jsx)(U.E,{children:"..."}),(0,p.jsx)(T.$,{size:"sm",variant:t===n?"solid":"outline",onClick:()=>a(n),children:n})]}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>a(t+1),isDisabled:t===n,"aria-label":"Dal\u0161\xed str\xe1nka",children:(0,p.jsx)(nn.v,{})})]})}var Ks=n(7541),qs=n(5983),Vs=n(1933),Hs=n(8707),$s=n(810);function Bs(e){let{isOpen:t,onClose:n,message:i,onDelete:o,onMarkAsRead:r}=e;const s=(0,j.d)(),{hasCopied:c,onCopy:d}=((0,l.jE)(),(0,Ks.i)(i.email)),{isOpen:h,onOpen:u,onClose:x}=(0,X.j)(),[g,v]=(0,a.useState)(""),b=(0,Mn.n)({mutationFn:e=>(async(e,t)=>{await m.FH.post("/admin/contact-messages/".concat(e,"/forward"),{to_email:t})})(i.id,e),onSuccess:()=>{s({title:"Zpr\xe1va p\u0159epos\xedl\xe1na",description:"Zpr\xe1va bude odesl\xe1na na ".concat(g),status:"success",duration:3e3,isClosable:!0}),v(""),x()},onError:()=>{s({title:"Chyba",description:"Nepoda\u0159ilo se p\u0159eposlat zpr\xe1vu",status:"error",duration:3e3,isClosable:!0})}});return(0,p.jsxs)(se.aF,{isOpen:t,onClose:n,size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"lg",fontWeight:"bold",children:i.subject||"Bez p\u0159edm\u011btu"}),(0,p.jsxs)(ee.z,{mt:1,fontSize:"sm",color:"gray.500",children:[(0,p.jsx)(U.E,{children:(f=i.createdAt,(0,Ei.GP)(new Date(f),"d. M. yyyy HH:mm",{locale:Ri.cs}))}),!i.isRead&&(0,p.jsx)(Qt.E,{colorScheme:"blue",children:"Nov\xe1 zpr\xe1va"}),i.source&&(0,p.jsx)(Qt.E,{colorScheme:"sponsor"===i.source?"purple":"gray",children:"sponsor"===i.source?"Sponzor":"Kontakt"})]})]})}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:1,children:"Od:"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{children:i.name}),(0,p.jsxs)(ee.z,{as:"button",onClick:()=>{d(),s({title:"E-mail zkop\xedrov\xe1n do schr\xe1nky",status:"success",duration:2e3,isClosable:!0})},color:"blue.500",_hover:{textDecoration:"underline"},spacing:1,children:[(0,p.jsxs)(U.E,{children:["<",i.email,">"]}),c?(0,p.jsx)(Dn.S,{boxSize:3}):(0,p.jsx)($s.T,{boxSize:3})]})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,children:"Zpr\xe1va:"}),(0,p.jsx)(U.E,{whiteSpace:"pre-wrap",p:3,bg:"gray.50",borderRadius:"md",children:i.message})]}),(i.ipAddress||i.userAgent)&&(0,p.jsxs)(y.a,{mt:4,fontSize:"sm",color:"gray.500",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:1,children:"Technick\xe9 informace:"}),i.ipAddress&&(0,p.jsxs)(U.E,{children:[(0,p.jsx)(U.E,{as:"span",fontWeight:"medium",children:"IP adresa:"})," ",i.ipAddress]}),i.userAgent&&(0,p.jsxs)(U.E,{mt:1,isTruncated:!0,title:i.userAgent,children:[(0,p.jsx)(U.E,{as:"span",fontWeight:"medium",children:"Prohl\xed\u017ee\u010d:"})," ",i.userAgent.length>50?"".concat(i.userAgent.substring(0,47),"..."):i.userAgent]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:2,flexWrap:"wrap",justify:"flex-end",w:"full",children:[(0,p.jsx)(T.$,{variant:"outline",colorScheme:"red",leftIcon:(0,p.jsx)(Qr.d,{}),onClick:o,size:{base:"sm",md:"md"},children:"Smazat"}),(0,p.jsxs)(as.A,{isOpen:h,onClose:x,children:[(0,p.jsx)(is.W,{children:(0,p.jsx)(T.$,{colorScheme:"teal",leftIcon:(0,p.jsx)(Ws.s,{}),onClick:u,size:{base:"sm",md:"md"},children:"P\u0159eposlat"})}),(0,p.jsxs)(os.h,{children:[(0,p.jsx)(qs.R,{}),(0,p.jsx)(Vs.q,{}),(0,p.jsx)(Hs.D,{children:"P\u0159eposlat zpr\xe1vu"}),(0,p.jsx)(rs.e,{children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{fontSize:"sm",children:"E-mailov\xe1 adresa"}),(0,p.jsx)(C.p,{placeholder:"prijemce@email.cz",value:g,onChange:e=>v(e.target.value),type:"email",size:"sm"})]}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"teal",width:"full",onClick:()=>{g&&g.includes("@")?b.mutate(g):s({title:"Chyba",description:"Zadejte platnou e-mailovou adresu",status:"error",duration:3e3})},isLoading:b.isLoading,children:"Odeslat"})]})})]})]}),!i.isRead&&(0,p.jsx)(T.$,{colorScheme:"blue",leftIcon:(0,p.jsx)(Ds.a,{}),onClick:r,size:{base:"sm",md:"md"},children:"Ozna\u010dit jako p\u0159e\u010dten\xe9"}),(0,p.jsx)(T.$,{variant:"ghost",onClick:n,size:{base:"sm",md:"md"},children:"Zav\u0159\xedt"})]})})]})]});var f}var Js=n(8455);function Ys(e){let{isOpen:t,onClose:n,onConfirm:i,title:o,message:r,confirmText:s="Potvrdit",cancelText:l="Zru\u0161it",isDanger:c=!1,isLoading:d=!1}=e;const h=(0,a.useRef)(null);return(0,p.jsx)(Js.Lt,{isOpen:t,leastDestructiveRef:h,onClose:n,isCentered:!0,children:(0,p.jsx)(H.m,{children:(0,p.jsxs)(Js.EO,{children:[(0,p.jsx)(J.r,{fontSize:"lg",fontWeight:"bold",children:o}),(0,p.jsx)(Y.c,{children:r}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{ref:h,onClick:n,isDisabled:d,children:l}),(0,p.jsx)(T.$,{colorScheme:c?"red":"blue",onClick:()=>{i()},ml:3,isLoading:d,loadingText:"Zpracov\xe1v\xe1m...",children:s})]})]})})})}function Gs(){const e=(0,b.dU)("white","gray.800"),[t,n]=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700"),(0,a.useState)([])),[i,o]=(0,a.useState)(""),[r,s]=(0,a.useState)("all"),[c,d]=(0,a.useState)({field:"createdAt",order:"desc"}),[u,x]=(0,a.useState)({page:1,limit:10}),{isOpen:g,onOpen:v,onClose:f}=(0,X.j)(),{isOpen:k,onOpen:R,onClose:P}=(0,X.j)(),{isOpen:I,onOpen:W,onClose:M}=(0,X.j)(),[D,L]=(0,a.useState)(""),[F,O]=(0,a.useState)(null),Z=(0,j.d)(),q=(0,l.jE)(),{data:V,isLoading:$,isError:G}=(0,xe.I)({queryKey:["admin","contact-messages",(0,h.A)((0,h.A)({},u),{},{searchTerm:i,statusFilter:r,sortBy:c})],queryFn:()=>(async e=>{const t=(await m.FH.get("/admin/contact-messages",{params:e})).data;return{data:t.data.map(e=>{var t,n,a,i,o,r;return{id:String(e.id),name:e.name,email:e.email,subject:e.subject,message:e.message,source:e.source,ipAddress:null!==(t=e.ipAddress)&&void 0!==t?t:e.ip_address,userAgent:null!==(n=e.userAgent)&&void 0!==n?n:e.user_agent,isRead:null!==(a=null!==(i=e.isRead)&&void 0!==i?i:e.is_read)&&void 0!==a&&a,createdAt:null!==(o=e.createdAt)&&void 0!==o?o:e.created_at,updatedAt:null!==(r=e.updatedAt)&&void 0!==r?r:e.updated_at}}),total:t.pagination.total,page:t.pagination.page,limit:t.pagination.limit,totalPages:t.pagination.pages}})({page:u.page,limit:u.limit,search:i,isRead:"all"===r?void 0:"read"===r,sortBy:c.field,sortOrder:c.order}),keepPreviousData:!0}),te=(0,Mn.n)({mutationFn:Us,onSuccess:()=>{q.invalidateQueries({queryKey:["admin","contact-messages"]}),Z({title:"Zpr\xe1va ozna\u010dena jako p\u0159e\u010dten\xe1",status:"success",duration:3e3,isClosable:!0})}}),ne=(0,Mn.n)({mutationFn:Ls,onSuccess:()=>{q.invalidateQueries({queryKey:["admin","contact-messages"]}),Z({title:"Zpr\xe1va smaz\xe1na",status:"success",duration:3e3,isClosable:!0})}}),ae=(0,Mn.n)({mutationFn:Fs,onSuccess:()=>{q.invalidateQueries({queryKey:["admin","contact-messages"]}),n([]),Z({title:"Vybran\xe9 zpr\xe1vy byly smaz\xe1ny",status:"success",duration:3e3,isClosable:!0})}}),ie=(0,Mn.n)({mutationFn:Os,onSuccess:e=>{Z({title:"Zpr\xe1vy se p\u0159epos\xedlaj\xed",description:e.message||"V\u0161echny zpr\xe1vy budou p\u0159eposl\xe1ny na zadan\xfd e-mail",status:"success",duration:5e3,isClosable:!0}),L(""),M()},onError:()=>{Z({title:"Chyba",description:"Nepoda\u0159ilo se p\u0159eposlat zpr\xe1vy",status:"error",duration:3e3,isClosable:!0})}}),oe=e=>{O(e),R()},re=e=>{d(t=>({field:e,order:t.field===e&&"asc"===t.order?"desc":"asc"}))},ce=e=>c.field!==e?null:"asc"===c.order?"\u2191":"\u2193";return(0,p.jsxs)(Mo,{children:[(0,p.jsxs)(y.a,{p:6,children:[(0,p.jsxs)(Q.s,{justify:"space-between",align:"center",mb:6,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:2,children:"P\u0159\xedchoz\xed zpr\xe1vy"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Spravujte p\u0159\xedchoz\xed zpr\xe1vy z kontaktn\xedho formul\xe1\u0159e"})]}),(0,p.jsxs)(ee.z,{spacing:3,flexWrap:"wrap",children:[(0,p.jsx)(T.$,{colorScheme:"teal",variant:"outline",leftIcon:(0,p.jsx)(Ws.s,{}),onClick:W,size:{base:"sm",md:"md"},children:"P\u0159eposlat v\u0161e"}),t.length>0&&(0,p.jsxs)(T.$,{colorScheme:"red",variant:"outline",leftIcon:(0,p.jsx)(Qr.d,{}),onClick:()=>{t.length>0&&ae.mutate(t)},isLoading:ae.isLoading,size:{base:"sm",md:"md"},children:["Smazat vybran\xe9 (",t.length,")"]})]})]}),(0,p.jsxs)(y.a,{bg:e,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsxs)(Q.s,{mb:4,gap:4,flexWrap:"wrap",children:[(0,p.jsxs)(A.M,{maxW:"md",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(Ms.Q,{color:"gray.400"})}),(0,p.jsx)(C.p,{placeholder:"Hledat v zpr\xe1v\xe1ch...",value:i,onChange:e=>o(e.target.value)})]}),(0,p.jsxs)(ha.l,{value:r,onChange:e=>s(e.target.value),maxW:"200px",children:[(0,p.jsx)("option",{value:"all",children:"V\u0161echny zpr\xe1vy"}),(0,p.jsx)("option",{value:"unread",children:"Nep\u0159e\u010dten\xe9"}),(0,p.jsx)("option",{value:"read",children:"P\u0159e\u010dten\xe9"})]})]}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"40px",children:(0,p.jsx)(N.S,{isChecked:t.length>0&&t.length===(null===V||void 0===V?void 0:V.data.length),onChange:e=>{e.target.checked?n((null===V||void 0===V?void 0:V.data.map(e=>e.id))||[]):n([])}})}),(0,p.jsxs)(Oi.Th,{cursor:"pointer",onClick:()=>re("name"),_hover:{textDecoration:"underline"},children:["Jm\xe9no ",ce("name")]}),(0,p.jsxs)(Oi.Th,{cursor:"pointer",onClick:()=>re("email"),_hover:{textDecoration:"underline"},children:["E-mail ",ce("email")]}),(0,p.jsx)(Oi.Th,{children:"P\u0159edm\u011bt"}),(0,p.jsx)(Oi.Th,{children:"Zdroj"}),(0,p.jsxs)(Oi.Th,{cursor:"pointer",onClick:()=>re("createdAt"),_hover:{textDecoration:"underline"},children:["Datum ",ce("createdAt")]}),(0,p.jsx)(Oi.Th,{children:"Stav"}),(0,p.jsx)(Oi.Th,{w:"120px",children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:$?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:8,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):G?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:8,textAlign:"center",py:8,color:"red.500",children:"Chyba p\u0159i na\u010d\xedt\xe1n\xed zpr\xe1v"})}):0===(null===V||void 0===V?void 0:V.data.length)?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:8,textAlign:"center",py:8,color:"gray.500",children:"\u017d\xe1dn\xe9 zpr\xe1vy nenalezeny"})}):null===V||void 0===V?void 0:V.data.map(e=>{return(0,p.jsxs)(Fi.Tr,{bg:e.isRead?"transparent":"blue.50",_hover:{bg:e.isRead?"gray.50":"blue.50"},children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(N.S,{isChecked:t.includes(e.id),onChange:t=>{return a=e.id,i=t.target.checked,void n(i?e=>[...e,a]:e=>e.filter(e=>e!==a));var a,i}})}),(0,p.jsx)(Ki.Td,{fontWeight:e.isRead?"normal":"semibold",children:e.name}),(0,p.jsx)(Ki.Td,{children:e.email}),(0,p.jsx)(Ki.Td,{maxW:"200px",isTruncated:!0,title:e.subject||"Bez p\u0159edm\u011btu",children:e.subject||"\u2014"}),(0,p.jsx)(Ki.Td,{children:"sponsor"===e.source?(0,p.jsx)(Qt.E,{colorScheme:"purple",children:"Sponzor"}):(0,p.jsx)(Qt.E,{colorScheme:"gray",children:"Kontakt"})}),(0,p.jsx)(Ki.Td,{whiteSpace:"nowrap",children:(a=e.createdAt,(0,Ei.GP)(new Date(a),"d. M. yyyy HH:mm",{locale:Ri.cs}))}),(0,p.jsx)(Ki.Td,{children:e.isRead?(0,p.jsx)(Qt.E,{colorScheme:"green",children:"P\u0159e\u010dteno"}):(0,p.jsx)(Qt.E,{colorScheme:"blue",children:"Nov\xe1 zpr\xe1va"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Zobrazit zpr\xe1vu",icon:(0,p.jsx)(Ds.a,{}),size:"sm",colorScheme:"blue",variant:"ghost",onClick:()=>(e=>{O(e),e.isRead||te.mutate(e.id),v()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat zpr\xe1vu",icon:(0,p.jsx)(Qr.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>oe(e),isLoading:ne.isLoading&&ne.variables===e.id})]})})]},e.id);var a})})]})}),V&&V.total>0&&(0,p.jsxs)(Q.s,{justify:"space-between",mt:4,alignItems:"center",children:[(0,p.jsxs)(U.E,{color:"gray.600",fontSize:"sm",children:["Zobrazeno ",V.data.length," z ",V.total," zpr\xe1v"]}),(0,p.jsx)(Zs,{currentPage:u.page,totalPages:V.totalPages||1,onPageChange:e=>x(t=>(0,h.A)((0,h.A)({},t),{},{page:e}))})]})]})]}),F&&(0,p.jsx)(Bs,{isOpen:g,onClose:f,message:F,onDelete:()=>{f(),oe(F)},onMarkAsRead:()=>te.mutate(F.id)}),(0,p.jsx)(Ys,{isOpen:k,onClose:P,onConfirm:()=>{F&&ne.mutate(F.id),P()},title:"Smazat zpr\xe1vu",message:"Opravdu chcete smazat tuto zpr\xe1vu? Tato akce je nevratn\xe1.",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0,isLoading:ne.isLoading}),(0,p.jsxs)(se.aF,{isOpen:I,onClose:M,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"P\u0159eposlat v\u0161echny zpr\xe1vy"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(U.E,{children:"V\u0161echny p\u0159\xedchoz\xed zpr\xe1vy budou p\u0159eposl\xe1ny na zadanou e-mailovou adresu."}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"E-mailov\xe1 adresa"}),(0,p.jsx)(C.p,{type:"email",placeholder:"prijemce@email.cz",value:D,onChange:e=>L(e.target.value)})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:M,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"teal",onClick:()=>{D&&D.includes("@")?ie.mutate(D):Z({title:"Chyba",description:"Zadejte platnou e-mailovou adresu",status:"error",duration:3e3})},isLoading:ie.isLoading,children:"P\u0159eposlat"})]})]})]})]})}var Xs=n(3200);async function Qs(e){return(await m.Ay.put("/admin/seo",e)).data}async function el(){const{data:e}=await m.Ay.get("/admin/prefetch/status");return e}async function tl(){const{data:e}=await m.Ay.post("/admin/prefetch/trigger");return e}const nl=()=>{var e,t;const n=(0,j.d)(),[i,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)({}),[d,u]=(0,a.useState)(""),[x,g]=(0,a.useState)(!1),v=(0,a.useRef)(null),[b,f]=(0,a.useState)({}),[A,E]=(0,a.useState)(""),[N,R]=(0,a.useState)(""),[M,D]=(0,a.useState)(""),[L,F]=(0,a.useState)(!1),[O,Z]=(0,a.useState)(null);(0,a.useEffect)(()=>{o(!0),P().then(e=>{c(e||{})}).catch(()=>{n({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst nastaven\xed",status:"error"})}).finally(()=>o(!1)),async function(){return(await m.Ay.get("/admin/seo")).data||{}}().then(e=>f(e||{})).catch(()=>{}).finally(()=>{}),K()},[n]);const K=async()=>{try{var e;const t=await m.Ay.get("/umami/config");if(Z(t.data),null!==(e=t.data)&&void 0!==e&&e.website_id&&E(t.data.website_id),!N){const e=window.location.hostname;R(e)}!M&&l.club_name&&D(l.club_name)}catch(t){console.error("Failed to fetch Umami config:",t)}};(0,a.useEffect)(()=>{f(e=>{const t=(0,h.A)({},e);let n=!1;return!t.site_title&&l.club_name&&(t.site_title=l.club_name,n=!0),!t.default_og_image_url&&l.club_logo_url&&(t.default_og_image_url=l.club_logo_url,n=!0),n?t:e})},[l.club_name,l.club_logo_url]);const q=e=>t=>{c(n=>(0,h.A)((0,h.A)({},n),{},{[e]:t.target.value}))},V=e=>t=>{const n="checkbox"===t.target.type?t.target.checked:t.target.value;f(t=>(0,h.A)((0,h.A)({},t),{},{[e]:n}))},H=e=>t=>{const n=t.target.checked;c(t=>(0,h.A)((0,h.A)({},t),{},{[e]:n}))},$=e=>t=>{c(n=>(0,h.A)((0,h.A)({},n),{},{[e]:t.target.value}))},B=async()=>{s(!0);try{const t=(0,h.A)((0,h.A)({club_name:l.club_name,club_logo_url:l.club_logo_url,facebook_url:l.facebook_url,instagram_url:l.instagram_url,youtube_url:l.youtube_url,gallery_url:l.gallery_url,gallery_label:l.gallery_label,zonerama_url:l.zonerama_url,smtp_host:l.smtp_host,smtp_port:l.smtp_port,smtp_user:l.smtp_user,smtp_password:l.smtp_password,smtp_from:l.smtp_from,smtp_from_name:l.smtp_from_name,smtp_encryption:l.smtp_encryption},"boolean"===typeof l.smtp_auth?{smtp_auth:l.smtp_auth}:{}),{},{smtp_skip_verify:l.smtp_skip_verify,videos_module_enabled:l.videos_module_enabled,videos_source:l.videos_source,contact_address:l.contact_address,contact_city:l.contact_city,contact_zip:l.contact_zip,contact_country:l.contact_country,contact_phone:l.contact_phone,contact_email:l.contact_email,location_latitude:l.location_latitude,location_longitude:l.location_longitude,map_zoom_level:l.map_zoom_level,show_map_on_homepage:"number"===typeof l.location_latitude&&"number"===typeof l.location_longitude,map_style:l.map_style,finished_match_display_days:l.finished_match_display_days}),a=await I(t);c(e=>(0,h.A)((0,h.A)({},e),a)),n({title:"Ulo\u017eeno",description:"Nastaven\xed bylo \xfasp\u011b\u0161n\u011b aktualizov\xe1no",status:"success"});try{await tl()}catch(e){}}catch(t){n({title:"Chyba",description:(null===t||void 0===t?void 0:t.message)||"Ulo\u017een\xed nastaven\xed se nezda\u0159ilo",status:"error"})}finally{s(!1)}};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:4,children:"Nastaven\xed webu"}),(0,p.jsxs)(ra.t,{variant:"enclosed",colorScheme:"brand",children:[(0,p.jsx)(sa.w,{flexWrap:"wrap",children:["Obecn\xe9","Soci\xe1ln\xed s\xedt\u011b","Videa","SMTP","Analytika","SEO"].map(e=>(0,p.jsx)(la.o,{_selected:{bg:"brand.primary",color:"text.onPrimary",borderColor:"brand.primary"},_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.500"},children:e},e))}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1zev klubu"}),(0,p.jsx)(C.p,{value:l.club_name||"",onChange:q("club_name")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Logo klubu"}),(0,p.jsxs)(ee.z,{align:"center",spacing:3,children:[l.club_logo_url&&(0,p.jsx)(k._,{src:W(l.club_logo_url)||l.club_logo_url,alt:"Logo",boxSize:"56px",borderRadius:"md"}),(0,p.jsx)("input",{ref:v,type:"file",accept:"image/png,image/svg+xml,application/pdf",style:{display:"none"},onChange:async e=>{try{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;if(!["image/png","image/svg+xml","application/pdf"].includes(a.type))return void n({title:"Nepodporovan\xfd form\xe1t",description:"Nahrajte pros\xedm logo ve form\xe1tu PNG, SVG nebo PDF.",status:"warning"});if(a.size>5242880)return void n({title:"Soubor je p\u0159\xedli\u0161 velk\xfd",description:"Maxim\xe1ln\u011b 5 MB.",status:"warning"});const i=await jt(a);c(e=>(0,h.A)((0,h.A)({},e),{},{club_logo_url:i.url})),n({title:"Logo nahr\xe1no",status:"success"})}catch(a){n({title:"Nahr\xe1v\xe1n\xed selhalo",description:(null===a||void 0===a?void 0:a.message)||"Logo se nepoda\u0159ilo nahr\xe1t",status:"error"})}finally{v.current&&(v.current.value="")}}}),(0,p.jsx)(T.$,{onClick:()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.click()},variant:"outline",children:"Nahr\xe1t logo"})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(z.D,{size:"sm",children:"Zobrazen\xed z\xe1pas\u016f"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Po\u010det dn\xed zobrazen\xed dokon\u010den\xfdch z\xe1pas\u016f"}),(0,p.jsx)(C.p,{type:"number",min:0,max:30,value:null!==(e=l.finished_match_display_days)&&void 0!==e?e:2,onChange:e=>{const t=parseInt(e.target.value,10);c(e=>(0,h.A)((0,h.A)({},e),{},{finished_match_display_days:isNaN(t)?2:t}))}}),(0,p.jsx)(_.eK,{children:"Po\u010det dn\xed, po kter\xe9 se na \xfavodn\xed str\xe1nce zobraz\xed dokon\u010den\xfd z\xe1pas s v\xfdsledkem m\xedsto p\u0159\xed\u0161t\xedho z\xe1pasu (v\xfdchoz\xed: 2 dny)."})]}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:B,isLoading:r,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Facebook URL"}),(0,p.jsx)(C.p,{value:l.facebook_url||"",onChange:q("facebook_url")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Instagram URL"}),(0,p.jsx)(C.p,{value:l.instagram_url||"",onChange:q("instagram_url")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"YouTube URL"}),(0,p.jsx)(C.p,{value:l.youtube_url||"",onChange:q("youtube_url")}),(0,p.jsx)(_.eK,{children:"Pro automatick\xe9 na\u010d\xedt\xe1n\xed vide\xed vypl\u0148te YouTube kan\xe1l."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Fotogalerie URL"}),(0,p.jsx)(C.p,{value:l.gallery_url||"",onChange:q("gallery_url")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popisek fotogalerie"}),(0,p.jsx)(C.p,{value:l.gallery_label||"",onChange:q("gallery_label")})]}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:B,isLoading:r,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(y.a,{p:4,bg:"blue.50",borderRadius:"md",borderLeft:"4px solid",borderColor:"blue.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:"\u2139\ufe0f Sekce Videa"}),l.videos_module_enabled&&(0,p.jsx)(Qt.E,{colorScheme:"green",children:"Aktivn\xed"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.700",children:["Videa spravujte na str\xe1nce"," ",(0,p.jsx)(T.$,{as:"a",href:"/admin/videa",variant:"link",colorScheme:"blue",size:"sm",fontWeight:"bold",children:"Videa"}),". Zde nastavte zobrazen\xed na tituln\xed str\xe1nce.",l.youtube_url&&(0,p.jsx)(U.E,{as:"span",color:"green.700",fontWeight:"semibold",ml:1,children:"Sekce se automaticky aktivuje p\u0159i vypln\u011bn\xed YouTube kan\xe1lu v tab\u011b Soci\xe1ln\xed s\xedt\u011b."})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:0,children:"Zobrazit sekci Videa na tituln\xed str\xe1nce"}),(0,p.jsx)(pa.d,{isChecked:!!l.videos_module_enabled,onChange:H("videos_module_enabled"),colorScheme:"green"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zdroj vide\xed"}),(0,p.jsxs)(ha.l,{value:l.videos_source||"auto",onChange:$("videos_source"),children:[(0,p.jsx)("option",{value:"auto",children:"Automaticky (YouTube kan\xe1l)"}),(0,p.jsx)("option",{value:"manual",children:"Ru\u010dn\u011b (spr\xe1va v sekci Videa)"})]}),(0,p.jsx)(_.eK,{children:'Pro automatick\xfd zdroj vypl\u0148te v tab\u011b \u201eSoci\xe1ln\xed s\xedt\u011b" pole YouTube URL.'})]}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:B,isLoading:r,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SMTP Host"}),(0,p.jsx)(C.p,{value:l.smtp_host||"",onChange:q("smtp_host")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SMTP Port"}),(0,p.jsx)(C.p,{type:"number",value:null!==(t=l.smtp_port)&&void 0!==t?t:"",onChange:(J="smtp_port",e=>{const t=e.target.value,n=""===t?void 0:Number(t);c(e=>(0,h.A)((0,h.A)({},e),{},{[J]:Number.isFinite(n)?n:void 0}))})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SMTP U\u017eivatel"}),(0,p.jsx)(C.p,{value:l.smtp_user||"",onChange:q("smtp_user")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SMTP Heslo"}),(0,p.jsx)(C.p,{type:"password",value:l.smtp_password||"",onChange:q("smtp_password")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"From e\u2011mail"}),(0,p.jsx)(C.p,{value:l.smtp_from||"",onChange:q("smtp_from")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"From jm\xe9no"}),(0,p.jsx)(C.p,{value:l.smtp_from_name||"",onChange:q("smtp_from_name")})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"\u0160ifrov\xe1n\xed"}),(0,p.jsxs)(ha.l,{value:l.smtp_encryption||"none",onChange:$("smtp_encryption"),children:[(0,p.jsx)("option",{value:"none",children:"\u017d\xe1dn\xe9"}),(0,p.jsx)("option",{value:"ssl",children:"SSL"}),(0,p.jsx)("option",{value:"tls",children:"TLS"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Autentizace"}),(0,p.jsxs)(ha.l,{value:l.smtp_auth||"plain",onChange:$("smtp_auth"),children:[(0,p.jsx)("option",{value:"plain",children:"PLAIN"}),(0,p.jsx)("option",{value:"login",children:"LOGIN"}),(0,p.jsx)("option",{value:"cram-md5",children:"CRAM\u2011MD5"})]})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:0,children:"P\u0159esko\u010dit ov\u011b\u0159en\xed certifik\xe1tu"}),(0,p.jsx)(pa.d,{isChecked:!!l.smtp_skip_verify,onChange:H("smtp_skip_verify")})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(z.D,{size:"sm",children:"Test e\u2011mail"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{placeholder:"test@example.com (voliteln\xe9)",value:d,onChange:e=>u(e.target.value),maxW:{base:"100%",md:"320px"}}),(0,p.jsx)(T.$,{onClick:async()=>{g(!0);try{const e={type:"newsletter"};d&&d.trim()&&(e.email=d.trim()),await(0,Xs.sendNewsletterTestAdvanced)(e),n({title:"Test odesl\xe1n",description:d?"Zkontrolujte schr\xe1nku ".concat(d):"Test odesl\xe1n na v\xfdchoz\xed administr\xe1torsk\xfd e\u2011mail.",status:"success",duration:5e3})}catch(a){var e,t;const i=(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===a||void 0===a?void 0:a.message)||"Nezn\xe1m\xe1 chyba",o=i.includes("535")||i.toLowerCase().includes("authentication failed");n({title:o?"\u26a0\ufe0f Chyba autentizace SMTP (535)":"Chyba p\u0159i odesl\xe1n\xed testu",description:o?"Zkontrolujte SMTP heslo. Ujist\u011bte se, \u017ee je spr\xe1vn\u011b zkop\xedrovan\xe9 bez mezer. N\u011bkter\xe9 poskytovatele vy\u017eaduj\xed aplika\u010dn\xed heslo m\xedsto b\u011b\u017en\xe9ho hesla.":i+" Zkuste upravit SMTP nastaven\xed.",status:"error",duration:1e4,isClosable:!0})}finally{g(!1)}},isLoading:x,children:"Odeslat test"})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:B,isLoading:r,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(z.D,{size:"sm",children:"Webov\xe1 analytika"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Nastaven\xed sledov\xe1n\xed n\xe1v\u0161t\u011bvnosti webu pomoc\xed open-source n\xe1stroje pro webovou analytiku."}),null!==O&&void 0!==O&&O.enabled&&null!==O&&void 0!==O&&O.website_id?(0,p.jsxs)(y.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"green.50",borderColor:"green.200",children:[(0,p.jsx)(ee.z,{spacing:2,mb:2,children:(0,p.jsx)(U.E,{fontWeight:"bold",color:"green.700",children:"\u2713 Analytika je aktivn\xed"})}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.700",children:["Website ID: ",(0,p.jsx)("strong",{children:O.website_id})]})]}):(0,p.jsxs)(y.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"yellow.50",borderColor:"yellow.200",children:[(0,p.jsx)(U.E,{fontWeight:"bold",color:"yellow.700",children:"\u26a0 Analytika nen\xed nakonfigurov\xe1na"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.700",mt:1,children:"Vytvo\u0159te webovou str\xe1nku pro aktivaci sledov\xe1n\xed."})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(z.D,{size:"sm",children:"Vytvo\u0159it novou webovou str\xe1nku"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1zev webov\xe9 str\xe1nky"}),(0,p.jsx)(C.p,{value:M,onChange:e=>D(e.target.value),placeholder:l.club_name||"Fotbal Club"}),(0,p.jsx)(_.eK,{children:"N\xe1zev, kter\xfd se zobraz\xed v dashboardu analytiky"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Dom\xe9na"}),(0,p.jsx)(C.p,{value:N,onChange:e=>R(e.target.value),placeholder:window.location.hostname}),(0,p.jsx)(_.eK,{children:"Dom\xe9na va\u0161eho webu (nap\u0159. fotbal.example.com)"})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{onClick:async()=>{if(M&&N){F(!0);try{const e=await m.Ay.post("/admin/umami/initialize",{name:M,domain:N});E(e.data.website_id),n({title:"\xdasp\u011bch",description:"Webov\xe1 str\xe1nka pro analytiku vytvo\u0159ena! ID: ".concat(e.data.website_id),status:"success",duration:5e3}),await K()}catch(a){var e,t;const i=(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||a.message||"Vytvo\u0159en\xed selhalo";n({title:"Chyba",description:i,status:"error",duration:7e3})}finally{F(!1)}}else n({title:"Chyba",description:"Vypl\u0148te n\xe1zev i dom\xe9nu",status:"error"})},isLoading:L,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Vytvo\u0159it webovou str\xe1nku"}),(0,p.jsx)(T.$,{onClick:K,variant:"outline",children:"Aktualizovat stav"})]}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Pozn\xe1mka: Pro aktivaci analytiky je nutn\xe9 m\xedt nastaven\xe9 p\u0159ihla\u0161ovac\xed \xfadaje v .env souboru."})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(z.D,{size:"sm",children:"SEO nastaven\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:4,children:"Z\xe1kladn\xed SEO nastaven\xed pro lep\u0161\xed viditelnost ve vyhled\xe1va\u010d\xedch."}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Titulek webu"}),(0,p.jsx)(C.p,{value:b.site_title||"",onChange:V("site_title")}),(0,p.jsx)(_.eK,{children:"Hlavn\xed n\xe1zev webu, zobraz\xed se v z\xe1lo\u017ece prohl\xed\u017ee\u010de a ve v\xfdsledc\xedch vyhled\xe1v\xe1n\xed"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis webu"}),(0,p.jsx)(va.T,{value:b.site_description||"",onChange:e=>f(t=>(0,h.A)((0,h.A)({},t),{},{site_description:e.target.value})),rows:3}),(0,p.jsx)(_.eK,{children:"Kr\xe1tk\xfd popis webu pro vyhled\xe1va\u010de (doporu\u010deno 150-160 znak\u016f)"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Kl\xed\u010dov\xe1 slova"}),(0,p.jsx)(C.p,{value:b.keywords||"",onChange:e=>f(t=>(0,h.A)((0,h.A)({},t),{},{keywords:e.target.value}))}),(0,p.jsx)(_.eK,{children:"Kl\xed\u010dov\xe1 slova odd\u011blen\xe1 \u010d\xe1rkou (nap\u0159: fotbal, klub, sport)"})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(z.D,{size:"sm",children:"Open Graph (soci\xe1ln\xed s\xedt\u011b)"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"V\xfdchoz\xed OG obr\xe1zek (URL)"}),(0,p.jsx)(C.p,{value:b.default_og_image_url||"",onChange:V("default_og_image_url")}),(0,p.jsx)(_.eK,{children:"V\xfdchoz\xed obr\xe1zek pro sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch (doporu\u010deno 1200x630px)"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"OG Type"}),(0,p.jsxs)(ha.l,{value:b.og_type||"website",onChange:e=>f(t=>(0,h.A)((0,h.A)({},t),{},{og_type:e.target.value})),children:[(0,p.jsx)("option",{value:"website",children:"Website"}),(0,p.jsx)("option",{value:"article",children:"Article"}),(0,p.jsx)("option",{value:"profile",children:"Profile"})]}),(0,p.jsx)(_.eK,{children:"Typ obsahu pro Open Graph"})]}),(0,p.jsx)(G.c,{}),(0,p.jsx)(z.D,{size:"sm",children:"Twitter Card"}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Twitter Card Type"}),(0,p.jsxs)(ha.l,{value:b.twitter_card||"summary_large_image",onChange:e=>f(t=>(0,h.A)((0,h.A)({},t),{},{twitter_card:e.target.value})),children:[(0,p.jsx)("option",{value:"summary",children:"Summary"}),(0,p.jsx)("option",{value:"summary_large_image",children:"Summary Large Image"})]}),(0,p.jsx)(_.eK,{children:"Typ karty pro Twitter"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Twitter Site"}),(0,p.jsx)(C.p,{value:b.twitter_site||"",onChange:e=>f(t=>(0,h.A)((0,h.A)({},t),{},{twitter_site:e.target.value})),placeholder:"@nazev_uctu"}),(0,p.jsx)(_.eK,{children:"Twitter \xfa\u010det webu (nap\u0159. @fotbalklub)"})]}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:async()=>{try{await Qs(b),n({title:"SEO ulo\u017eeno",status:"success"})}catch(e){n({title:"Chyba",description:(null===e||void 0===e?void 0:e.message)||"Ulo\u017een\xed SEO nastaven\xed se nezda\u0159ilo",status:"error"})}},bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit SEO"})})]})})]})]}),(0,p.jsx)(G.c,{my:4}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{onClick:B,isLoading:r,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})});var J},al=()=>{const[e,t]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[o,r]=(0,a.useState)(!1),{isOpen:s,onOpen:l,onClose:c}=(0,X.j)(),[d,u]=(0,a.useState)(null),[x,g]=(0,a.useState)({name:"",email:"",password:"",currentPassword:"",role:"editor",isActive:!0}),f=(0,j.d)(),k=(0,b.dU)("white","gray.800"),{user:A}=((0,b.dU)("gray.200","gray.700"),v()),E=async()=>{try{const e=await m.Ay.get("/admin/users");t(e.data)}catch(e){console.error("Error fetching users:",e),f({title:"Error",description:"Failed to fetch users",status:"error",duration:5e3,isClosable:!0})}finally{i(!1)}};(0,a.useEffect)(()=>{E()},[]);const N=e=>{const{name:t,value:n}=e.target;g(a=>(0,h.A)((0,h.A)({},a),{},{[t]:"isActive"===t?e.target.checked:n}))},R=async t=>{const n=e.find(e=>e.id===t);if("admin"!==(null===n||void 0===n?void 0:n.role)){if(A&&String(A.id)===String(t))f({title:"Zak\xe1z\xe1no",description:"Nem\u016f\u017eete smazat s\xe1m sebe.",status:"warning"});else if(window.confirm("Are you sure you want to delete this user?"))try{await m.Ay.delete("/admin/users/".concat(t)),f({title:"Success",description:"User deleted successfully",status:"success",duration:3e3,isClosable:!0}),E()}catch(s){var a,i,o,r;console.error("Error deleting user:",s),f({title:"Error",description:(null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)||"Failed to delete user",status:"error",duration:5e3,isClosable:!0})}}else f({title:"Zak\xe1z\xe1no",description:"Admin u\u017eivatele nelze smazat.",status:"warning"})},P=()=>{g({name:"",email:"",password:"",currentPassword:"",role:"editor",isActive:!0}),u(null)},I=e=>{u(e),g({name:e.name,email:e.email,password:"",currentPassword:"",role:e.role,isActive:e.isActive}),l()};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va u\u017eivatel\u016f"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),colorScheme:"blue",onClick:()=>{P(),l()},children:"P\u0159idat u\u017eivatele"})]}),(0,p.jsxs)(U.E,{color:"gray.500",mb:6,children:["Spr\xe1va u\u017eivatelsk\xfdch \xfa\u010dt\u016f a jejich opr\xe1vn\u011bn\xed. ",(0,p.jsx)("strong",{children:"Editor"})," m\u016f\u017ee vytv\xe1\u0159et a upravovat \u010dl\xe1nky a aktivity. ",(0,p.jsx)("strong",{children:"Admin"})," m\xe1 p\u0159\xedstup ke v\u0161em funkc\xedm."]}),(0,p.jsx)(z.D,{size:"md",mb:2,children:"Admini a edito\u0159i"}),(0,p.jsx)(y.a,{bg:k,borderRadius:"md",boxShadow:"sm",overflowX:"auto",mb:8,children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Name"}),(0,p.jsx)(Oi.Th,{children:"Email"}),(0,p.jsx)(Oi.Th,{children:"Role"}),(0,p.jsx)(Oi.Th,{children:"Status"}),(0,p.jsx)(Oi.Th,{children:"Created"}),(0,p.jsx)(Oi.Th,{children:"Actions"})]})}),(0,p.jsx)(Zi.N,{children:e.filter(e=>"fan"!==e.role).map(e=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.name}),(0,p.jsx)(Ki.Td,{children:e.email}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"admin"===e.role?"purple":"blue",children:"admin"===e.role?"Admin":"Editor"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:e.isActive?"green":"red",children:e.isActive?"Active":"Inactive"})}),(0,p.jsx)(Ki.Td,{children:new Date(e.createdAt).toLocaleDateString()}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ne.W,{children:[(0,p.jsx)(ae.I,{as:K.K,"aria-label":"Options",icon:(0,p.jsx)(ce.R,{}),size:"sm",variant:"ghost"}),(0,p.jsxs)(oe.c,{children:[(0,p.jsx)(re.D,{icon:(0,p.jsx)(de.q,{}),onClick:()=>I(e),children:"Edit"}),(0,p.jsx)(re.D,{onClick:async()=>{try{await m.Ay.post("/admin/users/".concat(e.id,"/reset-password")),f({title:"Hotovo",description:"Instrukce pro obnoven\xed hesla byly odesl\xe1ny.",status:"success"})}catch(s){var t,n,a,i,o,r;const e=(null===s||void 0===s||null===(t=s.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||(null===s||void 0===s||null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===s||void 0===s?void 0:s.message)||"Nelze odeslat reset hesla",l=null===s||void 0===s||null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.details;f({title:"Chyba p\u0159i odes\xedl\xe1n\xed resetu hesla",description:l?"".concat(e,"\n\n").concat(l):e,status:"error",duration:1e4,isClosable:!0})}},children:"Odeslat reset hesla"}),"admin"!==e.role&&String(null===A||void 0===A?void 0:A.id)!==String(e.id)&&(0,p.jsx)(re.D,{icon:(0,p.jsx)(Qr.d,{}),color:"red.500",onClick:()=>R(e.id),children:"Delete"})]})]})})]},e.id))})]})}),(0,p.jsx)(z.D,{size:"md",mb:2,children:"Fanou\u0161ci"}),(0,p.jsx)(y.a,{bg:k,borderRadius:"md",boxShadow:"sm",overflowX:"auto",children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Name"}),(0,p.jsx)(Oi.Th,{children:"Email"}),(0,p.jsx)(Oi.Th,{children:"Role"}),(0,p.jsx)(Oi.Th,{children:"Status"}),(0,p.jsx)(Oi.Th,{children:"Created"}),(0,p.jsx)(Oi.Th,{children:"Actions"})]})}),(0,p.jsx)(Zi.N,{children:e.filter(e=>"fan"===e.role).map(e=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.name}),(0,p.jsx)(Ki.Td,{children:e.email}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"gray",children:"Fan"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:e.isActive?"green":"red",children:e.isActive?"Active":"Inactive"})}),(0,p.jsx)(Ki.Td,{children:new Date(e.createdAt).toLocaleDateString()}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ne.W,{children:[(0,p.jsx)(ae.I,{as:K.K,"aria-label":"Options",icon:(0,p.jsx)(ce.R,{}),size:"sm",variant:"ghost"}),(0,p.jsxs)(oe.c,{children:[(0,p.jsx)(re.D,{icon:(0,p.jsx)(de.q,{}),onClick:()=>I(e),children:"Edit"}),String(null===A||void 0===A?void 0:A.id)!==String(e.id)&&(0,p.jsx)(re.D,{icon:(0,p.jsx)(Qr.d,{}),color:"red.500",onClick:()=>R(e.id),children:"Delete"})]})]})})]},e.id))})]})}),(0,p.jsxs)(se.aF,{isOpen:s,onClose:c,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{as:"form",onSubmit:async e=>{e.preventDefault(),r(!0);try{if(d){const e={name:x.name,email:x.email,role:x.role,isActive:x.isActive};if("admin"===d.role){if(!x.currentPassword)throw new Error("Pro \xfapravu administr\xe1torsk\xe9ho \xfa\u010dtu zadejte pros\xedm sou\u010dasn\xe9 heslo.");e.current_password=x.currentPassword}await m.Ay.put("/admin/users/".concat(d.id),e),f({title:"Success",description:"User updated successfully",status:"success",duration:3e3,isClosable:!0})}else await m.Ay.post("/admin/users",x),f({title:"Success",description:"User created successfully",status:"success",duration:3e3,isClosable:!0});c(),E(),P()}catch(o){var t,n,a,i;console.error("Error saving user:",o),f({title:"Error",description:(null===(t=o.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Failed to save user",status:"error",duration:5e3,isClosable:!0})}finally{r(!1)}},children:[(0,p.jsx)(J.r,{children:d?"Edit User":"Add New User"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{pb:6,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Full Name"}),(0,p.jsx)(C.p,{name:"name",value:x.name,onChange:N,placeholder:"Enter full name"})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Email"}),(0,p.jsx)(C.p,{type:"email",name:"email",value:x.email,onChange:N,placeholder:"Enter email"})]}),!d&&(0,p.jsxs)(_.MJ,{isRequired:!d,children:[(0,p.jsx)(S.l,{children:"Password"}),(0,p.jsx)(C.p,{type:"password",name:"password",value:x.password,onChange:N,placeholder:"Enter password",minLength:8}),(0,p.jsx)(_.eK,{children:"Password must be at least 8 characters long"})]}),d&&"admin"===d.role&&(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Sou\u010dasn\xe9 heslo (potvrzen\xed)"}),(0,p.jsx)(C.p,{type:"password",name:"currentPassword",value:x.currentPassword,onChange:N,placeholder:"Zadejte sou\u010dasn\xe9 heslo administr\xe1tora"}),(0,p.jsx)(_.eK,{children:"Pro \xfapravu administr\xe1torsk\xe9ho \xfa\u010dtu je nutn\xe9 zadat sou\u010dasn\xe9 heslo."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Role"}),(0,p.jsxs)(ha.l,{name:"role",value:x.role,onChange:N,children:[(0,p.jsx)("option",{value:"fan",children:"Fan"}),(0,p.jsx)("option",{value:"editor",disabled:!!d&&"admin"===d.role,children:"Editor"}),(0,p.jsx)("option",{value:"admin",children:"Admin"})]}),"admin"===(null===d||void 0===d?void 0:d.role)&&(0,p.jsx)(_.eK,{children:"Administr\xe1torsk\xfd \xfa\u010det nelze degradovat na editora p\u0159es tuto obrazovku."})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",mr:2,children:"Active"}),(0,p.jsx)(pa.d,{name:"isActive",isChecked:x.isActive,onChange:N,colorScheme:"blue"})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:c,children:"Cancel"}),(0,p.jsxs)(T.$,{colorScheme:"blue",type:"submit",isLoading:o,loadingText:"Saving...",children:[d?"Update":"Create"," User"]})]})]})]})]})})};var il=n(2733);function ol(){var e,t,i,o,r;const s=(0,b.dU)("white","gray.800"),c=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700"),(0,b.dU)("gray.600","gray.400")),d=(0,b.dU)("gray.50","gray.700"),[u,m]=(0,a.useState)(""),[x,g]=(0,a.useState)([]),[v,f]=(0,a.useState)({subject:"",content:""}),[k,R]=(0,a.useState)(""),[W,M]=(0,a.useState)(""),[D,L]=(0,a.useState)(""),[F,O]=(0,a.useState)(""),[Z,q]=(0,a.useState)(""),[V,$]=(0,a.useState)(""),[G,ne]=(0,a.useState)(!0),[ae,ie]=(0,a.useState)("SMTP Test"),[oe,re]=(0,a.useState)("<p>Toto je testovac\xed e\u2011mail (admin SMTP debug).</p>"),[ce,de]=(0,a.useState)(!1),he=(0,Mn.n)({mutationFn:async()=>{const e={host:k.trim(),port:"number"===typeof W?W:0,username:D||void 0,password:F||void 0,from:Z.trim(),to:V.trim(),subject:ae||void 0,body:oe||void 0,use_tls:G};return(0,Xs.adminSendSmtpTest)(e)},onSuccess:e=>{null!==e&&void 0!==e&&e.ok?nt({title:"SMTP test \xfasp\u011b\u0161n\xfd",description:(null===e||void 0===e?void 0:e.message)||"Test email sent",status:"success"}):nt({title:"SMTP test selhal",description:(null===e||void 0===e?void 0:e.error)||"Chyba p\u0159i odesl\xe1n\xed testu",status:"error"})},onError:e=>{var t,n;nt({title:"Chyba po\u017eadavku",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),[ue,me]=(0,a.useState)(""),[pe,ge]=(0,a.useState)(""),[ve,je]=(0,a.useState)("newsletter"),[be,ye]=(0,a.useState)(!1),[fe,ke]=(0,a.useState)(null),[ze,we]=(0,a.useState)({}),[_e,Se]=(0,a.useState)("custom"),[Ce,Ae]=(0,a.useState)(""),[Ee,Te]=(0,a.useState)(""),[Ne,Re]=(0,a.useState)(""),[Pe,Ie]=(0,a.useState)(!1),We={weekly:"T\xfddenn\xed p\u0159ehled",matches:"Z\xe1pasy",scores:"V\xfdsledky",blogs:"Novinky",events:"Akce"},[Me,De]=(0,a.useState)(!1),[Ue,Le]=(0,a.useState)(null),[Fe,Oe]=(0,a.useState)({}),[Ze,Ke]=(0,a.useState)(""),[qe,Ve]=(0,a.useState)(!1),[He,$e]=(0,a.useState)(!1),Be=()=>{De(!1),Le(null),Ke("")},Je=(e,t)=>{const n=((e,t)=>{const n="weekly"===e?"weekly":e,a=wt.filter(e=>(null===e||void 0===e?void 0:e.is_active)&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[n]);if(!t||!t.trim()||"matches"!==e&&"scores"!==e)return a.map(e=>e.email);const i=t.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean),o=a.filter(e=>{const t=(null===e||void 0===e?void 0:e.preferences)||{},n=("string"===typeof t.competitions&&t.competitions?t.competitions:"string"===typeof t.categories?t.categories:"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return 0===n.length||n.some(e=>i.includes(e))});return o.map(e=>e.email)})(e,t),a=e=>{const t=String(null!==e&&void 0!==e?e:"");return/^[=+\-@]/.test(t)?"'".concat(t):t},i=[["email","type","competitions"].join(","),...n.map(n=>[a(n),e,(t||"").trim()].join(","))],o=new Blob(["\ufeff"+i.join("\n")],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download="newsletter_recipients_".concat(e,".csv"),s.click(),URL.revokeObjectURL(r)},Ye=async(e,t)=>{const n={};"weekly"===e?(n.blogs=!0,n.events=!0,n.matches=!0,n.scores=!0):n[e]=!0,t&&t.trim()&&(n.competitions=t.trim());const a=await(0,Xs.previewNewsletter)({preferences:n});Oe(t=>(0,h.A)((0,h.A)({},t),{},{[e]:{subject:a.subject,html:a.html}}))};(0,a.useEffect)(()=>{Me&&Ue&&!Fe[Ue]&&(async()=>{try{Ve(!0),await Ye(Ue,Ze)}finally{Ve(!1)}})()},[Me,Ue]);const{isOpen:Ge,onOpen:Xe,onClose:Qe}=(0,X.j)(),et=(0,X.j)(),tt=(0,X.j)(),nt=(0,j.d)(),at=(0,l.jE)(),it=((0,Es.A)({base:!0,md:!1}),(0,xe.I)({queryKey:["admin","settings"],queryFn:P})),ot=it.data,[rt,st]=(0,a.useState)(!(null===ot||void 0===ot||!ot.enable_weekly)),[lt,ct]=(0,a.useState)(!(null===ot||void 0===ot||!ot.enable_match_reminders)),[dt,ht]=(0,a.useState)(!(null===ot||void 0===ot||!ot.enable_results)),[ut,mt]=(0,a.useState)((null===ot||void 0===ot?void 0:ot.newsletter_weekly_day)||"sun"),[pt,xt]=(0,a.useState)("number"===typeof(null===ot||void 0===ot?void 0:ot.newsletter_weekly_hour)?ot.newsletter_weekly_hour:18),[gt,vt]=(0,a.useState)("number"===typeof(null===ot||void 0===ot?void 0:ot.newsletter_reminder_lead_hours)?ot.newsletter_reminder_lead_hours:48),[jt,bt]=(0,a.useState)("number"===typeof(null===ot||void 0===ot?void 0:ot.newsletter_quiet_start)?ot.newsletter_quiet_start:22),[yt,ft]=(0,a.useState)("number"===typeof(null===ot||void 0===ot?void 0:ot.newsletter_quiet_end)?ot.newsletter_quiet_end:7);(0,a.useEffect)(()=>{ot&&(st(!!ot.enable_weekly),ct(!!ot.enable_match_reminders),ht(!!ot.enable_results),mt(ot.newsletter_weekly_day||"sun"),xt("number"===typeof ot.newsletter_weekly_hour?ot.newsletter_weekly_hour:18),vt("number"===typeof ot.newsletter_reminder_lead_hours?ot.newsletter_reminder_lead_hours:48),bt("number"===typeof ot.newsletter_quiet_start?ot.newsletter_quiet_start:22),ft("number"===typeof ot.newsletter_quiet_end?ot.newsletter_quiet_end:7))},[ot]);const kt=(0,Mn.n)({mutationFn:()=>I({enable_weekly:rt,enable_match_reminders:lt,enable_results:dt,newsletter_weekly_day:ut,newsletter_weekly_hour:pt,newsletter_reminder_lead_hours:gt,newsletter_quiet_start:jt,newsletter_quiet_end:yt}),onSuccess:()=>{at.invalidateQueries({queryKey:["admin","settings"]}),nt({title:"Nastaven\xed rozes\xedlek ulo\u017eeno",status:"success"})},onError:e=>{var t,n;nt({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),zt=e=>{try{const t=e.replace(/<\s*(script|style|iframe)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi,"").replace(/ on[a-zA-Z]+\s*=\s*"[^"]*"/g,"").replace(/ on[a-zA-Z]+\s*=\s*'[^']*'/g,"").replace(/ on[a-zA-Z]+\s*=\s*[^\s>]+/g,"");return t.replace(/(href|src)\s*=\s*(["'])\s*(javascript:|data:)/gi,"$1=$2#")}catch(t){return""}},{data:wt=[],isLoading:_t}=(0,xe.I)({queryKey:["admin","newsletter-subscribers"],queryFn:Xs.getNewsletterSubscribers}),St=wt.filter(e=>e.email.toLowerCase().includes(u.toLowerCase())),Ct=(0,Mn.n)({mutationFn:e=>{let{id:t,isActive:n}=e;return(0,Xs.toggleSubscriberStatus)(t,n)},onSuccess:()=>{at.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),nt({title:"Stav odb\u011bratele byl aktualizov\xe1n",status:"success",duration:3e3,isClosable:!0})}}),At=(0,Mn.n)({mutationFn:Xs.deleteSubscriber,onSuccess:()=>{at.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),g([]),nt({title:"Odb\u011bratel byl smaz\xe1n",status:"success",duration:3e3,isClosable:!0})}}),Et=(0,Mn.n)({mutationFn:e=>{let{id:t,prefs:a}=e;return Promise.resolve().then(n.bind(n,3200)).then(e=>e.updateSubscriberPreferences(t,a))},onSuccess:()=>{at.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),ye(!1),nt({title:"Preference ulo\u017eeny",status:"success"})},onError:e=>{var t,n;nt({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed preferenc\xed",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),Tt=(0,Mn.n)({mutationFn:Xs.sendNewsletter,onSuccess:()=>{Qe(),f({subject:"",content:""}),nt({title:"Newsletter byl odesl\xe1n",status:"success",duration:5e3,isClosable:!0})},onError:e=>{var t,n,a,i;nt({title:"Chyba p\u0159i odes\xedl\xe1n\xed newsletteru",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error",duration:5e3,isClosable:!0})}}),Nt=(0,Mn.n)({mutationFn:()=>{const e=pe.split(",").map(e=>e.trim()).filter(Boolean);return e.length>0?(0,Xs.sendNewsletterTestAdvanced)({emails:e,type:ve}):ue?(0,Xs.sendNewsletterTestAdvanced)({email:ue,type:ve}):(0,Xs.sendNewsletterTestAdvanced)({type:ve})},onSuccess:e=>{nt({title:"Test odesl\xe1n",description:null!==e&&void 0!==e&&e.recipients&&e.recipients.length>0?"E-mail byl odesl\xe1n na ".concat(e.recipients.join(", ")):null!==e&&void 0!==e&&e.recipient?"E-mail byl odesl\xe1n na ".concat(e.recipient):"Testovac\xed e-mail byl odesl\xe1n",status:"success",duration:4e3,isClosable:!0}),me(""),ge(""),et.onClose()},onError:e=>{var t,n,a,i;nt({title:"Chyba p\u0159i odes\xedl\xe1n\xed testu",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error",duration:5e3,isClosable:!0})}}),Rt=e=>(0,Ei.GP)(new Date(e),"d. M. yyyy HH:mm",{locale:Ri.cs}),{data:Pt}=(0,xe.I)({queryKey:["admin","newsletter-status"],queryFn:Xs.getNewsletterStatus}),It=(0,Mn.n)({mutationFn:e=>(0,Xs.setNewsletterAutomation)(e),onSuccess:()=>at.invalidateQueries({queryKey:["admin","newsletter-status"]})}),{data:Wt=[],isLoading:Mt}=(0,xe.I)({queryKey:["admin","newsletter-stats-recent"],queryFn:Xs.getRecentEmailStats}),[Dt,Ut]=(0,a.useState)(!1),[Lt,Ft]=(0,a.useState)(null),Ot=(0,xe.I)({queryKey:["admin","email-events",null===Lt||void 0===Lt?void 0:Lt.id],queryFn:()=>(0,Xs.getEmailEventsForLog)((null===Lt||void 0===Lt?void 0:Lt.id)||0),enabled:!(null===Lt||void 0===Lt||!Lt.id)&&Dt}),[Zt,Kt]=(0,a.useState)({open:!0,click:!0,spam:!0,unsubscribe:!0});(Ot.data||[]).filter(e=>{var t;return null===(t=Zt[e.event_type])||void 0===t||t});return(0,p.jsxs)(Mo,{children:[(0,p.jsxs)(y.a,{p:6,children:[(0,p.jsxs)(Q.s,{justify:"space-between",align:"center",mb:6,flexWrap:"wrap",gap:4,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:2,children:"Spr\xe1va newsletteru"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Spravujte odb\u011bratele newsletteru a rozes\xedlejte hromadn\xe9 zpr\xe1vy"})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[x.length>0&&(0,p.jsxs)(T.$,{colorScheme:"red",variant:"outline",leftIcon:(0,p.jsx)(Qr.d,{}),onClick:()=>{window.confirm("Opravdu chcete smazat vybran\xe9 odb\u011bratele?")&&Promise.all(x.map(e=>At.mutateAsync(e)))},isLoading:At.isLoading,children:["Smazat vybran\xe9 (",x.length,")"]}),(0,p.jsx)(T.$,{variant:"outline",onClick:et.onOpen,children:"Odeslat testovac\xed e-mail"}),(0,p.jsx)(T.$,{variant:"outline",onClick:tt.onOpen,children:"Otestovat SMTP"}),(0,p.jsx)(T.$,{colorScheme:"blue",leftIcon:(0,p.jsx)(Ds.a,{}),onClick:Xe,isDisabled:0===wt.length,children:"Odeslat newsletter"})]})]}),(0,p.jsxs)(ra.t,{colorScheme:"blue",isFitted:!0,children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Stav"}),(0,p.jsx)(la.o,{children:"Pl\xe1nov\xe1n\xed"}),(0,p.jsx)(la.o,{children:"Statistika"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsxs)(da.K,{p:0,children:[(0,p.jsxs)(y.a,{bg:s,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Stav rozes\xedlek"}),(0,p.jsxs)(ee.z,{spacing:6,wrap:"wrap",children:[(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Odb\u011bratel\u016f:"})," ",null!==(e=null===Pt||void 0===Pt?void 0:Pt.total_subscribers)&&void 0!==e?e:"\u2014"]}),(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Aktivn\xedch:"})," ",null!==(t=null===Pt||void 0===Pt?void 0:Pt.active_subscribers)&&void 0!==t?t:"\u2014"]}),(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Dal\u0161\xed b\u011bh:"})," ",null!==Pt&&void 0!==Pt&&Pt.next_approximate?(0,Ei.GP)(new Date(Pt.next_approximate),"d. M. yyyy HH:mm",{locale:Ri.cs}):"\u2014"]}),(0,p.jsxs)(U.E,{children:[(0,p.jsx)("b",{children:"Interval:"})," ",null!==Pt&&void 0!==Pt&&Pt.interval_minutes?"".concat(Pt.interval_minutes," min"):"\u2014"]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(pa.d,{size:"sm",isChecked:!(null===Pt||void 0===Pt||!Pt.newsletter_enabled),onChange:e=>It.mutate(e.target.checked)}),(0,p.jsx)(U.E,{children:"Automatick\xe9 rozes\xedlky"})]})]}),null!==Pt&&void 0!==Pt&&Pt.next_approximate?(0,p.jsxs)(U.E,{color:"gray.600",fontSize:"sm",mt:2,children:["Dal\u0161\xed automatick\xfd newsletter za ",(()=>{const e=new Date(Pt.next_approximate).getTime()-Date.now();if(e<=0)return"m\xe9n\u011b ne\u017e minutu";const t=Math.floor(e/6e4),n=Math.floor(t/60),a=t%60;return n>0?"".concat(n," h ").concat(a," min"):"".concat(t," min")})()]}):null,null!==Pt&&void 0!==Pt&&null!==(i=Pt.sample_recipients)&&void 0!==i&&i.length?(0,p.jsx)(y.a,{mt:3,children:(0,p.jsxs)(U.E,{color:"gray.600",fontSize:"sm",children:["Uk\xe1zka p\u0159\xedjemc\u016f (",Pt.sample_recipients.length,"): ",Pt.sample_recipients.join(", ")]})}):null]}),(0,p.jsxs)(y.a,{bg:s,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Typy e\u2011mail\u016f"}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:["weekly","matches","scores","blogs","events"].map(e=>{const t=(e=>{const t="weekly"===e?"weekly":e;return wt.filter(e=>e.is_active&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[t]).map(e=>e.email)})(e).length,n="weekly"===e?!(null===ot||void 0===ot||!ot.enable_weekly):"matches"===e?!(null===ot||void 0===ot||!ot.enable_match_reminders):"scores"===e?!(null===ot||void 0===ot||!ot.enable_results):void 0;return(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:d},children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(U.E,{fontWeight:"600",children:We[e]}),void 0!==n&&(0,p.jsx)(Qt.E,{colorScheme:n?"green":"gray",children:n?"Zapnuto":"Vypnuto"})]}),(0,p.jsxs)(ee.z,{spacing:4,children:[(0,p.jsxs)(U.E,{color:c,children:["P\u0159\xedjemci: ",(0,p.jsx)("b",{children:t})]}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>(e=>{Le(e),De(!0)})(e),children:"Detail"})]})]},e)})})]})]}),(0,p.jsx)(da.K,{p:0,children:(0,p.jsxs)(y.a,{bg:s,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Pl\xe1nov\xe1n\xed rozes\xedlek"}),(0,p.jsx)(U.E,{color:"gray.600",mb:4,children:"Nastavte, kdy se automaticky pos\xedlaj\xed jednotliv\xe9 typy newsletter\u016f."}),it.isLoading?(0,p.jsxs)(ee.z,{color:"gray.600",children:[(0,p.jsx)(zn.y,{size:"sm"})," ",(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m nastaven\xed\u2026"})]}):(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"600",children:"T\xfddenn\xed p\u0159ehled"}),(0,p.jsx)(pa.d,{isChecked:rt,onChange:e=>st(e.target.checked)})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsxs)(_.MJ,{maxW:"220px",children:[(0,p.jsx)(S.l,{children:"Den v t\xfddnu"}),(0,p.jsxs)(ha.l,{value:ut,onChange:e=>mt(e.target.value),children:[(0,p.jsx)("option",{value:"mon",children:"Pond\u011bl\xed"}),(0,p.jsx)("option",{value:"tue",children:"\xdater\xfd"}),(0,p.jsx)("option",{value:"wed",children:"St\u0159eda"}),(0,p.jsx)("option",{value:"thu",children:"\u010ctvrtek"}),(0,p.jsx)("option",{value:"fri",children:"P\xe1tek"}),(0,p.jsx)("option",{value:"sat",children:"Sobota"}),(0,p.jsx)("option",{value:"sun",children:"Ned\u011ble"})]})]}),(0,p.jsxs)(_.MJ,{maxW:"160px",children:[(0,p.jsx)(S.l,{children:"Hodina"}),(0,p.jsx)(C.p,{type:"number",min:0,max:23,value:pt,onChange:e=>xt(Math.max(0,Math.min(23,Number(e.target.value)||0)))})]})]}),(0,p.jsx)(y.a,{h:"1px",bg:(0,b.dU)("gray.200","gray.700"),my:2}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"600",children:"P\u0159ipom\xednky z\xe1pas\u016f"}),(0,p.jsx)(pa.d,{isChecked:lt,onChange:e=>ct(e.target.checked)})]}),(0,p.jsx)(ee.z,{spacing:3,children:(0,p.jsxs)(_.MJ,{maxW:"220px",children:[(0,p.jsx)(S.l,{children:"Odeslat p\u0159ed (hodin)"}),(0,p.jsx)(C.p,{type:"number",min:1,max:168,value:gt,onChange:e=>vt(Math.max(1,Math.min(168,Number(e.target.value)||0)))}),(0,p.jsx)(_.eK,{children:"V\xfdchoz\xed 48 h p\u0159ed v\xfdkopem. Syst\xe9m pos\xedl\xe1 i upozorn\u011bn\xed v den z\xe1pasu."})]})}),(0,p.jsx)(y.a,{h:"1px",bg:(0,b.dU)("gray.200","gray.700"),my:2}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"600",children:"V\xfdsledky po z\xe1pase"}),(0,p.jsx)(pa.d,{isChecked:dt,onChange:e=>ht(e.target.checked)})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsxs)(_.MJ,{maxW:"160px",children:[(0,p.jsx)(S.l,{children:"Tich\xe9 hodiny od"}),(0,p.jsx)(C.p,{type:"number",min:0,max:23,value:jt,onChange:e=>bt(Math.max(0,Math.min(23,Number(e.target.value)||0)))})]}),(0,p.jsxs)(_.MJ,{maxW:"160px",children:[(0,p.jsx)(S.l,{children:"Tich\xe9 hodiny do"}),(0,p.jsx)(C.p,{type:"number",min:0,max:23,value:yt,onChange:e=>ft(Math.max(0,Math.min(23,Number(e.target.value)||0)))}),(0,p.jsx)(_.eK,{children:"E-maily s v\xfdsledky se nepos\xedlaj\xed v tomto intervalu."})]})]}),(0,p.jsx)(ee.z,{pt:2,children:(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>kt.mutate(),isLoading:kt.isLoading,children:"Ulo\u017eit pl\xe1nov\xe1n\xed"})})]})]})}),(0,p.jsx)(da.K,{p:0,children:(0,p.jsxs)(y.a,{bg:s,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Dod\xe1n\xed a interakce"}),Mt?(0,p.jsxs)(ee.z,{color:"gray.600",children:[(0,p.jsx)(zn.y,{size:"sm"})," ",(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m statistiky\u2026"})]}):0===Wt.length?(0,p.jsx)(U.E,{color:"gray.600",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe9 z\xe1znamy."}):(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"\u010cas"}),(0,p.jsx)(Oi.Th,{children:"P\u0159edm\u011bt"}),(0,p.jsx)(Oi.Th,{children:"P\u0159\xedjemce"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Otev\u0159en\xed"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Kliknut\xed"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Spam"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Odhl\xe1\u0161en\xed"}),(0,p.jsx)(Oi.Th,{children:"Stav"}),(0,p.jsx)(Oi.Th,{children:"Detail"})]})}),(0,p.jsx)(Zi.N,{children:Wt.slice(0,50).map(e=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,Ei.GP)(new Date(e.created_at),"d. M. yyyy HH:mm",{locale:Ri.cs})}),(0,p.jsx)(Ki.Td,{children:e.subject}),(0,p.jsx)(Ki.Td,{children:e.recipient}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.opens}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.clicks}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.spam}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.unsubs}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"failed"===e.status?"red":"green",children:e.status})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(T.$,{size:"xs",variant:"outline",onClick:()=>{Ft(e),Ut(!0)},children:"Detail"})})]},e.id))})]})})]})})]})]}),(0,p.jsxs)(y.a,{bg:s,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,p.jsxs)(A.M,{maxW:"md",mb:4,children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(il.W,{color:"gray.400"})}),(0,p.jsx)(C.p,{placeholder:"Hledat podle e-mailu...",value:u,onChange:e=>m(e.target.value)})]}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{w:"40px",children:(0,p.jsx)("input",{type:"checkbox",onChange:e=>{e.target.checked?g(St.map(e=>e.id)):g([])},checked:St.length>0&&x.length===St.length})}),(0,p.jsx)(Oi.Th,{children:"E-mail"}),(0,p.jsx)(Oi.Th,{children:"Stav"}),(0,p.jsx)(Oi.Th,{children:"Datum registrace"}),(0,p.jsx)(Oi.Th,{children:"Posledn\xed zm\u011bna"}),(0,p.jsx)(Oi.Th,{w:"120px",children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:_t?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):0===St.length?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,textAlign:"center",py:8,color:"gray.500",children:u?"\u017d\xe1dn\xed odb\u011bratel\xe9 nebyli nalezeni":"\u017d\xe1dn\xed odb\u011bratel\xe9"})}):St.map(e=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)("input",{type:"checkbox",checked:x.includes(e.id),onChange:t=>{return n=e.id,a=t.target.checked,void g(a?e=>[...e,n]:e=>e.filter(e=>e!==n));var n,a}})}),(0,p.jsx)(Ki.Td,{children:e.email}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:e.is_active?"green":"gray",children:e.is_active?"Aktivn\xed":"Neaktivn\xed"})}),(0,p.jsx)(Ki.Td,{children:(()=>{const t=e.preferences;return t&&Object.keys(t).length>0?Object.keys(t).map(e=>t[e]?(0,p.jsx)(Qt.E,{mr:1,colorScheme:"blue",children:e},e):null):(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9"})})()}),(0,p.jsx)(Ki.Td,{children:Rt(e.created_at)}),(0,p.jsx)(Ki.Td,{children:Rt(e.updated_at)}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(te.m,{label:e.is_active?"Deaktivovat":"Aktivovat",children:(0,p.jsx)("span",{children:(0,p.jsx)(pa.d,{colorScheme:"green",isChecked:e.is_active,onChange:t=>Ct.mutate({id:e.id,isActive:t.target.checked}),isDisabled:Ct.isLoading})})}),(0,p.jsx)(te.m,{label:"Smazat",children:(0,p.jsx)("span",{children:(0,p.jsx)(K.K,{"aria-label":"Smazat odb\u011bratele",icon:(0,p.jsx)(Qr.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>{window.confirm("Opravdu chcete smazat tohoto odb\u011bratele?")&&At.mutate(e.id)},isLoading:At.isLoading&&At.variables===e.id})})}),(0,p.jsx)(te.m,{label:"Upravit preference",children:(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>{ke(e),we(e.preferences||{}),ye(!0)},children:"Upravit"})})]})})]},e.id))})]})})]})]}),(0,p.jsxs)(se.aF,{isOpen:Ge,onClose:Qe,size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:"Odeslat newsletter"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(U.E,{children:["Newsletter bude odesl\xe1n v\u0161em aktivn\xedm odb\u011bratel\u016fm (",wt.filter(e=>e.is_active).length,")."]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Typ"}),(0,p.jsxs)(ha.l,{value:_e,onChange:e=>Se(e.target.value),children:[(0,p.jsx)("option",{value:"custom",children:"Vlastn\xed obsah"}),(0,p.jsx)("option",{value:"matches",children:"\u0160ablona: Z\xe1pasy"}),(0,p.jsx)("option",{value:"scores",children:"\u0160ablona: V\xfdsledky"}),(0,p.jsx)("option",{value:"events",children:"\u0160ablona: Akce"}),(0,p.jsx)("option",{value:"blogs",children:"\u0160ablona: Novinky"}),(0,p.jsx)("option",{value:"weekly",children:"\u0160ablona: T\xfddenn\xed p\u0159ehled"})]}),(0,p.jsx)(_.eK,{children:"Zvolte mezi vlastn\xedm obsahem nebo automatickou \u0161ablonou."})]}),"custom"===_e&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"P\u0159edm\u011bt"}),(0,p.jsx)(C.p,{placeholder:"P\u0159edm\u011bt zpr\xe1vy",value:v.subject,onChange:e=>f((0,h.A)((0,h.A)({},v),{},{subject:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Obsah zpr\xe1vy"}),(0,p.jsx)(va.T,{placeholder:"Zde napi\u0161te obsah newsletteru...",value:v.content,onChange:e=>f((0,h.A)((0,h.A)({},v),{},{content:e.target.value})),rows:10}),(0,p.jsx)(_.eK,{children:"Pro form\xe1tov\xe1n\xed textu m\u016f\u017eete pou\u017e\xedt HTML zna\u010dky."})]})]}),"custom"!==_e&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Filtr sout\u011b\u017e\xed (voliteln\xe9)"}),(0,p.jsx)(C.p,{placeholder:"NAP\u0158. KP, I.A, I.B",value:Ce,onChange:e=>Ae(e.target.value)}),(0,p.jsx)(_.eK,{children:"\u010c\xe1rkou odd\u011blen\xfd seznam k\xf3d\u016f sout\u011b\u017e\xed."})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{variant:"outline",onClick:async()=>{Ie(!0);try{const e={};"weekly"===_e?(e.blogs=!0,e.events=!0,e.matches=!0,e.scores=!0):e[_e]=!0,Ce.trim()&&(e.competitions=Ce.trim());const t=await(0,Xs.previewNewsletter)({preferences:e});Te(t.subject),Re(t.html)}finally{Ie(!1)}},children:"N\xe1hled \u0161ablony"}),Pe&&(0,p.jsx)(zn.y,{size:"sm"}),Ee&&(0,p.jsx)(Qt.E,{colorScheme:"blue",children:Ee})]}),(0,p.jsx)(y.a,{mt:2,p:3,bg:(0,b.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",children:(0,p.jsx)(y.a,{bg:s,p:3,borderRadius:"md",borderWidth:"1px",dangerouslySetInnerHTML:{__html:zt(Ne||"<em>N\xe1hled se zobraz\xed zde</em>")}})})]}),(0,p.jsxs)(y.a,{mt:4,p:4,bg:(0,b.dU)("gray.50","gray.900"),borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,children:"N\xe1hled:"}),(0,p.jsx)(y.a,{border:"1px",borderColor:"gray.200",p:4,borderRadius:"md",bg:s,dangerouslySetInnerHTML:{__html:zt("custom"===_e?v.content||"<em>N\xe1hled se zobraz\xed zde</em>":Ne||"<em>N\xe1hled se zobraz\xed zde</em>")}})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:Qe,children:"Zru\u0161it"}),"custom"===_e?(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>{Tt.mutate(v)},isLoading:Tt.isLoading,isDisabled:!v.subject||!v.content,leftIcon:(0,p.jsx)(Ds.a,{}),children:"Odeslat newsletter"}):(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{try{await(0,Xs.sendNewsletterDigest)(_e,Ce.trim()||void 0),nt({title:"Digest odesl\xe1n",status:"success"}),Qe(),Re(""),Te(""),Ae(""),Se("custom")}catch(n){var e,t;nt({title:"Chyba p\u0159i odesl\xe1n\xed",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message),status:"error"})}},leftIcon:(0,p.jsx)(Ds.a,{}),children:"Odeslat digest"})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:Me,onClose:Be,size:"5xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"95vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:Ue?"Detail: ".concat(We[Ue]):"Detail"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(ee.z,{spacing:4,align:"flex-end",children:[(0,p.jsxs)(_.MJ,{maxW:"360px",children:[(0,p.jsx)(S.l,{children:"Filtr sout\u011b\u017e\xed (voliteln\xe9)"}),(0,p.jsx)(C.p,{placeholder:"NAP\u0158. KP, I.A, I.B",value:Ze,onChange:e=>Ke(e.target.value)})]}),(0,p.jsx)(T.$,{onClick:async()=>{if(Ue){Ve(!0);try{await Ye(Ue,Ze)}finally{Ve(!1)}}},isLoading:qe,children:"Aktualizovat n\xe1hled"}),Ue&&(null===(o=Fe[Ue])||void 0===o?void 0:o.subject)&&(0,p.jsx)(Qt.E,{colorScheme:"blue",children:Fe[Ue].subject}),(0,p.jsx)(T.$,{colorScheme:"blue",variant:"solid",isLoading:He,onClick:async()=>{if(!Ue)return;if(window.confirm('Odeslat "'.concat(We[Ue],'" nyn\xed? E\u2011mail bude odesl\xe1n v\u0161em aktivn\xedm odb\u011bratel\u016fm.')))try{$e(!0),await(0,Xs.sendNewsletterDigest)(Ue,(Ze||"").trim()||void 0),nt({title:"Digest odesl\xe1n",status:"success"})}catch(n){var e,t;nt({title:"Chyba p\u0159i odesl\xe1n\xed",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message),status:"error"})}finally{$e(!1)}},children:"Odeslat nyn\xed"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>{Ue&&Je(Ue,Ze)},children:"Export CSV"})]}),(0,p.jsx)(y.a,{p:3,bg:(0,b.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",children:(0,p.jsx)(y.a,{bg:s,p:3,borderRadius:"md",borderWidth:"1px",dangerouslySetInnerHTML:{__html:zt(Ue&&(null===(r=Fe[Ue])||void 0===r?void 0:r.html)||"<em>N\xe1hled se zobraz\xed zde</em>")}})}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:2,children:"P\u0159\xedjemci"}),(()=>{let e=[];if(Ue){const t="weekly"===Ue?"weekly":Ue,n=wt.filter(e=>(null===e||void 0===e?void 0:e.is_active)&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[t]);let a=n;const i=(Ze||"").trim();if(i&&("matches"===Ue||"scores"===Ue)){const e=i.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);e.length>0&&(a=n.filter(t=>{const n=(null===t||void 0===t?void 0:t.preferences)||{},a=("string"===typeof n.competitions&&n.competitions?n.competitions:"string"===typeof n.categories?n.categories:"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return 0===a.length||a.some(t=>e.includes(t))}))}e=a.map(e=>e.email)}const t=e.slice(0,50);return(0,p.jsx)(p.Fragment,{children:0===t.length?(0,p.jsx)(U.E,{color:"gray.600",children:"\u017d\xe1dn\xed p\u0159\xedjemci pro tento typ."}):(0,p.jsxs)(w.T,{align:"stretch",spacing:1,maxH:"240px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:[t.map(e=>(0,p.jsx)(U.E,{fontFamily:"mono",children:e},e)),e.length>t.length&&(0,p.jsxs)(U.E,{color:"gray.600",children:["\u2026 a dal\u0161\xedch ",e.length-t.length]})]})})})()]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{onClick:Be,children:"Zav\u0159\xedt"})})]})]}),(0,p.jsxs)(se.aF,{isOpen:tt.isOpen,onClose:tt.onClose,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:"Otestovat SMTP"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(ee.z,{spacing:3,align:"flex-end",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Host"}),(0,p.jsx)(C.p,{placeholder:"smtp.example.com",value:k,onChange:e=>R(e.target.value)})]}),(0,p.jsxs)(_.MJ,{maxW:"140px",children:[(0,p.jsx)(S.l,{children:"Port"}),(0,p.jsx)(C.p,{type:"number",placeholder:"465",value:W,onChange:e=>M(Number(e.target.value)||0)})]}),(0,p.jsxs)(_.MJ,{maxW:"140px",children:[(0,p.jsx)(S.l,{children:"\xa0"}),(0,p.jsx)(N.S,{isChecked:G,onChange:e=>ne(e.target.checked),children:"TLS/SSL"})]})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"U\u017eivatel"}),(0,p.jsx)(C.p,{value:D,onChange:e=>L(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Heslo"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{type:ce?"text":"password",value:F,onChange:e=>O(e.target.value)}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>de(e=>!e),children:ce?"Skr\xfdt":"Zobrazit"})})]})]})]}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"From"}),(0,p.jsx)(C.p,{placeholder:"club@example.com",value:Z,onChange:e=>q(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"To (kam poslat test)"}),(0,p.jsx)(C.p,{placeholder:"you@example.com",value:V,onChange:e=>$(e.target.value)})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"P\u0159edm\u011bt"}),(0,p.jsx)(C.p,{value:ae,onChange:e=>ie(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"T\u011blo zpr\xe1vy (HTML)"}),(0,p.jsx)(va.T,{rows:6,value:oe,onChange:e=>re(e.target.value)})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:tt.onClose,children:"Zav\u0159\xedt"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>he.mutate(),isLoading:he.isLoading,children:"Odeslat test"})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:et.isOpen,onClose:et.onClose,size:"md",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,p.jsx)(J.r,{children:"Odeslat testovac\xed e-mail"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsx)(U.E,{color:"gray.600",children:"Testovac\xed e-mail bude odesl\xe1n na zadanou adresu. Pokud pole nech\xe1te pr\xe1zdn\xe9, ode\u0161leme na v\xfdchoz\xed administr\xe1torsk\xfd e-mail."}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"E-mail p\u0159\xedjemce (voliteln\u011b)"}),(0,p.jsx)(C.p,{type:"email",placeholder:"nap\u0159. admin@priklad.cz",value:ue,onChange:e=>me(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"V\xedce e-mail\u016f (odd\u011blen\xe9 \u010d\xe1rkou)"}),(0,p.jsx)(C.p,{placeholder:"user1@priklad.cz, user2@priklad.cz",value:pe,onChange:e=>ge(e.target.value)}),(0,p.jsx)(_.eK,{children:"Pokud vypln\xedte, pou\u017eije se toto pole p\u0159ednostn\u011b."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Typ testu"}),(0,p.jsxs)("select",{value:ve,onChange:e=>je(e.target.value),children:[(0,p.jsx)("option",{value:"newsletter",children:"Newsletter"}),(0,p.jsx)("option",{value:"welcome",children:"Uv\xedtac\xed"}),(0,p.jsx)("option",{value:"welcome_back",children:"Uv\xedtac\xed (n\xe1vrat)"}),(0,p.jsx)("option",{value:"blogs",children:"Blogy (digest)"}),(0,p.jsx)("option",{value:"events",children:"Ud\xe1losti (digest)"}),(0,p.jsx)("option",{value:"matches",children:"Z\xe1pasy (digest)"}),(0,p.jsx)("option",{value:"scores",children:"V\xfdsledky (digest)"}),(0,p.jsx)("option",{value:"weekly",children:"T\xfddenn\xed p\u0159ehled"})]})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:et.onClose,children:"Zav\u0159\xedt"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>Nt.mutate(),isLoading:Nt.isLoading,children:"Odeslat test"})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:be,onClose:()=>ye(!1),size:"md",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Upravit preference"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"T\xfddenn\xed p\u0159ehled"}),(0,p.jsx)(pa.d,{isChecked:!!ze.weekly,onChange:e=>we((0,h.A)((0,h.A)({},ze),{},{weekly:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,p.jsx)(pa.d,{isChecked:!!ze.matches,onChange:e=>we((0,h.A)((0,h.A)({},ze),{},{matches:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Blog"}),(0,p.jsx)(pa.d,{isChecked:!!ze.blogs,onChange:e=>we((0,h.A)((0,h.A)({},ze),{},{blogs:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:()=>ye(!1),children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>fe?Et.mutate({id:fe.id,prefs:ze}):void 0,isLoading:Et.isLoading,isDisabled:!fe,children:"Ulo\u017eit"})]})]})]})]})}const rl=()=>{const e=(0,b.dU)("white","gray.800"),t=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700"),(0,j.d)()),[n,i]=(0,a.useState)([]),[o,r]=(0,a.useState)(!1),[s,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[u,x]=(0,a.useState)({}),[g,v]=(0,a.useState)(null),[f,k]=(0,a.useState)(!1),_=async()=>{r(!0);try{const e=await Bn();i(e||[])}catch(e){t({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed",description:(null===e||void 0===e?void 0:e.message)||"Nelze na\u010d\xedst aliasy",status:"error"})}finally{r(!1)}};(0,a.useEffect)(()=>{_().then(async()=>{await S()})},[]);const S=async()=>{try{const e=(e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/facr_club_info.json"),n=await fetch(e,{cache:"no-cache"});if(!n.ok)return;const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[],o=await Bn(),r=new Set((o||[]).map(e=>e.code)),s=i.map(e=>({code:String(e.code||e.id||"").trim(),name:String(e.name||"").trim()})).filter(e=>e.code).filter(e=>!r.has(e.code));if(!s.length)return;await Promise.all(s.map(e=>Jn(e.code,{alias:e.name||e.code,original_name:e.name||void 0}))),await _(),t({title:"Alias sout\u011b\u017e\xed dopln\u011bny",description:"P\u0159id\xe1no: ".concat(s.length),status:"success",duration:3e3})}catch(e){}},A=async e=>{if(window.confirm("Smazat alias pro sout\u011b\u017e ".concat(e,"?")))try{await async function(e){const t=await m.Ay.delete("/admin/competition-aliases/".concat(encodeURIComponent(e)));return t.data&&"undefined"!==typeof t.data.ok?t.data:void 0}(e),i(t=>t.filter(t=>t.code!==e)),x(t=>{const n=(0,h.A)({},t);return delete n[e],n}),t({title:"Smaz\xe1no",status:"success"})}catch(n){t({title:"Smaz\xe1n\xed selhalo",description:(null===n||void 0===n?void 0:n.message)||"Zkuste znovu",status:"error"})}},E=(0,a.useMemo)(()=>{if(!n)return[];if(f)return n;const e=e=>!e||e<=0?Number.MAX_SAFE_INTEGER:e;return[...n].sort((t,n)=>{const a=e(t.display_order),i=e(n.display_order);return a!==i?a-i:t.code.localeCompare(n.code)})},[n,f]),N=async()=>{const e=Object.entries(u);if(e.length){r(!0);try{for(const[t,n]of e){var a;if(null===n||void 0===n||null===(a=n.alias)||void 0===a||!a.trim())throw new Error("Alias je povinn\xfd pro ".concat(t))}const o=await Promise.all(e.map(e=>{let[t,a]=e;const i=n.find(e=>e.code===t),o={alias:a.alias.trim()};return null!==i&&void 0!==i&&i.original_name&&(o.original_name=i.original_name),Jn(t,o)}));i(e=>{const t=new Map(e.map(e=>[e.code,e]));for(const n of o)t.set(n.code,n);return Array.from(t.values()).sort((e,t)=>e.code.localeCompare(t.code))}),x({}),t({title:"V\u0161e ulo\u017eeno",status:"success"})}catch(o){t({title:"Hromadn\xe9 ulo\u017een\xed selhalo",description:(null===o||void 0===o?void 0:o.message)||"Zkuste znovu",status:"error"})}finally{r(!1)}}else t({title:"Nic k ulo\u017een\xed",status:"info"})},R=Object.keys(u).length>0,P=()=>{v(null)};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{maxW:"1400px",mx:"auto",children:[(0,p.jsx)(bs,{title:"Alias sout\u011b\u017e\xed",description:"Spravujte zobrazovan\xe9 n\xe1zvy sout\u011b\u017e\xed. M\u016f\u017eete je importovat z cache (FACR) a upravit aliasy."}),(0,p.jsxs)(Q.s,{align:"center",justify:"space-between",mb:6,wrap:"wrap",gap:3,bg:e,p:4,borderRadius:"lg",shadow:"sm",borderWidth:"1px",borderColor:"gray.200",children:[(0,p.jsx)(ee.z,{spacing:3,children:f?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),onClick:async()=>{r(!0);try{const e=n.map((e,t)=>({code:e.code,display_order:t+1}));await async function(e){return(await m.Ay.post("/admin/competition-aliases/reorder",{items:e})).data}(e),t({title:"Po\u0159ad\xed ulo\u017eeno",status:"success"}),k(!1),await _()}catch(e){t({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed po\u0159ad\xed",description:(null===e||void 0===e?void 0:e.message)||"Zkuste znovu",status:"error"})}finally{r(!1)}},isLoading:o,colorScheme:"green",size:"md",children:"Ulo\u017eit po\u0159ad\xed"}),(0,p.jsx)(T.$,{onClick:()=>{k(!1),_()},isDisabled:o,variant:"outline",size:"md",children:"Zru\u0161it"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.wO2,{}),onClick:_,isLoading:o,variant:"outline",size:"md",_hover:{bg:"gray.50",borderColor:"gray.400"},children:"Obnovit"}),(0,p.jsxs)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),onClick:N,isDisabled:!R,isLoading:o,colorScheme:"green",size:"md",variant:R?"solid":"outline",_hover:R?{bg:"green.600"}:{},children:["Ulo\u017eit v\u0161e ",R&&(0,p.jsx)(Qt.E,{ml:2,colorScheme:"green",variant:"solid",children:Object.keys(u).length})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.PfQ,{}),onClick:()=>k(!0),isLoading:o,colorScheme:"purple",size:"md",variant:"outline",_hover:{bg:"purple.50",borderColor:"purple.400"},children:"Zm\u011bnit po\u0159ad\xed"})]})}),!f&&(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.a4x,{}),onClick:async()=>{r(!0);try{const e=(e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/facr_club_info.json"),n=await fetch(e,{cache:"no-cache"});if(!n.ok)throw new Error("HTTP ".concat(n.status));const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[],o=await Bn(),r=new Set((o||[]).map(e=>e.code)),s=i.map(e=>({code:String(e.code||e.id||"").trim(),name:String(e.name||"").trim()})).filter(e=>e.code).filter(e=>!r.has(e.code));if(!s.length)return void t({title:"\u017d\xe1dn\xe9 nov\xe9 sout\u011b\u017ee",description:"V\u0161echny sout\u011b\u017ee ji\u017e maj\xed alias.",status:"info"});await Promise.all(s.map(e=>Jn(e.code,{alias:e.name||e.code,original_name:e.name||void 0}))),await _(),t({title:"Import dokon\u010den",description:"P\u0159id\xe1no: ".concat(s.length),status:"success"})}catch(e){t({title:"Import selhal",description:(null===e||void 0===e?void 0:e.message)||"Nelze na\u010d\xedst FACR sout\u011b\u017ee",status:"error"})}finally{r(!1)}},isLoading:o,colorScheme:"blue",size:"md",shadow:"sm",children:"Importovat ze sout\u011b\u017e\xed"})]}),!f&&(0,p.jsxs)(y.a,{bg:e,borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",p:6,mb:6,shadow:"sm",_hover:{shadow:"md"},transition:"all 0.2s",children:[(0,p.jsxs)(ee.z,{mb:4,spacing:2,children:[(0,p.jsx)(y.a,{bg:"blue.500",p:2,borderRadius:"md",children:(0,p.jsx)(q.GGD,{color:"white",size:18})}),(0,p.jsx)(z.D,{size:"md",color:"gray.700",children:"P\u0159idat nov\xfd alias"})]}),(0,p.jsx)(G.c,{mb:4}),(0,p.jsxs)(Q.s,{gap:3,wrap:"wrap",align:"flex-end",children:[(0,p.jsxs)(w.T,{align:"flex-start",spacing:2,flex:"0 0 240px",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",color:"gray.600",children:"K\xf3d sout\u011b\u017ee"}),(0,p.jsx)(C.p,{placeholder:"nap\u0159. A1A",value:s,onChange:e=>l(e.target.value.toUpperCase()),size:"md",bg:(0,b.dU)("gray.50","gray.900"),borderColor:"gray.300",_hover:{borderColor:"blue.400",bg:"white"},_focus:{borderColor:"blue.500",bg:"white",shadow:"sm"},fontFamily:"mono",fontWeight:"semibold"})]}),(0,p.jsxs)(w.T,{align:"flex-start",spacing:2,flex:"1",minW:"300px",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",color:"gray.600",children:"Zobrazovan\xfd n\xe1zev (alias)"}),(0,p.jsx)(C.p,{placeholder:"nap\u0159. Krajsk\xfd p\u0159ebor",value:c,onChange:e=>d(e.target.value),size:"md",bg:(0,b.dU)("gray.50","gray.900"),borderColor:"gray.300",_hover:{borderColor:"blue.400",bg:"white"},_focus:{borderColor:"blue.500",bg:"white",shadow:"sm"}})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),onClick:async()=>{const e=s.trim(),n=c.trim();if(e&&n)try{const a=await Jn(e,{alias:n});i(e=>[...e.filter(e=>e.code!==a.code),a].sort((e,t)=>e.code.localeCompare(t.code))),l(""),d(""),t({title:"Alias ulo\u017een",status:"success"})}catch(a){t({title:"Ulo\u017een\xed selhalo",description:(null===a||void 0===a?void 0:a.message)||"Zkuste znovu",status:"error"})}else t({title:"Vypl\u0148te code a alias",status:"warning"})},colorScheme:"blue",size:"md",px:8,shadow:"sm",_hover:{shadow:"md",transform:"translateY(-1px)"},transition:"all 0.2s",children:"P\u0159idat"})]})]}),(0,p.jsx)(y.a,{bg:e,borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",overflow:"hidden",shadow:"sm",children:(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsxs)(Ui.X,{variant:"simple",size:"md",children:[(0,p.jsx)(Li.d,{bg:(0,b.dU)("gray.50","gray.900"),children:(0,p.jsxs)(Fi.Tr,{children:[f&&(0,p.jsx)(Oi.Th,{width:"60px",textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Po\u0159ad\xed"}),(0,p.jsx)(Oi.Th,{width:"200px",textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"K\xf3d"}),!f&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Oi.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"P\u016fvodn\xed n\xe1zev"}),(0,p.jsx)(Oi.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Alias"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Akce"})]}),f&&(0,p.jsx)(Oi.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Alias"})]})}),(0,p.jsxs)(Zi.N,{children:[E.map((e,a)=>{var o;const r=null!==(o=u[e.code])&&void 0!==o?o:{alias:e.alias},s=void 0!==u[e.code];return f?(0,p.jsxs)(Fi.Tr,{draggable:!0,onDragStart:e=>((e,t)=>{v(t),e.dataTransfer.effectAllowed="move"})(e,a),onDragOver:e=>((e,t)=>{if(e.preventDefault(),null===g||g===t)return;const a=[...n],o=a[g];a.splice(g,1),a.splice(t,0,o),i(a),v(t)})(e,a),onDragEnd:P,cursor:"move",bg:g===a?"blue.50":void 0,_hover:{bg:"gray.100"},transition:"background 0.15s",opacity:g===a?.5:1,children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(y.a,{as:q.PfQ,color:"gray.500"}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"gray.700",children:a+1})]})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",fontFamily:"mono",fontSize:"sm",px:2,py:1,children:e.code})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:e.alias})})]},e.code):(0,p.jsxs)(Fi.Tr,{_hover:{bg:"gray.50"},transition:"background 0.15s",children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",fontFamily:"mono",fontSize:"sm",px:2,py:1,children:e.code}),s&&(0,p.jsx)(y.a,{as:q.Pj4,color:"orange.500",size:14})]})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",fontWeight:"medium",children:e.original_name||(0,p.jsx)(U.E,{as:"span",color:"gray.400",children:"\u2014"})})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(C.p,{size:"md",value:r.alias,onChange:t=>x(n=>(0,h.A)((0,h.A)({},n),{},{[e.code]:{alias:t.target.value}})),bg:s?"orange.50":"white",borderColor:s?"orange.300":"gray.200",_hover:{borderColor:s?"orange.400":"blue.300",bg:"white"},_focus:{borderColor:"blue.500",bg:"white",shadow:"sm"},fontWeight:"medium"})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsxs)(ee.z,{justify:"flex-end",spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Ulo\u017eit",icon:(0,p.jsx)(q.Bc_,{}),size:"sm",onClick:()=>(async e=>{var a;const o=u[e];if(o)if(null!==(a=o.alias)&&void 0!==a&&a.trim())try{const a=n.find(t=>t.code===e),r={alias:o.alias.trim()};null!==a&&void 0!==a&&a.original_name&&(r.original_name=a.original_name);const s=await Jn(e,r);i(t=>t.map(t=>t.code===e?s:t)),x(t=>{const n=(0,h.A)({},t);return delete n[e],n}),t({title:"Ulo\u017eeno",status:"success"})}catch(r){t({title:"Ulo\u017een\xed selhalo",description:(null===r||void 0===r?void 0:r.message)||"Zkuste znovu",status:"error"})}else t({title:"Alias je povinn\xfd",status:"warning"})})(e.code),colorScheme:"green",variant:"ghost",_hover:{bg:"green.50"}}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),size:"sm",colorScheme:"red",variant:"ghost",_hover:{bg:"red.50"},onClick:()=>A(e.code)})]})})]},e.code)}),0===E.length&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:4,children:(0,p.jsxs)(w.T,{py:12,spacing:3,children:[(0,p.jsx)(y.a,{color:"gray.300",fontSize:"4xl",children:(0,p.jsx)(q.Pj4,{})}),(0,p.jsx)(U.E,{color:"gray.500",fontSize:"md",fontWeight:"medium",children:"\u017d\xe1dn\xe9 aliasy zat\xedm nejsou"}),(0,p.jsx)(U.E,{color:"gray.400",fontSize:"sm",children:"P\u0159idejte nov\xfd alias nebo importujte ze sout\u011b\u017e\xed"})]})})})]})]})})}),E.length>0&&(0,p.jsx)(y.a,{mt:4,p:4,bg:(0,b.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",borderColor:"gray.200",children:(0,p.jsxs)(ee.z,{justify:"space-between",wrap:"wrap",children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",children:["Celkem alias\u016f: ",(0,p.jsx)(Qt.E,{colorScheme:"blue",ml:1,children:E.length})]}),R&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(Qt.E,{colorScheme:"orange",variant:"subtle",children:[Object.keys(u).length," neulo\u017een\xfdch zm\u011bn"]}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"green",onClick:N,leftIcon:(0,p.jsx)(q.Bc_,{}),children:"Ulo\u017eit v\u0161e"})]})]})})]})})};var sl=n(3169),ll=n(6201),cl=n(4330);const dl=()=>{var e;const t=(0,j.d)(),n=(0,l.jE)(),[i,o]=a.useState(!1),[r,s]=a.useState(""),[c,d]=a.useState(!1),[h,u]=a.useState(null),[x,g]=a.useState(""),{data:v,isError:b,error:f}=(0,xe.I)({queryKey:["admin","cache","list"],queryFn:async()=>(await m.Ay.get("/admin/cache/list")).data,staleTime:3e4,retry:1}),k=async e=>{d(!0),u(null),g("");try{const n=(await m.Ay.get("/admin/cache/file?path=".concat(encodeURIComponent(e)),{transformResponse:[e=>e]})).data;try{const e=JSON.parse(n);g(JSON.stringify(e,null,2))}catch(t){g(n)}}catch(n){u((null===n||void 0===n?void 0:n.message)||"Nelze na\u010d\xedst data")}finally{d(!1)}},{data:_,isLoading:S,isFetching:C}=(0,xe.I)({queryKey:["admin","prefetch","status"],queryFn:el,refetchInterval:3e4}),A=(0,Mn.n)({mutationFn:tl,onSuccess:async()=>{t({title:"Prefetch spu\u0161t\u011bn",status:"success"}),await n.invalidateQueries({queryKey:["admin","prefetch","status"]})},onError:e=>{t({title:"Spu\u0161t\u011bn\xed prefetch selhalo",description:String((null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),E=null!==_&&void 0!==_&&_.lastUpdated?new Date(_.lastUpdated):null,N=null!==_&&void 0!==_&&_.nextApproximate?new Date(_.nextApproximate):null;return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:4,children:"Prefetch & Cache"}),(0,p.jsx)(U.E,{color:"gray.600",mb:6,children:"Na pozad\xed b\u011b\u017e\xed \xfaloha, kter\xe1 pravideln\u011b stahuje JSON snapshoty z ve\u0159ejn\xfdch API pro rychlej\u0161\xed na\u010d\xedt\xe1n\xed str\xe1nek. Zde uvid\xedte aktu\xe1ln\xed pl\xe1n a m\u016f\u017eete spustit ru\u010dn\xed sta\u017een\xed."}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:3},spacing:4,mb:6,children:[(0,p.jsxs)(sl.Z,{children:[(0,p.jsx)(ll.a,{children:(0,p.jsx)(U.E,{fontWeight:"bold",children:"Re\u017eim"})}),(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"Aktu\xe1ln\xed re\u017eim"}),(0,p.jsx)(ko.k,{children:null!==_&&void 0!==_&&_.fastMode?(0,p.jsx)(Qt.E,{colorScheme:"green",children:"Rychl\xfd (b\u011bhem z\xe1pasu)"}):(0,p.jsx)(Qt.E,{children:"Norm\xe1ln\xed"})}),(0,p.jsx)(zo.h,{children:"V dob\u011b kon\xe1n\xed z\xe1pas\u016f se automaticky p\u0159epne do rychl\xe9ho re\u017eimu."})]})})]}),(0,p.jsxs)(sl.Z,{children:[(0,p.jsx)(ll.a,{children:(0,p.jsx)(U.E,{fontWeight:"bold",children:"Posledn\xed aktualizace"})}),(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"Posledn\xed prefetch"}),(0,p.jsx)(ko.k,{fontSize:"lg",children:E?E.toLocaleString():"Unknown"}),(0,p.jsx)(zo.h,{children:C?"Obnovuji\u2026":"Aktu\xe1ln\xed"})]})})]}),(0,p.jsxs)(sl.Z,{children:[(0,p.jsx)(ll.a,{children:(0,p.jsx)(U.E,{fontWeight:"bold",children:"Dal\u0161\xed spu\u0161t\u011bn\xed"})}),(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"P\u0159ibli\u017en\u011b"}),(0,p.jsx)(ko.k,{fontSize:"lg",children:N?N.toLocaleString():"\u2014"}),(0,p.jsxs)(zo.h,{children:["Interval: ",null!==(e=null===_||void 0===_?void 0:_.intervalMinutes)&&void 0!==e?e:30," min"]})]})})]})]}),(0,p.jsxs)(sl.Z,{children:[(0,p.jsx)(ll.a,{children:(0,p.jsxs)(At.B,{direction:{base:"column",sm:"row"},align:"center",justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Ovl\xe1d\xe1n\xed"}),(0,p.jsxs)(At.B,{direction:"row",spacing:3,children:[(0,p.jsx)(T.$,{colorScheme:"blue",isLoading:A.isLoading,onClick:()=>A.mutate(),children:"Spustit sta\u017een\xed"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>n.invalidateQueries({queryKey:["admin","prefetch","status"]}),children:"Obnovit stav"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>{var e;o(!0);const t=null===v||void 0===v||null===(e=v.files)||void 0===e?void 0:e[0];t?(s(t.path),k(t.path)):b?u("Nelze na\u010d\xedst seznam soubor\u016f"):null!==v&&void 0!==v&&v.files&&0!==v.files.length||u("\u017d\xe1dn\xe9 cache soubory nebyly nalezeny")},isDisabled:b&&!v,children:"Zobrazit RAW data"})]})]})}),(0,p.jsx)(G.c,{}),(0,p.jsx)(cl.b,{children:(0,p.jsx)(U.E,{color:"gray.600",children:"Ru\u010dn\xed spu\u0161t\u011bn\xed zah\xe1j\xed na pozad\xed obnovu v\u0161ech ve\u0159ejn\xfdch endpoint\u016f a zdroj\u016f FA\u010cR. Nezablokuje u\u017eivatelsk\xe9 rozhran\xed."})})]}),(0,p.jsxs)(se.aF,{isOpen:i,onClose:()=>o(!1),size:"6xl",scrollBehavior:"inside",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"RAW data (prefetch & cache)"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:b?(0,p.jsxs)(y.a,{p:4,textAlign:"center",children:[(0,p.jsx)(U.E,{color:"red.500",mb:2,children:"Chyba p\u0159i na\u010d\xedt\xe1n\xed seznamu soubor\u016f"}),(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",children:String(f)})]}):null!==v&&void 0!==v&&v.files&&0!==v.files.length?(0,p.jsxs)(Tt.r,{columns:{base:1,md:4},spacing:4,children:[(0,p.jsx)(w.T,{align:"stretch",spacing:2,gridColumn:{base:"1",md:"span 1"},children:v.files.map(e=>(0,p.jsx)(T.$,{variant:r===e.path?"solid":"outline",onClick:()=>{s(e.path),k(e.path)},justifyContent:"flex-start",size:"sm",children:(0,p.jsx)(U.E,{noOfLines:1,fontSize:"xs",textAlign:"left",w:"full",children:e.label})},e.path))}),(0,p.jsxs)(y.a,{gridColumn:{base:"1",md:"span 3"},children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:2,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:1,children:r||"Vyberte soubor"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>k(r),isLoading:c,isDisabled:!r,children:"Obnovit"}),(0,p.jsx)(T.$,{size:"sm",as:"a",href:"".concat(m.API_URL,"/admin/cache/file?path=").concat(encodeURIComponent(r)),target:"_blank",rel:"noreferrer",isDisabled:!r,children:"Otev\u0159\xedt v nov\xe9 z\xe1lo\u017ece"})]})]}),h&&(0,p.jsx)(y.a,{color:"red.500",mb:2,p:2,bg:"red.50",borderRadius:"md",children:h}),(0,p.jsx)(va.T,{value:x,onChange:()=>{},readOnly:!0,fontFamily:"mono",rows:24,fontSize:"xs"})]})]}):(0,p.jsxs)(y.a,{p:4,textAlign:"center",children:[(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 cache soubory nebyly nalezeny"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.400",mt:2,children:"Zkuste spustit prefetch sta\u017een\xed nejprve"})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{onClick:()=>o(!1),children:"Zav\u0159\xedt"})})]})]})]})})},hl={url:""},ul=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)([]),[s,l]=(0,a.useState)("manual"),[c,d]=(0,a.useState)(!0),u=(0,j.d)(),[m,x]=(0,a.useState)(""),[g,v]=(0,a.useState)(!1),[b,f]=(0,a.useState)(""),[A,E]=(0,a.useState)([]),[R,W]=(0,a.useState)({}),[M,D]=(0,a.useState)([]),[F,O]=(0,a.useState)(!1),[Z,V]=(0,a.useState)(""),[H,$]=(0,a.useState)(""),B=(0,a.useMemo)(()=>(m||"").trim().length>0,[m]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await P();if(!e)return;const n=Array.isArray(t.videos_items)?t.videos_items:[],a=Array.isArray(t.videos)?t.videos.map(e=>({url:e})):[];r(n.length?n:a);const i=t.videos_source;"auto"!==i&&"manual"!==i||l(i);const o=t.videos_module_enabled,s=n.length+a.length>0;d("boolean"===typeof o?Boolean(o):s);const c=t.youtube_url||t.social_youtube||"";c&&x(c)}catch(n){}finally{e&&t(!1)}})(),()=>{e=!1}},[]),(0,a.useEffect)(()=>{let t=!0;return(async()=>{if(!e&&"auto"===s){V(""),O(!0);try{const e=await bt();if(!t)return;D((null===e||void 0===e?void 0:e.videos)||[])}catch(n){if(!t)return;V("Nepoda\u0159ilo se na\u010d\xedst cache vide\xed. Zkuste Aktualizovat.")}finally{t&&O(!1)}}})(),()=>{t=!1}},[e,s]),(0,a.useEffect)(()=>{e||!B&&0===o.length&&c&&d(!1)},[e,B,o.length,c]),(0,a.useEffect)(()=>{if(e)return;if("auto"!==s)return;if(!(m||"").trim())return;const t="youtube_autoload_last";let n=0;try{n=Number(localStorage.getItem(t)||"0")}catch(a){}(!n||Date.now()-n>828e5)&&(async()=>{try{await tl();try{localStorage.setItem(t,String(Date.now()))}catch(e){}u({status:"info",title:"Aktualizace vide\xed",description:"Na pozad\xed se aktualizuje cache vide\xed z YouTube.",duration:3e3})}catch(n){}})()},[e,s,m,u]);const J=(e,t,n)=>{r(a=>a.map((a,i)=>i===e?(0,h.A)((0,h.A)({},a),{},{[t]:n}):a))},Y=(e,t)=>{const n=new Date;n.setDate(n.getDate()-t);const a=n.toISOString().slice(0,10);r(t=>t.map((t,n)=>n===e?(0,h.A)((0,h.A)({},t),{},{uploaded_at:a}):t))},X=e=>{try{const a=e.trim();if(!a)return;if(a.includes("youtu.be/")){var t;const e=null===(t=a.split("youtu.be/")[1])||void 0===t?void 0:t.split(/[?&#]/)[0];return e?"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg"):void 0}if(a.includes("youtube.com")){try{const e=new URL(a).searchParams.get("v")||"";if(e)return"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg")}catch(n){}const e=a.match(/[?&]v=([^&#]+)/),t=null===e||void 0===e?void 0:e[1];return t?"https://i.ytimg.com/vi/".concat(t,"/hqdefault.jpg"):void 0}}catch(a){}};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"md",mb:2,children:"Videa (pro tituln\xed str\xe1nku)"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:2,children:"P\u0159idejte a\u017e 5 vide\xed (doporu\u010deno). Prvn\xed se zobraz\xed jako hlavn\xed, dal\u0161\xed 4 v m\u0159\xed\u017ece. Podporov\xe1no YouTube/Vimeo URL."}),(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,flexWrap:"wrap",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Zdroj vide\xed:"}),(0,p.jsxs)(_i.e,{size:"sm",isAttached:!0,children:[(0,p.jsx)(T.$,{variant:"auto"===s?"solid":"outline",onClick:async()=>{if("auto"!==s){l("auto");try{await I({videos_source:"auto"}),u({status:"success",title:"Zdroj nastaven",description:"Videa se na\u010d\xedtaj\xed automaticky z YouTube.",duration:2500})}catch(e){u({status:"error",title:"Chyba",description:"Nelze ulo\u017eit zdroj vide\xed.",duration:3e3})}}},children:"Automaticky"}),(0,p.jsx)(T.$,{variant:"manual"===s?"solid":"outline",onClick:async()=>{if("manual"!==s){l("manual");try{await I({videos_source:"manual"}),u({status:"success",title:"Zdroj nastaven",description:"Videa spravujete ru\u010dn\u011b.",duration:2500})}catch(e){u({status:"error",title:"Chyba",description:"Nelze ulo\u017eit zdroj vide\xed.",duration:3e3})}}},children:"Ru\u010dn\u011b"})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",w:"auto",children:[(0,p.jsx)(S.l,{mb:0,children:"Zobrazit sekci Videa na tituln\xed str\xe1nce"}),(0,p.jsx)(pa.d,{isChecked:c,isDisabled:e||n,onChange:async e=>{const t=e.target.checked;if(t&&!B&&0===o.length)return d(!1),u({status:"warning",title:"Dopl\u0148te kan\xe1l nebo videa",description:"Pro zobrazen\xed sekce vypl\u0148te YouTube kan\xe1l nebo p\u0159idejte alespo\u0148 jedno video.",duration:4e3}),void setTimeout(()=>{const e=document.getElementById("admin-videos-channel-input");e&&e.focus()},0);d(t);try{await I({videos_module_enabled:t})}catch(n){u({status:"error",title:"Ulo\u017een\xed selhalo",description:"Nepoda\u0159ilo se ulo\u017eit zm\u011bnu zobrazen\xed sekce.",duration:3e3})}}})]})]}),!B&&0===o.length&&(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.600",mb:2,children:"Pro aktivaci sekce vypl\u0148te YouTube kan\xe1l nebo p\u0159idejte video."}),"auto"===s&&(0,p.jsxs)(xa.F,{status:"info",mb:3,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),"Automatick\xfd re\u017eim je zapnut\xfd. Videa se na\u010d\xedtaj\xed z YouTube kan\xe1lu z Nastaven\xed \u2192 Soci\xe1ln\xed s\xedt\u011b (YouTube URL) a spr\xe1vy \u201eVidea (YouTube modul)\u201c. Manu\xe1ln\xed seznam je v tomto re\u017eimu skryt."]}),"auto"!==s&&(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,mb:4,children:[(0,p.jsx)(z.D,{size:"sm",mb:2,children:"Import z YouTube kan\xe1lu"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",mb:3,children:["Pou\u017eijte Scraper API. Zadejte handle (nap\u0159. ",(0,p.jsx)("code",{children:"@FotbalKunovice"}),") nebo URL kan\xe1lu a na\u010dt\u011bte videa z karty \u201eVidea\u201c. Slu\u017eba: ",(0,p.jsx)(L.N,{href:"https://youtube.tdvorak.dev/",isExternal:!0,color:"blue.500",children:"https://youtube.tdvorak.dev/"})]}),(0,p.jsxs)(ee.z,{align:"start",spacing:3,children:[(0,p.jsxs)(_.MJ,{maxW:{base:"100%",md:"400px"},children:[(0,p.jsx)(S.l,{children:"Kan\xe1l (handle nebo URL)"}),(0,p.jsx)(C.p,{id:"admin-videos-channel-input",placeholder:"@FCBizoniUH nebo https://www.youtube.com/@FCBizoniUH/videos",value:m,onChange:e=>x(e.target.value)})]}),(0,p.jsx)(T.$,{onClick:async()=>{const e=null===m||void 0===m?void 0:m.trim();if(e){f(""),v(!0),E([]),W({});try{const t="https://youtube.tdvorak.dev/channel_videos?channel=".concat(encodeURIComponent(e)),n=await fetch(t,{method:"GET"});if(!n.ok)throw new Error("HTTP ".concat(n.status));const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.videos)?a.videos:[];E(i),0===i.length&&f("Na kan\xe1lu nebyla nalezena \u017e\xe1dn\xe1 videa.")}catch(t){console.error(t),f("Nepoda\u0159ilo se na\u010d\xedst videa z API. Zkontrolujte dostupnost slu\u017eby na https://youtube.tdvorak.dev/ a CORS.")}finally{v(!1)}}else u({status:"warning",title:"Zadejte kan\xe1l",description:"Zadejte YouTube handle nebo URL kan\xe1lu."})},isLoading:g,variant:"outline",children:"Na\u010d\xedst videa"}),(0,p.jsx)(T.$,{colorScheme:"green",onClick:()=>{const e=A.filter(e=>R[e.video_id]);if(0===e.length)return void u({status:"info",title:"Nic k importu",description:"Vyberte alespo\u0148 jedno video."});const t=e.map(e=>({url:"https://www.youtube.com/watch?v=".concat(e.video_id),title:e.title,length:e.length,uploaded_at:(e.published_date||"").slice(0,10),thumbnail_url:e.thumbnail_url}));r(e=>{const n=new Set(e.map(e=>e.url)),a=[...e];for(const i of t)n.has(i.url)||(a.push(i),n.add(i.url));return a}),u({status:"success",title:"Videa p\u0159id\xe1na",description:"".concat(e.length," vide\xed bylo p\u0159id\xe1no do seznamu.")})},isDisabled:0===A.length,children:"P\u0159idat vybran\xe1"})]}),b&&(0,p.jsxs)(xa.F,{status:"error",mt:3,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),b]}),g&&(0,p.jsxs)(ee.z,{mt:3,color:"gray.600",children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m videa\u2026"})]}),!g&&A.length>0&&(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:3,mt:3,children:A.map(e=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:2,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(k._,{src:e.thumbnail_url,alt:e.title,borderRadius:"md"}),(0,p.jsx)(N.S,{isChecked:!!R[e.video_id],onChange:()=>{return t=e.video_id,void W(e=>(0,h.A)((0,h.A)({},e),{},{[t]:!e[t]}));var t},children:"Vybrat"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",noOfLines:2,children:e.title}),(0,p.jsxs)(ee.z,{spacing:2,color:"gray.600",fontSize:"sm",children:[e.length&&(0,p.jsx)(Qt.E,{children:e.length}),e.published_text&&(0,p.jsx)(U.E,{children:e.published_text})]})]})]})},e.video_id))})]}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,mb:4,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",mb:2,flexWrap:"wrap",children:[(0,p.jsx)(z.D,{size:"sm",children:"N\xe1hled: v\u0161echna videa (aktivn\xed zdroj)"}),"auto"===s&&(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(C.p,{size:"sm",placeholder:"Filtrovat podle n\xe1zvu",value:H,onChange:e=>$(e.target.value)}),(0,p.jsx)(T.$,{size:"sm",onClick:async()=>{V(""),O(!0);try{await tl();const e=await bt();D((null===e||void 0===e?void 0:e.videos)||[]),u({status:"success",title:"Aktualizov\xe1no",description:"Cache vide\xed byla obnovena.",duration:3e3})}catch(e){V("Aktualizace cache selhala.")}finally{O(!1)}},isLoading:F,variant:"outline",children:"Aktualizovat cache"})]})]}),"auto"===s?(0,p.jsxs)(p.Fragment,{children:[Z&&(0,p.jsxs)(xa.F,{status:"error",mb:2,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),Z]}),F?(0,p.jsxs)(ee.z,{color:"gray.600",children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m videa\u2026"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",mb:2,children:["Po\u010det vide\xed: ",M.filter(e=>e.title.toLowerCase().includes(H.toLowerCase())).length]}),(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:3,children:M.filter(e=>e.title.toLowerCase().includes(H.toLowerCase())).map(e=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:2,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(k._,{src:e.thumbnail_url,alt:e.title,borderRadius:"md"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",noOfLines:2,children:e.title}),(0,p.jsx)(ee.z,{spacing:2,color:"gray.600",fontSize:"sm",children:e.published_date&&(0,p.jsx)(Qt.E,{children:new Date(e.published_date).toLocaleDateString("cs-CZ")})})]})]})},e.video_id))}),0===M.length&&(0,p.jsx)(U.E,{color:"gray.600",children:"\u017d\xe1dn\xe1 videa v cache. Zkontrolujte YouTube URL v nastaven\xed a pou\u017eijte \u201eAktualizovat cache\u201c."})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",mb:2,children:["Po\u010det vide\xed: ",o.length]}),(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:3,children:o.map((e,t)=>(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:2,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(k._,{src:e.thumbnail_url||X(e.url),alt:e.title||"Video ".concat(t+1),borderRadius:"md"}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",noOfLines:2,children:e.title||"Video ".concat(t+1)}),(0,p.jsx)(ee.z,{spacing:2,color:"gray.600",fontSize:"sm",children:e.uploaded_at&&(0,p.jsx)(Qt.E,{children:new Date(e.uploaded_at).toLocaleDateString("cs-CZ")})})]})]})},"".concat(t,"-").concat(e.url)))}),0===o.length&&(0,p.jsx)(U.E,{color:"gray.600",children:"Zat\xedm \u017e\xe1dn\xe1 videa."})]})]}),(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),onClick:()=>r(e=>[...e,(0,h.A)({},hl)]),children:"P\u0159idat video"}),(0,p.jsx)(T.$,{colorScheme:"blue",leftIcon:(0,p.jsx)(q.Bc_,{}),onClick:async()=>{i(!0);try{const e=o.filter(e=>e.url&&e.url.trim().length>0);await I({videos_items:e,videos_module_enabled:c}),u({status:"success",title:"Ulo\u017eeno",description:"Seznam vide\xed byl ulo\u017een."})}catch(e){u({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit nastaven\xed."})}finally{i(!1)}},isLoading:n,children:"Ulo\u017eit"})]}),(0,p.jsx)(G.c,{my:3}),e?(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"}):"auto"===s?(0,p.jsx)(U.E,{color:"gray.600",children:"Automatick\xfd zdroj vide\xed je aktivn\xed. Pro ru\u010dn\xed spr\xe1vu p\u0159epn\u011bte zdroj na \u201eRu\u010dn\u011b\u201c."}):(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[o.map((e,t)=>(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,children:[(0,p.jsx)(ee.z,{justify:"space-between",children:(0,p.jsxs)(z.D,{size:"sm",children:["Video #",t+1]})}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:3,mt:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL videa"}),(0,p.jsx)(C.p,{value:e.url,onChange:e=>J(t,"url",e.target.value),placeholder:"https://www.youtube.com/watch?v=..."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Thumbnail (voliteln\xe9)"}),(0,p.jsx)(C.p,{value:e.thumbnail_url||"",onChange:e=>J(t,"thumbnail_url",e.target.value),placeholder:"https://example.com/thumb.jpg"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1zev (voliteln\xe9)"}),(0,p.jsx)(C.p,{value:e.title||"",onChange:e=>J(t,"title",e.target.value),placeholder:"Titulek videa"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"D\xe9lka (voliteln\xe9)"}),(0,p.jsx)(C.p,{value:e.length||"",onChange:e=>J(t,"length",e.target.value),placeholder:"3:45"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Datum nahr\xe1n\xed (voliteln\xe9)"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"date",value:(e.uploaded_at||"").slice(0,10),onChange:e=>J(t,"uploaded_at",e.target.value)}),(0,p.jsx)(te.m,{label:"Dnes",children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>Y(t,0),children:"Dnes"})}),(0,p.jsx)(te.m,{label:"V\u010dera",children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>Y(t,1),children:"V\u010dera"})}),(0,p.jsx)(te.m,{label:"P\u0159ed t\xfddnem",children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>Y(t,7),children:"\u22127 dn\xed"})}),(0,p.jsx)(te.m,{label:"Vymazat datum",children:(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>J(t,"uploaded_at",""),children:"Vymazat"})})]})]})]}),(0,p.jsx)(ee.z,{justify:"flex-end",mt:2,children:(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),onClick:()=>(e=>r(t=>t.filter((t,n)=>n!==e)))(t),variant:"outline",colorScheme:"red"})})]},t)),0===o.length&&(0,p.jsx)(U.E,{color:"gray.600",children:"Zat\xedm \u017e\xe1dn\xe1 videa. Pou\u017eijte tla\u010d\xedtko \u201eP\u0159idat video\u201c."})]})]})})};var ml=n(516);const pl=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_API_BASE_URL||"/api/v1");return new URL(e,"".concat(t.protocol,"//").concat(t.host)).toString()}return e}catch(t){return e}},xl=()=>{const e=(0,b.dU)("white","gray.800"),[t,n]=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("gray.600","gray.400"),(0,a.useState)([])),[i,o]=(0,a.useState)(!0),[r,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)(""),d=(0,j.d)(),h=async()=>{o(!0),c("");try{const[e,t]=await Promise.allSettled([fetch(pl("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(pl("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let a=[];if("fulfilled"===e.status&&e.value.ok){const t=await e.value.json();t.albums&&Array.isArray(t.albums)&&(a=[...t.albums])}if("fulfilled"===t.status&&t.value.ok){const e=await t.value.json(),n=(Array.isArray(e)?e:[]).filter(e=>e.id&&e.title&&!a.some(t=>t.id===e.id));a=[...a,...n]}n(a)}catch(e){c(e.message||"Nepoda\u0159ilo se na\u010d\xedst alba")}finally{o(!1)}},u=async()=>{s(!0);try{await m.Ay.post("/admin/gallery/refresh"),d({title:"Galerie obnovena",description:"Data z Zonerama byla \xfasp\u011b\u0161n\u011b na\u010dtena",status:"success",duration:3e3,isClosable:!0}),await h()}catch(n){var e,t;const a=(null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||n.message||"Nepoda\u0159ilo se obnovit galerii";d({title:"Chyba p\u0159i obnov\u011b galerie",description:a,status:"error",duration:5e3,isClosable:!0}),console.error("Gallery refresh error:",n)}finally{s(!1)}};(0,a.useEffect)(()=>{h()},[]);const x=t.reduce((e,t)=>e+t.photos_count,0),g=t.reduce((e,t)=>e+(t.views_count||0),0);return(0,p.jsx)(Mo,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",flexWrap:"wrap",children:[(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(z.D,{size:"xl",children:"Spr\xe1va galerie"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Spr\xe1va alb a fotografi\xed ze Zonerama"})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(ml.A,{size:18}),colorScheme:"blue",onClick:u,isLoading:r,loadingText:"Obnova...",children:"Obnovit z Zonerama"})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Zonerama integrace"}),(0,p.jsx)(_o.T,{children:'Alba jsou automaticky na\u010d\xedt\xe1na ze Zonerama profilu. Klikn\u011bte na "Obnovit z Zonerama" pro synchronizaci s nejnov\u011bj\u0161\xedmi daty.'})]})]}),!i&&!l&&t.length>0&&(0,p.jsxs)(ee.z,{spacing:4,flexWrap:"wrap",children:[(0,p.jsxs)(Qt.E,{colorScheme:"purple",fontSize:"md",p:3,borderRadius:"md",children:[t.length," alb"]}),(0,p.jsxs)(Qt.E,{colorScheme:"blue",fontSize:"md",p:3,borderRadius:"md",children:[x," fotografi\xed"]}),(0,p.jsxs)(Qt.E,{colorScheme:"green",fontSize:"md",p:3,borderRadius:"md",children:[g," zhl\xe9dnut\xed"]})]}),i&&(0,p.jsxs)(w.T,{spacing:4,py:12,children:[(0,p.jsx)(zn.y,{size:"xl",color:"brand.primary"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m alba..."})]}),l&&!i&&(0,p.jsxs)(xa.F,{status:"error",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(_o.T,{children:l})]}),!i&&!l&&0===t.length&&(0,p.jsx)(y.a,{bg:e,borderWidth:"1px",borderRadius:"lg",p:12,textAlign:"center",children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(Kn.A,{size:48,color:"gray"}),(0,p.jsx)(z.D,{size:"md",color:"gray.600",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 alba"}),(0,p.jsx)(U.E,{color:"gray.500",children:'Klikn\u011bte na tla\u010d\xedtko "Obnovit z Zonerama" pro na\u010dten\xed alb.'}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(ml.A,{size:18}),colorScheme:"blue",onClick:u,isLoading:r,children:"Obnovit z Zonerama"})]})}),!i&&!l&&t.length>0&&(0,p.jsx)(y.a,{bg:e,borderWidth:"1px",borderRadius:"lg",overflow:"hidden",boxShadow:"sm",children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{bg:(0,b.dU)("gray.50","gray.900"),children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{width:"100px",children:"N\xe1hled"}),(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{width:"120px",children:"Datum"}),(0,p.jsx)(Oi.Th,{width:"100px",isNumeric:!0,children:"Fotky"}),(0,p.jsx)(Oi.Th,{width:"120px",isNumeric:!0,children:"Zhl\xe9dnut\xed"}),(0,p.jsx)(Oi.Th,{width:"180px",children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:t.map(e=>{const t=e.photos&&e.photos.length>0?e.photos[0]:null;return(0,p.jsxs)(Fi.Tr,{_hover:{bg:"gray.50"},children:[(0,p.jsx)(Ki.Td,{children:t?(0,p.jsx)(k._,{src:t.image_1500,alt:e.title,boxSize:"60px",objectFit:"cover",borderRadius:"md"}):(0,p.jsx)(y.a,{boxSize:"60px",bg:"gray.200",borderRadius:"md",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(Kn.A,{size:24,color:"gray"})})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(U.E,{fontWeight:"600",color:"gray.800",noOfLines:2,children:e.title})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:1,fontSize:"sm",color:"gray.600",children:[(0,p.jsx)(qn.A,{size:14}),(0,p.jsx)(U.E,{children:e.date})]})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsx)(Qt.E,{colorScheme:"blue",children:e.photos_count})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsxs)(ee.z,{spacing:1,justify:"flex-end",children:[(0,p.jsx)(rn.A,{size:14}),(0,p.jsx)(U.E,{fontSize:"sm",children:e.views_count||0})]})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{as:L.N,href:"/galerie/album/".concat(e.id),target:"_blank",size:"sm",colorScheme:"purple",variant:"outline",children:"N\xe1hled"}),(0,p.jsx)(T.$,{as:L.N,href:e.url,target:"_blank",rel:"noopener noreferrer",size:"sm",colorScheme:"blue",variant:"ghost",rightIcon:(0,p.jsx)(ri.A,{size:14}),children:"Zonerama"})]})})]},e.id)})})]})})]})})})},gl=e=>{let{value:t,onChange:n,clubPrimaryColor:a,clubSecondaryColor:i,showPreview:o=!0}=e;const r=(0,b.dU)("gray.50","gray.700"),s=(0,b.dU)("blue.50","blue.900"),l=(0,b.dU)("blue.200","blue.700"),c=(0,b.dU)("gray.700","gray.300"),d=(0,b.dU)("gray.600","gray.400"),h=(0,b.dU)("white","gray.700"),u=di[t]||di.default;return(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Styl mapy"}),(0,p.jsx)(ha.l,{value:t,onChange:e=>n(e.target.value),bg:h,children:Object.entries({"Light & Minimal":["positron","positron-no-labels","default"],"Dark Themes":["dark","dark-no-labels"],"Black & White":["toner","toner-lite"],Colorful:["voyager","terrain","watercolor"],Satellite:["satellite"]}).map(e=>{let[t,n]=e;return(0,p.jsx)("optgroup",{label:t,children:n.map(e=>{const t=di[e];return(0,p.jsx)("option",{value:e,children:t.name},e)})},t)})})]}),o&&(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsx)(y.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:r,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:u.name}),(0,p.jsx)(Qt.E,{colorScheme:"blue",children:"N\xe1hled stylu"})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:d,children:u.description}),a&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",mb:2,children:"Barvy klubu:"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(y.a,{w:"40px",h:"40px",borderRadius:"md",bg:a,borderWidth:"1px",borderColor:"gray.300"}),i&&(0,p.jsx)(y.a,{w:"40px",h:"40px",borderRadius:"md",bg:i,borderWidth:"1px",borderColor:"gray.300"}),(0,p.jsx)(U.E,{fontSize:"xs",color:d,children:"Pou\u017eity pro marker a overlay"})]})]})]})}),(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",boxShadow:"sm",children:(0,p.jsx)(hi,{latitude:50.0755,longitude:14.4378,zoom:13,address:"Praha, \u010cesk\xe1 republika",clubName:"N\xe1hled mapy",mapStyle:t,clubPrimaryColor:a,clubSecondaryColor:i,height:300})}),(0,p.jsx)(U.E,{fontSize:"xs",color:d,textAlign:"center",children:"N\xe1hled interaktivn\xed mapy se zvolen\xfdm stylem"})]}),(0,p.jsxs)(y.a,{p:3,bg:s,borderWidth:"1px",borderColor:l,borderRadius:"md",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",mb:1,children:"\ud83d\udca1 Tipy pro v\xfdb\u011br stylu:"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:2,children:[(0,p.jsxs)(U.E,{fontSize:"xs",color:c,children:["\u2022 ",(0,p.jsx)("strong",{children:"Positron/Toner Lite"})," - nejlep\u0161\xed pro barevn\xe9 markery"]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:c,children:["\u2022 ",(0,p.jsx)("strong",{children:"Dark Matter"})," - skv\u011bl\xe9 pro tmav\xfd design"]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:c,children:["\u2022 ",(0,p.jsx)("strong",{children:"Toner B&W"})," - vysok\xfd kontrast, elegantn\xed"]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:c,children:["\u2022 ",(0,p.jsx)("strong",{children:"Voyager"})," - vyv\xe1\u017een\u011b pro v\u0161echny p\u0159\xedpady"]})]})]}),(0,p.jsxs)(U.E,{fontSize:"xs",color:d,children:["V\u0161echny mapy jsou open-source a bezplatn\xe9.",a&&" Mapa bude automaticky obarvena barvami klubu."]})]})};function vl(e){if(!e||"string"!==typeof e)return null;let t=e.trim();t.startsWith("http://")||t.startsWith("https://")||(t="https://"+t);const n=function(e){try{const t=new URL(e);if(!t.hostname.includes("mapy.cz")&&!t.hostname.includes("mapy.com"))return null;const n=t.searchParams,a=n.get("x"),i=n.get("y"),o=n.get("z"),r=n.get("q");if(a&&i){const e=parseFloat(a),t=parseFloat(i),n=o?parseInt(o):void 0;return isNaN(t)||isNaN(e)?null:{latitude:t,longitude:e,zoom:n,address:r?decodeURIComponent(r):void 0,source:"mapy.cz"}}return null}catch(t){return console.error("Error parsing mapy.cz URL:",t),null}}(t);if(n)return n;const a=function(e){try{const t=new URL(e);if(!t.hostname.includes("google.com")&&!t.hostname.includes("google.cz"))return null;const n=t.pathname.match(/@(-?\d+\.\d+),(-?\d+\.\d+),(\d+)z/);if(n){const e=parseFloat(n[1]),a=parseFloat(n[2]),i=parseInt(n[3]);if(!isNaN(e)&&!isNaN(a)){const n=t.pathname.match(/\/place\/([^/]+)/),o=n?decodeURIComponent(n[1].replace(/\+/g," ")):void 0;return{latitude:e,longitude:a,zoom:isNaN(i)?void 0:i,address:o,source:"google-maps"}}}const a=t.searchParams.get("q");if(a){const e=a.match(/(-?\d+\.\d+),(-?\d+\.\d+)/);if(e){const t=parseFloat(e[1]),n=parseFloat(e[2]);if(!isNaN(t)&&!isNaN(n))return{latitude:t,longitude:n,address:a.includes(",")?void 0:a,source:"google-maps"}}}const i=t.pathname.match(/!3d(-?\d+\.\d+)!4d(-?\d+\.\d+)/);if(i){const e=parseFloat(i[1]),t=parseFloat(i[2]);if(!isNaN(e)&&!isNaN(t))return{latitude:e,longitude:t,source:"google-maps"}}return null}catch(t){return console.error("Error parsing Google Maps URL:",t),null}}(t);return a||null}const jl=e=>{let{onImport:t,currentLatitude:n,currentLongitude:i,currentZoom:o,mapStyle:r,onMapStyleChange:s,clubPrimaryColor:l,clubSecondaryColor:c,clubName:d}=e;const[u,m]=(0,a.useState)(""),[x,g]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[f,k]=(0,a.useState)(null),z=((0,b.dU)("white","gray.800"),(0,b.dU)("gray.200","gray.700"));(0,a.useEffect)(()=>{n&&i&&k({latitude:n,longitude:i,zoom:o,source:"unknown"})},[n,i,o]);return(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(S.l,{display:"flex",alignItems:"center",gap:2,children:[(0,p.jsx)(q.HzC,{})," Importovat z URL mapy"]}),(0,p.jsx)(C.p,{placeholder:"Vlo\u017ete URL z mapy.cz nebo Google Maps...",value:u,onChange:async e=>{const t=e.target.value;if(m(t),j(null),g(null),!t.trim())return;const n=vl(t);if(n)if(a=n.latitude,i=n.longitude,!isNaN(a)&&!isNaN(i)&&a>=-90&&a<=90&&i>=-180&&i<=180)try{const e=await async function(e,t){try{const n=await fetch("https://nominatim.openstreetmap.org/reverse?format=json&lat=".concat(e,"&lon=").concat(t,"&addressdetails=1&accept-language=cs"),{headers:{"User-Agent":"FotbalClub/1.0"}});if(!n.ok)throw new Error("Reverse geocoding failed");const a=await n.json(),i=a.address||{};return{address:a.display_name,street:i.road||i.street||i.pedestrian||i.footway,houseNumber:i.house_number,city:i.city||i.town||i.village||i.municipality,zip:i.postcode,country:i.country||"\u010cesk\xe1 republika"}}catch(v){return console.error("Reverse geocoding error:",v),{}}}(n.latitude,n.longitude),t=(0,h.A)((0,h.A)({},n),e);g(t),k(t),j(null)}catch(o){g(n),k(n),j(null)}else j("Sou\u0159adnice jsou mimo platn\xfd rozsah"),g(null);else j("Nepoda\u0159ilo se rozpoznat URL mapy. Podporovan\xe9: mapy.cz, Google Maps"),g(null);var a,i},size:"md"}),(0,p.jsxs)(ee.z,{mt:2,spacing:3,fontSize:"sm",children:[(0,p.jsx)(U.E,{color:"gray.600",children:"Rychl\xe9 odkazy:"}),(0,p.jsxs)(L.N,{href:"https://mapy.com/cs/",isExternal:!0,color:"blue.500",display:"flex",alignItems:"center",gap:1,_hover:{color:"blue.600",textDecoration:"underline"},children:["Mapy.cz ",(0,p.jsx)(q.HaR,{size:12})]}),(0,p.jsx)(U.E,{color:"gray.400",children:"\u2022"}),(0,p.jsxs)(L.N,{href:"https://www.google.com/maps/",isExternal:!0,color:"blue.500",display:"flex",alignItems:"center",gap:1,_hover:{color:"blue.600",textDecoration:"underline"},children:["Google Maps ",(0,p.jsx)(q.HaR,{size:12})]})]})]}),x&&(0,p.jsxs)(xa.F,{status:"success",mt:3,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{flex:"1",children:[(0,p.jsx)(wo.X,{children:"\xdasp\u011b\u0161n\u011b rozpozn\xe1no!"}),(0,p.jsx)(_o.T,{display:"block",children:(0,p.jsxs)(w.T,{align:"start",spacing:1,mt:2,children:[(0,p.jsx)(ee.z,{children:(0,p.jsx)(Qt.E,{colorScheme:"green",children:"mapy.cz"===x.source?"Mapy.cz":"Google Maps"})}),(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"\u0160\xed\u0159ka:"})," ",x.latitude.toFixed(7)]}),(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"D\xe9lka:"})," ",x.longitude.toFixed(7)]}),x.zoom&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Zoom:"})," ",x.zoom]}),x.street&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Ulice:"})," ",x.street]}),x.city&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"M\u011bsto:"})," ",x.city]}),x.zip&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"PS\u010c:"})," ",x.zip]}),x.country&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Zem\u011b:"})," ",x.country]}),x.address&&(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Cel\xe1 adresa:"})," ",x.address]})]})})]}),(0,p.jsxs)(ee.z,{ml:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.YrT,{}),colorScheme:"green",size:"sm",onClick:()=>{x&&(t(x),m(""),g(null),j(null))},children:"Importovat"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.yGN,{}),variant:"ghost",size:"sm",onClick:()=>{m(""),g(null),j(null),k(n&&i?{latitude:n,longitude:i,zoom:o,source:"unknown"}:null)},children:"Zru\u0161it"})]})]}),v&&(0,p.jsxs)(xa.F,{status:"error",mt:3,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(_o.T,{children:v})]})]}),f&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"N\xe1hled mapy"}),(0,p.jsx)(y.a,{borderRadius:"md",overflow:"hidden",borderWidth:"1px",borderColor:z,children:(0,p.jsx)(hi,{latitude:f.latitude,longitude:f.longitude,zoom:f.zoom||15,address:f.address,clubName:d,mapStyle:r||"positron",clubPrimaryColor:l,clubSecondaryColor:c,height:300})}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Sou\u0159adnice: ",f.latitude.toFixed(6),", ",f.longitude.toFixed(6),f.zoom&&" | Zoom: ".concat(f.zoom)]})]}),s&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"Styl mapy"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:3,children:"Vyberte vzhled mapy, kter\xfd se zobraz\xed na va\u0161em webu."}),(0,p.jsx)(gl,{value:r||"positron",onChange:s,clubPrimaryColor:l,clubSecondaryColor:c,showPreview:!1})]})]})]})]})},bl=[{value:"match",label:"Z\xe1pas"},{value:"training",label:"Tr\xe9nink"},{value:"meeting",label:"Sch\u016fzka"},{value:"other",label:"Jin\xe9"}],yl=()=>{var e,t,n,i;const o=(0,b.dU)("white","gray.800"),r=(0,b.dU)("gray.200","gray.700"),s=((0,b.dU)("white","gray.700"),(0,b.dU)("gray.600","gray.400")),c=(0,j.d)(),d=(0,l.jE)(),{isOpen:x,onOpen:g,onClose:v}=(0,X.j)(),[f,A]=(0,a.useState)(null),[E,N]=(0,a.useState)(!1),[P,I]=(0,a.useState)(""),[M,D]=(0,a.useState)(""),[L,F]=(0,a.useState)(!1),[O,Z]=(0,a.useState)("friendly"),[V,$]=(0,a.useState)(!0),[G,Q]=(0,a.useState)(void 0),[ne,ae]=(0,a.useState)(void 0),[ie,oe]=(0,a.useState)([]),[re,ce]=(0,a.useState)("club"),{saveStatus:de,lastSaved:he,forceSave:ue,clearDraft:me}=ds({data:f||{},storageKey:P,onSave:async e=>{var t;if(e.id)return await ht(e.id,e);if(null!==(t=e.title)&&void 0!==t&&t.trim()&&e.start_time){const t=await ct(e);return null!==t&&void 0!==t&&t.id&&A(e=>(0,h.A)((0,h.A)({},e),{},{id:t.id})),t}return{}},debounceMs:2e3,enabled:x&&null!==f}),{data:pe,isLoading:ge}=(0,xe.I)({queryKey:["admin-events"],queryFn:()=>dt()}),ve=pe||[],je=e=>{const t=String(e||"").trim(),n=bl.find(e=>e.value===t);return n?n.label:"Jin\xe9"};(0,a.useEffect)(()=>{(async()=>{try{const e=await bt();null!==e&&void 0!==e&&e.videos&&oe(e.videos.slice(0,20))}catch(e){console.error("Failed to load YouTube videos:",e)}})()},[]);const be=(0,xe.I)({queryKey:["public-settings"],queryFn:R,staleTime:3e5}),ye=()=>{A(null),Q(void 0),ae(void 0),v()},fe=(0,Mn.n)({mutationFn:e=>ct(e),onSuccess:()=>{c({title:"Ud\xe1lost vytvo\u0159ena",status:"success"}),d.invalidateQueries({queryKey:["admin-events"]}),ye()},onError:e=>c({title:"Chyba p\u0159i vytv\xe1\u0159en\xed",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),ke=(0,Mn.n)({mutationFn:e=>{let{id:t,payload:n}=e;return ht(t,n)},onSuccess:()=>{c({title:"Ud\xe1lost upravena",status:"success"}),d.invalidateQueries({queryKey:["admin-events"]}),ye()},onError:e=>c({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),ze=(0,Mn.n)({mutationFn:e=>(async e=>{const t=(0,u.gf)();return(await m.FH.delete("/events/".concat(e),{headers:t?{Authorization:"Bearer ".concat(t)}:void 0})).data})(e),onSuccess:()=>{c({title:"Smaz\xe1no",status:"success"}),d.invalidateQueries({queryKey:["admin-events"]})},onError:e=>c({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),[we,_e]=(0,a.useState)([]),[Ce,Ae]=(0,a.useState)({});(0,a.useEffect)(()=>{(async()=>{try{const n=await R(),a=(null===n||void 0===n?void 0:n.club_id)||"",i=(null===n||void 0===n?void 0:n.club_type)||"football",o=[];if(a)try{const e=await Se.getClub(String(a),i);(Array.isArray(null===e||void 0===e?void 0:e.competitions)?e.competitions:[]).forEach(e=>o.push({code:e.code,name:e.name||e.code}))}catch(e){}let r={};try{(await $n()).forEach(e=>{e.code&&e.alias&&(r[e.code]=e.alias)})}catch(t){}const s=o.map(e=>({code:e.code,name:e.code&&r[e.code]?r[e.code]:e.name}));Ae(r),_e(s)}catch(n){}})()},[]);const[Ee,Te]=(0,a.useState)(""),[Ne,Re]=(0,a.useState)(""),[Pe,Ie]=(0,a.useState)(""),[We,Me]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=null!==f&&void 0!==f&&f.start_time?new Date(f.start_time):null;if(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0");Te("".concat(t,"-").concat(n,"-").concat(a)),Re("".concat(i,":").concat(o))}else Te(""),Re("");const t=null!==f&&void 0!==f&&f.end_time?new Date(f.end_time):null;if(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");Ie("".concat(e,"-").concat(n,"-").concat(a)),Me("".concat(i,":").concat(o))}else Ie(""),Me("")},[null===f||void 0===f?void 0:f.start_time,null===f||void 0===f?void 0:f.end_time]);const De=(e,t)=>{if(!e||!t)return null;const n=new Date("".concat(e,"T").concat(t,":00"));return isNaN(n.getTime())?null:n.toISOString()},Ue=!String((null===f||void 0===f?void 0:f.title)||"").trim(),Le=!Ee||!Ne;return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"Aktivity (Ud\xe1losti)"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>{const e="draft-activity-new";I(e);const t=us(e);t&&t.age<1440?N(!0):(A({title:"",description:"",type:"other",is_public:!0}),Q(void 0),ae(void 0),g())},children:"Nov\xe1 aktivita"})]}),(0,p.jsx)(y.a,{bg:o,borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"N\xe1hled"}),(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"Typ"}),(0,p.jsx)(Oi.Th,{children:"Za\u010d\xe1tek"}),(0,p.jsx)(Oi.Th,{children:"Konec"}),(0,p.jsx)(Oi.Th,{children:"M\xedsto"}),(0,p.jsx)(Oi.Th,{children:"Ve\u0159ejn\xe1"}),(0,p.jsx)(Oi.Th,{w:"140px",children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[ge&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:8,children:"Na\u010d\xedt\xe1n\xed\u2026"})}),!ge&&ve.map(e=>{var t;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.image_url?(0,p.jsx)(ss,{src:W(e.image_url)||e.image_url,alt:e.title,size:"48px",previewSize:"350px"}):(0,p.jsx)(k._,{src:(null===(t=be.data)||void 0===t?void 0:t.club_logo_url)||"/dist/img/logo-club-empty.svg",alt:"No image",boxSize:"48px",objectFit:"contain",opacity:.3})}),(0,p.jsx)(Ki.Td,{children:e.title}),(0,p.jsx)(Ki.Td,{children:je(e.type)}),(0,p.jsx)(Ki.Td,{children:new Date(e.start_time).toLocaleString()}),(0,p.jsx)(Ki.Td,{children:e.end_time?new Date(e.end_time).toLocaleString():"-"}),(0,p.jsx)(Ki.Td,{children:e.location||"-"}),(0,p.jsx)(Ki.Td,{children:e.is_public?"Ano":"Ne"}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",size:"sm",icon:(0,p.jsx)(q.WXf,{}),onClick:()=>(e=>{const t="draft-activity-".concat(e.id);I(t),A((0,h.A)({},e)),e.latitude&&e.longitude?(Q(e.latitude),ae(e.longitude)):(Q(void 0),ae(void 0)),g()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,p.jsx)(q.IXo,{}),onClick:()=>ze.mutate(e.id)}),(0,p.jsx)(K.K,{"aria-label":"Zkr\xe1tit odkaz",size:"sm",icon:(0,p.jsx)(q.ayE,{}),title:"Zkr\xe1tit odkaz pro sd\xedlen\xed",onClick:async()=>{try{const t=window.location.origin,n="".concat(t,"/aktivita/").concat(e.id),a=await ms({target_url:n,title:e.title,source_type:"event",source_id:e.id});await navigator.clipboard.writeText(a.short_url),c({title:"Zkr\xe1cen\xfd odkaz zkop\xedrov\xe1n",description:a.short_url,status:"success",duration:4e3})}catch(t){c({title:"Vytvo\u0159en\xed odkazu selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}}})]})})]},e.id)})]})]})}),(0,p.jsxs)(se.aF,{isOpen:x,onClose:ye,isCentered:!0,scrollBehavior:"inside",children:[(0,p.jsx)(H.m,{backdropFilter:"blur(3px)"}),(0,p.jsxs)(le.$,{maxW:{base:"96vw",md:"920px"},maxH:{base:"90vh",md:"86vh"},borderRadius:"2xl",overflow:"hidden",boxShadow:"2xl",children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",w:"full",pr:8,children:[(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsx)(z.D,{size:"md",children:null!==f&&void 0!==f&&f.id?"Upravit aktivitu":"Nov\xe1 aktivita"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Pl\xe1nujte klubov\xe9 akce, sd\xedlejte s fanou\u0161ky a t\xfdmem."})]}),(0,p.jsx)(ls,{status:de,lastSaved:he,compact:!0})]})}),(0,p.jsx)(B.s,{}),(0,p.jsxs)(Y.c,{overflowY:"auto",maxH:{base:"76vh",md:"70vh"},children:[(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,mb:5,bg:(0,b.dU)("gray.50","gray.900"),children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",mb:2,children:[(0,p.jsx)(z.D,{size:"sm",children:"AI generov\xe1n\xed"}),(0,p.jsx)(Qt.E,{colorScheme:"purple",variant:"subtle",children:"Beta"})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:2,children:"Zadejte instrukce pro AI nebo klikn\u011bte na p\u0159edlohy n\xed\u017ee. AI m\u016f\u017ee vytvo\u0159it nebo doplnit titulek a popis ud\xe1losti."}),(0,p.jsx)(va.T,{placeholder:"Nap\u0159.: Tr\xe9nink A-t\xfdmu, h\u0159i\u0161t\u011b TJ Dvorce, 18:00\u201319:30, pro v\u0161echny hr\xe1\u010de.",value:M,onChange:e=>D(e.target.value),rows:3,bg:o}),(0,p.jsx)(Et.B,{spacing:2,mt:2,children:["Pozv\xe1nka na tr\xe9nink se zam\u011b\u0159en\xedm na kondici","Ozn\xe1men\xed p\u0159\xe1telsk\xe9ho z\xe1pasu pro fanou\u0161ky","Rodi\u010dovsk\xe1 sch\u016fzka ml\xe1de\u017ee \u2013 stru\u010dn\xfd program"].map((e,t)=>(0,p.jsx)(Et.Q,{children:(0,p.jsx)(ni.vw,{size:"sm",variant:"subtle",colorScheme:"blue",_hover:{cursor:"pointer",opacity:.9},onClick:()=>D(e),children:(0,p.jsx)(ni.d1,{children:e})})},t))}),(0,p.jsxs)(ee.z,{mt:3,spacing:3,align:"center",children:[(0,p.jsxs)(_.MJ,{maxW:"220px",children:[(0,p.jsx)(S.l,{mb:1,children:"T\xf3n"}),(0,p.jsxs)(ha.l,{size:"sm",value:O,onChange:e=>Z(e.target.value),children:[(0,p.jsx)("option",{value:"friendly",children:"P\u0159\xe1telsk\xfd"}),(0,p.jsx)("option",{value:"informative",children:"Informa\u010dn\xed"}),(0,p.jsx)("option",{value:"formal",children:"Form\xe1ln\xed"})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"P\u0159epsat existuj\xedc\xed obsah"}),(0,p.jsx)(pa.d,{isChecked:V,onChange:e=>$(e.target.checked)})]}),(0,p.jsx)(te.m,{label:"AI dopln\xed titul a popis podle zadan\xfdch informac\xed.",hasArrow:!0,children:(0,p.jsx)(T.$,{onClick:async()=>{try{var e,t,n;F(!0);const a=f||{},i=[],r=String((null===be||void 0===be||null===(e=be.data)||void 0===e?void 0:e.club_name)||"").trim();r&&i.push("Klub: ".concat(r)),a.type&&i.push("Typ: ".concat(a.type)),a.description&&i.push("Pozn\xe1mky: ".concat(a.description));const s=i.join("\n"),l="informative"===O?"informativn\xedm a v\u011bcn\xfdm stylem":"formal"===O?"form\xe1ln\xedm a profesion\xe1ln\xedm stylem":"p\u0159\xe1telsk\xfdm, pozitivn\xedm a l\xe1kav\xfdm stylem",d=(M||"Vytvo\u0159 kr\xe1tk\xe9 ozn\xe1men\xed pro fanou\u0161ky o klubov\xe9 aktivit\u011b.").trim(),u="Nevkl\xe1dej datum ani m\xedsto (lokalitu) do textu. Neuv\xe1d\u011bj konkr\xe9tn\xed \u010das nebo adresu.",p="".concat(d,"\n\nPi\u0161 ").concat(l,", \u010desky, s d\u016frazem na jasnost a pozv\xe1nku k \xfa\u010dasti. ").concat(u,"\nDetaily:\n").concat(s).trim(),{data:x}=await m.FH.post("/ai/blog/generate",{prompt:p,audience:r?"Fanou\u0161ci klubu ".concat(r,", ozn\xe1men\xed/pozv\xe1nka"):"Fanou\u0161ci klubu, ozn\xe1men\xed/pozv\xe1nka",min_words:120});let g=x;if("string"===typeof x)try{g=JSON.parse(x)}catch(o){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}const v=String((null===(t=g)||void 0===t?void 0:t.title)||"").trim(),j=String((null===(n=g)||void 0===n?void 0:n.html)||"").trim();if(!v&&!j)throw new Error("AI nevr\xe1tila obsah");A(e=>(0,h.A)((0,h.A)({},e||{}),{},{title:V?v||(null===e||void 0===e?void 0:e.title)||"":(null===e||void 0===e?void 0:e.title)||v||"",description:V?j||(null===e||void 0===e?void 0:e.description)||"":"".concat((null===e||void 0===e?void 0:e.description)||"").concat(null!==e&&void 0!==e&&e.description?"\n\n":"").concat(j)})),c({title:"Vygenerov\xe1no pomoc\xed AI",status:"success",duration:3e3})}catch(r){var a,i;console.error("AI generation error:",r),c({title:"AI generov\xe1n\xed selhalo",description:(null===r||void 0===r||null===(a=r.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===r||void 0===r?void 0:r.message)||"Zkuste doplnit v\xedce detail\u016f a opakovat.",status:"error",duration:5e3})}finally{F(!1)}},isLoading:L,leftIcon:(0,p.jsx)(q.GGD,{}),bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"AI text"})})]})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,mb:3,children:[(0,p.jsx)(S.l,{children:"N\xe1zev"}),(0,p.jsx)(C.p,{value:(null===f||void 0===f?void 0:f.title)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{title:e.target.value}))}),Ue&&(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.500",mt:1,children:"Vypl\u0148te n\xe1zev aktivity."})]}),(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"Popis (Rich Text Editor)"}),(0,p.jsx)(Jr,{value:(null===f||void 0===f?void 0:f.description)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{description:e})),height:"300px",toolbar:"full",showImageResize:!0,placeholder:"Zadejte popis ud\xe1losti..."})]}),(0,p.jsxs)(y.a,{mb:3,children:[(0,p.jsx)(S.l,{children:"YouTube Video (voliteln\xe9)"}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:(0,b.dU)("gray.50","gray.900"),children:[(0,p.jsxs)(ee.z,{mb:3,spacing:2,children:[(0,p.jsxs)(T.$,{size:"sm",leftIcon:(0,p.jsx)(q.blI,{}),onClick:()=>ce("club"),variant:"club"===re?"solid":"outline",colorScheme:"club"===re?"red":"gray",children:["Z kan\xe1lu klubu (",ie.length,")"]}),(0,p.jsx)(T.$,{size:"sm",leftIcon:(0,p.jsx)(q.ayE,{}),onClick:()=>ce("custom"),variant:"custom"===re?"solid":"outline",colorScheme:"custom"===re?"blue":"gray",children:"Vlastn\xed odkaz"})]}),"club"===re&&(0,p.jsx)(y.a,{children:0===ie.length?(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"\u017d\xe1dn\xe1 videa z kan\xe1lu klubu. Nastavte YouTube kan\xe1l v Nastaven\xed."}):(0,p.jsx)(w.T,{align:"stretch",spacing:2,maxH:"300px",overflowY:"auto",children:ie.map(e=>{var t;const n="https://www.youtube.com/watch?v=".concat(e.video_id),a=null===f||void 0===f||null===(t=f.youtube_url)||void 0===t?void 0:t.includes(e.video_id);return(0,p.jsxs)(ee.z,{p:2,borderWidth:"1px",borderRadius:"md",borderColor:a?"red.500":r,bg:a?(0,b.dU)("red.50","red.900"):o,cursor:"pointer",_hover:{borderColor:"red.300",bg:(0,b.dU)("red.50","red.900")},onClick:()=>{A(e=>(0,h.A)((0,h.A)({},e||{}),{},{youtube_url:n})),c({title:"Video vybr\xe1no",description:e.title,status:"success",duration:2e3})},children:[(0,p.jsx)(k._,{src:e.thumbnail_url,alt:e.title,boxSize:"60px",objectFit:"cover",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"start",flex:1,spacing:0,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",noOfLines:2,children:e.title}),(0,p.jsxs)(ee.z,{fontSize:"xs",color:"gray.500",children:[e.published_text&&(0,p.jsx)(U.E,{children:e.published_text}),e.views_text&&(0,p.jsxs)(U.E,{children:["\u2022 ",e.views_text]})]})]}),a&&(0,p.jsx)(Qt.E,{colorScheme:"red",children:"Vybr\xe1no"})]},e.video_id)})})}),"custom"===re&&(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(C.p,{value:(null===f||void 0===f?void 0:f.youtube_url)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{youtube_url:e.target.value})),placeholder:"https://www.youtube.com/watch?v=... nebo https://youtu.be/..."}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Vlo\u017ete odkaz na jak\xe9koliv YouTube video (nemus\xed b\xfdt z va\u0161eho kan\xe1lu)."})]}),(null===f||void 0===f?void 0:f.youtube_url)&&(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"xs",children:"Video nastaveno"}),(0,p.jsx)(T.$,{size:"xs",variant:"ghost",colorScheme:"red",onClick:()=>A(e=>(0,h.A)((0,h.A)({},e||{}),{},{youtube_url:""})),children:"Zru\u0161it video"})]})]})]}),(0,p.jsxs)(y.a,{mt:3,children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,children:"Datum a \u010das"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:3,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Za\u010d\xe1tek"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"date",value:Ee,onChange:e=>{const t=e.target.value;Te(t);const n=De(t,Ne);A(e=>(0,h.A)((0,h.A)({},e||{}),{},{start_time:n||(null===e||void 0===e?void 0:e.start_time)}))}}),(0,p.jsx)(C.p,{type:"time",step:"900",value:Ne,onChange:e=>{const t=e.target.value;Re(t);const n=De(Ee,t);A(e=>{const t=n,a=null!==e&&void 0!==e&&e.end_time?new Date(e.end_time):null;let i=null===e||void 0===e?void 0:e.end_time;return a&&t&&a.getTime()<new Date(t).getTime()&&(i=new Date(new Date(t).getTime()+36e5).toISOString()),(0,h.A)((0,h.A)({},e||{}),{},{start_time:t,end_time:i})})}})]}),Le&&(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.500",mt:1,children:"Vypl\u0148te datum i \u010das za\u010d\xe1tku."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Konec (voliteln\xe9)"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{type:"date",value:Pe,onChange:e=>{const t=e.target.value;Ie(t);const n=We?De(t,We):null;A(e=>(0,h.A)((0,h.A)({},e||{}),{},{end_time:n}))}}),(0,p.jsx)(C.p,{type:"time",step:"900",value:We,onChange:e=>{const t=e.target.value;Me(t);const n=Pe?De(Pe,t):null;A(e=>(0,h.A)((0,h.A)({},e||{}),{},{end_time:n}))}})]}),(0,p.jsxs)(ee.z,{mt:2,children:[(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+36e5).toISOString();return(0,h.A)((0,h.A)({},e||{}),{},{end_time:n})}),children:"+60m"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+54e5).toISOString();return(0,h.A)((0,h.A)({},e||{}),{},{end_time:n})}),children:"+90m"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+72e5).toISOString();return(0,h.A)((0,h.A)({},e||{}),{},{end_time:n})}),children:"+120m"}),(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>{Ie(""),Me(""),A(e=>(0,h.A)((0,h.A)({},e||{}),{},{end_time:null}))},children:"Zru\u0161it"})]})]})]}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{const t=new Date,n=t.getMinutes(),a=new Date(t.getTime()+(15-n%15)%15*6e4),i=a.getFullYear(),o=String(a.getMonth()+1).padStart(2,"0"),r=String(a.getDate()).padStart(2,"0"),s=String(a.getHours()).padStart(2,"0"),l=String(a.getMinutes()).padStart(2,"0");return Te("".concat(i,"-").concat(o,"-").concat(r)),Re("".concat(s,":").concat(l)),(0,h.A)((0,h.A)({},e||{}),{},{start_time:a.toISOString()})}),children:"Nyn\xed (zaokrouhlit 15m)"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{const t=new Date;t.setHours(18,0,0,0);const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return Te("".concat(n,"-").concat(a,"-").concat(i)),Re("18:00"),(0,h.A)((0,h.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Dnes 18:00"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{const t=new Date;t.setDate(t.getDate()+1),t.setHours(18,0,0,0);const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return Te("".concat(n,"-").concat(a,"-").concat(i)),Re("18:00"),(0,h.A)((0,h.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Z\xedtra 18:00"}),(0,p.jsx)(te.m,{label:"Rychl\xe9 nastaven\xed z\xedt\u0159ej\u0161\xedho r\xe1na",hasArrow:!0,children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>A(e=>{const t=new Date;t.setDate(t.getDate()+1),t.setHours(9,0,0,0);const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return Te("".concat(n,"-").concat(a,"-").concat(i)),Re("09:00"),(0,h.A)((0,h.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Z\xedtra 9:00"})})]}),(0,p.jsxs)(U.E,{mt:2,fontSize:"xs",color:"gray.500",children:["\u010casov\xe1 z\xf3na: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),(0,p.jsxs)(y.a,{mt:4,children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"M\xedsto kon\xe1n\xed"}),(0,p.jsxs)(y.a,{bg:(0,b.dU)("gray.50","gray.900"),p:4,borderRadius:"md",borderWidth:"1px",mb:3,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"Importovat z odkazu na mapu"}),(0,p.jsx)(jl,{currentLatitude:G,currentLongitude:ne,mapStyle:(null===(e=be.data)||void 0===e?void 0:e.map_style)||"positron",clubPrimaryColor:null===(t=be.data)||void 0===t?void 0:t.primary_color,clubSecondaryColor:null===(n=be.data)||void 0===n?void 0:n.accent_color,clubName:(null===f||void 0===f?void 0:f.title)||(null===f||void 0===f?void 0:f.location)||"M\xedsto ud\xe1losti",onImport:e=>{Q(e.latitude),ae(e.longitude);let t="";if(e.address)t=e.address;else{const n=[];e.street&&n.push(e.street),e.city&&n.push(e.city),e.zip&&n.push(e.zip),t=n.join(", ")}A(n=>(0,h.A)((0,h.A)({},n||{}),{},{latitude:e.latitude,longitude:e.longitude,location:t||(null===n||void 0===n?void 0:n.location)||""})),c({title:"M\xedsto importov\xe1no",description:t||"Lat: ".concat(e.latitude.toFixed(6),", Lng: ").concat(e.longitude.toFixed(6)),status:"success",duration:3e3})}})]}),(0,p.jsxs)(ee.z,{spacing:3,align:"start",mt:3,children:[(0,p.jsxs)(_.MJ,{flex:2,children:[(0,p.jsx)(S.l,{children:"N\xe1zev m\xedsta / Adresa"}),(0,p.jsx)(C.p,{value:(null===f||void 0===f?void 0:f.location)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{location:e.target.value})),placeholder:"nap\u0159. Sportovn\xed hala TJ Sokol"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Zobraz\xed se n\xe1v\u0161t\u011bvn\xedk\u016fm (s mo\u017enou mapou)"})]}),(0,p.jsxs)(_.MJ,{flex:1,children:[(0,p.jsx)(S.l,{children:"Typ"}),(0,p.jsx)(ha.l,{value:(null===f||void 0===f?void 0:f.type)||"other",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{type:e.target.value})),children:bl.map(e=>(0,p.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),(0,p.jsxs)(_.MJ,{mt:3,children:[(0,p.jsx)(S.l,{children:"Kategorie (sout\u011b\u017e)"}),(0,p.jsx)(ha.l,{placeholder:"Vyberte kategorii (voliteln\xe9)",value:(null===f||void 0===f?void 0:f.category_name)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{category_name:e.target.value})),children:we.map((e,t)=>(0,p.jsx)("option",{value:e.code&&Ce[e.code]?Ce[e.code]:e.name,children:e.code&&Ce[e.code]?Ce[e.code]:e.name},(e.code||e.name)+"_"+t))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",mt:3,children:[(0,p.jsx)(S.l,{mb:"0",children:"Ve\u0159ejn\xe1"}),(0,p.jsx)(pa.d,{isChecked:!(null===f||void 0===f||!f.is_public),onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{is_public:e.target.checked}))})]}),(0,p.jsxs)(ee.z,{mt:4,align:"flex-start",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Obr\xe1zek (n\xe1hled)"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(C.p,{value:(null===f||void 0===f?void 0:f.image_url)||"",onChange:e=>A(t=>(0,h.A)((0,h.A)({},t||{}),{},{image_url:e.target.value})),placeholder:"/uploads/...jpg"}),(0,p.jsxs)(T.$,{as:"label",variant:"outline",children:["Nahr\xe1t",(0,p.jsx)("input",{type:"file",accept:"image/*",style:{display:"none"},onChange:async e=>{var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return;const a=await jt(n);A(e=>(0,h.A)((0,h.A)({},e||{}),{},{image_url:a.url}))}})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"P\u0159\xedlohy (v\xedce soubor\u016f)"}),(0,p.jsx)(U.E,{fontSize:"xs",color:s,mb:2,children:"Podporovan\xe9 form\xe1ty: PDF, Word (.doc, .docx), Excel (.xls, .xlsx), PowerPoint (.ppt, .pptx), Obr\xe1zky (.jpg, .png, .gif, .webp), Text (.txt), ZIP, RAR"}),(0,p.jsx)(ee.z,{children:(0,p.jsxs)(T.$,{as:"label",variant:"outline",children:["Nahr\xe1t",(0,p.jsx)("input",{type:"file",multiple:!0,accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.webp,.txt,.zip,.rar",style:{display:"none"},onChange:async e=>{const t=Array.from(e.target.files||[]),n=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/jpeg","image/png","image/gif","image/webp","text/plain","application/zip","application/x-zip-compressed","application/x-rar-compressed","application/vnd.rar"];for(const i of t)if(n.includes(i.type)||i.name.match(/\.(pdf|docx?|xlsx?|pptx?|jpe?g|png|gif|webp|txt|zip|rar)$/i))try{const e=await jt(i);A(t=>(0,h.A)((0,h.A)({},t||{}),{},{attachments:[...(null===t||void 0===t?void 0:t.attachments)||[],{name:i.name,url:e.url,mime_type:i.type,size:i.size}]}))}catch(a){c({title:"Chyba p\u0159i nahr\xe1v\xe1n\xed",description:'Soubor "'.concat(i.name,'": ').concat((null===a||void 0===a?void 0:a.message)||"Nezn\xe1m\xe1 chyba"),status:"error",duration:4e3})}else c({title:"Nepodporovan\xfd form\xe1t souboru",description:'Soubor "'.concat(i.name,'" nelze nahr\xe1t.'),status:"warning",duration:4e3})}})]})}),(0,p.jsx)(y.a,{mt:2,children:Array.isArray(null===f||void 0===f?void 0:f.attachments)&&f.attachments.length>0?(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"Velikost"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:f.attachments.map((e,t)=>(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:3,p:2,children:(0,p.jsxs)(ee.z,{justify:"space-between",w:"full",children:[(0,p.jsx)(y.a,{flex:1,children:(0,p.jsx)(si,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size})}),(0,p.jsx)(T.$,{size:"xs",variant:"outline",colorScheme:"red",flexShrink:0,ml:2,onClick:()=>A(e=>(0,h.A)((0,h.A)({},e),{},{attachments:(e.attachments||[]).filter((e,n)=>n!==t)})),children:"Odebrat"})]})})},t))})]}):(0,p.jsx)(y.a,{color:"gray.500",children:"\u017d\xe1dn\xe9 p\u0159\xedlohy"})})]})]}),(0,p.jsxs)(y.a,{mt:6,pt:4,borderTopWidth:"1px",borderColor:r,children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"Anketa"}),null!==f&&void 0!==f&&f.id?(0,p.jsx)(ns,{eventId:f.id}):(0,p.jsx)(y.a,{bg:(0,b.dU)("blue.50","blue.900"),p:4,borderRadius:"md",borderWidth:"1px",borderColor:"blue.200",children:(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("blue.700","blue.200"),children:"\ud83d\udca1 Nejprve ulo\u017ete aktivitu, pot\xe9 budete moci vytvo\u0159it nebo p\u0159ipojit anketu p\u0159\xedmo zde."})})]})]}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{w:"100%",justify:"space-between",children:[(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Ukl\xe1d\xe1n\xedm souhlas\xedte s publikac\xed podle nastaven\xed \u201eVe\u0159ejn\xe1\u201c."}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:1,onClick:ye,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},onClick:async()=>{if(!f)return;if(Ue)return void c({title:"Zadejte n\xe1zev",status:"warning"});if(Le)return void c({title:"Vypl\u0148te datum a \u010das za\u010d\xe1tku",status:"warning"});const e=De(Ee,Ne),t=Pe&&We?De(Pe,We):null;if(t&&e&&new Date(t).getTime()<new Date(e).getTime())return void c({title:"Konec mus\xed b\xfdt po za\u010d\xe1tku",status:"warning"});let n=f.image_url;n||(n=await(async()=>{try{var e;const a=String((null===(e=be.data)||void 0===e?void 0:e.club_logo_url)||"/dist/img/logo-club-empty.svg"),i=document.createElement("canvas"),o=1200,r=630;i.width=o,i.height=r;const s=i.getContext("2d");if(!s)return;s.fillStyle="#ffffff",s.fillRect(0,0,o,r),s.strokeStyle="#000000",s.lineWidth=6,s.strokeRect(3,3,o-6,r-6);const l=new Image;l.crossOrigin="anonymous";const c=()=>new Promise((e,t)=>{l.onload=()=>e(l),l.onerror=t,l.src=a});try{await c()}catch(t){}const d=Math.round(.5*o),h=Math.round(.5*r),u=Math.round((o-d)/2),m=Math.round((r-h)/2);try{s.drawImage(l,u,m,d,h)}catch(n){}const p=await new Promise(e=>i.toBlob(t=>e(t),"image/jpeg",.92));if(!p)return;const x=new File([p],"activity-cover.jpg",{type:"image/jpeg"}),g=await jt(x);return(null===g||void 0===g?void 0:g.url)||void 0}catch(a){return}})(),n&&A(e=>(0,h.A)((0,h.A)({},e||{}),{},{image_url:n})));const a={title:(f.title||"").trim(),description:(f.description||"").trim(),start_time:e,end_time:t||null,location:(f.location||"").trim(),type:f.type||"other",is_public:!!f.is_public,image_url:n||void 0,file_url:f.file_url||void 0,category_name:(null===f||void 0===f?void 0:f.category_name)||void 0,attachments:Array.isArray(null===f||void 0===f?void 0:f.attachments)?f.attachments.map(e=>({name:e.name,url:e.url,mime_type:e.mime_type,size:e.size})):void 0,youtube_url:(null===f||void 0===f?void 0:f.youtube_url)||void 0,latitude:(null===f||void 0===f?void 0:f.latitude)||G||void 0,longitude:(null===f||void 0===f?void 0:f.longitude)||ne||void 0};f.id?await ke.mutateAsync({id:f.id,payload:a}):await fe.mutateAsync(a)},isLoading:fe.isLoading||ke.isLoading,children:"Ulo\u017eit"})]})]})})]})]}),(0,p.jsx)(cs,{isOpen:E,onClose:()=>N(!1),onRecover:()=>{const e=hs(P);e&&(A(e),null!==e&&void 0!==e&&e.latitude&&null!==e&&void 0!==e&&e.longitude&&(Q(e.latitude),ae(e.longitude)),g()),N(!1)},onDiscard:()=>{me(),A({title:"",description:"",type:"other",is_public:!0}),Q(void 0),ae(void 0),N(!1),g()},onDeleteOnly:()=>{me(),N(!1)},draftAge:(null===(i=us(P))||void 0===i?void 0:i.age)||null,entityType:"aktivitu"})]})})},fl={title:"",description:"",price:0,currency:"K\u010d",image_url:"",url:"",is_active:!0,display_order:0},kl=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)([]),s=(0,j.d)(),l=async()=>{try{const e=await(async()=>(await ve.A.get("".concat(m.API_URL,"/admin/clothing"),{withCredentials:!0})).data.data)();r(e)}catch(e){s({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst oble\u010den\xed."})}finally{t(!1)}};(0,a.useEffect)(()=>{l()},[]);const c=async e=>{const t=o[e];if(t.id)try{await(async e=>{await ve.A.delete("".concat(m.API_URL,"/admin/clothing/").concat(e),{withCredentials:!0})})(t.id),s({status:"success",title:"Smaz\xe1no",description:"Polo\u017eka byla smaz\xe1na."}),l()}catch(n){s({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se smazat polo\u017eku."})}else r(t=>t.filter((t,n)=>n!==e))},d=(e,t,n)=>{r(a=>a.map((a,i)=>i===e?(0,h.A)((0,h.A)({},a),{},{[t]:n}):a))},u=async e=>{const t=o[e];if(t.title&&t.image_url){i(!0);try{t.id?(await(async(e,t)=>(await ve.A.put("".concat(m.API_URL,"/admin/clothing/").concat(e),t,{withCredentials:!0})).data)(t.id,t),s({status:"success",title:"Ulo\u017eeno",description:"Polo\u017eka byla aktualizov\xe1na."})):(await(async e=>(await ve.A.post("".concat(m.API_URL,"/admin/clothing"),e,{withCredentials:!0})).data)(t),s({status:"success",title:"Ulo\u017eeno",description:"Polo\u017eka byla vytvo\u0159ena."}),l())}catch(n){s({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit polo\u017eku."})}finally{i(!1)}}else s({status:"warning",title:"Upozorn\u011bn\xed",description:"Vypl\u0148te alespo\u0148 n\xe1zev a obr\xe1zek."})};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"md",mb:2,children:"Oble\u010den\xed a Fan Shop"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:2,children:"Spravujte polo\u017eky oble\u010den\xed a merchandisingu. Na tituln\xed str\xe1nce se zobraz\xed 5 nejnov\u011bj\u0161\xedch polo\u017eek, v\u0161echny polo\u017eky jsou k dispozici na str\xe1nce /obleceni."}),(0,p.jsx)(y.a,{mb:4,p:3,bg:"blue.50",borderRadius:"md",borderLeft:"4px solid",borderColor:"blue.500",children:(0,p.jsxs)(U.E,{fontSize:"sm",color:"blue.800",children:["\ud83d\udca1 ",(0,p.jsx)("strong",{children:"Tip:"})," P\u0159idejte cenu pro lep\u0161\xed p\u0159ehlednost. Na ve\u0159ejn\xe9 str\xe1nce se zobraz\xed pouze aktivn\xed polo\u017eky."]})}),(0,p.jsx)(ee.z,{justify:"space-between",mb:3,children:(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),onClick:()=>{const e=(0,h.A)({},fl);r(t=>[...t,e])},children:"P\u0159idat polo\u017eku"})}),(0,p.jsx)(G.c,{my:3}),e?(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"}):(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[o.map((e,t)=>(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"white",children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,children:[(0,p.jsxs)(z.D,{size:"sm",children:[e.title||"Polo\u017eka #".concat(t+1),!e.is_active&&(0,p.jsx)(U.E,{as:"span",ml:2,fontSize:"xs",color:"gray.500",children:"(neaktivn\xed)"})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",leftIcon:(0,p.jsx)(q.Bc_,{}),onClick:()=>u(t),isLoading:n,children:"Ulo\u017eit"}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),onClick:()=>c(t),variant:"outline",colorScheme:"red",size:"sm"})]})]}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:3,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev"}),(0,p.jsx)(C.p,{value:e.title||"",onChange:e=>d(t,"title",e.target.value),placeholder:"nap\u0159. Dres dom\xe1c\xed 2024/25"})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Obr\xe1zek (URL)"}),(0,p.jsx)(C.p,{value:e.image_url||"",onChange:e=>d(t,"image_url",e.target.value),placeholder:"https://example.com/img.jpg"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Cena"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(ua.Q7,{value:e.price||0,onChange:(e,n)=>d(t,"price",n),min:0,precision:2,flex:1,children:(0,p.jsx)(ua.OO,{placeholder:"0.00"})}),(0,p.jsx)(C.p,{value:e.currency||"K\u010d",onChange:e=>d(t,"currency",e.target.value),placeholder:"K\u010d",width:"80px"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Odkaz (e\u2011shop)"}),(0,p.jsx)(C.p,{value:e.url||"",onChange:e=>d(t,"url",e.target.value),placeholder:"https://eshop.example.com/produkt"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Po\u0159ad\xed zobrazen\xed"}),(0,p.jsx)(ua.Q7,{value:e.display_order||0,onChange:(e,n)=>d(t,"display_order",n),min:0,children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:0,children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:!1!==e.is_active,onChange:e=>d(t,"is_active",e.target.checked)})]})]}),(0,p.jsxs)(_.MJ,{mt:3,children:[(0,p.jsx)(S.l,{children:"Popis"}),(0,p.jsx)(va.T,{value:e.description||"",onChange:e=>d(t,"description",e.target.value),placeholder:"Voliteln\xfd popis polo\u017eky",rows:2})]})]},t)),0===o.length&&(0,p.jsx)(U.E,{color:"gray.600",children:'Zat\xedm \u017e\xe1dn\xe9 polo\u017eky. Pou\u017eijte tla\u010d\xedtko \u201eP\u0159idat polo\u017eku".'})]})]})})},zl=()=>{const[e,t]=(0,a.useState)(""),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(!1),s=(0,j.d)();return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{maxW:"lg",children:[(0,p.jsx)(z.D,{size:"md",mb:4,children:"Odeslat reset hesla"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mb:3,children:"Tato akce ode\u0161le u\u017eivateli e-mail s odkazem pro nastaven\xed nov\xe9ho hesla. Pou\u017eije se speci\xe1ln\xed SMTP konfigurace ur\u010den\xe1 pouze pro reset."}),(0,p.jsxs)(w.T,{as:"form",onSubmit:async t=>{t.preventDefault(),i(!0);try{await m.Ay.post("/admin/users/send-reset",{email:e}),r(!0),s({status:"success",title:"Odesl\xe1no",description:"Pokud \xfa\u010det existuje, byl odesl\xe1n e-mail pro reset hesla."})}catch(o){var n,a;s({status:"error",title:"Chyba",description:(null===(n=o.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Nepoda\u0159ilo se odeslat e-mail."})}finally{i(!1)}},spacing:4,align:"stretch",children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Email u\u017eivatele"}),(0,p.jsx)(C.p,{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"uzivatel@example.com"})]}),(0,p.jsx)(T.$,{colorScheme:"blue",type:"submit",isLoading:n,children:"Odeslat e-mail"}),o&&(0,p.jsx)(U.E,{color:"green.600",children:"Pokud adresa existuje, e-mail s odkazem byl odesl\xe1n."})]})]})})},wl=()=>{var e,t;const n=(0,j.d)(),[i,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(""),[x,g]=(0,a.useState)("Fanou\u0161ci klubu"),[v,b]=(0,a.useState)({title:"",subtitle:"",style:"default",content:"",sections:"[]",seo_title:"",seo_description:""});(0,a.useEffect)(()=>{f()},[]);const f=async()=>{o(!0);try{const e=await m.Ay.get("/admin/about");e.data&&b(e.data)}catch(e){n({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst data",status:"error"})}finally{o(!1)}},k=async()=>{if(v.title.trim()){s(!0);try{await m.Ay.put("/admin/about",v),n({title:"Ulo\u017eeno",description:"Str\xe1nka O klubu byla ulo\u017eena",status:"success"}),await f()}catch(a){var e,t;n({title:"Chyba",description:(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Nepoda\u0159ilo se ulo\u017eit",status:"error"})}finally{s(!1)}}else n({title:"Chyba",description:"Vypl\u0148te n\xe1zev str\xe1nky",status:"warning"})},A={default:{name:"V\xfdchoz\xed",desc:"Jednoduch\xfd layout s titulkem a obsahem"},modern:{name:"Modern\xed",desc:"Vizu\xe1ln\u011b atraktivn\xed s hero obr\xe1zkem a sekcemi"},timeline:{name:"Timeline",desc:"Historie klubu na \u010dasov\xe9 ose"},custom:{name:"Vlastn\xed HTML",desc:"Pln\xe1 kontrola nad obsahem a stylingem"}};return(0,p.jsx)(Mo,{requireAdmin:!1,children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"lg",children:"Str\xe1nka O klubu"}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),colorScheme:"brand",onClick:k,isLoading:r,children:"Ulo\u017eit"})})]}),(0,p.jsxs)(U.E,{color:"gray.600",mb:6,children:["Vytvo\u0159te nebo upravte str\xe1nku O klubu. Dostupn\xe1 na ",(0,p.jsx)("strong",{children:"/o-klubu"}),"."]}),(0,p.jsxs)(ra.t,{variant:"enclosed",colorScheme:"brand",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:q.Iy6,mr:2})," Obsah"]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:q.PjK,mr:2})," Styl"]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:q.Vap,mr:2})," SEO"]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev str\xe1nky"}),(0,p.jsx)(C.p,{value:v.title,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{title:e.target.value})),placeholder:"O na\u0161\xed klubu"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Podtitulek"}),(0,p.jsx)(C.p,{value:v.subtitle,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{subtitle:e.target.value})),placeholder:"Na\u0161e historie, hodnoty a komunita"})]}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"gray.50",children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:3,align:"flex-start",children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:1,children:"AI gener\xe1tor obsahu"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:"Napi\u0161te kr\xe1tk\xe9 pozn\xe1mky (nap\u0159. historie, \xfasp\u011bchy, hodnoty) a nechte AI p\u0159ipravit n\xe1vrh str\xe1nky."})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.FrA,{}),colorScheme:"purple",variant:"solid",onClick:async()=>{if(d.trim()){c(!0);try{const e=await async function(e){const{data:t}=await m.Ay.post("/ai/about/generate",e);let n=t;if("string"===typeof t)try{n=JSON.parse(t)}catch(a){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}return n}({prompt:d,audience:x,style:v.style});b(t=>(0,h.A)((0,h.A)({},t),{},{content:e.html||t.content,title:e.title||t.title,subtitle:e.subtitle||t.subtitle,seo_title:e.seo_title||t.seo_title,seo_description:e.seo_description||t.seo_description})),n({title:"Hotovo!",description:"Obsah byl vygenerov\xe1n pomoc\xed AI",status:"success"})}catch(a){var e,t;n({title:"Chyba AI",description:(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Nepoda\u0159ilo se vygenerovat obsah",status:"error"})}finally{c(!1)}}else n({title:"Chyba",description:"Zadejte pozn\xe1mky pro AI",status:"warning"})},isLoading:l,children:"Vygenerovat"})]}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Pozn\xe1mky pro AI"}),(0,p.jsx)(va.T,{value:d,onChange:e=>u(e.target.value),placeholder:"Popi\u0161te historii klubu, sou\u010dasn\xe9 c\xedle, p\u0159\xedstup k ml\xe1de\u017ei...",rows:4})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"C\xedlov\xe9 publikum"}),(0,p.jsx)(C.p,{value:x,onChange:e=>g(e.target.value),placeholder:"Fanou\u0161ci klubu"})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Obsah str\xe1nky"}),(0,p.jsx)(Jr,{value:v.content,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{content:e})),height:"400px",toolbar:"full",showImageResize:!0,placeholder:"Zadejte obsah str\xe1nky O n\xe1s..."})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Styl str\xe1nky"}),(0,p.jsx)(ha.l,{value:v.style,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{style:e.target.value})),children:Object.entries(A).map(e=>{let[t,{name:n,desc:a}]=e;return(0,p.jsx)("option",{value:t,children:n},t)})}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mt:2,children:null===(e=A[v.style])||void 0===e?void 0:e.desc})]}),(0,p.jsxs)(y.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"blue.50",borderColor:"blue.200",children:[(0,p.jsxs)(z.D,{size:"sm",mb:2,children:["Vybran\xfd styl: ",null===(t=A[v.style])||void 0===t?void 0:t.name]}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:3,mb:3,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Qt.E,{colorScheme:"blue",mb:1,children:"V\xfdchoz\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Jednoduch\xfd layout, ide\xe1ln\xed pro text"})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Qt.E,{colorScheme:"purple",mb:1,children:"Modern\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Hero obr\xe1zek + sekce karet"})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Qt.E,{colorScheme:"green",mb:1,children:"Timeline"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Historie klubu chronologicky"})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(Qt.E,{colorScheme:"orange",mb:1,children:"Vlastn\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Pln\xe1 kontrola p\u0159es HTML/CSS"})]})]})]}),"custom"===v.style&&(0,p.jsxs)(y.a,{p:3,bg:"yellow.50",borderWidth:"1px",borderColor:"yellow.300",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",mb:1,children:"Vlastn\xed HTML re\u017eim"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"V editoru m\u016f\u017eete pou\u017e\xedt jak\xe9koliv HTML a CSS. Ujist\u011bte se, \u017ee je k\xf3d validn\xed."})]})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SEO Titulek"}),(0,p.jsx)(C.p,{value:v.seo_title,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{seo_title:e.target.value})),placeholder:"Pokud pr\xe1zdn\xe9, pou\u017eije se n\xe1zev str\xe1nky"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"SEO Popis"}),(0,p.jsx)(va.T,{value:v.seo_description,onChange:e=>b(t=>(0,h.A)((0,h.A)({},t),{},{seo_description:e.target.value})),placeholder:"Kr\xe1tk\xfd popis pro vyhled\xe1va\u010de (doporu\u010deno 150-160 znak\u016f)",rows:4}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",mt:1,children:["D\xe9lka: ",v.seo_description.length," znak\u016f"]})]})]})})]})]}),(0,p.jsx)(y.a,{mt:6,pt:4,borderTopWidth:"1px",children:(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(T.$,{colorScheme:"red",variant:"outline",onClick:async()=>{if(confirm("Opravdu smazat str\xe1nku O klubu?"))try{await m.Ay.delete("/admin/about"),n({title:"Smaz\xe1no",description:"Str\xe1nka byla smaz\xe1na",status:"info"}),b({title:"",subtitle:"",style:"default",content:"",sections:"[]",seo_title:"",seo_description:""})}catch(e){n({title:"Chyba",description:"Nepoda\u0159ilo se smazat",status:"error"})}},children:"Smazat str\xe1nku"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{as:"a",href:"/o-klubu",target:"_blank",variant:"outline",children:"N\xe1hled"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.Bc_,{}),colorScheme:"brand",onClick:k,isLoading:r,children:"Ulo\u017eit zm\u011bny"})]})]})})]})})};var _l=n(461);_l.t1.register(_l.PP,_l.kc,_l.E8,_l.hE,_l.m_,_l.s$);const Sl=()=>{var e,t,n,i,o,r,s;const[l,c]=(0,a.useState)(null),[d,h]=(0,a.useState)([]),[u,x]=(0,a.useState)([]),[g,v]=(0,a.useState)([]),[j,f]=(0,a.useState)([]),[k,_]=(0,a.useState)([]),[S,C]=(0,a.useState)([]),[A,E]=(0,a.useState)([]),[N,R]=(0,a.useState)([]),[P,I]=(0,a.useState)([]),[W,M]=(0,a.useState)(!0),[D,L]=(0,a.useState)("0"),[F,O]=(0,a.useState)(!1),[K,V]=(0,a.useState)(null),[$,ne]=(0,a.useState)(null),[ae,ie]=(0,a.useState)(null),[oe,re]=(0,a.useState)(null),[ce,de]=(0,a.useState)(!1),[he,ue]=(0,a.useState)(null),[me,pe]=(0,a.useState)(!1),{isOpen:xe,onOpen:ge,onClose:ve}=(0,X.j)(),je=(0,b.dU)("white","gray.800"),be=(0,b.dU)("gray.200","gray.700");(0,a.useEffect)(()=>{(async e=>{M(!0),V(null),ne(null);try{var t,n,a,i;const o=parseInt(e),r=await m.Ay.get("/admin/umami/stats?days=".concat(e));c(r.data);const s=r.data&&((null===(t=r.data.pageviews)||void 0===t?void 0:t.value)&&r.data.pageviews.value>0||(null===(n=r.data.visitors)||void 0===n?void 0:n.value)&&r.data.visitors.value>0),[l,d,u,p,g,j,b,y]=await Promise.all([m.Ay.get("/admin/umami/metrics/url?days=".concat(e)),m.Ay.get("/admin/umami/metrics/browser?days=".concat(e)),m.Ay.get("/admin/umami/metrics/os?days=".concat(e)),m.Ay.get("/admin/umami/metrics/country?days=".concat(e)),m.Ay.get("/admin/umami/metrics/device?days=".concat(e)),m.Ay.get("/admin/umami/metrics/event?days=".concat(e)),m.Ay.get("/admin/umami/metrics/query?days=".concat(e)).catch(()=>({data:[]})),m.Ay.get("/admin/umami/pageviews?days=".concat(e))]);h(l.data||[]),x([]),v(d.data||[]),f(u.data||[]),_(p.data||[]),C(g.data||[]),E(j.data||[]),R(b.data||[]);const k=[],z=y.data||[];if(z.length>0)for(const e of z){let t="";const n=e.t||e.time||e.date;if(0===o||1===o){const e=new Date(n);t="".concat(e.getHours().toString().padStart(2,"0"),":00")}else{const e=new Date(n);t="".concat(e.getDate(),". ").concat(e.getMonth()+1,".")}k.push({date:t,value:e.y||e.value||0})}I(k);const w=k.length>0&&k.some(e=>e.value>0),S=(null===(a=l.data)||void 0===a?void 0:a.length)>0||(null===(i=p.data)||void 0===i?void 0:i.length)>0;O(s||w||S),s||w||S?ne(null):o<=1?ne("Pro vybran\xe9 denn\xed obdob\xed zat\xedm nebyla zaznamen\xe1na \u017e\xe1dn\xe1 n\xe1v\u0161t\u011bvnost. Zkuste pozd\u011bji nebo zvolte del\u0161\xed obdob\xed."):V("Umami nen\xed spr\xe1vn\u011b nakonfigurov\xe1no nebo je\u0161t\u011b nebyly zaznamen\xe1ny \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy. Zkontrolujte UMAMI_WEBSITE_ID v .env souboru.")}catch(o){console.error("Failed to fetch analytics:",o),V("Chyba p\u0159i na\u010d\xedt\xe1n\xed analytiky. Zkontrolujte p\u0159ipojen\xed k Umami."),O(!1)}finally{M(!1)}})(D),ye()},[D]);const ye=async()=>{try{const e=await m.Ay.get("/umami/config");ue(e.data)}catch(e){console.error("Failed to fetch Umami config:",e)}},fe=e=>e?new Intl.NumberFormat("cs-CZ").format(e):"0",ke=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,p.jsxs)(sl.Z,{bg:je,borderColor:be,children:[(0,p.jsx)(ll.a,{children:(0,p.jsx)(z.D,{size:"sm",children:t})}),(0,p.jsx)(cl.b,{children:(0,p.jsxs)(Ui.X,{variant:"simple",size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"N\xe1v\u0161t\u011bvy"})]})}),(0,p.jsxs)(Zi.N,{children:[e.slice(0,10).map((e,t)=>{const a=n?{"Contact Form Submit":{name:"Odesl\xe1n\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel odeslal kontaktn\xed formul\xe1\u0159 na str\xe1nce Kontakt"},"Contact Form":{name:"Zobrazen\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel zobrazil kontaktn\xed formul\xe1\u0159"},"Form Submit":{name:"Odesl\xe1n\xed formul\xe1\u0159e",source:"R\u016fzn\xe9 str\xe1nky",description:"Obecn\xe9 odesl\xe1n\xed formul\xe1\u0159e na webu"},"Newsletter Subscribe":{name:"Odb\u011br newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel se p\u0159ihl\xe1sil k odb\u011bru newsletteru"},"Newsletter Submit":{name:"Potvrzen\xed newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel potvrdil p\u0159ihl\xe1\u0161en\xed k newsletteru"},"Newsletter Unsubscribe":{name:"Odhl\xe1\u0161en\xed z newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru newsletteru"},"Newsletter Preferences Saved":{name:"Ulo\u017een\xed p\u0159edvoleb newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby pro newsletter"},Unsubscribe:{name:"Odhl\xe1\u0161en\xed z odb\u011bru",source:"Nastaven\xed",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru"},"Save Preferences":{name:"Ulo\u017een\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby (souhlas s cookies apod.)"},"Refresh Preferences":{name:"Obnoven\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel obnovil nebo zm\u011bnil sv\xe9 p\u0159edvolby"},"Article View":{name:"Zobrazen\xed \u010dl\xe1nku",source:"Blog",description:"U\u017eivatel si zobrazil \u010dl\xe1nek na blogu"},"Match View":{name:"Zobrazen\xed z\xe1pasu",source:"Str\xe1nka z\xe1pas\u016f",description:"U\u017eivatel si zobrazil detail z\xe1pasu"},"Gallery View":{name:"Zobrazen\xed galerie",source:"Galerie",description:"U\u017eivatel si otev\u0159el galerii fotografi\xed"},"Video Play":{name:"P\u0159ehr\xe1n\xed videa",source:"Video sekce",description:"U\u017eivatel spustil p\u0159ehr\xe1v\xe1n\xed videa"},"Social Share":{name:"Sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch",source:"Sd\xedlec\xed tla\u010d\xedtka",description:"U\u017eivatel sd\xedlel obsah na soci\xe1ln\xed s\xed\u0165"},Download:{name:"Sta\u017een\xed souboru",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel st\xe1hl soubor"},"External Link Click":{name:"Kliknut\xed na extern\xed odkaz",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na odkaz vedouc\xed mimo web"},"Poll Vote":{name:"Hlasov\xe1n\xed v anket\u011b",source:"Ankety",description:"U\u017eivatel hlasoval v anket\u011b"}}[i=e.x]||{name:i,source:"Nezn\xe1m\xfd zdroj",description:"Ud\xe1lost: ".concat(i)}:null;var i;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:n&&a?(0,p.jsx)(te.m,{label:a.description,placement:"top",hasArrow:!0,children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{noOfLines:1,maxW:"300px",fontWeight:"medium",children:a.name}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:a.source})]})}):(0,p.jsx)(U.E,{noOfLines:1,maxW:"300px",children:e.x||"(pr\xe1zdn\xe9)"})}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:(0,p.jsx)(Qt.E,{colorScheme:"blue",children:fe(e.y)})})]},t)}),0===e.length&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:2,textAlign:"center",children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe1 data"})})})]})]})})]})};return W&&!l?(0,p.jsx)(Mo,{children:(0,p.jsx)(Z.m,{maxW:"container.xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed analytiky..."})]})})}):(0,p.jsxs)(Mo,{children:[(0,p.jsx)(Z.m,{maxW:"container.xl",py:8,children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(jn.I,{as:q.wIk,color:"blue.500",boxSize:6}),(0,p.jsx)(z.D,{size:"lg",children:"Analytika webu"})]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(jn.I,{as:q.wIk,color:"gray.500",boxSize:4}),(0,p.jsxs)(ha.l,{value:D,onChange:e=>L(e.target.value),maxW:"200px",children:[(0,p.jsx)("option",{value:"0",children:"Dnes (dne\u0161n\xed den)"}),(0,p.jsx)("option",{value:"1",children:"V\u010dera"}),(0,p.jsx)("option",{value:"7",children:"Posledn\xedch 7 dn\xed"}),(0,p.jsx)("option",{value:"30",children:"Posledn\xedch 30 dn\xed"}),(0,p.jsx)("option",{value:"90",children:"Posledn\xedch 90 dn\xed"}),(0,p.jsx)("option",{value:"365",children:"Posledn\xed rok"})]})]})]}),$&&(0,p.jsx)(sl.Z,{bg:"yellow.50",borderColor:"yellow.300",borderWidth:2,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(ee.z,{spacing:3,align:"start",children:[(0,p.jsx)(jn.I,{as:q.S8s,color:"yellow.600",boxSize:6,mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",color:"yellow.800",children:"Zat\xedm \u017e\xe1dn\xe1 data"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"yellow.700",children:$})]})]})})}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2,lg:5},spacing:4,children:[(0,p.jsx)(sl.Z,{bg:je,borderColor:be,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:q.Vap,color:"blue.500",boxSize:5}),(0,p.jsx)(fo.v,{children:"Zobrazen\xed str\xe1nek"})]}),(0,p.jsx)(ko.k,{children:fe(null===l||void 0===l||null===(e=l.pageviews)||void 0===e?void 0:e.value)}),(0,p.jsx)(zo.h,{children:"Celkov\xfd po\u010det zobrazen\xed"})]})})}),(0,p.jsx)(sl.Z,{bg:je,borderColor:be,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:q.cfS,color:"green.500",boxSize:5}),(0,p.jsx)(fo.v,{children:"N\xe1v\u0161t\u011bvn\xedci"})]}),(0,p.jsx)(ko.k,{children:fe(null===l||void 0===l||null===(t=l.visitors)||void 0===t?void 0:t.value)}),(0,p.jsx)(zo.h,{children:"Unik\xe1tn\xed n\xe1v\u0161t\u011bvn\xedci"})]})})}),(0,p.jsx)(sl.Z,{bg:je,borderColor:be,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:q.z1n,color:"purple.500",boxSize:5}),(0,p.jsx)(fo.v,{children:"N\xe1v\u0161t\u011bvy"})]}),(0,p.jsx)(ko.k,{children:fe(null===l||void 0===l||null===(n=l.visits)||void 0===n?void 0:n.value)}),(0,p.jsx)(zo.h,{children:"Celkov\xfd po\u010det relac\xed"})]})})}),(0,p.jsx)(sl.Z,{bg:je,borderColor:be,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:q.fTJ,color:"orange.500",boxSize:5}),(0,p.jsx)(fo.v,{children:"M\xedra opu\u0161t\u011bn\xed"})]}),(0,p.jsx)(ko.k,{children:null!==l&&void 0!==l&&null!==(i=l.bounces)&&void 0!==i&&i.value&&null!==l&&void 0!==l&&null!==(o=l.visits)&&void 0!==o&&o.value?"".concat(Math.round(l.bounces.value/l.visits.value*100),"%"):"0%"}),(0,p.jsx)(zo.h,{children:"Odchody po 1 str\xe1nce"})]})})}),(0,p.jsx)(sl.Z,{bg:je,borderColor:be,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(yo.r,{children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:q.Ohp,color:"teal.500",boxSize:5}),(0,p.jsx)(fo.v,{children:"Pr\u016fm\u011brn\xfd \u010das"})]}),(0,p.jsx)(ko.k,{children:(e=>{if(!e||0===e)return"0s";let t=e>1e4?Math.floor(e/1e3):Math.floor(e);const n=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return n>0?"".concat(n,"h ").concat(a,"m ").concat(i,"s"):a>0?"".concat(a,"m ").concat(i,"s"):"".concat(i,"s")})(null!==l&&void 0!==l&&null!==(r=l.totaltime)&&void 0!==r&&r.value&&null!==l&&void 0!==l&&null!==(s=l.visits)&&void 0!==s&&s.value?l.totaltime.value/l.visits.value:0)}),(0,p.jsx)(zo.h,{children:"Pr\u016fm\u011brn\xe1 d\xe9lka n\xe1v\u0161t\u011bvy"})]})})})]}),(!F||me)&&(0,p.jsx)(sl.Z,{bg:"blue.50",borderColor:"blue.300",borderWidth:2,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(ee.z,{spacing:3,align:"start",children:[(0,p.jsx)(jn.I,{as:q.z1n,color:"blue.500",boxSize:6,mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:3,flex:1,children:[(0,p.jsxs)(ee.z,{justify:"space-between",w:"full",children:[(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.800",fontSize:"lg",children:"Diagnostika analytiky"}),(0,p.jsx)(T.$,{size:"xs",variant:"ghost",onClick:()=>pe(!me),children:me?"Skr\xfdt":"Zobrazit detaily"})]}),(0,p.jsxs)(y.a,{w:"full",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(Qt.E,{colorScheme:null!==he&&void 0!==he&&he.enabled?"green":"red",children:null!==he&&void 0!==he&&he.enabled?"P\u0159ipojeno":"Nep\u0159ipojeno"}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",color:"blue.800",children:"Stav Umami"})]}),he&&(0,p.jsxs)(w.T,{align:"start",spacing:1,pl:4,children:[(0,p.jsxs)(U.E,{fontSize:"xs",color:"blue.700",children:[(0,p.jsx)("strong",{children:"Aktivov\xe1no:"})," ",he.enabled?"Ano":"Ne"]}),he.website_id&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"blue.700",children:[(0,p.jsx)("strong",{children:"Website ID:"})," ",he.website_id]}),he.reason&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"red.600",children:[(0,p.jsx)("strong",{children:"D\u016fvod:"})," ",he.reason]})]})]}),(0,p.jsx)(G.c,{borderColor:"blue.200"}),!F&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(U.E,{fontSize:"sm",color:"blue.800",fontWeight:"semibold",children:"Pro\u010d nejsou k dispozici \u017e\xe1dn\xe1 data?"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,pl:4,children:[(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Umami tracking je\u0161t\u011b nezaznamenal \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Tracking script se na\u010d\xedt\xe1 pouze na ve\u0159ejn\xfdch str\xe1nk\xe1ch (ne na /admin)"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Data se aktualizuj\xed v re\xe1ln\xe9m \u010dase po n\xe1v\u0161t\u011bv\u011b ve\u0159ejn\xfdch str\xe1nek"})]}),(0,p.jsx)(G.c,{borderColor:"blue.200"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"blue.800",fontWeight:"semibold",children:"Jak vygenerovat testovac\xed data:"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,pl:4,children:[(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"1. Otev\u0159ete hlavn\xed str\xe1nku webu v nov\xe9m okn\u011b inkognito"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"2. Proch\xe1zejte n\u011bkolik ve\u0159ejn\xfdch str\xe1nek (Blog, O klubu, Kontakt...)"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.700",children:"3. Po\u010dkejte 1-2 minuty a obnovte tuto str\xe1nku analytiky"})]}),(0,p.jsxs)(ee.z,{spacing:2,mt:2,children:[(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",leftIcon:(0,p.jsx)(jn.I,{as:q.VeH}),onClick:()=>window.open("/","_blank"),children:"Otev\u0159\xedt hlavn\xed str\xe1nku"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",variant:"outline",leftIcon:(0,p.jsx)(jn.I,{as:q.FrA}),onClick:()=>window.location.reload(),children:"Obnovit analytiku"})]})]})]})]})})}),K&&(0,p.jsx)(sl.Z,{bg:"orange.50",borderColor:"orange.300",borderWidth:2,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(ee.z,{spacing:3,align:"start",children:[(0,p.jsx)(jn.I,{as:q.FrA,color:"orange.500",boxSize:6,mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:2,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",color:"orange.800",fontSize:"lg",children:"Analytika nen\xed k dispozici"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.700",children:K}),(0,p.jsx)(G.c,{borderColor:"orange.200"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.800",fontWeight:"semibold",children:"Mo\u017en\xe9 p\u0159\xed\u010diny:"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,pl:4,children:[(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Umami nen\xed spu\u0161t\u011bno nebo nen\xed dostupn\xe9"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"\u2022 V Umami instanci neexistuje \u017e\xe1dn\xfd web"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Nebyly je\u0161t\u011b zaznamen\xe1ny \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Chybn\xe9 p\u0159ihla\u0161ovac\xed \xfadaje v .env souboru"})]}),(0,p.jsx)(G.c,{borderColor:"orange.200"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"orange.800",fontWeight:"semibold",children:"\u0158e\u0161en\xed:"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,pl:4,children:[(0,p.jsxs)(U.E,{fontSize:"xs",color:"orange.700",children:["1. Zkontrolujte, \u017ee Umami b\u011b\u017e\xed na ",(0,p.jsx)("strong",{children:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_UMAMI_URL||"nakonfigurovan\xe9 URL"})]}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"2. P\u0159ihlaste se do Umami a vytvo\u0159te nov\xfd web, pokud \u017e\xe1dn\xfd neexistuje"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"3. Restartujte backend server pro op\u011btovn\xe9 p\u0159ipojen\xed"}),(0,p.jsx)(U.E,{fontSize:"xs",color:"orange.700",children:"4. Zkontrolujte backend logy pro detailn\xed chybov\xe9 zpr\xe1vy"})]}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"orange",variant:"outline",leftIcon:(0,p.jsx)(jn.I,{as:q.FrA}),onClick:()=>window.location.reload(),mt:2,children:"Znovu na\u010d\xedst str\xe1nku"})]})]})})}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(sl.Z,{bg:je,borderColor:be,children:[(0,p.jsx)(ll.a,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.VeH,color:"green.500",boxSize:5}),(0,p.jsx)(z.D,{size:"md",children:"N\xe1v\u0161t\u011bvn\xedci podle zem\xed"})]})}),(0,p.jsx)(cl.b,{children:W&&0===k.length?(0,p.jsx)(Q.s,{justify:"center",py:8,children:(0,p.jsx)(zn.y,{size:"lg"})}):0===k.length?(0,p.jsx)(U.E,{textAlign:"center",color:"gray.500",py:8,children:"\u017d\xe1dn\xe1 data o zem\xedch"}):(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:4,children:k.slice(0,12).map((e,t)=>{var n;const a=(null===(n=e.x)||void 0===n?void 0:n.toUpperCase())||"",i=new Intl.DisplayNames(["cs","en"],{type:"region"}).of(a)||a,o=2===a.length?String.fromCodePoint(...[...a].map(e=>127397+e.charCodeAt(0))):"\ud83c\udff3\ufe0f";return(0,p.jsx)(sl.Z,{variant:"outline",cursor:"pointer",transition:"all 0.2s",_hover:{transform:"translateY(-2px)",boxShadow:"md",borderColor:"blue.400"},onClick:()=>(async(e,t,n)=>{ie({code:e,name:t,value:n}),de(!0),ge();try{const[t,n,a,i,o]=await Promise.all([m.Ay.get("/admin/umami/metrics/url?days=".concat(D,"&country=").concat(e)),m.Ay.get("/admin/umami/metrics/browser?days=".concat(D,"&country=").concat(e)),m.Ay.get("/admin/umami/metrics/os?days=".concat(D,"&country=").concat(e)),m.Ay.get("/admin/umami/metrics/device?days=".concat(D,"&country=").concat(e)),m.Ay.get("/admin/umami/metrics/event?days=".concat(D,"&country=").concat(e))]);re({pages:t.data||[],browsers:n.data||[],os:a.data||[],devices:i.data||[],events:o.data||[]})}catch(a){console.error("Failed to fetch country details:",a),re(null)}finally{de(!1)}})(a,i,e.y),children:(0,p.jsx)(cl.b,{p:4,children:(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(U.E,{fontSize:"4xl",children:o}),(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:1,children:i}),(0,p.jsxs)(Qt.E,{colorScheme:"blue",fontSize:"sm",children:[fe(e.y)," n\xe1v\u0161t\u011bv"]})]})})},t)})})})]}),(0,p.jsxs)(ra.t,{colorScheme:"blue",children:[(0,p.jsxs)(sa.w,{flexWrap:"wrap",children:[(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.QuH}),(0,p.jsx)(U.E,{children:"Str\xe1nky"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.ufi}),(0,p.jsx)(U.E,{children:"Prohl\xed\u017ee\u010de"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.Ojn}),(0,p.jsx)(U.E,{children:"Opera\u010dn\xed syst\xe9my"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.VeH}),(0,p.jsx)(U.E,{children:"Zem\u011b"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.PCV}),(0,p.jsx)(U.E,{children:"Za\u0159\xedzen\xed"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.FrA}),(0,p.jsx)(U.E,{children:"Ud\xe1losti"})]})}),(0,p.jsx)(la.o,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.CKj}),(0,p.jsx)(U.E,{children:"Query parametry"})]})})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:ke(d,"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky")}),(0,p.jsx)(da.K,{children:ke(g,"Pou\u017e\xedvan\xe9 prohl\xed\u017ee\u010de")}),(0,p.jsx)(da.K,{children:ke(j,"Opera\u010dn\xed syst\xe9my")}),(0,p.jsx)(da.K,{children:ke(k,"Zem\u011b n\xe1v\u0161t\u011bvn\xedk\u016f")}),(0,p.jsx)(da.K,{children:ke(S,"Typy za\u0159\xedzen\xed")}),(0,p.jsx)(da.K,{children:ke(A,"Ud\xe1losti u\u017eivatel\u016f",!0)}),(0,p.jsx)(da.K,{children:ke(N,"Query parametry URL")})]})]})]})}),(0,p.jsxs)(se.aF,{isOpen:xe,onClose:()=>{ve(),ie(null),re(null)},size:"6xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:(0,p.jsxs)(Q.s,{align:"center",gap:3,children:[(0,p.jsxs)(U.E,{children:["Analytika pro zemi: ",null===ae||void 0===ae?void 0:ae.name]}),(0,p.jsxs)(Qt.E,{colorScheme:"blue",fontSize:"sm",children:[fe(null===ae||void 0===ae?void 0:ae.value)," n\xe1v\u0161t\u011bv"]})]})}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{pb:6,children:ce?(0,p.jsxs)(Q.s,{justify:"center",align:"center",py:8,children:[(0,p.jsx)(zn.y,{size:"lg"}),(0,p.jsx)(U.E,{ml:3,children:"Na\u010d\xedt\xe1n\xed detail\u016f..."})]}):oe?(0,p.jsxs)(ra.t,{colorScheme:"blue",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Str\xe1nky"}),(0,p.jsx)(la.o,{children:"Prohl\xed\u017ee\u010de"}),(0,p.jsx)(la.o,{children:"Opera\u010dn\xed syst\xe9my"}),(0,p.jsx)(la.o,{children:"Za\u0159\xedzen\xed"}),(0,p.jsx)(la.o,{children:"Ud\xe1losti"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:ke(oe.pages,"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky v ".concat(null===ae||void 0===ae?void 0:ae.name))}),(0,p.jsx)(da.K,{children:ke(oe.browsers,"Pou\u017e\xedvan\xe9 prohl\xed\u017ee\u010de v ".concat(null===ae||void 0===ae?void 0:ae.name))}),(0,p.jsx)(da.K,{children:ke(oe.os,"Opera\u010dn\xed syst\xe9my v ".concat(null===ae||void 0===ae?void 0:ae.name))}),(0,p.jsx)(da.K,{children:ke(oe.devices,"Typy za\u0159\xedzen\xed v ".concat(null===ae||void 0===ae?void 0:ae.name))}),(0,p.jsx)(da.K,{children:ke(oe.events,"Ud\xe1losti u\u017eivatel\u016f z ".concat(null===ae||void 0===ae?void 0:ae.name),!0)})]})]}):(0,p.jsx)(y.a,{textAlign:"center",py:8,children:(0,p.jsx)(U.E,{color:"gray.500",children:"Pro vybranou zemi nejsou k dispozici detailn\xed data."})})})]})]})]})};var Cl=n(3669);const Al=()=>{var e,t;const n=(0,j.d)(),i=(0,l.jE)(),[o,r]=(0,a.useState)(""),[s,c]=(0,a.useState)(""),[d,h]=(0,a.useState)(null),[u,x]=(0,a.useState)(null),[g,v]=(0,a.useState)(!1),[f,_]=(0,a.useState)(null),[S,N]=(0,a.useState)(null),{isOpen:R,onOpen:P,onClose:I}=(0,X.j)(),{isOpen:W,onOpen:M,onClose:D}=(0,X.j)(),{isOpen:F,onOpen:O,onClose:Z}=(0,X.j)(),{isOpen:V,onOpen:$,onClose:Q}=(0,X.j)(),ne=(0,b.dU)("gray.200","gray.600"),ae=(0,b.dU)("gray.50","gray.700"),{data:ie=[],isLoading:oe,refetch:re}=(0,xe.I)({queryKey:["admin-files",o,s],queryFn:()=>fs({search:o,mime_type:s})}),{data:ce=[]}=(0,xe.I)({queryKey:["admin-files-unused"],queryFn:ks}),{data:de={}}=(0,xe.I)({queryKey:["admin-files-duplicates"],queryFn:zs}),he=(0,Mn.n)({mutationFn:e=>{let{id:t,force:n}=e;return ws(t,n)},onSuccess:()=>{n({title:"Soubor smaz\xe1n",status:"success"}),i.invalidateQueries({queryKey:["admin-files"]}),i.invalidateQueries({queryKey:["admin-files-unused"]}),i.invalidateQueries({queryKey:["admin-files-duplicates"]}),D(),x(null),v(!1)},onError:e=>{var t,a,i;409===(null===(t=e.response)||void 0===t?void 0:t.status)?(v(!1),n({title:"Soubor je pou\u017e\xedv\xe1n",description:"Soubor je pou\u017e\xedv\xe1n. Zkontrolujte pou\u017eit\xed a potvr\u010fte smaz\xe1n\xed.",status:"warning",duration:5e3})):n({title:"Chyba p\u0159i maz\xe1n\xed",description:(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Nepoda\u0159ilo se smazat soubor",status:"error"})}}),ue=(0,Mn.n)({mutationFn:_s,onSuccess:e=>{_(e),O(),i.invalidateQueries({queryKey:["admin-files"]}),i.invalidateQueries({queryKey:["admin-files-unused"]}),i.invalidateQueries({queryKey:["admin-files-duplicates"]})},onError:()=>{n({title:"Chyba p\u0159i skenov\xe1n\xed",status:"error"})}}),me=(0,Mn.n)({mutationFn:Ss,onSuccess:e=>{N(e),$(),i.invalidateQueries({queryKey:["admin-files"]}),i.invalidateQueries({queryKey:["admin-files-unused"]}),i.invalidateQueries({queryKey:["admin-files-duplicates"]})},onError:()=>{n({title:"Chyba p\u0159i aktualizaci sledov\xe1n\xed",status:"error"})}}),pe=e=>{if(e.startsWith("http"))return e;const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return"".concat(t).concat(e)},ge=(0,a.useMemo)(()=>{const e=new Set;return ie.forEach(t=>{if(t.mime_type){const n=t.mime_type.split("/")[0];e.add(n)}}),Array.from(e)},[ie]),ve=e=>{var t,a;let{file:i,showUsageCount:o=!0}=e;return(0,p.jsxs)(Fi.Tr,{_hover:{bg:ae},children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[null!==(t=i.mime_type)&&void 0!==t&&t.startsWith("image/")?(0,p.jsx)(k._,{src:pe(i.file_url),alt:i.filename,boxSize:"40px",objectFit:"cover",borderRadius:"md",fallbackSrc:"/logo192.png"}):(0,p.jsx)(jn.I,{as:(r=i.mime_type||"",r.startsWith("image/")?q.fZZ:"application/pdf"===r?q.jH2:r.startsWith("video/")?q.pVQ:q.QuH),boxSize:6,color:"blue.500"}),(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"medium",fontSize:"sm",children:i.filename}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:i.file_path})]})]})}),(0,p.jsx)(Ki.Td,{fontSize:"sm",children:Cs(i.file_size)}),(0,p.jsx)(Ki.Td,{fontSize:"sm",children:(0,p.jsx)(Qt.E,{colorScheme:null!==(a=i.mime_type)&&void 0!==a&&a.startsWith("image/")?"blue":"gray",children:i.mime_type})}),o&&(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(Qt.E,{colorScheme:i.usage_count>0?"green":"red",children:i.usage_count}),i.usage_count>0&&(0,p.jsx)(K.K,{"aria-label":"Zobrazit pou\u017eit\xed",icon:(0,p.jsx)(q.HaR,{}),size:"xs",variant:"ghost",onClick:()=>(e=>{h(e),P()})(i)})]})}),(0,p.jsx)(Ki.Td,{fontSize:"sm",children:new Date(i.created_at).toLocaleDateString("cs-CZ")}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(te.m,{label:"Kop\xedrovat URL",children:(0,p.jsx)(K.K,{"aria-label":"Kop\xedrovat URL",icon:(0,p.jsx)(q.nxz,{}),size:"sm",variant:"ghost",onClick:()=>{return e=i.file_url,navigator.clipboard.writeText(e),void n({title:"Zkop\xedrov\xe1no",status:"success",duration:2e3});var e}})}),(0,p.jsx)(te.m,{label:"Smazat",children:(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(e=>{x(e),v(!1),M()})(i)})})]})})]});var r},je=Object.entries(de);return(0,p.jsxs)(Mo,{requireAdmin:!0,children:[(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va soubor\u016f"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.jTZ,{}),onClick:()=>me.mutate(void 0),isLoading:me.isPending,colorScheme:"green",size:"sm",variant:"outline",children:"Aktualizovat sledov\xe1n\xed"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.jTZ,{}),onClick:()=>ue.mutate(),isLoading:ue.isPending,colorScheme:"blue",size:"sm",children:"Skenovat soubory"})]})]}),(0,p.jsxs)(ra.t,{colorScheme:"blue",variant:"enclosed",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsxs)(la.o,{children:["V\u0161echny soubory (",ie.length,")"]}),(0,p.jsxs)(la.o,{children:["Nepou\u017e\xedvan\xe9 (",ce.length,")"]}),(0,p.jsxs)(la.o,{children:["Duplicity (",je.length,")"]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[0===ie.length&&!oe&&(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{flex:"1",children:[(0,p.jsx)(wo.X,{children:"\u017d\xe1dn\xe9 soubory v datab\xe1zi"}),(0,p.jsx)(_o.T,{children:'Klikn\u011bte na tla\u010d\xedtko "Skenovat soubory" pro na\u010dten\xed soubor\u016f z uploads slo\u017eky do datab\xe1ze.'})]})]}),(0,p.jsxs)(ee.z,{spacing:4,children:[(0,p.jsxs)(A.M,{maxW:"400px",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(q.CKj,{})}),(0,p.jsx)(C.p,{placeholder:"Hledat soubory...",value:o,onChange:e=>r(e.target.value)})]}),(0,p.jsx)(ha.l,{placeholder:"V\u0161echny typy",maxW:"200px",value:s,onChange:e=>c(e.target.value),children:ge.map(e=>(0,p.jsx)("option",{value:e,children:e},e))}),(0,p.jsx)(Cl.h,{}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["Celkem: ",ie.length," soubor\u016f"]})]}),(0,p.jsx)(y.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",borderColor:ne,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Soubor"}),(0,p.jsx)(Oi.Th,{children:"Velikost"}),(0,p.jsx)(Oi.Th,{children:"Typ"}),(0,p.jsx)(Oi.Th,{children:"Pou\u017eit\xed"}),(0,p.jsx)(Oi.Th,{children:"Vytvo\u0159eno"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:oe?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):0===ie.length?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,textAlign:"center",py:8,children:"\u017d\xe1dn\xe9 soubory nenalezeny"})}):ie.map(e=>(0,p.jsx)(ve,{file:e},e.id))})]})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Nepou\u017e\xedvan\xe9 soubory"}),(0,p.jsx)(_o.T,{children:"Tyto soubory nejsou pou\u017eity v \u017e\xe1dn\xe9m \u010dl\xe1nku, hr\xe1\u010di, sponzorovi nebo jin\xe9 entit\u011b."})]})]}),(0,p.jsx)(y.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",borderColor:ne,children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Soubor"}),(0,p.jsx)(Oi.Th,{children:"Velikost"}),(0,p.jsx)(Oi.Th,{children:"Typ"}),(0,p.jsx)(Oi.Th,{children:"Vytvo\u0159eno"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:0===ce.length?(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:5,textAlign:"center",py:8,children:"V\u0161echny soubory jsou pou\u017e\xedv\xe1ny"})}):ce.map(e=>(0,p.jsx)(ve,{file:e,showUsageCount:!1},e.id))})]})})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(xa.F,{status:"warning",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Duplicitn\xed soubory"}),(0,p.jsx)(_o.T,{children:"Tyto soubory maj\xed identick\xfd obsah (MD5 hash). M\u016f\u017eete je smazat a aktualizovat odkazy."})]})]}),0===je.length?(0,p.jsx)(y.a,{textAlign:"center",py:8,children:(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 duplicity nenalezeny"})}):je.map(e=>{let[t,n]=e;return(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,borderColor:ne,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(q.eHT,{color:"orange"}),(0,p.jsxs)(U.E,{fontWeight:"bold",fontSize:"sm",children:["Duplicitn\xed skupina (",n.length," soubor\u016f)"]}),(0,p.jsxs)(ja.C,{fontSize:"xs",children:[t.substring(0,12),"..."]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Soubor"}),(0,p.jsx)(Oi.Th,{children:"Velikost"}),(0,p.jsx)(Oi.Th,{children:"Pou\u017eit\xed"}),(0,p.jsx)(Oi.Th,{children:"Vytvo\u0159eno"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:n.map(e=>(0,p.jsx)(ve,{file:e},e.id))})]})]})},t)})]})})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:R,onClose:I,size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Pou\u017eit\xed souboru"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:d&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(ee.z,{children:[(null===(e=d.mime_type)||void 0===e?void 0:e.startsWith("image/"))&&(0,p.jsx)(k._,{src:pe(d.file_url),alt:d.filename,maxH:"100px",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"start",flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:d.filename}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:d.file_path})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(U.E,{fontWeight:"bold",children:["Pou\u017e\xedv\xe1no v (",d.usage_count,"):"]}),d.usages&&d.usages.length>0?d.usages.map(e=>{var t,n,a;return(0,p.jsx)(y.a,{p:3,borderWidth:"1px",borderRadius:"md",children:(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(Qt.E,{colorScheme:"purple",children:e.entity_type}),(0,p.jsx)(U.E,{fontSize:"sm",mt:1,children:(null===(t=e.entity_info)||void 0===t?void 0:t.title)||(null===(n=e.entity_info)||void 0===n?void 0:n.name)||"ID: ".concat(e.entity_id)}),e.field_name&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["Pole: ",e.field_name]})]}),(null===(a=e.entity_info)||void 0===a?void 0:a.url)&&(0,p.jsx)(L.N,{href:e.entity_info.url,isExternal:!0,children:(0,p.jsx)(K.K,{"aria-label":"Otev\u0159\xedt",icon:(0,p.jsx)(q.HaR,{}),size:"sm",variant:"ghost"})})]})},e.id)}):(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",children:"Soubor nen\xed nikde pou\u017eit"})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{onClick:I,children:"Zav\u0159\xedt"})})]})]}),(0,p.jsxs)(se.aF,{isOpen:W,onClose:D,children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Smazat soubor"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:u&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(U.E,{children:["Opravdu chcete smazat soubor ",(0,p.jsx)("strong",{children:u.filename}),"?"]}),u.usage_count>0&&(0,p.jsxs)(xa.F,{status:"warning",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Pozor!"}),(0,p.jsxs)(_o.T,{children:["Tento soubor je pou\u017eit na ",u.usage_count," m\xedstech. Smaz\xe1n\xedm m\u016f\u017ee doj\xedt k nefunk\u010dnosti odkaz\u016f."]})]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(T.$,{variant:"ghost",onClick:D,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"red",onClick:()=>{u&&he.mutate({id:u.id,force:g})},isLoading:he.isPending,children:(null!==(t=null===u||void 0===u?void 0:u.usage_count)&&void 0!==t?t:0)>0?"P\u0159esto smazat":"Smazat"})]})})]})]}),(0,p.jsxs)(se.aF,{isOpen:F,onClose:Z,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"V\xfdsledky skenov\xe1n\xed soubor\u016f"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:f&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(xa.F,{status:"success",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{flex:"1",children:[(0,p.jsx)(wo.X,{children:"Skenov\xe1n\xed dokon\u010deno"}),(0,p.jsx)(_o.T,{children:f.message})]})]}),(0,p.jsxs)(At.B,{spacing:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Nalezen\xfdch soubor\u016f:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:f.found_files})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Nov\u011b p\u0159idan\xfdch:"}),(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"md",px:3,py:1,children:f.new_files})]}),void 0!==f.skipped_files&&f.skipped_files>0&&(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"P\u0159esko\u010den\xfdch (.gitkeep, atd.):"}),(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:f.skipped_files})]}),f.orphaned_files>0&&(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",borderColor:"orange.300",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Osi\u0159el\xfdch z\xe1znam\u016f:"}),(0,p.jsx)(Qt.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:f.orphaned_files})]})]}),f.new_files_list&&f.new_files_list.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,children:"Nov\u011b p\u0159idan\xe9 soubory:"}),(0,p.jsx)(y.a,{maxH:"200px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:(0,p.jsx)(w.T,{align:"stretch",spacing:1,children:f.new_files_list.map((e,t)=>(0,p.jsxs)(U.E,{fontSize:"sm",fontFamily:"monospace",children:["\u2713 ",e]},t))})})]}),f.orphaned_list&&f.orphaned_list.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,color:"orange.500",children:"Osi\u0159el\xe9 z\xe1znamy (soubory v DB, ale ne na disku):"}),(0,p.jsx)(y.a,{maxH:"200px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,borderColor:"orange.300",children:(0,p.jsx)(w.T,{align:"stretch",spacing:1,children:f.orphaned_list.map((e,t)=>(0,p.jsxs)(U.E,{fontSize:"sm",fontFamily:"monospace",color:"orange.600",children:["\u26a0 ",e]},t))})})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{colorScheme:"blue",onClick:Z,children:"Zav\u0159\xedt"})})]})]}),(0,p.jsxs)(se.aF,{isOpen:V,onClose:Q,size:"lg",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"V\xfdsledky aktualizace sledov\xe1n\xed"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:S&&(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(xa.F,{status:"success",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{children:"Sledov\xe1n\xed aktualizov\xe1no!"}),(0,p.jsx)(_o.T,{children:S.message})]})]}),(0,p.jsxs)(At.B,{spacing:3,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",mb:2,children:"Statistiky:"}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"\u010cl\xe1nky:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.articles_scanned})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Aktivity:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.events_scanned})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Hr\xe1\u010di:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.players_scanned})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Sponzo\u0159i:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.sponsors_scanned})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"Kontakty:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.contacts_scanned})]}),(0,p.jsxs)(ee.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"T\xfdmy:"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:S.stats.teams_scanned})]})]})]})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{colorScheme:"blue",onClick:Q,children:"Zav\u0159\xedt"})})]})]})]})},El=e=>{if(!e)return;if(e.startsWith("http://")||e.startsWith("https://"))return e;const t=m.API_URL.replace("/api/v1",""),n=e.startsWith("/")?e:"/".concat(e);return"".concat(t).concat(n)},Tl=()=>{var e,t,n;const i=(0,b.dU)("white","gray.800"),o=(0,b.dU)("gray.200","gray.700"),r=(0,b.dU)("white","gray.700"),s=(0,b.dU)("gray.600","gray.400"),l=(0,b.dU)("gray.50","gray.900"),c=(0,b.dU)("white","gray.800"),d=((0,b.dU)("gray.50","gray.700"),(0,b.dU)("blue.50","blue.900")),u=(0,b.dU)("blue.200","blue.700"),[x,g]=(0,a.useState)([]),[v,f]=(0,a.useState)([]),[k,A]=(0,a.useState)(!1),[E,N]=(0,a.useState)(null),[R,W]=(0,a.useState)(!1),[M,D]=(0,a.useState)(null),L=a.useRef(null),F=(0,j.d)(),[O,Z]=(0,a.useState)({name:"",position:"",email:"",phone:"",category_id:void 0,image_url:"",description:"",display_order:0,is_active:!0}),[V,$]=(0,a.useState)(!1),[G,X]=(0,a.useState)({}),[Q,te]=(0,a.useState)(!1);(0,a.useEffect)(()=>{ne(),ie()},[]);const ne=async()=>{A(!0);try{const[e,t]=await Promise.all([no(),to()]);g(e),f(t)}catch(e){F({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed",description:"Nepoda\u0159ilo se na\u010d\xedst kontakty a kategorie",status:"error",duration:3e3})}finally{A(!1)}},ae=e=>{e?(N(e),Z({name:e.name,position:e.position,email:e.email,phone:e.phone,category_id:e.category_id,image_url:e.image_url||"",description:e.description||"",display_order:e.display_order,is_active:e.is_active})):(N(null),Z({name:"",position:"",email:"",phone:"",category_id:void 0,image_url:"",description:"",display_order:10*x.length,is_active:!0})),W(!0)},ie=async()=>{try{const e=await P();X(e||{})}catch(e){console.error("Failed to load settings:",e)}},oe=e=>t=>{X(n=>(0,h.A)((0,h.A)({},n),{},{[e]:t.target.value}))},re=e=>t=>{const n=t.target.value,a=""===n?void 0:Number(n);X(t=>(0,h.A)((0,h.A)({},t),{},{[e]:Number.isFinite(a)?a:void 0}))},ce=async e=>{A(!0);try{await(async e=>{await m.Ay.delete("/admin/contacts/".concat(e))})(e),F({title:"Kontakt smaz\xe1n",status:"success",duration:2e3}),ne()}catch(t){F({title:"Chyba",description:"Smaz\xe1n\xed kontaktu se nezda\u0159ilo",status:"error",duration:3e3})}finally{A(!1),D(null)}};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{p:6,bg:l,minH:"100vh",children:[(0,p.jsx)(z.D,{size:"lg",mb:6,children:"Spr\xe1va kontakt\u016f"}),(0,p.jsxs)(ra.t,{colorScheme:"blue",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Kontakty"}),(0,p.jsx)(la.o,{children:"Mapa a adresa"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsxs)(da.K,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(U.E,{children:"Spravujte kontaktn\xed osoby va\u0161eho klubu"}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(q.GGD,{}),colorScheme:"blue",onClick:()=>ae(),children:"P\u0159idat kontakt"})]}),(0,p.jsx)(y.a,{overflowX:"auto",bg:c,borderRadius:"md",borderWidth:"1px",borderColor:o,children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Foto"}),(0,p.jsx)(Oi.Th,{children:"Jm\xe9no"}),(0,p.jsx)(Oi.Th,{children:"Pozice"}),(0,p.jsx)(Oi.Th,{children:"Sout\u011b\u017e"}),(0,p.jsx)(Oi.Th,{children:"Email"}),(0,p.jsx)(Oi.Th,{children:"Telefon"}),(0,p.jsx)(Oi.Th,{children:"Po\u0159ad\xed"}),(0,p.jsx)(Oi.Th,{children:"Stav"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[x.map(e=>{var t;return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.image_url?(0,p.jsx)(y.a,{as:"img",src:El(e.image_url),alt:e.name,boxSize:"40px",objectFit:"cover",borderRadius:"md"}):(0,p.jsx)(y.a,{boxSize:"40px",bg:"gray.200",borderRadius:"md",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(q.JXP,{})})}),(0,p.jsx)(Ki.Td,{fontWeight:"bold",children:e.name}),(0,p.jsx)(Ki.Td,{children:e.position}),(0,p.jsx)(Ki.Td,{children:e.category_id?(0,p.jsx)(Qt.E,{colorScheme:"purple",children:(null===(t=v.find(t=>t.id===e.category_id))||void 0===t?void 0:t.name)||e.category_id}):(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Bez kategorie"})}),(0,p.jsx)(Ki.Td,{children:e.email}),(0,p.jsx)(Ki.Td,{children:e.phone}),(0,p.jsx)(Ki.Td,{children:e.display_order}),(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:e.is_active?"green":"red",children:e.is_active?"Aktivn\xed":"Neaktivn\xed"})}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Upravit",icon:(0,p.jsx)(q.SG1,{}),size:"sm",onClick:()=>ae(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(q.IXo,{}),size:"sm",colorScheme:"red",onClick:()=>D({type:"contact",id:e.id})})]})})]},e.id)}),0===x.length&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:9,textAlign:"center",py:8,children:(0,p.jsx)(U.E,{color:"gray.500",children:"Zat\xedm \u017e\xe1dn\xe9 kontakty. P\u0159idejte sv\u016fj prvn\xed kontakt!"})})})]})]})})]}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsxs)(y.a,{bg:i,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:o,children:[(0,p.jsx)(z.D,{size:"md",mb:4,children:"Kontaktn\xed \xfadaje"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Adresa"}),(0,p.jsx)(C.p,{bg:r,value:G.contact_address||"",onChange:oe("contact_address"),placeholder:"Ulice a \u010d.p."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"M\u011bsto"}),(0,p.jsx)(C.p,{bg:r,value:G.contact_city||"",onChange:oe("contact_city"),placeholder:"M\u011bsto"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"PS\u010c"}),(0,p.jsx)(C.p,{bg:r,value:G.contact_zip||"",onChange:oe("contact_zip"),placeholder:"12345"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zem\u011b"}),(0,p.jsx)(C.p,{bg:r,value:G.contact_country||"",onChange:oe("contact_country"),placeholder:"\u010cesk\xe1 republika"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Telefon"}),(0,p.jsx)(C.p,{bg:r,value:G.contact_phone||"",onChange:oe("contact_phone"),placeholder:"+420 123 456 789"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"E-mail"}),(0,p.jsx)(C.p,{bg:r,type:"email",value:G.contact_email||"",onChange:oe("contact_email"),placeholder:"kontakt@klub.cz"})]})]})]}),(0,p.jsxs)(y.a,{bg:i,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:o,children:[(0,p.jsx)(z.D,{size:"md",mb:4,children:"Poloha na map\u011b"}),(0,p.jsx)(jl,{currentLatitude:G.location_latitude,currentLongitude:G.location_longitude,currentZoom:G.map_zoom_level,mapStyle:G.map_style||"positron",clubPrimaryColor:G.primary_color,clubSecondaryColor:G.accent_color,clubName:G.club_name,onImport:e=>{X(t=>(0,h.A)((0,h.A)({},t),{},{location_latitude:e.latitude,location_longitude:e.longitude,map_zoom_level:e.zoom,contact_address:e.street||t.contact_address,contact_city:e.city||t.contact_city,contact_zip:e.zip||t.contact_zip,contact_country:e.country||t.contact_country})),F({title:"Sou\u0159adnice a adresa importov\xe1ny",description:"GPS poloha".concat(e.city?" a kontaktn\xed \xfadaje":""," byly na\u010dteny"),status:"success",duration:3e3})}}),(0,p.jsx)(U.E,{fontSize:"sm",color:s,mt:2,fontStyle:"italic",children:"Mapa se automaticky zobraz\xed na tituln\xed str\xe1nce p\u0159i nastaven\xed GPS sou\u0159adnic."})]}),(0,p.jsxs)(y.a,{bg:i,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:o,children:[(0,p.jsx)(z.D,{size:"md",mb:4,children:"Ru\u010dn\xed nastaven\xed sou\u0159adnic"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:3},spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zem\u011bpisn\xe1 \u0161\xed\u0159ka (Latitude)"}),(0,p.jsx)(C.p,{bg:r,type:"number",step:"0.000001",value:null!==(e=G.location_latitude)&&void 0!==e?e:"",onChange:re("location_latitude"),placeholder:"50.0947"}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Rozsah: -90 a\u017e 90"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zem\u011bpisn\xe1 d\xe9lka (Longitude)"}),(0,p.jsx)(C.p,{bg:r,type:"number",step:"0.000001",value:null!==(t=G.location_longitude)&&void 0!==t?t:"",onChange:re("location_longitude"),placeholder:"17.6997"}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Rozsah: -180 a\u017e 180"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"\xdarove\u0148 p\u0159ibl\xed\u017een\xed (Zoom)"}),(0,p.jsx)(C.p,{bg:r,type:"number",min:"1",max:"20",value:null!==(n=G.map_zoom_level)&&void 0!==n?n:15,onChange:re("map_zoom_level"),placeholder:"15"}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"Rozsah: 1-20 (vy\u0161\u0161\xed = v\u011bt\u0161\xed p\u0159ibl\xed\u017een\xed)"})]})]})]}),(0,p.jsx)(y.a,{bg:i,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:o,children:(0,p.jsx)(gl,{value:G.map_style||"positron",onChange:e=>{X(t=>(0,h.A)((0,h.A)({},t),{},{map_style:e}))},clubPrimaryColor:G.primary_color,clubSecondaryColor:G.accent_color,showPreview:!0})}),G.location_latitude&&G.location_longitude&&(0,p.jsx)(y.a,{bg:i,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:o,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(z.D,{size:"md",children:"N\xe1hled va\u0161\xed mapy"}),(0,p.jsx)(Qt.E,{colorScheme:"green",children:"Aktu\xe1ln\xed poloha"})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:s,children:"Toto je n\xe1hled mapy s va\u0161\xed aktu\xe1ln\xed polohou a vybran\xfdm stylem. Takto se zobraz\xed n\xe1v\u0161t\u011bvn\xedk\u016fm na webu."}),(0,p.jsx)(hi,{latitude:G.location_latitude,longitude:G.location_longitude,zoom:G.map_zoom_level||15,address:"".concat(G.contact_address||"").concat(G.contact_city?", "+G.contact_city:""),clubName:G.club_name,mapStyle:G.map_style||"positron",clubPrimaryColor:G.primary_color,clubSecondaryColor:G.accent_color,height:400})]})}),(0,p.jsx)(y.a,{bg:d,p:4,borderRadius:"md",borderWidth:"1px",borderColor:u,children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",children:"\ud83d\udccd Nezapome\u0148te ulo\u017eit zm\u011bny"}),(0,p.jsx)(U.E,{fontSize:"xs",color:s,children:"Ulo\u017ete nastaven\xed, aby se zm\u011bny projevily na webu."})]}),(0,p.jsx)(T.$,{colorScheme:"blue",size:"lg",onClick:async()=>{te(!0);try{const e="number"===typeof G.location_latitude?G.location_latitude:void 0,t="number"===typeof G.location_longitude?G.location_longitude:void 0,n="number"===typeof G.map_zoom_level?G.map_zoom_level:void 0,a=void 0!==e&&void 0!==t,i={};void 0!==G.contact_address&&(i.contact_address=G.contact_address),void 0!==G.contact_city&&(i.contact_city=G.contact_city),void 0!==G.contact_zip&&(i.contact_zip=G.contact_zip),void 0!==G.contact_country&&(i.contact_country=G.contact_country),void 0!==G.contact_phone&&(i.contact_phone=G.contact_phone),void 0!==G.contact_email&&(i.contact_email=G.contact_email),void 0!==e&&(i.location_latitude=e),void 0!==t&&(i.location_longitude=t),void 0!==n&&(i.map_zoom_level=n),void 0!==G.map_style&&(i.map_style=G.map_style),i.show_map_on_homepage=a,await I(i),F({title:"Nastaven\xed ulo\u017eeno",description:"Kontaktn\xed informace a mapa byly aktualizov\xe1ny",status:"success",duration:3e3})}catch(r){var e,t,n,a,i,o;const s=(null===r||void 0===r||null===(e=r.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.chyba)||(null===r||void 0===r||null===(n=r.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.detail)||(null===r||void 0===r||null===(i=r.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.error)||(null===r||void 0===r?void 0:r.message)||"Ulo\u017een\xed nastaven\xed se nezda\u0159ilo";console.error("Settings save error:",r),F({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:s,status:"error",duration:5e3,isClosable:!0})}finally{te(!1)}},isLoading:Q,loadingText:"Ukl\xe1d\xe1m...",children:"Ulo\u017eit nastaven\xed"})]})})]})})]})]}),(0,p.jsxs)(se.aF,{isOpen:R,onClose:()=>W(!1),size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:E?"Upravit kontakt":"P\u0159idat kontakt"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Jm\xe9no"}),(0,p.jsx)(C.p,{value:O.name,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{name:e.target.value})),placeholder:"Jan Nov\xe1k"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Pozice"}),(0,p.jsx)(C.p,{value:O.position,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{position:e.target.value})),placeholder:"P\u0159edseda, Hlavn\xed tren\xe9r, atd."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Kategorie"}),(0,p.jsxs)(ha.l,{value:O.category_id||"",onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{category_id:e.target.value?parseInt(e.target.value):void 0})),children:[(0,p.jsx)("option",{value:"",children:"Bez p\u0159i\u0159azen\xed"}),v.map(e=>(0,p.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,p.jsx)(_.eK,{fontSize:"xs",children:"P\u0159i\u0159a\u010fte kontakt ke konkr\xe9tn\xed kategorii"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Email"}),(0,p.jsx)(C.p,{type:"email",value:O.email,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{email:e.target.value})),placeholder:"john@example.com"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Telefon"}),(0,p.jsx)(C.p,{value:O.phone,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{phone:e.target.value})),placeholder:"+420 123 456 789"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Fotografie"}),(0,p.jsx)(C.p,{type:"file",accept:"image/*",onChange:async e=>{var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n)if(n.type.startsWith("image/")){$(!0);try{const e=new FormData;e.append("file",n);const t=await(0,m.V6)(e);Z((0,h.A)((0,h.A)({},O),{},{image_url:t.url})),F({title:"Obr\xe1zek nahr\xe1n",status:"success",duration:2e3})}catch(o){var a,i;F({title:"Nahr\xe1v\xe1n\xed selhalo",description:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Nahr\xe1n\xed obr\xe1zku se nezda\u0159ilo",status:"error",duration:3e3})}finally{$(!1)}}else F({title:"Neplatn\xfd typ souboru",description:"Nahrajte pros\xedm obr\xe1zkov\xfd soubor",status:"error",duration:3e3})},disabled:V}),O.image_url&&(0,p.jsx)(y.a,{mt:2,children:(0,p.jsx)("img",{src:El(O.image_url),alt:"N\xe1hled",style:{maxWidth:"200px",borderRadius:"8px"}})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis"}),(0,p.jsx)(va.T,{value:O.description,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{description:e.target.value})),placeholder:"Stru\u010dn\xfd popis nebo bio",rows:3})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Po\u0159ad\xed zobrazen\xed"}),(0,p.jsx)(C.p,{type:"number",value:O.display_order,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{display_order:parseInt(e.target.value)||0}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:O.is_active,onChange:e=>Z((0,h.A)((0,h.A)({},O),{},{is_active:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:()=>W(!1),children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{if(O.name.trim()){A(!0);try{E?(await(async(e,t)=>(await m.Ay.put("/admin/contacts/".concat(e),t)).data)(E.id,O),F({title:"Kontakt aktualizov\xe1n",status:"success",duration:2e3})):(await(async e=>(await m.Ay.post("/admin/contacts",e)).data)(O),F({title:"Kontakt vytvo\u0159en",status:"success",duration:2e3})),W(!1),ne()}catch(n){var e,t;F({title:"Chyba",description:(null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Ulo\u017een\xed kontaktu se nezda\u0159ilo",status:"error",duration:3e3})}finally{A(!1)}}else F({title:"Chyba validace",description:"Jm\xe9no je povinn\xe9",status:"error",duration:3e3})},isLoading:k,children:E?"Aktualizovat":"Vytvo\u0159it"})]})]})]}),(0,p.jsx)(Js.Lt,{isOpen:null!==M,leastDestructiveRef:L,onClose:()=>D(null),children:(0,p.jsx)(H.m,{children:(0,p.jsxs)(Js.EO,{children:[(0,p.jsx)(J.r,{fontSize:"lg",fontWeight:"bold",children:"Smazat kontakt"}),(0,p.jsx)(Y.c,{children:"Opravdu chcete smazat tento kontakt? Tuto akci nelze vr\xe1tit zp\u011bt."}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{ref:L,onClick:()=>D(null),children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"red",onClick:()=>{M&&ce(M.id)},ml:3,isLoading:k,children:"Smazat"})]})]})})})]})})};var Nl=n(3241),Rl=n(2128);const Pl=[{value:"home",label:"Dom\u016f",url:"/"},{value:"about",label:"O klubu",url:"/o-klubu"},{value:"calendar",label:"Kalend\xe1\u0159",url:"/kalendar"},{value:"matches",label:"Z\xe1pasy",url:"/zapasy"},{value:"activities",label:"Aktivity",url:"/aktivity"},{value:"players",label:"Hr\xe1\u010di",url:"/hraci"},{value:"tables",label:"Tabulky",url:"/tabulky"},{value:"blog",label:"\u010cl\xe1nky",url:"/blog"},{value:"videos",label:"Videa",url:"/videa"},{value:"gallery",label:"Fotogalerie",url:"/galerie"},{value:"sponsors",label:"Sponzo\u0159i",url:"/sponzori"},{value:"contact",label:"Kontakt",url:"/kontakt"},{value:"search",label:"Hledat",url:"/hledat"}],Il=[{value:"dashboard",label:"N\xe1st\u011bnka",url:"/admin"},{value:"analytics",label:"Analytika",url:"/admin/analytika"},{value:"teams",label:"T\xfdmy",url:"/admin/tymy"},{value:"matches",label:"Z\xe1pasy",url:"/admin/zapasy"},{value:"activities",label:"Aktivity",url:"/admin/aktivity"},{value:"players",label:"Hr\xe1\u010di",url:"/admin/hraci"},{value:"articles",label:"\u010cl\xe1nky",url:"/admin/clanky"},{value:"about",label:"O klubu",url:"/admin/o-klubu"},{value:"videos",label:"Videa",url:"/admin/videa"},{value:"gallery",label:"Galerie",url:"/admin/galerie"},{value:"sponsors",label:"Sponzo\u0159i",url:"/admin/sponzori"},{value:"messages",label:"Zpr\xe1vy",url:"/admin/zpravy"},{value:"contacts",label:"Kontakty",url:"/admin/kontakty"},{value:"newsletter",label:"Zpravodaj",url:"/admin/newsletter"},{value:"navigation",label:"Navigace",url:"/admin/navigace"},{value:"users",label:"U\u017eivatel\xe9",url:"/admin/uzivatele"},{value:"settings",label:"Nastaven\xed",url:"/admin/nastaveni"},{value:"files",label:"Soubory",url:"/admin/soubory"},{value:"prefetch",label:"Prefetch",url:"/admin/prefetch"},{value:"docs",label:"Dokumentace",url:"/admin/docs"},{value:"webmail",label:"Webmail",url:"https://webmail.example.com"}],Wl=(pe.iYk,pe.ao$,pe.Vk6,pe.feZ,pe.kkU,pe.QEs,pe.O4U,pe.JV,e=>{let{item:t,index:n,total:a,onMoveUp:i,onMoveDown:o,onEdit:r,onDelete:s,onAddChild:l,isExpanded:c,onToggleExpand:d,cardBg:h,borderColor:u,hoverBg:m,level:x=0}=e;const g=t.children&&t.children.length>0,v=32*x;return(0,p.jsxs)(y.a,{ml:"".concat(v,"px"),children:[(0,p.jsx)(sl.Z,{bg:t.visible?h:(0,b.dU)("gray.100","gray.700"),borderWidth:"1px",borderColor:u,_hover:{bg:m},transition:"all 0.2s",children:(0,p.jsx)(cl.b,{py:3,children:(0,p.jsxs)(Q.s,{align:"center",gap:3,children:[g?(0,p.jsx)(K.K,{"aria-label":"Toggle children",icon:c?(0,p.jsx)(me.D,{}):(0,p.jsx)(nn.v,{}),size:"sm",variant:"ghost",onClick:d}):(0,p.jsx)(y.a,{w:"32px"}),(0,p.jsxs)(w.T,{spacing:0,children:[(0,p.jsx)(K.K,{"aria-label":"Nahoru",icon:(0,p.jsx)(Xr.M,{}),size:"xs",isDisabled:0===n,onClick:i,variant:"ghost"}),(0,p.jsx)(K.K,{"aria-label":"Dol\u016f",icon:(0,p.jsx)(me.D,{}),size:"xs",isDisabled:n===a-1,onClick:o,variant:"ghost"})]}),(0,p.jsxs)(w.T,{align:"start",flex:1,spacing:1,children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"md",children:t.label}),(0,p.jsx)(Qt.E,{colorScheme:"external"===t.type?"orange":"dropdown"===t.type?"purple":"page"===t.type?"blue":"green",children:t.type}),!t.visible&&(0,p.jsx)(Qt.E,{colorScheme:"red",children:(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(Nl.O,{}),(0,p.jsx)(U.E,{children:"Skryto"})]})})]}),(0,p.jsxs)(ee.z,{spacing:2,fontSize:"sm",color:"gray.500",children:[t.url&&(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(U.E,{isTruncated:!0,maxW:"300px",children:t.url}),"external"===t.type&&(0,p.jsx)(Rl.p,{})]}),t.page_type&&!t.url&&(0,p.jsxs)(U.E,{children:["Page: ",t.page_type]}),g&&(0,p.jsxs)(Qt.E,{colorScheme:"cyan",children:[t.children.length," ",1===t.children.length?"podpolo\u017eka":"podpolo\u017eek"]})]})]}),(0,p.jsxs)(ee.z,{spacing:1,children:["dropdown"===t.type&&(0,p.jsx)(te.m,{label:"P\u0159idat podpolo\u017eku",children:(0,p.jsx)(K.K,{"aria-label":"P\u0159idat podpolo\u017eku",icon:(0,p.jsx)(es.R,{}),size:"sm",colorScheme:"green",variant:"ghost",onClick:l})}),(0,p.jsx)(te.m,{label:"Upravit",children:(0,p.jsx)(K.K,{"aria-label":"Upravit",icon:(0,p.jsx)(de.q,{}),size:"sm",variant:"ghost",onClick:r})}),(0,p.jsx)(te.m,{label:"Smazat",children:(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(Qr.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:s})})]})]})})}),g&&c&&(0,p.jsx)(w.T,{spacing:2,align:"stretch",mt:2,children:t.children.map(e=>(0,p.jsx)(Wl,{item:e,index:0,total:1,onMoveUp:()=>{},onMoveDown:()=>{},onEdit:()=>r(),onDelete:()=>s(),onAddChild:()=>{},isExpanded:!1,onToggleExpand:()=>{},cardBg:h,borderColor:u,hoverBg:m,level:x+1},e.id))})]})}),Ml=()=>{var e;const[t,n]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[r,s]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,u]=(0,a.useState)(null),[x,g]=(0,a.useState)(null),[v,f]=(0,a.useState)(new Set),[k,A]=(0,a.useState)(!1),E=(0,j.d)(),N=(0,b.dU)("white","gray.800"),R=(0,b.dU)("gray.200","gray.600"),P=(0,b.dU)("gray.50","gray.700"),{isOpen:I,onOpen:W,onClose:M}=(0,X.j)(),{isOpen:D,onOpen:L,onClose:F}=(0,X.j)();(0,a.useEffect)(()=>{O()},[]);const O=async()=>{try{c(!0);const[e,t]=await Promise.all([it(),rt()]);if(console.log("Na\u010dten\xe1 navigace:",e),console.log("Na\u010dten\xe9 soci\xe1ln\xed odkazy:",t),!e||0===e.length){console.log("Navigace je pr\xe1zdn\xe1, automaticky vytv\xe1\u0159\xedme v\xfdchoz\xed navigaci...");try{const e=await st();if(e.seeded){E({title:"V\xfdchoz\xed navigace vytvo\u0159ena",description:"Automaticky vytvo\u0159eno ".concat(e.count," polo\u017eek navigace"),status:"success",duration:4e3,isClosable:!0});const[t,a]=await Promise.all([it(),rt()]),i=(t||[]).filter(e=>!e.requires_admin),r=(t||[]).filter(e=>e.requires_admin);return n(i),o(r),void s(a||[])}}catch(a){console.error("Chyba p\u0159i automatick\xe9m seedov\xe1n\xed:",a)}}const i=(e||[]).filter(e=>!e.requires_admin),r=(e||[]).filter(e=>e.requires_admin);n(i),o(r),s(t||[])}catch(i){var e,t;console.error("Chyba p\u0159i na\u010d\xedt\xe1n\xed navigace:",i),E({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed dat",description:(null===i||void 0===i||null===(e=i.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===i||void 0===i?void 0:i.message)||"Nezn\xe1m\xe1 chyba",status:"error",duration:5e3,isClosable:!0})}finally{c(!1)}},K=async(e,a)=>{if("up"===a&&0===e)return;if("down"===a&&e===t.length-1)return;const i=Array.from(t),o="up"===a?e-1:e+1;[i[e],i[o]]=[i[o],i[e]],n(i);const r=i.map((e,t)=>({id:e.id,display_order:t}));try{await ot(r),E({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(s){E({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),O()}},q=async(e,t)=>{if("up"===t&&0===e)return;if("down"===t&&e===i.length-1)return;const n=Array.from(i),a="up"===t?e-1:e+1;[n[e],n[a]]=[n[a],n[e]],o(n);const r=n.map((e,t)=>({id:e.id,display_order:t}));try{await ot(r),E({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(s){E({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),O()}},V=(e,n,a)=>{if(A(a||!1),e)u(e);else{const e=a?i.length:t.length;u({label:"",type:a?"internal":"page",visible:!0,display_order:e,target:"_self",parent_id:n,requires_admin:a||!1})}W()},$=e=>{f(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},G=async e=>{if(window.confirm("Opravdu smazat tuto polo\u017eku?"))try{await(async e=>{await ve.A.delete("".concat(m.API_URL,"/admin/navigation/").concat(e),{withCredentials:!0})})(e),E({title:"Polo\u017eka smaz\xe1na",status:"success",duration:2e3}),O()}catch(t){E({title:"Chyba p\u0159i maz\xe1n\xed",status:"error",duration:3e3})}};return l?(0,p.jsx)(Mo,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed..."})]})})}):(0,p.jsx)(Mo,{children:(0,p.jsxs)(Z.m,{maxW:"7xl",py:8,children:[(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(ee.z,{justify:"space-between",align:"center",children:[(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va navigace"}),(0,p.jsx)(T.$,{onClick:O,size:"sm",colorScheme:"gray",children:"Obnovit data"})]}),(0,p.jsxs)(xa.F,{status:"info",variant:"left-accent",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(y.a,{flex:"1",children:(0,p.jsx)(ee.z,{spacing:4,children:(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Na\u010dteno:"})," ",t.length," webov\xfdch, ",i.length," admin"]})})})]}),(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Odd\u011blen\xe1 spr\xe1va navigace"}),(0,p.jsxs)(U.E,{fontSize:"sm",mt:1,children:["\u2022 ",(0,p.jsx)("strong",{children:"Webov\xe1 navigace:"})," Menu na ve\u0159ejn\xe9m webu",(0,p.jsx)("br",{}),"\u2022 ",(0,p.jsx)("strong",{children:"Admin panel:"})," Postrann\xed menu v administraci"]})]})]}),(0,p.jsxs)(ra.t,{children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Webov\xe1 navigace"}),(0,p.jsx)(la.o,{children:"Admin panel"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),colorScheme:"blue",onClick:()=>V(),children:"P\u0159idat hlavn\xed polo\u017eku"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"P\u0159etahujte polo\u017eky nahoru/dol\u016f pro zm\u011bnu po\u0159ad\xed. Klikn\u011bte na \u0161ipku pro zobrazen\xed podpolo\u017eek."})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Tipy pro spr\xe1vu navigace:"}),(0,p.jsxs)(U.E,{fontSize:"sm",mt:1,children:['\u2022 Pou\u017eijte typ "Dropdown" pro polo\u017eky s podpolo\u017ekami',(0,p.jsx)("br",{}),"\u2022 Podpolo\u017eky se zobraz\xed p\u0159i najet\xed my\u0161\xed na hlavn\xed polo\u017eku",(0,p.jsx)("br",{}),"\u2022 Polo\u017eky m\u016f\u017eete skr\xfdt bez smaz\xe1n\xed pomoc\xed p\u0159ep\xedna\u010de viditelnosti"]})]})]}),(0,p.jsx)(w.T,{spacing:2,align:"stretch",children:0===t.length?(0,p.jsxs)(xa.F,{status:"warning",variant:"left-accent",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{flex:"1",children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"\u017d\xe1dn\xe9 polo\u017eky navigace"}),(0,p.jsx)(U.E,{fontSize:"sm",mt:1,mb:2,children:"Nebyly nalezeny \u017e\xe1dn\xe9 polo\u017eky navigace. M\u016f\u017eete vytvo\u0159it v\xfdchoz\xed navigaci nebo p\u0159idat polo\u017eky ru\u010dn\u011b."}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:async()=>{if(window.confirm("Vytvo\u0159it v\xfdchoz\xed naviga\u010dn\xed polo\u017eky? Toto lze prov\xe9st pouze pokud datab\xe1ze je pr\xe1zdn\xe1."))try{const e=await st();e.seeded?(E({title:"V\xfdchoz\xed navigace vytvo\u0159ena",description:"Vytvo\u0159eno ".concat(e.count," polo\u017eek"),status:"success",duration:3e3,isClosable:!0}),O()):E({title:"Navigace ji\u017e existuje",description:e.message,status:"info",duration:3e3,isClosable:!0})}catch(n){var e,t;console.error("Chyba p\u0159i seedov\xe1n\xed navigace:",n),E({title:"Chyba p\u0159i vytv\xe1\u0159en\xed v\xfdchoz\xed navigace",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message)||"Nezn\xe1m\xe1 chyba",status:"error",duration:5e3,isClosable:!0})}},children:"Vytvo\u0159it v\xfdchoz\xed navigaci"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>V(),children:"P\u0159idat polo\u017eku ru\u010dn\u011b"})]})]})]}):t.map((e,n)=>(0,p.jsx)(Wl,{item:e,index:n,total:t.length,onMoveUp:()=>K(n,"up"),onMoveDown:()=>K(n,"down"),onEdit:()=>V(e),onDelete:()=>G(e.id),onAddChild:()=>V(void 0,e.id),isExpanded:v.has(e.id),onToggleExpand:()=>$(e.id),cardBg:N,borderColor:R,hoverBg:P},e.id))})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),colorScheme:"purple",onClick:()=>V(void 0,void 0,!0),children:"P\u0159idat polo\u017eku do admin panelu"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Spr\xe1va bo\u010dn\xedho menu v administraci"})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",colorScheme:"purple",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Spr\xe1va admin panelu:"}),(0,p.jsxs)(U.E,{fontSize:"sm",mt:1,children:["\u2022 Vyberte z p\u0159ednastaven\xfdch str\xe1nek nebo p\u0159idejte vlastn\xed",(0,p.jsx)("br",{}),"\u2022 Skryjte nepot\u0159ebn\xe9 sekce pomoc\xed viditelnosti",(0,p.jsx)("br",{}),"\u2022 P\u0159idejte extern\xed odkazy (nap\u0159. Webmail)",(0,p.jsx)("br",{}),"\u2022 Kategorizujte pomoc\xed dropdown menu"]})]})]}),(0,p.jsxs)(w.T,{spacing:2,align:"stretch",children:[i.map((e,t)=>(0,p.jsx)(Wl,{item:e,index:t,total:i.length,onMoveUp:()=>q(t,"up"),onMoveDown:()=>q(t,"down"),onEdit:()=>V(e,void 0,!0),onDelete:()=>G(e.id),onAddChild:()=>V(void 0,e.id,!0),isExpanded:v.has(e.id),onToggleExpand:()=>$(e.id),cardBg:N,borderColor:R,hoverBg:P},e.id)),0===i.length&&(0,p.jsxs)(xa.F,{status:"warning",children:[(0,p.jsx)(ga._,{}),'\u017d\xe1dn\xe9 vlastn\xed polo\u017eky v admin panelu. Pou\u017eijte tla\u010d\xedtko "P\u0159idat polo\u017eku" pro vytvo\u0159en\xed vlastn\xed navigace.']})]})]})})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:I,onClose:M,size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsxs)(J.r,{children:[null!==d&&void 0!==d&&d.id?"Upravit polo\u017eku":"Nov\xe1 polo\u017eka",k&&(0,p.jsx)(Qt.E,{ml:2,colorScheme:"purple",children:"Admin panel"})]}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(w.T,{spacing:4,children:[k&&!(null!==d&&void 0!==d&&d.id)&&(0,p.jsxs)(xa.F,{status:"info",fontSize:"sm",children:[(0,p.jsx)(ga._,{}),"Vytv\xe1\u0159te polo\u017eku pro bo\u010dn\xed menu v administraci. M\u016f\u017eete vybrat p\u0159ednastaven\xe9 str\xe1nky nebo p\u0159idat vlastn\xed odkazy."]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev"}),(0,p.jsx)(C.p,{value:(null===d||void 0===d?void 0:d.label)||"",onChange:e=>u((0,h.A)((0,h.A)({},d),{},{label:e.target.value})),placeholder:k?"Nap\u0159. N\xe1st\u011bnka, Webmail":"Nap\u0159. Dom\u016f, O klubu"})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Typ"}),(0,p.jsx)(ha.l,{value:(null===d||void 0===d?void 0:d.type)||(k?"internal":"page"),onChange:e=>u((0,h.A)((0,h.A)({},d),{},{type:e.target.value})),children:k?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"internal",children:"Admin str\xe1nka (vyberte existuj\xedc\xed)"}),(0,p.jsx)("option",{value:"external",children:"Extern\xed odkaz (nap\u0159. Webmail)"}),(0,p.jsx)("option",{value:"dropdown",children:"Kategorie (m\xe1 podpolo\u017eky)"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"page",children:"Str\xe1nka (vyberte existuj\xedc\xed)"}),(0,p.jsx)("option",{value:"internal",children:"Intern\xed odkaz (vlastn\xed URL)"}),(0,p.jsx)("option",{value:"external",children:"Extern\xed odkaz"}),(0,p.jsx)("option",{value:"dropdown",children:"Dropdown (m\xe1 podpolo\u017eky)"})]})})]}),"page"===(null===d||void 0===d?void 0:d.type)&&!k&&(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Webov\xe1 str\xe1nka"}),(0,p.jsxs)(ha.l,{value:(null===d||void 0===d?void 0:d.page_type)||"",onChange:e=>{const t=Pl.find(t=>t.value===e.target.value);u((0,h.A)((0,h.A)({},d),{},{page_type:e.target.value,url:(null===t||void 0===t?void 0:t.url)||"",label:(null===d||void 0===d?void 0:d.label)||(null===t||void 0===t?void 0:t.label)||""}))},children:[(0,p.jsx)("option",{value:"",children:"-- Vyberte str\xe1nku --"}),Pl.map(e=>(0,p.jsxs)("option",{value:e.value,children:[e.label," (",e.url,")"]},e.value))]})]}),"internal"===(null===d||void 0===d?void 0:d.type)&&k&&(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Admin str\xe1nka"}),(0,p.jsxs)(ha.l,{value:(null===d||void 0===d?void 0:d.page_type)||"",onChange:e=>{var t;const n=Il.find(t=>t.value===e.target.value),a=null===n||void 0===n||null===(t=n.url)||void 0===t?void 0:t.startsWith("http");u((0,h.A)((0,h.A)({},d),{},{page_type:e.target.value,url:(null===n||void 0===n?void 0:n.url)||"",label:(null===d||void 0===d?void 0:d.label)||(null===n||void 0===n?void 0:n.label)||"",type:a?"external":"internal"}))},children:[(0,p.jsx)("option",{value:"",children:"-- Vyberte admin str\xe1nku --"}),(0,p.jsxs)("optgroup",{label:"Hlavn\xed",children:[(0,p.jsx)("option",{value:"dashboard",children:"N\xe1st\u011bnka (/admin)"}),(0,p.jsx)("option",{value:"analytics",children:"Analytika (/admin/analytika)"})]}),(0,p.jsxs)("optgroup",{label:"Obsah",children:[(0,p.jsx)("option",{value:"teams",children:"T\xfdmy (/admin/tymy)"}),(0,p.jsx)("option",{value:"matches",children:"Z\xe1pasy (/admin/zapasy)"}),(0,p.jsx)("option",{value:"activities",children:"Aktivity (/admin/aktivity)"}),(0,p.jsx)("option",{value:"players",children:"Hr\xe1\u010di (/admin/hraci)"}),(0,p.jsx)("option",{value:"articles",children:"\u010cl\xe1nky (/admin/clanky)"}),(0,p.jsx)("option",{value:"videos",children:"Videa (/admin/videa)"}),(0,p.jsx)("option",{value:"gallery",children:"Galerie (/admin/galerie)"})]}),(0,p.jsxs)("optgroup",{label:"Komunikace",children:[(0,p.jsx)("option",{value:"messages",children:"Zpr\xe1vy (/admin/zpravy)"}),(0,p.jsx)("option",{value:"contacts",children:"Kontakty (/admin/kontakty)"}),(0,p.jsx)("option",{value:"newsletter",children:"Zpravodaj (/admin/newsletter)"})]}),(0,p.jsxs)("optgroup",{label:"Nastaven\xed",children:[(0,p.jsx)("option",{value:"navigation",children:"Navigace (/admin/navigace)"}),(0,p.jsx)("option",{value:"users",children:"U\u017eivatel\xe9 (/admin/uzivatele)"}),(0,p.jsx)("option",{value:"settings",children:"Nastaven\xed (/admin/nastaveni)"}),(0,p.jsx)("option",{value:"files",children:"Soubory (/admin/soubory)"}),(0,p.jsx)("option",{value:"prefetch",children:"Prefetch (/admin/prefetch)"}),(0,p.jsx)("option",{value:"docs",children:"Dokumentace (/admin/docs)"})]}),(0,p.jsx)("optgroup",{label:"Extern\xed odkazy",children:(0,p.jsx)("option",{value:"webmail",children:"Webmail (vlastn\xed URL)"})})]})]}),"dropdown"===(null===d||void 0===d?void 0:d.type)&&(0,p.jsxs)(xa.F,{status:"info",fontSize:"sm",children:[(0,p.jsx)(ga._,{}),'Po vytvo\u0159en\xed t\xe9to polo\u017eky m\u016f\u017eete p\u0159idat podpolo\u017eky kliknut\xedm na tla\u010d\xedtko "P\u0159idat podpolo\u017eku".']}),("internal"===(null===d||void 0===d?void 0:d.type)||"external"===(null===d||void 0===d?void 0:d.type))&&(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"URL"}),(0,p.jsx)(C.p,{value:(null===d||void 0===d?void 0:d.url)||"",onChange:e=>u((0,h.A)((0,h.A)({},d),{},{url:e.target.value})),placeholder:"external"===(null===d||void 0===d?void 0:d.type)?"https://example.com":"/vlastni-stranka"})]}),(null===d||void 0===d?void 0:d.parent_id)&&(0,p.jsxs)(xa.F,{status:"warning",fontSize:"sm",children:[(0,p.jsx)(ga._,{}),"Toto je podpolo\u017eka. Zobraz\xed se v dropdown menu rodi\u010dovsk\xe9 polo\u017eky."]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis (voliteln\xe9)"}),(0,p.jsx)(va.T,{value:(null===d||void 0===d?void 0:d.css_class)||"",onChange:e=>u((0,h.A)((0,h.A)({},d),{},{css_class:e.target.value})),placeholder:"Kr\xe1tk\xfd popis pro administr\xe1tory",rows:2})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"CSS t\u0159\xedda (voliteln\xe9)"}),(0,p.jsx)(C.p,{value:(null===d||void 0===d?void 0:d.icon)||"",onChange:e=>u((0,h.A)((0,h.A)({},d),{},{icon:e.target.value})),placeholder:"custom-class"})]}),"external"===(null===d||void 0===d?void 0:d.type)&&(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Target"}),(0,p.jsxs)(ha.l,{value:(null===d||void 0===d?void 0:d.target)||"_self",onChange:e=>u((0,h.A)((0,h.A)({},d),{},{target:e.target.value})),children:[(0,p.jsx)("option",{value:"_self",children:"Stejn\xe9 okno"}),(0,p.jsx)("option",{value:"_blank",children:"Nov\xe9 okno"})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Viditeln\xe9"}),(0,p.jsx)(pa.d,{isChecked:null===(e=null===d||void 0===d?void 0:d.visible)||void 0===e||e,onChange:e=>u((0,h.A)((0,h.A)({},d),{},{visible:e.target.checked}))})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:M,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{if(d)try{d.id?(await(async(e,t)=>(await ve.A.put("".concat(m.API_URL,"/admin/navigation/").concat(e),t,{withCredentials:!0})).data)(d.id,d),E({title:"Polo\u017eka aktualizov\xe1na",status:"success",duration:2e3})):(await(async e=>(await ve.A.post("".concat(m.API_URL,"/admin/navigation"),e,{withCredentials:!0})).data)(d),E({title:"Polo\u017eka vytvo\u0159ena",status:"success",duration:2e3})),M(),O()}catch(e){E({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:3e3})}},children:"Ulo\u017eit"})]})]})]})]})})},Dl=()=>{var e,t,n,i;const o=(0,j.d)(),r=(0,l.jE)(),[s,c]=a.useState(""),[d,h]=a.useState(""),[u,x]=a.useState(""),[g,v]=a.useState(!1),b=(0,X.j)(),[f,k]=a.useState(null),[z,_]=a.useState(null),S=(0,xe.I)({queryKey:["admin-shortlinks"],queryFn:ps,staleTime:6e4}),A=async e=>{try{k(e),_(null),b.onOpen();const t=await async function(e){return(await m.Ay.get("/admin/shortlinks/".concat(e,"/stats"))).data}(e.id);_(t)}catch(t){o({title:"Na\u010dten\xed statistik selhalo",status:"error"})}};return(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(U.E,{fontSize:"xl",fontWeight:"bold",children:"Zkr\xe1cen\xe9 odkazy"}),(0,p.jsx)(K.K,{"aria-label":"Obnovit",icon:(0,p.jsx)(q.wO2,{}),onClick:()=>r.invalidateQueries({queryKey:["admin-shortlinks"]})})]}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,mb:6,bg:"bg.card",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"Vytvo\u0159it nov\xfd odkaz"}),(0,p.jsxs)(ee.z,{spacing:2,flexWrap:"wrap",children:[(0,p.jsx)(C.p,{placeholder:"https://\u2026",value:s,onChange:e=>c(e.target.value),flex:3}),(0,p.jsx)(C.p,{placeholder:"Titulek (voliteln\xfd)",value:d,onChange:e=>h(e.target.value),flex:2}),(0,p.jsx)(C.p,{placeholder:"Vlastn\xed k\xf3d (voliteln\xe9)",value:u,onChange:e=>x(e.target.value),flex:1}),(0,p.jsx)(T.$,{onClick:async()=>{const e=s.trim();if(e)try{v(!0);const t=await ms({target_url:e,title:d.trim()||void 0,code:u.trim()||void 0,active:!0});await navigator.clipboard.writeText(t.short_url),o({title:"Odkaz vytvo\u0159en",description:"Zkop\xedrov\xe1no: ".concat(t.short_url),status:"success"}),c(""),h(""),x(""),r.invalidateQueries({queryKey:["admin-shortlinks"]})}catch(t){o({title:"Vytvo\u0159en\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}finally{v(!1)}else o({title:"Zadejte c\xedlovou URL",status:"warning"})},isLoading:g,colorScheme:"blue",children:"Vytvo\u0159it"})]})]}),(0,p.jsx)(y.a,{borderWidth:"1px",borderRadius:"lg",overflowX:"auto",bg:"bg.card",children:(0,p.jsxs)(Ui.X,{size:"sm",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"K\xf3d"}),(0,p.jsx)(Oi.Th,{children:"C\xedl"}),(0,p.jsx)(Oi.Th,{children:"Titulek"}),(0,p.jsx)(Oi.Th,{children:"Zdroj"}),(0,p.jsx)(Oi.Th,{children:"Prokliky"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsxs)(Zi.N,{children:[null===(e=S.data)||void 0===e||null===(t=e.items)||void 0===t?void 0:t.map(e=>{var t;const n="".concat(window.location.origin,"/s/").concat(e.code),a=e.source_type?"".concat(e.source_type).concat(e.source_id?"#".concat(e.source_id):""):"-";return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsx)(Qt.E,{colorScheme:"blue",children:e.code})}),(0,p.jsx)(Ki.Td,{maxW:"420px",children:(0,p.jsx)(L.N,{href:e.target_url,isExternal:!0,color:"blue.600",children:e.target_url})}),(0,p.jsx)(Ki.Td,{children:e.title||"-"}),(0,p.jsx)(Ki.Td,{children:a}),(0,p.jsx)(Ki.Td,{children:null!==(t=e.click_count)&&void 0!==t?t:0}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(K.K,{"aria-label":"Otev\u0159\xedt kr\xe1tkou URL",icon:(0,p.jsx)(q.HaR,{}),as:L.N,href:n,isExternal:!0}),(0,p.jsx)(K.K,{"aria-label":"Zkop\xedrovat",icon:(0,p.jsx)(q.ydS,{}),onClick:async()=>{await navigator.clipboard.writeText(n),o({title:"Zkop\xedrov\xe1no",description:n,status:"success",duration:2e3})}}),(0,p.jsx)(K.K,{"aria-label":"Statistiky",icon:(0,p.jsx)(q.vQY,{}),onClick:()=>A(e)})]})})]},e.id)}),(!(null!==(n=S.data)&&void 0!==n&&n.items)||0===S.data.items.length)&&(0,p.jsx)(Fi.Tr,{children:(0,p.jsx)(Ki.Td,{colSpan:6,children:(0,p.jsx)(U.E,{p:3,children:"\u017d\xe1dn\xe9 odkazy"})})})]})]})}),(0,p.jsxs)(se.aF,{isOpen:b.isOpen,onClose:b.onClose,size:"xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsxs)(J.r,{children:["Statistiky: ",null===f||void 0===f?void 0:f.code]}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:z?(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:1,children:"Prokliky za posledn\xedch 30 dn\xed"}),(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Den"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,p.jsx)(Zi.N,{children:null===(i=z.timeseries)||void 0===i?void 0:i.map((e,t)=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.date}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.count})]},t))})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:1,children:"Referrers (Top)"}),(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Referrer"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,p.jsx)(Zi.N,{children:(z.referrers||[]).map((e,t)=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.Referrer||"-"}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.Count})]},t))})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:1,children:"UTM kombinace (Top)"}),(0,p.jsxs)(Ui.X,{size:"sm",variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"Source"}),(0,p.jsx)(Oi.Th,{children:"Medium"}),(0,p.jsx)(Oi.Th,{children:"Campaign"}),(0,p.jsx)(Oi.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,p.jsx)(Zi.N,{children:(z.utms||[]).map((e,t)=>(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:e.Source||"-"}),(0,p.jsx)(Ki.Td,{children:e.Medium||"-"}),(0,p.jsx)(Ki.Td,{children:e.Campaign||"-"}),(0,p.jsx)(Ki.Td,{isNumeric:!0,children:e.Count})]},t))})]})]})]}):(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{onClick:b.onClose,children:"Zav\u0159\xedt"})})]})]})]})})},Ul=()=>{const{user:e,updateUser:t}=v(),n=e=>{const t=String(e||"").trim();if(!t)return{fn:"",ln:""};const n=t.split(/\s+/);return 1===n.length?{fn:n[0],ln:""}:{fn:n[0],ln:n.slice(1).join(" ")}},i=n(null===e||void 0===e?void 0:e.name),[o,r]=(0,a.useState)(i.fn),[s,l]=(0,a.useState)(i.ln),[c,d]=(0,a.useState)(!1),[h,u]=(0,a.useState)(""),x=(0,j.d)();(0,a.useEffect)(()=>{const t=n(null===e||void 0===e?void 0:e.name);r(t.fn),l(t.ln)},[null===e||void 0===e?void 0:e.name]),(0,a.useEffect)(()=>{(async()=>{try{var e;const t=await m.Ay.get("/newsletter/token/me");u((null===(e=t.data)||void 0===e?void 0:e.token)||"")}catch(t){}})()},[]);const g=h?"/newsletter/preferences?token=".concat(encodeURIComponent(h)):"";return(0,p.jsxs)(Z.m,{maxW:"5xl",py:8,children:[(0,p.jsx)(z.D,{size:"lg",mb:6,children:"Fan z\xf3na"}),(0,p.jsxs)(ra.t,{colorScheme:"blue",isFitted:!0,variant:"enclosed",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Osobn\xed \xfadaje"}),(0,p.jsx)(la.o,{children:"Newsletter"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsx)(y.a,{as:"form",onSubmit:async e=>{e.preventDefault(),d(!0);try{var n;const e=null===(n=(await m.Ay.put("/me",{first_name:o,last_name:s})).data)||void 0===n?void 0:n.user;if(e){const n="".concat(e.first_name||o," ").concat(e.last_name||s).trim();t({name:n})}x({title:"Ulo\u017eeno",description:"Osobn\xed \xfadaje byly aktualizov\xe1ny.",status:"success",duration:3e3})}catch(r){var a,i;x({title:"Chyba",description:(null===r||void 0===r||null===(a=r.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Nelze ulo\u017eit zm\u011bny",status:"error"})}finally{d(!1)}},maxW:"lg",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Jm\xe9no"}),(0,p.jsx)(C.p,{value:o,onChange:e=>r(e.target.value),placeholder:"Jm\xe9no"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"P\u0159\xedjmen\xed"}),(0,p.jsx)(C.p,{value:s,onChange:e=>l(e.target.value),placeholder:"P\u0159\xedjmen\xed"})]}),(0,p.jsx)(ee.z,{children:(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",isLoading:c,children:"Ulo\u017eit"})})]})})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{align:"start",spacing:4,children:[(0,p.jsx)(U.E,{children:"Spravujte p\u0159edvolby newsletteru nebo se odhlaste."}),g?(0,p.jsx)(T.$,{as:L.N,href:g,colorScheme:"blue",children:"Otev\u0159\xedt nastaven\xed newsletteru"}):(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1m odkaz na nastaven\xed\u2026"})]})})]})]})]})};var Ll=n(5206);const Fl=()=>{var e,t,n,i;const o=(0,j.d)(),r=(0,l.jE)(),{isOpen:s,onOpen:c,onClose:d}=(0,X.j)(),{isOpen:u,onOpen:x,onClose:g}=(0,X.j)(),[v,b]=(0,a.useState)(""),[f,A]=(0,a.useState)(null),[E,N]=(0,a.useState)(null),[R,P]=(0,a.useState)([]),[I,W]=(0,a.useState)(!1),[M,D]=(0,a.useState)({title:"",description:"",type:"single",style:"auto",status:"draft",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),{data:L,isLoading:F}=(0,xe.I)({queryKey:["admin-polls",v],queryFn:()=>(async e=>(await m.Ay.get("/admin/polls",{params:e})).data)(v?{status:v}:void 0)}),O=(0,Mn.n)({mutationFn:Cn,onSuccess:()=>{r.invalidateQueries({queryKey:["admin-polls"]}),o({title:"Anketa vytvo\u0159ena",status:"success",duration:3e3}),d(),Q()},onError:e=>{var t,n;o({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se vytvo\u0159it anketu",status:"error",duration:5e3})}}),q=(0,Mn.n)({mutationFn:e=>{let{id:t,data:n}=e;return An(t,n)},onSuccess:()=>{r.invalidateQueries({queryKey:["admin-polls"]}),o({title:"Anketa aktualizov\xe1na",status:"success",duration:3e3}),d(),Q()},onError:e=>{var t,n;o({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se aktualizovat anketu",status:"error",duration:5e3})}}),V=(0,Mn.n)({mutationFn:En,onSuccess:()=>{r.invalidateQueries({queryKey:["admin-polls"]}),o({title:"Anketa smaz\xe1na",status:"success",duration:3e3})},onError:e=>{var t,n;o({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se smazat anketu",status:"error",duration:5e3})}}),{data:$,isLoading:G}=(0,xe.I)({queryKey:["poll-stats",null===E||void 0===E||null===(e=E.poll)||void 0===e?void 0:e.id],queryFn:()=>Tn(E.poll.id),enabled:!(null===E||void 0===E||null===(t=E.poll)||void 0===t||!t.id)}),Q=()=>{D({title:"",description:"",type:"single",style:"auto",status:"draft",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),A(null)},te=e=>{if("rating5"===e){const e=Array.from({length:5}).map((e,t)=>({text:String(t+1),display_order:t+1}));D({title:"Hodnocen\xed z\xe1pasu",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 5 = nejlep\u0161\xed)",type:"rating",style:"rating-stars",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:e})}else if("rating10"===e){const e=Array.from({length:10}).map((e,t)=>({text:String(t+1),display_order:t+1}));D({title:"Hodnocen\xed z\xe1pasu (1\u201310)",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 10 = nejlep\u0161\xed)",type:"rating",style:"rating-scale",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:e})}else"attendance"===e&&D({title:"Doraz\xed\u0161 na sch\u016fzku?",description:"Dej n\xe1m v\u011bd\u011bt, zda doraz\xed\u0161.",type:"single",style:"choices-chips",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"Ano",display_order:0},{text:"Ne",display_order:1},{text:"Mo\u017en\xe1",display_order:2}]});c()},ie=(e,t,n)=>{const a=[...M.options];a[e]=(0,h.A)((0,h.A)({},a[e]),{},{[t]:n}),D((0,h.A)((0,h.A)({},M),{},{options:a}))};(0,a.useEffect)(()=>{s&&0===R.length&&(W(!0),bt().then(e=>{null!==e&&void 0!==e&&e.videos&&P(e.videos)}).catch(()=>{o({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst videa",status:"error",duration:3e3})}).finally(()=>{W(!1)}))},[s,R.length,o]),(0,a.useEffect)(()=>{if("rating"!==M.type)return;const e=M.style||"auto",t="rating-scale"===e?"rating-scale":"rating-stars",n="rating-scale"===t?10:5,a=M.options.length===n&&M.options.every((e,t)=>String(e.text)===String(t+1));e===t&&!M.allow_multiple&&1===(M.max_choices||1)&&a||D((0,h.A)((0,h.A)({},M),{},{style:t,allow_multiple:!1,max_choices:1,options:Array.from({length:n}).map((e,t)=>({text:String(t+1),display_order:t}))}))},[M.type,M.style,M.options,M.allow_multiple,M.max_choices]);return F?(0,p.jsx)(Mo,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed anket..."})]})})}):(0,p.jsx)(Mo,{children:(0,p.jsxs)(Z.m,{maxW:"7xl",py:8,children:[(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(z.D,{size:"lg",children:"Spr\xe1va anket"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsxs)(ne.W,{children:[(0,p.jsx)(ae.I,{as:T.$,rightIcon:(0,p.jsx)(me.D,{}),variant:"outline",children:"P\u0159edvolby"}),(0,p.jsxs)(oe.c,{children:[(0,p.jsx)(re.D,{onClick:()=>te("rating5"),children:"Hodnocen\xed z\xe1pasu (5 hv\u011bzd)"}),(0,p.jsx)(re.D,{onClick:()=>te("rating10"),children:"Hodnocen\xed z\xe1pasu (1\u201310)"}),(0,p.jsx)(re.D,{onClick:()=>te("attendance"),children:"Doraz\xed\u0161 na sch\u016fzku?"})]})]}),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),colorScheme:"blue",onClick:()=>{Q(),c()},children:"Nov\xe1 anketa"})]})]}),(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:"Ankety a hlasov\xe1n\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Vytvo\u0159te interaktivn\xed ankety pro fanou\u0161ky - Hr\xe1\u010d z\xe1pasu, p\u0159edpov\u011b\u010f v\xfdsledku, designov\xe9 ankety a dal\u0161\xed."})]})]}),(0,p.jsx)(ee.z,{children:(0,p.jsxs)(ha.l,{value:v,onChange:e=>b(e.target.value),maxW:"200px",children:[(0,p.jsx)("option",{value:"",children:"V\u0161echny stavy"}),(0,p.jsx)("option",{value:"draft",children:"Koncepty"}),(0,p.jsx)("option",{value:"active",children:"Aktivn\xed"}),(0,p.jsx)("option",{value:"closed",children:"Uzav\u0159en\xe9"}),(0,p.jsx)("option",{value:"archived",children:"Archivovan\xe9"})]})}),(0,p.jsx)(y.a,{overflowX:"auto",children:(0,p.jsxs)(Ui.X,{variant:"simple",children:[(0,p.jsx)(Li.d,{children:(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Oi.Th,{children:"N\xe1zev"}),(0,p.jsx)(Oi.Th,{children:"Typ"}),(0,p.jsx)(Oi.Th,{children:"Stav"}),(0,p.jsx)(Oi.Th,{children:"Po\u010det hlas\u016f"}),(0,p.jsx)(Oi.Th,{children:"Vytvo\u0159eno"}),(0,p.jsx)(Oi.Th,{children:"Akce"})]})}),(0,p.jsx)(Zi.N,{children:null===L||void 0===L?void 0:L.map(e=>{return(0,p.jsxs)(Fi.Tr,{children:[(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(w.T,{align:"start",spacing:0,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:e.title}),e.featured&&(0,p.jsx)(Qt.E,{colorScheme:"purple",children:"Zv\xfdrazn\u011bn\xe1"})]})}),(0,p.jsx)(Ki.Td,{children:e.type}),(0,p.jsx)(Ki.Td,{children:(t=e.status,(0,p.jsx)(Qt.E,{colorScheme:{draft:"gray",active:"green",closed:"orange",archived:"red"}[t]||"gray",children:t}))}),(0,p.jsx)(Ki.Td,{children:e.total_votes}),(0,p.jsx)(Ki.Td,{children:new Date(e.created_at).toLocaleDateString("cs-CZ")}),(0,p.jsx)(Ki.Td,{children:(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(K.K,{"aria-label":"Statistiky",icon:(0,p.jsx)(Ll.t,{}),size:"sm",onClick:()=>(async e=>{try{const t=await Tn(e.id);N(t),x()}catch(t){o({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst statistiky",status:"error",duration:3e3})}})(e)}),(0,p.jsx)(K.K,{"aria-label":"Upravit",icon:(0,p.jsx)(de.q,{}),size:"sm",onClick:()=>(e=>{A(e),D({title:e.title,description:e.description,type:e.type,style:e.style||"auto",status:e.status,start_date:e.start_date,end_date:e.end_date,allow_multiple:e.allow_multiple,max_choices:e.max_choices,show_results:e.show_results,require_auth:e.require_auth,allow_guest_vote:e.allow_guest_vote,featured:e.featured,category_id:e.category_id,related_match_id:e.related_match_id,related_article_id:e.related_article_id,related_event_id:e.related_event_id,related_video_url:e.related_video_url,image_url:e.image_url,options:e.options.map(e=>({text:e.text,description:e.description,image_url:e.image_url,display_order:e.display_order,player_id:e.player_id}))}),c()})(e)}),(0,p.jsx)(K.K,{"aria-label":"Smazat",icon:(0,p.jsx)(Qr.d,{}),size:"sm",colorScheme:"red",onClick:()=>{return t=e.id,void(window.confirm("Opravdu chcete smazat tuto anketu?")&&V.mutate(t));var t}})]})})]},e.id);var t})})]})}),0===(null===L||void 0===L?void 0:L.length)&&(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),"Zat\xedm nem\xe1te \u017e\xe1dn\xe9 ankety. Vytvo\u0159te prvn\xed anketu pomoc\xed tla\u010d\xedtka v\xfd\u0161e."]})]}),(0,p.jsxs)(se.aF,{isOpen:s,onClose:d,size:"4xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:f?"Upravit anketu":"Nov\xe1 anketa"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:(0,p.jsxs)(ra.t,{children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Z\xe1kladn\xed"}),"rating"!==M.type&&(0,p.jsx)(la.o,{children:"Mo\u017enosti"}),(0,p.jsx)(la.o,{children:"Nastaven\xed"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(ee.z,{w:"full",justify:"space-between",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",children:"Doporu\u010den\xe9 p\u0159edvolby"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"sm",onClick:()=>te("rating5"),children:"Hodnocen\xed (5 hv\u011bzd)"}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>te("rating10"),children:"Hodnocen\xed (1\u201310)"}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>te("attendance"),children:"Doch\xe1zka"})]})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"N\xe1zev ankety"}),(0,p.jsx)(C.p,{value:M.title,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{title:e.target.value})),placeholder:"Nap\u0159. Hr\xe1\u010d z\xe1pasu"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis"}),(0,p.jsx)(va.T,{value:M.description,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{description:e.target.value})),placeholder:"Voliteln\xfd popis ankety"})]}),(0,p.jsxs)(Tt.r,{columns:3,spacing:4,w:"full",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Typ"}),(0,p.jsxs)(ha.l,{value:M.type,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{type:e.target.value})),children:[(0,p.jsx)("option",{value:"single",children:"Jedna volba"}),(0,p.jsx)("option",{value:"multiple",children:"V\xedce voleb"}),(0,p.jsx)("option",{value:"rating",children:"Hodnocen\xed"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Stav"}),(0,p.jsxs)(ha.l,{value:M.status,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{status:e.target.value})),children:[(0,p.jsx)("option",{value:"draft",children:"Koncept"}),(0,p.jsx)("option",{value:"active",children:"Aktivn\xed"}),(0,p.jsx)("option",{value:"closed",children:"Uzav\u0159en\xe1"}),(0,p.jsx)("option",{value:"archived",children:"Archivovan\xe1"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Styl"}),(0,p.jsxs)(ha.l,{value:M.style||"auto",onChange:e=>D((0,h.A)((0,h.A)({},M),{},{style:e.target.value})),children:[(0,p.jsx)("option",{value:"auto",children:"Automaticky"}),"rating"===M.type?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"rating-stars",children:"Hv\u011bzdi\u010dky"}),(0,p.jsx)("option",{value:"rating-scale",children:"\u010c\xedseln\xe1 stupnice"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("option",{value:"choices-list",children:"Seznam"}),(0,p.jsx)("option",{value:"choices-chips",children:"\u0160t\xedtky"}),(0,p.jsx)("option",{value:"choices-cards",children:"Karty"})]})]})]})]}),"rating"===M.type&&(0,p.jsxs)(y.a,{w:"full",borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,p.jsx)(U.E,{fontSize:"sm",mb:2,children:"Mo\u017enosti se generuj\xed automaticky podle stylu:"}),(0,p.jsx)(U.E,{fontSize:"sm",children:Array.from({length:"rating-scale"===M.style?10:5}).map((e,t)=>String(t+1)).join(", ")})]}),(0,p.jsxs)(Tt.r,{columns:2,spacing:4,w:"full",children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Datum zah\xe1jen\xed"}),(0,p.jsx)(C.p,{type:"datetime-local",value:M.start_date||"",onChange:e=>D((0,h.A)((0,h.A)({},M),{},{start_date:e.target.value}))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Datum ukon\u010den\xed"}),(0,p.jsx)(C.p,{type:"datetime-local",value:M.end_date||"",onChange:e=>D((0,h.A)((0,h.A)({},M),{},{end_date:e.target.value}))})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Video z klubov\xe9ho kan\xe1lu (voliteln\xe9)"}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",mb:2,children:"P\u0159ipojte anketu k videu z va\u0161eho YouTube kan\xe1lu"}),I?(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(zn.y,{size:"sm"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Na\u010d\xedt\xe1n\xed vide\xed..."})]}):0===R.length?(0,p.jsxs)(xa.F,{status:"info",size:"sm",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"\u017d\xe1dn\xe1 videa nenalezena. P\u0159idejte videa v Nastaven\xed \u2192 Videa."})]}):(0,p.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,p.jsx)(ha.l,{value:M.related_video_url||"",onChange:e=>D((0,h.A)((0,h.A)({},M),{},{related_video_url:e.target.value})),placeholder:"Vyberte video (nebo nechte pr\xe1zdn\xe9)",children:R.map(e=>(0,p.jsxs)("option",{value:"https://www.youtube.com/watch?v=".concat(e.video_id),children:[e.title," ",e.published_text?"(".concat(e.published_text,")"):""]},e.video_id))}),M.related_video_url&&(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"md",p:2,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"N\xe1hled vybran\xe9ho videa:"}),(()=>{const e=R.find(e=>"https://www.youtube.com/watch?v=".concat(e.video_id)===M.related_video_url);return e?(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(k._,{src:e.thumbnail_url,alt:e.title,boxSize:"120px",objectFit:"cover",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:e.title}),e.published_text&&(0,p.jsx)(Qt.E,{size:"sm",children:e.published_text})]})]}):null})()]})]}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Pozn\xe1mka: Propojen\xed s \u010dl\xe1nky a aktivitami se nastavuje p\u0159\xedmo v editoru \u010dl\xe1nku/aktivity."})]})]})}),"rating"!==M.type&&(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{spacing:4,align:"stretch",children:[M.options.map((e,t)=>(0,p.jsx)(sl.Z,{children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(ee.z,{align:"start",children:[(0,p.jsxs)(w.T,{flex:1,spacing:3,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsxs)(S.l,{children:["Mo\u017enost ",t+1]}),(0,p.jsx)(C.p,{value:e.text,onChange:e=>ie(t,"text",e.target.value),placeholder:"Text mo\u017enosti"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Popis (voliteln\xe9)"}),(0,p.jsx)(C.p,{value:e.description||"",onChange:e=>ie(t,"description",e.target.value),placeholder:"Dopl\u0148uj\xedc\xed informace"})]})]}),M.options.length>2&&(0,p.jsx)(K.K,{"aria-label":"Odstranit mo\u017enost",icon:(0,p.jsx)(Qr.d,{}),colorScheme:"red",variant:"ghost",onClick:()=>(e=>{M.options.length>2&&D((0,h.A)((0,h.A)({},M),{},{options:M.options.filter((t,n)=>n!==e)}))})(t)})]})})},t)),(0,p.jsx)(T.$,{leftIcon:(0,p.jsx)(es.R,{}),onClick:()=>{D((0,h.A)((0,h.A)({},M),{},{options:[...M.options,{text:"",display_order:M.options.length}]}))},variant:"outline",colorScheme:"blue",children:"P\u0159idat mo\u017enost"})]})}),(0,p.jsx)(da.K,{children:(0,p.jsxs)(w.T,{spacing:4,children:["rating"!==M.type&&(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Povolit v\xedce voleb"}),(0,p.jsx)(pa.d,{isChecked:M.allow_multiple,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{allow_multiple:e.target.checked}))})]}),"rating"!==M.type&&M.allow_multiple&&(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Max. po\u010det voleb"}),(0,p.jsxs)(ua.Q7,{value:M.max_choices,min:1,max:M.options.length,onChange:(e,t)=>D((0,h.A)((0,h.A)({},M),{},{max_choices:t})),children:[(0,p.jsx)(ua.OO,{}),(0,p.jsxs)(ua.lw,{children:[(0,p.jsx)(ua.Q0,{}),(0,p.jsx)(ua.Sh,{})]})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zobrazen\xed v\xfdsledk\u016f"}),(0,p.jsxs)(ha.l,{value:M.show_results,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{show_results:e.target.value})),children:[(0,p.jsx)("option",{value:"always",children:"V\u017edy"}),(0,p.jsx)("option",{value:"after_vote",children:"Po hlasov\xe1n\xed"}),(0,p.jsx)("option",{value:"after_end",children:"Po ukon\u010den\xed"}),(0,p.jsx)("option",{value:"never",children:"Nikdy (pouze admin)"})]})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Vy\u017eadovat p\u0159ihl\xe1\u0161en\xed"}),(0,p.jsx)(pa.d,{isChecked:M.require_auth,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{require_auth:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Povolit hlasov\xe1n\xed host\u016f"}),(0,p.jsx)(pa.d,{isChecked:M.allow_guest_vote,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{allow_guest_vote:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:"0",children:"Zv\xfdraznit na hlavn\xed str\xe1nce"}),(0,p.jsx)(pa.d,{isChecked:M.featured,onChange:e=>D((0,h.A)((0,h.A)({},M),{},{featured:e.target.checked}))})]})]})})]})]})}),(0,p.jsxs)(Ta.j,{children:[(0,p.jsx)(T.$,{variant:"ghost",mr:3,onClick:d,children:"Zru\u0161it"}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>{if("rating"!==M.type){if(M.options.filter(e=>!e.text||""===e.text.trim()).length>0)return void o({title:"Chyba",description:"V\u0161echny mo\u017enosti mus\xed m\xedt vypln\u011bn\xfd text",status:"error",duration:3e3})}f?q.mutate({id:f.id,data:M}):O.mutate(M)},isLoading:O.isPending||q.isPending,children:f?"Ulo\u017eit":"Vytvo\u0159it"})]})]})]}),(0,p.jsxs)(se.aF,{isOpen:u,onClose:g,size:"4xl",children:[(0,p.jsx)(H.m,{}),(0,p.jsxs)(le.$,{children:[(0,p.jsx)(J.r,{children:"Statistiky ankety"}),(0,p.jsx)(B.s,{}),(0,p.jsx)(Y.c,{children:G?(0,p.jsxs)(w.T,{py:8,children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed statistik..."})]}):$?(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(Tt.r,{columns:3,spacing:4,children:[(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"Celkem hlas\u016f"}),(0,p.jsx)(ko.k,{children:$.poll.total_votes})]}),(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"P\u0159ihl\xe1\u0161en\xed u\u017eivatel\xe9"}),(0,p.jsx)(ko.k,{children:$.authenticated_votes}),(0,p.jsx)(zo.h,{children:$.poll.total_votes>0?"".concat(Math.round($.authenticated_votes/$.poll.total_votes*100),"%"):"0%"})]}),(0,p.jsxs)(yo.r,{children:[(0,p.jsx)(fo.v,{children:"Host\xe9"}),(0,p.jsx)(ko.k,{children:$.guest_votes}),(0,p.jsx)(zo.h,{children:$.poll.total_votes>0?"".concat(Math.round($.guest_votes/$.poll.total_votes*100),"%"):"0%"})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:4,children:"V\xfdsledky"}),(0,p.jsx)(w.T,{spacing:2,align:"stretch",children:($.poll.options||[]).map(e=>{const t=$.poll.total_votes>0?e.vote_count/$.poll.total_votes*100:0;return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:1,children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.text}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:[e.vote_count," hlas\u016f (",t.toFixed(1),"%)"]})]}),(0,p.jsx)(y.a,{w:"full",h:"8px",bg:"gray.200",borderRadius:"full",overflow:"hidden",children:(0,p.jsx)(y.a,{h:"full",bg:"blue.500",w:"".concat(t,"%"),transition:"width 0.3s"})})]},e.id)})})]}),(null!==(n=null===(i=$.votes_by_day)||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:4,children:"Hlasy podle dn\u016f"}),(0,p.jsx)(w.T,{spacing:2,align:"stretch",children:($.votes_by_day||[]).map(e=>(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{children:new Date(e.date).toLocaleDateString("cs-CZ")}),(0,p.jsxs)(Qt.E,{children:[e.count," hlas\u016f"]})]},e.date))})]})]}):null}),(0,p.jsx)(Ta.j,{children:(0,p.jsx)(T.$,{onClick:g,children:"Zav\u0159\xedt"})})]})]})]})})};var Ol=n(7401);const Zl=async()=>(await m.Ay.get("/setup/status")).data,Kl=()=>{const[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(null),[o,r]=(0,a.useState)([]),[s,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),h=(0,a.useCallback)(async e=>{t(!0),i(null);try{return await e()}catch(n){const e=n instanceof Error?n:new Error("An unknown error occurred");throw i(e),e}finally{t(!1)}},[]),u=(0,a.useCallback)(async e=>{l(!0),d(null);try{const t=await h(()=>Ce.searchClubs(e));return r(t.results||[]),t}catch(t){const e=t instanceof Error?t:new Error("Failed to search clubs");throw d(e),e}finally{l(!1)}},[h]);return{searchClubs:u,searchResults:o,searchLoading:s,searchError:c,getClub:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>Ce.getClub(e,t))},[h]),getClubTable:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>Ce.getClubTable(e,t))},[h]),getClubCompetitions:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>Ce.getClubCompetitions(e,t))},[h]),getCompetitionMatches:(0,a.useCallback)(e=>h(()=>Ce.getCompetitionMatches(e)),[h]),clearCache:(0,a.useCallback)(()=>{Ce.clearCache()},[]),loading:e,error:n}},ql=(e,t)=>{let n=(e||"").trim();if(!n)return"";if(n=n.replace(/[\s\-.()]/g,""),n=n.replace(/^00/,"+"),n.startsWith("+"))return n;if(/^420\d{9}$/.test(n))return"+"+n;if(/^\d{9}$/.test(n)){const e=(t||"").toLowerCase();if(e.includes("\u010desk")||e.includes("czech"))return"+420"+n}return n},Vl=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(!1),[s,l]=(0,a.useState)(""),[d,h]=(0,a.useState)(""),[x,g]=(0,a.useState)(!1),[v,f]=(0,a.useState)(""),[R,P]=(0,a.useState)(""),[I,M]=(0,a.useState)(""),[D,L]=(0,a.useState)(""),[F,O]=(0,a.useState)("football"),[Z,K]=(0,a.useState)(""),[q,V]=(0,a.useState)(""),[H,$]=(0,a.useState)(!1),[B,J]=(0,a.useState)(""),[Y,X]=(0,a.useState)(""),{searchClubs:Q,searchResults:ne,searchLoading:ae}=Kl(),ie=e=>{if(e){if(e.includes("logoapi.sportcreative.eu"))return e;if(e.startsWith("/uploads")||e.startsWith("/dist")||e.startsWith("/api/"))return W(e);if(/^https?:\/\//i.test(e)){const t=(m.API_URL||"").replace(/\/$/,"");return"".concat(t,"/proxy/image?url=").concat(encodeURIComponent(e))}return e}},[oe,re]=(0,a.useState)("#2d74da"),[se,le]=(0,a.useState)("#f6f8fb"),[ce,de]=(0,a.useState)("#ffb703"),[he,ue]=(0,a.useState)("#ffffff"),[me,pe]=(0,a.useState)("#111827"),[xe,ge]=(0,a.useState)("unified"),[ve,je]=(0,a.useState)([]),[be,ye]=(0,a.useState)(null),[fe,ke]=(0,a.useState)("inter-inter"),[ze,we]=(0,a.useState)(""),[_e,Se]=(0,a.useState)(""),[Ce,Te]=(0,a.useState)(""),[Ne,We]=(0,a.useState)("positron"),[Me,De]=(0,a.useState)(""),[Ue,Le]=(0,a.useState)(""),[Oe,Ze]=(0,a.useState)(""),[Ke,qe]=(0,a.useState)("\u010cesk\xe1 republika"),[Ve,$e]=(0,a.useState)(""),[Be,Je]=(0,a.useState)(""),[Ye,Ge]=(0,a.useState)(""),[Xe,Qe]=(0,a.useState)(""),[et,tt]=(0,a.useState)(""),[nt,at]=(0,a.useState)(""),[it,ot]=(0,a.useState)(!1),[rt,st]=(0,a.useState)(!1),[lt,ct]=(0,a.useState)(""),[dt,ht]=(0,a.useState)(!0),[ut,mt]=(0,a.useState)(!1),[pt,xt]=(0,a.useState)(""),[gt,vt]=(0,a.useState)(""),[jt,bt]=(0,a.useState)(""),[yt,ft]=(0,a.useState)(""),kt=(0,j.d)(),zt=(0,c.Zp)(),wt=(0,b.dU)("white","gray.800"),_t=(0,b.dU)("gray.200","gray.600"),St=e=>(e||"").replace(/\s+/g,""),Ct=e=>/^(?:[^\s@]+)@(?:[^\s@]+)\.(?:[^\s@]+)$/.test((e||"").trim());(0,a.useEffect)(()=>{let e=!0;try{(0,u.L)(),(0,u.aK)(!1)}catch(n){}return(async()=>{try{const t=await Zl();if(!e)return;r(!!t.requires_setup)}catch(n){r(!1)}finally{e&&t(!1)}})(),()=>{e=!1}},[]),(0,a.useEffect)(()=>{o&&!I&&M(Ie())},[o,I]),(0,a.useEffect)(()=>{const e=Y.trim();if(!e)return;const t=setTimeout(()=>{Q(e).catch(()=>{})},300);return()=>clearTimeout(t)},[Y,Q]),(0,a.useEffect)(()=>{const e=ka.qE.find(e=>e.id===fe);e&&(0,ka.Iu)(e)},[fe]),(0,a.useEffect)(()=>{Be&&Ct(Be)&&!rt&&tt(Be)},[Be,rt]);const At=(0,a.useMemo)(()=>he&&me?Re(he,me):null,[he,me]),Et=(0,a.useMemo)(()=>oe&&me?Re(oe,me):null,[oe,me]),Nt=(0,a.useMemo)(()=>null==At||Pe(he,me,"AA"),[At,he,me]);if((0,a.useEffect)(()=>{e||o||zt("/login",{replace:!0})},[e,o,zt]),e)return(0,p.jsx)(y.a,{p:8,children:"Na\u010d\xedt\xe1n\xed\u2026"});if(!o)return null;const Rt=ka.qE.find(e=>e.id===fe),Pt=(null===Rt||void 0===Rt?void 0:Rt.cssHeading)||"inherit",It=(null===Rt||void 0===Rt?void 0:Rt.cssBody)||"inherit";return(0,p.jsx)(y.a,{minH:"100vh",bg:"gray.50",display:"flex",alignItems:"center",justifyContent:"center",px:8,py:8,fontFamily:It,children:(0,p.jsxs)(y.a,{as:"form",onSubmit:async e=>{e.preventDefault(),i(!0);try{var t,n;const e=St(d);if(!/^\S{8,128}$/.test(e))return kt({title:"Neplatn\xe9 heslo",description:"Heslo mus\xed m\xedt 8\u2013128 znak\u016f a nesm\xed obsahovat mezery.",status:"error"}),void i(!1);const a=lt&&et?"".concat(lt," <").concat(et,">"):et||void 0,o={admin_email:s,admin_password:e,first_name:v||void 0,last_name:R||void 0,jwt_secret:I||void 0,club_id:D||void 0,club_type:F||void 0,club_name:Z||void 0,club_logo_url:q||void 0,club_url:B||void 0,frontpage_style:xe||void 0,primary_color:oe||void 0,secondary_color:se||void 0,accent_color:ce||void 0,background_color:he||void 0,text_color:me||void 0,font_heading:(null===(t=ka.qE.find(e=>e.id===fe))||void 0===t?void 0:t.heading)||void 0,font_body:(null===(n=ka.qE.find(e=>e.id===fe))||void 0===n?void 0:n.body)||void 0,facebook_url:pt||void 0,instagram_url:gt||void 0,youtube_url:jt||void 0,gallery_url:yt||void 0,location_latitude:"number"===typeof _e?_e:void 0,location_longitude:"number"===typeof Ce?Ce:void 0,map_style:Ne||void 0,contact_address:Me||void 0,contact_city:Ue||void 0,contact_zip:Oe||void 0,contact_country:Ke||void 0,contact_phone:ql(Ve,Ke)||void 0,contact_email:Be||void 0,smtp:Ye||Xe||et||nt||lt?{host:Ye||void 0,port:"number"===typeof Xe?Xe:void 0,username:et||void 0,password:nt||void 0,from:a,use_tls:dt}:null};await(async e=>(await m.Ay.post("/setup/initialize",e,{timeout:3e4})).data)(o);try{const e=("undefined"!==typeof window?window.location.origin:"").replace(/\/$/,"");await Qs({site_title:Z||"Fotbal Club",site_description:Z?"".concat(Z," \u2013 ofici\xe1ln\xed klubov\xfd web: aktuality, z\xe1pasy, tabulky, hr\xe1\u010di."):"Ofici\xe1ln\xed klubov\xfd web: aktuality, z\xe1pasy, tabulky, hr\xe1\u010di.",default_og_image_url:q||void 0,canonical_base_url:e||void 0,enable_indexing:!0})}catch(r){}kt({title:"Nastaven\xed dokon\u010deno",status:"success",duration:3e3,isClosable:!0}),zt("/login",{replace:!0}),setTimeout(()=>{try{window.location.reload()}catch(e){}},800)}catch(l){var a,o;kt({title:"Nastaven\xed selhalo",description:(null===l||void 0===l||null===(a=l.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.error)||"Zkontrolujte pros\xedm sv\xe9 \xfadaje",status:"error"})}finally{i(!1)}},w:"100%",maxW:"3xl",p:8,bg:wt,borderRadius:"xl",boxShadow:"lg",borderWidth:"1px",borderColor:_t,fontFamily:It,children:[(0,p.jsxs)(w.T,{spacing:3,mb:6,align:"stretch",children:[(0,p.jsx)(z.D,{size:"xl",fontFamily:Pt,children:"\ud83d\ude80 V\xedtejte v nastaven\xed va\u0161eho webu!"}),(0,p.jsx)(U.E,{fontSize:"md",color:"gray.600",children:"Nastavte z\xe1kladn\xed informace o va\u0161em klubu. M\u016f\u017eete v\u0161e vyplnit nyn\xed, nebo n\u011bkter\xe9 \xfadaje doplnit pozd\u011bji v administraci."}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:"\ud83d\udca1 Tip: Vyhledejte v\xe1\u0161 klub v datab\xe1zi FA\u010cR"}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Logo, barvy a z\xe1kladn\xed \xfadaje se dopln\xed automaticky."})]})]})]}),(0,p.jsxs)(Tt.r,{columns:[1,1,2],spacing:6,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h3",size:"md",mb:4,fontFamily:Pt,children:"\ud83d\udd10 Administr\xe1torsk\xfd \xfa\u010det"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"E\u2011mail administr\xe1tora"}),(0,p.jsx)(C.p,{type:"email",value:s,onChange:e=>l(e.target.value),placeholder:"admin@example.com"})]}),(0,p.jsxs)(_.MJ,{isRequired:!0,children:[(0,p.jsx)(S.l,{children:"Heslo administr\xe1tora"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{type:x?"text":"password",value:d,onChange:e=>h(St(e.target.value)),placeholder:"Minim\xe1ln\u011b 8 znak\u016f, bez mezer",minLength:8}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>g(e=>!e),children:x?"Skr\xfdt":"Zobrazit"})})]}),(0,p.jsx)(_.eK,{children:"Bez mezer. 8\u2013128 znak\u016f. Pou\u017eijte p\xedsmena, \u010d\xedslice a speci\xe1ln\xed znaky."}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>h((()=>{const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%^&*()-_=+[]{};:,.?";let t="";for(let n=0;n<16;n++)t+=e.charAt(Math.floor(80*Math.random()));return t})()),children:"Vygenerovat siln\xe9 heslo"}),(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>h(""),children:"Vymazat"})]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Jm\xe9no"}),(0,p.jsx)(C.p,{value:v,onChange:e=>f(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"P\u0159\xedjmen\xed"}),(0,p.jsx)(C.p,{value:R,onChange:e=>P(e.target.value)})]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h3",size:"md",mb:4,fontFamily:Pt,children:"\u26bd Informace o klubu"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Hledat klub (FA\u010cR)"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{value:Y,onChange:e=>X(e.target.value),placeholder:"Hledejte podle n\xe1zvu klubu"}),(0,p.jsx)(E.t,{children:ae?(0,p.jsx)(zn.y,{size:"sm"}):null})]}),Y&&(null===ne||void 0===ne?void 0:ne.length)>0&&(0,p.jsx)(y.a,{mt:2,borderWidth:"1px",borderRadius:"md",maxH:"240px",overflowY:"auto",children:(0,p.jsx)(No.B8,{spacing:0,children:ne.filter(e=>e.name&&""!==e.name.trim()).slice(0,8).map(e=>(0,p.jsx)(No.ck,{px:3,py:2,_hover:{bg:"gray.50",cursor:"pointer"},onClick:()=>(async e=>{const t=e.club_id||"";L(t),O(e.club_type||"football"),K(e.name||""),J(e.url||""),X(e.name||"");let n="";if(t){const a=await He(t,e.name);a&&(n=a)}!n&&e.logo_url&&(n=e.logo_url),V(n),!lt&&e.name&&ct(e.name);try{"undefined"!==typeof document&&e.name&&(document.title=e.name)}catch(a){}n&&Ae(n,5).then(e=>{if(!e||0===e.length)return;const t=Fe(e);je(t);const n=t[0];n&&(re(n.primary),le(n.secondary),de(n.accent),ue(n.background),pe(n.text),ye(0))}).catch(()=>{})})(e),children:(0,p.jsxs)(ee.z,{spacing:3,children:[e.logo_url?(0,p.jsx)(k._,{src:ie(e.logo_url),alt:e.name,boxSize:"24px",objectFit:"contain"}):null,(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.name}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:e.club_type})]})]})},"".concat(e.club_type,"-").concat(e.club_id)))})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Typ klubu"}),(0,p.jsx)(C.p,{value:F,onChange:e=>O(e.target.value),placeholder:"football nebo futsal"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"ID klubu"}),(0,p.jsx)(C.p,{value:D,onChange:e=>L(e.target.value),placeholder:"FA\u010cR ID klubu"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"N\xe1zev klubu"}),(0,p.jsx)(C.p,{value:Z,onChange:e=>K(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL loga klubu"}),(0,p.jsx)(C.p,{id:"clubLogoUrlInput",value:q,onChange:e=>V(e.target.value)}),(0,p.jsxs)(ee.z,{mt:2,spacing:3,children:[(0,p.jsxs)(T.$,{as:"label",size:"sm",leftIcon:(0,p.jsx)(Ol.Y,{}),children:["Nahr\xe1t logo",(0,p.jsx)(C.p,{type:"file",display:"none",accept:"image/*,image/svg+xml,application/pdf",id:"clubLogoFileInput",onChange:e=>{var t;(async t=>{if(t){$(!0);try{const e=new FormData;e.append("file",t),e.append("preserve_quality","true");const r="".concat((m.API_URL||"").replace(/\/$/,""),"/upload"),s=await fetch(r,{method:"POST",body:e});if(!s.ok)throw new Error("Upload failed");const l=await s.json();let c=(null===l||void 0===l?void 0:l.url)||"";try{const e=new URL(c,window.location.origin);c=e.pathname+e.search+e.hash}catch(n){}if(V(c),D)try{const e=new FormData;if(e.append("logo",t),(await fetch("https://logoapi.sportcreative.eu/logos/".concat(D),{method:"POST",body:e})).ok){kt({title:"Logo nahr\xe1no",description:"Logo bylo nahr\xe1no na logoapi i lok\xe1ln\u011b",status:"success",duration:3e3});try{const e=await He(D);e&&V(e)}catch(a){}}}catch(i){console.warn("Failed to upload to logoapi:",i)}try{const e=Fe(await Ae(c,5));je(e),e[0]&&(re(e[0].primary),le(e[0].secondary),de(e[0].accent),ue(e[0].background),pe(e[0].text),ye(0))}catch(o){}}catch(e){kt({title:"Nahr\xe1n\xed loga selhalo",status:"error"})}finally{$(!1)}}})((null===(t=e.target.files)||void 0===t?void 0:t[0])||null);try{e.target.value=""}catch(n){}}})]}),H?(0,p.jsx)(U.E,{fontSize:"sm",children:"Nahr\xe1v\xe1m\u2026"}):null]})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL klubu"}),(0,p.jsx)(C.p,{value:B,onChange:e=>J(e.target.value)})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{mb:2,children:"N\xe1hled loga"}),(0,p.jsx)(k._,{src:ie(q)||W("/dist/img/logo-club-empty.svg"),alt:"Logo preview",maxH:"80px",objectFit:"contain"})]})]})]})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,fontFamily:Pt,children:"\ud83c\udfa8 Barvy a vzhled webu"}),(0,p.jsx)(U.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Automaticky z loga (lze upravit). Vyberte jednu z p\u0159edloh nebo barvy ru\u010dn\u011b dola\u010fte."}),ve.length>0&&(0,p.jsxs)(y.a,{mb:4,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"P\u0159edlohy z loga"}),(0,p.jsx)(Tt.r,{columns:{base:1,md:5},spacing:3,children:ve.map((e,t)=>(0,p.jsxs)(y.a,{borderWidth:be===t?"2px":"1px",borderColor:be===t?"blue.400":"gray.200",borderRadius:"md",p:3,cursor:"pointer",onClick:()=>(e=>{const t=ve[e];t&&(re(t.primary),le(t.secondary),de(t.accent),ue(t.background),pe(t.text),ye(e))})(t),children:[(0,p.jsxs)(y.a,{mb:2,display:"flex",gap:"6px",alignItems:"center",children:[(0,p.jsx)(y.a,{flex:"1",h:"48px",borderRadius:"6px",bg:e.primary,display:"flex",alignItems:"center",justifyContent:"center",color:e.text}),(0,p.jsx)(y.a,{w:"48px",h:"48px",borderRadius:"6px",bg:e.secondary}),(0,p.jsx)(y.a,{w:"48px",h:"48px",borderRadius:"6px",bg:e.accent})]}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",children:e.name}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"Prim\xe1rn\xed / Sekund\xe1rn\xed / Akcent"})]},e.name+t))}),(0,p.jsx)(T.$,{mt:3,variant:"ghost",onClick:async()=>{const e=null===q||void 0===q?void 0:q.trim();if(e)try{const t=Fe(await Ae(e,5));je(t),t[0]&&(re(t[0].primary),le(t[0].secondary),de(t[0].accent),ue(t[0].background),pe(t[0].text),ye(0))}catch(t){}},children:"Znovu z loga"})]}),(0,p.jsxs)(Tt.r,{columns:[1,1,2],spacing:6,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(S.l,{children:["Prim\xe1rn\xed",(0,p.jsx)(te.m,{label:"Hlavn\xed barva zna\u010dky (tla\u010d\xedtka, odkazy, zv\xfdrazn\u011bn\xed).",hasArrow:!0,children:(0,p.jsx)(Ol.Y,{ml:2})})]}),(0,p.jsx)(C.p,{type:"color",value:oe,onChange:e=>(0,a.startTransition)(()=>re(e.target.value))}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Pou\u017e\xedv\xe1 se na hlavn\xedch prvc\xedch."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(S.l,{children:["Sekund\xe1rn\xed",(0,p.jsx)(te.m,{label:"Dopl\u0148kov\xe1 barva pro m\xe9n\u011b d\u016fle\u017eit\xe9 prvky a plochy.",hasArrow:!0,children:(0,p.jsx)(Ol.Y,{ml:2})})]}),(0,p.jsx)(C.p,{type:"color",value:se,onChange:e=>(0,a.startTransition)(()=>le(e.target.value))}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Podp\u016frn\xe9 zv\xfdrazn\u011bn\xed."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsxs)(S.l,{children:["Akcent",(0,p.jsx)(te.m,{label:"Kontrastn\xed barva pro odznaky, \u0161t\xedtky a mal\xe9 akce.",hasArrow:!0,children:(0,p.jsx)(Ol.Y,{ml:2})})]}),(0,p.jsx)(C.p,{type:"color",value:ce,onChange:e=>(0,a.startTransition)(()=>de(e.target.value))}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Men\u0161\xed prvky a upozorn\u011bn\xed."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Pozad\xed"}),(0,p.jsx)(C.p,{type:"color",value:he,onChange:e=>(0,a.startTransition)(()=>ue(e.target.value))}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Barva ploch str\xe1nky."})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Text"}),(0,p.jsx)(C.p,{type:"color",value:me,onChange:e=>(0,a.startTransition)(()=>pe(e.target.value))}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Z\xe1kladn\xed barva textu."})]})]}),!Nt&&(0,p.jsxs)(xa.F,{status:"warning",mt:4,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),"Slab\xfd kontrast textu v\u016f\u010di pozad\xed (pom\u011br ",null===At||void 0===At?void 0:At.toFixed(2),"). Pro \u010ditelnost upravte barvy nebo",(0,p.jsx)(T.$,{variant:"link",colorScheme:"blue",ml:2,onClick:()=>{if(!he)return;const e=Ee(he);pe(e)},children:"automaticky opravit barvu textu"}),"."]}),null!==Et&&Et<4.5&&(0,p.jsxs)(xa.F,{status:"warning",mt:3,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),"Text na prim\xe1rn\xed barv\u011b m\xe1 n\xedzk\xfd kontrast (pom\u011br ",Et.toFixed(2),"). Zva\u017ete jinou barvu textu nebo prim\xe1rn\xed barvy."]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,fontFamily:Pt,children:"\ud83d\udcf1 Soci\xe1ln\xed s\xedt\u011b a fotogalerie"}),(0,p.jsx)(U.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Zadejte odkazy na profily klubu a voliteln\u011b na fotogalerii. Lze pozd\u011bji upravit v administraci."}),(0,p.jsxs)(Tt.r,{columns:[1,1,2],spacing:6,mb:2,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Facebook URL"}),(0,p.jsx)(C.p,{placeholder:"https://www.facebook.com/vas.klub",value:pt,onChange:e=>xt(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Instagram URL"}),(0,p.jsx)(C.p,{placeholder:"https://www.instagram.com/vas.klub",value:gt,onChange:e=>vt(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"YouTube URL"}),(0,p.jsx)(C.p,{placeholder:"https://www.youtube.com/@vas_klub",value:jt,onChange:e=>bt(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"URL fotogalerie"}),(0,p.jsx)(C.p,{placeholder:"https://photos.example.com/club",value:yt,onChange:e=>ft(e.target.value)}),(0,p.jsx)(_.eK,{children:"M\u016f\u017eete pou\u017e\xedt libovoln\xfd web (SmugMug, Flickr, Google Photos, Zonerama...)."})]})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,fontFamily:Pt,children:"\u270d\ufe0f P\xedsmo a typografie"}),(0,p.jsx)(U.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Vyberte vzhled p\xedsma pro v\xe1\u0161 web. N\xe1hled se aplikuje okam\u017eit\u011b na celou str\xe1nku."}),(0,p.jsxs)(y.a,{mb:4,children:[(0,p.jsx)(Tt.r,{columns:{base:1,md:3},spacing:3,children:ka.qE.map(e=>(0,p.jsx)(y.a,{borderWidth:fe===e.id?"2px":"1px",borderColor:fe===e.id?"blue.400":"gray.200",borderRadius:"md",p:3,cursor:"pointer",onClick:()=>ke(e.id),children:(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:e.name}),(0,p.jsx)(Qt.E,{colorScheme:(0,ka.iD)(e.style),children:e.style})]}),(0,p.jsx)(U.E,{fontFamily:e.cssHeading,fontSize:"lg",fontWeight:"bold",children:"Nadpis"}),(0,p.jsx)(U.E,{fontFamily:e.cssBody,fontSize:"sm",children:"Text b\u011b\u017en\xe9ho odstavce"})]})},e.id))}),(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Zobrazeno ",ka.qE.length," dostupn\xfdch styl\u016f p\xedsma."]})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,fontFamily:Pt,children:"\ud83d\udccd GPS poloha a mapa"}),(0,p.jsx)(U.E,{fontSize:"sm",mb:4,color:"gray.600",children:"Nastavte polohu va\u0161eho stadionu. M\u016f\u017eete vlo\u017eit odkaz z mapy, nebo zadat sou\u0159adnice ru\u010dn\u011b. Vyberte tak\xe9 styl mapy."}),(0,p.jsx)(y.a,{mb:4,children:(0,p.jsx)(jl,{currentLatitude:"number"===typeof _e?_e:void 0,currentLongitude:"number"===typeof Ce?Ce:void 0,currentZoom:15,mapStyle:Ne,onMapStyleChange:We,clubPrimaryColor:oe,clubSecondaryColor:ce,clubName:Z||"V\xe1\u0161 klub",onImport:e=>{Se(e.latitude),Te(e.longitude),e.street?De(e.street):e.houseNumber&&e.city&&De("".concat(e.city," ").concat(e.houseNumber)),e.city&&Le(e.city),e.zip&&Ze(e.zip),e.country&&qe(e.country),kt({title:"Poloha importov\xe1na",description:e.city?"GPS sou\u0159adnice a adresa (".concat(e.city,") na\u010dteny"):"GPS sou\u0159adnice na\u010dteny",status:"success",duration:3e3})}})}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:2,fontFamily:Pt,children:"\ud83d\udce7 Kontaktn\xed \xfadaje"}),(0,p.jsx)(U.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Tyto \xfadaje se automaticky vypln\xed p\u0159i importu z mapy. M\u016f\u017eete je upravit nebo doplnit ru\u010dn\u011b."}),(0,p.jsxs)(Tt.r,{columns:[1,1,2],spacing:4,mb:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Adresa (ulice a \u010d\xedslo)"}),(0,p.jsx)(C.p,{placeholder:"Hlavn\xed 123",value:Me,onChange:e=>De(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"M\u011bsto"}),(0,p.jsx)(C.p,{placeholder:"Krnov",value:Ue,onChange:e=>Le(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"PS\u010c"}),(0,p.jsx)(C.p,{placeholder:"794 01",value:Oe,onChange:e=>Ze(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zem\u011b"}),(0,p.jsx)(C.p,{placeholder:"\u010cesk\xe1 republika",value:Ke,onChange:e=>qe(e.target.value)})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Telefon"}),(0,p.jsx)(C.p,{type:"tel",placeholder:"+420 123 456 789",value:Ve,onChange:e=>$e(e.target.value)}),(0,p.jsx)(_.eK,{children:"Hlavn\xed kontaktn\xed telefon klubu"})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"E-mail"}),(0,p.jsx)(C.p,{type:"email",placeholder:"kontakt@klub.cz",value:Be,onChange:e=>Je(e.target.value),onBlur:()=>{!rt&&Ct(Be)&&tt(Be)}}),(0,p.jsx)(_.eK,{children:"Hlavn\xed kontaktn\xed e-mail klubu"})]})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsx)(z.D,{as:"h3",size:"md",mb:4,fontFamily:Pt,children:"\ud83d\udd12 Zabezpe\u010den\xed a SMTP"}),(0,p.jsxs)(Tt.r,{columns:[1,1,2],spacing:6,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"JWT tajemstv\xed"}),(0,p.jsx)(C.p,{value:I,onChange:e=>M(e.target.value),placeholder:"Ponechte pr\xe1zdn\xe9 pro st\xe1vaj\xedc\xed hodnotu"}),(0,p.jsx)(T.$,{mt:2,size:"sm",onClick:()=>M(Ie()),children:"Vygenerovat bezpe\u010dn\xe9 tajemstv\xed"})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"SMTP hostitel"}),(0,p.jsx)(C.p,{value:Ye,onChange:e=>Ge(e.target.value),placeholder:"smtp.example.com"})]}),(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"SMTP port"}),(0,p.jsx)(C.p,{type:"number",value:Xe,onChange:e=>Qe(e.target.value?Number(e.target.value):""),placeholder:"587"})]}),(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"SMTP u\u017eivatelsk\xe9 jm\xe9no"}),(0,p.jsx)(C.p,{value:et,onChange:e=>{tt(e.target.value),st(!0)}})]}),(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"SMTP heslo"}),(0,p.jsxs)(A.M,{children:[(0,p.jsx)(C.p,{type:it?"text":"password",value:nt,onChange:e=>at(e.target.value)}),(0,p.jsx)(E.t,{width:"4.5rem",children:(0,p.jsx)(T.$,{h:"1.75rem",size:"sm",onClick:()=>ot(e=>!e),children:it?"Skr\xfdt":"Zobrazit"})})]})]}),(0,p.jsxs)(_.MJ,{mb:3,children:[(0,p.jsx)(S.l,{children:"Jm\xe9no odes\xedlatele"}),(0,p.jsx)(C.p,{value:lt,onChange:e=>ct(e.target.value),placeholder:"N\xe1zev klubu (nap\u0159. Fotbal Club)"}),(0,p.jsx)(_.eK,{children:"Jako adresu pou\u017eijeme v\xe1\u0161 SMTP username (e\u2011mail). Zde vypl\u0148te pouze zobrazovan\xe9 jm\xe9no."})]}),(0,p.jsx)(N.S,{isChecked:dt,onChange:e=>ht(e.target.checked),children:"Pou\u017e\xedt TLS"}),(0,p.jsxs)(ee.z,{mt:3,spacing:3,children:[(0,p.jsx)(T.$,{size:"sm",onClick:async()=>{const e=Ye.trim(),t="number"===typeof Xe?Xe:0;if(e&&t){mt(!0);try{const n=lt&&et?"".concat(lt," <").concat(et,">"):lt||void 0,a=await(async e=>(await m.Ay.post("/setup/validate-smtp",e,{timeout:3e4})).data)({host:e,port:t,username:et||void 0,password:nt||void 0,from:n,use_tls:dt});a.ok?kt({title:"SMTP ov\u011b\u0159eno",description:"P\u0159ipojen\xed a p\u0159\xedpadn\xe1 autentizace prob\u011bhly v po\u0159\xe1dku.",status:"success"}):kt({title:"SMTP selhalo",description:a.error||"Zkontrolujte pros\xedm \xfadaje (host, port, \u0161ifrov\xe1n\xed, jm\xe9no/heslo).",status:"error",duration:7e3})}catch(i){var n,a;const e=(null===i||void 0===i||null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message)||"Nezn\xe1m\xe1 chyba";kt({title:"SMTP selhalo",description:e,status:"error",duration:7e3})}finally{mt(!1)}}else kt({title:"Zadejte SMTP host a port",status:"warning"})},isLoading:ut,children:"Otestovat SMTP"}),(0,p.jsx)(te.m,{label:"Pro port 465 pou\u017eijte implicitn\xed SSL (ponechte za\u0161krtnut\xe9). Pro 587 obvykle STARTTLS (tak\xe9 za\u0161krtnout).",children:(0,p.jsx)(Ol.Y,{})})]}),(0,p.jsxs)(xa.F,{status:"info",mt:4,borderRadius:"md",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:"P\u0159ed dokon\u010den\xedm nastaven\xed otestujte SMTP p\u0159ipojen\xed."}),(0,p.jsx)(U.E,{fontSize:"sm",mt:1,children:"Nej\u010dast\u011bj\u0161\xed chyba: nespr\xe1vn\xe9 heslo. Ujist\u011bte se, \u017ee heslo je zkop\xedrov\xe1no p\u0159esn\u011b bez mezer."})]})]})]})]}),(0,p.jsx)(T.$,{type:"submit",colorScheme:"blue",mt:8,isLoading:n,loadingText:"Ukl\xe1d\xe1m\u2026",children:"Dokon\u010dit nastaven\xed"})]})})},Hl=[{id:"unified",name:"Unified",description:"Klasick\xfd a univerz\xe1ln\xed styl s grid layoutem, ide\xe1ln\xed pro v\u011bt\u0161inu klub\u016f",features:["Grid layout pro \u010dl\xe1nky","Panel nejbli\u017e\u0161\xedho z\xe1pasu","T\u0159i sloupce obsahu","Sekce sponzor\u016f"],recommended:!0,imageUrl:"/dist/img/style-preview-unified.jpg"},{id:"magazine",name:"Magazine",description:"Modern\xed magaz\xednov\xfd styl s barevn\xfdmi pruhy a dynamick\xfdm layoutem",features:["Barevn\xe9 klubov\xe9 pruhy","Magaz\xednov\xfd header","R\u016fzn\xe9 velikosti karet","Modern\xed navigace"],recommended:!1,imageUrl:"/dist/img/style-preview-magazine.jpg"},{id:"pro",name:"Pro",description:"Pr\xe9miov\xfd styl s fullscreen hero obrazem pro maxim\xe1ln\xed dojem",features:["Fullscreen hero slideshow","Premium vzhled","Horizont\xe1ln\xed scrollery","Velk\xe9 vizu\xe1ln\xed prvky"],recommended:!1,imageUrl:"/dist/img/style-preview-pro.jpg"},{id:"edge",name:"Edge",description:"Minimalistick\xfd a modern\xed full-width design",features:["Full-width layout","Minimalistick\xfd design","Modern\xed dla\u017edice","Sticky navigace"],recommended:!1,imageUrl:"/dist/img/style-preview-edge.jpg"}],$l={clubId:"441d3783-06aa-436a-b438-359300ee0371",clubName:"FC Bizoni UH",clubLogo:"/dist/img/logo-club-empty.svg",primaryColor:"#1e40af",secondaryColor:"#dc2626",youtube:"https://www.youtube.com/@FCBizoniUH",instagram:"https://www.instagram.com/fcbizoni_uh/",facebook:"https://www.facebook.com/bizoniuh/?locale=cs_CZ",gallery:"https://eu.zonerama.com/Fcbizoni/1419417",maps:"https://www.google.com/maps/place/Sportovi%C5%A1t%C4%9B+m%C4%9Bsta+Uhersk%C3%A9+Hradi%C5%A1t%C4%9B/@49.066982,17.4702993,19.5z/data=!4m6!3m5!1s0x4713144f4e888bd3:0xf6b552dcecd165df!8m2!3d49.0669271!4d17.4708283!16s%2Fg%2F1tdvc9kh?entry=ttu&g_ep=EgoyMDI1MTAwOC4wIKXMDSoASAFQAw%3D%3D",articles:[{title:"Velk\xe9 v\xedt\u011bzstv\xed v derby",date:"15. b\u0159ezna 2024",category:"Z\xe1pasy"},{title:"Nov\xe1 posila v t\xfdmu",date:"12. b\u0159ezna 2024",category:"Aktuality"},{title:"Pozv\xe1nka na tr\xe9nink ml\xe1de\u017ee",date:"10. b\u0159ezna 2024",category:"Ml\xe1de\u017e"}],nextMatch:{opponent:"TJ Slov\xe1cko B",date:"2024-03-20",time:"17:00",location:"Sportovi\u0161te m\u011bsta Uhersk\xe9 Hradi\u0161t\u011b"}},Bl=()=>{var e,t;const[n,i]=(0,a.useState)(null),o=(0,c.Zp)(),r=(0,b.dU)("white","gray.800"),s=(0,b.dU)("gray.200","gray.600");return(0,p.jsx)(y.a,{minH:"100vh",bg:"gray.50",py:8,children:(0,p.jsx)(Z.m,{maxW:"7xl",children:(0,p.jsxs)(w.T,{spacing:8,align:"stretch",children:[(0,p.jsxs)(y.a,{textAlign:"center",children:[(0,p.jsx)(z.D,{size:"2xl",mb:3,children:"Vyberte styl webu"}),(0,p.jsx)(U.E,{fontSize:"lg",color:"gray.600",children:"Zvolte vzhled, kter\xfd nejl\xe9pe reprezentuje v\xe1\u0161 klub. M\u016f\u017eete kdykoliv zm\u011bnit v administraci."})]}),(0,p.jsx)(Tt.r,{columns:[1,1,2],spacing:8,children:Hl.map(e=>(0,p.jsxs)(y.a,{borderWidth:n===e.id?"3px":"1px",borderColor:n===e.id?"blue.500":s,borderRadius:"xl",overflow:"hidden",bg:r,cursor:"pointer",onClick:()=>{return t=e.id,void i(t);var t},transition:"all 0.3s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:"blue.400"},position:"relative",children:[e.recommended&&(0,p.jsx)(Qt.E,{colorScheme:"green",position:"absolute",top:4,right:4,zIndex:2,fontSize:"sm",px:3,py:1,children:"Doporu\u010deno"}),n===e.id&&(0,p.jsx)(y.a,{position:"absolute",top:4,left:4,zIndex:2,bg:"blue.500",color:"white",borderRadius:"full",p:2,children:(0,p.jsx)(jn.I,{as:q.YrT,boxSize:5})}),(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsx)(k._,{src:e.imageUrl,alt:"".concat(e.name," style preview"),objectFit:"cover",fallback:(0,p.jsx)(y.a,{bg:"gray.200",w:"100%",h:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"2xl",color:"gray.500",children:e.name}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"N\xe1hled bude p\u0159id\xe1n"})]})})})}),(0,p.jsxs)(w.T,{align:"stretch",p:6,spacing:4,children:[(0,p.jsx)(ee.z,{justify:"space-between",align:"flex-start",children:(0,p.jsxs)(w.T,{align:"stretch",spacing:1,flex:1,children:[(0,p.jsx)(z.D,{size:"lg",children:e.name}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:e.description})]})}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",color:"gray.700",children:"Kl\xed\u010dov\xe9 vlastnosti:"}),e.features.map((e,t)=>(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:q.YrT,color:"green.500"}),(0,p.jsx)(U.E,{fontSize:"sm",children:e})]},t))]}),(0,p.jsx)(T.$,{variant:"outline",leftIcon:(0,p.jsx)(q.HaR,{}),onClick:t=>{t.stopPropagation(),window.open("/?style=".concat(e.id,"&preview=1"),"_blank")},size:"sm",children:"\u017div\xfd n\xe1hled"})]})]},e.id))}),(0,p.jsxs)(y.a,{bg:r,borderRadius:"xl",borderWidth:"1px",borderColor:s,p:8,children:[(0,p.jsx)(z.D,{size:"lg",mb:4,children:"N\xe1hled s va\u0161imi daty"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.600",mb:6,children:["Uk\xe1zka stylu ",n?null===(e=Hl.find(e=>e.id===n))||void 0===e?void 0:e.name:"vyberte styl v\xfd\u0161e"," s uk\xe1zkov\xfdmi daty klubu FC Bizoni UH"]}),n&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:4,mb:6,p:4,bg:"gray.50",borderRadius:"lg",children:[(0,p.jsx)(k._,{src:$l.clubLogo,alt:$l.clubName,boxSize:"64px",borderRadius:"md"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:1,children:[(0,p.jsx)(z.D,{size:"md",children:$l.clubName}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(Qt.E,{colorScheme:"blue",children:"Fotbal"}),(0,p.jsx)(Qt.E,{colorScheme:"green",children:"Aktivn\xed"})]})]})]}),(0,p.jsx)(Tt.r,{columns:[1,2,3],spacing:4,children:$l.articles.map((e,t)=>(0,p.jsxs)(y.a,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:s,_hover:{boxShadow:"md"},children:[(0,p.jsx)(Qt.E,{colorScheme:"blue",mb:2,children:e.category}),(0,p.jsx)(z.D,{size:"sm",mb:1,noOfLines:2,children:e.title}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.date})]},t))}),(0,p.jsxs)(y.a,{mt:6,p:6,bg:"blue.50",borderRadius:"lg",borderWidth:"1px",borderColor:"blue.200",children:[(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",color:"blue.700",mb:2,children:"NEJBLI\u017d\u0160\xcd Z\xc1PAS"}),(0,p.jsx)(z.D,{size:"lg",mb:2,children:$l.nextMatch.opponent}),(0,p.jsxs)(ee.z,{spacing:4,fontSize:"sm",color:"gray.700",children:[(0,p.jsx)(U.E,{children:new Date($l.nextMatch.date).toLocaleDateString("cs-CZ")}),(0,p.jsx)(U.E,{children:"\u2022"}),(0,p.jsx)(U.E,{children:$l.nextMatch.time})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",mt:2,children:$l.nextMatch.location})]}),(0,p.jsxs)(ee.z,{spacing:4,mt:6,justify:"center",children:[(0,p.jsx)(T.$,{size:"sm",colorScheme:"facebook",leftIcon:(0,p.jsx)(q.HaR,{}),children:"Facebook"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"pink",leftIcon:(0,p.jsx)(q.HaR,{}),children:"Instagram"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"red",leftIcon:(0,p.jsx)(q.HaR,{}),children:"YouTube"})]})]})]}),(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(T.$,{variant:"ghost",onClick:()=>o("/setup"),children:"Zp\u011bt na nastaven\xed"}),(0,p.jsxs)(T.$,{colorScheme:"blue",size:"lg",isDisabled:!n,onClick:()=>{n&&o("/setup?style=".concat(n))},rightIcon:(0,p.jsx)(jn.I,{as:q.YrT}),children:["Pokra\u010dovat s ",n?null===(t=Hl.find(e=>e.id===n))||void 0===t?void 0:t.name:"vybran\xfdm stylem"]})]})]})})})},Jl=e=>{let{d:t,h:n,hid:a,hl:i,a:o,aid:r,al:s,s:l,clubName:c,clubId:d}=e;return(0,p.jsxs)(ee.z,{justify:"space-between",borderRadius:"lg",p:3,bg:"white",boxShadow:"sm",children:[(0,p.jsx)(U.E,{w:"140px",fontSize:"sm",color:"gray.600",children:t}),(0,p.jsxs)(ee.z,{flex:1,justify:"flex-end",spacing:4,children:[(0,p.jsxs)(ee.z,{minW:"40%",justify:"flex-end",spacing:2,children:[(0,p.jsx)(U.E,{noOfLines:1,textAlign:"right",flex:1,children:M(n)}),(0,p.jsx)(y.a,{className:"logo-container",w:"28px",h:"28px",children:(0,p.jsx)(Wa,{teamId:a,teamName:n,facrLogo:i,size:"custom",boxSize:"28px"})})]}),(0,p.jsxs)(ee.z,{minW:"60px",justify:"center",spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",textAlign:"center",children:l||"-:-"}),(()=>{if(!l)return null;const e=l.match(/^(\d+)\s*[:\-]\s*(\d+)$/);if(!e)return null;const t=parseInt(e[1],10),i=parseInt(e[2],10);let s=!1,h=!1;if(d&&a&&r&&(s=a===d,h=r===d),!s&&!h&&c){const e=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),t=t=>e(t).replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),a=t(n),i=t(c);s=Boolean(a&&i&&(a===i||a.endsWith(i)||i.endsWith(a)));const r=t(o);h=Boolean(r&&i&&(r===i||r.endsWith(i)||i.endsWith(r)))}if(!s&&!h)return null;if(t===i)return(0,p.jsx)(Qt.E,{colorScheme:"blue",variant:"subtle",children:"Rem\xedza"});return(s?t:i)>(s?i:t)?(0,p.jsx)(Qt.E,{colorScheme:"green",variant:"subtle",children:"V\xfdhra"}):(0,p.jsx)(Qt.E,{colorScheme:"red",variant:"subtle",children:"Prohra"})})()]}),(0,p.jsxs)(ee.z,{minW:"40%",spacing:2,children:[(0,p.jsx)(y.a,{className:"logo-container",w:"28px",h:"28px",children:(0,p.jsx)(Wa,{teamId:r,teamName:o,facrLogo:s,size:"custom",boxSize:"28px"})}),(0,p.jsx)(U.E,{noOfLines:1,flex:1,children:M(o)})]})]})]})},Yl=()=>{var e;const{data:t}=ge(),n=null===t||void 0===t?void 0:t.club_id,i=(null===t||void 0===t?void 0:t.club_type)||"football",{data:o,isLoading:r}=(0,xe.I)({queryKey:["facr-club",n,i],queryFn:()=>Se.getClub(n,i),enabled:!!n}),[s,l]=a.useState({});a.useEffect(()=>{let e=!0;return(async()=>{try{const t=await $n();if(!e)return;const n={};(t||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(n[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})}),l(n)}catch(t){}})(),()=>{e=!1}},[]);const c=null!==(e=null===o||void 0===o?void 0:o.competitions)&&void 0!==e?e:[],d=a.useMemo(()=>Wi((Array.isArray(c)?c:[]).map(e=>{var t,n,a,i,o,r,l;return(0,h.A)((0,h.A)({},e),{},{name:(null===(t=s[e.code])||void 0===t?void 0:t.alias)||(null===(n=s[e.id])||void 0===n?void 0:n.alias)||e.name,alias:(null===(a=s[e.code])||void 0===a?void 0:a.alias)||(null===(i=s[e.id])||void 0===i?void 0:i.alias),display_order:null!==(o=null===(r=s[e.code])||void 0===r?void 0:r.display_order)&&void 0!==o?o:null===(l=s[e.id])||void 0===l?void 0:l.display_order})})),[c,s]);return r?(0,p.jsx)(en.E,{height:"200px"}):n?o&&o.competitions&&0!==o.competitions.length?(0,p.jsx)(y.a,{children:(0,p.jsxs)(ra.t,{variant:"soft-rounded",colorScheme:"blue",size:"sm",children:[(0,p.jsx)(sa.w,{px:2,pt:2,overflowX:"auto",overflowY:"hidden",css:{"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"4px"}},children:d.map(e=>{const t=e.alias||e.name;return(0,p.jsx)(la.o,{flex:"0 0 auto",px:3,py:2,fontSize:"sm",children:(0,p.jsx)(U.E,{as:"span",noOfLines:1,maxW:"220px",title:t,children:t})},e.id)})}),(0,p.jsx)(ca.T,{children:d.map(e=>(0,p.jsx)(da.K,{px:0,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(e.matches||[]).slice(0,6).map((e,t)=>(0,p.jsx)(Jl,{d:e.date_time,h:e.home,hid:e.home_id,hl:e.home_logo_url,a:e.away,aid:e.away_id,al:e.away_logo_url,s:e.score,clubName:o.name,clubId:o.club_internal_id},e.match_id||t)),0===(e.matches||[]).length&&(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 z\xe1pasy k dispozici."})]})},e.id))})]})}):(0,p.jsx)(y.a,{p:4,bg:"gray.50",borderRadius:"md",borderWidth:"1px",borderColor:"gray.200",children:(0,p.jsx)(U.E,{color:"gray.600",children:"\u017d\xe1dn\xe9 sout\u011b\u017ee ani z\xe1pasy nejsou k dispozici pro vybran\xfd klub."})}):(0,p.jsx)(y.a,{p:4,bg:"yellow.50",borderRadius:"md",borderWidth:"1px",borderColor:"yellow.200",children:(0,p.jsx)(U.E,{color:"gray.700",children:"Pro zobrazen\xed z\xe1pas\u016f je pot\u0159eba nastavit klub v administraci (Nastaven\xed \u2192 Z\xe1kladn\xed \xfadaje)."})})},Gl=()=>{const[e,t]=(0,a.useState)(!0),[n,i]=(0,a.useState)(null),[o,r]=(0,a.useState)(""),{data:s}=ge(),[l,c]=(0,a.useState)([]),h=(0,b.dU)("white","gray.800"),u=(0,b.dU)("gray.600","gray.400"),x=(0,b.dU)("gray.100","gray.700");(0,a.useEffect)(()=>{g(),v()},[]);const g=async()=>{t(!0),r("");try{const e=await m.Ay.get("/about");i(e.data)}catch(n){var e;404===(null===n||void 0===n||null===(e=n.response)||void 0===e?void 0:e.status)?r("About page has not been created yet."):r("Nepoda\u0159ilo se na\u010d\xedst str\xe1nku.")}finally{t(!1)}},v=async()=>{try{const e=await Xa();c(e||[])}catch(e){}};if((0,a.useEffect)(()=>{try{document.querySelectorAll(".about-content img, .about-timeline img").forEach(e=>{e instanceof HTMLImageElement&&(e.loading="lazy",e.decoding="async",e.style.maxWidth="100%",e.style.height="auto",e.style.display="block")})}catch(e){}},[n]),e)return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"container.lg",py:8,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,p.jsx)(en.E,{height:"60px"}),(0,p.jsx)(en.E,{height:"400px"})]})})});const j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return 0===l.length?null:(0,p.jsxs)(y.a,{mt:e,children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mb:4,children:"Rubriky"}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:l.map(e=>(0,p.jsxs)(At.B,{direction:{base:"column",sm:"row"},spacing:{base:3,sm:4},align:{base:"flex-start",sm:"center"},bg:h,borderRadius:"md",p:{base:4,md:5},boxShadow:"sm",borderWidth:"1px",borderColor:x,w:"100%",children:[(0,p.jsxs)(y.a,{flex:"1",minW:0,children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",mb:e.description?1:0,children:e.name}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:u,noOfLines:{base:3,md:2},children:e.description})]}),(0,p.jsx)(T.$,{as:d.N_,to:"/blog?category=".concat(e.id),size:"sm",variant:"outline",colorScheme:"blue",fontWeight:"bold",w:{base:"full",sm:"auto"},children:"Otev\u0159\xedt"})]},e.id))})]})};if(o||!n)return(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(ii.mg,{children:[(0,p.jsx)("title",{children:null!==s&&void 0!==s&&s.club_name?"O klubu | ".concat(s.club_name):"O klubu"}),(0,p.jsx)("meta",{name:"description",content:"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}),(null===s||void 0===s?void 0:s.club_logo_url)&&(0,p.jsx)("meta",{property:"og:image",content:W(s.club_logo_url)||s.club_logo_url})]}),(0,p.jsxs)(Z.m,{maxW:"container.lg",py:8,children:[(0,p.jsxs)(y.a,{textAlign:"center",py:6,children:[(0,p.jsx)(z.D,{size:"xl",mb:2,children:"O klubu"}),(0,p.jsx)(U.E,{color:u,children:"Tato str\xe1nka je\u0161t\u011b nen\xed nastavena. Zde je p\u0159ehled klubu, sout\u011b\u017e\xed a rubrik."})]}),(0,p.jsxs)(y.a,{mt:4,mb:10,children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mb:4,children:"Z\xe1pasy podle sout\u011b\u017e\xed"}),(0,p.jsx)(Yl,{})]}),j()]})]});const f=n.seo_title||n.title,_=n.seo_description||n.subtitle,S=(null===s||void 0===s?void 0:s.club_name)||n.title,C=null!==s&&void 0!==s&&s.club_logo_url?W(s.club_logo_url)||s.club_logo_url:void 0,A=ai.A.sanitize(n.content);return(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(ii.mg,{children:[(0,p.jsx)("title",{children:f||S}),(0,p.jsx)("meta",{name:"description",content:_||"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}),(0,p.jsx)("meta",{property:"og:title",content:f||S}),(0,p.jsx)("meta",{property:"og:description",content:_||"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}),C&&(0,p.jsx)("meta",{property:"og:image",content:C})]}),(0,p.jsxs)(Z.m,{maxW:"container.lg",py:8,children:[(()=>{switch(n.style){case"modern":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:4,mb:8,align:"center",children:[C&&(0,p.jsx)(k._,{src:C,alt:S,boxSize:"64px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(z.D,{size:"2xl",children:S}),n.subtitle&&(0,p.jsx)(U.E,{fontSize:"xl",color:u,children:n.subtitle})]})]}),(0,p.jsx)(y.a,{className:"about-content",dangerouslySetInnerHTML:{__html:A},sx:{"& p":{mb:4,lineHeight:1.8},"& h1, & h2, & h3":{mt:8,mb:4,fontWeight:"bold"},"& h1":{fontSize:"2xl"},"& h2":{fontSize:"xl"},"& h3":{fontSize:"lg"},"& img":{maxW:"100%",borderRadius:"md",my:6},"& ul, & ol":{pl:6,mb:4},"& li":{mb:2}}})]});case"timeline":return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:4,mb:8,align:"center",children:[C&&(0,p.jsx)(k._,{src:C,alt:S,boxSize:"64px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(z.D,{size:"2xl",children:S}),n.subtitle&&(0,p.jsx)(U.E,{fontSize:"xl",color:u,children:n.subtitle})]})]}),(0,p.jsx)(y.a,{className:"about-timeline",dangerouslySetInnerHTML:{__html:A},sx:{position:"relative","&::before":{content:'""',position:"absolute",left:"20px",top:0,bottom:0,width:"2px",bg:"gray.300"},"& p":{mb:4,lineHeight:1.8,pl:12,position:"relative"},"& h1, & h2, & h3":{mt:8,mb:4,fontWeight:"bold",pl:12,position:"relative","&::before":{content:'""',position:"absolute",left:"11px",top:"8px",width:"20px",height:"20px",borderRadius:"full",bg:"brand.500",border:"4px solid white",boxShadow:"md"}},"& img":{maxW:"100%",borderRadius:"md",my:6,ml:12}}})]});case"custom":return(0,p.jsx)(y.a,{dangerouslySetInnerHTML:{__html:A}});default:return(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:4,mb:8,align:"center",children:[C&&(0,p.jsx)(k._,{src:C,alt:S,boxSize:"64px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(z.D,{size:"2xl",children:S}),n.subtitle&&(0,p.jsx)(U.E,{fontSize:"xl",color:u,children:n.subtitle})]})]}),(0,p.jsx)(y.a,{className:"about-content",dangerouslySetInnerHTML:{__html:A},sx:{"& p":{mb:4,lineHeight:1.8},"& h1, & h2, & h3":{mt:6,mb:3,fontWeight:"bold"},"& h1":{fontSize:"2xl"},"& h2":{fontSize:"xl"},"& h3":{fontSize:"lg"},"& img":{maxW:"100%",borderRadius:"md",my:4},"& ul, & ol":{pl:6,mb:4},"& li":{mb:2}}})]})}})(),j({base:10,md:12})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})},Xl=()=>{const e=(0,a.useMemo)(()=>[{id:"uvod",label:"\xdavod a p\u0159ehled",icon:pe.ZPX},{id:"nastaveni",label:"Nastaven\xed klubu",icon:pe.Pcn},{id:"dashboard",label:"Dashboard a p\u0159ehledy",icon:pe.$BV},{id:"clanky",label:"\u010cl\xe1nky a kategorie",icon:pe.Nhm},{id:"zapasy",label:"Z\xe1pasy a tabulky",icon:pe.i0U},{id:"hraci-tymy",label:"Hr\xe1\u010di a t\xfdmy",icon:pe.YXz},{id:"media",label:"M\xe9dia a soubory",icon:pe.T0M},{id:"gallery",label:"Galerie",icon:pe.dkL},{id:"files",label:"Spr\xe1va soubor\u016f",icon:pe.g1V},{id:"sponzori-bannery",label:"Sponzo\u0159i a bannery",icon:pe.DDN},{id:"newsletter",label:"Newsletter a e-maily",icon:pe.maD},{id:"aliasy",label:"Alias sout\u011b\u017e\xed",icon:pe.Z0L},{id:"prefetch",label:"Prefetch a cache",icon:pe.KP4},{id:"videa",label:"Videa",icon:pe.HiP},{id:"aktivity",label:"Aktivity",icon:pe.bfZ},{id:"merch",label:"Oble\u010den\xed",icon:pe.lV_},{id:"zpravy",label:"Zpr\xe1vy",icon:pe.g5D},{id:"contacts",label:"Kontakty a formul\xe1\u0159e",icon:pe.toK},{id:"analytics",label:"Analytics a reporty",icon:pe.YYR},{id:"scoreboard",label:"Tabule (Scoreboard)",icon:pe.vF8},{id:"mobile-scoreboard",label:"Mobiln\xed scoreboard",icon:pe.rle},{id:"uzivatele",label:"U\u017eivatel\xe9 a p\u0159\xedstupy",icon:pe.pXu},{id:"docs",label:"Intern\xed dokumentace",icon:pe.__w},{id:"checklist",label:"Checklisty a postupy",icon:pe.lfF},{id:"seo",label:"SEO a metadata",icon:pe.KSO},{id:"troubleshooting",label:"\u0158e\u0161en\xed probl\xe9m\u016f",icon:pe.KRc}],[]),[t,n]=(0,a.useState)(""),i=(0,j.d)();(0,a.useEffect)(()=>{const t=new IntersectionObserver(e=>{const t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top>t.boundingClientRect.top?1:-1);t[0]&&n(t[0].target.id)},{rootMargin:"-20% 0px -60% 0px",threshold:[0,.25,.5,.75,1]});return e.map(e=>document.getElementById(e.id)).filter(Boolean).forEach(e=>t.observe(e)),()=>t.disconnect()},[e]),(0,a.useEffect)(()=>{if(t)try{localStorage.setItem("adminDocs:lastAnchor",t)}catch(e){}},[t]),(0,a.useEffect)(()=>{const e=setTimeout(()=>{let e=(window.location.hash||"").replace("#","").trim();if(!e)try{e=localStorage.getItem("adminDocs:lastAnchor")||""}catch(t){}if(e){const t=document.getElementById(e);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),n(e))}},50);return()=>clearTimeout(e)},[]);const o=(0,b.dU)("blue.700","blue.300"),r=(0,b.dU)("blue.50","blue.900"),s=(0,b.dU)("white","gray.800"),l=(0,b.dU)("gray.200","gray.700"),c=e=>{let{id:t,icon:n,title:a}=e;return(0,p.jsxs)(ee.z,{align:"center",justify:"space-between",mb:4,id:t,scrollMarginTop:"100px",children:[(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(y.a,{p:2,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",children:(0,p.jsx)(jn.I,{as:n,color:(0,b.dU)("blue.600","blue.300"),boxSize:5})}),(0,p.jsx)(z.D,{size:"lg",color:(0,b.dU)("gray.800","white"),children:a})]}),(0,p.jsx)(K.K,{"aria-label":"Zkop\xedrovat odkaz",variant:"ghost",size:"sm",icon:(0,p.jsx)(pe.AnD,{}),onClick:()=>(async e=>{try{const t="".concat(window.location.origin).concat(window.location.pathname,"#").concat(e);await navigator.clipboard.writeText(t),i({title:"Odkaz zkop\xedrov\xe1n",status:"success",duration:1500,isClosable:!0})}catch(t){i({title:"Nelze zkop\xedrovat odkaz",status:"error",duration:2e3,isClosable:!0})}})(t),borderRadius:"full"})]})};return(0,p.jsx)(Mo,{children:(0,p.jsx)(y.a,{maxW:"1400px",mx:"auto",children:(0,p.jsxs)(y.a,{display:{base:"block",lg:"grid"},gridTemplateColumns:{base:"1fr",lg:"280px 1fr"},gap:8,children:[(0,p.jsx)(y.a,{display:{base:"none",lg:"block"},children:(0,p.jsx)(y.a,{position:"sticky",top:"100px",maxH:"calc(100vh - 120px)",overflowY:"auto",children:(0,p.jsxs)(y.a,{bg:s,p:5,borderRadius:"xl",borderWidth:"1px",borderColor:l,shadow:"md",children:[(0,p.jsxs)(ee.z,{mb:4,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.vd0,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",color:(0,b.dU)("gray.700","gray.200"),children:"Rychl\xe1 navigace"})]}),(0,p.jsx)(w.T,{spacing:1.5,align:"stretch",children:e.map(e=>(0,p.jsxs)(L.N,{href:"#".concat(e.id),display:"flex",alignItems:"center",px:3,py:2.5,borderRadius:"lg",bg:t===e.id?r:"transparent",color:t===e.id?o:"inherit",fontWeight:t===e.id?"semibold":"medium",fontSize:"sm",_hover:{bg:r,textDecoration:"none"},transition:"all 0.2s",onClick:t=>{t.preventDefault();try{localStorage.setItem("adminDocs:lastAnchor",e.id)}catch(a){}const n=document.getElementById(e.id);n&&(n.scrollIntoView({behavior:"smooth",block:"nearest"}),window.history.pushState(null,"","#".concat(e.id)))},children:[(0,p.jsx)(jn.I,{as:e.icon,mr:2.5,boxSize:4}),(0,p.jsx)(U.E,{flex:1,children:e.label})]},e.id))})]})})}),(0,p.jsx)(y.a,{children:(0,p.jsxs)(y.a,{bg:s,p:8,borderRadius:"xl",borderWidth:"1px",borderColor:l,shadow:"sm",children:[(0,p.jsx)(y.a,{id:"top",mb:4}),(0,p.jsxs)(y.a,{mb:8,children:[(0,p.jsxs)(ee.z,{mb:3,spacing:3,children:[(0,p.jsx)(jn.I,{as:pe.hko,color:(0,b.dU)("blue.600","blue.400"),boxSize:10}),(0,p.jsx)(z.D,{size:"2xl",children:"Dokumentace"})]}),(0,p.jsx)(U.E,{color:"gray.600",fontSize:"lg",mb:6,children:"Kompletn\xed pr\u016fvodce administrac\xed va\u0161eho klubov\xe9ho webu - vytvo\u0159eno pro ka\u017ed\xe9ho, i bez technick\xfdch znalost\xed"}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",variant:"left-accent",mb:4,children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"md",children:"V\xedtejte v admin panelu!"}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:["Tato dokumentace v\xe1s krok za krokem provede v\u0161emi funkcemi syst\xe9mu. Pro rychl\xfd start doporu\u010dujeme za\u010d\xedt"," ",(0,p.jsx)(L.N,{href:"#nastaveni",color:"blue.600",fontWeight:"semibold",children:"nastaven\xedm klubu"}),"."]})]})]}),(0,p.jsxs)(xa.F,{status:"success",borderRadius:"lg",variant:"left-accent",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"md",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.uN,boxSize:4}),(0,p.jsx)(U.E,{as:"span",children:"Pot\u0159ebujete pomoc nebo vlastn\xed \xfapravy?"})]})}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"Technick\xe1 podpora:"})," M\xe1te-li jak\xe9koli dotazy nebo naraz\xedte na probl\xe9m, napi\u0161te n\xe1m na"," ",(0,p.jsx)(L.N,{href:"mailto:help@tdvorak.dev",color:"blue.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","\u2014 odpov\xedd\xe1me do 24 hodin.",(0,p.jsx)("br",{}),(0,p.jsx)("strong",{children:"Vlastn\xed \xfapravy:"})," Hled\xe1te specifick\xe9 funkce nebo p\u0159izp\u016fsoben\xed webu va\u0161im pot\u0159eb\xe1m? Kontaktujte n\xe1s a spole\u010dn\u011b zjist\xedme, zda je va\u0161e p\u0159edstava realizovateln\xe1. R\xe1di v\xe1m pom\u016f\u017eeme!"]})]})]})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{id:"uvod",scrollMarginTop:"100px",children:[(0,p.jsx)(c,{id:"uvod",icon:pe.ZPX,title:"\xdavod a p\u0159ehled"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:8,children:[(0,p.jsxs)(U.E,{fontSize:"md",color:"gray.700",children:["Tento administra\u010dn\xed syst\xe9m v\xe1m umo\u017e\u0148uje jednodu\u0161e spravovat kompletn\xed klubov\xfd web \u2014 od \u010dl\xe1nk\u016f, p\u0159es z\xe1pasy a v\xfdsledky, a\u017e po newsletter a galerie. ",(0,p.jsx)("strong",{children:"Nen\xed pot\u0159eba \u017e\xe1dn\xe9 programov\xe1n\xed ani technick\xe9 znalosti."})," V\u0161e je navr\u017eeno tak, aby to zvl\xe1dl ka\u017ed\xfd \u010dlen klubu."]}),(0,p.jsx)(y.a,{p:4,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:(0,p.jsxs)(U.E,{fontSize:"md",color:"blue.800",fontWeight:"medium",children:[(0,p.jsx)("strong",{children:"Co m\u016f\u017eete d\u011blat:"})," P\u0159id\xe1vat \u010dl\xe1nky, spravovat z\xe1pasy, nahr\xe1vat fotky do galerie, pos\xedlat newslettery fanou\u0161k\u016fm, upravovat vzhled webu a mnoho dal\u0161\xedho. V\u0161e p\u0159ehledn\u011b na jednom m\xedst\u011b."]})}),(0,p.jsxs)(ee.z,{mt:4,mb:2,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.lHQ,color:(0,b.dU)("orange.500","orange.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Rychl\xe9 odkazy na nejpou\u017e\xedvan\u011bj\u0161\xed sekce"})]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:3,children:[{icon:pe.Nhm,title:"\u010cl\xe1nky",desc:"Publikujte novinky a report\xe1\u017ee",link:"/admin/clanky"},{icon:pe.i0U,title:"Z\xe1pasy",desc:"Automatick\xe9 na\u010d\xedt\xe1n\xed z FA\u010cR",link:"/admin/zapasy"},{icon:pe.YXz,title:"Hr\xe1\u010di a t\xfdmy",desc:"Spr\xe1va soupisek",link:"/admin/hraci"},{icon:pe.dkL,title:"Galerie",desc:"Fotogalerie a alba",link:"/admin/gallery"},{icon:pe.T0M,title:"M\xe9dia",desc:"Nahr\xe1v\xe1n\xed obr\xe1zk\u016f a soubor\u016f",link:"/admin/media"},{icon:pe.maD,title:"Newsletter",desc:"E-mailov\xe9 kampan\u011b",link:"/admin/newsletter"},{icon:pe.Pcn,title:"Nastaven\xed klubu",desc:"Logo, barvy, kontakty",link:"/admin/nastaveni"},{icon:pe.DDN,title:"Sponzo\u0159i",desc:"Spr\xe1va partner\u016f klubu",link:"/admin/sponzori"},{icon:pe.HiP,title:"Videa",desc:"YouTube a dal\u0161\xed videa",link:"/admin/videa"},{icon:pe.bfZ,title:"Aktivity",desc:"Kalend\xe1\u0159 akc\xed",link:"/admin/aktivity"},{icon:pe.YYR,title:"Analytics",desc:"Statistiky n\xe1v\u0161t\u011bvnosti",link:"/admin/analytika"},{icon:pe.KP4,title:"Prefetch",desc:"Aktualizace dat z FA\u010cR",link:"/admin/prefetch"}].map((e,t)=>(0,p.jsx)(L.N,{href:e.link,_hover:{textDecoration:"none"},children:(0,p.jsxs)(ee.z,{p:4,bg:(0,b.dU)("gray.50","gray.700"),borderRadius:"lg",borderWidth:"1px",borderColor:l,_hover:{shadow:"md",transform:"translateY(-2px)",borderColor:"blue.400"},transition:"all 0.2s",cursor:"pointer",children:[(0,p.jsx)(y.a,{p:2,bg:"blue.50",borderRadius:"md",children:(0,p.jsx)(jn.I,{as:e.icon,color:"blue.600",boxSize:5})}),(0,p.jsxs)(w.T,{align:"start",spacing:0,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"semibold",fontSize:"sm",children:e.title}),(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.desc})]})]})},t))}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",mt:4,children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.ZPX,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Tip pro za\u010d\xe1te\u010dn\xedky"})]})}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:["Pokud jste zde poprv\xe9, za\u010dn\u011bte v po\u0159ad\xed: ",(0,p.jsx)("strong",{children:"1) Nastaven\xed"})," (vypl\u0148te n\xe1zev klubu a logo),",(0,p.jsx)("strong",{children:"2) M\xe9dia"})," (nahrajte p\xe1r obr\xe1zk\u016f), ",(0,p.jsx)("strong",{children:"3) \u010cl\xe1nky"})," (vytvo\u0159te prvn\xed p\u0159\xedsp\u011bvek). Zbytek m\u016f\u017eete prozkoum\xe1vat postupn\u011b!"]})]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"nastaveni",icon:pe.Pcn,title:"Nastaven\xed klubu"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(xa.F,{status:"warning",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(U.E,{fontSize:"sm",children:[(0,p.jsxs)("strong",{children:[(0,p.jsx)(jn.I,{as:pe.BS8,boxSize:3,display:"inline",mr:1}),"Za\u010dn\u011bte zde!"]})," Nastaven\xed je prvn\xed, co byste m\u011bli vyplnit. Ovliv\u0148uje vzhled webu, e-maily, na\u010d\xedt\xe1n\xed z\xe1pas\u016f a dal\u0161\xed funkce. Bez spr\xe1vn\xe9ho nastaven\xed web nebude fungovat optim\xe1ln\u011b."]})]}),(0,p.jsx)(L.N,{href:"/admin/nastaveni",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.Pcn,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Nastaven\xed klubu"})]})}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.kkc,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Co nastavit? (Krok za krokem)"})]}),(0,p.jsxs)(No._J,{spacing:3,pl:5,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"N\xe1zev klubu"})," \u2014 Pln\xfd n\xe1zev va\u0161eho fotbalov\xe9ho klubu (zobrazuje se v z\xe1hlav\xed webu, e-mailech a v\u0161ude na str\xe1nk\xe1ch)"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Logo klubu"})," \u2014 Nejd\u0159\xedve nahrajte logo do sekce"," ",(0,p.jsx)(L.N,{href:"/admin/media",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"}),", pot\xe9 zkop\xedrujte adresu obr\xe1zku (URL) a vlo\u017ete ji sem"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Barvy"})," \u2014 Prim\xe1rn\xed barva (hlavn\xed barva klubu) a sekund\xe1rn\xed barva (dopl\u0148kov\xe1). Pou\u017eijte barevn\xe9 k\xf3dy jako nap\u0159. #FF0000 pro \u010dervenou"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"SMTP nastaven\xed (pro e-maily)"})," \u2014 Nutn\xe9 pro odes\xedl\xe1n\xed newsletter\u016f a automatick\xfdch e-mail\u016f. Pot\u0159ebujete: adresu serveru (host), port (465 nebo 587), u\u017eivatelsk\xe9 jm\xe9no a heslo"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"FA\u010cR \xfadaje"})," \u2014 Club ID a Club Type z\xedsk\xe1te z"," ",(0,p.jsx)(L.N,{href:"https://is.fotbal.cz",color:"blue.600",isExternal:!0,children:"is.fotbal.cz"}),". Tyto \xfadaje slou\u017e\xed k automatick\xe9mu na\u010d\xedt\xe1n\xed z\xe1pas\u016f a tabulek"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Soci\xe1ln\xed s\xedt\u011b"})," \u2014 Vlo\u017ete odkazy na Facebook, Instagram, YouTube profily klubu. Ikony se zobraz\xed v pati\u010dce webu"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Kontaktn\xed \xfadaje"})," \u2014 E-mail, telefon a adresa klubu pro kontaktn\xed str\xe1nku"]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"blue.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:"blue.800",children:"Tip pro SMTP (e-mailov\xe9 nastaven\xed)"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"blue.700",mb:2,children:[(0,p.jsx)("strong",{children:"Port 465"})," pou\u017e\xedv\xe1 SSL zabezpe\u010den\xed, ",(0,p.jsx)("strong",{children:"port 587"})," pou\u017e\xedv\xe1 STARTTLS."]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"blue.700",children:[(0,p.jsx)("strong",{children:"Pou\u017e\xedv\xe1te Gmail?"}),' Gmail vy\u017eaduje \u201eApp Password" (heslo aplikace), ne va\u0161e b\u011b\u017en\xe9 heslo! Nastavte si ho v Google Account \u2192 Security \u2192 2-Step Verification \u2192 App passwords.']})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("green.50","green.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"green.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"green.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:"green.800",children:"Nejste si jist\xed n\u011bkter\xfdm nastaven\xedm?"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:"green.700",children:["\u017d\xe1dn\xfd probl\xe9m! Napi\u0161te n\xe1m na"," ",(0,p.jsx)(L.N,{href:"mailto:help@tdvorak.dev",color:"green.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","a pom\u016f\u017eeme v\xe1m se v\u0161\xedm nastavit. Odpov\xedd\xe1me do 24 hodin."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"dashboard",icon:pe.$BV,title:"Dashboard a p\u0159ehledy"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Hned po p\u0159ihl\xe1\u0161en\xed najdete v sekci"," ",(0,p.jsx)(L.N,{href:"/admin",color:"blue.600",children:"Dashboard"})," souhrn nejd\u016fle\u017eit\u011bj\u0161\xedch informac\xed o webu a klubu."]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:[{title:"Rychl\xfd p\u0159ehled",desc:"Posledn\xed \u010dl\xe1nky, pl\xe1n z\xe1pas\u016f, e-mailov\xe9 statistiky."},{title:"Ak\u010dn\xed dla\u017edice",desc:"Tla\u010d\xedtka pro vytvo\u0159en\xed \u010dl\xe1nku, spu\u0161t\u011bn\xed prefetch nebo import alias\u016f."},{title:"Notifikace",desc:"Varov\xe1n\xed na chyb\u011bj\xedc\xed nastaven\xed nebo ne\xfasp\u011b\u0161n\xe9 importy."},{title:"Widget aktivit",desc:"Seznam nejbli\u017e\u0161\xedch akc\xed z kalend\xe1\u0159e aktivit."}].map((e,t)=>(0,p.jsxs)(y.a,{p:4,borderWidth:"1px",borderColor:l,borderRadius:"lg",bg:(0,b.dU)("gray.50","gray.700"),children:[(0,p.jsx)(z.D,{size:"sm",mb:2,children:e.title}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:e.desc})]},t))}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(U.E,{fontSize:"sm",children:["Dashboard vych\xe1z\xed z real-time dat. Pokud n\u011bco chyb\xed, spus\u0165te"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," nebo obnovte str\xe1nku."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"clanky",icon:pe.Nhm,title:"\u010cl\xe1nky a kategorie"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"\u010cl\xe1nky jsou hlavn\xed zp\u016fsob, jak komunikovat s fanou\u0161ky. M\u016f\u017eete publikovat novinky, report\xe1\u017ee, rozhovory a dal\u0161\xed obsah. Je to jednoduch\xe9 jako psan\xed p\u0159\xedsp\u011bvku na Facebook!"}),(0,p.jsx)(L.N,{href:"/admin/clanky",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.Nhm,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt \u010cl\xe1nky"})]})}),(0,p.jsxs)(zr.n,{allowToggle:!0,children:[(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{_expanded:{bg:"blue.50",color:"blue.700"},children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.uO9,boxSize:4}),(0,p.jsx)(U.E,{children:"Jak vytvo\u0159it \u010dl\xe1nek? (Krok za krokem)"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(No._J,{spacing:2,children:[(0,p.jsxs)(No.ck,{children:["Otev\u0159ete sekci"," ",(0,p.jsx)(L.N,{href:"/admin/clanky",color:"blue.600",fontWeight:"bold",children:"\u010cl\xe1nky"})]}),(0,p.jsx)(No.ck,{children:'Klikn\u011bte na zelen\xe9 tla\u010d\xedtko \u201eVytvo\u0159it \u010dl\xe1nek" (vpravo naho\u0159e)'}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Vypl\u0148te n\xe1zev \u010dl\xe1nku"}),' \u2014 nap\u0159. "V\xedt\u011bzstv\xed 3:1 proti Sokolu"']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Napi\u0161te obsah"})," \u2014 M\u016f\u017eete ps\xe1t norm\xe1ln\xed text. Pro pokro\u010dil\xe9: podporov\xe1n HTML/Markdown form\xe1t"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Vyberte kategorii"}),' \u2014 nap\u0159. "Z\xe1pasy", "Aktuality", "Rozhovory". Pokud kategorie neexistuje, vytvo\u0159te novou']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"P\u0159idejte hlavn\xed obr\xe1zek"})," \u2014 Nejprve nahrajte obr\xe1zek do"," ",(0,p.jsx)(L.N,{href:"/admin/media",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"}),', pot\xe9 zkop\xedrujte jeho adresu (URL) a vlo\u017ete ji do pole "Obr\xe1zek"']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Vypl\u0148te SEO titulek a popis"})," \u2014 Pom\xe1h\xe1 n\xe1v\u0161t\u011bvn\xedk\u016fm naj\xedt \u010dl\xe1nek p\u0159es Google"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:'Za\u0161krtn\u011bte \u201ePublikovat"'})," pokud chcete \u010dl\xe1nek hned zve\u0159ejnit. Pokud ne, m\u016f\u017eete ho ulo\u017eit jako koncept"]}),(0,p.jsxs)(No.ck,{children:['Klikn\u011bte na \u201eUlo\u017eit" \u2014 Hotovo! ',(0,p.jsx)(jn.I,{as:pe.A7C,boxSize:3,display:"inline",color:"green.500"})]})]})})]}),(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.IFh,boxSize:4}),(0,p.jsx)(U.E,{children:"Jak p\u0159idat obr\xe1zky a videa do \u010dl\xe1nku?"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsxs)(Cr.v,{pb:4,children:[(0,p.jsx)(U.E,{mb:2,fontSize:"sm",children:(0,p.jsx)("strong",{children:"Pro obr\xe1zky:"})}),(0,p.jsxs)(No._J,{spacing:2,fontSize:"sm",children:[(0,p.jsxs)(No.ck,{children:["Nahrajte obr\xe1zek v sekci ",(0,p.jsx)(L.N,{href:"/admin/media",color:"blue.600",children:"M\xe9dia"})]}),(0,p.jsxs)(No.ck,{children:["Zkop\xedrujte adresu obr\xe1zku (nap\u0159. ",(0,p.jsx)(ja.C,{children:"/uploads/2025/01/foto.jpg"}),")"]}),(0,p.jsxs)(No.ck,{children:["V editoru \u010dl\xe1nku pou\u017eijte HTML: ",(0,p.jsx)(ja.C,{children:'<img src="/uploads/2025/01/foto.jpg" alt="Popis" />'})]})]}),(0,p.jsx)(U.E,{mt:3,mb:2,fontSize:"sm",children:(0,p.jsx)("strong",{children:"Pro YouTube videa:"})}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Zkop\xedrujte YouTube odkaz a vlo\u017ete p\u0159\xedmo do obsahu, nebo pou\u017eijte HTML embed k\xf3d z YouTube."})]})]}),(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.KSO,boxSize:4}),(0,p.jsx)(U.E,{children:"SEO optimalizace (pro lep\u0161\xed viditelnost)"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsxs)(Cr.v,{pb:4,children:[(0,p.jsx)(U.E,{fontSize:"sm",mb:3,children:"SEO pom\xe1h\xe1 lidem naj\xedt va\u0161e \u010dl\xe1nky p\u0159es Google. Vypl\u0148te tyto pole:"}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"SEO Titulek:"}),' 50-60 znak\u016f, obsahuje kl\xed\u010dov\xe1 slova (nap\u0159. "FK Dvorinka zv\xedt\u011bzil 3:1 - report\xe1\u017e ze z\xe1pasu")']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"SEO Popis:"})," 150-160 znak\u016f, kr\xe1tk\xe9 shrnut\xed \u010dl\xe1nku pro Google v\xfdsledky"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"URL Slug:"}),' Kr\xe1tk\xfd text bez diakritiky, s poml\u010dkami (nap\u0159. "vitezstvi-3-1-sokol")']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Obr\xe1zek:"})," Optimalizujte velikost (max 1MB, ide\xe1ln\u011b 1200x630 px)"]})]})]})]})]}),(0,p.jsxs)(xa.F,{status:"success",borderRadius:"lg",mt:2,children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.ZPX,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Tip: Kategorie"})]})}),(0,p.jsx)(_o.T,{fontSize:"sm",children:'Vytvo\u0159te si kategorie jako "Z\xe1pasy", "Aktuality", "Ml\xe1de\u017e", "Rozhovory" atd. Pomohou fanou\u0161k\u016fm rychle naj\xedt konkr\xe9tn\xed typ obsahu!'})]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"zapasy",icon:pe.i0U,title:"Z\xe1pasy a tabulky"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Ve\u0161ker\xe1 data o z\xe1pasech, tabulk\xe1ch a v\xfdsledc\xedch se ",(0,p.jsx)("strong",{children:"automaticky na\u010d\xedtaj\xed z FA\u010cR"})," (Fotbalov\xe1 asociace \u010cR). Nemus\xedte nic zad\xe1vat ru\u010dn\u011b \u2014 sta\u010d\xed spr\xe1vn\xe9 nastaven\xed a syst\xe9m v\u0161e st\xe1hne s\xe1m!"]}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:3,children:[(0,p.jsx)(L.N,{href:"/admin/zapasy",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.i0U,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Zobrazit z\xe1pasy"})]})}),(0,p.jsx)(L.N,{href:"/admin/prefetch",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("green.50","green.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("green.100","green.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.KP4,color:"green.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"green.700",children:"\u2192 Aktualizovat data (Prefetch)"})]})})]}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.Pcn,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Jak nastavit automatick\xe9 na\u010d\xedt\xe1n\xed z\xe1pas\u016f?"})]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["P\u0159ejd\u011bte do"," ",(0,p.jsx)(L.N,{href:"/admin/nastaveni",color:"blue.600",fontWeight:"bold",children:"Nastaven\xed"})," klubu"]}),(0,p.jsxs)(No.ck,{children:["Najd\u011bte sekci ",(0,p.jsx)("strong",{children:'"FA\u010cR \xfadaje"'})]}),(0,p.jsxs)(No.ck,{children:["Vypl\u0148te ",(0,p.jsx)("strong",{children:"Club ID"})," a ",(0,p.jsx)("strong",{children:"Club Type"})," (z\xedsk\xe1te z"," ",(0,p.jsx)(L.N,{href:"https://is.fotbal.cz",color:"blue.600",isExternal:!0,children:"is.fotbal.cz"}),")"]}),(0,p.jsxs)(No.ck,{children:["Ulo\u017ete nastaven\xed a spus\u0165te"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",fontWeight:"bold",children:"Prefetch"})," pro na\u010dten\xed dat"]}),(0,p.jsxs)(No.ck,{children:["Hotovo! Z\xe1pasy a tabulky se budou automaticky aktualizovat ",(0,p.jsx)(jn.I,{as:pe.A7C,boxSize:3,display:"inline",color:"green.500"})]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"blue.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:(0,b.dU)("blue.800","blue.200"),children:"Co jsou aliasy sout\u011b\u017e\xed?"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:(0,b.dU)("blue.700","blue.200"),mb:2,children:["Z FA\u010cR n\u011bkdy p\u0159ich\xe1zej\xed dlouh\xe9 a nep\u0159ehledn\xe9 n\xe1zvy sout\u011b\u017e\xed. V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/aliasy-soutezi",color:"blue.600",fontWeight:"bold",children:"Alias sout\u011b\u017e\xed"})," ","si m\u016f\u017eete n\xe1zvy zkr\xe1tit a upravit, jak se maj\xed zobrazovat na webu."]}),(0,p.jsx)(U.E,{fontSize:"xs",color:(0,b.dU)("blue.600","blue.300"),children:'P\u0159\xedklad: "I. A t\u0159\xedda skupina B - mu\u017ei" \u2192 "I.A t\u0159\xedda"'})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.KP4,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Aktualizace dat"})]})}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:["Data se automaticky aktualizuj\xed pravideln\u011b. Pokud pot\u0159ebujete aktualizovat hned, pou\u017eijte tla\u010d\xedtko v sekci"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",fontWeight:"bold",children:"Prefetch"}),"."]})]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"hraci-tymy",icon:pe.YXz,title:"Hr\xe1\u010di a t\xfdmy"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Udr\u017eujte seznam t\xfdm\u016f a hr\xe1\u010d\u016f aktu\xe1ln\xed, aby fanou\u0161ci i tren\xe9\u0159i m\u011bli okam\u017eit\xfd p\u0159ehled o soupisce."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/tymy",color:"blue.600",children:"T\xfdmy"})," spravujete z\xe1kladn\xed \xfadaje a fotografie."]}),(0,p.jsx)(No.ck,{children:"Hr\xe1\u010de p\u0159i\u0159azujte k t\xfdm\u016fm, dopl\u0148te \u010d\xedsla dres\u016f, pozice a profilov\xe9 obr\xe1zky."}),(0,p.jsxs)(No.ck,{children:["V p\u0159\xedpad\u011b chybn\u011b na\u010dten\xfdch log \u010di n\xe1zv\u016f vyu\u017eijte"," ",(0,p.jsx)(L.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"aliasy sout\u011b\u017e\xed"})," nebo manu\xe1ln\xed \xfapravy t\xfdm\u016f."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"media",icon:pe.T0M,title:"M\xe9dia a soubory"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Sekce M\xe9dia je va\u0161e ",(0,p.jsx)("strong",{children:"centr\xe1ln\xed \xfalo\u017ei\u0161t\u011b pro v\u0161echny obr\xe1zky, loga a soubory"}),". V\u0161e, co nahrajete zde, m\u016f\u017eete pak pou\u017e\xedt v \u010dl\xe1nc\xedch, bannerech, newsletterech nebo na str\xe1nce O klubu."]}),(0,p.jsx)(L.N,{href:"/admin/media",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.T0M,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt M\xe9dia"})]})}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.T0M,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Jak nahr\xe1t obr\xe1zek nebo soubor?"})]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["Otev\u0159ete sekci"," ",(0,p.jsx)(L.N,{href:"/admin/media",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"})]}),(0,p.jsxs)(No.ck,{children:["Klikn\u011bte na tla\u010d\xedtko ",(0,p.jsx)("strong",{children:'"Nahr\xe1t soubor"'})," nebo ",(0,p.jsx)("strong",{children:'"Upload"'})]}),(0,p.jsx)(No.ck,{children:"Vyberte obr\xe1zek ze sv\xe9ho po\u010d\xedta\u010de (doporu\u010den\xe9 form\xe1ty: JPG, PNG, max 5 MB)"}),(0,p.jsxs)(No.ck,{children:["Po nahr\xe1n\xed se zobraz\xed ",(0,p.jsx)("strong",{children:"adresa souboru"})," (URL) \u2014 nap\u0159. ",(0,p.jsx)(ja.C,{children:"/uploads/2025/01/foto.jpg"})]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Zkop\xedrujte tuto adresu"})," a pou\u017eijte ji tam, kde pot\u0159ebujete (\u010dl\xe1nky, nastaven\xed loga atd.)"]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"blue.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:(0,b.dU)("blue.800","blue.200"),children:"Tipy pro pr\xe1ci s obr\xe1zky"})]}),(0,p.jsxs)(No.B8,{spacing:1,styleType:"disc",pl:5,fontSize:"sm",color:(0,b.dU)("blue.700","blue.200"),children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Optimalizujte velikost:"})," Ide\xe1ln\xed \u0161\xed\u0159ka 1200-2000 px, velikost souboru max 1 MB"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pou\u017e\xedvejte popisn\xe9 n\xe1zvy:"}),' nap\u0159. "zapas-sokol-2025-01.jpg" m\xedsto "IMG_1234.jpg"']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Form\xe1ty:"})," JPG pro fotky, PNG pro loga s pr\u016fhlednost\xed"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Z\xe1loha:"})," D\u016fle\u017eit\xe9 fotky si uchov\xe1vejte i lok\xe1ln\u011b na po\u010d\xedta\u010di"]})]})]}),(0,p.jsxs)(xa.F,{status:"warning",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.BS8,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Pozor p\u0159i maz\xe1n\xed soubor\u016f!"})]})}),(0,p.jsx)(_o.T,{fontSize:"sm",children:"Ne\u017e sma\u017eete obr\xe1zek, ov\u011b\u0159te, \u017ee ho nepou\u017e\xedv\xe1te v \u010dl\xe1nc\xedch, bannerech nebo jinde na webu. Po smaz\xe1n\xed se m\xedsto obr\xe1zku zobraz\xed chybov\xe1 hl\xe1\u0161k\xe1 (404)."})]})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.g1V,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Spr\xe1va soubor\u016f"})]})}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:["Pro pokro\u010dilou spr\xe1vu v\u0161ech nahran\xfdch soubor\u016f pou\u017eijte sekci"," ",(0,p.jsx)(L.N,{href:"/admin/files",color:"blue.600",fontWeight:"bold",children:"Soubory"}),", kde vid\xedte celkov\xfd p\u0159ehled, velikosti a m\u016f\u017eete je filtrovat."]})]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"gallery",icon:pe.dkL,title:"Galerie"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"V sekci Galerie spravujete fotografie z akc\xed, z\xe1pas\u016f a dal\u0161\xedch klubov\xfdch ud\xe1lost\xed. M\u016f\u017eete vyu\u017e\xedt propojen\xed se slu\u017ebou Zonerama nebo nahr\xe1vat fotky p\u0159\xedmo."}),(0,p.jsx)(L.N,{href:"/admin/gallery",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.dkL,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Galerii"})]})}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.dkL,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Jak p\u0159idat fotogalerii?"})]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["Otev\u0159ete sekci"," ",(0,p.jsx)(L.N,{href:"/admin/gallery",color:"blue.600",fontWeight:"bold",children:"Galerie"})]}),(0,p.jsx)(No.ck,{children:'Klikn\u011bte na \u201eP\u0159idat album" nebo \u201eVytvo\u0159it galerii"'}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Vypl\u0148te n\xe1zev alba"}),' \u2014 nap\u0159. "Z\xe1pas proti Spartaku 15.10.2025"']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"P\u0159idejte popis"})," \u2014 kr\xe1tk\xfd text, co fotky zobrazuj\xed"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Nahrajte n\xe1hledov\xfd obr\xe1zek"})," \u2014 reprezentativn\xed foto, kter\xe9 se zobraz\xed jako n\xe1hled"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Propojte se Zoneramou"})," (voliteln\xe9) \u2014 Pokud m\xe1te fotky na Zonerama.cz, vlo\u017ete odkaz na album"]}),(0,p.jsxs)(No.ck,{children:["Ulo\u017ete album \u2014 zobraz\xed se fanou\u0161k\u016fm na webu! ",(0,p.jsx)(jn.I,{as:pe.A7C,boxSize:3,display:"inline",color:"green.500"})]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("purple.50","purple.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"purple.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.__w,color:"purple.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:(0,b.dU)("purple.800","purple.200"),children:"Co je Zonerama?"})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("purple.700","purple.200"),children:"Zonerama je \u010desk\xfd fotoserver, kde m\u016f\u017eete zdarma ukl\xe1dat fotky. Pokud tam u\u017e m\xe1te fotogalerie, m\u016f\u017eete je propojit s va\u0161\xedm webem a nemus\xedte je nahr\xe1vat znovu! Sta\u010d\xed vlo\u017eit odkaz."})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.ZPX,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"Tip pro organizaci"})]})}),(0,p.jsx)(_o.T,{fontSize:"sm",children:'Vytv\xe1\u0159ejte alba systematicky: "Sez\xf3na 2024/25 - Dom\xe1c\xed z\xe1pasy", "Letn\xed soust\u0159ed\u011bn\xed 2025" atd. Fanou\u0161k\u016fm se pak l\xe9pe hledaj\xed konkr\xe9tn\xed fotky!'})]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"files",icon:pe.g1V,title:"Spr\xe1va soubor\u016f"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Sekce ",(0,p.jsx)(L.N,{href:"/admin/files",color:"blue.600",children:"Soubory"})," nab\xedz\xed p\u0159ehled v\u0161ech nahran\xfdch polo\u017eek v\u010detn\u011b velikosti a data nahr\xe1n\xed."]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsx)(No.ck,{children:"Filtrujte podle typu souboru nebo n\xe1zvu \u2013 snadno najdete star\u0161\xed materi\xe1ly."}),(0,p.jsx)(No.ck,{children:"St\xe1hn\u011bte soubor p\u0159\xedmo z administrace pro lok\xe1ln\xed z\xe1lohu."}),(0,p.jsx)(No.ck,{children:"P\u0159i hromadn\xe9m \xfaklidu postupujte opatrn\u011b a dr\u017ete se doporu\u010den\xed v `FILES_MANAGEMENT_SYSTEM.md`."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"sponzori-bannery",icon:pe.DDN,title:"Sponzo\u0159i a bannery"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Zobrazujte partnery klubu a spravujte reklamn\xed plochy na webu i v newsletterech."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/sponzori",color:"blue.600",children:"Sponzo\u0159i"})," p\u0159idejte logo, odkaz a po\u0159ad\xed zobrazen\xed."]}),(0,p.jsxs)(No.ck,{children:["Bannery vkl\xe1dejte p\u0159es"," ",(0,p.jsx)(L.N,{href:"/admin/bannery",color:"blue.600",children:"Bannery"}),"; nastavte c\xedlovou URL a obdob\xed platnosti."]}),(0,p.jsxs)(No.ck,{children:["Statistiky prokliku sledujte v sekci"," ",(0,p.jsx)(L.N,{href:"/admin/analytics",color:"blue.600",children:"Analytics"}),"."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"newsletter",icon:pe.maD,title:"Newsletter a e-maily"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Newsletter v\xe1m umo\u017e\u0148uje pos\xedlat hromadn\xe9 e-maily v\u0161em fanou\u0161k\u016fm, kte\u0159\xed se k odb\u011bru p\u0159ihl\xe1sili. Ide\xe1ln\xed pro ozn\xe1men\xed o z\xe1pasech, akc\xedch nebo d\u016fle\u017eit\xe9 informace o klubu."}),(0,p.jsx)(L.N,{href:"/admin/newsletter",isExternal:!0,children:(0,p.jsxs)(ee.z,{p:3,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,b.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,p.jsx)(jn.I,{as:pe.maD,color:"blue.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Newsletter"})]})}),(0,p.jsxs)(xa.F,{status:"warning",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(wo.X,{fontSize:"sm",children:(0,p.jsxs)(ee.z,{spacing:2,display:"inline-flex",children:[(0,p.jsx)(jn.I,{as:pe.BS8,boxSize:3}),(0,p.jsx)(U.E,{as:"span",children:"P\u0159ed odesl\xe1n\xedm newsletteru"})]})}),(0,p.jsxs)(_o.T,{fontSize:"sm",children:[(0,p.jsx)("strong",{children:"V\u017edy nejprve otestujte e-mail na sv\xe9 adrese!"})," Zkontrolujte, \u017ee v\u0161e vypad\xe1 dob\u0159e, \u017ee nejsou p\u0159eklepy a \u017ee obr\xe1zky se zobrazuj\xed spr\xe1vn\u011b. A\u017e pak ode\u0161lete v\u0161em."]})]})]}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsx)(jn.I,{as:pe.maD,color:(0,b.dU)("blue.600","blue.300"),boxSize:4}),(0,p.jsx)(z.D,{size:"sm",children:"Postup: Jak odeslat newsletter?"})]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Zkontrolujte SMTP nastaven\xed"})," \u2014 Mus\xed b\xfdt spr\xe1vn\u011b vypln\u011bn\xe9 v"," ",(0,p.jsx)(L.N,{href:"/admin/nastaveni",color:"blue.600",fontWeight:"bold",children:"Nastaven\xed"}),". Bez n\u011bj e-maily nep\u016fjdou odeslat!"]}),(0,p.jsxs)(No.ck,{children:["Otev\u0159ete"," ",(0,p.jsx)(L.N,{href:"/admin/newsletter",color:"blue.600",fontWeight:"bold",children:"Newsletter"})]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Vypl\u0148te p\u0159edm\u011bt e-mailu"}),' \u2014 nap\u0159. "Pozv\xe1nka na z\xe1pas s Technikou Brno"']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Napi\u0161te obsah"})," \u2014 M\u016f\u017eete pou\u017e\xedt norm\xe1ln\xed text nebo HTML form\xe1tov\xe1n\xed pro hez\u010d\xed vzhled"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"D\u016eLE\u017dIT\xc9: Po\u0161lete testovac\xed e-mail"}),' \u2014 Klikn\u011bte na \u201eOdeslat test" a zadejte svou e-mailovou adresu. Zkontrolujte, jak e-mail vypad\xe1']}),(0,p.jsxs)(No.ck,{children:["Pokud v\u0161e vypad\xe1 dob\u0159e, klikn\u011bte na ",(0,p.jsx)("strong",{children:'\u201eOdeslat v\u0161em"'})," \u2014 e-mail se roze\u0161le v\u0161em p\u0159ihl\xe1\u0161en\xfdm"]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"blue.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:(0,b.dU)("blue.800","blue.200"),children:"Tipy pro \xfasp\u011b\u0161n\xfd newsletter"})]}),(0,p.jsxs)(No.B8,{spacing:1,styleType:"disc",pl:5,fontSize:"sm",color:(0,b.dU)("blue.700","blue.200"),children:[(0,p.jsx)(No.ck,{children:"Pi\u0161te stru\u010dn\u011b a jasn\u011b \u2014 \u010dten\xe1\u0159i maj\xed m\xe1lo \u010dasu"}),(0,p.jsx)(No.ck,{children:"Pou\u017e\xedvejte poutav\xfd p\u0159edm\u011bt \u2014 zv\xfd\u0161\xed to \u0161anci, \u017ee e-mail otev\u0159ou"}),(0,p.jsx)(No.ck,{children:"P\u0159id\xe1vejte odkazy na web pro v\xedce informac\xed"}),(0,p.jsx)(No.ck,{children:"Nepos\xedlejte newslettery p\u0159\xedli\u0161 \u010dasto (doporu\u010deno: max 1-2x t\xfddn\u011b)"})]})]}),(0,p.jsxs)(y.a,{p:4,bg:(0,b.dU)("orange.50","orange.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"orange.500",children:[(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.BS8,color:"orange.600"}),(0,p.jsx)(U.E,{fontWeight:"semibold",color:(0,b.dU)("orange.800","orange.200"),children:"Probl\xe9m s odes\xedl\xe1n\xedm?"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:(0,b.dU)("orange.700","orange.200"),children:["Pokud e-maily nejdou odeslat nebo padaj\xed do spamu, napi\u0161te n\xe1m na"," ",(0,p.jsx)(L.N,{href:"mailto:help@tdvorak.dev",color:"orange.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","a pom\u016f\u017eeme v\xe1m nastavit SMTP a dal\u0161\xed pokro\u010dil\xe9 v\u011bci (SPF, DKIM z\xe1znamy)."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"aliasy",icon:pe.Z0L,title:"Alias sout\u011b\u017e\xed"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Alias spr\xe1va slou\u017e\xed pro p\u0159ejmenov\xe1n\xed sout\u011b\u017e\xed importovan\xfdch z FA\u010cR tak, aby byly na webu srozumiteln\xe9 a jednotn\xe9."}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["Otev\u0159ete"," ",(0,p.jsx)(L.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"Alias sout\u011b\u017e\xed"}),"."]}),(0,p.jsx)(No.ck,{children:'Vyu\u017eijte automatick\xfd import ze soubor\u016f cache (tla\u010d\xedtko \u201eImportovat ze sout\u011b\u017e\xed").'}),(0,p.jsx)(No.ck,{children:"Upravte aliasy ru\u010dn\u011b nebo p\u0159et\xe1hn\u011bte po\u0159ad\xed pro prioritn\xed sout\u011b\u017ee."})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Ka\u017ed\xe1 zm\u011bna se prop\xed\u0161e na front-end b\u011bhem n\u011bkolika sekund po ulo\u017een\xed."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"prefetch",icon:pe.KP4,title:"Prefetch a cache"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Prefetch vytv\xe1\u0159\xed lok\xe1ln\xed cache dat (z\xe1pasy, videa, \u010dl\xe1nky) a v\xfdrazn\u011b zrychluje na\u010d\xedt\xe1n\xed webu."}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," zkontrolujte posledn\xed b\u011bh a stav jednotliv\xfdch modul\u016f."]}),(0,p.jsx)(No.ck,{children:"Spus\u0165te ru\u010dn\u011b po v\u011bt\u0161\xedch obsahov\xfdch zm\u011bn\xe1ch nebo p\u0159i neaktu\xe1ln\xedch datech."}),(0,p.jsx)(No.ck,{children:"Sledujte upozorn\u011bn\xed na chyb\u011bj\xedc\xed tokeny \u010di API kl\xed\u010de (nap\u0159. YouTube). Bez nich se data neobnov\xed."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"videa",icon:pe.HiP,title:"Videa"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Integrace s YouTube a dal\u0161\xedmi platformami umo\u017e\u0148uje vkl\xe1dat playlisty i jednotliv\xe1 videa."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["P\u0159id\xe1vejte videa v sekci"," ",(0,p.jsx)(L.N,{href:"/admin/videa",color:"blue.600",children:"Videa"})," pomoc\xed URL nebo ID videa."]}),(0,p.jsxs)(No.ck,{children:["Aktivujte automatick\xfd import playlistu p\u0159es"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"}),"."]}),(0,p.jsx)(No.ck,{children:"N\xe1hledy se ukl\xe1daj\xed do cache; p\u0159i probl\xe9mech spus\u0165te znovu Prefetch modul Videa."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"aktivity",icon:pe.bfZ,title:"Aktivity"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Klubov\xe9 akce, tr\xe9ninky a mimo-sout\u011b\u017en\xed ud\xe1losti m\u016f\u017eete prezentovat v kalend\xe1\u0159i i na \xfavodn\xed str\xe1nce."}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/aktivity",color:"blue.600",children:"Aktivity"})," nastavte datum, m\xedsto a kr\xe1tk\xfd popis."]}),(0,p.jsx)(No.ck,{children:"P\u0159idejte obr\xe1zek nebo ikonu pro lep\u0161\xed vizu\xe1ln\xed zobrazen\xed."}),(0,p.jsx)(No.ck,{children:"Aktivitu ozna\u010dte jako ve\u0159ejnou, chcete-li ji zobrazit na webu."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"merch",icon:pe.lV_,title:"Oble\u010den\xed"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Spravujte polo\u017eky klubov\xe9ho merche a informujte fanou\u0161ky o dostupnosti zbo\u017e\xed."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["P\u0159idejte polo\u017eky v"," ",(0,p.jsx)(L.N,{href:"/admin/merch",color:"blue.600",children:"Oble\u010den\xed"})," s popisem, cenou a fotkou."]}),(0,p.jsx)(No.ck,{children:'Vyu\u017eijte \u0161t\xedtky pro kategorizaci (nap\u0159. "dresy", "fan shop").'}),(0,p.jsx)(No.ck,{children:"Sledujte z\xe1jem fanou\u0161k\u016f p\u0159es kontaktn\xed formul\xe1\u0159 nebo dedikovan\xfd e-shop."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"zpravy",icon:pe.g5D,title:"Zpr\xe1vy"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Zpr\xe1vy zahrnuj\xed kontaktn\xed formul\xe1\u0159e, p\u0159ihl\xe1\u0161ky a dal\u0161\xed komunikaci sm\u011brem ke klubu."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["V"," ",(0,p.jsx)(L.N,{href:"/admin/zpravy",color:"blue.600",children:"Zpr\xe1v\xe1ch"})," vid\xedte p\u0159ijat\xe9 zpr\xe1vy a jejich stav."]}),(0,p.jsx)(No.ck,{children:"Odpov\xeddejte z vlastn\xed e-mailov\xe9 schr\xe1nky; syst\xe9m uchov\xe1v\xe1 historii pouze informativn\u011b."}),(0,p.jsx)(No.ck,{children:"Ozna\u010dte vy\u0159\xedzen\xe9 zpr\xe1vy pro p\u0159ehlednost t\xfdmu."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"contacts",icon:pe.toK,title:"Kontakty a formul\xe1\u0159e"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["V sekci"," ",(0,p.jsx)(L.N,{href:"/admin/kontakty",color:"blue.600",children:"Kontakty"})," spravujete kontaktn\xed \xfadaje klubu a odpov\u011bdn\xe9 osoby pro jednotliv\xe9 typy dotaz\u016f."]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsx)(No.ck,{children:"Zadejte telefon, e-mail a roli pro ka\u017ed\xe9ho kontaktn\xedho pracovn\xedka."}),(0,p.jsx)(No.ck,{children:"U formul\xe1\u0159\u016f lze nastavit c\xedlovou e-mailovou adresu a potvrzovac\xed zpr\xe1vu."}),(0,p.jsxs)(No.ck,{children:["Zkontrolujte odd\xedl ",(0,p.jsx)(L.N,{href:"/admin/zpravy",color:"blue.600",children:"Zpr\xe1vy"}),", zda se odes\xedlan\xe9 formul\xe1\u0159e ukl\xe1daj\xed spr\xe1vn\u011b."]})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Kontaktn\xed \xfadaje se propisuj\xed do pati\u010dky webu i do automatick\xfdch e-mail\u016f."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"analytics",icon:pe.YYR,title:"Analytics a reporty"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Sekce"," ",(0,p.jsx)(L.N,{href:"/admin/analytika",color:"blue.600",children:"Analytics"})," kombinuje statistiky z Umami a intern\xedch metrik syst\xe9mu. Sledujte n\xe1v\u0161t\u011bvnost, interakce a v\xfdkon jednotliv\xfdch str\xe1nek."]}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsx)(No.ck,{children:"P\u0159ehled n\xe1v\u0161t\u011bv podle \u010dasov\xe9ho obdob\xed a zdroj\u016f."}),(0,p.jsx)(No.ck,{children:"Top \u010dl\xe1nky, nej\u010dten\u011bj\u0161\xed kategorie a popularita vide\xed."}),(0,p.jsx)(No.ck,{children:"Informace o p\u0159ihl\xe1\u0161k\xe1ch k newsletteru a konverz\xedch formul\xe1\u0159\u016f."})]}),(0,p.jsx)(y.a,{p:4,bg:(0,b.dU)("green.50","green.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"green.500",children:(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("green.700","green.200"),children:"Podrobn\xfd postup integrace najdete v souboru `UMAMI_SETUP_WITH_CLUB_NAME.md`. Doporu\u010dujeme nastavit i `UMAMI_ADMIN_EXCLUSION.md`, aby se nezapo\u010d\xedt\xe1valy administr\xe1torsk\xe9 n\xe1v\u0161t\u011bvy."})})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"scoreboard",icon:pe.vF8,title:"Tabule (Scoreboard)"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Scoreboard v"," ",(0,p.jsx)(L.N,{href:"/admin/scoreboard",color:"blue.600",children:"Tabuli"})," pou\u017e\xedv\xe1 data ze z\xe1pas\u016f a umo\u017e\u0148uje p\u0159ipravit grafiku na klubov\xe9 obrazovky."]}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsx)(No.ck,{children:"Vyberte sout\u011b\u017e a konkr\xe9tn\xed z\xe1pas pro zobrazen\xed."}),(0,p.jsx)(No.ck,{children:"Nastavte barevn\xe9 t\xe9ma v souladu s brandingem klubu."}),(0,p.jsx)(No.ck,{children:"Exportujte URL pro sd\xedlen\xed na velkoplo\u0161n\xfdch displej\xedch."})]}),(0,p.jsxs)(xa.F,{status:"warning",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsxs)(U.E,{fontSize:"sm",children:["Scoreboard vy\u017eaduje aktu\xe1ln\xed data z FA\u010cR. Pokud se z\xe1pas nezobrazuje, ov\u011b\u0159te nastaven\xed v sekci ",(0,p.jsx)(L.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"Alias sout\u011b\u017e\xed"})," a spus\u0165te Prefetch."]})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"mobile-scoreboard",icon:pe.rle,title:"Mobiln\xed scoreboard"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsxs)(U.E,{children:["Pro ovl\xe1d\xe1n\xed tabule na d\xe1lku pou\u017eijte"," ",(0,p.jsx)(L.N,{href:"/admin/scoreboard/remote",color:"blue.600",children:"Mobiln\xed scoreboard"}),". Umo\u017e\u0148uje aktualizovat sk\xf3re v pr\u016fb\u011bhu utk\xe1n\xed p\u0159\xedmo z telefonu."]}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsx)(No.ck,{children:"P\u0159ihlaste se stejn\xfdm \xfa\u010dtem jako v administraci."}),(0,p.jsx)(No.ck,{children:"Vyberte z\xe1pas, kter\xfd sledujete, a nastavte sk\xf3re i \u010das."}),(0,p.jsx)(No.ck,{children:"Ov\u011b\u0159te internetov\xe9 p\u0159ipojen\xed \u2013 zm\u011bny se synchronizuj\xed okam\u017eit\u011b na ve\u0159ejn\xe9 tabuli."})]}),(0,p.jsxs)(xa.F,{status:"success",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Funkce je optimalizovan\xe1 pro PWA. P\u0159idejte si ji na domovskou obrazovku pro rychl\xfd p\u0159\xedstup."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"uzivatele",icon:pe.pXu,title:"U\u017eivatel\xe9 a p\u0159\xedstupy"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Spravujte p\u0159\xedstupy administr\xe1tor\u016f i redaktor\u016f, nastavujte role a resetujte hesla."}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["V"," ",(0,p.jsx)(L.N,{href:"/admin/uzivatele",color:"blue.600",children:"U\u017eivatel\xedch"})," p\u0159idejte nov\xe9 \xfa\u010dty a p\u0159id\u011blte roli ",(0,p.jsx)(ja.C,{children:"admin"})," nebo ",(0,p.jsx)(ja.C,{children:"user"}),"."]}),(0,p.jsxs)(No.ck,{children:["Pro reset hesla vyu\u017eijte n\xe1stroj"," ",(0,p.jsx)(L.N,{href:"/admin/users/send-reset",color:"blue.600",children:"Odeslat reset"}),"."]}),(0,p.jsx)(No.ck,{children:"Doporu\u010dujeme zapnout dvoufaktorov\xe9 ov\u011b\u0159en\xed na e-mailov\xfdch \xfa\u010dtech administr\xe1tor\u016f."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"docs",icon:pe.__w,title:"Intern\xed dokumentace"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"V repozit\xe1\u0159i najdete rozs\xe1hl\xe9 manu\xe1ly k jednotliv\xfdm oblastem. Doporu\u010dujeme proj\xedt alespo\u0148 tyto:"}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"FRONTEND_FUNCTIONALITY_REPORT.md"})," \u2013 podrobn\xfd popis ve\u0159ejn\xe9ho webu."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"BACKEND_FUNCTIONALITY_REPORT.md"})," \u2013 vysv\u011btlen\xed API a datov\xfdch tok\u016f."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"NEWSLETTER_SYSTEM.md"})," a ",(0,p.jsx)(ja.C,{children:"FILES_MANAGEMENT_SYSTEM.md"})," \u2013 detailn\xed pracovn\xed postupy."]})]}),(0,p.jsxs)(xa.F,{status:"info",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Kompletn\xed seznam manu\xe1l\u016f najdete v adres\xe1\u0159i `docs/` (ko\u0159en projektu). Dokumenty jsou pr\u016fb\u011b\u017en\u011b aktualizovan\xe9 \u2013 sledujte datum posledn\xed revize."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"checklist",icon:pe.lfF,title:"Checklisty a postupy"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Pro rychl\xe9 spu\u0161t\u011bn\xed nov\xfdch funkc\xed vyu\u017eijte p\u0159ipraven\xe9 checklisty. Najdete je v ko\u0159enov\xe9m adres\xe1\u0159i projektu a v administraci slou\u017e\xed jako dopln\u011bk k t\xe9to dokumentaci."}),(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"NEWSLETTER_FEATURE_CHECKLIST.md"})," \u2013 krok za krokem konfigurace newsletteru."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"FILES_MANAGEMENT_TESTING.md"})," \u2013 co ov\u011b\u0159it, ne\u017e nasad\xedte novou sadu soubor\u016f."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)(ja.C,{children:"MAP_IMPORT_COMPLETE_IMPLEMENTATION.md"})," a souvisej\xedc\xed checklisty pro import mapov\xfdch dat."]})]}),(0,p.jsxs)(xa.F,{status:"success",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Checklisty si m\u016f\u017eete st\xe1hnout jako PDF a sd\xedlet v r\xe1mci klubu \u2013 usnadn\xedte tak za\u0161kolen\xed nov\xfdch \u010dlen\u016f t\xfdmu."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"seo",icon:pe.KSO,title:"SEO a Analytics"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:4,mb:6,children:[(0,p.jsx)(U.E,{children:"Spr\xe1vn\xe9 SEO nastaven\xed a analytika v\xe1m pom\u016f\u017eou sledovat n\xe1v\u0161t\u011bvnost webu a optimalizovat obsah."}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["U ka\u017ed\xe9ho \u010dl\xe1nku vypl\u0148te ",(0,p.jsx)("strong",{children:"SEO titulek"}),", ",(0,p.jsx)("strong",{children:"SEO popis"})," a slug bez diakritiky."]}),(0,p.jsxs)(No.ck,{children:["Integrujte slu\u017ebu"," ",(0,p.jsx)(L.N,{href:"/admin/analytics",color:"blue.600",children:"Umami Analytics"})," dle pr\u016fvodce v souboru `UMAMI_SETUP_WITH_CLUB_NAME.md`."]}),(0,p.jsx)(No.ck,{children:"Pro soci\xe1ln\xed s\xedt\u011b dopl\u0148te Open Graph a Twitter metatagy v nastaven\xed."})]}),(0,p.jsxs)(xa.F,{status:"success",borderRadius:"lg",children:[(0,p.jsx)(ga._,{}),(0,p.jsx)(U.E,{fontSize:"sm",children:"Auditujte SEO pravideln\u011b \u2014 jednoduch\xe9 \xfapravy nadpis\u016f a popis\u016f v\xfdrazn\u011b zlep\u0161\xed dosah."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(c,{id:"troubleshooting",icon:pe.KRc,title:"\u0158e\u0161en\xed probl\xe9m\u016f"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:6,mb:6,children:[(0,p.jsxs)(zr.n,{allowMultiple:!0,children:[(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.BS8,boxSize:4}),(0,p.jsx)(U.E,{children:"E-maily se neodes\xedlaj\xed"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["Zkontrolujte SMTP nastaven\xed v"," ",(0,p.jsx)(L.N,{href:"/admin/nastaveni",color:"blue.600",children:"Nastaven\xed"})]}),(0,p.jsx)(No.ck,{children:"Ov\u011b\u0159te port: 465 = SSL, 587 = STARTTLS"}),(0,p.jsx)(No.ck,{children:'Gmail vy\u017eaduje \u201eApp Password", ne b\u011b\u017en\xe9 heslo'}),(0,p.jsx)(No.ck,{children:"Zkuste odeslat testovac\xed e-mail z Newsletteru"}),(0,p.jsx)(No.ck,{children:"Zkontrolujte serverov\xe9 logy pro chybov\xe9 hl\xe1\u0161ky"})]})})]}),(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.dkL,boxSize:4}),(0,p.jsx)(U.E,{children:"Obr\xe1zky se nezobrazuj\xed"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsxs)(No.ck,{children:["Nahrajte obr\xe1zek do"," ",(0,p.jsx)(L.N,{href:"/admin/media",color:"blue.600",children:"M\xe9dia"})]}),(0,p.jsxs)(No.ck,{children:["Pou\u017eijte relativn\xed cestu: ",(0,p.jsx)(ja.C,{children:"/uploads/2025/01/obrazek.jpg"})]}),(0,p.jsxs)(No.ck,{children:["Pro extern\xed zdroje pou\u017eijte proxy: ",(0,p.jsx)(ja.C,{children:"/api/v1/proxy/image?url=..."})]}),(0,p.jsx)(No.ck,{children:"Zkontrolujte, \u017ee soubor existuje a je ve\u0159ejn\u011b p\u0159\xedstupn\xfd"})]})})]}),(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.i0U,boxSize:4}),(0,p.jsx)(U.E,{children:"FA\u010cR data nejsou aktu\xe1ln\xed"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(No._J,{spacing:2,pl:5,children:[(0,p.jsxs)(No.ck,{children:["Spus\u0165te"," ",(0,p.jsx)(L.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," ","ru\u010dn\u011b"]}),(0,p.jsx)(No.ck,{children:"Zkontrolujte Club ID a Club Type v Nastaven\xed"}),(0,p.jsx)(No.ck,{children:"Ov\u011b\u0159te \u010das posledn\xedho b\u011bhu v Prefetch statusu"}),(0,p.jsx)(No.ck,{children:"Zkontrolujte internetov\xe9 p\u0159ipojen\xed serveru"})]})})]}),(0,p.jsxs)(wr.A,{borderColor:l,children:[(0,p.jsx)("h3",{children:(0,p.jsxs)(_r.J,{children:[(0,p.jsxs)(ee.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,p.jsx)(jn.I,{as:pe.pXu,boxSize:4}),(0,p.jsx)(U.E,{children:"Nelze se p\u0159ihl\xe1sit"})]}),(0,p.jsx)(Sr.Q,{})]})}),(0,p.jsx)(Cr.v,{pb:4,children:(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,p.jsx)(No.ck,{children:"Ov\u011b\u0159te e-mail a heslo (hesla jsou case-sensitive)"}),(0,p.jsx)(No.ck,{children:'Pou\u017eijte \u201eZapomenut\xe9 heslo" pro reset'}),(0,p.jsxs)(No.ck,{children:["Zkontrolujte, \u017ee \xfa\u010det m\xe1 roli ",(0,p.jsx)(ja.C,{children:"admin"})]}),(0,p.jsx)(No.ck,{children:"Vy\u010dkejte 5 minut po n\u011bkolika ne\xfasp\u011b\u0161n\xfdch pokusech (ochrana proti brute-force)"})]})})]})]}),(0,p.jsxs)(y.a,{p:5,bg:(0,b.dU)("green.50","green.900"),borderRadius:"lg",borderWidth:"2px",borderColor:(0,b.dU)("green.300","green.600"),children:[(0,p.jsxs)(ee.z,{spacing:2,mb:3,children:[(0,p.jsx)(jn.I,{as:pe.Qro,color:"green.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",color:(0,b.dU)("green.800","green.200"),fontSize:"lg",children:"Pot\u0159ebujete pomoc?"})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("green.700","green.200"),mb:3,children:"Pokud probl\xe9m p\u0159etrv\xe1v\xe1 nebo si nev\xedte rady, zkuste nejprve tyto kroky:"}),(0,p.jsxs)(No.B8,{spacing:2,styleType:"disc",pl:5,fontSize:"sm",color:(0,b.dU)("green.700","green.200"),mb:4,children:[(0,p.jsx)(No.ck,{children:"Vyma\u017ete cache (mezipam\u011b\u0165) prohl\xed\u017ee\u010de a obnovte str\xe1nku (Ctrl+F5)"}),(0,p.jsx)(No.ck,{children:"Zkuste jin\xfd prohl\xed\u017ee\u010d (Chrome, Firefox, Edge)"}),(0,p.jsx)(No.ck,{children:"Odhlaste se a p\u0159ihlaste znovu"}),(0,p.jsx)(No.ck,{children:"Zkontrolujte internetov\xe9 p\u0159ipojen\xed"})]}),(0,p.jsx)(G.c,{borderColor:(0,b.dU)("green.300","green.600"),mb:3}),(0,p.jsxs)(ee.z,{spacing:2,mb:2,children:[(0,p.jsx)(jn.I,{as:pe.maD,color:(0,b.dU)("green.600","green.300"),boxSize:4}),(0,p.jsx)(U.E,{fontSize:"md",fontWeight:"bold",color:(0,b.dU)("green.800","green.100"),children:"St\xe1le nefunguje? Ozv\u011bte se n\xe1m!"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:(0,b.dU)("green.700","green.200"),mb:2,children:["Napi\u0161te n\xe1m na"," ",(0,p.jsx)(L.N,{href:"mailto:help@tdvorak.dev",color:"green.600",fontWeight:"bold",fontSize:"md",children:"help@tdvorak.dev"})," ","a popi\u0161te probl\xe9m. Odpov\xedd\xe1me do 24 hodin a r\xe1di v\xe1m pom\u016f\u017eeme!"]}),(0,p.jsx)(U.E,{fontSize:"xs",color:(0,b.dU)("green.600","green.300"),fontStyle:"italic",children:"Tip: Do e-mailu p\u0159ilo\u017ete screenshot probl\xe9mu, urychl\xedte t\xedm \u0159e\u0161en\xed."})]})]}),(0,p.jsx)(L.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,p.jsxs)(ee.z,{as:"span",spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.uCC,boxSize:3}),(0,p.jsx)(U.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsxs)(y.a,{p:6,bg:(0,b.dU)("purple.50","purple.900"),borderRadius:"xl",borderWidth:"2px",borderColor:(0,b.dU)("purple.200","purple.700"),textAlign:"center",mb:6,children:[(0,p.jsx)(jn.I,{as:pe.maD,boxSize:12,color:"purple.500",mb:3}),(0,p.jsx)(z.D,{size:"lg",mb:3,color:(0,b.dU)("purple.800","purple.200"),children:"Pot\u0159ebujete pomoc?"}),(0,p.jsx)(U.E,{fontSize:"md",mb:4,color:(0,b.dU)("purple.700","purple.300"),children:"M\xe1te dotazy, narazili jste na probl\xe9m nebo hled\xe1te vlastn\xed \xfapravy a roz\u0161\xed\u0159en\xed syst\xe9mu?"}),(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:2,justify:"center",mb:2,children:[(0,p.jsx)(jn.I,{as:pe.maD,color:"purple.600",boxSize:5}),(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",color:(0,b.dU)("purple.900","purple.100"),children:"Technick\xe1 podpora"})]}),(0,p.jsx)(L.N,{href:"mailto:help@tdvorak.dev",fontSize:"xl",color:"purple.600",fontWeight:"bold",_hover:{color:"purple.700",textDecoration:"underline"},children:"help@tdvorak.dev"}),(0,p.jsx)(U.E,{fontSize:"sm",color:(0,b.dU)("purple.600","purple.400"),mt:1,children:"Odpov\xedd\xe1me do 24 hodin"})]}),(0,p.jsx)(G.c,{borderColor:(0,b.dU)("purple.300","purple.600")}),(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{spacing:2,justify:"center",mb:2,children:[(0,p.jsx)(jn.I,{as:pe.ZPX,color:"purple.600",boxSize:4}),(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"md",color:(0,b.dU)("purple.900","purple.100"),children:"Vlastn\xed \xfapravy a implementace"})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:(0,b.dU)("purple.700","purple.300"),children:["Chcete p\u0159idat nov\xe9 funkce nebo p\u0159izp\u016fsobit syst\xe9m va\u0161im specifick\xfdm pot\u0159eb\xe1m?",(0,p.jsx)("br",{}),"Kontaktujte n\xe1s a spole\u010dn\u011b zjist\xedme, zda je va\u0161e p\u0159edstava realizovateln\xe1.",(0,p.jsx)("br",{}),(0,p.jsx)("strong",{children:"R\xe1di v\xe1m pom\u016f\u017eeme roz\u0161\xed\u0159it syst\xe9m dle va\u0161ich po\u017eadavk\u016f!"})]})]})]})]}),(0,p.jsxs)(y.a,{textAlign:"center",py:6,color:"gray.500",children:[(0,p.jsxs)(ee.z,{spacing:2,justify:"center",children:[(0,p.jsx)(jn.I,{as:pe.hko,color:"gray.500",boxSize:4}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:"Dokumentace administra\u010dn\xedho syst\xe9mu \u2022 Verze 1.0"})]}),(0,p.jsxs)(U.E,{fontSize:"xs",mt:1,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,p.jsx)(U.E,{fontSize:"xs",mt:3,color:"gray.400",children:"Vytvo\u0159eno pro snadnou spr\xe1vu klubov\xfdch web\u016f \u2022 \u017d\xe1dn\xe9 technick\xe9 znalosti nejsou nutn\xe9"})]})]})})]})})})},Ql=["classic","pill","var1","var2","var3","var4"],ec=e=>{if(e){if(e.startsWith("/uploads")||e.startsWith("/dist")||e.startsWith("/api/"))return e;if(/^https?:\/\//i.test(e)){const t=(m.API_URL||"").replace(/\/$/,"");return"".concat(t,"/proxy/image?url=").concat(encodeURIComponent(e))}return e}},tc=()=>{const e=(0,b.dU)("white","gray.800"),[t,n]=((0,b.dU)("gray.200","gray.700"),(0,b.dU)("white","gray.700"),(0,a.useState)(null)),[i,o]=(0,a.useState)(!0),r=(0,j.d)(),[s,l]=(0,a.useState)(0),[c,d]=(0,a.useState)(""),[h,u]=(0,a.useState)("home"),{searchClubs:x,searchResults:g,searchLoading:v,searchError:f}=Kl();(0,a.useEffect)(()=>{(async()=>{const e=await ur();n(e),o(!1)})()},[]),(0,a.useEffect)(()=>{if(null===t||void 0===t||!t.running)return;let e=!0;const a=setInterval(async()=>{try{const t=await ur();e&&n(t)}catch(t){}},1e3);return()=>{e=!1,clearInterval(a)}},[null===t||void 0===t?void 0:t.running]);const{data:A=[]}=(0,xe.I)({queryKey:["admin-matches"],queryFn:Ko,staleTime:6e4}),{data:E}=(0,xe.I)({queryKey:["facr-club-info-cache"],queryFn:nr,staleTime:12e4,refetchInterval:12e4}),N=(0,a.useMemo)(()=>{const e=[];try{const t=(null===E||void 0===E?void 0:E.competitions)||[];for(const n of t){const t=String((null===n||void 0===n?void 0:n.name)||(null===n||void 0===n?void 0:n.code)||"").trim(),a=(null===n||void 0===n?void 0:n.matches)||[];for(const n of a)e.push({match_id:(null===n||void 0===n?void 0:n.match_id)||(null===n||void 0===n?void 0:n.id)||"",id:(null===n||void 0===n?void 0:n.match_id)||(null===n||void 0===n?void 0:n.id)||"",home:(null===n||void 0===n?void 0:n.home)||"",away:(null===n||void 0===n?void 0:n.away)||"",date_time:(null===n||void 0===n?void 0:n.date_time)||(null===n||void 0===n?void 0:n.kickoff)||"",home_logo_url:(null===n||void 0===n?void 0:n.home_logo_url)||"",away_logo_url:(null===n||void 0===n?void 0:n.away_logo_url)||"",competition:t,league:t})}}catch(t){}return e},[E]),R=a.useMemo(()=>{const e=new Set;for(const t of A){const n=String(t.competition||t.league||"").trim();n&&e.add(n)}for(const t of N){const n=String(t.competition||t.league||"").trim();n&&e.add(n)}return["V\u0161e",...Array.from(e)]},[A,N]),[P,I]=(0,a.useState)("V\u0161e"),[W,M]=(0,a.useState)(""),D=a.useMemo(()=>{const e=e=>{const t=String(e.date_time||e.date||"").slice(0,16);let n=Date.parse(t);return isNaN(n)&&t.includes(" ")&&(n=Date.parse(t.replace(" ","T")+":00")),n},t=Date.now();let n=[...A||[],...N];if(P&&"V\u0161e"!==P&&(n=n.filter(e=>String(e.competition||e.league||"").trim()===P)),W.trim()){const e=W.trim().toLowerCase();n=n.filter(t=>String(t.home||"").toLowerCase().includes(e)||String(t.away||"").toLowerCase().includes(e)||String(t.competition||t.league||"").toLowerCase().includes(e))}const a=n.map(t=>({m:t,ts:e(t)})),i=a.filter(e=>"number"===typeof e.ts&&!isNaN(e.ts)&&e.ts>=t).sort((e,t)=>e.ts-t.ts).map(e=>e.m),o=a.filter(e=>"number"===typeof e.ts&&!isNaN(e.ts)&&e.ts<t).sort((e,t)=>t.ts-e.ts).map(e=>e.m);return{upcoming:i,recent:o}},[A,N,P,W]);(0,a.useEffect)(()=>{const e=c.trim();if(!e)return;const t=setTimeout(()=>{x(e).catch(()=>{})},400);return()=>clearTimeout(t)},[c,x]);const L=async e=>{const t=await mr(e);n(t)},F=async e=>{if(!t)return;const a=String(e.home||e.home_team||"").trim(),i=String(e.away||e.away_team||"").trim(),o=ec(e.home_logo_url||"")||"",s=ec(e.away_logo_url||"")||"",l={homeName:a,awayName:i,homeShort:vr(a),awayShort:vr(i),homeLogo:o||t.homeLogo,awayLogo:s||t.awayLogo,externalMatchId:String(e.match_id||e.id||"")},[c,d]=await Promise.all([jr(o||t.homeLogo),jr(s||t.awayLogo)]);c&&(l.primaryColor=c),d&&(l.secondaryColor=d);const h=await mr(l);n(h),r({title:"Z\xe1pas vybr\xe1n",description:"Z\xe1kladn\xed \xfadaje byly p\u0159edvypln\u011bny.",status:"success"})};return i||!t?(0,p.jsx)(Mo,{children:(0,p.jsx)(y.a,{children:"Na\u010d\xedt\xe1n\xed\u2026"})}):(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"lg",mb:2,children:"Tabule (Scoreboard)"}),(0,p.jsx)(U.E,{color:"gray.500",mb:2,children:"Napojte tabuli na konkr\xe9tn\xed z\xe1pas a ovl\xe1dejte sk\xf3re v re\xe1ln\xe9m \u010dase. Pokud je tabule aktivn\xed a propojen\xe1 se z\xe1pasem, propisujeme \u017eiv\xe9 sk\xf3re i do ve\u0159ejn\xe9 homepage."}),(0,p.jsxs)(ee.z,{spacing:3,mb:4,children:[(0,p.jsx)(Qt.E,{colorScheme:"green",children:"OBS"}),(()=>{const e=("undefined"!==typeof window?window.location.origin.replace(/\/$/,""):"")+"/overlay/scoreboard";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(T.$,{as:"a",href:e,target:"_blank",rel:"noreferrer",children:"Otev\u0159\xedt overlay"}),(0,p.jsxs)(ee.z,{spacing:2,children:[(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:["Ve\u0159ejn\xe1 URL pro OBS: ",e]}),(0,p.jsx)(T.$,{size:"sm",leftIcon:(0,p.jsx)($s.T,{}),onClick:()=>{try{navigator.clipboard.writeText(e)}catch(t){}},children:"Kop\xedrovat"})]})]})})()]}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Napojen\xed na z\xe1pas (FA\u010cR)"}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:3},spacing:3,mb:3,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Sout\u011b\u017e"}),(0,p.jsx)(ha.l,{value:P,onChange:e=>I(e.target.value),children:R.map(e=>(0,p.jsx)("option",{value:e,children:e},e))})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Hledat z\xe1pas"}),(0,p.jsx)(C.p,{placeholder:"Hledat podle n\xe1zvu t\xfdmu nebo sout\u011b\u017ee",value:W,onChange:e=>M(e.target.value)})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:0,children:"Tabule aktivn\xed"}),(0,p.jsx)(pa.d,{isChecked:!(null===t||void 0===t||!t.active),onChange:async e=>{const t=await mr({active:e.target.checked});n(t)}}),null!==t&&void 0!==t&&t.externalMatchId?(0,p.jsxs)(Qt.E,{ml:3,colorScheme:"blue",children:["Z\xe1pas: ",t.externalMatchId]}):(0,p.jsx)(Qt.E,{ml:3,children:"Bez z\xe1pasu"})]})]}),(0,p.jsxs)(ra.t,{index:s,onChange:l,variant:"enclosed",size:"sm",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsx)(la.o,{children:"Nadch\xe1zej\xedc\xed"}),(0,p.jsx)(la.o,{children:"Ned\xe1vn\xe9"})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{px:0,children:(0,p.jsx)(w.T,{align:"stretch",spacing:2,maxH:"320px",overflowY:"auto",children:D.upcoming.map(e=>(0,p.jsxs)(ee.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},children:[e.home_logo_url?(0,p.jsx)(k._,{src:ec(e.home_logo_url),alt:String(e.home),boxSize:"28px",objectFit:"contain"}):null,(0,p.jsxs)(U.E,{fontWeight:"semibold",children:[String(e.home)," vs ",String(e.away)]}),(0,p.jsx)(Qt.E,{ml:"auto",children:String(e.date_time||e.date||"").slice(0,16).replace("T"," ")}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>F(e),children:"Vybrat z\xe1pas"})]},"".concat(e.match_id||e.id)))})}),(0,p.jsx)(da.K,{px:0,children:(0,p.jsx)(w.T,{align:"stretch",spacing:2,maxH:"320px",overflowY:"auto",children:D.recent.map(e=>(0,p.jsxs)(ee.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},children:[e.home_logo_url?(0,p.jsx)(k._,{src:ec(e.home_logo_url),alt:String(e.home),boxSize:"28px",objectFit:"contain"}):null,(0,p.jsxs)(U.E,{fontWeight:"semibold",children:[String(e.home)," vs ",String(e.away)]}),(0,p.jsx)(Qt.E,{ml:"auto",colorScheme:"purple",children:String(e.date_time||e.date||"").slice(0,16).replace("T"," ")}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>F(e),children:"Vybrat z\xe1pas"})]},"".concat(e.match_id||e.id)))})})]})]}),(0,p.jsxs)(ee.z,{mt:3,children:[(0,p.jsx)(T.$,{colorScheme:"blue",onClick:async()=>{if(null===t||void 0===t||!t.externalMatchId)return void r({title:"Zvolte z\xe1pas",description:"Nejprve vyberte z\xe1pas ze seznamu v\xfd\u0161e.",status:"warning"});const e=await mr({active:!0});n(e),r({title:"Tabule aktivov\xe1na",description:"\u017div\xe1 data se budou propsat i na homepage.",status:"success"})},children:"Aktivovat pro vybran\xfd z\xe1pas"}),(0,p.jsx)(T.$,{variant:"ghost",onClick:async()=>{const e=await mr({externalMatchId:"",active:!1});n(e),r({title:"Odpojeno",description:"Tabule odpojena od z\xe1pasu.",status:"info"})},children:"Odpojit od z\xe1pasu"})]})]}),(0,p.jsx)(y.a,{display:"flex",justifyContent:"center",mb:6,children:(0,p.jsx)(cr,{state:t})}),(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:6,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Z\xe1kladn\xed \xfadaje"}),(0,p.jsxs)(Tt.r,{columns:2,spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Dom\xe1c\xed t\xfdm"}),(0,p.jsx)(C.p,{value:t.homeName,onChange:async e=>{var n;const a=e.target.value;await L({homeName:a,homeShort:null!==(n=t.homeShort)&&void 0!==n&&n.trim()?t.homeShort:vr(a)})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zkratka dom\xe1c\xedch"}),(0,p.jsx)(C.p,{value:t.homeShort||"",maxLength:3,onChange:async e=>{await L({homeShort:e.target.value.toUpperCase().slice(0,3)})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Hostuj\xedc\xed t\xfdm"}),(0,p.jsx)(C.p,{value:t.awayName,onChange:async e=>{var n;const a=e.target.value;await L({awayName:a,awayShort:null!==(n=t.awayShort)&&void 0!==n&&n.trim()?t.awayShort:vr(a)})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Zkratka host\u016f"}),(0,p.jsx)(C.p,{value:t.awayShort||"",maxLength:3,onChange:async e=>{await L({awayShort:e.target.value.toUpperCase().slice(0,3)})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Logo dom\xe1c\xedch (URL)"}),(0,p.jsx)(C.p,{value:t.homeLogo||"",onChange:async e=>{await L({homeLogo:e.target.value})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Logo host\u016f (URL)"}),(0,p.jsx)(C.p,{value:t.awayLogo||"",onChange:async e=>{await L({awayLogo:e.target.value})}})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Sk\xf3re dom\xe1c\xedch"}),(0,p.jsx)(ua.Q7,{value:t.homeScore,min:0,onChange:async(e,t)=>L({homeScore:Number.isFinite(t)?t:0}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Sk\xf3re host\u016f"}),(0,p.jsx)(ua.Q7,{value:t.awayScore,min:0,onChange:async(e,t)=>L({awayScore:Number.isFinite(t)?t:0}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Fauly dom\xe1c\xedch"}),(0,p.jsx)(ua.Q7,{value:t.homeFouls||0,min:0,max:5,onChange:async(e,t)=>L({homeFouls:Math.max(0,Math.min(5,Number.isFinite(t)?t:0))}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Fauly host\u016f"}),(0,p.jsx)(ua.Q7,{value:t.awayFouls||0,min:0,max:5,onChange:async(e,t)=>L({awayFouls:Math.max(0,Math.min(5,Number.isFinite(t)?t:0))}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"D\xe9lka polo\u010dasu (min)"}),(0,p.jsx)(ua.Q7,{value:t.halfLength,min:1,max:60,onChange:async(e,t)=>L({halfLength:Number.isFinite(t)?t:45}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Styl"}),(0,p.jsx)(ha.l,{value:t.theme,onChange:async e=>L({theme:e.target.value}),children:Ql.map(e=>(0,p.jsx)("option",{value:e,children:e},e))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",children:[(0,p.jsx)(S.l,{mb:0,children:"P\u0159ehodit strany (vizu\xe1ln\u011b)"}),(0,p.jsx)(pa.d,{isChecked:!!t.sidesFlipped,onChange:async e=>L({sidesFlipped:e.target.checked})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Polo\u010das"}),(0,p.jsxs)(ha.l,{value:String(t.half||1),onChange:async e=>L({half:parseInt(e.target.value,10)||1}),children:[(0,p.jsx)("option",{value:"1",children:"1"}),(0,p.jsx)("option",{value:"2",children:"2"})]})]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Barvy a vyhled\xe1n\xed klubu"}),(0,p.jsxs)(Tt.r,{columns:2,spacing:4,children:[(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Barva dom\xe1c\xedch"}),(0,p.jsx)(C.p,{type:"color",value:t.primaryColor||"#1e3a8a",onChange:async e=>L({primaryColor:e.target.value})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Barva host\u016f"}),(0,p.jsx)(C.p,{type:"color",value:t.secondaryColor||"#2563eb",onChange:async e=>L({secondaryColor:e.target.value})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"QR interval (minuty)"}),(0,p.jsx)(ua.Q7,{value:t.qrEvery||5,min:1,max:120,onChange:async(e,t)=>L({qrEvery:Math.max(1,Number.isFinite(t)?t:5)}),children:(0,p.jsx)(ua.OO,{})})]}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"QR d\xe9lka zobrazen\xed (sekundy)"}),(0,p.jsx)(ua.Q7,{value:t.qrDuration||60,min:5,max:600,onChange:async(e,t)=>L({qrDuration:Math.max(5,Number.isFinite(t)?t:60)}),children:(0,p.jsx)(ua.OO,{})})]})]}),(0,p.jsx)(G.c,{my:4}),(0,p.jsxs)(ee.z,{spacing:3,align:"flex-start",children:[(0,p.jsxs)(ha.l,{value:h,onChange:e=>u(e.target.value||"home"),maxW:"160px",children:[(0,p.jsx)("option",{value:"home",children:"Nastavit dom\xe1c\xed"}),(0,p.jsx)("option",{value:"away",children:"Nastavit hosty"})]}),(0,p.jsx)(C.p,{placeholder:"Hledat klub (FA\u010cR)",value:c,onChange:e=>d(e.target.value)}),(0,p.jsx)(T.$,{isLoading:v,onClick:()=>c.trim()&&x(c.trim()),children:"Hledat"})]}),f?(0,p.jsxs)(U.E,{color:"red.500",mt:2,children:["Chyba vyhled\xe1v\xe1n\xed: ",f.message]}):null,(0,p.jsx)(w.T,{align:"stretch",spacing:2,mt:3,maxH:"260px",overflowY:"auto",children:null===g||void 0===g?void 0:g.slice(0,8).map(e=>(0,p.jsxs)(ee.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},cursor:"pointer",onClick:()=>(async e=>{const n=ec(e.logo_url)||void 0,a=await jr(n||void 0);"home"===h?await L({homeName:e.name||"DOM\xc1C\xcd",homeShort:vr(e.name||""),homeLogo:n,primaryColor:a||(null===t||void 0===t?void 0:t.primaryColor)}):await L({awayName:e.name||"HOST\xc9",awayShort:vr(e.name||""),awayLogo:n,secondaryColor:a||(null===t||void 0===t?void 0:t.secondaryColor)}),r({title:"Nastaveno pro ".concat("home"===h?"dom\xe1c\xed":"hosty"),status:"success"})})(e),children:[e.logo_url?(0,p.jsx)(k._,{src:ec(e.logo_url),alt:e.name,boxSize:"28px",objectFit:"contain"}):null,(0,p.jsxs)(y.a,{children:[(0,p.jsx)(U.E,{fontWeight:"medium",children:e.name}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:e.club_type})]})]},"".concat(e.club_type,"-").concat(e.club_id)))})]})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsxs)(ee.z,{spacing:3,children:[(0,p.jsx)(T.$,{onClick:()=>L({homeScore:(t.homeScore||0)+1}),children:"+ G\xf3l DOM"}),(0,p.jsx)(T.$,{onClick:()=>L({homeScore:Math.max(0,(t.homeScore||0)-1)}),children:"\u2212 G\xf3l DOM"}),(0,p.jsx)(T.$,{onClick:()=>L({awayScore:(t.awayScore||0)+1}),children:"+ G\xf3l HOS"}),(0,p.jsx)(T.$,{onClick:()=>L({awayScore:Math.max(0,(t.awayScore||0)-1)}),children:"\u2212 G\xf3l HOS"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>L({homeScore:0,awayScore:0}),children:"Reset sk\xf3re"})]}),(0,p.jsx)(G.c,{my:6}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"\u010casova\u010d"}),(0,p.jsxs)(ee.z,{spacing:4,align:"center",flexWrap:"wrap",children:[(0,p.jsx)(U.E,{fontSize:"4xl",fontFamily:"mono",minW:"120px",children:t.timer||"00:00"}),t.running?(0,p.jsx)(Qt.E,{colorScheme:"green",children:"B\u011b\u017e\xed"}):(0,p.jsx)(Qt.E,{children:"Stoj\xed"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{colorScheme:"green",onClick:async()=>{await async function(){await m.Ay.post("/admin/scoreboard/timer/start")}();const e=await ur();n(e)},children:"Start"}),(0,p.jsx)(T.$,{onClick:async()=>{await async function(){await m.Ay.post("/admin/scoreboard/timer/pause")}();const e=await ur();n(e)},children:"Pauza"}),(0,p.jsx)(T.$,{variant:"outline",onClick:async()=>{await async function(){await m.Ay.post("/admin/scoreboard/timer/reset")}();const e=await ur();n(e)},children:"Reset"}),(0,p.jsx)(T.$,{onClick:async()=>{await async function(){await m.Ay.post("/admin/scoreboard/swap-sides")}();const e=await ur();n(e)},children:"P\u0159ehodit strany"}),(0,p.jsx)(T.$,{colorScheme:"purple",onClick:async()=>{await async function(){await m.Ay.post("/admin/scoreboard/second-half")}();const e=await ur();n(e)},children:"Za\u010d\xedt 2. polo\u010das"})]})]}),(0,p.jsx)(ee.z,{mt:3,spacing:3,align:"center",children:(0,p.jsxs)(_.MJ,{maxW:"160px",isDisabled:!!t.running,children:[(0,p.jsx)(S.l,{children:"Nastavit \u010das (MM:SS)"}),(0,p.jsx)(C.p,{value:t.timer||"00:00",onChange:async e=>{const a=e.target.value.trim();if(!t.running){const e=await mr({timer:a});n(e)}}})]})})]}),(0,p.jsx)(z.D,{size:"md",mb:3,children:"Import / Export"}),(0,p.jsxs)(ee.z,{spacing:4,align:"center",flexWrap:"wrap",children:[(0,p.jsx)(T.$,{onClick:()=>{try{const e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),n=URL.createObjectURL(e),a=document.createElement("a");a.href=n,a.download="scoreboard-state.json",a.click(),URL.revokeObjectURL(n)}catch(e){r({title:"Export selhal",status:"error"})}},children:"Exportovat JSON"}),(0,p.jsxs)(T.$,{as:"label",children:["Importovat JSON",(0,p.jsx)(C.p,{type:"file",accept:"application/json",display:"none",onChange:async e=>{try{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;const i=await a.text(),o=JSON.parse(i);await xr(o),n(await ur()),r({title:"Import dokon\u010den",status:"success"})}catch(a){r({title:"Import selhal",description:(null===a||void 0===a?void 0:a.message)||"Neplatn\xfd soubor",status:"error"})}finally{try{e.target&&(e.target.value="")}catch(i){}}}})]})]}),(0,p.jsx)(G.c,{my:8}),(0,p.jsx)(z.D,{size:"md",mb:2,children:"N\xe1vod k pou\u017eit\xed (CZ)"}),(0,p.jsxs)(w.T,{align:"start",spacing:2,color:"gray.700",children:[(0,p.jsx)(U.E,{children:"1) V horn\xed \u010d\xe1sti vyberte sout\u011b\u017e, p\u0159\xedpadn\u011b vyhledejte z\xe1pas podle n\xe1zvu t\xfdmu. Klikn\u011bte na \u201eVybrat z\xe1pas\u201c."}),(0,p.jsx)(U.E,{children:"2) Pole \u201eDom\xe1c\xed/Host\xe9\u201c, loga a zkratky se p\u0159edvypln\xed. Barvy se pokus\xedme odhadnout z log."}),(0,p.jsx)(U.E,{children:"3) Zapn\u011bte p\u0159ep\xedna\u010d \u201eTabule aktivn\xed\u201c nebo pou\u017eijte tla\u010d\xedtko \u201eAktivovat pro vybran\xfd z\xe1pas\u201c."}),(0,p.jsx)(U.E,{children:"4) Sk\xf3re upravujte tla\u010d\xedtky n\xed\u017ee nebo ru\u010dn\xedm zad\xe1n\xedm. Zm\u011bny se ukl\xe1daj\xed pr\u016fb\u011b\u017en\u011b."}),(0,p.jsx)(U.E,{children:"5) Pokud je tabule aktivn\xed a propojen\xe1 se z\xe1pasem, \u017eiv\xe9 sk\xf3re se propisuje do ve\u0159ejn\xe9 homepage (nejbli\u017e\u0161\xed z\xe1pas) a do JSON cache."}),(0,p.jsx)(U.E,{children:"6) P\u0159epn\u011bte vzhled tabule (styl) dle pot\u0159eby. Pro p\u0159enos do streamu pou\u017eijte ve\u0159ejnou adresu /overlay/scoreboard."}),(0,p.jsx)(U.E,{children:"Tip: P\u0159i importu JSON pou\u017eijte p\u0159edchoz\xed export, form\xe1t je kompatibiln\xed."})]})]})})},nc=()=>{const e=(0,j.d)(),t=(0,l.jE)(),n=(0,b.dU)("white","gray.800"),i=(0,b.dU)("gray.200","gray.700"),{data:o,isLoading:r}=(0,xe.I)({queryKey:["admin-scoreboard-mobile"],queryFn:pr,refetchInterval:5e3,staleTime:3e3}),s=async n=>{try{await xr(n),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]})}catch(a){e({title:"Ulo\u017een\xed selhalo",status:"error"})}},[c,d]=(0,a.useState)(!1),[h,u]=(0,a.useState)(0),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e;const t=()=>{if(c){var n;const e=Date.now(),t=null!==(n=m.current)&&void 0!==n?n:e;m.current=t,u(Math.floor((e-t)/1e3))}e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[c]);const x=(0,a.useMemo)(()=>{const e=Math.floor(h/60),t=h%60;return"".concat(String(e).padStart(2,"0"),":").concat(String(t).padStart(2,"0"))},[h]);return r||!o?(0,p.jsx)(Mo,{children:(0,p.jsx)(f.o,{minH:"50vh",children:"Na\u010d\xedt\xe1n\xed\u2026"})}):(0,p.jsx)(Mo,{children:(0,p.jsxs)(y.a,{p:3,children:[(0,p.jsx)(z.D,{size:"md",mb:3,children:"Mobiln\xed ovl\xe1d\xe1n\xed tabule"}),(0,p.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,p.jsx)(y.a,{borderWidth:"1px",borderColor:i,bg:n,borderRadius:"lg",p:3,children:(0,p.jsxs)(Tt.r,{columns:3,spacing:2,alignItems:"center",children:[(0,p.jsxs)(w.T,{spacing:2,children:[o.homeLogo?(0,p.jsx)(k._,{src:o.homeLogo,alt:"DOM",boxSize:"64px",objectFit:"contain"}):null,(0,p.jsx)(U.E,{fontWeight:"bold",textAlign:"center",children:o.homeShort||"DOM"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"lg",onClick:()=>s({homeScore:Math.max(0,(o.homeScore||0)-1)}),children:"\u2212"}),(0,p.jsx)(T.$,{size:"lg",colorScheme:"green",onClick:()=>s({homeScore:(o.homeScore||0)+1}),children:"+"})]})]}),(0,p.jsxs)(w.T,{spacing:2,children:[(0,p.jsxs)(U.E,{fontSize:"5xl",fontWeight:"black",children:[o.homeScore," : ",o.awayScore]}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{onClick:()=>d(e=>!e),children:c?"Stop":"Start"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>{d(!1),u(0),m.current=null},children:"Reset"})]}),(0,p.jsx)(U.E,{fontSize:"2xl",fontFamily:"mono",children:x})]}),(0,p.jsxs)(w.T,{spacing:2,children:[o.awayLogo?(0,p.jsx)(k._,{src:o.awayLogo,alt:"HOS",boxSize:"64px",objectFit:"contain"}):null,(0,p.jsx)(U.E,{fontWeight:"bold",textAlign:"center",children:o.awayShort||"HOS"}),(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(T.$,{size:"lg",onClick:()=>s({awayScore:Math.max(0,(o.awayScore||0)-1)}),children:"\u2212"}),(0,p.jsx)(T.$,{size:"lg",colorScheme:"green",onClick:()=>s({awayScore:(o.awayScore||0)+1}),children:"+"})]})]})]})}),(0,p.jsxs)(y.a,{borderWidth:"1px",borderColor:i,bg:n,borderRadius:"lg",p:3,children:[(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{children:"Vybran\xfd z\xe1pas"}),(0,p.jsx)(U.E,{fontWeight:"bold",children:o.externalMatchId?o.externalMatchId:"\u2014"})]}),(0,p.jsxs)(ee.z,{mt:2,spacing:2,children:[(0,p.jsx)(T.$,{onClick:()=>s({active:!0}),colorScheme:"blue",children:"Aktivovat"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>s({active:!1}),children:"Deaktivovat"}),(0,p.jsx)(T.$,{variant:"ghost",onClick:()=>s({homeScore:0,awayScore:0}),children:"Reset sk\xf3re"})]})]})]})]})})},ac={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic"}.REACT_APP_API_BASE_URL||"";function ic(){const{email:e}=(0,c.g)(),[t,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(null),l=(0,j.d)(),d=(0,c.Zp)();(0,a.useEffect)(()=>{(async()=>{if(!e)return s("Neplatn\xfd odhla\u0161ovac\xed odkaz"),void n(!1);try{const t=decodeURIComponent(e);await(async e=>(await ve.A.post("".concat(ac,"/api/v1/newsletter/unsubscribe/").concat(encodeURIComponent(e)))).data)(t),o(!0),It("Newsletter Unsubscribe",{success:!0,source:"email_link"})}catch(t){const e=t instanceof Error?t.message:"P\u0159i odhla\u0161ov\xe1n\xed z newsletteru do\u0161lo k chyb\u011b";s(e),l({title:"Chyba",description:e,status:"error",duration:5e3,isClosable:!0})}finally{n(!1)}})()},[e,l]);const h=()=>{d("/")};return t?(0,p.jsx)(Z.m,{maxW:"container.md",py:10,children:(0,p.jsxs)(w.T,{spacing:6,textAlign:"center",children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Zpracov\xe1v\xe1m va\u0161i \u017e\xe1dost o odhl\xe1\u0161en\xed..."})]})}):r?(0,p.jsx)(Z.m,{maxW:"container.md",py:10,children:(0,p.jsxs)(w.T,{spacing:6,textAlign:"center",children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",color:"red.500",children:"Chyba p\u0159i odhla\u0161ov\xe1n\xed"}),(0,p.jsx)(U.E,{fontSize:"lg",children:r}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:h,children:"Zp\u011bt na \xfavodn\xed str\xe1nku"})]})}):i?(0,p.jsx)(Z.m,{maxW:"container.md",py:10,children:(0,p.jsxs)(w.T,{spacing:6,textAlign:"center",children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",color:"green.500",mb:4,children:"Byl jste \xfasp\u011b\u0161n\u011b odhl\xe1\u0161en"}),(0,p.jsx)(U.E,{fontSize:"lg",children:"Je n\xe1m l\xedto, \u017ee odch\xe1z\xedte. Va\u0161e e-mailov\xe1 adresa byla odebr\xe1na z na\u0161eho seznamu odb\u011bratel\u016f."})]}),(0,p.jsx)(U.E,{color:"gray.600",children:"Pokud jste se odhl\xe1sili omylem, m\u016f\u017eete se znovu p\u0159ihl\xe1sit k odb\u011bru na na\u0161ich webov\xfdch str\xe1nk\xe1ch."}),(0,p.jsx)(T.$,{colorScheme:"blue",onClick:h,"data-umami-event":"Back to Home","data-umami-event-from":"unsubscribe",children:"Zp\u011bt na \xfavodn\xed str\xe1nku"})]})}):null}const oc=()=>{const[e]=(0,d.ok)(),t=e.get("token")||"",n=(0,j.d)(),i=(0,c.Zp)(),o=(0,l.jE)(),{data:r,isLoading:s,isError:u}=(0,xe.I)({queryKey:["newsletter","prefs",t],queryFn:()=>async function(e){const{data:t}=await m.FH.get("/newsletter/preferences",{params:{token:e}});return t}(t),enabled:!!t}),{data:x}=ge(),g=null===x||void 0===x?void 0:x.club_id,v=(null===x||void 0===x?void 0:x.club_type)||"football",{data:b}=(0,xe.I)({queryKey:["facr","competitions",g,v],queryFn:async()=>{if(!g)return[];return await Se.getClubCompetitions(g,v)||[]},enabled:!!g}),f=(0,a.useMemo)(()=>(0,h.A)({blogs:!0,matches:!0,events:!0,scores:!0,weekly:!0},(null===r||void 0===r?void 0:r.preferences)||{}),[r]),[k,A]=(0,a.useState)(f);a.useEffect(()=>{A(f)},[f]);const E=(0,Mn.n)({mutationFn:()=>zt(t,k),onSuccess:()=>{n({title:"Preference ulo\u017eeny",status:"success"}),o.invalidateQueries({queryKey:["newsletter","prefs",t]}),It("Newsletter Preferences Saved",{blogs:k.blogs,matches:k.matches,events:k.events,scores:k.scores})},onError:e=>{var t,a;return n({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:String((null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||(null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),N=(0,Mn.n)({mutationFn:()=>async function(e){const{data:t}=await m.FH.post("/newsletter/unsubscribe-token",{token:e});return t}(t),onSuccess:()=>{n({title:"Odb\u011br byl zru\u0161en",status:"success"}),o.invalidateQueries({queryKey:["newsletter","prefs",t]}),It("Newsletter Unsubscribe",{success:!0,source:"preferences_page"}),setTimeout(()=>i("/"),1500)},onError:e=>{var t,a;return n({title:"Chyba p\u0159i odhl\xe1\u0161en\xed",description:String((null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||(null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),R=(0,a.useMemo)(()=>{const e=k.competitions||"";return new Set(e.split(",").map(e=>e.trim()).filter(Boolean))},[k.competitions]);if(!t)return(0,p.jsx)(y.a,{maxW:"640px",mx:"auto",p:6,children:(0,p.jsxs)(xa.F,{status:"error",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),"Chyb\xed parametr token v adrese."]})});if(s)return(0,p.jsx)(Z.m,{maxW:"container.md",py:8,children:(0,p.jsxs)(ee.z,{children:[(0,p.jsx)(zn.y,{}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})]})});if(u||!r)return(0,p.jsx)(y.a,{maxW:"640px",mx:"auto",p:6,children:(0,p.jsxs)(xa.F,{status:"error",borderRadius:"md",children:[(0,p.jsx)(ga._,{}),"Neplatn\xfd nebo expirovan\xfd token."]})});const P=e=>A((0,h.A)((0,h.A)({},k),{},{blogs:e,matches:e,events:e,scores:e,weekly:e}));return(0,p.jsxs)(Z.m,{maxW:"container.md",py:8,children:[(0,p.jsxs)(ee.z,{mb:2,align:"center",children:[(0,p.jsx)(z.D,{size:"lg",children:"Nastaven\xed newsletteru"}),(0,p.jsx)(Cl.h,{}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>P(!0),children:"Zapnout v\u0161e"}),(0,p.jsx)(T.$,{size:"sm",variant:"ghost",onClick:()=>P(!1),children:"Vypnout v\u0161e"})]}),(0,p.jsxs)(ee.z,{mb:6,color:"gray.600",children:[(0,p.jsx)(U.E,{children:"Spravujte, jak\xe9 e-maily chcete dost\xe1vat na adresu"}),(0,p.jsx)(Qt.E,{colorScheme:r.is_active?"green":"red",children:r.email})]}),(0,p.jsx)(sl.Z,{mb:6,children:(0,p.jsx)(cl.b,{children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(Tt.r,{columns:{base:1,md:2},spacing:4,children:[(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsx)(S.l,{m:0,children:"\u010cl\xe1nky (blog)"}),(0,p.jsx)(pa.d,{isChecked:!!k.blogs,onChange:e=>A((0,h.A)((0,h.A)({},k),{},{blogs:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsx)(S.l,{m:0,children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,p.jsx)(pa.d,{isChecked:!!k.matches,onChange:e=>A((0,h.A)((0,h.A)({},k),{},{matches:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsx)(S.l,{m:0,children:"Ud\xe1losti"}),(0,p.jsx)(pa.d,{isChecked:!!k.events,onChange:e=>A((0,h.A)((0,h.A)({},k),{},{events:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsx)(S.l,{m:0,children:"V\xfdsledky (souhrn t\xfddne)"}),(0,p.jsx)(pa.d,{isChecked:!!k.scores,onChange:e=>A((0,h.A)((0,h.A)({},k),{},{scores:e.target.checked}))})]}),(0,p.jsxs)(_.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,p.jsx)(S.l,{m:0,children:"T\xfddenn\xed souhrn (digest)"}),(0,p.jsx)(pa.d,{isChecked:!!k.weekly,onChange:e=>A((0,h.A)((0,h.A)({},k),{},{weekly:e.target.checked}))})]})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(_.MJ,{children:[(0,p.jsx)(S.l,{children:"Preferovan\xe9 sout\u011b\u017ee"}),Array.isArray(b)&&b.length>0?(0,p.jsx)(w.T,{align:"stretch",spacing:1,maxH:"220px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:b.map((e,t)=>{const n=(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.name)||"comp-".concat(t),a=(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||n,i=R.has(String(n));return(0,p.jsxs)(ee.z,{justify:"space-between",children:[(0,p.jsx)(U.E,{children:a}),(0,p.jsx)(pa.d,{isChecked:i,onChange:e=>((e,t)=>{const n=new Set(R);t?n.add(e):n.delete(e);const a=Array.from(n).join(", ");A((0,h.A)((0,h.A)({},k),{},{competitions:a}))})(String(n),e.target.checked)})]},n)})}):(0,p.jsx)(C.p,{placeholder:"nap\u0159. 5LM, POH",value:k.competitions||"",onChange:e=>A((0,h.A)((0,h.A)({},k),{},{competitions:e.target.value}))}),(0,p.jsx)(U.E,{mt:2,fontSize:"sm",color:"gray.500",children:"Pokud nen\xed seznam k dispozici, m\u016f\u017eete zadat k\xf3dy sout\u011b\u017e\xed ru\u010dn\u011b, odd\u011blen\xe9 \u010d\xe1rkou."})]})]})})}),(0,p.jsxs)(ee.z,{spacing:3,pt:2,borderTopWidth:"1px",children:[(0,p.jsx)(T.$,{colorScheme:"blue",onClick:()=>E.mutate(),isLoading:E.isLoading,"data-umami-event":"Save Preferences",children:"Ulo\u017eit"}),(0,p.jsx)(T.$,{variant:"outline",onClick:()=>o.invalidateQueries({queryKey:["newsletter","prefs",t]}),"data-umami-event":"Refresh Preferences",children:"Obnovit"}),(0,p.jsx)(Cl.h,{}),(0,p.jsx)(T.$,{colorScheme:"red",variant:"outline",onClick:()=>N.mutate(),isLoading:N.isLoading,"data-umami-event":"Unsubscribe","data-umami-event-source":"preferences",children:"Zru\u0161it odb\u011br"})]})]})},rc=()=>{const e=(0,b.dU)("gray.700","gray.300"),t=(0,b.dU)("gray.900","gray.100"),n=(0,b.dU)("blue.50","blue.900"),a=(0,b.dU)("blue.900","blue.100");return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"3xl",py:8,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,color:t,children:"Pravidla pou\u017e\xedv\xe1n\xed soubor\u016f cookies"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,p.jsxs)(y.a,{bg:n,p:4,borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,color:a,children:"Shrnut\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",color:a,children:"Cookies pou\u017e\xedv\xe1me pro zaji\u0161t\u011bn\xed nezbytn\xfdch funkc\xed webu, zlep\u0161en\xed u\u017eivatelsk\xe9ho z\xe1\u017eitku a m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti. Nepovinn\xe9 cookies ukl\xe1d\xe1me pouze na z\xe1klad\u011b va\u0161eho souhlasu."})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Co jsou cookies?"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Cookies jsou mal\xe9 textov\xe9 soubory ukl\xe1dan\xe9 do va\u0161eho za\u0159\xedzen\xed p\u0159i n\xe1v\u0161t\u011bv\u011b webu. Umo\u017e\u0148uj\xed rozpoznat prohl\xed\u017ee\u010d, pamatovat si va\u0161e volby a zajistit fungov\xe1n\xed webu."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Jak\xe9 cookies pou\u017e\xedv\xe1me"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9:"})," zaji\u0161\u0165uj\xed bezpe\u010dnost a z\xe1kladn\xed funkce webu. V\u017edy aktivn\xed."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed:"})," pamatuj\xed si va\u0161e volby (nap\u0159. jazyk, zobrazen\xed)."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Analytick\xe9:"})," anonymn\xed m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti a v\xfdkonu str\xe1nek."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Marketingov\xe9:"})," p\u0159izp\u016fsoben\xed obsahu a p\u0159\xedpadn\xe9ho marketingu."]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Pr\xe1vn\xed z\xe1klady a \xfa\u010dely"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9 cookies:"})," opr\xe1vn\u011bn\xfd z\xe1jem na provozu a zabezpe\u010den\xed webu (GDPR \u010dl. 6 odst. 1 p\xedsm. f)."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed, analytick\xe9, marketingov\xe9:"})," pouze na z\xe1klad\u011b va\u0161eho souhlasu (GDPR \u010dl. 6 odst. 1 p\xedsm. a), kter\xfd m\u016f\u017eete kdykoli odvolat."]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. Spr\xe1va souhlasu"}),(0,p.jsx)(U.E,{color:e,mb:3,children:"Nastaven\xed cookies m\u016f\u017eete kdykoli zm\u011bnit pomoc\xed tla\u010d\xedtka n\xed\u017ee nebo v nastaven\xed prohl\xed\u017ee\u010de. Odvol\xe1n\xed souhlasu nem\xe1 vliv na z\xe1konnost p\u0159edchoz\xedho zpracov\xe1n\xed."}),(0,p.jsx)(T.$,{onClick:()=>{window.dispatchEvent(new Event("cookie-consent-open"))},colorScheme:"blue",size:"sm",children:"Otev\u0159\xedt nastaven\xed cookies"})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Doba uchov\xe1v\xe1n\xed"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9 cookies:"})," po dobu nezbytnou pro fungov\xe1n\xed relace \u010di bezpe\u010dnost."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed a analytick\xe9:"})," typicky 6\u201326 m\u011bs\xedc\u016f, nebo do odvol\xe1n\xed souhlasu."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Marketingov\xe9:"})," dle konkr\xe9tn\xed kategorie, nejd\xe9le do odvol\xe1n\xed souhlasu."]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. T\u0159et\xed strany"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Pro analytiku nebo m\u011b\u0159en\xed m\u016f\u017eeme vyu\u017e\xedvat n\xe1stroje t\u0159et\xedch stran. Tyto slu\u017eby zpracov\xe1vaj\xed \xfadaje pouze v rozsahu nezbytn\xe9m pro poskytov\xe1n\xed m\u011b\u0159en\xed a jsou v\xe1z\xe1ny smluvn\xedmi z\xe1vazky ochrany \xfadaj\u016f."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. Dal\u0161\xed informace"}),(0,p.jsxs)(U.E,{color:e,mb:2,children:["Podrobnosti o zpracov\xe1n\xed osobn\xedch \xfadaj\u016f najdete v ",(0,p.jsx)(L.N,{href:"/zasady-ochrany-osobnich-udaju",color:"brand.primary",children:"Z\xe1sad\xe1ch ochrany osobn\xedch \xfadaj\u016f"}),"."]}),(0,p.jsxs)(U.E,{color:e,children:["V p\u0159\xedpad\u011b dotaz\u016f n\xe1s kontaktujte prost\u0159ednictv\xedm str\xe1nky ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]})]})})})},sc=e=>{let{state:t}=e;return(0,p.jsx)(y.a,{children:(0,p.jsx)(cr,{state:t})})},lc=()=>{const e=(0,b.dU)("transparent","transparent"),{data:t,isLoading:n}=(0,xe.I)({queryKey:["public-scoreboard"],queryFn:gr,refetchInterval:1e3,staleTime:3e3});return(0,p.jsx)(y.a,{minH:"100vh",bg:e,display:"flex",alignItems:"center",justifyContent:"center",p:4,children:n||!t?(0,p.jsx)(f.o,{children:(0,p.jsx)(zn.y,{})}):(0,p.jsx)(sc,{state:t})})},cc="cookie_consent",dc={version:1,necessary:!0,preferences:!1,analytics:!1,marketing:!1,timestamp:(new Date).toISOString()},hc=()=>{const[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(dc);(0,a.useEffect)(()=>{try{const e=localStorage.getItem(cc);if(e){const n=JSON.parse(e);r(n),t(!1)}else t(!0)}catch(e){t(!0)}},[]),(0,a.useEffect)(()=>{const e=e=>{i(!0),t(!0)};return window.addEventListener("cookie-consent-open",e),()=>{window.removeEventListener("cookie-consent-open",e)}},[]);const s=e=>{const n=(0,h.A)((0,h.A)({},e),{},{timestamp:(new Date).toISOString()});localStorage.setItem(cc,JSON.stringify(n)),r(n),t(!1),i(!1),window.dispatchEvent(new CustomEvent("cookie-consent-change",{detail:n}))};return e?(0,p.jsx)(y.a,{role:"dialog","aria-live":"polite",position:"fixed",bottom:{base:4,md:6},left:"50%",transform:"translateX(-50%)",bg:"blackAlpha.800",color:"gray.100",zIndex:1e3,px:{base:4,md:6},py:{base:4,md:5},borderRadius:"xl",boxShadow:"xl",borderWidth:"1px",borderColor:"whiteAlpha.300",w:{base:"calc(100% - 2rem)",sm:"calc(100% - 3rem)",md:"auto"},maxW:"3xl",style:{backdropFilter:"blur(6px)"},children:(0,p.jsxs)(Q.s,{align:"start",justify:"space-between",gap:6,wrap:"wrap",children:[(0,p.jsxs)(y.a,{maxW:{base:"100%",md:"75%"},children:[(0,p.jsxs)(U.E,{fontSize:"sm",mb:2,children:[(0,p.jsx)("span",{role:"img","aria-label":"cookie",children:"\ud83c\udf6a"})," ","Tento web pou\u017e\xedv\xe1 soubory cookies pro zaji\u0161t\u011bn\xed spr\xe1vn\xe9ho fungov\xe1n\xed (nezbytn\xe9) a za \xfa\u010delem vylep\u0161en\xed obsahu. O vybran\xfdch kategori\xedch rozhodujete vy. Podrobnosti najdete v\xa0",(0,p.jsx)(L.N,{href:"/pravidla-cookies",color:"blue.300",textDecoration:"underline",children:"Pravidlech cookies"}),"."]}),n&&(0,p.jsxs)(y.a,{mt:3,bg:"gray.800",borderRadius:"lg",p:4,borderWidth:"1px",borderColor:"gray.700",children:[(0,p.jsx)(U.E,{fontWeight:"semibold",mb:2,children:"Nastaven\xed preferenc\xed"}),(0,p.jsxs)(Q.s,{direction:"column",gap:2,children:[(0,p.jsx)(N.S,{isChecked:!0,isDisabled:!0,children:(0,p.jsx)(U.E,{fontSize:"sm",children:"Nezbytn\xe9 cookies (v\u017edy aktivn\xed)"})}),(0,p.jsx)(N.S,{isChecked:!!o.preferences,onChange:e=>r(t=>(0,h.A)((0,h.A)({},t),{},{preferences:e.target.checked})),children:(0,p.jsx)(U.E,{fontSize:"sm",children:"Preferen\u010dn\xed cookies (nap\u0159. zapamatov\xe1n\xed voleb)"})}),(0,p.jsx)(N.S,{isChecked:!!o.analytics,onChange:e=>r(t=>(0,h.A)((0,h.A)({},t),{},{analytics:e.target.checked})),children:(0,p.jsx)(U.E,{fontSize:"sm",children:"Analytick\xe9 cookies (anonymn\xed m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti)"})}),(0,p.jsx)(N.S,{isChecked:!!o.marketing,onChange:e=>r(t=>(0,h.A)((0,h.A)({},t),{},{marketing:e.target.checked})),children:(0,p.jsx)(U.E,{fontSize:"sm",children:"Marketingov\xe9 cookies"})}),(0,p.jsxs)(Q.s,{gap:2,mt:2,wrap:"wrap",children:[(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:()=>s(o),children:"Ulo\u017eit nastaven\xed"}),(0,p.jsx)(T.$,{size:"sm",variant:"outline",onClick:()=>i(!1),children:"Zp\u011bt"})]})]})]})]}),(0,p.jsxs)(Q.s,{gap:2,align:"center",wrap:"wrap",children:[(0,p.jsx)(T.$,{size:"sm",onClick:()=>i(e=>!e),variant:"ghost",children:"Nastavit"}),(0,p.jsx)(T.$,{size:"sm",onClick:()=>{s((0,h.A)({},dc))},variant:"outline",colorScheme:"gray",children:"Odm\xedtnout nepovinn\xe9"}),(0,p.jsx)(T.$,{size:"sm",colorScheme:"blue",onClick:()=>{s((0,h.A)((0,h.A)({},dc),{},{preferences:!0,analytics:!0,marketing:!0}))},children:"P\u0159ijmout v\u0161e"})]})]})}):null};function uc(){const[e,t]=(0,a.useState)(null),[n,i]=(0,a.useState)(null),{data:o}=ge();(0,a.useEffect)(()=>{let e=!0;return m.Ay.get("/seo").then(n=>{e&&t(n.data)}).catch(()=>{}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{o&&i({facebook:o.facebook_url,instagram:o.instagram_url,youtube:o.youtube_url})},[o]);const r=null===o||void 0===o?void 0:o.club_name,s=(null===e||void 0===e?void 0:e.site_title)&&e.site_title.trim()||r&&r.trim()||"MyClub",l=(null===e||void 0===e?void 0:e.site_description)&&e.site_description.trim()||(r?"Official ".concat(r," Website"):"Official MyClub Website"),c=(null===e||void 0===e?void 0:e.meta_keywords)||"",d=(null===e||void 0===e?void 0:e.default_og_image_url)||(null===o||void 0===o?void 0:o.club_logo_url)||"/logo512.png",h=W(d)||d,u=(null===e||void 0===e?void 0:e.twitter_handle)||"",x=(null===e||void 0===e?void 0:e.canonical_base_url)||("undefined"!==typeof window?window.location.origin:""),g=[];if(u){const e=u.startsWith("@")?u.slice(1):u;g.push("https://twitter.com/".concat(e))}null!==n&&void 0!==n&&n.facebook&&g.push(n.facebook),null!==n&&void 0!==n&&n.instagram&&g.push(n.instagram),null!==n&&void 0!==n&&n.youtube&&g.push(n.youtube);const v=!1===(null===e||void 0===e?void 0:e.enable_indexing)?"noindex, nofollow":"index, follow";return(0,a.useEffect)(()=>{"undefined"!==typeof document&&s&&(document.title=s)},[s]),(0,p.jsxs)(ii.mg,{defaultTitle:s,titleTemplate:"%s | ".concat(r||s),children:[(0,p.jsx)("title",{children:s}),(0,p.jsx)("meta",{name:"description",content:l}),c&&(0,p.jsx)("meta",{name:"keywords",content:c}),(0,p.jsx)("meta",{name:"robots",content:v}),(null===o||void 0===o?void 0:o.club_logo_url)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("link",{rel:"icon",href:W(o.club_logo_url)}),(0,p.jsx)("link",{rel:"shortcut icon",href:W(o.club_logo_url)}),(0,p.jsx)("link",{rel:"apple-touch-icon",href:W(o.club_logo_url)})]}),(0,p.jsx)("meta",{property:"og:type",content:"website"}),(0,p.jsx)("meta",{property:"og:title",content:s}),(0,p.jsx)("meta",{property:"og:description",content:l}),(0,p.jsx)("meta",{property:"og:image",content:h}),(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),u&&(0,p.jsx)("meta",{name:"twitter:site",content:u}),(0,p.jsx)("meta",{name:"twitter:title",content:s}),(0,p.jsx)("meta",{name:"twitter:description",content:l}),(0,p.jsx)("meta",{name:"twitter:image",content:h}),(null===e||void 0===e?void 0:e.canonical_base_url)&&(0,p.jsx)("link",{rel:"canonical",href:e.canonical_base_url}),x&&(0,p.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebSite",url:x,name:s,potentialAction:{"@type":"SearchAction",target:"".concat(x,"/blog?q={search_term_string}"),"query-input":"required name=search_term_string"}})}),x&&(0,p.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Organization",url:x,name:s,logo:h,sameAs:g.length?g:void 0})})]})}const mc=e=>{let{children:t,requiredRole:n}=e;const{isAuthenticated:i,isLoading:o,user:r}=v(),s=(0,c.zy)(),[l,d]=(0,a.useState)(!0),[h,u]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await Zl();e&&u(!!t.requires_setup)}catch(t){e&&u(!1)}finally{e&&d(!1)}})(),()=>{e=!1}},[]),o||l?(0,p.jsx)("div",{children:"Na\u010d\xedt\xe1n\xed\u2026"}):h?(0,p.jsx)(c.C5,{to:"/setup",replace:!0}):i?n&&r&&r.role&&r.role!==n&&"admin"!==r.role?(0,p.jsx)(c.C5,{to:"/403",state:{from:s.pathname},replace:!0}):t:(0,p.jsx)(c.C5,{to:"/login",state:{from:s},replace:!0})},pc=()=>{const e=(0,b.dU)("gray.700","gray.300"),t=(0,b.dU)("gray.900","gray.100"),n=(0,b.dU)("blue.50","blue.900"),a=(0,b.dU)("blue.900","blue.100");return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"3xl",py:8,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,color:t,children:"Obchodn\xed podm\xednky"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,p.jsxs)(y.a,{bg:n,p:4,borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,color:a,children:"Shrnut\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",color:a,children:"Pou\u017e\xedv\xe1n\xedm tohoto webu souhlas\xedte s n\xed\u017ee uveden\xfdmi podm\xednkami. Obsah slou\u017e\xed pro informa\u010dn\xed \xfa\u010dely, bez z\xe1ruky \xfaplnosti a spr\xe1vnosti. Provozovatel m\u016f\u017ee podm\xednky a obsah kdykoli m\u011bnit."})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Provozovatel a kontakt"}),(0,p.jsxs)(U.E,{color:e,mb:4,children:["Provozovatelem webov\xfdch str\xe1nek je subjekt uveden\xfd v sekci ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),". Pro ve\u0161ker\xe9 dotazy nebo podn\u011bty pros\xedm vyu\u017eijte uveden\xe9 kontaktn\xed \xfadaje."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Rozsah a p\u0159ijet\xed podm\xednek"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Tyto podm\xednky upravuj\xed pou\u017e\xedv\xe1n\xed tohoto webu a souvisej\xedc\xedch slu\u017eeb (nap\u0159. newsletter). Vstupem na web a jeho pou\u017e\xedv\xe1n\xedm vyjad\u0159ujete souhlas s t\u011bmito podm\xednkami."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Obsah, zdroje dat a pr\xe1va k du\u0161evn\xedmu vlastnictv\xed"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Autorsk\xe1 pr\xe1va:"})," Texty, grafika a prvky webu podl\xe9haj\xed ochran\u011b autorsk\xe9ho pr\xe1va. Kop\xedrov\xe1n\xed \u010di \u0161\xed\u0159en\xed je mo\u017en\xe9 pouze s p\u0159edchoz\xedm souhlasem."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Extern\xed data FA\u010cR:"})," Informace o z\xe1pasech, sout\u011b\u017e\xedch a tabulk\xe1ch poch\xe1zej\xed z ve\u0159ejn\xfdch zdroj\u016f FA\u010cR (",(0,p.jsx)(L.N,{href:"https://www.fotbal.cz",isExternal:!0,color:"brand.primary",children:"www.fotbal.cz"}),") a jsou majetkem FA\u010cR. Zobrazujeme je v\xfdhradn\u011b pro informa\u010dn\xed \xfa\u010dely."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Loga klub\u016f a t\xfdm\u016f:"})," Loga n\xe1le\u017e\xed p\u0159\xedslu\u0161n\xfdm klub\u016fm a organizac\xedm a slou\u017e\xed pouze k identifikaci."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Fotografie a videa:"})," Medi\xe1ln\xed obsah m\u016f\u017ee poch\xe1zet z r\u016fzn\xfdch zdroj\u016f, v\u010detn\u011b YouTube a Zonerama. Ve\u0161ker\xe1 pr\xe1va n\xe1le\u017e\xed p\u016fvodn\xedm autor\u016fm."]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. Pravidla chov\xe1n\xed u\u017eivatel\u016f"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsx)(No.ck,{children:"Neporu\u0161ujte pr\xe1vn\xed p\u0159edpisy ani pr\xe1va t\u0159et\xedch osob."}),(0,p.jsx)(No.ck,{children:"Nevkl\xe1dejte \u0161kodliv\xfd k\xf3d a nepokou\u0161ejte se naru\u0161it bezpe\u010dnost webu."}),(0,p.jsx)(No.ck,{children:"Nevyu\u017e\xedvejte web k nevy\u017e\xe1dan\xe9 reklam\u011b ani automatizovan\xe9mu sb\u011bru dat (scraping) v rozporu s podm\xednkami."})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Newsletter a \xfa\u010dty"}),(0,p.jsxs)(U.E,{color:e,mb:4,children:["P\u0159ihl\xe1\u0161en\xed k odb\u011bru newsletteru je dobrovoln\xe9 a lze jej kdykoli odhl\xe1sit prost\u0159ednictv\xedm odkazu v e\u2011mailu nebo na str\xe1nce ",(0,p.jsx)(L.N,{href:"/newsletter/preferences",color:"brand.primary",children:"nastaven\xed newsletteru"}),"."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. Odpov\u011bdnost a z\xe1ruky"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Obsah webu je poskytov\xe1n \u201etak jak je\u201c, bez jak\xfdchkoli z\xe1ruk. Provozovatel neodpov\xedd\xe1 za p\u0159\xedpadn\xe9 \u0161kody vznikl\xe9 u\u017e\xedv\xe1n\xedm webu, v nej\u0161ir\u0161\xedm rozsahu povolen\xe9m pr\xe1vem. Neodpov\xedd\xe1me za dostupnost a obsah extern\xedch odkaz\u016f (nap\u0159. FA\u010cR, YouTube, Zonerama)."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. E\u2011shop a extern\xed slu\u017eby"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Pokud web odkazuje na extern\xed e\u2011shop nebo platebn\xed slu\u017ebu, n\xe1kup se \u0159\xedd\xed podm\xednkami dan\xe9ho poskytovatele. Provozovatel tohoto webu nen\xed stranou takov\xe9ho smluvn\xedho vztahu, pokud nen\xed v\xfdslovn\u011b uvedeno jinak."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"8. Ochrana osobn\xedch \xfadaj\u016f a cookies"}),(0,p.jsxs)(U.E,{color:e,mb:4,children:["Zpracov\xe1n\xed osobn\xedch \xfadaj\u016f se \u0159\xedd\xed dokumentem ",(0,p.jsx)(L.N,{href:"/zasady-ochrany-osobnich-udaju",color:"brand.primary",children:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f"}),". Informace o cookies naleznete v ",(0,p.jsx)(L.N,{href:"/pravidla-cookies",color:"brand.primary",children:"Pravidlech pou\u017e\xedv\xe1n\xed cookies"}),"."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"9. Zm\u011bny podm\xednek"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Provozovatel si vyhrazuje pr\xe1vo tyto podm\xednky kdykoli upravit nebo doplnit. Zm\u011bny jsou \xfa\u010dinn\xe9 zve\u0159ejn\u011bn\xedm na tomto webu."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"10. Rozhodn\xe9 pr\xe1vo"}),(0,p.jsx)(U.E,{color:e,mb:2,children:"Tyto podm\xednky se \u0159\xedd\xed pr\xe1vn\xedm \u0159\xe1dem \u010cesk\xe9 republiky. P\u0159\xedpadn\xe9 spory budou \u0159e\u0161eny u p\u0159\xedslu\u0161n\xfdch soud\u016f \u010cesk\xe9 republiky."}),(0,p.jsxs)(U.E,{color:e,children:["M\xe1te\u2011li dotazy, kontaktujte n\xe1s prost\u0159ednictv\xedm str\xe1nky ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]})]})})})},xc=()=>{const e=(0,b.dU)("gray.700","gray.300"),t=(0,b.dU)("gray.900","gray.100"),n=(0,b.dU)("blue.50","blue.900"),a=(0,b.dU)("blue.900","blue.100");return(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"3xl",py:8,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:2,color:t,children:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,p.jsxs)(y.a,{bg:n,p:4,borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,color:a,children:"D\u016fle\u017eit\xe9 upozorn\u011bn\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",color:a,children:"Respektujeme va\u0161e soukrom\xed. Tato str\xe1nka popisuje, jak zpracov\xe1v\xe1me va\u0161e osobn\xed \xfadaje v souladu s platn\xfdmi pr\xe1vn\xedmi p\u0159edpisy (zejm\xe9na na\u0159\xedzen\xedm GDPR - Na\u0159\xedzen\xed Evropsk\xe9ho parlamentu a Rady (EU) 2016/679)."})]}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Spr\xe1vce osobn\xedch \xfadaj\u016f"}),(0,p.jsxs)(U.E,{color:e,mb:2,children:["Spr\xe1vcem osobn\xedch \xfadaj\u016f je provozovatel t\u011bchto webov\xfdch str\xe1nek. Kontaktn\xed \xfadaje spr\xe1vce naleznete na str\xe1nce ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Jak\xe9 osobn\xed \xfadaje zpracov\xe1v\xe1me"}),(0,p.jsx)(U.E,{color:e,mb:2,children:"Zpracov\xe1v\xe1me n\xe1sleduj\xedc\xed kategorie osobn\xedch \xfadaj\u016f:"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Kontaktn\xed \xfadaje:"})," jm\xe9no, p\u0159\xedjmen\xed, e-mailov\xe1 adresa, telefonn\xed \u010d\xedslo - poskytnut\xe9 dobrovoln\u011b prost\u0159ednictv\xedm kontaktn\xedho formul\xe1\u0159e nebo p\u0159i registraci k newsletteru"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"IP adresa:"})," automaticky zaznamen\xe1van\xe1 p\u0159i n\xe1v\u0161t\u011bv\u011b webu pro \xfa\u010dely bezpe\u010dnosti, anal\xfdzy n\xe1v\u0161t\u011bvnosti a prevence zneu\u017eit\xed"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Technick\xe9 \xfadaje:"})," informace o za\u0159\xedzen\xed, prohl\xed\u017ee\u010di, opera\u010dn\xedm syst\xe9mu, datum a \u010das n\xe1v\u0161t\u011bvy, nav\u0161t\xedven\xe9 str\xe1nky"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Cookies:"})," soubory ukl\xe1dan\xe9 do va\u0161eho za\u0159\xedzen\xed (viz samostatn\xe1 ",(0,p.jsx)(L.N,{href:"/pravidla-cookies",color:"brand.primary",children:"Pravidla pou\u017e\xedv\xe1n\xed cookies"}),")"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Analytick\xe9 \xfadaje:"})," anonymizovan\xe1 data o chov\xe1n\xed na webu prost\u0159ednictv\xedm analytick\xfdch n\xe1stroj\u016f"]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Zdroje dat a vlastnictv\xed obsahu"}),(0,p.jsxs)(y.a,{bg:n,p:4,borderRadius:"md",mb:4,children:[(0,p.jsx)(U.E,{fontWeight:"bold",mb:2,color:a,children:"D\u016fle\u017eit\xe9 pr\xe1vn\xed upozorn\u011bn\xed"}),(0,p.jsx)(U.E,{fontSize:"sm",color:a,children:"Tento web zobrazuje data z extern\xedch zdroj\u016f, kter\xe1 NEVLASTN\xcdME a kter\xe1 jsou majetkem p\u0159\xedslu\u0161n\xfdch organizac\xed."})]}),(0,p.jsxs)(No.B8,{spacing:3,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Data FA\u010cR (Fotbalov\xe1 asociace \u010cesk\xe9 republiky):"})," Ve\u0161ker\xe9 informace o z\xe1pasech, tabulk\xe1ch, sout\u011b\u017e\xedch a v\xfdsledc\xedch poch\xe1zej\xed z ve\u0159ejn\xfdch API a webov\xfdch str\xe1nek FA\u010cR (",(0,p.jsx)(L.N,{href:"https://www.fotbal.cz",isExternal:!0,color:"brand.primary",children:"www.fotbal.cz"}),"). Tato data jsou majetkem FA\u010cR a zobrazujeme je pouze pro informa\u010dn\xed \xfa\u010dely v souladu s ve\u0159ejnou dostupnost\xed."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Loga klub\u016f a t\xfdm\u016f:"})," Loga zobrazen\xe1 na webu jsou majetkem p\u0159\xedslu\u0161n\xfdch fotbalov\xfdch klub\u016f a organizac\xed. Pou\u017e\xedv\xe1me je pouze pro identifika\u010dn\xed \xfa\u010dely v r\xe1mci sportovn\xedho zpravodajstv\xed."]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Fotografie a medi\xe1ln\xed obsah:"})," Fotografie a videa mohou poch\xe1zet z r\u016fzn\xfdch zdroj\u016f v\u010detn\u011b ve\u0159ejn\xfdch galeri\xed, YouTube a dal\u0161\xedch platforem. Ve\u0161ker\xe1 autorsk\xe1 pr\xe1va n\xe1le\u017e\xed jejich p\u016fvodn\xedm autor\u016fm."]})]}),(0,p.jsxs)(U.E,{fontSize:"sm",color:e,children:["Pokud jste vlastn\xedkem obsahu a m\xe1te n\xe1mitky proti jeho pou\u017eit\xed, pros\xedm kontaktujte n\xe1s prost\u0159ednictv\xedm ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"kontaktn\xedho formul\xe1\u0159e"}),"."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. \xda\u010del zpracov\xe1n\xed"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Komunikace:"})," Vy\u0159\xedzen\xed va\u0161ich dotaz\u016f, po\u017eadavk\u016f a zp\u011btn\xe9 vazby"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Newsletter:"})," Zas\xedl\xe1n\xed novinek a informac\xed (pouze se souhlasem)"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Bezpe\u010dnost webu:"})," Ochrana p\u0159ed \xfatoky, prevence zneu\u017eit\xed, detekce podvod\u016f"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Anal\xfdza n\xe1v\u0161t\u011bvnosti:"})," Zlep\u0161ov\xe1n\xed u\u017eivatelsk\xe9ho z\xe1\u017eitku a optimalizace obsahu"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pln\u011bn\xed pr\xe1vn\xedch povinnost\xed:"})," Dodr\u017eov\xe1n\xed z\xe1konn\xfdch po\u017eadavk\u016f"]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Pr\xe1vn\xed z\xe1klad zpracov\xe1n\xed"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Souhlas (\u010dl. 6 odst. 1 p\xedsm. a GDPR):"})," Pro newsletter a analytick\xe9 cookies"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Opr\xe1vn\u011bn\xfd z\xe1jem (\u010dl. 6 odst. 1 p\xedsm. f GDPR):"})," Bezpe\u010dnost webu, prevence zneu\u017eit\xed, anonymizovan\xe1 analytika"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pln\u011bn\xed smlouvy (\u010dl. 6 odst. 1 p\xedsm. b GDPR):"})," Poskytov\xe1n\xed slu\u017eeb"]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. Doba uchov\xe1v\xe1n\xed \xfadaj\u016f"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Kontaktn\xed \xfadaje:"})," Po dobu nezbytnou pro vy\u0159\xedzen\xed po\u017eadavku, maxim\xe1ln\u011b 3 roky"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"IP adresy:"})," 90 dn\xed pro \xfa\u010dely bezpe\u010dnosti a anal\xfdzy"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Analytick\xe9 \xfadaje:"})," Anonymizovan\u011b a\u017e 26 m\u011bs\xedc\u016f"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Newsletter:"})," Do odvol\xe1n\xed souhlasu"]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. P\u0159ed\xe1v\xe1n\xed \xfadaj\u016f t\u0159et\xedm stran\xe1m"}),(0,p.jsx)(U.E,{color:e,mb:2,children:"Va\u0161e osobn\xed \xfadaje m\u016f\u017eeme p\u0159ed\xe1vat:"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Poskytovatel\xe9 hostingu:"})," Pro technick\xfd provoz webu"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Analytick\xe9 n\xe1stroje:"})," Pro m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti (anonymizovan\u011b)"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"E-mailov\xe9 slu\u017eby:"})," Pro zas\xedl\xe1n\xed newsletter\u016f"]})]}),(0,p.jsx)(U.E,{fontSize:"sm",color:e,children:"V\u0161ichni zpracovatel\xe9 jsou pe\u010dliv\u011b vybr\xe1ni a zav\xe1z\xe1ni k ochran\u011b va\u0161ich \xfadaj\u016f v souladu s GDPR."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"8. Va\u0161e pr\xe1va"}),(0,p.jsx)(U.E,{color:e,mb:2,children:"M\xe1te n\xe1sleduj\xedc\xed pr\xe1va:"}),(0,p.jsxs)(No.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo na p\u0159\xedstup:"})," M\u016f\u017eete po\u017e\xe1dat o informace o zpracov\xe1n\xed va\u0161ich \xfadaj\u016f"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo na opravu:"})," M\u016f\u017eete po\u017eadovat opravu nep\u0159esn\xfdch \xfadaj\u016f"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo na v\xfdmaz:"}),' M\u016f\u017eete po\u017eadovat smaz\xe1n\xed va\u0161ich \xfadaj\u016f (\u201epr\xe1vo b\xfdt zapomenut")']}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo na omezen\xed zpracov\xe1n\xed:"})," M\u016f\u017eete po\u017eadovat omezen\xed zpracov\xe1n\xed"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo na p\u0159enositelnost:"})," M\u016f\u017eete po\u017e\xe1dat o p\u0159ed\xe1n\xed \xfadaj\u016f"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo vzn\xe9st n\xe1mitku:"})," M\u016f\u017eete se br\xe1nit zpracov\xe1n\xed na z\xe1klad\u011b opr\xe1vn\u011bn\xe9ho z\xe1jmu"]}),(0,p.jsxs)(No.ck,{children:[(0,p.jsx)("strong",{children:"Pr\xe1vo odvolat souhlas:"})," Kdykoliv m\u016f\u017eete odvolat souhlas se zpracov\xe1n\xedm"]})]}),(0,p.jsxs)(U.E,{color:e,mb:4,children:["Pro uplatn\u011bn\xed va\u0161ich pr\xe1v n\xe1s kontaktujte prost\u0159ednictv\xedm str\xe1nky ",(0,p.jsx)(L.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"9. Bezpe\u010dnost \xfadaj\u016f"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Pou\u017e\xedv\xe1me p\u0159im\u011b\u0159en\xe1 technick\xe1 a organiza\u010dn\xed opat\u0159en\xed k ochran\u011b va\u0161ich osobn\xedch \xfadaj\u016f p\u0159ed neopr\xe1vn\u011bn\xfdm p\u0159\xedstupem, ztr\xe1tou, zni\u010den\xedm nebo zm\u011bnou. Data jsou p\u0159en\xe1\u0161ena \u0161ifrovan\u011b prost\u0159ednictv\xedm HTTPS protokolu."})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"10. St\xed\u017enosti"}),(0,p.jsx)(U.E,{color:e,mb:4,children:"Pokud se domn\xedv\xe1te, \u017ee s va\u0161imi \xfadaji nen\xed nakl\xe1d\xe1no v souladu se z\xe1konem, m\xe1te pr\xe1vo podat st\xed\u017enost u dozorov\xe9ho \xfa\u0159adu:"}),(0,p.jsxs)(y.a,{bg:n,p:4,borderRadius:"md",children:[(0,p.jsx)(U.E,{fontWeight:"bold",color:a,children:"\xda\u0159ad pro ochranu osobn\xedch \xfadaj\u016f"}),(0,p.jsx)(U.E,{fontSize:"sm",color:a,children:"Pplk. Sochora 27, 170 00 Praha 7"}),(0,p.jsxs)(U.E,{fontSize:"sm",color:a,children:["Web: ",(0,p.jsx)(L.N,{href:"https://www.uoou.cz",isExternal:!0,color:"brand.primary",children:"www.uoou.cz"})]})]})]}),(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"11. Zm\u011bny t\u011bchto z\xe1sad"}),(0,p.jsx)(U.E,{color:e,children:"Vyhrazujeme si pr\xe1vo tyto z\xe1sady aktualizovat. O v\xfdznamn\xfdch zm\u011bn\xe1ch v\xe1s budeme informovat prost\u0159ednictv\xedm webu."})]})]})})})};var gc=n(8860);const vc=()=>{(0,c.zy)();const e=(0,c.Zp)();return(0,p.jsx)(y.a,{minH:"70vh",display:"flex",alignItems:"center",justifyContent:"center",bgGradient:"linear(to-b, rgba(0,0,0,0.02), transparent)",px:6,children:(0,p.jsx)(y.a,{w:{base:"100%",sm:"560px"},textAlign:"center",bg:"white",_dark:{bg:"gray.800"},borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",boxShadow:"md",p:{base:6,md:10},children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(ee.z,{spacing:3,color:"brand.primary",children:[(0,p.jsx)(jn.I,{as:gc.Rmk,boxSize:8}),(0,p.jsx)(z.D,{as:"h1",size:"2xl",letterSpacing:"wide",children:"403"}),(0,p.jsx)(jn.I,{as:gc.zIu,boxSize:8})]}),(0,p.jsx)(z.D,{as:"h2",size:"lg",bgGradient:"linear(to-r, brand.primary, brand.accent)",bgClip:"text",children:"P\u0159\xedstup odep\u0159en"}),(0,p.jsx)(U.E,{color:"gray.600",_dark:{color:"gray.300"},children:"Rozhod\u010d\xed p\xedsk\xe1: tato \u010d\xe1st h\u0159i\u0161t\u011b je jen pro kapit\xe1ny (adminy)."}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(ee.z,{spacing:3,pt:2,children:[(0,p.jsx)(T.$,{onClick:()=>e(-1),colorScheme:"blue",children:"Zp\u011bt"}),(0,p.jsx)(T.$,{as:d.N_,to:"/",variant:"outline",children:"Zp\u011bt na \xfavod"})]})]})})})};var jc=n(7149);const bc=()=>{const e=(0,c.Zp)();return(0,p.jsx)(y.a,{minH:"70vh",display:"flex",alignItems:"center",justifyContent:"center",bgGradient:"linear(to-b, rgba(0,0,0,0.02), transparent)",px:6,children:(0,p.jsx)(y.a,{w:{base:"100%",sm:"560px"},textAlign:"center",bg:"white",_dark:{bg:"gray.800"},borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",boxShadow:"md",p:{base:6,md:10},children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsxs)(ee.z,{spacing:3,color:"brand.primary",children:[(0,p.jsx)(jn.I,{as:gc.zIu,boxSize:8}),(0,p.jsx)(z.D,{as:"h1",size:"2xl",letterSpacing:"wide",children:"404"}),(0,p.jsx)(jn.I,{as:jc.oDq,boxSize:8})]}),(0,p.jsx)(z.D,{as:"h2",size:"lg",bgGradient:"linear(to-r, brand.primary, brand.accent)",bgClip:"text",children:"Str\xe1nka nenalezena"}),(0,p.jsx)(U.E,{color:"gray.600",_dark:{color:"gray.300"},children:"M\xed\u010d je mimo h\u0159i\u0161t\u011b \u2013 zkuste to znovu nebo vra\u0165te se."}),(0,p.jsx)(G.c,{}),(0,p.jsxs)(ee.z,{spacing:3,pt:2,children:[(0,p.jsx)(T.$,{onClick:()=>e(-1),colorScheme:"blue",children:"Zp\u011bt"}),(0,p.jsx)(T.$,{as:d.N_,to:"/",variant:"outline",children:"Zp\u011bt na \xfavod"})]})]})})})},yc=e=>{try{if(e.includes("youtube.com")||e.includes("youtu.be")){const t=new URL(e);if(t.hostname.includes("youtu.be")){const e=t.pathname.replace("/","");return"https://www.youtube.com/embed/".concat(e)}const n=t.searchParams.get("v");if(n)return"https://www.youtube.com/embed/".concat(n)}}catch(t){}return"https://www.youtube.com/embed/".concat(e)},fc=e=>{var t;if(null!==e&&void 0!==e&&e.includes("/embed/"))return null===(t=e.split("/embed/")[1])||void 0===t?void 0:t.split("?")[0]},kc=()=>{const e=(0,b.dU)("white","gray.800"),t=(0,b.dU)("gray.200","gray.600"),n=(0,b.dU)("gray.800","gray.100"),i=(0,b.dU)("gray.600","gray.300"),o=(0,b.dU)("gray.500","gray.400"),r=(0,b.dU)("white","gray.800"),s=(0,b.dU)("gray.100","gray.700"),l=(0,b.dU)("gray.400","gray.500"),c=(0,b.dU)("brand.primary","brand.accent"),d=Ye(),{data:h,isLoading:u}=ge(),[m,x]=(0,a.useState)([]),[g,v]=(0,a.useState)(!0),{isOpen:j,onOpen:f,onClose:k}=(0,X.j)(),[_,S]=(0,a.useState)(null),C=(null===h||void 0===h?void 0:h.videos_source)||"auto",A=(null===h||void 0===h?void 0:h.youtube_url)||(null===h||void 0===h?void 0:h.social_youtube)||null;(0,a.useEffect)(()=>{let e=!1;return(async()=>{if("auto"===C)try{const t=await bt();if(!t)return void v(!1);const n=(t.videos||[]).slice().sort((e,t)=>(Date.parse(t.published_date||"")||0)-(Date.parse(e.published_date||"")||0));e||x(n)}catch(t){console.error("Failed to load videos:",t)}finally{e||v(!1)}else v(!1)})(),()=>{e=!0}},[C]);const E=(0,a.useMemo)(()=>{if("auto"===C)return(m||[]).map(e=>({key:e.video_id,title:e.title,embedUrl:yc(e.video_id),thumbnail:e.thumbnail_url,date:e.published_date,videoId:e.video_id}));const e=((null===h||void 0===h?void 0:h.videos_items)||[]).map((e,t)=>{const n=yc(e.url);return{key:"".concat(t,"-").concat(e.url),title:e.title||"Video ".concat(t+1),embedUrl:n,thumbnail:e.thumbnail_url,date:e.uploaded_at,videoId:fc(n)}}),t=((null===h||void 0===h?void 0:h.videos)||[]).map((e,t)=>{const n=yc(e);return{key:"".concat(t,"-").concat(e),title:"Video ".concat(t+1),embedUrl:n,videoId:fc(n)}});return e.length?e:t},[C,m,null===h||void 0===h?void 0:h.videos_items,h]),N=n=>{let{item:a}=n;const i=a.thumbnail||(a.videoId?"https://i.ytimg.com/vi/".concat(a.videoId,"/hqdefault.jpg"):void 0);return(0,p.jsxs)(y.a,{bg:e,borderRadius:"xl",overflow:"hidden",boxShadow:"sm",borderWidth:"2px",borderColor:t,transition:"all 0.3s",_hover:{transform:"translateY(-8px)",boxShadow:"0 20px 40px rgba(0,0,0,0.15)",borderColor:"brand.primary"},children:[(0,p.jsx)(vn.g,{ratio:16/9,children:(0,p.jsxs)(y.a,{position:"relative",cursor:"pointer",onClick:()=>(e=>{S(e),f()})(a),children:[i?(0,p.jsx)(y.a,{as:"img",src:i,alt:a.title,width:"100%",height:"100%",style:{objectFit:"cover"}}):(0,p.jsx)(y.a,{bg:s,display:"flex",alignItems:"center",justifyContent:"center",children:(0,p.jsx)(jn.I,{as:pe.gSK,boxSize:12,color:l})}),(0,p.jsx)(y.a,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",bg:"blackAlpha.600",opacity:0,_hover:{opacity:1},transition:"opacity 0.3s",children:(0,p.jsxs)(y.a,{bg:"brand.primary",color:"white",borderRadius:"full",px:8,py:4,fontWeight:"bold",display:"flex",alignItems:"center",gap:2,transform:"scale(1)",_hover:{transform:"scale(1.1)"},transition:"transform 0.2s",boxShadow:"0 8px 24px rgba(0,0,0,0.3)",children:[(0,p.jsx)(jn.I,{as:pe.gSK,boxSize:5}),(0,p.jsx)(U.E,{fontSize:"lg",children:"P\u0159ehr\xe1t"})]})})]})}),(0,p.jsx)(y.a,{p:4,borderTopWidth:"2px",borderTopColor:c,children:(0,p.jsxs)(w.T,{align:"start",spacing:2,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"md",color:c,noOfLines:2,children:a.title}),(0,p.jsxs)(ee.z,{justify:"space-between",width:"100%",children:[a.date&&(0,p.jsx)(Qt.E,{colorScheme:"gray",fontSize:"0.7rem",children:new Date(a.date).toLocaleDateString("cs-CZ")}),a.videoId&&(0,p.jsx)(L.N,{href:"https://www.youtube.com/watch?v=".concat(a.videoId),isExternal:!0,onClick:e=>e.stopPropagation(),children:(0,p.jsx)(T.$,{size:"xs",variant:"ghost",colorScheme:"red",leftIcon:(0,p.jsx)(jn.I,{as:pe.Vk6}),children:"YouTube"})})]})]})})]})};return u||g?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl",color:d.accent}),(0,p.jsx)(U.E,{color:i,children:"Na\u010d\xedt\xe1m videa..."})]})})}):(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,p.jsxs)(y.a,{mb:6,children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:2,flexWrap:"wrap",children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",color:n,children:"Videa"}),A&&(0,p.jsx)(L.N,{href:A,isExternal:!0,children:(0,p.jsx)(T.$,{size:"sm",variant:"outline",colorScheme:"red",rightIcon:(0,p.jsx)(jn.I,{as:pe.EQc}),children:"YouTube kan\xe1l"})})]}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{color:i,children:"Sledujte na\u0161e nejnov\u011bj\u0161\xed videa a z\xe1pasy"}),(0,p.jsxs)(ee.z,{spacing:1,color:o,fontSize:"sm",children:[(0,p.jsx)(jn.I,{as:pe.Vk6,color:"red.500"}),(0,p.jsx)(U.E,{children:"V\u0161echna videa jsou z YouTube"})]})]})]}),0===E.length?(0,p.jsxs)(y.a,{textAlign:"center",py:12,children:[(0,p.jsx)(jn.I,{as:pe.gSK,boxSize:16,color:l,mb:4}),(0,p.jsx)(U.E,{color:i,fontSize:"lg",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 videa"})]}):(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:E.map(e=>(0,p.jsx)(N,{item:e},e.key))})]}),(0,p.jsxs)(se.aF,{isOpen:j,onClose:k,size:"6xl",isCentered:!0,children:[(0,p.jsx)(H.m,{bg:"blackAlpha.800"}),(0,p.jsxs)(le.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,p.jsx)(B.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.800"},size:"lg",top:2,right:2,zIndex:2}),(0,p.jsx)(Y.c,{p:0,children:_&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(vn.g,{ratio:16/9,maxH:"80vh",children:(0,p.jsx)("iframe",{src:"".concat(_.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:_.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin",style:{borderRadius:"8px"}})}),(0,p.jsx)(y.a,{bg:r,p:4,borderRadius:"md",mt:2,children:(0,p.jsxs)(ee.z,{justify:"space-between",align:"start",children:[(0,p.jsxs)(w.T,{align:"start",flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"lg",children:_.title}),_.date&&(0,p.jsx)(U.E,{color:i,fontSize:"sm",children:new Date(_.date).toLocaleDateString("cs-CZ",{year:"numeric",month:"long",day:"numeric"})})]}),_.videoId&&(0,p.jsx)(L.N,{href:"https://www.youtube.com/watch?v=".concat(_.videoId),isExternal:!0,children:(0,p.jsx)(T.$,{size:"sm",colorScheme:"red",leftIcon:(0,p.jsx)(jn.I,{as:pe.Vk6}),children:"Otev\u0159\xedt na YouTube"})})]})})]})})]})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})},zc=["lastPlayedDate"],wc=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),_c=async e=>{try{const t=await fetch((e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})(e),{cache:"no-cache"});return t.ok?await t.json():null}catch(t){return null}};let Sc=null;const Cc=e=>{if(!e)return[];const t=wc(e.name||""),n=Array.isArray(e.competitions)?e.competitions:[],a=new Map,i=e=>{var n,i;const o=null===(n=e.name)||void 0===n?void 0:n.trim();if(!o)return;const r=wc(o);if(!r||r===t)return;const s=a.get(r),l=(null!==(i=null===s||void 0===s?void 0:s.matches_played)&&void 0!==i?i:0)+1,c=e.occurredAt&&(null===s||void 0===s||!s.lastPlayedDate||e.occurredAt>s.lastPlayedDate)?e.occurredAt:null===s||void 0===s?void 0:s.lastPlayedDate,d=e.logo||(null===s||void 0===s?void 0:s.logo_url),h=e.competition||(null===s||void 0===s?void 0:s.competition);a.set(r,{id:e.id||(null===s||void 0===s?void 0:s.id)||r,name:o,logo_url:d?W(d)||d:null===s||void 0===s?void 0:s.logo_url,competition:h,matches_played:l,last_played_iso:c?c.toISOString():null===s||void 0===s?void 0:s.last_played_iso,lastPlayedDate:c})};return n.forEach(e=>{(Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[]).forEach(t=>{const n=(e=>{if(!e)return null;const[t,n="00:00"]=String(e).split(" "),[a,i,o]=(t||"").split(".");if(!a||!i||!o)return null;const r="".concat(o,"-").concat(i.padStart(2,"0"),"-").concat(a.padStart(2,"0"),"T").concat(n.slice(0,5),":00"),s=new Date(r);return Number.isNaN(s.getTime())?null:s})(null===t||void 0===t?void 0:t.date_time);i({name:null===t||void 0===t?void 0:t.home,id:(null===t||void 0===t?void 0:t.home_id)||(null===t||void 0===t?void 0:t.homeId),logo:null===t||void 0===t?void 0:t.home_logo_url,competition:null===e||void 0===e?void 0:e.name,occurredAt:n}),i({name:null===t||void 0===t?void 0:t.away,id:(null===t||void 0===t?void 0:t.away_id)||(null===t||void 0===t?void 0:t.awayId),logo:null===t||void 0===t?void 0:t.away_logo_url,competition:null===e||void 0===e?void 0:e.name,occurredAt:n})})}),Array.from(a.values()).map(e=>{let{lastPlayedDate:t}=e;return(0,O.A)(e,zc)}).sort((e,t)=>{const n=e.last_played_iso?new Date(e.last_played_iso).getTime():0;return(t.last_played_iso?new Date(t.last_played_iso).getTime():0)-n})},Ac=async()=>(Sc||(Sc=(async()=>{const e=await _c("/cache/prefetch/facr_club_info.json");return e?Cc(e):[]})().catch(()=>[])),Sc),Ec=(e,t)=>{const n=(e,t)=>{if(!e||!t)return 0;if(e===t)return 100;if(e.startsWith(t))return 80;const n=e.indexOf(t);if(n>=0)return 60-Math.min(n,30);const a=t.split(/\s+/).filter(e=>e.length>1);if(a.length>1){let t=0,n=0;for(const i of a)if(e.includes(i)){t++;const a=e.indexOf(i);n+=0===a?25:15-Math.min(a,10)}if(t>=a.length/2)return Math.min(55,n*(t/a.length))}const i=t.split("");let o=-1,r=0;for(const s of i){const t=e.indexOf(s,o+1);t>o&&(r++,o=t)}return r>=.8*i.length?Math.min(25,Math.floor(r/i.length*25)):0},a=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),i=(e||"").toLowerCase(),o=(t||"").toLowerCase(),r=a(i),s=a(o);return Math.max(n(i,o),n(r,s))},Tc=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},Nc=async e=>{try{const t=Tc(e),n=await fetch(t,{cache:"no-cache"});return n.ok?await n.json():null}catch(t){return null}},Rc=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase();const Pc=()=>{const[e,t]=(0,d.ok)(),n=(0,c.Zp)(),i=String(e.get("q")||""),[o,r]=(0,a.useState)(i),[s,l]=(0,a.useState)(i),[h,u]=(0,a.useState)(!1),[x,g]=(0,a.useState)(null),[v,j]=(0,a.useState)({clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],total:0}),[f,_]=(0,a.useState)("all"),[S,N]=(0,a.useState)(10),[R,P]=(0,a.useState)(10),[I,M]=(0,a.useState)(12),[D,F]=(0,a.useState)(12),[O,K]=(0,a.useState)(10),q=(0,a.useRef)(null),V=(0,b.dU)("white","gray.800"),H=(0,b.dU)("gray.200","gray.600");(0,a.useEffect)(()=>{const e=setTimeout(()=>l(o.trim()),400);return()=>clearTimeout(e)},[o]);const $=(0,a.useCallback)(async e=>{if(e){u(!0),g(null);try{const t=await async function(e){if(!e||0===e.trim().length)return{clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],total:0};const t=e.trim().toLowerCase();try{var n,a;const i=Ac(),[o,r,s,l,c,d,h,u,p,x,g]=await Promise.allSettled([i,Ce.searchClubs(e).catch(()=>({results:[]})),(async()=>{const t=Tc("/api/v1/matches?q=".concat(encodeURIComponent(e)));try{const e=await fetch(t,{cache:"no-cache"});let n=[];if(e.ok&&(n=await e.json()),!Array.isArray(n)||0===n.length){const e=await Nc("/cache/prefetch/matches.json");return Array.isArray(e)?e:[]}return n}catch(n){const e=await Nc("/cache/prefetch/matches.json");return Array.isArray(e)?e:[]}})(),(async()=>{const t=Tc("/api/v1/matches/history?q=".concat(encodeURIComponent(e)));try{const e=await fetch(t,{cache:"no-cache"});let n=[];if(e.ok&&(n=await e.json()),Array.isArray(n)&&n.length>0)return n}catch(o){}const n=await Nc("/cache/prefetch/facr_club_info.json");if(!n||!Array.isArray(null===n||void 0===n?void 0:n.competitions))return[];const a=new Date,i=[];for(const e of n.competitions){const t=String((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||"").trim(),n=Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[];for(const e of n){const n=String((null===e||void 0===e?void 0:e.date_time)||"").trim();if(!n)continue;const[o,r="00:00"]=n.split(" "),[s,l,c]=String(o||"").split(".");if(!s||!l||!c)continue;const d="".concat(c,"-").concat(String(l).padStart(2,"0"),"-").concat(String(s).padStart(2,"0")),h=String(r).slice(0,5),u=new Date("".concat(d,"T").concat(h||"00:00",":00"));u instanceof Date&&!isNaN(u.getTime())&&(u.getTime()>=a.getTime()||i.push({id:(null===e||void 0===e?void 0:e.match_id)||(null===e||void 0===e?void 0:e.matchId),home:null===e||void 0===e?void 0:e.home,away:null===e||void 0===e?void 0:e.away,competition:t,date:d,time:h||void 0,venue:null===e||void 0===e?void 0:e.venue,home_logo_url:null===e||void 0===e?void 0:e.home_logo_url,away_logo_url:null===e||void 0===e?void 0:e.away_logo_url}))}}return i})(),xt({q:e,published:!0,page:1,page_size:50}),Qe(),lt(),Jt(),(async e=>{const t=await m.Ay.get("/teams");return Array.isArray(t.data)?t.data:(null===(e=t.data)||void 0===e?void 0:e.data)||[]})(),(async()=>{try{var e,t;const n=await m.Ay.get("/contacts"),a=(null===(e=n.data)||void 0===e?void 0:e.categories)||{},i=[...(null===(t=n.data)||void 0===t?void 0:t.uncategorized)||[]];return Object.values(a).forEach(e=>{Array.isArray(e)&&i.push(...e)}),i}catch(n){return[]}})(),(async()=>{try{var e,t;const n=await m.Ay.get("/gallery/albums");return Array.isArray(n.data)?n.data:(null===(e=n.data)||void 0===e?void 0:e.data)||(null===(t=n.data)||void 0===t?void 0:t.albums)||[]}catch(n){return[]}})()]),v="fulfilled"===o.status?o.value:[],j=new Map,b=new Map;v.forEach(e=>{const t=String(e.id||"").toLowerCase();t&&j.set(t,e);const n=Rc(e.name);n&&b.set(n,e)});const y=j.size>0||b.size>0,f=("fulfilled"===r.status&&(null===(n=r.value)||void 0===n?void 0:n.results)||[]).filter(e=>!!String(e.name||"").trim()).map(e=>{const n=String(e.club_id||e.id||"").toLowerCase(),a=Rc(e.name),i=n&&j.get(n)||a&&b.get(a)||null,o=Math.max(Ec(e.name,t),Ec(e.category||"",t)),r=(null===i||void 0===i?void 0:i.logo_url)||e.logo_url,s=(null===i||void 0===i?void 0:i.competition)||e.category||e.club_type;return{type:"club",id:e.club_id||e.id,title:e.name,subtitle:s,logo_url:r?Tc(r):void 0,metadata:{club_type:e.club_type,last_played_iso:null===i||void 0===i?void 0:i.last_played_iso,matches_played:null===i||void 0===i?void 0:i.matches_played},score:o}}).sort((e,t)=>(t.score||0)-(e.score||0)),k=(e,t,n,a)=>{if(!y)return!0;const i=Rc(e||""),o=Rc(t||"");if(i&&b.has(i))return!0;if(o&&b.has(o))return!0;const r=String(n||"").toLowerCase(),s=String(a||"").toLowerCase();return!(!r||!j.has(r))||!(!s||!j.has(s))},z="fulfilled"===s.status?s.value:[],w=(Array.isArray(z)?z:[]).filter(e=>{const n=e.competition||e.competition_name||e.league||"",a=Ec(e.home||"",t)>0||Ec(e.away||"",t)>0||Ec(e.venue||"",t)>0||Ec(n,t)>0;return k(e.home,e.away,e.home_id||e.homeId,e.away_id||e.awayId)||a}).filter(e=>{const n=e.competition||e.competition_name||e.league||"";return Ec(e.home||"",t)>0||Ec(e.away||"",t)>0||Ec(e.venue||"",t)>0||Ec(n,t)>0}).map((e,n)=>({type:"match",id:e.id||n,title:"".concat(e.home||"TBD"," vs ").concat(e.away||"TBD"),subtitle:e.competition||e.competition_name||e.league,date:e.date,time:e.time,metadata:{home:e.home,away:e.away,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url,venue:e.venue},score:Math.max(Ec(e.home||"",t),Ec(e.away||"",t),Ec(e.venue||"",t),Ec(e.competition||e.competition_name||e.league||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),_="fulfilled"===l.status?l.value:[],S=(Array.isArray(_)?_:[]).filter(e=>{const n=e.competition||e.competition_name||e.league||"",a=Ec(e.home||"",t)>0||Ec(e.away||"",t)>0||Ec(e.venue||"",t)>0||Ec(n,t)>0;return k(e.home,e.away,e.home_id||e.homeId,e.away_id||e.awayId)||a}).filter(e=>{const n=e.competition||e.competition_name||e.league||"";return Ec(e.home||"",t)>0||Ec(e.away||"",t)>0||Ec(e.venue||"",t)>0||Ec(n,t)>0}).map((e,n)=>({type:"match_past",id:"past-".concat(e.id||n),title:"".concat(e.home||"TBD"," vs ").concat(e.away||"TBD"),subtitle:e.competition||e.competition_name||e.league,date:e.date,time:e.time,metadata:{home:e.home,away:e.away,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url,venue:e.venue},score:Math.max(Ec(e.home||"",t),Ec(e.away||"",t),Ec(e.venue||"",t),Ec(e.competition||e.competition_name||e.league||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),C=("fulfilled"===c.status&&(null===(a=c.value)||void 0===a?void 0:a.data)||[]).filter(e=>{const n=Ec(e.title||"",t),a=Ec(e.excerpt||"",t),i=Ec(e.content||"",t);return n>0||a>0||i>0}).map(e=>({type:"article",id:e.id,title:e.title,description:e.excerpt,image_url:e.image_url,url:"/blog/".concat(e.slug||e.id),date:e.published_at||e.created_at,score:Math.max(Ec(e.title||"",t),.7*Ec(e.excerpt||"",t),.3*Ec(e.content||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),A="fulfilled"===d.status?d.value:[],E=(Array.isArray(A)?A:[]).filter(e=>{const n="".concat(e.first_name||""," ").concat(e.last_name||""),a=Ec(n,t),i=Ec(e.position||"",t);return a>0||i>0}).map(e=>({type:"player",id:e.id,title:"".concat(e.first_name," ").concat(e.last_name),subtitle:e.position,image_url:e.image_url,url:"/hraci/".concat(e.id),metadata:{jersey_number:e.jersey_number},score:Math.max(Ec("".concat(e.first_name," ").concat(e.last_name),t),Ec(e.position||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),T="fulfilled"===h.status?h.value:[],N=(Array.isArray(T)?T:[]).filter(e=>{const n=Ec(e.title||"",t),a=Ec(e.description||"",t),i=Ec(e.location||"",t);return n>0||a>0||i>0}).map(e=>({type:"event",id:e.id,title:e.title,description:e.description,date:e.event_date,time:e.event_time,metadata:{location:e.location},score:Math.max(Ec(e.title||"",t),.7*Ec(e.description||"",t),.5*Ec(e.location||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),R="fulfilled"===u.status?u.value:[],P=(Array.isArray(R)?R:[]).filter(e=>Ec(e.name||"",t)>0).map(e=>({type:"sponsor",id:e.id,title:e.name,logo_url:e.logo_url,url:e.website_url,score:Ec(e.name||"",t)})).sort((e,t)=>(t.score||0)-(e.score||0)),I="fulfilled"===p.status?p.value:[],W=(Array.isArray(I)?I:[]).filter(e=>{if(!String(e.name||"").trim())return!1;const n=Ec(e.name||"",t),a=Ec(e.short_name||"",t);return n>0||a>0}).map(e=>({type:"team",id:e.id,title:e.name,subtitle:e.short_name,logo_url:e.logo_url,description:e.description,score:Math.max(Ec(e.name||"",t),Ec(e.short_name||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),M="fulfilled"===x.status?x.value:[],D=(Array.isArray(M)?M:[]).filter(e=>{const n=Ec(e.name||"",t),a=Ec(e.position||"",t),i=Ec(e.email||"",t);return n>0||a>0||i>0}).map(e=>({type:"contact",id:e.id,title:e.name,subtitle:e.position,description:e.description,image_url:e.image_url,metadata:{email:e.email,phone:e.phone},score:Math.max(Ec(e.name||"",t),Ec(e.position||"",t),.5*Ec(e.email||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),U="fulfilled"===g.status?g.value:[],L=(Array.isArray(U)?U:[]).filter(e=>{const n=Ec(e.title||e.name||"",t),a=Ec(e.description||"",t);return n>0||a>0}).map(e=>({type:"gallery",id:e.id,title:e.title||e.name,description:e.description,image_url:e.cover_url||e.thumbnail_url,url:"/galerie/".concat(e.id),metadata:{photo_count:e.photo_count},score:Math.max(Ec(e.title||e.name||"",t),.7*Ec(e.description||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0));return{clubs:f,matches:w,matchesPast:S,articles:C,players:E,events:N,sponsors:P,teams:W,contacts:D,gallery:L,total:f.length+w.length+S.length+C.length+E.length+N.length+P.length+W.length+D.length+L.length}}catch(x){return console.error("Search error:",x),{clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],total:0}}}(e);j(t)}catch(t){g((null===t||void 0===t?void 0:t.message)||"Chyba vyhled\xe1v\xe1n\xed")}finally{u(!1)}}else j({clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],total:0})},[]);(0,a.useEffect)(()=>{const n=String(e.get("q")||"");if(s!==n){const n=new URLSearchParams(e.toString());s?n.set("q",s):n.delete("q"),t(n,{replace:!0})}N(10),P(10),M(12),F(12),K(10),$(s)},[s]);const B=(0,a.useMemo)(()=>v.total>0,[v.total]),J=(0,a.useMemo)(()=>v.clubs.filter(e=>e.title&&String(e.title).trim()),[v.clubs]),Y=(e,t)=>{const n=String(e||""),a=String(t||"").trim();if(!n||!a)return n;try{const e=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(e,"gi"),i=n.split(t),o=n.match(t)||[],r=[];return i.forEach((e,t)=>{r.push(e),t<o.length&&r.push((0,p.jsx)("mark",{style:{backgroundColor:"#fde68a"},children:o[t]},t))}),(0,p.jsx)(p.Fragment,{children:r})}catch(i){return n}};return(0,p.jsx)(Ht,{children:(0,p.jsxs)(Z.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,p.jsxs)(w.T,{align:"stretch",spacing:8,children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h1",size:{base:"xl",md:"2xl"},mb:2,children:"Vyhled\xe1v\xe1n\xed"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Prohled\xe1vejte kluby, z\xe1pasy, \u010dl\xe1nky, hr\xe1\u010de, akce a dal\u0161\xed obsah"})]}),(0,p.jsxs)(y.a,{as:"form",onSubmit:t=>{t.preventDefault();const a=o.trim();r(a),l(a);const i=new URLSearchParams(e.toString());a?i.set("q",a):i.delete("q"),n("/hledat?".concat(i.toString()))},children:[(0,p.jsxs)(A.M,{size:"lg",children:[(0,p.jsx)(E.W,{pointerEvents:"none",children:(0,p.jsx)(jn.I,{as:pe.KSO,color:"gray.400"})}),(0,p.jsx)(C.p,{placeholder:"Hledat kluby, z\xe1pasy, \u010dl\xe1nky, hr\xe1\u010de, akce...",value:o,onChange:e=>{r(e.target.value)},bg:V,borderColor:H,ref:q,_focus:{borderColor:"brand.primary",boxShadow:"0 0 0 1px var(--chakra-colors-brand-primary)"}})]}),(0,p.jsx)(T.$,{type:"submit",mt:3,colorScheme:"blue",size:"lg",children:"Vyhledat"})]}),h&&(0,p.jsx)(Q.s,{justify:"center",my:12,children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsx)(zn.y,{size:"xl",color:"brand.primary",thickness:"4px"}),(0,p.jsx)(U.E,{color:"gray.500",children:"Vyhled\xe1v\xe1m..."})]})}),x&&(0,p.jsxs)(y.a,{p:4,bg:"red.50",borderRadius:"md",borderWidth:"1px",borderColor:"red.200",children:[(0,p.jsx)(U.E,{color:"red.700",fontWeight:"medium",children:"Chyba p\u0159i vyhled\xe1v\xe1n\xed"}),(0,p.jsx)(U.E,{color:"red.600",fontSize:"sm",children:x})]}),!h&&!B&&s&&(0,p.jsxs)(y.a,{textAlign:"center",py:12,children:[(0,p.jsx)(jn.I,{as:pe.KSO,boxSize:16,color:"gray.300",mb:4}),(0,p.jsx)(z.D,{size:"md",mb:2,children:"\u017d\xe1dn\xe9 v\xfdsledky"}),(0,p.jsxs)(U.E,{color:"gray.500",children:['Pro dotaz "',s,'" nebyly nalezeny \u017e\xe1dn\xe9 v\xfdsledky']}),(0,p.jsx)(U.E,{color:"gray.500",fontSize:"sm",mt:2,children:"Zkuste jin\xe9 kl\xed\u010dov\xe9 slovo nebo hledejte obecn\u011bj\u0161\xed term\xedn"})]}),B&&(0,p.jsxs)(ra.t,{variant:"enclosed",colorScheme:"blue",index:["all","clubs","matches","articles","players","events","other"].indexOf(f),onChange:e=>_(["all","clubs","matches","articles","players","events","other"][e]),children:[(0,p.jsxs)(sa.w,{flexWrap:"wrap",children:[(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:pe.KSO,mr:2}),"V\u0161e (",v.total,")"]}),(0,p.jsxs)(la.o,{children:["Kluby (",J.length,")"]}),(0,p.jsxs)(la.o,{children:["Z\xe1pasy (",v.matches.length+v.matchesPast.length,")"]}),(0,p.jsxs)(la.o,{children:["\u010cl\xe1nky (",v.articles.length,")"]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:pe.YXz,mr:2}),"Hr\xe1\u010di (",v.players.length,")"]}),(0,p.jsxs)(la.o,{children:[(0,p.jsx)(jn.I,{as:pe.itz,mr:2}),"Akce (",v.events.length,")"]}),(0,p.jsxs)(la.o,{children:["Ostatn\xed (",v.teams.length+v.sponsors.length+v.contacts.length+v.gallery.length,")"]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{px:0,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:8,children:[J.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"md",children:"Kluby"}),(0,p.jsx)(Qt.E,{colorScheme:"blue",fontSize:"md",children:J.length})]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:J.slice(0,6).map(e=>(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",align:"center",gap:3,children:[e.logo_url&&(0,p.jsx)(k._,{src:e.logo_url,alt:e.title,boxSize:"50px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))}),J.length>6&&(0,p.jsxs)(T.$,{mt:3,size:"sm",onClick:()=>_("clubs"),children:["Zobrazit v\u0161ech ",J.length," klub\u016f"]})]}),v.players.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsxs)(z.D,{size:"md",children:[(0,p.jsx)(jn.I,{as:pe.YXz,mr:2}),"Hr\xe1\u010di"]}),(0,p.jsx)(Qt.E,{colorScheme:"green",fontSize:"md",children:v.players.length})]}),(0,p.jsx)(Tt.r,{columns:{base:2,md:4,lg:6},spacing:4,children:v.players.slice(0,6).map(e=>(0,p.jsxs)(At.B,{as:d.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:V,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[(0,p.jsx)(k._,{src:W(e.image_url)||"/logo512.png",alt:e.title,objectFit:"cover",w:"100%",h:"140px"}),(0,p.jsxs)(w.T,{p:2,spacing:1,align:"start",children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"xs",noOfLines:1,children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.subtitle})]})]},e.id))}),v.players.length>6&&(0,p.jsxs)(T.$,{mt:3,size:"sm",onClick:()=>_("players"),children:["Zobrazit v\u0161ech ",v.players.length," hr\xe1\u010d\u016f"]})]}),v.matches.length+v.matchesPast.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"md",children:"Z\xe1pasy"}),(0,p.jsx)(Qt.E,{colorScheme:"purple",fontSize:"md",children:v.matches.length+v.matchesPast.length})]}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:v.matches.slice(0,3).map(e=>{var t,n;return(0,p.jsxs)(Q.s,{p:3,bg:V,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:2,children:[(0,p.jsxs)(ee.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.home_logo_url,alt:"",boxSize:"24px",objectFit:"contain"}),(0,p.jsx)(U.E,{fontSize:"sm",fontWeight:"medium",children:Y(e.title,o)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.away_logo_url,alt:"",boxSize:"24px",objectFit:"contain"})]}),e.date&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[e.date," ",e.time]})]},e.id)})}),v.matches.length+v.matchesPast.length>3&&(0,p.jsx)(T.$,{mt:3,size:"sm",onClick:()=>_("matches"),children:"Zobrazit v\u0161echny z\xe1pasy"})]}),v.articles.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsx)(z.D,{size:"md",children:"\u010cl\xe1nky"}),(0,p.jsx)(Qt.E,{colorScheme:"teal",fontSize:"md",children:v.articles.length})]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:4,children:v.articles.slice(0,6).map(e=>(0,p.jsxs)(At.B,{as:d.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:V,_hover:{boxShadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:[e.image_url&&(0,p.jsx)(k._,{src:e.image_url,alt:e.title,objectFit:"cover",w:"100%",h:"140px"}),(0,p.jsxs)(w.T,{p:3,spacing:2,align:"start",children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",noOfLines:2,children:Y(e.title,o)}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",noOfLines:2,children:Y(e.description,o)})]})]},e.id))}),v.articles.length>6&&(0,p.jsxs)(T.$,{mt:3,size:"sm",onClick:()=>_("articles"),children:["Zobrazit v\u0161ech ",v.articles.length," \u010dl\xe1nk\u016f"]})]}),v.events.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(ee.z,{justify:"space-between",mb:4,children:[(0,p.jsxs)(z.D,{size:"md",children:[(0,p.jsx)(jn.I,{as:pe.itz,mr:2}),"Akce"]}),(0,p.jsx)(Qt.E,{colorScheme:"orange",fontSize:"md",children:v.events.length})]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:v.events.slice(0,4).map(e=>(0,p.jsxs)(Q.s,{p:3,bg:V,borderWidth:"1px",borderRadius:"md",gap:2,children:[(0,p.jsx)(jn.I,{as:pe.itz,boxSize:5,color:"orange.400",mt:1}),(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:Y(e.title,o)}),e.description&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.600",noOfLines:2,children:Y(e.description,o)}),e.date&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[e.date," ",e.time]})]})]},e.id))}),v.events.length>4&&(0,p.jsx)(T.$,{mt:3,size:"sm",onClick:()=>_("events"),children:"Zobrazit v\u0161echny akce"})]})]})}),(0,p.jsx)(da.K,{px:0,children:J.length>0?(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:J.map(e=>(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",align:"center",gap:3,children:[e.logo_url&&(0,p.jsx)(k._,{src:e.logo_url,alt:e.title,boxSize:"60px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))}):(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 kluby nenalezeny"})}),(0,p.jsx)(da.K,{px:0,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:6,children:[v.matches.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:v.matches.map(e=>{var t,n;return(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:3,children:[(0,p.jsxs)(ee.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.home_logo_url,alt:"",boxSize:"32px",objectFit:"contain"}),(0,p.jsx)(U.E,{fontWeight:"medium",children:Y(e.title,o)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.away_logo_url,alt:"",boxSize:"32px",objectFit:"contain"})]}),(0,p.jsxs)(ee.z,{gap:2,children:[e.date&&(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:[e.date," ",e.time]}),e.subtitle&&(0,p.jsx)(Qt.E,{children:Y(e.subtitle,o)})]})]},e.id)})})]}),v.matchesPast.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"Minul\xe9 z\xe1pasy"}),(0,p.jsx)(w.T,{align:"stretch",spacing:3,children:v.matchesPast.map(e=>{var t,n;return(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:3,children:[(0,p.jsxs)(ee.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.home_logo_url,alt:"",boxSize:"32px",objectFit:"contain"}),(0,p.jsx)(U.E,{fontWeight:"medium",children:Y(e.title,o)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,p.jsx)(k._,{src:e.metadata.away_logo_url,alt:"",boxSize:"32px",objectFit:"contain"})]}),(0,p.jsxs)(ee.z,{gap:2,children:[e.date&&(0,p.jsxs)(U.E,{fontSize:"sm",color:"gray.500",children:[e.date," ",e.time]}),e.subtitle&&(0,p.jsx)(Qt.E,{children:Y(e.subtitle,o)})]})]},e.id)})})]}),0===v.matches.length&&0===v.matchesPast.length&&(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 z\xe1pasy nenalezeny"})]})}),(0,p.jsx)(da.K,{px:0,children:v.articles.length>0?(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:4,children:v.articles.map(e=>(0,p.jsxs)(At.B,{as:d.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:V,_hover:{boxShadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:[e.image_url&&(0,p.jsx)(k._,{src:e.image_url,alt:e.title,objectFit:"cover",w:"100%",h:"160px"}),(0,p.jsxs)(w.T,{p:4,spacing:2,align:"start",children:[(0,p.jsx)(U.E,{fontWeight:"bold",noOfLines:2,children:Y(e.title,o)}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",noOfLines:3,children:Y(e.description,o)})]})]},e.id))}):(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 \u010dl\xe1nky nenalezeny"})}),(0,p.jsx)(da.K,{px:0,children:v.players.length>0?(0,p.jsx)(Tt.r,{columns:{base:2,md:3,lg:4},spacing:4,children:v.players.map(e=>{var t;return(0,p.jsxs)(At.B,{as:d.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:V,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[(0,p.jsx)(k._,{src:W(e.image_url)||"/logo512.png",alt:e.title,objectFit:"cover",w:"100%",h:"200px"}),(0,p.jsxs)(w.T,{p:3,spacing:1,align:"start",children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:e.subtitle}),(null===(t=e.metadata)||void 0===t?void 0:t.jersey_number)&&(0,p.jsxs)(Qt.E,{colorScheme:"blue",children:["#",e.metadata.jersey_number]})]})]},e.id)})}):(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xed hr\xe1\u010di nenalezeni"})}),(0,p.jsx)(da.K,{px:0,children:v.events.length>0?(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:v.events.map(e=>{var t;return(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",gap:3,children:[(0,p.jsx)(jn.I,{as:pe.itz,boxSize:8,color:"orange.400"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:Y(e.title,o)}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:Y(e.description,o)}),(0,p.jsxs)(ee.z,{fontSize:"sm",color:"gray.500",spacing:3,children:[e.date&&(0,p.jsxs)(U.E,{children:[e.date," ",e.time]}),(null===(t=e.metadata)||void 0===t?void 0:t.location)&&(0,p.jsxs)(ee.z,{spacing:1,children:[(0,p.jsx)(jn.I,{as:pe.vq8}),(0,p.jsx)(U.E,{children:e.metadata.location})]})]})]})]},e.id)})}):(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 akce nenalezeny"})}),(0,p.jsx)(da.K,{px:0,children:(0,p.jsxs)(w.T,{align:"stretch",spacing:8,children:[v.teams.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{size:"sm",mb:3,children:"T\xfdmy"}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:v.teams.map(e=>(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",gap:3,children:[e.logo_url&&(0,p.jsx)(k._,{src:e.logo_url,alt:e.title,boxSize:"48px",objectFit:"contain"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))})]}),v.sponsors.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(z.D,{size:"sm",mb:3,children:[(0,p.jsx)(jn.I,{as:pe.DDN,mr:2}),"Sponzo\u0159i"]}),(0,p.jsx)(Tt.r,{columns:{base:2,md:4},spacing:4,children:v.sponsors.map(e=>(0,p.jsx)(Q.s,{as:e.url?L.N:void 0,href:e.url,isExternal:!!e.url,p:4,bg:V,borderWidth:"1px",borderRadius:"md",align:"center",justify:"center",children:e.logo_url?(0,p.jsx)(k._,{src:e.logo_url,alt:e.title,maxH:"60px",maxW:"100%",objectFit:"contain"}):(0,p.jsx)(U.E,{fontWeight:"medium",children:Y(e.title,o)})},e.id))})]}),v.contacts.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(z.D,{size:"sm",mb:3,children:[(0,p.jsx)(jn.I,{as:pe.maD,mr:2}),"Kontakty"]}),(0,p.jsx)(Tt.r,{columns:{base:1,md:2},spacing:4,children:v.contacts.map(e=>{var t,n;return(0,p.jsxs)(Q.s,{p:4,bg:V,borderWidth:"1px",borderRadius:"md",gap:3,children:[e.image_url?(0,p.jsx)(k._,{src:e.image_url,alt:e.title,boxSize:"50px",borderRadius:"full",objectFit:"cover"}):(0,p.jsx)(jn.I,{as:pe.YXz,boxSize:10,color:"gray.400"}),(0,p.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,p.jsx)(U.E,{fontWeight:"bold",children:Y(e.title,o)}),e.subtitle&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",children:e.subtitle}),(null===(t=e.metadata)||void 0===t?void 0:t.email)&&(0,p.jsxs)(ee.z,{fontSize:"xs",color:"gray.500",children:[(0,p.jsx)(jn.I,{as:pe.maD}),(0,p.jsx)(U.E,{children:e.metadata.email})]}),(null===(n=e.metadata)||void 0===n?void 0:n.phone)&&(0,p.jsxs)(ee.z,{fontSize:"xs",color:"gray.500",children:[(0,p.jsx)(jn.I,{as:pe.Cab}),(0,p.jsx)(U.E,{children:e.metadata.phone})]})]})]},e.id)})})]}),v.gallery.length>0&&(0,p.jsxs)(y.a,{children:[(0,p.jsxs)(z.D,{size:"sm",mb:3,children:[(0,p.jsx)(jn.I,{as:pe.dkL,mr:2}),"Galerie"]}),(0,p.jsx)(Tt.r,{columns:{base:2,md:3,lg:4},spacing:4,children:v.gallery.map(e=>{var t;return(0,p.jsxs)(At.B,{as:d.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:V,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[e.image_url&&(0,p.jsx)(k._,{src:e.image_url,alt:e.title,objectFit:"cover",w:"100%",h:"120px"}),(0,p.jsxs)(w.T,{p:3,spacing:1,align:"start",children:[(0,p.jsx)(U.E,{fontWeight:"bold",fontSize:"sm",noOfLines:1,children:Y(e.title,o)}),(null===(t=e.metadata)||void 0===t?void 0:t.photo_count)&&(0,p.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:[e.metadata.photo_count," fotek"]})]})]},e.id)})})]}),0===v.teams.length&&0===v.sponsors.length&&0===v.contacts.length&&0===v.gallery.length&&(0,p.jsx)(U.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 dal\u0161\xed v\xfdsledky"})]})})]})]})]}),(0,p.jsx)(Qa,{}),(0,p.jsx)(Vt,{})]})})},Ic=()=>{const{code:e}=(0,c.g)();return(0,a.useEffect)(()=>{if(e)try{const t=new URL(m.API_URL,"undefined"!==typeof window?window.location.origin:void 0).origin,n="".concat(t,"/s/").concat(e);window.location.replace(n)}catch(t){window.location.href="/s/".concat(e)}},[e]),(0,p.jsx)(f.o,{minH:"60vh",children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsx)(zn.y,{}),(0,p.jsx)(U.E,{children:"P\u0159esm\u011brov\xe1n\xed\u2026"})]})})},Wc=()=>{const[e,t]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),o=(0,b.dU)("white","gray.800"),r=(0,b.dU)("gray.200","gray.700");return(0,a.useEffect)(()=>{(async()=>{try{const e=await fn();t(e)}catch(e){console.error("Failed to fetch clothing items:",e)}finally{i(!1)}})()},[]),n?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsx)(f.o,{minH:"50vh",children:(0,p.jsx)(zn.y,{size:"xl",color:"blue.500"})})})}):(0,p.jsxs)(Ht,{children:[(0,p.jsxs)(ii.mg,{children:[(0,p.jsx)("title",{children:"Oble\u010den\xed a Fan Shop"}),(0,p.jsx)("meta",{name:"description",content:"Podpo\u0159te sv\u016fj t\xfdm! Oble\u010den\xed, dresy a merchandise na\u0161eho klubu."})]}),(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsxs)(y.a,{children:[(0,p.jsx)(z.D,{as:"h1",size:"xl",mb:3,children:"Oble\u010den\xed a Fan Shop"}),(0,p.jsx)(U.E,{fontSize:"lg",color:"gray.600",children:"Podpo\u0159te sv\u016fj t\xfdm! Prohl\xe9dn\u011bte si na\u0161i nab\xeddku dres\u016f, tri\u010dek a dal\u0161\xedho merchandisingu."})]}),0===e.length?(0,p.jsx)(f.o,{minH:"40vh",children:(0,p.jsxs)(w.T,{spacing:3,children:[(0,p.jsx)(U.E,{fontSize:"lg",color:"gray.500",children:"Zat\xedm zde nejsou \u017e\xe1dn\xe9 polo\u017eky."}),(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.400",children:"Brzy zde najdete na\u0161e oble\u010den\xed a merchandise."})]})}):(0,p.jsx)(Tt.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:6,children:e.map(e=>(0,p.jsx)(L.N,{href:e.url||"#",isExternal:!!e.url,_hover:{textDecoration:"none"},role:"group",children:(0,p.jsxs)(y.a,{bg:o,borderWidth:"1px",borderColor:r,borderRadius:"xl",overflow:"hidden",transition:"all 0.3s",_groupHover:{transform:"translateY(-4px)",boxShadow:"lg"},children:[(0,p.jsxs)(y.a,{position:"relative",paddingTop:"100%",overflow:"hidden",children:[(0,p.jsx)(k._,{src:e.image_url,alt:e.title,position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",fallbackSrc:"/images/placeholder-clothing.jpg"}),e.url&&(0,p.jsx)(y.a,{position:"absolute",top:2,right:2,bg:"white",borderRadius:"full",p:2,opacity:0,_groupHover:{opacity:1},transition:"opacity 0.2s",children:(0,p.jsx)(q.HaR,{size:16})})]}),(0,p.jsxs)(w.T,{align:"stretch",p:4,spacing:2,children:[(0,p.jsx)(z.D,{as:"h3",size:"sm",noOfLines:2,children:e.title}),e.description&&(0,p.jsx)(U.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:e.description}),(0,p.jsxs)(ee.z,{justify:"space-between",mt:2,children:[e.price&&e.price>0?(0,p.jsxs)(Qt.E,{colorScheme:"blue",fontSize:"md",px:2,py:1,children:[e.price," ",e.currency||"K\u010d"]}):(0,p.jsx)(y.a,{}),e.url&&(0,p.jsx)(U.E,{fontSize:"xs",color:"blue.500",children:"Zobrazit \u2192"})]})]})]})},e.id))})]})})]})},Mc=()=>{const[e,t]=(0,a.useState)(0),n=(0,b.dU)("white","gray.800"),{data:i,isLoading:o}=(0,xe.I)({queryKey:["polls"],queryFn:()=>wn(),staleTime:12e4}),{data:r,isLoading:s}=(0,xe.I)({queryKey:["polls-details",null===i||void 0===i?void 0:i.map(e=>e.id)],queryFn:async()=>{if(!i||0===i.length)return[];const e=i.map(e=>_n(e.id));return await Promise.all(e)},enabled:!!i&&i.length>0}),l=(null===r||void 0===r?void 0:r.filter(e=>e.poll.featured))||[],c=(null===r||void 0===r?void 0:r.filter(e=>e.is_active))||[],d=r||[];return o||s?(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:4,children:[(0,p.jsx)(zn.y,{size:"xl"}),(0,p.jsx)(U.E,{children:"Na\u010d\xedt\xe1n\xed anket..."})]})})}):i&&0!==i.length?(0,p.jsx)(Ht,{children:(0,p.jsx)(y.a,{bg:n,minH:"100vh",children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:8,align:"stretch",children:[(0,p.jsxs)(w.T,{spacing:2,align:"start",children:[(0,p.jsx)(z.D,{size:"xl",children:"Ankety a hlasov\xe1n\xed"}),(0,p.jsx)(U.E,{color:"gray.600",children:"Hlasujte v anket\xe1ch a pod\u011blte se o sv\u016fj n\xe1zor s ostatn\xedmi fanou\u0161ky!"})]}),(0,p.jsxs)(ra.t,{index:e,onChange:t,colorScheme:"blue",children:[(0,p.jsxs)(sa.w,{children:[(0,p.jsxs)(la.o,{children:["V\u0161echny",d.length>0&&(0,p.jsx)(Qt.E,{ml:2,colorScheme:"blue",children:d.length})]}),(0,p.jsxs)(la.o,{children:["Aktivn\xed",c.length>0&&(0,p.jsx)(Qt.E,{ml:2,colorScheme:"green",children:c.length})]}),l.length>0&&(0,p.jsxs)(la.o,{children:["Zv\xfdrazn\u011bn\xe9",(0,p.jsx)(Qt.E,{ml:2,colorScheme:"purple",children:l.length})]})]}),(0,p.jsxs)(ca.T,{children:[(0,p.jsx)(da.K,{children:(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:d.map(e=>(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))})}),(0,p.jsx)(da.K,{children:c.length>0?(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:c.map(e=>(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))}):(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),"Moment\xe1ln\u011b nejsou k dispozici \u017e\xe1dn\xe9 aktivn\xed ankety."]})}),l.length>0&&(0,p.jsx)(da.K,{children:(0,p.jsx)(Tt.r,{columns:{base:1,md:2,lg:3},spacing:6,children:l.map(e=>(0,p.jsx)(Fn,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))})})]})]})]})})})}):(0,p.jsx)(Ht,{children:(0,p.jsx)(Z.m,{maxW:"7xl",py:8,children:(0,p.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,p.jsx)(z.D,{size:"xl",children:"Ankety a hlasov\xe1n\xed"}),(0,p.jsxs)(xa.F,{status:"info",children:[(0,p.jsx)(ga._,{}),"Moment\xe1ln\u011b nejsou k dispozici \u017e\xe1dn\xe9 ankety. Brzy p\u0159id\xe1me nov\xe9!"]})]})})})},Dc=new s.E({defaultOptions:{queries:{staleTime:3e5,cacheTime:6e5,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}}),Uc=(0,o.oY)({config:{initialColorMode:"light",useSystemColorMode:!1},colors:{brand:{50:"#e6f7ff",100:"#b3e0ff",200:"#80caff",300:"#4db3ff",400:"#1a9cff",500:"var(--club-primary, #0b5cff)",600:"#0066cc",700:"#004d99",800:"#003366",900:"#001a33"}},semanticTokens:{colors:{"brand.primary":{default:"var(--club-primary, #0b5cff)"},"brand.secondary":{default:"var(--club-secondary, #ffd200)"},"brand.accent":{default:"var(--club-accent, #141414)"},"text.onPrimary":{default:"var(--club-text-on-primary, #ffffff)"},"bg.app":{default:"#f8f9fb",_dark:"#0f1115"},"text.app":{default:"#1a1a1a",_dark:"#e8eaf0"},"border.subtle":{default:"rgba(0,0,0,0.06)",_dark:"rgba(255,255,255,0.12)"},"bg.card":{default:"#ffffff",_dark:"#1a1d29"},"bg.elevated":{default:"#ffffff",_dark:"#242831"}}},styles:{global:{"html, body, #root":{height:"100%",fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},body:{bg:"bg.app",color:"text.app",lineHeight:1.5,fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},"h1, h2, h3, h4, h5, h6":{fontFamily:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},a:{transition:"color 0.2s ease"},"::selection":{background:"brand.accent",color:"black"}}},components:{Container:{baseStyle:{px:{base:4,md:6}},sizes:{"7xl":"88rem"}},Button:{baseStyle:{fontWeight:"700",borderRadius:"md",letterSpacing:"0.4px",_hover:{transform:"translateY(-1px)",boxShadow:"md"},_active:{transform:"translateY(0)"}},variants:{solid:{bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"}},outline:{border:"2px solid",borderColor:"brand.primary",color:"brand.primary",_hover:{bg:"rgba(0,0,0,0.02)"}},ghost:{color:"brand.secondary",_hover:{bg:"rgba(0,0,0,0.04)"}}}},Card:{baseStyle:{container:{borderRadius:"lg",boxShadow:"sm",overflow:"hidden",transition:"all 0.2s",borderWidth:"1px",borderColor:"border.subtle",_hover:{transform:"translateY(-4px)",boxShadow:"lg"}}}},Divider:{baseStyle:{borderColor:"border.subtle"}},Heading:{baseStyle:{fontFamily:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}},Text:{baseStyle:{fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}}},fonts:{heading:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)",body:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}}),Lc=()=>(Ln(),null),Fc=()=>((()=>{const{data:e}=ge();(0,a.useEffect)(()=>{const t=(null===e||void 0===e?void 0:e.font_heading)||(null===e||void 0===e?void 0:e.font_body);let a;t&&(a=(0,ka.QY)(t),!a)&&(a=n(9483).qE.find(e=>e.heading===t||e.body===t||e.id===t)),a||(a=(0,ka.Tu)()),(0,ka.Iu)(a)},[null===e||void 0===e?void 0:e.font_heading,null===e||void 0===e?void 0:e.font_body])})(),null),Oc=()=>{const e=(0,c.zy)();return(0,p.jsx)(c.C5,{to:"/blog".concat(e.search||""),replace:!0})},Zc=()=>{const e=e=>{let{children:t}=e;const{isAuthenticated:n,isLoading:i,user:o}=v(),[r,s]=(0,a.useState)(!0),[l,d]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await Zl();e&&d(!!t.requires_setup)}catch(t){e&&d(!1)}finally{e&&s(!1)}})(),()=>{e=!1}},[]),i||r)return(0,p.jsx)("div",{children:"Na\u010d\xedt\xe1n\xed\u2026"});if(n){const e=String((null===o||void 0===o?void 0:o.role)||"").toLowerCase();return"admin"===e||"editor"===e?(0,p.jsx)(c.C5,{to:"/admin",replace:!0}):"fan"===e?(0,p.jsx)(c.C5,{to:"/semiadmin",replace:!0}):(0,p.jsx)(c.C5,{to:"/",replace:!0})}const h=window.location.pathname;return l&&"/setup"!==h?(0,p.jsx)(c.C5,{to:"/setup",replace:!0}):(0,p.jsx)(p.Fragment,{children:t})},t=()=>(0,p.jsx)(c.sv,{});return(0,p.jsx)(r.s,{theme:Uc,children:(0,p.jsx)(l.Ht,{client:Dc,children:(0,p.jsx)(d.Kd,{children:(0,p.jsx)(g,{children:(0,p.jsxs)(Ge,{children:[(0,p.jsx)(Lc,{}),(0,p.jsx)(Fc,{}),(0,p.jsx)(uc,{}),(0,p.jsxs)(c.BV,{children:[(0,p.jsx)(c.qh,{path:"/",element:(0,p.jsx)(Ja,{})}),(0,p.jsx)(c.qh,{path:"/hledat",element:(0,p.jsx)(Pc,{})}),(0,p.jsx)(c.qh,{path:"/search",element:(0,p.jsx)(Pc,{})}),(0,p.jsx)(c.qh,{path:"/overlay/scoreboard",element:(0,p.jsx)(lc,{})}),(0,p.jsx)(c.qh,{path:"/blog",element:(0,p.jsx)(ti,{})}),(0,p.jsx)(c.qh,{path:"/klub",element:(0,p.jsx)(zi,{})}),(0,p.jsx)(c.qh,{path:"/o-klubu",element:(0,p.jsx)(Gl,{})}),(0,p.jsx)(c.qh,{path:"/kalendar",element:(0,p.jsx)(Di,{})}),(0,p.jsx)(c.qh,{path:"/aktivity",element:(0,p.jsx)(bo,{})}),(0,p.jsx)(c.qh,{path:"/tabulky",element:(0,p.jsx)(Vi,{})}),(0,p.jsx)(c.qh,{path:"/zapasy",element:(0,p.jsx)(Hi,{})}),(0,p.jsx)(c.qh,{path:"/players",element:(0,p.jsx)($i,{})}),(0,p.jsx)(c.qh,{path:"/hraci",element:(0,p.jsx)($i,{})}),(0,p.jsx)(c.qh,{path:"/players/:id",element:(0,p.jsx)(Ji,{})}),(0,p.jsx)(c.qh,{path:"/hraci/:id",element:(0,p.jsx)(Ji,{})}),(0,p.jsx)(c.qh,{path:"/sponzori",element:(0,p.jsx)(Yi,{})}),(0,p.jsx)(c.qh,{path:"/kontakt",element:(0,p.jsx)(ao,{})}),(0,p.jsx)(c.qh,{path:"/ankety",element:(0,p.jsx)(Mc,{})}),(0,p.jsx)(c.qh,{path:"/galerie",element:(0,p.jsx)(oo,{})}),(0,p.jsx)(c.qh,{path:"/galerie/album/:id",element:(0,p.jsx)(ho,{})}),(0,p.jsx)(c.qh,{path:"/videa",element:(0,p.jsx)(kc,{})}),(0,p.jsx)(c.qh,{path:"/obleceni",element:(0,p.jsx)(Wc,{})}),(0,p.jsx)(c.qh,{path:"/pravidla-cookies",element:(0,p.jsx)(rc,{})}),(0,p.jsx)(c.qh,{path:"/obchodni-podminky",element:(0,p.jsx)(pc,{})}),(0,p.jsx)(c.qh,{path:"/zasady-ochrany-osobnich-udaju",element:(0,p.jsx)(xc,{})}),(0,p.jsx)(c.qh,{path:"/s/:code",element:(0,p.jsx)(Ic,{})}),(0,p.jsx)(c.qh,{path:"/news",element:(0,p.jsx)(Oc,{})}),(0,p.jsx)(c.qh,{path:"/news/:slug",element:(0,p.jsx)(li,{})}),(0,p.jsx)(c.qh,{path:"/articles/slug/:slug",element:(0,p.jsx)(li,{})}),(0,p.jsx)(c.qh,{path:"/articles/:id",element:(0,p.jsx)(li,{})}),(0,p.jsx)(c.qh,{path:"/zapas/:id",element:(0,p.jsx)(ki,{})}),(0,p.jsx)(c.qh,{path:"/aktivita/:id",element:(0,p.jsx)(vi,{})}),(0,p.jsx)(c.qh,{path:"/clanky",element:(0,p.jsx)(c.C5,{to:"/blog",replace:!0})}),(0,p.jsx)(c.qh,{path:"/aktuality",element:(0,p.jsx)(c.C5,{to:"/blog",replace:!0})}),(0,p.jsx)(c.qh,{path:"/setup",element:(0,p.jsx)(e,{children:(0,p.jsx)(Vl,{})})}),(0,p.jsx)(c.qh,{path:"/setup/styl",element:(0,p.jsx)(e,{children:(0,p.jsx)(Bl,{})})}),(0,p.jsx)(c.qh,{path:"/login",element:(0,p.jsx)(e,{children:(0,p.jsx)(D,{})})}),(0,p.jsx)(c.qh,{path:"/register",element:(0,p.jsx)(e,{children:(0,p.jsx)(F,{})})}),(0,p.jsx)(c.qh,{path:"/forgot-password",element:(0,p.jsx)(mo,{})}),(0,p.jsx)(c.qh,{path:"/reset-password",element:(0,p.jsx)(po,{})}),(0,p.jsx)(c.qh,{path:"/newsletter/unsubscribe/:email",element:(0,p.jsx)(ic,{})}),(0,p.jsx)(c.qh,{path:"/newsletter/preferences",element:(0,p.jsx)(oc,{})}),(0,p.jsx)(c.qh,{path:"/semiadmin",element:(0,p.jsx)(mc,{children:(0,p.jsx)(Ul,{})})}),(0,p.jsx)(c.qh,{path:"/403",element:(0,p.jsx)(vc,{})}),(0,p.jsxs)(c.qh,{element:(0,p.jsx)(mc,{requiredRole:"admin",children:(0,p.jsx)(t,{})}),children:[(0,p.jsx)(c.qh,{path:"/admin",element:(0,p.jsx)(kr,{})}),(0,p.jsx)(c.qh,{path:"/admin/docs",element:(0,p.jsx)(Xl,{})}),(0,p.jsx)(c.qh,{path:"/admin/o-klubu",element:(0,p.jsx)(wl,{})}),(0,p.jsx)(c.qh,{path:"/admin/videa",element:(0,p.jsx)(ul,{})}),(0,p.jsx)(c.qh,{path:"/admin/galerie",element:(0,p.jsx)(xl,{})}),(0,p.jsx)(c.qh,{path:"/admin/obleceni",element:(0,p.jsx)(kl,{})}),(0,p.jsx)(c.qh,{path:"/admin/sponzori",element:(0,p.jsx)(js,{})}),(0,p.jsx)(c.qh,{path:"/admin/kategorie",element:(0,p.jsx)(ys,{})}),(0,p.jsx)(c.qh,{path:"/admin/zapasy",element:(0,p.jsx)(Ts,{})}),(0,p.jsx)(c.qh,{path:"/admin/hraci",element:(0,p.jsx)(Ns,{})}),(0,p.jsx)(c.qh,{path:"/admin/tymy",element:(0,p.jsx)(Rs,{})}),(0,p.jsx)(c.qh,{path:"/admin/uzivatele",element:(0,p.jsx)(al,{})}),(0,p.jsx)(c.qh,{path:"/admin/bannery",element:(0,p.jsx)(Is,{})}),(0,p.jsx)(c.qh,{path:"/admin/zpravy",element:(0,p.jsx)(Gs,{})}),(0,p.jsx)(c.qh,{path:"/admin/nastaveni",element:(0,p.jsx)(nl,{})}),(0,p.jsx)(c.qh,{path:"/admin/newsletter",element:(0,p.jsx)(ol,{})}),(0,p.jsx)(c.qh,{path:"/admin/ankety",element:(0,p.jsx)(Fl,{})}),(0,p.jsx)(c.qh,{path:"/admin/aliasy-soutezi",element:(0,p.jsx)(rl,{})}),(0,p.jsx)(c.qh,{path:"/admin/prefetch",element:(0,p.jsx)(dl,{})}),(0,p.jsx)(c.qh,{path:"/admin/users/send-reset",element:(0,p.jsx)(zl,{})}),(0,p.jsx)(c.qh,{path:"/admin/scoreboard",element:(0,p.jsx)(tc,{})}),(0,p.jsx)(c.qh,{path:"/admin/scoreboard/remote",element:(0,p.jsx)(nc,{})}),(0,p.jsx)(c.qh,{path:"/admin/analytika",element:(0,p.jsx)(Sl,{})}),(0,p.jsx)(c.qh,{path:"/admin/shortlinks",element:(0,p.jsx)(Dl,{})}),(0,p.jsx)(c.qh,{path:"/admin/soubory",element:(0,p.jsx)(Al,{})}),(0,p.jsx)(c.qh,{path:"/admin/kontakty",element:(0,p.jsx)(Tl,{})}),(0,p.jsx)(c.qh,{path:"/admin/navigace",element:(0,p.jsx)(Ml,{})})]}),(0,p.jsx)(c.qh,{path:"/dashboard",element:(0,p.jsx)(c.C5,{to:"/admin",replace:!0})}),(0,p.jsx)(c.qh,{path:"/admin/sponsors",element:(0,p.jsx)(mc,{requiredRole:"admin",children:(0,p.jsx)(js,{})})}),(0,p.jsx)(c.qh,{path:"/admin/banners",element:(0,p.jsx)(mc,{requiredRole:"admin",children:(0,p.jsx)(Is,{})})}),(0,p.jsx)(c.qh,{path:"/admin/messages",element:(0,p.jsx)(mc,{requiredRole:"admin",children:(0,p.jsx)(Gs,{})})}),(0,p.jsx)(c.qh,{path:"/admin/settings",element:(0,p.jsx)(mc,{requiredRole:"admin",children:(0,p.jsx)(nl,{})})}),(0,p.jsx)(c.qh,{path:"/admin/clanky",element:(0,p.jsx)(mc,{requiredRole:"editor",children:(0,p.jsx)(vs,{})})}),(0,p.jsx)(c.qh,{path:"/admin/aktivity",element:(0,p.jsx)(mc,{requiredRole:"editor",children:(0,p.jsx)(yl,{})})}),(0,p.jsx)(c.qh,{path:"/admin/media",element:(0,p.jsx)(mc,{requiredRole:"editor",children:(0,p.jsx)(As,{})})}),(0,p.jsx)(c.qh,{path:"*",element:(0,p.jsx)(bc,{})})]}),(0,p.jsx)(hc,{})]})})})})})};var Kc=n(8025);const qc=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,6453)).then(t=>{let{getCLS:n,getFID:a,getFCP:i,getLCP:o,getTTFB:r}=t;n(e),a(e),i(e),o(e),r(e)})};class Vc extends a.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("Error caught by ErrorBoundary:",e,t)}render(){return this.state.hasError?(0,p.jsxs)("div",{style:{padding:"20px",fontFamily:"Arial, sans-serif"},children:[(0,p.jsx)("h2",{children:"Something went wrong."}),(0,p.jsx)("p",{children:"Please refresh the page or try again later."})]}):this.props.children}}window.addEventListener("unhandledrejection",e=>{});const Hc=document.getElementById("root");if(Hc)try{var $c,Bc,Jc,Yc,Gc,Xc,Qc,ed;const e=document.documentElement;let t=null;try{const e=localStorage.getItem("club_theme_cache");if(e){t=JSON.parse(e);Date.now()-(t.timestamp||0)>864e5&&(t=null)}}catch(nd){}e.style.setProperty("--club-primary",(null===($c=t)||void 0===$c?void 0:$c.primary)||"#0b5cff"),e.style.setProperty("--club-secondary",(null===(Bc=t)||void 0===Bc?void 0:Bc.secondary)||"#ffd200"),e.style.setProperty("--club-accent",(null===(Jc=t)||void 0===Jc?void 0:Jc.accent)||"#141414"),e.style.setProperty("--club-text-on-primary",(null===(Yc=t)||void 0===Yc?void 0:Yc.textOnPrimary)||"#ffffff"),null!==(Gc=t)&&void 0!==Gc&&Gc.textOnSecondary&&e.style.setProperty("--club-text-on-secondary",t.textOnSecondary),null!==(Xc=t)&&void 0!==Xc&&Xc.textOnAccent&&e.style.setProperty("--club-text-on-accent",t.textOnAccent),e.style.setProperty("--club-bg-light",(null===(Qc=t)||void 0===Qc?void 0:Qc.background)||"#ffffff"),e.style.setProperty("--club-text-light",(null===(ed=t)||void 0===ed?void 0:ed.text)||"#000000");const n=document.createElement("link");n.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap",n.rel="stylesheet",document.head.appendChild(n);i.createRoot(document.getElementById("root")).render((0,p.jsx)(a.StrictMode,{children:(0,p.jsx)(Vc,{children:(0,p.jsxs)(ii.vd,{children:[(0,p.jsx)(Kc.m,{initialColorMode:Uc.config.initialColorMode}),(0,p.jsx)(Zc,{})]})})}));const o=(()=>{try{const e=localStorage.getItem("cookie_consent");return e?JSON.parse(e):null}catch(e){return null}})();null!==o&&void 0!==o&&o.analytics,td=e=>{null!==e&&void 0!==e&&e.analytics},window.addEventListener("cookie-consent-change",e=>{const t=e.detail;td(t||{})})}catch(ad){Hc.innerHTML='\n <div style="padding: 20px; font-family: Arial, sans-serif; color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px;">\n <h2>Application Error</h2>\n <p>'.concat(String(ad),"</p>\n <p>Please check the console for more details and refresh the page.</p>\n </div>\n ")}else;var td;qc()},1860:(e,t,n)=>{n.d(t,{Ec:()=>d,L:()=>s,WG:()=>r,aK:()=>c,gf:()=>o,wR:()=>l});const a="auth_token",i="fotbal_club_has_admin",o=()=>{try{var e;return null!==(e=localStorage.getItem(a))&&void 0!==e?e:sessionStorage.getItem(a)}catch(t){return null}},r=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{localStorage.removeItem(a)}catch(n){}try{sessionStorage.removeItem(a)}catch(i){}if(t)try{localStorage.setItem(a,e)}catch(o){}else try{sessionStorage.setItem(a,e)}catch(r){}},s=()=>{try{localStorage.removeItem(a)}catch(e){}try{sessionStorage.removeItem(a)}catch(t){}},l=()=>!!o(),c=e=>{localStorage.setItem(i,String(e))},d=async()=>{try{const{API_URL:t}=await Promise.resolve().then(n.bind(n,6291)),a=await fetch("".concat(t,"/auth/admin/exists"),{headers:{Accept:"application/json"}});if(a.ok){var e;const t=await a.json(),n=Boolean(t&&(null!==(e=t.hasAdmin)&&void 0!==e?e:t.has_admin));return c(n),n}return!1}catch(t){return console.error("Error checking admin status:",t),!1}}},3200:(e,t,n)=>{n.r(t),n.d(t,{adminSendSmtpTest:()=>s,deleteSubscriber:()=>x,getEmailEventsForLog:()=>p,getNewsletterStatus:()=>c,getNewsletterSubscribers:()=>i,getRecentEmailStats:()=>m,previewNewsletter:()=>u,sendNewsletter:()=>o,sendNewsletterDigest:()=>d,sendNewsletterTest:()=>r,sendNewsletterTestAdvanced:()=>l,setNewsletterAutomation:()=>h,toggleSubscriberStatus:()=>g,updateSubscriberPreferences:()=>v});var a=n(6291);const i=async()=>(await a.FH.get("/admin/newsletter/subscribers")).data,o=async e=>(await a.FH.post("/admin/newsletter/send",{subject:e.subject,content:e.content},{timeout:6e4})).data,r=async e=>{const t=e?{email:e}:{};return(await a.FH.post("/admin/newsletter/test",t,{timeout:6e4})).data},s=async e=>(await a.FH.post("/admin/newsletter/smtp-test",e,{timeout:6e4})).data,l=async e=>(await a.FH.post("/admin/newsletter/test",e,{timeout:6e4})).data,c=async()=>(await a.FH.get("/admin/newsletter/status")).data,d=async(e,t)=>(await a.FH.post("/admin/newsletter/send-digest",{type:e,competitions:t})).data,h=async e=>(await a.FH.patch("/admin/newsletter/enable",{enabled:e})).data,u=async e=>(await a.FH.post("/admin/newsletter/preview",e)).data,m=async()=>{var e;return(null===(e=(await a.FH.get("/admin/newsletter/stats/recent")).data)||void 0===e?void 0:e.data)||[]},p=async e=>{var t;return(null===(t=(await a.FH.get("/admin/newsletter/stats/".concat(e,"/events"))).data)||void 0===t?void 0:t.data)||[]},x=async e=>{await a.FH.delete("/admin/newsletter/subscribers/".concat(e))},g=async(e,t)=>(await a.FH.patch("/admin/newsletter/subscribers/".concat(e,"/status"),{is_active:t})).data,v=async(e,t)=>(await a.FH.patch("/admin/newsletter/subscribers/".concat(e,"/preferences"),t)).data},6291:(e,t,n)=>{n.d(t,{API_URL:()=>r,Ay:()=>c,FH:()=>s,V6:()=>l});var a=n(9379),i=n(9722),o=n(1860);let r="/api/v1";try{const e=new URL(r,"undefined"!==typeof window?window.location.origin:void 0);/\/api\//.test(e.pathname)||(e.pathname=e.pathname.replace(/\/$/,"")+"/api/v1"),r=e.toString()}catch(d){}const s=i.A.create({baseURL:r,headers:(0,a.A)((0,a.A)({},{}),{}),withCredentials:!0,timeout:2e4});s.interceptors.request.use(e=>{const t=(0,o.gf)();return t&&(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(t)),e},e=>Promise.reject(e)),s.interceptors.response.use(e=>e,e=>{var t;if(401===(null===(t=e.response)||void 0===t?void 0:t.status)){var n;const t=(null===(n=e.config)||void 0===n?void 0:n.url)||"",a=t.endsWith("/auth/login")||t.includes("/auth/login"),i=t.endsWith("/upload")||t.includes("/upload");a||i||"/login"!==window.location.pathname&&(window.location.href="/login")}return Promise.reject(e)});const l=async e=>(await s.post("/upload",e,{headers:{"Content-Type":"multipart/form-data"}})).data,c=s},9483:(e,t,n)=>{n.d(t,{Fd:()=>r,Iu:()=>s,QY:()=>i,Tu:()=>o,iD:()=>l,qE:()=>a});const a=[{id:"inter-inter",name:"Inter (Modern Clean)",heading:"Inter",body:"Inter",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",cssBody:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",description:"Modern\xed univerz\xe1ln\xed font navr\u017een\xfd pro digit\xe1ln\xed \u010dten\xed",style:"modern"},{id:"montserrat-opensans",name:"Montserrat & Open Sans (Klasika)",heading:"Montserrat",body:"Open Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Open+Sans:wght@400;500;600;700&display=swap",cssHeading:"'Montserrat', -apple-system, sans-serif",cssBody:"'Open Sans', -apple-system, sans-serif",description:"Obl\xedben\xe1 kombinace pro \u010ditelnost a profesionalitu",style:"classic"},{id:"poppins-roboto",name:"Poppins & Roboto (Sportovn\xed)",heading:"Poppins",body:"Roboto",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800;900&family=Roboto:wght@400;500;600;700&display=swap",cssHeading:"'Poppins', -apple-system, sans-serif",cssBody:"'Roboto', -apple-system, sans-serif",description:"Dynamick\xe1 kombinace vhodn\xe1 pro sportovn\xed weby",style:"bold"},{id:"raleway-lato",name:"Raleway & Lato (Elegantn\xed)",heading:"Raleway",body:"Lato",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@600;700;800;900&family=Lato:wght@400;500;600;700&display=swap",cssHeading:"'Raleway', -apple-system, sans-serif",cssBody:"'Lato', -apple-system, sans-serif",description:"Elegantn\xed a lehk\xe1 kombinace pro pr\xe9miov\xfd vzhled",style:"elegant"},{id:"oswald-sourcesan",name:"Oswald & Source Sans (Siln\xe9)",heading:"Oswald",body:"Source Sans 3",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Oswald:wght@600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap",cssHeading:"'Oswald', -apple-system, sans-serif",cssBody:"'Source Sans 3', -apple-system, sans-serif",description:"V\xfdrazn\xe9 nadpisy s \u010diteln\xfdm textem",style:"bold"},{id:"nunito-nunito",name:"Nunito (P\u0159\xe1telsk\xe9)",heading:"Nunito",body:"Nunito",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Nunito', -apple-system, sans-serif",cssBody:"'Nunito', -apple-system, sans-serif",description:"P\u0159\xe1telsk\xfd a p\u0159\xedstupn\xfd vzhled pro komunitn\xed weby",style:"playful"},{id:"worksans-worksans",name:"Work Sans (Tech)",heading:"Work Sans",body:"Work Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Work Sans', -apple-system, sans-serif",cssBody:"'Work Sans', -apple-system, sans-serif",description:"Modern\xed technick\xfd vzhled s v\xfdbornou \u010ditelnost\xed",style:"tech"},{id:"rubik-rubik",name:"Rubik (Zaoblen\xe9)",heading:"Rubik",body:"Rubik",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Rubik', -apple-system, sans-serif",cssBody:"'Rubik', -apple-system, sans-serif",description:"Zaoblen\xfd a modern\xed design s p\u0159\xe1telsk\xfdm dojmem",style:"playful"},{id:"playfair-sourcesans",name:"Playfair & Source Sans (Presti\u017en\xed)",heading:"Playfair Display",body:"Source Sans 3",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800;900&family=Source+Sans+3:wght@400;500;600;700&display=swap",cssHeading:"'Playfair Display', Georgia, serif",cssBody:"'Source Sans 3', -apple-system, sans-serif",description:"Presti\u017en\xed serifov\xfd nadpis s modern\xedm textem",style:"elegant"},{id:"bebas-opensans",name:"Bebas Neue & Open Sans (Impact)",heading:"Bebas Neue",body:"Open Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Open+Sans:wght@400;500;600;700&display=swap",cssHeading:"'Bebas Neue', -apple-system, sans-serif",cssBody:"'Open Sans', -apple-system, sans-serif",description:"Masivn\xed nadpisy pro maxim\xe1ln\xed dojem",style:"bold"},{id:"archivo-archivo",name:"Archivo (Kompaktn\xed)",heading:"Archivo",body:"Archivo",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Archivo', -apple-system, sans-serif",cssBody:"'Archivo', -apple-system, sans-serif",description:"Kompaktn\xed a efektivn\xed pro hust\u0161\xed obsah",style:"tech"},{id:"exo-exo",name:"Exo 2 (Futuristick\xe9)",heading:"Exo 2",body:"Exo 2",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Exo 2', -apple-system, sans-serif",cssBody:"'Exo 2', -apple-system, sans-serif",description:"Futuristick\xfd a technologick\xfd vzhled",style:"tech"}],i=e=>a.find(t=>t.id===e),o=()=>a[0],r=e=>{if(document.querySelector('link[href="'.concat(e,'"]')))return;const t=document.createElement("link");t.href=e,t.rel="stylesheet",t.crossOrigin="anonymous",document.head.appendChild(t)},s=e=>{r(e.googleFontsUrl),document.documentElement.style.setProperty("--font-heading",e.cssHeading),document.documentElement.style.setProperty("--font-body",e.cssBody),document.documentElement.style.setProperty("--chakra-fonts-heading",e.cssHeading),document.documentElement.style.setProperty("--chakra-fonts-body",e.cssBody)},l=e=>({modern:"blue",classic:"gray",elegant:"purple",bold:"orange",playful:"pink",tech:"cyan"}[e]||"gray")}},e=>{e.O(0,[290],()=>{return t=857,e(e.s=t);var t});e.O()}]);
//# sourceMappingURL=main.8c4bb3a7.js.map