import{j as e}from"./ui-vendor-8uIfD_JC.js";import{a as S}from"./analytics-vendor-Buw7Jr8C.js";import{G as h,S as b,c as _,a as y,b as g,B as f}from"./index-BagLllOy.js";import{M as k,H as L}from"./header-B8URyXEE.js";import{F as q}from"./footer-B4a-Tf9e.js";import{o as F}from"./seo-BoELg83m.js";import{S as N,M as T,t as w}from"./analytics-DwWXTewx.js";import{r as u,L as c}from"./react-vendor-28t7dxFl.js";import{u as x}from"./useQuery-XqhZ5yOb.js";import{a as m}from"./api-Cp4ZovNS.js";import{S as $,C}from"./status-badge-Ci7U3cAc.js";import{S as A}from"./search-C9cjY_J1.js";import"./convex-vendor-BbyM1w2O.js";function P(){const{data:r}=x({queryKey:["places-all"],queryFn:()=>m.getPlaces()}),{data:t}=x({queryKey:["shops-all"],queryFn:()=>m.getShops()}),{data:a}=x({queryKey:["cities"],queryFn:()=>m.getCities(),staleTime:b.STATIC,gcTime:h.STATIC}),{data:n}=x({queryKey:["countries"],queryFn:m.getCountries,staleTime:b.STATIC,gcTime:h.STATIC});return u.useMemo(()=>{const s=r?.length,l=t?.length,d=a?.length,p=n?.length;let i;if(r){const o=r.filter(j=>j.rate!=null);o.length>0&&(i=o.reduce((j,M)=>j+(M.rate??0),0)/o.length)}return[{value:s!=null?`${s}`:"—",label:"заведений"},{value:l!=null?`${l}`:"—",label:"магазинов"},{value:d!=null?`${d}`:"—",label:"городов"},{value:p!=null?`${p}`:"—",label:"стран"},{value:i!=null?`${i.toFixed(1)}★`:"—",label:"средний рейтинг"}]},[r,t,a,n])}function z({place:r,citySlug:t,cityName:a}){const[n,s]=u.useState(!1),l=r.main_image?.url??r.icon_image?.url??null;return e.jsxs(c,{to:`/place/${t}/${r.slug}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),className:_("block rounded-[14px] overflow-hidden bg-card border transition-all duration-200",n?"border-border -translate-y-1 shadow-lg":"border-border/60"),children:[e.jsxs("div",{className:"h-[175px] relative overflow-hidden bg-secondary",children:[l?e.jsx("img",{src:l,alt:r.name,className:"w-full h-full object-cover transition-transform duration-300",style:{transform:n?"scale(1.04)":"scale(1)"}}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-4xl text-muted-foreground/20 select-none",children:"🌿"}),e.jsx("div",{className:"absolute bottom-2.5 left-2.5 right-2.5 flex items-center justify-between gap-1.5",children:e.jsx($,{item:r})})]}),e.jsxs("div",{className:"p-3.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1.5",children:[e.jsx("h3",{className:"font-bold text-[15px] leading-tight",children:r.name}),r.rate!=null&&e.jsxs("span",{className:"flex items-center gap-1 text-primary text-[13px] font-bold shrink-0",children:[e.jsx(N,{className:"size-3 fill-primary"}),r.rate.toFixed(1)]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx(k,{className:"size-3 shrink-0"}),e.jsx("span",{className:"line-clamp-1",children:a})]})]})]})}const I=6;function E(){const{data:r,isLoading:t,isError:a}=x({queryKey:["places-all"],queryFn:()=>m.getPlaces()}),{data:n,isLoading:s}=x({queryKey:["cities"],queryFn:()=>m.getCities(),staleTime:b.STATIC,gcTime:h.STATIC}),l=u.useMemo(()=>n?new Map(n.map(i=>[i.id,i])):new Map,[n]),d=u.useMemo(()=>r?r.filter(i=>i.rate!=null).sort((i,o)=>(o.rate??0)-(i.rate??0)).slice(0,I):[],[r]),p=t||s;return a||!p&&d.length===0?null:e.jsxs("section",{className:"mx-auto max-w-[1200px] px-6 pb-16",children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[32px] font-bold tracking-[-0.03em] mb-2",children:"Лучшие заведения"}),e.jsx("p",{className:"text-muted-foreground text-[15px]",children:"Топ кальянных по рейтингу"})]}),e.jsx(c,{to:"/places",className:"text-primary text-[14px] font-semibold hover:underline shrink-0 hidden sm:block",children:"Все заведения →"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:p?Array.from({length:3}).map((i,o)=>e.jsxs("div",{className:"rounded-[14px] overflow-hidden bg-card border border-border/60",children:[e.jsx(y,{className:"h-[175px] rounded-none"}),e.jsxs("div",{className:"p-3.5 space-y-2",children:[e.jsx(y,{className:"h-4 w-3/4"}),e.jsx(y,{className:"h-3 w-1/2"})]})]},o)):d.map(i=>{const o=l.get(i.city_id);return e.jsx(z,{place:i,citySlug:o?.slug??i.city_id,cityName:o?.name??""},i.id)})}),e.jsx(c,{to:"/places",className:"text-primary text-[14px] font-semibold hover:underline mt-6 block text-center sm:hidden",children:"Все заведения →"})]})}function v({name:r,city:t,rating:a,status:n,statusText:s,imgUrl:l,to:d,style:p}){const o={open:{bg:"rgba(34,197,94,0.12)",color:"#22c55e",border:"rgba(34,197,94,0.2)"},closed:{bg:"rgba(249,115,22,0.12)",color:"#f97316",border:"rgba(249,115,22,0.2)"},round:{bg:"rgba(129,140,248,0.12)",color:"#818cf8",border:"rgba(129,140,248,0.2)"}}[n];return e.jsxs(c,{to:d,className:"rounded-[14px] overflow-hidden bg-card border border-border shadow-xl w-[200px] shrink-0 block hover:shadow-2xl transition-shadow",style:p,children:[e.jsx("div",{className:"h-[100px] overflow-hidden",children:l?e.jsx("img",{src:l,alt:r,className:"w-full h-full object-cover"}):e.jsx("div",{className:"h-full flex items-center justify-center text-4xl opacity-25",style:{background:"linear-gradient(135deg, #1c0a2e, #3b1060)"},children:"🌿"})}),e.jsxs("div",{className:"p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-1 mb-1",children:[e.jsx("span",{className:"font-bold text-[13px] leading-tight",children:r}),e.jsxs("span",{className:"flex items-center gap-0.5 text-primary text-[12px] font-bold shrink-0",children:[e.jsx(N,{className:"size-[11px] fill-primary"}),a.toFixed(1)]})]}),e.jsx("div",{className:"text-muted-foreground text-[11px] mb-2",children:t}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold px-2 py-0.5 rounded-md",style:{background:o.bg,color:o.color,border:`1px solid ${o.border}`},children:[e.jsx(C,{className:"size-[10px]"}),s]})]})]})}function K(r,t){let a,n;r.open_to==="Круглосуточно"?(a="round",n="Круглосуточно"):r.open_to?(a="open",n=`до ${r.open_to}`):(a="closed",n=r.open_in?`в ${r.open_in}`:"Закрыто");const s=t?.slug??r.city_id;return{name:r.name,city:t?.name??"",rating:r.rate??0,status:a,statusText:n,imgUrl:r.main_image?.url??r.icon_image?.url??null,to:`/place/${s}/${r.slug}`}}function U(){const{data:r}=x({queryKey:["places-all"],queryFn:()=>m.getPlaces()}),{data:t}=x({queryKey:["cities"],queryFn:()=>m.getCities(),staleTime:b.STATIC,gcTime:h.STATIC}),a=u.useMemo(()=>r?r.filter(l=>l.rate!=null).sort((l,d)=>(d.rate??0)-(l.rate??0)).slice(0,3):[],[r]),n=u.useMemo(()=>t?new Map(t.map(l=>[l.id,l])):new Map,[t]);if(a.length<3)return null;const s=a.map(l=>K(l,n.get(l.city_id)));return e.jsxs("div",{className:"hidden md:block relative h-[440px]",children:[e.jsx("div",{className:"absolute top-[10%] left-[5%] w-[280px] h-[280px] rounded-full pointer-events-none",style:{background:"radial-gradient(circle, var(--yellow-soft) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[5%] right-[0%] w-[200px] h-[200px] rounded-full pointer-events-none",style:{background:"radial-gradient(circle, rgba(129,140,248,0.06) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute top-[0%] left-[2%]",style:{animation:"float-a 6s ease-in-out infinite"},children:e.jsx(v,{...s[0]})}),e.jsx("div",{className:"absolute top-[30%] right-[-2%]",style:{animation:"float-b 7s 1s ease-in-out infinite"},children:e.jsx(v,{...s[1]})}),e.jsx("div",{className:"absolute bottom-[2%] left-[12%]",style:{animation:"float-c 8s 0.5s ease-in-out infinite"},children:e.jsx(v,{...s[2]})}),e.jsx("div",{className:"absolute top-[18%] right-[28%] w-9 h-9 rounded-[50%_50%_50%_0] rotate-[-45deg] bg-primary flex items-center justify-center shadow-lg",style:{animation:"float-b 5s 2s ease-in-out infinite",boxShadow:"0 4px 20px var(--yellow-glow)"},children:e.jsx("span",{className:"rotate-45 text-[14px] font-bold text-primary-foreground",children:"G"})})]})}function G(){const{data:r}=x({queryKey:["places-all"],queryFn:()=>m.getPlaces()}),{data:t}=x({queryKey:["cities"],queryFn:()=>m.getCities(),staleTime:b.STATIC,gcTime:h.STATIC}),a=u.useMemo(()=>r?r.filter(s=>s.rate!=null).sort((s,l)=>(l.rate??0)-(s.rate??0)).slice(0,2):[],[r]),n=u.useMemo(()=>t?new Map(t.map(s=>[s.id,s])):new Map,[t]);return a.length<2?null:e.jsx("div",{className:"hidden md:flex justify-center items-end gap-4",children:a.map((s,l)=>{const d=n.get(s.city_id),p=d?.slug??s.city_id,i=s.main_image?.url??s.icon_image?.url??null;return e.jsxs(c,{to:`/place/${p}/${s.slug}`,className:"w-[155px] rounded-[14px] overflow-hidden bg-background border border-border shadow-lg block hover:shadow-xl transition-shadow",style:{transform:l===0?"translateY(16px) rotate(-3deg)":"rotate(2deg)"},children:[e.jsx("div",{className:"h-[86px] overflow-hidden",children:i?e.jsx("img",{src:i,alt:s.name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"h-full flex items-center justify-center text-3xl opacity-30",style:{background:"linear-gradient(135deg, #1c0a2e, #3b1060)"},children:"🌿"})}),e.jsxs("div",{className:"p-2.5",children:[e.jsx("div",{className:"font-bold text-[12px] mb-0.5",children:s.name}),e.jsx("div",{className:"text-muted-foreground text-[10px] mb-1.5",children:d?.name??""}),e.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:"var(--yellow-soft)",color:"var(--color-primary)"},children:s.rate!=null?`${s.rate.toFixed(1)} ★`:""})]})]},s.id)})})}const Y=[{icon:T,title:"Интерактивная карта",description:"Находите заведения на карте с фильтрацией по городам и странам"},{icon:C,title:"Актуальное время",description:"Видите, открыто ли заведение прямо сейчас и когда откроется"},{icon:A,title:"Поиск и фильтры",description:"Быстрый поиск по названию и удобные фильтры для выбора"},{icon:N,title:"Рейтинги и отзывы",description:"Читайте отзывы других посетителей перед визитом"}];function se(){const r=P();return e.jsxs(e.Fragment,{children:[e.jsxs(S,{children:[e.jsx("title",{children:"Goh.Place — Найти кальянные и магазины"}),e.jsx("meta",{name:"description",content:"Goh.Place — платформа для поиска кальянных и магазинов табачных изделий с актуальной информацией о времени работы, адресах, телефонах и отзывах."}),e.jsx("link",{rel:"canonical",href:g.siteUrl}),e.jsx("meta",{property:"og:title",content:"Goh.Place — Найти кальянные и магазины"}),e.jsx("meta",{property:"og:description",content:"Платформа для поиска кальянных и магазинов с актуальной информацией"}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:g.siteUrl}),e.jsx("meta",{property:"og:image",content:`${g.siteUrl}/images/logo-favicon.png`}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(F)})]}),e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(L,{}),e.jsxs("main",{id:"main-content",className:"flex-1",children:[e.jsxs("section",{className:"mx-auto max-w-[1200px] px-6 py-20 md:py-28 grid grid-cols-1 md:grid-cols-2 gap-12 items-center min-h-[85vh]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center gap-2 text-[12px] font-semibold px-3 py-1.5 rounded-full mb-6 border",style:{background:"var(--yellow-soft)",color:"var(--color-primary)",borderColor:"rgba(var(--primary), 0.2)"},children:[e.jsx("span",{className:"text-base",children:"💨"}),"Кальянная культура на карте"]}),e.jsxs("h1",{className:"text-[clamp(32px,5.5vw,76px)] font-bold leading-[1.04] tracking-[-0.04em] mb-6",children:["Найди",e.jsx("br",{}),"лучшую"," ",e.jsx("span",{className:"text-primary",children:"кальянную"}),e.jsx("br",{}),"рядом"]}),e.jsx("p",{className:"text-[17px] text-muted-foreground leading-[1.65] mb-10 max-w-[460px]",children:"Актуальные заведения, время работы, адреса и отзывы — всё в одном месте. Выбирай место под настроение."}),e.jsxs("div",{className:"flex flex-wrap gap-3 mb-14",children:[e.jsx(c,{to:"/places",children:e.jsxs(f,{size:"lg",className:"gap-2 font-semibold text-[15px]",children:[e.jsx(k,{className:"size-4"}),"Найти кальянную"]})}),e.jsx(c,{to:"/map",children:e.jsxs(f,{size:"lg",variant:"outline",className:"gap-2 font-semibold text-[15px]",children:[e.jsx(T,{className:"size-4"}),"Открыть карту"]})})]}),e.jsx("div",{className:"flex flex-wrap gap-y-4 pt-7 border-t border-border/60",children:r.map((t,a)=>e.jsxs("div",{className:"pr-5 mr-5 sm:pr-8 sm:mr-8 last:pr-0 last:mr-0",style:{borderRight:a<r.length-1?"1px solid var(--color-border)":"none"},children:[e.jsx("div",{className:"text-[22px] sm:text-[26px] font-bold text-primary tracking-[-0.03em] leading-none mb-1",children:t.value}),e.jsx("div",{className:"text-[11px] sm:text-[12px] text-muted-foreground",children:t.label})]},a))})]}),e.jsx(U,{})]}),e.jsx(E,{}),e.jsx("section",{className:"bg-card border-y border-border/60 py-16",children:e.jsxs("div",{className:"mx-auto max-w-[1200px] px-6",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-[32px] font-bold tracking-[-0.03em] mb-3",children:"Всё для выбора места"}),e.jsx("p",{className:"text-muted-foreground text-[15px]",children:"Сервис, который знает кальянную культуру"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Y.map((t,a)=>e.jsxs("div",{className:"p-6 rounded-[14px] bg-background border border-border/60 hover:border-border hover:-translate-y-1 hover:shadow-lg transition-all duration-200",children:[e.jsx("div",{className:"inline-flex items-center justify-center p-2.5 bg-primary/10 rounded-xl mb-4",children:e.jsx(t.icon,{className:"size-5 text-primary"})}),e.jsx("h3",{className:"font-bold text-[15px] mb-2",children:t.title}),e.jsx("p",{className:"text-muted-foreground text-[13px] leading-relaxed",children:t.description})]},a))})]})}),e.jsx("section",{className:"mx-auto max-w-[1200px] px-6 py-16",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(c,{to:"/shops",className:"group relative overflow-hidden p-8 rounded-[20px] bg-card border border-border/60 hover:border-primary/30 hover:-translate-y-0.5 transition-all duration-200",children:[e.jsx("div",{className:"absolute right-[-20px] bottom-[-20px] text-[100px] opacity-[0.06] pointer-events-none",children:"🛍️"}),e.jsx("div",{className:"text-[36px] mb-3",children:"🛍️"}),e.jsx("h3",{className:"text-[22px] font-bold tracking-tight mb-2",children:"Магазины"}),e.jsx("p",{className:"text-muted-foreground text-[14px] leading-relaxed mb-5",children:"Кальяны, табак и всё необходимое рядом с тобой"}),e.jsx("span",{className:"text-primary text-[13px] font-semibold group-hover:underline",children:"Смотреть магазины →"})]}),e.jsxs(c,{to:"/blog",className:"group relative overflow-hidden p-8 rounded-[20px] bg-card border border-border/60 hover:border-primary/30 hover:-translate-y-0.5 transition-all duration-200",children:[e.jsx("div",{className:"absolute right-[-20px] bottom-[-20px] text-[100px] opacity-[0.06] pointer-events-none",children:"📖"}),e.jsx("div",{className:"text-[36px] mb-3",children:"📖"}),e.jsx("h3",{className:"text-[22px] font-bold tracking-tight mb-2",children:"Блог"}),e.jsx("p",{className:"text-muted-foreground text-[14px] leading-relaxed mb-5",children:"Советы, обзоры и всё о кальянной культуре"}),e.jsx("span",{className:"text-primary text-[13px] font-semibold group-hover:underline",children:"Читать статьи →"})]})]})}),e.jsx("section",{className:"mx-auto max-w-[1200px] px-6 pb-16",children:e.jsxs("div",{className:"p-10 md:p-14 rounded-[24px] bg-card border border-border/60 grid grid-cols-1 md:grid-cols-2 gap-10 items-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"inline-flex items-center gap-2 text-[11px] font-bold uppercase tracking-[0.06em] text-muted-foreground mb-4 bg-secondary px-2.5 py-1 rounded-md border border-border",children:"📱 Мобильное приложение"}),e.jsx("h2",{className:"text-[28px] font-bold tracking-[-0.03em] mb-3",children:"Всегда под рукой"}),e.jsx("p",{className:"text-muted-foreground text-[14px] leading-relaxed mb-8 max-w-[380px]",children:"Удобный поиск кальянных и магазинов в мобильном приложении. Уведомления, офлайн-карты и быстрый доступ к любимым местам."}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs("a",{href:g.appStoreUrl,target:"_blank",rel:"noopener noreferrer",onClick:()=>w("ios"),className:"inline-flex items-center gap-3 px-5 py-3.5 rounded-[12px] bg-secondary border border-border hover:border-primary/40 hover:-translate-y-0.5 transition-all",children:[e.jsx("svg",{className:"size-7",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-muted-foreground leading-none mb-0.5",children:"Загрузите в"}),e.jsx("div",{className:"text-[15px] font-bold leading-none",children:"App Store"})]})]}),e.jsxs("a",{href:g.playMarketUrl,target:"_blank",rel:"noopener noreferrer",onClick:()=>w("android"),className:"inline-flex items-center gap-3 px-5 py-3.5 rounded-[12px] bg-secondary border border-border hover:border-primary/40 hover:-translate-y-0.5 transition-all",children:[e.jsx("svg",{className:"size-7",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-muted-foreground leading-none mb-0.5",children:"Доступно в"}),e.jsx("div",{className:"text-[15px] font-bold leading-none",children:"Google Play"})]})]})]})]}),e.jsx(G,{})]})}),e.jsx("section",{className:"mx-auto max-w-[1200px] px-6 pb-20",children:e.jsxs("div",{className:"bg-primary rounded-[24px] px-10 md:px-16 py-12 flex flex-col md:flex-row items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[28px] font-bold tracking-[-0.03em] text-primary-foreground mb-2",children:"Готов найти своё место?"}),e.jsx("p",{className:"text-primary-foreground/65 text-[15px]",children:r[0].value!=="—"?`${r[0].value} заведений ждут тебя прямо сейчас`:"Заведения ждут тебя прямо сейчас"})]}),e.jsxs("div",{className:"flex gap-3 shrink-0",children:[e.jsx(c,{to:"/places",children:e.jsx(f,{size:"lg",variant:"secondary",className:"font-bold",children:"Кальянные"})}),e.jsx(c,{to:"/shops",children:e.jsx(f,{size:"lg",className:"font-bold bg-primary-foreground/15 text-primary-foreground hover:bg-primary-foreground/25 border-0",children:"Магазины"})})]})]})})]}),e.jsx(q,{})]}),e.jsx("style",{children:`
        @keyframes float-a { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(-3deg); } }
        @keyframes float-b { 0%,100% { transform: translateY(0) rotate(2.5deg); } 50% { transform: translateY(-14px) rotate(2.5deg); } }
        @keyframes float-c { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-8px) rotate(-1.5deg); } }
      `})]})}export{se as default};