PageSourceSearch

https://rezidence-elisky-premyslovny.cz/assets/dashboard.index-Cdap0GLD.js

js rezidence-elisky-premyslovny.cz collected 2026-10-09 22:01:58 UTC 39,076 bytes, 2 lines download raw bytes

1import{u as B,a as F,b as Z,d as q,r as u,j as t,f as $}from"./index-aUg8wedK.js";import{b as j,S as E,i as U}from"./client-u3-PO_J-.js";import{e as X}from"./tslib.es6-EcI8rXm4.js";import{c as y,B as J,X as I}from"./index-COC5PSfp.js";function K(n){const a=B({warn:n?.router===void 0}),e=n?.router||a;return F(e.stores.__store,Z(n,e))}const W=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],G=y("download",W);const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],tt=y("external-link",Q);const et=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],at=y("inbox",et);const st=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],rt=y("log-out",st);const ot=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],nt=y("message-square",ot);const it=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],lt=y("panel-left-close",it);const dt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ct=y("panel-left",dt);const mt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ht=y("pencil",mt);const ut=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gt=y("plus",ut);const pt=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],xt=y("save",pt);const ft=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yt=y("search",ft);const bt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],H=y("trash-2",bt),vt=[{id:"inquiries",label:"Poptávky",icon:nt},{id:"apartments",label:"Byty",icon:J}],jt=({activeTab:n,onTabChange:a,inquiryCount:e})=>{const r=q(),[d,o]=u.useState(!1),g=async()=>{await j.auth.signOut(),r({to:"/dashboard/login"})};return t.jsxs("aside",{className:`${d?"w-16":"w-60"} bg-white border-r border-gray-200 flex flex-col transition-all duration-200 shrink-0 min-h-screen`,children:[t.jsxs("div",{className:"h-14 flex items-center px-4 border-b border-gray-200",children:[!d&&t.jsx("img",{src:X,alt:"Rezidence Elišky Přemyslovny",className:"h-5 brightness-0"}),t.jsx("button",{onClick:()=>o(!d),className:`${d?"mx-auto":"ml-auto"} text-gray-400 hover:text-gray-600 transition-colors`,children:d?t.jsx(ct,{className:"w-4 h-4"}):t.jsx(lt,{className:"w-4 h-4"})})]}),t.jsx("nav",{className:"flex-1 py-3 px-2 space-y-0.5",children:vt.map(h=>{const c=n===h.id,l=h.id==="inquiries"&&e>0&&!c;return t.jsxs("button",{onClick:()=>a(h.id),className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors ${c?"bg-gray-100 text-gray-900 font-medium":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:[t.jsxs("div",{className:"relative shrink-0",children:[t.jsx(h.icon,{className:"w-4 h-4"}),l&&t.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 bg-red-500 rounded-full"})]}),!d&&t.jsxs("span",{className:"flex items-center gap-2",children:[h.label,l&&t.jsx("span",{className:"bg-red-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full leading-none",children:e})]})]}
vendor: 4,690 bytes, line 1
1,h.id)})}),t.jsxs("div",{className:"border-t border-gray-200 py-3 px-2 space-y-0.5",children:[t.jsxs("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors",children:[t.jsx(tt,{className:"w-4 h-4 shrink-0"}),!d&&t.jsx("span",{children:"Zobrazit web"})]}),t.jsxs("button",{onClick:g,className:"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-gray-500 hover:text-red-600 hover:bg-red-50 transition-colors",children:[t.jsx(rt,{className:"w-4 h-4 shrink-0"}),!d&&t.jsx("span",{children:"Odhlásit se"})]})]})]})};function wt(n){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",a.appendChild(e),e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}Array(12).fill(0);let P=1;class Nt{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const e=this.subscribers.indexOf(a);this.subscribers.splice(e,1)}),this.publish=a=>{this.subscribers.forEach(e=>e(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var e;const{message:r,...d}=a,o=typeof a?.id=="number"||((e=a.id)==null?void 0:e.length)>0?a.id:P++,g=this.toasts.find(c=>c.id===o),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),g?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...a,id:o,title:r}),{...c,...a,id:o,dismissible:h,title:r}):c):this.addToast({title:r,...d,dismissible:h,id:o}),o},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:a,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),a),this.message=(a,e)=>this.create({...e,message:a}),this.error=(a,e)=>this.create({...e,message:a,type:"error"}),this.success=(a,e)=>this.create({...e,type:"success",message:a}),this.info=(a,e)=>this.create({...e,type:"info",message:a}),this.warning=(a,e)=>this.create({...e,type:"warning",message:a}),this.loading=(a,e)=>this.create({...e,type:"loading",message:a}),this.promise=(a,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:a,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const d=Promise.resolve(a instanceof Function?a():a);let o=r!==void 0,g;const h=d.then(async l=>{if(g=["resolve",l],$.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(Ct(l)&&!l.ok){o=!1;const s=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,m=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description,i=typeof s=="object"&&!$.isValidElement(s)?s:{message:s};this.create({id:r,type:"error",description:m,...i})}else if(l instanceof Error){o=!1;const s=typeof e.error=="function"?await e.error(l):e.error,m=typeof e.description=="function"?await e.description(l):e.description,i=typeof s=="object"&&!$.isValidElement(s)?s:{message:s};this.create({id:r,type:"error",description:m,...i})}else if(e.success!==void 0){o=!1;const s=typeof e.success=="function"?await e.success(l):e.success,m=typeof e.description=="function"?await e.description(l):e.description,i=typeof s=="object"&&!$.isValidElement(s)?s:{message:s};this.create({id:r,type:"success",description:m,...i})}}).catch(async l=>{if(g=["reject",l],e.error!==void 0){o=!1;const p=typeof e.error=="function"?await e.error(l):e.error,s=typeof e.description=="function"?await e.description(l):e.description,N=typeof p=="object"&&!$.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:s,...N})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),e.finally==null||e.finally.call(e)}),c=()=>new Promise((l,p)=>h.then(()=>g[0]==="reject"?p(g[1]):l(g[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(a,e)=>{const r=e?.id||P++;return this.create({jsx:a(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const f=new Nt,kt=(n,a)=>{const e=a?.id||P++;return f.addToast({title:n,...a,id:e}),e},Ct=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",St=kt,_t=()=>f.toasts,Dt=()=>f.getActiveToasts(),v=Object.assign(St,{success:f.success,info:f.info,warning:f.warning,error:f.error,custom:f.custom,message:f.message,promise:f.promise,dismiss:f.dismiss,loading:f.loading},{getHistory:_t,getToasts:Dt});wt
vendor: 4,787 bytes, line 1
1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;
vendor: 10,077 bytes, line 1
1left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
1const D=({label:n,value:a})=>t.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4",children:[t.jsx("div",{className:"text-xs text-gray-500",children:n}),t.jsx("div",{className:"text-2xl font-semibold text-gray-900 mt-1",children:a})]}),Et=({onCountChange:n})=>{const[a,e]=u.useState([]),[r,d]=u.useState(""),[o,g]=u.useState(null),[h,c]=u.useState(!0),l=async()=>{c(!0);const{data:i,error:b}=await j.from("inquiries").select("id,name,email,phone,interest:service_type,message,created_at").eq("site_id",E).order("created_at",{ascending:!1});b?v.error("Chyba při načítání"):(e(i||[]),n?.(i?.length||0)),c(!1)};u.useEffect(()=>{l()},[]);const p=u.useMemo(()=>{if(!r)return a;const i=r.toLowerCase();return a.filter(b=>b.name.toLowerCase().includes(i)||b.email.toLowerCase().includes(i)||(b.phone??"").toLowerCase().includes(i))},[a,r]),s=u.useMemo(()=>{const x=(R=>{const w=new Date(R);return w.setHours(0,0,0,0),w})(new Date),C=new Date(x);C.setDate(C.getDate()-1);const z=new Date(x),T=(x.getDay()+6)%7;z.setDate(x.getDate()-T);const k=new Date(x.getFullYear(),x.getMonth(),1),M=new Date(x);M.setDate(M.getDate()-30);let L=0,Y=0,O=0,V=0,A=0;for(const R of a){const w=new Date(R.created_at);w>=x?L++:w>=C&&w<x&&Y++,w>=z&&O++,w>=k&&V++,w>=M&&A++}return{dnes:L,vcera:Y,tyden:O,mesic:V,l30:A,total:a.length}},[a]),m=async i=>{const{error:b}=await j.from("inquiries").delete().eq("site_id",E).eq("id",i);if(b)return v.error("Chyba při mazání");const x=a.filter(C=>C.id!==i);e(x),n?.(x.length),o?.id===i&&g(null),v.success("Poptávka smazána")},N=()=>{const i="Datum;Jméno;Email;Telefon;Zájem;Zpráva",b=a.map(k=>`"${new Date(k.created_at).toLocaleString("cs-CZ")}";"${k.name}";"${k.email}";"${k.phone||""}";"${k.interest||""}";"${(k.message||"").replace(/"/g,"'")}"`),x=[i,...b].join(`
2`),C=new Blob(["\uFEFF"+x],{type:"text/csv;charset=utf-8;"}),z=URL.createObjectURL(C),T=document.createElement("a");T.href=z,T.download=`poptavky-${new Date().toISOString().slice(0,10)}.csv`,T.click(),URL.revokeObjectURL(z)};return t.jsxs("div",{className:"p-8 flex gap-6",children:[t.jsxs("div",{className:`${o?"w-1/2":"w-full"} transition-all`,children:[t.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Poptávky"}),t.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"Příchozí zprávy z kontaktního formuláře"})]}),a.length>0&&t.jsxs("button",{onClick:N,className:"inline-flex items-center gap-2 text-xs font-medium bg-white border border-gray-200 text-gray-700 px-3 py-2 rounded-lg hover:bg-gray-50 transition-colors",children:[t.jsx(G,{className:"w-3.5 h-3.5"}),"Export CSV"]})]}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 mb-8",children:[t.jsx(D,{label:"Dnes",value:s.dnes}),t.jsx(D,{label:"Včera",value:s.vcera}),t.jsx(D,{label:"Tento týden",value:s.tyden}),t.jsx(D,{label:"Tento měsíc",value:s.mesic}),t.jsx(D,{label:"Posledních 30 dní",value:s.l30}),t.jsx(D,{label:"Celkem",value:s.total})]}),t.jsxs("div",{className:"relative max-w-xs mb-6",children:[t.jsx(yt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx("input",{value:r,onChange:i=>d(i.target.value),placeholder:"Hledat...",className:"w-full bg-white border border-gray-300 rounded-lg pl-10 pr-4 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-900/10 focus:border-gray-400"})]}),t.jsx("div",{className:"bg-white border border-gray-200 rounded-xl overflow-hidden",children:h?t.jsx("div",{className:"p-12 text-center text-gray-400 text-sm",children:"Načítání..."}):p.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[t.jsx(at,{className:"w-10 h-10 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Žádné poptávky"})]}):t.jsx("div",{className:"divide-y divide-gray-100",children:p.map(i=>t.jsxs("div",{onClick:()=>g(i),className:`px-5 py-4 cursor-pointer hover:bg-gray-50 transition-colors ${o?.id===i.id?"bg-gray-50":""}`,children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-sm font-medium text-gray-900",children:i.name}),t.jsx("span",{className:"text-xs text-gray-400",children:new Date(i.created_at).toLocaleDateString("cs-CZ",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})})]}),t.jsxs("p",{className:"text-xs text-gray-500",children:[i.email,i.phone?` · ${i.phone}`:""]}),i.message&&t.jsx("p",{className:"text-xs text-gray-400 mt-1 line-clamp-1",children:i.message})]},i.id))})})]}),o&&t.jsxs("div",{className:"w-1/2 bg-white border border-gray-200 rounded-xl p-6 sticky top-8 self-start",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Detail poptávky"}),t.jsx("button",{onClick:()=>g(null),className:"text-gray-400 hover:text-gray-600",children:t.jsx(I,{className:"w-4 h-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"Jméno"}),t.jsx("p",{className:"text-sm text-gray-900",children:o.name})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"E-mail"}),t.jsx("p",{className:"text-sm text-gray-900 break-all",children:o.email})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"Telefon"}),t.jsx("p",{className:"text-sm text-gray-900",children:o.phone||"—"})]})]}),o.interest&&t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"Zájem"}),t.jsx("p",{className:"text-sm text-gray-900",children:o.interest})]}),o.message&&t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"Zpráva"}),t.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3",children:o.message})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-xs text-gray-500 block mb-0.5",children:"Datum"}),t.jsx("p",{className:"text-sm text-gray-900",children:new Date(o.created_at).toLocaleStr
2ing("cs-CZ")})]}),t.jsxs("button",{onClick:()=>m(o.id),className:"inline-flex items-center gap-1.5 text-xs text-red-500 hover:text-red-600 mt-4",children:[t.jsx(H,{className:"w-3.5 h-3.5"}),"Smazat poptávku"]})]})]})]})},zt=["Volný","Rezervovaný","Prodáno"],Tt=["1+kk","1+1","2+kk","2+1","3+kk","3+1","4+kk","4+1"],$t={id:"",label:"",disposition:"1+kk",area:0,balcony:0,floor:1,price:0,status:"Volný",pdf_url:null},Mt={Volný:"bg-emerald-50 text-emerald-700",Rezervovaný:"bg-amber-50 text-amber-700",Prodáno:"bg-rose-50 text-rose-700"},Rt=n=>n>0?new Intl.NumberFormat("cs-CZ",{style:"currency",currency:"CZK",maximumFractionDigits:0}).format(n):"—",S="w-full bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-900/10 focus:border-gray-400",_="text-xs text-gray-500 block mb-1",Pt=()=>{const[n,a]=u.useState([]),[e,r]=u.useState(null),[d,o]=u.useState(!1),[g,h]=u.useState(!0),c=async()=>{h(!0);const{data:s,error:m}=await j.from("site_apartments").select("id,label,disposition,area,balcony,floor,price,status,pdf_url").eq("site_id",E).order("position");m?v.error("Chyba při načítání"):a(s||[]),h(!1)};u.useEffect(()=>{c()},[]);const l=async()=>{if(!e)return;if(!e.id||!e.label)return v.error("ID a označení jsou povinné.");const s={...e};if(d){const{error:m}=await j.from("site_apartments").insert({...s,site_id:E,position:Number(s.id)||0});if(m)return v.error("Chyba při ukládání")}else{const{error:m}=await j.from("site_apartments").update(s).eq("site_id",E).eq("id",e.id);if(m)return v.error("Chyba při ukládání")}v.success(`Byt ${e.label} byl uložen.`),r(null),o(!1),c()},p=async s=>{const{error:m}=await j.from("site_apartments").delete().eq("site_id",E).eq("id",s);if(m)return v.error("Chyba při mazání");a(N=>N.filter(i=>i.id!==s)),v.success("Byt byl odstraněn.")};return t.jsxs("div",{className:"p-8",children:[t.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Byty"}),t.jsxs("p",{className:"text-gray-500 text-sm mt-1",children:["Správa bytových jednotek (",n.length," bytů)"]})]}),t.jsxs("button",{onClick:()=>{r({...$t}),o(!0)},className:"inline-flex items-center gap-2 text-sm font-medium bg-gray-900 text-white px-4 py-2 rounded-lg hover:bg-gray-800 transition-colors",children:[t.jsx(gt,{className:"w-4 h-4"}),"Přidat byt"]})]}),t.jsx("div",{className:"bg-white border border-gray-200 rounded-xl overflow-hidden",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-gray-200 bg-gray-50",children:[t.jsx("th",{className:"text-left px-4 py-3 font-medium text-gray-500",children:"Označení"}),t.jsx("th",{className:"text-left px-4 py-3 font-medium text-gray-500",children:"Dispozice"}),t.jsx("th",{className:"text-right px-4 py-3 font-medium text-gray-500",children:"Plocha m²"}),t.jsx("th",{className:"text-right px-4 py-3 font-medium text-gray-500",children:"Balkón m²"}),t.jsx("th",{className:"text-center px-4 py-3 font-medium text-gray-500",children:"Patro"}),t.jsx("th",{className:"text-right px-4 py-3 font-medium text-gray-500",children:"Cena"}),t.jsx("th",{className:"text-center px-4 py-3 font-medium text-gray-500",children:"Stav"}),t.jsx("th",{className:"text-right px-4 py-3 font-medium text-gray-500",children:"Akce"})]})}),t.jsx("tbody",{children:g?t.jsx("tr",{children:t.jsx("td",{colSpan:8,className:"px-4 py-12 text-center text-gray-400",children:"Načítání..."})}):n.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:8,className:"px-4 py-12 text-center text-gray-400",children:"Zatím žádné byty."})}):n.map(s=>t.jsxs("tr",{className:"border-b border-gray-100 last:border-0 hover:bg-gray-50/60 transition-colors",children:[t.jsx("td",{className:"px-4 py-3 font-medium text-gray-900",children:s.label}),t.jsx("td",{className:"px-4 py-3 text-gray-500",children:s.disposition}),t.jsx("td",{className:"px-4 py-3 text-right text-gray-500",children:s.area}),t.jsx("td",{className:"px-4 py-3 text-right text-gray-500",children:s.balcony||"—"}),t.jsx("td",{className:"px-4 py-3 text-center text-gray-500",children:s.floor}),t.jsx("td",{className:"px-4 py-3 text-right text-gray-900 font-medium",children:Rt(s.price)}),t.jsx("td",{className:"px-4 py-3 text-center",children:t.jsx("span",{className:`inline-block text-xs px-2 py-0.5 rounded-md font-medium w-24 ${Mt[s.status]||"bg-gray-100 text-gray-600"}`,children:s.status})}),t.jsx("td",{className:"px-4 py-3 text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx("button",{onClick:()=>{r({...s}),o(!1)},className:"p-1.5 rounded-md text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition-colors",children:t.jsx(ht,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:()=>p(s.id),className:"p-1.5 rounded-md text-gray-400 hover:text-red-600 hover:bg-red-50 transition-colors",children:t.jsx(H,{className:"w-3.5 h-3.5"})})]})})]},s.id))})]})})}),e&&t.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 flex items-center justify-center p-4",onClick:()=>{r(null),o(!1)},children:t.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-md p-6",onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:d?"Nový byt":`Upravit ${e.label}`}),t.jsx("button",{onClick:()=>{r(null),o(!1)},className:"text-gray-400 hover:text-gray-600",children:t.jsx(I,{className:"w-4 h-4"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:_,children:"ID / Označení"}),t.jsx("input",{value:e.label,onChange:s=>r({...e,id:d?s.target.value:e.id,label:s.target.value}),placeholder:"A1.01",disabled:!d,className:S+" disabled:bg-gray-50 disabled:text-gray-500"})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Dispozice"}),t.jsx("select",{value:e.disposition,onChange:s=>r({...e,disposition:s.target.value}),className:S,children:Tt.map(s=>t.jsx("option",{value:s,children:s},s))})]})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Plocha (m²)"}),t.jsx("input",{type:"number",step:"0.1",value:e.area,onChange:s=>r({...e,area:parseFloat(s.target.value)||0}),className:S})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Balkón (m²)"}),t.jsx("input",{type:"number",step:"0.1",value:e.balcony,onChange:s=>r({...e,balcony:parseFloat(s.target.value)||0}),className:S})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Patro"}),t.jsx("input",{type:"number",value:e.floor,onChange:s=>r({...e,floor:parseInt(s.target.value)||1}),className:S})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Cena (Kč)"}),t.jsx("input",{type:"number",value:e.price,onChange:s=>r({...e,price:parseInt(s.target.value)||0}),className:S})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,children:"Stav"}),t.jsx("select",{value:e.status,onChange:s=>r({...e,status:s.target.value}),className:S,children:zt.map(s=>t.jsx("option",{value:s,children:s},s))})]})]})]}),t.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[t.jsx("button",{onClick:()=>{r(null),o(!1)},className:"text-sm font-medium bg-white border border-gray-200 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 transition-colors",children:"Zrušit"}),t.jsxs("button",{onClick:l,className:"inline-flex items-center gap-2 text-sm font-medium bg-gray-900 text-white px-4 py-2 rounded-lg hover:bg-gray-800 transition-colors",children:[t.jsx(xt,{className:"w-4 h-4"}),"Uložit"]})]})]})})]})};function At(){const n=q(),a=K({select:l=>l.location.hash}),[e,r]=u.useState(!0),[d,o]=u.useState("inquiries"),[g,h]=u.useState(0);u.useEffect(()=>{(async()=>{const{data:{session:s}}=await j.auth.getSession();if(!s){n({to:"/dashboard/login"});return}if(!await U()){await j.auth.signOut(),n({to:"/dashboard/login"});return}r(!1)})();const{data:{subscription:p}}=j.auth.onAuthStateChange((s,m)=>{m||n({to:"/dashboard/login"})});return()=>p.unsubscribe()},[n]),u.useEffect(()=>{(a==="apartments"||a==="inquiries")&&o(a)},[a]);const c=l=>{o(l),window.location.hash=l};return e?t.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 border-2 border-gray-300 border-t-gray-700 rounded-full animate-spin"})}):t.jsxs("div",{className:"min-h-screen bg-gray-50 flex",children:[t.jsx(jt,{activeTab:d,onTabChange:c,inquiryCount:g}),t.jsxs("main",{className:"flex-1 overflow-auto",children:[d==="inquiries"&&t.jsx(Et,{onCountChange:h}),d==="apartments"&&t.jsx(Pt,{})]})]})}export{At as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.