PageSourceSearch

https://www.kemer.tours/_next/static/immutable/chunks/1gz4ca19vcokc.js

js kemer.tours collected 2026-10-02 02:09:03 UTC 53,871 bytes, 22 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19811,98195,43849,35508,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(3828),r=e.i(41158),l=e.i(40741),n=e.i(21679),i=e.i(19316),o=e.i(51836),c=e.i(21614),u=e.i(97878),d=e.i(33538),x=e.i(35975);let h=e=>{if(!e||"string"!=typeof e)return null;let[t,s,a]=e.split("-").map(Number);if(!t||!s||!a)return null;let r=new Date(t,s-1,a);return Number.isNaN(r.getTime())?null:r},m={},g={},p=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),f=({onSearchSubmit:e,defaultValues:r={},isIndexPage:f=null})=>{let b,y,j,v,{t:w}=(0,i.useStaticTranslation)("Search"),N=(0,a.useRouter)(),{locale:_}=N,{isMobile:k}=(0,l.useDevice)(),[S,C]=(0,s.useState)(r.destination||""),[$,E]=(0,s.useState)(r.category||"Tours"),[T,L]=(0,s.useState)(r.travelerCount||1),[M,D]=(0,s.useState)(r.date||""),[P,A]=(0,s.useState)(!1),z=(0,s.useRef)(null),[I,O]=(0,s.useState)(()=>h(r.date)||new Date),[R,F]=(0,s.useState)(!1),[q,B]=(0,s.use
1State)(null),[W,K]=(0,s.useState)([]),[U,H]=(0,s.useState)([]),[J,Y]=(0,s.useState)(!1),[G,V]=(0,s.useState)(!1),X=(0,s.useRef)(null),Q=(t=S)=>{let s=String(t||"").trim();s?(V(!1),e?e({destination:s,category:$,travelerCount:T,date:M}):N.push({pathname:"/search",query:{destination:s,category:$,travelers:T,...M&&{date:M}}})):F(!0)},Z=e=>{"Enter"===e.key&&(e.preventDefault(),Q())},ee=h(M),et=ee?(0,x.formatDateInKemerTime)(ee,_||"en",{month:"short",day:"numeric"}):w.selectDates||"Select Dates",es=S.trim()?e?w.searchReady||"Ready to search":w.notConfigured||"Search functionality is not configured yet":w.enterDestination||"Please enter a destination to search",ea=[w.weekdaySun||"Sun",w.weekdayMon||"Mon",w.weekdayTue||"Tue",w.weekdayWed||"Wed",w.weekdayThu||"Thu",w.weekdayFri||"Fri",w.weekdaySat||"Sat"],er=(b=I.getFullYear(),j=new Date(b,y=I.getMonth(),1).getDay(),v=new Date(b,y,1-j),Array.from({length:42},(e,t)=>{let s=new Date(v);return s.setDate(v.getDate()+t),s.getMonth()===y?s:null})),el=(0,x.getTodayInKemerTime)();(0,s.useEffect)(()=>{if(!P)return;let e=e=>{z.current&&!z.current.contains(e.target)&&A(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[P]),(0,s.useEffect)(()=>{if(!f)return;let e=!0;return(e=>{let t=e||"en",s=m[t],a=Date.now();if(s&&a-s.timestamp<3e5)return Promise.resolve(s.items);if(g[t])return g[t];let r=new URLSearchParams({locale:t,preload:"locations"}),l=fetch(`/api/search/suggestions?${r.toString()}`).then(async e=>{let s=await e.json();if(!e.ok)throw Error(s.error||"Location preload failed");let a=Array.isArray(s.suggestions)?s.suggestions:[];return m[t]={items:a,timestamp:Date.now()},a}).finally(()=>{delete g[t]});return g[t]=l,l})(_||"en").then(t=>{e&&H(t)}).catch(t=>{console.error("[search suggestions] preload failed:",t),e&&H([])}),()=>{e=!1}},[f,_]),(0,s.useEffect)(()=>{let e,t=S.trim();if(t.length<2){K([]),Y(!1),V(!1);return}let s=f?(e=p(t.trim())).length<2?[]:(U||[]).map((t,s)=>{var a;let r=p(t.label),l=p([t.label,t.description,t.type].filter(Boolean).join(" ")),n=r.indexOf(e),i=l.indexOf(e);return -1===n&&-1===i?null:{suggestion:t,score:[+(r!==e),+!r.startsWith(e),n>=0?n:i+20,"city"===(a=t.type)?0:"area"===a?1:"poi"===a?2:"country"===a?3:4,s]}}).filter(Boolean).sort((e,t)=>{for(let s=0;s<e.score.length;s+=1)if(e.score[s]!==t.score[s])return e.score[s]-t.score[s];return 0}).slice(0,8).map(e=>e.suggestion):[];U.length>0?(K(s),s.length>0&&V(!0)):s.length>0&&(K(s),V(!0));let a=new AbortController,r=setTimeout(async()=>{try{Y(!0);let e=new URLSearchParams({q:t,locale:_||"en",...U.length>0&&{locations:"0"}}),r=await fetch(`/api/search/suggestions?${e.toString()}`,{signal:a.signal}),l=await r.json();if(!r.ok)throw Error(l.error||"Suggestion search failed");K(((...e)=>{let t=new Set,s=[];return e.flat().forEach(e=>{!e?.id||t.has(e.id)||(t.add(e.id),s.push(e))}),s.slice(0,10)})(s,Array.isArray(l.suggestions)?l.suggestions:[])),V(!0)}catch(e){"AbortError"!==e.name&&K(s)}finally{Y(!1)}},220);return()=>{a.abort(),clearTimeout(r)}},[f,_,U,S]),(0,s.useEffect)(()=>{if(!G)return;let e=e=>{X.current&&!X.current.contains(e.target)&&V(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[G]);let en=G&&(W.length>0||J)?(0,t.jsx)("div",{ref:X,className:"absolute left-0 right-0 top-[calc(100%+0.5rem)] z-[10000] overflow-hidden rounded-2xl border border-black/10 bg-white text-left text-black shadow-[0_18px_44px_rgba(15,23,42,0.22)]",children:J&&0===W.length?(0,t.jsx)("div",{className:"px-4 py-3 text-sm font-medium text-gray-500",children:"Searching..."}):W.map(e=>(0,t.jsxs)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>{let t;(C(t=e.label||""),V(!1),e.href)?N.push(e.href):Q(t)},className:"flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-gray-50",children:[(0,t.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-gray-100 text-gray-600",children:e.image?(0,t.jsx)("img",{src:e.image,alt:"",className:"h-full w-full object-cover",loading:"lazy"}):(0,t.jsx)(u.MapPin,{className:"h-4 w-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm font-semibold text-gray-900",children:e.label}),(0,t.jsx)("span",{className:"block truncate text-xs text-gray-500",children:"tour"===e.source?e.description||"Tour":"google"===e.source?"Google Places":e.description||e.type})]})]},e.id))}):null;return k?f?(0,t.jsxs)("form",{className:"relative w-full max-w-full",onSubmit:e=>{e.preventDefault(),Q()},children:[(0,t.jsxs)("div",{className:"flex h-12 w-full items-center rounded-full border border-gray-200 bg-white px-4 shadow-[0_8px_22px_rgba(15,23,42,0.16)]",children:[(0,t.jsx)(d.Search,{className:"mr-2 h-4 w-4 shrink-0 text-black",strokeWidth:2.2}),(0,t.jsx)("input",{type:"search",enterKeyHint:"search",inputMode:"search",value:S,onChange:e=>C(e.target.value),onFocus:()=>S.trim().length>=2&&V(!0),onKeyDown:Z,placeholder:w.placeholder||"Find places and things to do",className:"min-w-0 flex-1 bg-transparent text-base text-gray-800 outline-none placeholder:text-gray-500"})]}),en,R&&(0,t.jsx)(n.default,{text:es,isError:!S.trim()})]}):(0,t.jsxs)("div",{className:"relative flex flex-col gap-2 w-full max-w-full border border-gray-300 rounded-full shadow-sm bg-white py-1 px-1",children:[(0,t.jsxs)("div",{className:"flex items-center w-full",children:[(0,t.jsx)("input",{type:"text",value:S,onChange:e=>C(e.target.value),onFocus:()=>S.trim().length>=2&&V(!0),onKeyDown:Z,placeholder:w.placeholder||"Find places and things to do",className:"flex-1 rounded-full px-2 py-2 outline-none text-gray-800 placeholder-gray-500 bg-white text-base"}),(0,t.jsx)("button",{onClick:()=>Q(),className:"bg-blue-600 text-white font-semibold rounded-full px-6 py-2 text-base ml-2 hover:bg-blue-700",children:w.button||"Search"})]}),en,R&&(0,t.jsx)(n.default,{text:es,isError:!S.trim()})]}):f?(0,t.jsxs)("div",{className:"relative z-[80] flex h-[66px] w-full cursor-pointer items-center rounded-full bg-white shadow-[0_10px_26px_rgba(15,23,42,0.26)]",onMouseLeave:()=>B(null),children:[(0,t.jsxs)("label",{className:`flex h-full min-w-0 flex-1 cursor-pointer flex-col justify-center rounded-l-full px-7 text-left transition-all duration-200 ${"when"===q?"opacity-45":"opacity-100"} ${"where"===q?"shadow-[0_8px_22px_rgba(15,23,42,0.14)]":""}`,onMouseEnter:()=>B("where"),children:[(0,t.jsx)("span",{className:"mb-2 text-[14px] font-bold leading-none text-black",children:w.whereTo||"Where to?"}),(0,t.jsx)("input",{type:"search",enterKeyHint:"search",value:S,onChange:e=>C(e.target.value),onFocus:()=>S.trim().length>=2&&V(!0),onKeyDown:Z,placeholder:w.placeholder||"Search for a place or activity",className:"h-4 min-w-0 cursor-text bg-transparent p-0 text-[13px] font-normal leading-4 text-gray-700 outline-none placeholder:text-gray-500"})]}),(0,t.jsx)("div",{className:`h-10 w-px scale-x-[0.35] bg-gray-500 transition-opacity duration-200 ${q?"opacity-0":"opacity-100"}`}),(0,t.jsxs)("div",{className:`flex h-full min-w-0 flex-1 cursor-pointer items-center justify-between rounded-r-full pl-7 pr-2 text-left transition-all duration-200 ${"when"===q?"shadow-[0_8px_22px_rgba(15,23,42,0.16)]":""}`,onMouseEnter:()=>B("when"),onClick:()=>A(!0),children:[(0,t.jsxs)("div",{className:`min-w-0 transition-opacity duration-200 ${"where"===q?"opacity-45":"opacity-100"}`,children:[(0,t.jsx)("span",{className:"mb-2 block text-[14px] font-bold leading-none text-black",children:w.when||"When"}),(0,t.jsx)("span",{className:"block h-4 truncate text-[13px] font-normal leading-4 text-gray-500",children:et})]}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),Q()},"aria-label":w.button||"Search",className:"ml-4 mr-2 flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-full bg-kt_regular text-white transition-colors hover:bg-kt_dark",children:(0,t.jsx)(d.Search,{className:"h-5 w-5",strokeWidth:2})})]}),P&&(0,t.jsxs)("div",{ref:z,className:"absolute right-0 top-[calc(100%+0.75rem)] z-[9999] w-[360px] cursor-default rounded-3xl border border-black/10 bg-white p-4 text-black shadow-[0_18px_50px_rgba(15,23,42,0.28)]",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsx)("button",{type:"button",onClick:()=>O(new Date(I.getFullYear(),I.getMonth()-1,1)),className:"flex h-9 w-9 items-center justify-center rounded-full text-black transition-colors hover:bg-gray-100","aria-label":w.previousMonth||"Previous month",children:(0,t.jsx)(o.ChevronLeft,{className:"h-5 w-5",style:{color:"#000000"}})}),(0,t.jsx)("div",{className:"text-sm font-bold",children:(0,x.formatDateInKemerTime)(I,_||"en",{month:"long",year:"numeric"})}),(0,t.jsx)("button",{type:"button",onClick:()=>
1O(new Date(I.getFullYear(),I.getMonth()+1,1)),className:"flex h-9 w-9 items-center justify-center rounded-full text-black transition-colors hover:bg-gray-100","aria-label":w.nextMonth||"Next month",children:(0,t.jsx)(c.ChevronRight,{className:"h-5 w-5",style:{color:"#000000"}})})]}),(0,t.jsx)("div",{className:"mb-2 grid grid-cols-7 text-center text-[11px] font-bold uppercase tracking-wide text-gray-500",children:ea.map(e=>(0,t.jsx)("span",{children:e},e))}),(0,t.jsx)("div",{className:"grid grid-cols-7 gap-1",children:er.map((e,s)=>{let a,r,l;if(!e)return(0,t.jsx)("div",{className:"h-10"},`empty-${s}`);let n=(a=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0"),`${a}-${r}-${l}`),i=M===n,o=e<el;return(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>{D(i?"":n),A(!1)},className:`flex h-10 items-center justify-center rounded-full text-sm transition-colors ${i?"bg-kt_regular font-bold text-white":o?"cursor-not-allowed text-gray-300":"text-black hover:bg-gray-100"}`,children:e.getDate()},n)})})]}),en,R&&(0,t.jsx)("div",{className:"absolute left-8 top-[calc(100%+0.75rem)]",children:(0,t.jsx)(n.default,{text:es,isError:!S.trim()})})]}):(0,t.jsxs)("div",{className:"relative flex items-center rounded-full overflow-visible min-w-[22rem] max-w-md mx-auto bg-white",style:{boxShadow:"inset 0 0.5px 0 rgba(15,23,42,0.12), -1px 0 2px rgba(15,23,42,0.12), 1px 0 2px rgba(15,23,42,0.12), 0 2px 2px rgba(15,23,42,0.30), 0 4px 3px rgba(15,23,42,0.14)"},children:[(0,t.jsx)(d.Search,{className:"ml-4 w-4 h-4 text-gray-500"}),(0,t.jsx)("input",{type:"text",value:S,onChange:e=>C(e.target.value),onFocus:()=>S.trim().length>=2&&V(!0),onKeyDown:Z,placeholder:w.placeholder||"Find places and things to do",className:"flex-1 min-w-0 px-3 py-2.5 rounded-full outline-none placeholder-gray-500 text-sm text-gray-800 bg-white"}),en,R&&(0,t.jsx)(n.default,{text:es,isError:!S.trim()})]})};e.s(["default",0,f],98195);var b=e.i(85438),y=e.i(22615),j=e.i(88123),v=e.i(81586),w=e.i(69547);let N=(0,w.default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var _=e.i(47710);let k=(0,w.default)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]),S=(0,w.default)("circle-dollar-sign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);var C=e.i(59643),$=e.i(40614);let E=(0,w.default)("building",[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]),T=(0,w.default)("mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);var L=e.i(70718);let M={"category.adventure_nature":"🏔️","category.boat_tours_cruises":"🚤","category.culture_history":"🏛️","category.water_sports":"🏄","category.wellness_spa":"💆","category.entertainment_shows":"🎭","category.family_kids":"👨‍👩‍👧‍👦","category.food_wine":"🍷","category.luxury_vip":"✨","category.shopping_local":"🛍️","category.sports_fitness":"⚽","category.eco_rural":"🌿","category.winter_mountain":"⛷️","category.romantic_honeymoon":"💕","category.special_interest_events":"🎪","category.airport_transfer":"✈️"};function D({open:e=!0,onClose:r}){let l=(0,a.useRouter)(),[n,o]=(0,s.useState)(!1),[d,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),[g,p]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),[y,w]=(0,s.useState)(!0),[P,A]=(0,s.useState)({countries:{},cities:{},areas:{},pois:[]}
1),[z,I]=(0,s.useState)([]),[O,R]=(0,s.useState)({}),{currentCurrency:F,currencies:q,changeCurrency:B,getCurrentCurrencySymbol:W,isLoading:K,isInitialized:U}=(0,j.useCurrency)(),{t:H,locale:J}=(0,i.useStaticTranslation)("MobileMenu"),Y="en"===J?"":`/${J}`,G=[{code:"en",name:"English"},{code:"tr",name:"Türkçe"},{code:"de",name:"Deutsch"},{code:"ru",name:"Русский"},{code:"nl",name:"Nederlands"},{code:"pl",name:"Polski"},{code:"ja",name:"日本語"}];(0,s.useEffect)(()=>{!async function(){let{data:e,error:t}=await v.supabase.from(`tours_${J||"en"}`).select("location");if(e){let t={},s={},a={},r=[];e.forEach(e=>{let l=e.location;if(l.country&&(t[l.country]||(t[l.country]={count:0,slug:l.country_slug}),t[l.country].count++),l.city&&(s[l.city]||(s[l.city]={count:0,city_slug:l.city_slug,country_slug:l.country_slug}),s[l.city].count++),l.area&&(a[l.area]||(a[l.area]={count:0,area_slug:l.area_slug,city_slug:l.city_slug,country_slug:l.country_slug}),a[l.area].count++),l.poi){let e=r.find(e=>e.name===l.poi);e?e.count++:r.push({name:l.poi,count:1,poi_slug:l.poi_slug,area_slug:l.area_slug,city_slug:l.city_slug,country_slug:l.country_slug})}}),A({countries:t,cities:s,areas:a,pois:r.sort((e,t)=>t.count-e.count)});let l=[...Object.values(t).slice(0,5).map(e=>e.slug),...Object.values(s).slice(0,5).map(e=>e.city_slug),...Object.values(a).slice(0,5).map(e=>e.area_slug),...r.slice(0,8).map(e=>e.poi_slug)].filter(Boolean);if(l.length>0){let{data:e}=await v.supabase.from("location_index").select("slug, image").in("slug",l);if(e){let t={};e.forEach(e=>{e.image&&"string"==typeof e.image&&(t[e.slug]=e.image+"?width=100&height=100&quality=80")}),R(t)}}}}()},[J]),(0,s.useEffect)(()=>{!async function(){let{data:e,error:t}=await v.supabase.from("tour_categories").select(`
2          id,
3          slug,
4          sort_order,
5          tour_category_translations!inner (
6            label
7          )
8        `).eq("tour_category_translations.lang",J).eq("is_active",!0).order("sort_order");t?console.error("Category fetch error:",t):I(e.map(e=>({id:e.id,slug:e.slug,name:e.tour_category_translations[0].label})))}()},[J]),(0,s.useEffect)(()=>{(async()=>{try{let{data:{session:e}}=await v.supabase.auth.getSession();if(e?.user){p(e.user);let t=e.user.user_metadata?.user_type;b(!t||"customer"===t)}}catch(e){console.error("Error checking user:",e)}finally{w(!1)}})();let{data:{subscription:e}}=v.supabase.auth.onAuthStateChange((e,t)=>{if(t?.user){p(t.user);let e=t.user.user_metadata?.user_type;b(!e||"customer"===e)}else p(null),b(!1);w(!1)});return()=>e.unsubscribe()},[]);let V=[{icon:k,label:g&&f?"My Profile":H.loginOrSignup||"Log in or Sign Up",value:g&&f&&`${g.user_metadata?.first_name||""} ${g.user_metadata?.last_name||""}`.trim(),onClick:()=>{g&&f?l.push(`${Y}/user-account`):l.push(`${Y}/user?tab=signin`)}},{icon:S,label:H.currency||"Currency",value:U?`${W()} ${F}`:"USD",onClick:()=>{o(!0)}},{icon:C.LanguagesIcon,label:H.language||"Language",value:G.find(e=>e.code===J)?.name||"English",onClick:()=>{x(!0)}},{icon:L.Handshake,label:H.becomeASupplier||"Become a supplier",onClick:()=>{l.push(`${Y}/supplier?tab=signup`)}}],X=[{id:"places",icon:u.MapPin,label:H.placesToSee||"Places to see"},{id:"things",icon:N,label:H.thingsToDo||"Things to do"},{id:"inspiration",icon:_.Sparkles,label:H.tripInspiration||"Trip inspiration"}];return e?(0,t.jsxs)("div",{className:"fixed inset-0 z-[9999] flex flex-col text-[#1a2942]",children:[(0,t.jsx)("div",{className:"w-full bg-[#1a2942] h-16 flex items-center justify-end px-6 relative",children:(0,t.jsx)("button",{className:"text-white text-3xl focus:outline-none",onClick:r,"aria-label":"Close menu",children:"×"})}),(0,t.jsxs)("div",{className:"w-full max-w-md mx-auto bg-white h-full overflow-y-auto flex flex-col shadow-xl relative",children:[(0,t.jsxs)("div",{className:"p-6 pb-2",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold text-[#1a2942] mb-4",children:H.explore}),(0,t.jsx)("div",{className:"divide-y divide-gray-200",children:X.map(e=>{let s=e.icon,a=h===e.id;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>{var t;m(h===(t=e.id)?null:t)},className:"w-full flex items-center py-4 gap-4 text-lg font-medium text-[#1a2942] transition",children:[(0,t.jsx)(s,{className:"h-6 w-6"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),(0,t.jsx)(c.ChevronRight,{className:`h-5 w-5 text-gray-400 transition-transform ${a?"rotate-90":""}`})]}),a&&(0,t.jsxs)("div",{className:"pb-4",children:["places"===e.id&&(0,t.jsxs)("div",{className:"px-2 space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs border-b py-2 font-bold text-gray-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,t.jsx)($.Globe,{className:"w-3 h-3"}),H.countries||"Countries"]}),(0,t.jsx)("div",{className:"space-y-2",children:Object.entries(P.countries).slice(0,4).map(([e,s])=>(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/${s.slug}`),r()},className:"w-full flex items-center gap-3 p-2 bg-white rounded-lg hover:bg-blue-50 transition-colors",children:[O[s.slug]&&(0,t.jsx)("img",{src:O[s.slug],alt:e,className:"w-12 h-12 rounded-lg object-cover"}),(0,t.jsxs)("div",{className:"flex-1 text-left",children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e}),(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:[s.count," ",H.tours||"tours"]})]}),(0,t.jsx)(c.ChevronRight,{className:"w-4 h-4 text-gray-400"})]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs border-b py-2 font-bold text-gray-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,t.jsx)(E,{className:"w-3 h-3"}),H.cities||"Cities"]}),(0,t.jsx)("div",{className:"space-y-2",children:Object.entries(P.cities).slice(0,4).map(([e,s])=>(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/${s.country_slug}/${s.city_slug}`),r()},className:"w-full flex items-center gap-3 p-2 bg-white rounded-lg hover:bg-blue-50 transition-colors",children:[O[s.city_slug]&&(0,t.jsx)("img",{src:O[s.city_slug],alt:e,className:"w-12 h-12 rounded-lg object-cover"}),(0,t.jsxs)("div",{className:"flex-1 text-left",children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e}),(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:[s.count," ",H.tours||"tours"]})]}),(0,t.jsx)(c.ChevronRight,{className:"w-4 h-4 text-gray-400"})]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs border-b py-2 font-bold text-gray-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,t.jsx)(T,{className:"w-3 h-3"}),H.regions||"Regions"]}),(0,t.jsx)("div",{className:"space-y-2",children:Object.entries(P.areas).slice(0,4).map(([e,s])=>(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/${s.country_slug}/${s.city_slug}/${s.area_slug}`),r()},className:"w-full flex items-center gap-3 p-2 bg-white rounded-lg hover:bg-blue-50 transition-colors",children:[O[s.area_slug]&&(0,t.jsx)("img",{src:O[s.area_slug],alt:e,className:"w-12 h-12 rounded-lg object-cover"}),(0,t.jsxs)("div",{className:"flex-1 text-left",children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e}),(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:[s.count," ",H.tours||"tours"]})]}),(0,t.jsx)(c.ChevronRight,{className:"w-4 h-4 text-gray-400"})]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs border-b py-2 font-bold text-gray-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,t.jsx)(u.MapPin,{className:"w-3 h-3"}),H.popularPlaces||"Popular Places"]}),(0,t.jsx)("div",{className:"space-y-2",children:P.pois.slice(0,6).map(e=>(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/${e.country_slug}/${e.city_slug}/${e.area_slug}/${e.poi_slug}`),r()},className:"w-full flex items-center gap-3 p-2 bg-white rounded-lg hover:bg-blue-50 transition-colors",children:[O[e.poi_slug]&&(0,t.jsx)("img",{src:O[e.poi_slug],alt:e.name,className:"w-12 h-12 rounded-lg object-cover"}),(0,t.jsxs)("div",{className:"flex-1 text-left",children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:[e.count," ",H.tours||"tours"]})]}),(0,t.jsx)(c.ChevronRight,{className:"w-4 h-4 text-gray-400"})]},e.name))})]})]}),"things"===e.id&&(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-4",children:[(0,t.jsx)("h3",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:H.categories||"Categories"}),(0,t.jsx)("div",{className:"space-y-2",children:z.map(e=>(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/things-to-do/${e.slug}`),r()},className:"w-full flex items-center gap-3 p-3 bg-white rounded-lg hover:bg-blue-50 transition-colors",children:[(0,t.jsx)("span",{className:"text-2xl",children:M[e.id]||"🎯"}),(0,t.jsx)("span",{className:"flex-1 text-left font-medium text-[#1a2942]",children:e.name}),(0,t.jsx)(c.ChevronRight,{className:"w-4 h-4 text-gray-400"})]},e.id))})]}),"inspiration"===e.id&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/blog`),r()},className:"w-full mt-3 relative rounded-xl overflow-hidden h-28",children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/travel_blog.jpg",alt:"Travel Blog",className:"absolute inset-0 w-full h-full object-cover"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 p-3 text-white text-left",children:[(0,t.jsx)("h4",{className:"font-bold text-base",children:H.travelBlog||"Travel Blog"}),(0,t.jsx)("p",{className:"text-xs text-gray-200",children:H.tipsAndStories||"Tips & stories"})]})]}),(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/things-to-do/best-sellers`),r()},className:"w-full relative rounded-xl overflow-hidden h-28",children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/best_seller.webp",alt:"Best Sellers",className:"absolute inset-0 w-full h-full object-cover"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 p-3 text-white text-left",children:[(0,t.jsx)("h4",{className:"font-bold text-base",children:H.bestSellers||"Best Sellers"}),(0,t.jsx)("p",{className:"text-xs text-gray-200",children:H.mostPopularTours||"Most popular tours"})]})]}),(0,t.jsxs)("button",{onClick:()=>{l.push(`${Y}/things-to-do/new`),r()},className:"w-full relative rounded-xl overflow-hidden h-28",children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/whats_new.webp",alt:"What's New",className:"absolute inset-0 w-full h-full object-cover"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 p-3 text-white text-left",children:[(0,t.jsx)("h4",{className:"font-bold text-base",children:H.whatsNew||"What's New"}),(0,t.jsx)("p",{className:"text-xs text-gray-200",children:H.latestExperiences||"Latest experiences"})]})]})]})]})]},e.id)})})]}),(0,t.jsxs)("div",{className:"p-6 pt-2",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold text-[#1a2942] mb-4",children:H.profile}),(0,t.jsx)("div",{className:"divide-y divide-gray-200",children:V.map(e=>{let s=e.icon;return(0,t.jsxs)("button",{className:"flex items-center py-4 gap-4 w-full text-lg font-medium text-[#1a2942] transition",onClick:e.onClick,children:[(0,t.jsx)(s,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"ml-auto text-base text-gray-500 font-bold",children:e.value}),(0,t.jsx)("span",{className:"ml-2 text-2xl text-gray-400",children:"›"})]},e.label)})})]}),n&&(0,t.jsxs)("div",{className:"absolute inset-0 bg-white z-10 flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[(0,t.jsxs)("button",{onClick:()=>o(!1),className:"text-blue-600 text-lg font-medium",children:["← ",H.back]}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-[#1a2942]",children:H.selectCurrency}),(0,t.jsx)("div",{className:"w-12"})," "]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:K?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)("div",{className:"text-gray-500",children:H.loadingCurrencies})}):(0,t.jsx)("div",{className:"divide-y divide-gray-200",children:q.map(e=>(0,t.jsxs)("button",{onClick:()=>{B(e.ISO),o(!1)},className:`w-full px-4 py-4 text-left hover:bg-gray-50 transition-colors flex items-center justify-between ${F===e.ISO?"bg-blue-50 text-blue-700":"text-gray-700"}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("span",{className:`font-semibold text-xl ${F===e.ISO?"text-blue-600":"text-gray-600"}`,children:e.symbol}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e.name}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:e.ISO})]})]}),F===e.ISO&&(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"})]},e.id))})})]}),d&&(0,t.jsxs)("div",{className:"absolute inset-0 bg-white z-[100] flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 flex-shrink-0",children:[(0,t.jsxs)("button",{onClick:()=>x(!1),className:"text-blue-600 text-lg font-medium",children:["← ",H.back]}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-[#1a2942]",children:H.selectLanguage}),(0,t.jsx)("div",{className:"w-12"})," "]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto bg-gray-50",children:(0,t.jsx)("div",{className:"divide-y divide-gray-200",children:G.map(e=>(0,t.jsxs)("button",{onClick:()=>(e=>{let{asPath:t}=l;localStorage.setItem("preferred_locale",e),document.cookie=`preferred_locale=${e}; Max-Age=31536000; Path=/; SameSite=Lax`;let s=t.split("/").filter(e=>""!==e);s.length>0&&s[0].length<=3&&G.some(e=>e.code===s[0])&&s.shift();let a=s.length>0?"/"+s.join("/"):"",r=`/${e}${a}`;window.location.href=r})(e.code),className:`w-full px-4 py-4 text-left hover:bg-gray-50 transition-colors flex items-center justify-between ${J===e.code?"bg-blue-50 text-blue-700":"text-gray-700 bg-white"}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold ${J===e.code?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-600"}`,children:e.code.toUpperCase()}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium text-[#1a2942]",children:e.name}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:e.code.toUpperCase()})]})]}),J===e.code&&(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"})]},e.code))})})]})]})]}):null}var P=e.i(65126),A=e.i(68462);let z="recentTourSearches";function I(e){if(null==e)return"";let t=String(e).trim();return t?t.replace(/^category\./i,"").replace(/_/g,"-").toLowerCase():""}function O({open:e,onClose:r}
8){let l=(0,a.useRouter)(),n=l.locale||"en",[i,o]=(0,s.useState)(""),[c,u]=(0,s.useState)([]),[x,h]=(0,s.useState)([]),[m,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!e)return;let t=localStorage.getItem(z);if(!t)return void u([]);try{let e=JSON.parse(t);u(Array.isArray(e)?e:[])}catch{u([])}},[e]),(0,s.useEffect)(()=>{if(!e)return;let t=!1;return async function(){g(!0);try{let{data:e,error:s}=await v.supabase.from("tour_categories").select(`
9            id,
10            slug,
11            sort_order,
12            tour_category_translations!inner (
13              label
14            )
15          `).eq("tour_category_translations.lang",n).eq("is_active",!0).order("sort_order");if(s||!Array.isArray(e)){s&&console.error("Failed to load search suggestions categories:",s),t||h([]);return}let a=`tours_${n}`,{data:r,error:l}=await v.supabase.from(a).select("category_id");l&&console.error("Failed to load search suggestions tour counts:",l);let i=new Map;(Array.isArray(r)?r:[]).forEach(e=>{let t=I(e?.category_id);t&&i.set(t,(i.get(t)||0)+1)});let o=e.map(e=>{let t=I(e.id),s=I(e.slug),a=Math.max(i.get(t)||0,i.get(s)||0);return{id:e.id,slug:e.slug,title:e.tour_category_translations?.[0]?.label||e.slug,totalActivities:a}});t||h(o)}catch(e){console.error("Failed to load mobile search suggestions:",e),t||h([])}finally{t||g(!1)}}(),()=>{t=!0}},[e,n]),(0,s.useEffect)(()=>{if(!e||"u"<typeof document)return;let t=document.body.style.overflow;document.body.style.overflow="hidden";let s=e=>{"Escape"===e.key&&r()};return document.addEventListener("keydown",s),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",s)}},[e,r]);let p=(0,s.useMemo)(()=>{let e=i.trim().toLowerCase();return e?x.filter(t=>t.title.toLowerCase().includes(e)):x},[x,i]),f=async e=>{let t=(e||"").trim();if(t){let e;(e=(t||"").trim())&&u(t=>{let s=t.filter(t=>t.toLowerCase()!==e.toLowerCase()),a=[e,...s].slice(0,6);return localStorage.setItem(z,JSON.stringify(a)),a}),await l.push({pathname:"/search",query:{destination:t}},`/${n}/search?destination=${encodeURIComponent(t)}`),r()}},b=async e=>{e.preventDefault(),await f(i)};return e?(0,t.jsx)("div",{className:"fixed inset-0 z-[9999] bg-black/55 flex items-end sm:items-center justify-center",onClick:r,children:(0,t.jsxs)("div",{className:"w-full sm:max-w-lg bg-white rounded-t-3xl sm:rounded-3xl shadow-2xl max-h-[90vh] overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4 pb-2 border-b border-gray-100",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Search"}),(0,t.jsx)("button",{type:"button",onClick:r,className:"h-9 w-9 rounded-full flex items-center justify-center hover:bg-gray-100 transition","aria-label":"Close search",children:(0,t.jsx)(A.X,{className:"h-5 w-5 text-gray-700"})})]}),(0,t.jsxs)("div",{className:"p-4 overflow-y-auto max-h-[calc(90vh-62px)]",children:[(0,t.jsxs)("form",{onSubmit:b,className:"relative",children:[(0,t.jsx)(d.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,t.jsx)("input",{value:i,onChange:e=>o(e.target.value),placeholder:"Search tours, places or activities",className:"w-full h-12 rounded-xl border border-gray-200 pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",autoFocus:!0})]}),c.length>0&&(0,t.jsxs)("section",{className:"mt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Recent Searches"}),(0,t.jsx)("button",{type:"button",onClick:()=>{u([]),localStorage.removeItem(z)},className:"text-xs text-gray-500 hover:text-gray-700",children:"Clear"})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>f(e),className:"inline-flex items-center gap-1.5 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm px-3 py-1.5 transition",children:[(0,t.jsx)(P.Clock3,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsxs)("section",{className:"mt-6",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Suggestions"}),m?(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Loading suggestions..."}):0===p.length?(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"No suggestions foun
15d."}):(0,t.jsx)("div",{className:"space-y-1",children:p.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>f(e.title),className:"w-full text-left rounded-xl px-3 py-2.5 hover:bg-gray-50 transition",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:[e.totalActivities," activities"]})]},e.id))})]})]})]})}):null}var R=e.i(39891),F=e.i(64303),q=e.i(69437),B=e.i(19753),W=e.i(69252);e.s(["HeartIcon",()=>W.default],43849);var W=W,K=e.i(32208);let U=`https://wa.me/${"+905551782207".replace(/[^\d]/g,"")}`;function H({Cart:e,becomeSupplier:n=!0,Login:o,Language:c,isIndex:u=!1,light:d=!1,loginHref:x}){let{t:h}=(0,i.useStaticTranslation)("Header"),[m,g]=(0,s.useState)(!1),[p,f]=(0,s.useState)(0),{isMobile:j}=(0,l.useDevice)(),v=(0,a.useRouter)(),[w,N]=(0,s.useState)(!1),[_,k]=(0,s.useState)(!1),{locale:S}=v,C="en"===S?"":`/${S}`,{user:$}=(0,R.useAuth)(),E=x||`${C}/user?tab=signin`,T=$?.user_metadata||$?.raw_user_meta_data||{},L="hotel"===T.user_type?T.hotel_name||T.username||$?.email?.split("@")[0]:T.full_name?.split(" ")[0]||T.email?.split("@")[0]||$?.email?.split("@")[0];if((0,s.useEffect)(()=>{function e(){let e=localStorage.getItem("cartTours");if(e)try{let t=JSON.parse(e);f(Array.isArray(t)?t.length:1)}catch{f(0)}else f(0)}g(!0),e();let t=setInterval(e,500),s=t=>{"cartTours"===t.key&&e()};return window.addEventListener("storage",s),()=>{clearInterval(t),window.removeEventListener("storage",s)}},[]),!m)return null;if(j)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("a",{href:U,target:"_blank",rel:"noopener noreferrer","aria-label":"Chat on WhatsApp",className:"flex h-6 w-6 items-center justify-center",children:(0,t.jsx)(K.WhatsApp,{className:u?"h-5 w-5 text-white":"h-5 w-5 text-black"})}),B.SearchIcon&&(0,t.jsx)("button",{type:"button","aria-label":h["searchBox.button"],"aria-haspopup":"dialog",className:"flex flex-col items-center",onClick:()=>k(!0),children:u?(0,t.jsx)(B.SearchIcon,{className:"h-6 w-6 cursor-pointer text-white"}):(0,t.jsx)(B.SearchIcon,{className:"h-6 w-6 cursor-pointer text-gray-700"})}),e&&p>0&&(0,t.jsx)(r.default,{className:"flex flex-col items-center relative",href:`${C}/cart`,"aria-label":h.cart,children:(0,t.jsxs)("div",{className:"relative",children:[u?(0,t.jsx)(W.default,{className:"h-6 w-6 cursor-pointer text-white"}):(0,t.jsx)(W.default,{className:"h-6 w-6 cursor-pointer text-gray-700"}),(0,t.jsx)("span",{className:"absolute -top-2 -right-2 bg-red-700 text-white text-xs rounded-full px-1.5 cursor-pointer",children:p})]})}),o&&(0,t.jsx)(r.default,{className:"flex flex-col items-center",href:E,"aria-label":L||h.login,children:u?(0,t.jsx)(F.UserCircle2,{className:"h-6 w-6 cursor-pointer text-white"}):(0,t.jsx)(F.UserCircle2,{className:"h-6 w-6 cursor-pointer text-gray-700"})}),(0,t.jsx)("div",{className:"flex flex-col items-center",children:(0,t.jsx)("button",{className:"h-6 w-6 flex items-center justify-center cursor-pointer p-0 bg-transparent border-none",type:"button","aria-label":(0,b.getMobileControlText)(S).menu,onClick:()=>N(!0),children:u?(0,t.jsx)(q.Menu,{className:"h-6 w-6 text-white"}):(0,t.jsx)(q.Menu,{className:"h-6 w-6 text-gray-700"})})})]}),w&&(0,t.jsx)(D,{open:w,onClose:()=>N(!1)}),_&&(0,t.jsx)(O,{open:_,onClose:()=>k(!1)})]});{let s=d?"text-white":"text-gray-500";return(0,t.jsxs)("div",{className:`flex items-center gap-7 mt-1 ${s} justify-center`,children:[n&&(0,t.jsx)(r.default,{className:"flex flex-col items-center mr-16",href:`${C}/supplier?tab=signup`,children:(0,t.jsx)("span",{className:`text-xs ${s} font-regular mt-1 cursor-pointer`,children:h.becomeASupplier||"Become a Supplier"})}),(0,t.jsxs)("a",{href:U,target:"_blank",rel:"noopener noreferrer","aria-label":"Chat on WhatsApp",className:"flex flex-col items-center",children:[(0,t.jsx)(K.WhatsApp,{className:`h-5 w-5 ${s}`}),(0,t.jsx)("span",{className:`text-xs ${s} font-regular mt-1 cursor-pointer`,children:"WhatsApp"})]}),e&&p>0&&(0,t.jsxs)(r.default,{className:"flex flex-col items-center relative",href:`${C}/cart`,"aria-label":h.cart,children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(W.default,{className:`h-5 w-5 cursor-pointer ${s}`}),(0,t.jsx)("span",{className:"absolute -top-2 -right-2 bg-red-700 text-white text-xs rounded-full px-1.5 cursor-pointer",children:p})]}),(0,t.jsx)("span",{className:`text-xs ${s} font-regular mt-1 cursor-pointer`,children:h.cart||"Wishlist"})]}),o&&(0,t.jsxs)(r.default,{className:"flex flex-col items-center",href:E,"aria-label":L||h.login,children:[(0,t.jsx)(F.UserCircle2,{className:`h-5 w-5 cursor-pointer ${s}`}),$?(0,t.jsx)("span",{className:`text-xs ${s} font-regular mt-1 cursor-pointer`,children:L}):(0,t.jsx)("span",{className:`text-xs ${s} font-regular mt-1 cursor-pointer`,children:h.login||"Login"})]}),c&&(0,t.jsx)("div",{className:"flex flex-col items-center",children:(0,t.jsx)(y.default,{light:d})})]})}}e.s(["default",0,H],35508);var J=e.i(18324);let Y={},G={},V=e=>[...e].sort((e,t)=>
15(t[1]?.count||0)-(e[1]?.count||0));e.s(["default",0,function({scrollWithPage:e=!1,isIndex:n=!1,noSearchBox:o=!1,noMobileBorder:c=!1,showBecomeSupplier:d=!0}){let x=(0,a.useRouter)();x.query?.country&&x.query?.city&&x.query?.area&&x.query?.slug;let h="/transfer/reserve"===x.pathname||x.asPath?.split("?")[0]?.endsWith("/transfer/reserve"),m=n||h,[g,p]=(0,s.useState)(null),{locale:b}=x,y="en"===b?"":`/${b}`,{t:j}=(0,i.useStaticTranslation)("Header"),[w,k]=(0,s.useState)(!1),{isMobile:S}=(0,l.useDevice)(),[C,L]=(0,s.useState)(null),[M,D]=(0,s.useState)(!1),[P,A]=(0,s.useState)({countries:{},cities:{},areas:{},pois:[]}),[z,I]=(0,s.useState)([]),[O,R]=(0,s.useState)(!1),[F,q]=(0,s.useState)(!1),B=(0,s.useRef)(null),W=(0,s.useRef)(null),U={"category.adventure_nature":"🏔️","category.boat_tours_cruises":"🚤","category.culture_history":"🏛️","category.water_sports":"🏄","category.wellness_spa":"💆","category.entertainment_shows":"🎭","category.family_kids":"👨‍👩‍👧‍👦","category.food_wine":"🍷","category.luxury_vip":"✨","category.shopping_local":"🛍️","category.sports_fitness":"⚽","category.eco_rural":"🌿","category.winter_mountain":"⛷️","category.romantic_honeymoon":"💕","category.special_interest_events":"🎪","category.airport_transfer":"✈️"};(0,s.useEffect)(()=>{A({countries:{},cities:{},areas:{},pois:[]}),I([]),R(!1),q(!1)},[b]);let X=async()=>{let e=b||"en",t=Y[e];if(t)return void A(t);R(!0);try{let{data:t}=await v.supabase.from(`tours_${e}`).select("location");if(!t)return;let s={},a={},r={},l=new Map;t.forEach(e=>{let t="string"==typeof e.location?JSON.parse(e.location):e.location;if(t&&(t.country&&(s[t.country]||(s[t.country]={areas:new Set,count:0,slug:t.country_slug}),s[t.country].count++,t.area&&s[t.country].areas.add(t.area)),t.city&&(a[t.city]||(a[t.city]={areas:new Set,country:t.country,count:0,country_slug:t.country_slug,city_slug:t.city_slug}),a[t.city].count++,t.area&&a[t.city].areas.add(t.area)),t.area&&(r[t.area]||(r[t.area]={pois:new Set,country:t.country,count:0,country_slug:t.country_slug,city_slug:t.city_slug,area_slug:t.area_slug}),r[t.area].count++,t.poi&&r[t.area].pois.add(t.poi)),t.poi)){let e=l.get(t.poi);e?e.count+=1:l.set(t.poi,{name:t.poi,area:t.area,country:t.country,poi_slug:t.poi_slug,city_slug:t.city_slug,area_slug:t.area_slug,country_slug:t.country_slug,count:1})}}),Object.keys(s).forEach(e=>{s[e].areas=Array.from(s[e].areas)}),Object.keys(a).forEach(e=>{a[e].areas=Array.from(a[e].areas)}),Object.keys(r).forEach(e=>{r[e].pois=Array.from(r[e].pois)});let n={countries:s,cities:a,areas:r,pois:Array.from(l.values()).sort((e,t)=>t.count-e.count)};Y[e]=n,A(n)}finally{R(!1)}},Q=async()=>{let e=b||"en",t=G[e];if(t)return void I(t);q(!0);try{let{data:t,error:s}=await v.supabase.from("tour_categories").select(`
16          id,
17          slug,
18          sort_order,
19          tour_category_translations!inner (
20            label
21          )
22        `).eq("tour_category_translations.lang",e).eq("is_active",!0).order("sort_order");if(s||!t){s&&console.error("Category fetch error:",s);return}let a=t.map(e=>({id:e.id,slug:e.slug,name:e.tour_category_translations[0].label}));G[e]=a,I(a)}finally{q(!1)}};(0,s.useEffect)(()=>{"places"!==C||0!==Object.keys(P.countries).length||O||X(),"things"!==C||0!==z.length||F||Q()},[C,b]),(0,s.useEffect)(()=>{let{country:e,city:t,area:s,poi:a,slug:r}=x.query;e&&t&&s&&a&&r?async function(){let{data:e}=await v.supabase.from(`tours_${b||"en"}`).select("location").eq("slug",r).single();if(e){let t="string"==typeof e.location?JSON.parse(e.location):e.location;p({country:t.country,city:t.city,area:t.area,poi:t.poi,country_slug:t.country_slug,city_slug:t.city_slug,area_slug:t.area_slug,poi_slug:t.poi_slug})}}():p(null)},[x.query,b]),(0,s.useEffect)(()=>(C?(W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{D(!0)},120)):(W.current&&clearTimeout(W.current),D(!1)),()=>{W.current&&clearTimeout(W.current)}),[C]),(0,s.useEffect)(()=>{function e(e){B.current&&!B.current.contains(e.target)&&L(null)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{let e=()=>{k(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]);
22let Z=[{id:"places",label:j.placesToSee||"Places to see",icon:u.MapPin},{id:"things",label:j.thingsToDo||"Things to do",icon:N},{id:"inspiration",label:j.tripInspiration||"Trip inspiration",icon:_.Sparkles}];return S?(0,t.jsx)("div",{className:`text-center ${m||c?"":"border-b border-gray-100"}`,children:(0,t.jsxs)("div",{className:`flex items-center justify-between w-full px-4 py-1.5 ${m?"":"bg-white"}`,children:[(0,t.jsx)(r.default,{href:`${y||"/"}`,children:m?(0,t.jsx)(K.KemerToursLogo,{className:"text-white",width:84,height:46}):(0,t.jsx)(K.KemerToursLogo,{className:"text-kt_regular",width:84,height:46})}),(0,t.jsx)(H,{Language:!0,Cart:!0,isIndex:m})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{ref:B,onMouseLeave:()=>L(null),className:e?`fixed left-0 w-full z-50 ${m?"bg-transparent":"bg-white"} transition-opacity duration-300 ${w?"opacity-90":"opacity-100"} ${C||m?"":"border-b border-gray-100"}`:`w-full ${m?"bg-transparent":"bg-white border-b border-gray-100"} z-50`,children:[(0,t.jsxs)("div",{className:"relative max-w-8xl py-2 px-4 mx-auto justify-between space-x-4 flex items-center transition-all duration-300",children:[(0,t.jsxs)("div",{className:"flex items-center w-full justify-between gap-8 py-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)(r.default,{href:`${y||"/"}`,className:"flex items-center",children:(0,t.jsx)(K.KemerToursLogo,{className:m?"text-white":"text-kt_regular",width:88,height:48})})}),(0,t.jsxs)("button",{type:"button",onClick:()=>L(C?null:"places"),"aria-expanded":!!C,className:`flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors ${C?"border-kt_regular bg-kt_regular text-white":m?"border-white/50 bg-transparent text-white hover:border-white hover:bg-white/10":"border-gray-200 bg-white text-black hover:border-gray-300 hover:bg-gray-50"}`,children:[(0,t.jsx)("span",{children:j.discover||"Discover"}),(0,t.jsx)(J.ChevronDown,{className:`h-4 w-4 transition-transform ${C?"rotate-180":""}`,color:C||m?"#ffffff":"#111827"})]}),!o&&(0,t.jsx)("div",{className:"flex items-center h-full",children:(0,t.jsx)(f,{isIndexPage:!1})})]}),(0,t.jsx)("div",{className:"flex items-start",children:(0,t.jsx)(H,{Cart:!0,Login:!0,Language:!0,becomeSupplier:d,light:m})})]}),C&&(0,t.jsx)("div",{className:"absolute left-0 right-0 top-full z-50 bg-white drop-shadow-xl",style:{boxShadow:"0 18px 48px rgba(15,23,42,0.22), 0 4px 12px rgba(15,23,42,0.14)"},children:(0,t.jsxs)("div",{className:"w-full px-6 pb-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-gray-100 pt-4",children:Z.map(e=>{let s=e.icon,a=C===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>L(e.id),className:`relative flex items-center gap-2 pb-3 pt-1 pr-6 text-sm font-semibold transition-colors ${a?"text-black":"text-black/70 hover:text-black"}`,children:[(0,t.jsx)(s,{className:`h-4 w-4 ${a?"header-discover-brand-icon text-kt_regular":"header-discover-muted-icon text-black/45"}`,color:"currentColor",strokeWidth:2}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:`absolute bottom-0 left-0 right-6 h-[2px] origin-center bg-[#ff5533] transition-all duration-300 ${a?"scale-x-100 opacity-100":"scale-x-0 opacity-0"}`})]},e.id)})}),M&&("places"===C?O?(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:j.loadingPlaces||"Loading places..."}):(0,t.jsxs)("div",{className:"grid w-full grid-cols-4 gap-8 px-0 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-sm font-bold text-black uppercase tracking-wider mb-4 flex items-center gap-2",children:[(0,t.jsx)($.Globe,{className:"header-discover-brand-icon w-4 h-4 text-kt_regular",color:"currentColor"}),j.nav_countries||j.countries||"Countries"]}),(0,t.jsx)("ul",{className:"space-y-2",children:V(Object.entries(P.countries)).slice(0,8).map(([e,s])=>(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`${y}/${s.slug}`,className:"flex items-center justify-between text-black transition-colors py-1 group",onClick:()=>L(null),children:[(0,t.jsx)("span",{className:"group-hover:translate-x-1 transition-transform",children:e}),(0,t.jsx)("span",{className:"text-xs text-black bg-gray-100 px-2 py-0.5 rounded-full",children:s.count})]})},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-sm font-bold text-black uppercase tracking-wider mb-4 flex items-center gap-2",children:[(0,t.jsx)(E,{className:"header-discover-brand-icon w-4 h-4 text-kt_regular",color:"currentColor"}),j.nav_cities||j.cities||"Cities"]}),(0,t.jsx)("ul",{className:"space-y-2",children:V(Object.entries(P.cities)).slice(0,8).map(([e,s])=>(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`${y}/${s.country_slug}/${s.city_slug}`,className:"flex items-center justify-between text-black transition-colors py-1 group",onClick:()=>L(null),children:[(0,t.jsx)("span",{className:"group-hover:translate-x-1 transition-transform",children:e}),(0,t.jsx)("span",{className:"text-xs text-black bg-gray-100 px-2 py-0.5 rounded-full",children:s.count})]})},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-sm font-bold text-black uppercase tracking-wider mb-4 flex items-center gap-2",children:[(0,t.jsx)(T,{className:"header-discover-brand-icon w-4 h-4 text-kt_regular",color:"currentColor"}),j.nav_regions||j.regions||"Regions"]}),(0,t.jsx)("ul",{className:"space-y-2",children:V(Object.entries(P.areas)).slice(0,8).map(([e,s])=>(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`${y}/${s.country_slug}/${s.city_slug}/${s.area_slug}`,className:"flex items-center justify-between text-black transition-colors py-1 group",onClick:()=>L(null),children:[(0,t.jsx)("span",{className:"group-hover:translate-x-1 transition-transform",children:e}),(0,t.jsx)("span",{className:"text-xs text-black bg-gray-100 px-2 py-0.5 rounded-full",children:s.count})]})},e))})]}),(0,t.jsxs)("div",{className:"col-span-1",children:[(0,t.jsxs)("h3",{className:"text-sm font-bold text-black uppercase tracking-wider mb-4 flex items-center gap-2",children:[(0,t.jsx)(u.MapPin,{className:"header-discover-brand-icon w-4 h-4 text-kt_regular",color:"currentColor"}),j.nav_popular_places||j.popularPlaces||"Popular Places"]}),(0,t.jsx)("ul",{className:"space-y-2",children:P.pois.slice(0,8).map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`${y}/${e.country_slug}/${e.city_slug}/${e.area_slug}/${e.poi_slug}`,className:"flex items-center justify-between text-black transition-colors py-1 group",onClick:()=>L(null),children:[(0,t.jsx)("span",{className:"group-hover:translate-x-1 transition-transform",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-black bg-gray-100 px-2 py-0.5 rounded-full",children:e.count})]})},e.name))})]})]}):"things"===C?F?(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:j.loadingCategories||"Loading c
22ategories..."}):(0,t.jsxs)("div",{className:"w-full px-0 py-4",children:[(0,t.jsx)("h3",{className:"text-sm font-bold text-black uppercase tracking-wider mb-4",children:j.nav_categories||j.categories||"Categories"}),(0,t.jsx)("div",{className:"grid w-full grid-cols-4 gap-4",children:z.map(e=>(0,t.jsxs)(r.default,{href:`${y}/things-to-do/${e.slug}`,className:"flex items-center gap-3 p-3 rounded-xl text-black hover:bg-gray-50 transition-colors group",onClick:()=>L(null),children:[(0,t.jsx)("span",{className:"text-2xl group-hover:scale-110 transition-transform",children:U[e.id]||"🎯"}),(0,t.jsx)("span",{className:"font-medium text-black",children:e.name})]},e.id))})]}):"inspiration"===C?(0,t.jsx)("div",{className:"w-full px-0 py-4",children:(0,t.jsxs)("div",{className:"grid w-full grid-cols-3 gap-6",children:[(0,t.jsxs)(r.default,{href:`${y}/blog`,className:"group relative rounded-xl overflow-hidden h-40",onClick:()=>L(null),children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/travel_blog.jpg",alt:j.nav_blog_alt||j.travelBlog||"Travel Blog Inspiration",className:"absolute inset-0 w-full h-full object-cover z-0 transition-transform duration-300 group-hover:scale-105",style:{objectPosition:"center"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent z-10"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-blue-900 opacity-40 z-10"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 z-20 bg-white/90 text-black backdrop-blur-sm",children:[(0,t.jsx)("h4",{className:"font-bold text-lg text-black group-hover:translate-x-1 transition-transform",children:j.nav_blog||j.travelBlog||"Travel Blog"}),(0,t.jsx)("p",{className:"text-sm text-black",children:j.nav_blog_desc||j.tipsAndStories||"Tips & stories"})]})]}),(0,t.jsxs)(r.default,{href:`${y}/things-to-do/best-sellers`,className:"group relative rounded-xl overflow-hidden h-40",onClick:()=>L(null),children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/best_seller.webp",alt:j.nav_bestsellers_alt||j.bestSellers||"Best Sellers Inspiration",className:"absolute inset-0 w-full h-full object-cover z-0 transition-transform duration-300 group-hover:scale-105",style:{objectPosition:"center"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent z-10"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-orange-600 opacity-40 z-10"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 z-20 bg-white/90 text-black backdrop-blur-sm",children:[(0,t.jsx)("h4",{className:"font-bold text-lg text-black group-hover:translate-x-1 transition-transform",children:j.nav_bestsellers||j.bestSellers||"Best Sellers"}),(0,t.jsx)("p",{className:"text-sm text-black",children:j.nav_bestsellers_desc||j.mostPopularTours||"Most popular tours"})]})]}),(0,t.jsxs)(r.default,{href:`${y}/things-to-do/new`,className:"group relative rounded-xl overflow-hidden h-40",onClick:()=>L(null),children:[(0,t.jsx)("img",{src:"/images/trip_inspiration/whats_new.webp",alt:j.nav_new_alt||j.whatsNew||"What's New Inspiration",className:"absolute inset-0 w-full h-full object-cover z-0 transition-transform duration-300 group-hover:scale-105",style:{objectPosition:"center 30%"}}
22),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent z-10"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-green-600 opacity-40 z-10"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 z-20 bg-white/90 text-black backdrop-blur-sm",children:[(0,t.jsx)("h4",{className:"font-bold text-lg text-black group-hover:translate-x-1 transition-transform",children:j.nav_new||j.whatsNew||"What's New"}),(0,t.jsx)("p",{className:"text-sm text-black",children:j.nav_new_desc||j.latestExperiences||"Latest experiences"})]})]})]})}):null)]})})]}),!1]}),e&&(0,t.jsx)("div",{style:{height:"80px"}})]})}],19811)}]);

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.