1import{q as ce,r,d as se,x as ue,e as pe,A as oe,f as Z,s as me,g as de,aS as ve,c as le,h as u,u as w,l as P,aP as fe,k as s,t as v,D as x,i as H,O as he,w as X,b as q,_ as ge,F as ee,n as te,a as _e,b0 as we,j as O,v as ae,Q as ke,z as ne,H as ye,as as xe,y as be,o as i,aV as Ce,C as Se,a3 as $e,E as Le}from"./Cm6QmM0y.js";import{_ as Me}from"./CUYznNuf.js";import{_ as Ae,P as Ee}from"./B_NnfH1z.js";import{_ as ze}from"./DtnqW-fP.js";import{u as re}from"./aQboYVCR.js";const Re={key:0},Ne={class:"flex flex-col gap-2 justify-between px-4 cursor-pointer md:cursor-default"},Pe={class:"text-xl"},Te={class:"flex items-center gap-2"},De={class:"text-xs"},Ie={class:"overflow-y-auto flex-1 pb-5"},Be=["onClick"],Ue={key:1,class:"ts-link text-sm"},Oe={class:"flex gap-2 justify-between items-center w-full"},je={src:Me,class:"w-4 h-4 dark:invert-1"},We={class:"w-full h-full flex flex-col overflow-auto md:grid md:grid-cols-2 md:overflow-hidden p-2"},Ve=["src"],Fe={class:"absolute"},He={key:0,class:"map-container relative"},qe={key:0,class:"absolute inset-0 bg-black opacity-50 z-20 md:z-10"},Ge={key:1,class:"bg-white w-[90%] md:w-fit dark:bg-zinc-800 absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-20 rounded-xl px-5 py-5 text-center shadow-md shadow-zinc-800"},Ke={class:"text-3xl font-semibold block leading-tight mb-4"},Ye=["width","height","src"],Je={__name:"MapComponent",props:{cityName:{type:String,required:!0},cityURL:{type:String,required:!1},heightClass:{type:String,required:!1},fullScreen:{type:Boolean,default:!1}},async setup(h){let b,k;const T=["Outdoor, Adventure & Sports","Attractions","Museums","Food & Wine Experiences","Shows, Music & Nightlife","Theme Parks","Day trips & Excursions","Wellness","Multi day trips","Workshops & Classes","Transfers & Transports","Shopping & Fashion","Shore Excursions","Events: Concerts & Sport matches","Sightseeing"],c=r(!1),{locale:g}=se(),D=g.value.split("-")[0],M=r(!1),A=r(!1),y=r(!1);ue();const p=r([]),t=r(!1),{isCrawler:j,isMobile:I}=pe(),B=be(),E=h,{data:f,error:U}=([b,k]=oe(()=>re("/api/explore",{params:{type:"map",city_name:E.cityName,lang:D},server:!0,key:`explore-map-component-${E.cityName}-${D}`},"$ytTan2Bjq7")),b=await b,k(),b);U.value;const z=r(null);f.value&&(z.value=f.value.embedUrl,p.value=f.value.destinations);const l=r(null),C=r(null),S=r(null),_=r({width:null,height:null});function m(){return new Promise((a,e)=>{if(window.google&&google.maps){a();return}const o=document.createElement("script");o.src=`https://maps.googleapis.com/maps/api/js?key=${B.public.GOOGLE_MAPS_PUBLIC_API_KEY}`,o.async=!0,o.onload=a,o.onerror=e,document.head.appendChild(o)})}function d(){if(!l.value||p.value.length===0)return;const a=new google.maps.LatLngBounds;p.value.forEach(e=>{a.extend({lat:e.latitude,lng:e.longitude})}),l.value.fitBounds(a)}function R(a){let e;switch(a){case 1:e="pin_map_A";break;case 2:e="pin_map_B";break;case 3:e="pin_map_C";break;case 4:e="pin_map_D";break;case 5:e="pin_map_E";break;case 6:e="pin_map_F";break;case 7:e="pin_map_G";break;case 8:e="pin_map_H";break;case 9:e="pin_map_I";break;case 10:e="pin_map_J";break;case 11:e="pin_map_K";break;case 12:e="pin_map_L";break;case 13:e="pin_map_M";break;case 14:e="pin_map_N";break;case 15:e="pin_map_O";break;default:e="pin_map_A"}return e}function W(a){const e=R(a.father_id);return new google.maps.Marker({position:{lat:a.latitude,lng:a.longitude},map:l.value,title:a.label,icon:{url:`/img/icons/${e}.svg`,scaledSize:new google.maps.Size(30,30)}})}function G(){!l.value&&!p.value||(window.markers&&window.markers.forEach(a=>a.setMap(null)),window.markers=[],p.value.forEach(a=>{if(a.father_id==7&&!y.value)return;const e=W(a);e.addListener("click",()=>{K(a)}),window.markers.push(e)}),d())}let $=null;async function K(a){if(l.value||await Y(),l.value){$!=null&&$.close();const e=window.markers.find(o=>o.getPosition().lat()===a.latitude&&o.getPosition().lng()===a.longitude);if(e){const o=new google.maps.InfoWindow({content:ie(a)});o.open(l.value,e),l.value.panTo(e.getPosition()),l.value.setZoom(15),$=o}}}function ie(a){const e=document.createElement("div"),o=ne(),L=ye({render(){return xe(Ee,{data:a})}});return L.config.globalProperties=o.vueApp.config.globalProperties,o.vueApp._context&&o.vueApp._context.plugins&&o.vueApp._context.plugins.forEach(V=>{L.use(V)}),L.mount(e),e}async function Y(){j||(await m(),C.value&&(l.value=new google.maps.Map(C.value,{center:{lat:20,lng:0},zoom:2,options:{gestureHandling:"greedy"}}),l.value.addListener("click",()=>{$&&($.close(),$=null)}),G(),M.value=!0))}Z(()=>{const a=new ResizeObserver(e=>{for(const o of e)_.value={width:o.contentRect.width,height:o.contentRect.height}});S.value&&a.observe(S.value),me(()=>{a.disconnect()})}),de(()=>{p.value,y.value},()=>{G()},{deep:!0});const N=r(null),J=r(!1);return Z(()=>{N.value=ve(),J.value=le({get(){var a;return((a=N.value)==null?void 0:a.value)==="dark"},set(){N.value&&(N.value.preference=N.value.value==="dark"?"light":"dark")}})}),(a,e)=>{var Q;const o=fe,L=ge,V=we;return(Q=w(f))!=null&&Q.city?(i(),u("div",{key:1,ref_key:"mapContainer",ref:S,id:"map-component",class:x(["relative overflow-hidden",[h.heightClass,h.fullScreen?"":"rounded-lg"]])},[s("div",{class:x(["absolute w-64 bg-white dark:bg-[#121212] shadow-md z-20 max-h-[calc(100%-1rem)] flex flex-col py-3 transform transition-transform duration-300 ease-in-out",{"h-auto max-h-96":w(I),"translate-y-[calc(100%-4rem)]":w(I)&&!t.value,"top-12 my-28 mr-4 h-[calc(100%-11.5rem)] md:h-[calc(100%-17rem)] rounded-xl right-0":h.fullScreen,"my-2 md:h-[calc(100%-8rem)] rounded-md right-2":!h.fullScreen}])},[s("div",Ne,[s("span",{class:"w-full flex items-center justify-between",onClick:e[0]||(e[0]=n=>t.value=!t.value)},[s("span",Pe,v(a.$t("Attractions")),1),(i(),u("svg",{class:x(["w-6 h-6 md:hidden transform transition-transform",{"rotate-180":!t.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},[...e[4]||(e[4]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),s("span",Te,[s("label",De,v(a.$t("Show Day Trips?")),1),H(s("input",{type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=n=>y.value=n),class:"form-checkbox h-3 w-3 text-tourscanner_blue-700"},null,512),[[he,y.value]])])]),P(L,{to:h.cityURL,class:"ts-link flex items-center justify-between px-4 py-2"},{default:X(()=>[q(v(w(f).city.name),1)]),_:1},8,["to"]),s("div",Ie,[s("ul",null,[(i(!0),u(ee,null,te(p.value,n=>(i(),u("li",{onClick:F=>K(n),key:n.id,class:"px-4 py-2 hover:bg-gray-100 hover:dark:bg-zinc-800 cursor-pointer text-black text-md leading-tight"},[P(V,{reviews_count:n.reviews_count,rating:n.reviews_average??0},null,8,["reviews_count","rating"]),w(j)?(i(),_e(L,{key:0,to:n.url,class:"ts-link text-sm"},{default:X(()=>[q(v(n.label),1)]),_:2},1032,["to"])):(i(),u("a",Ue,v(n.label),1))],8,Be))),128))])])],2),s("div",{class:x(["absolute flex flex-col p-4 bg-white dark:bg-black rounded-lg shadow-lg transition-all duration-300 ease-in-out z-20 md:w-auto",[c.value?"w-4/5 max-h-4/5 overlfow-y-auto left-1/2 -translate-x-1/2 md:left-2 md:-translate-x-0":"-translate-x-[calc(100%-6rem)] pl-12",h.fullScreen?"top-40":"top-16"]])},[s("div",Oe,[s("h3",{class:x(["text-lg flex items-center gap-2 font-semibold text-black dark:text-white cursor-pointer",{"text-sm":!c.value}]),onClick:e[2]||(e[2]=n=>c.value=!c.value)},[q(v(a.$t("Legend"))+" ",1),H(s("img",je,null,512),[[ae,!c.value]])],2),c.value?(i(),u("img",{key:0,src:Ae,class:"w-4 h-4 dark:invert-1",onClick:e[3]||(e[3]=n=>c.value=!1)})):O("",!0)]),H(s("ul",We,[(i(),u(ee,null,te(T,(n,F)=>s("li",{key:F,class:"flex items-center gap-2 text-xs"},[s("img",{src:`/img/icons/${R(F+1)}.svg`,alt:"",class:"w-4 h-4"},null,8,Ve),s("span",null,v(a.$t(n)),1)])),64))],512),[[ae,c.value]])],2),s("div",Fe,[M.value?O("",!0):(i(),u("div",He,[A.value?O("",!0):(i(),u("div",qe)),A.value?O("",!0):(i(),u("div",Ge,[e[5]||
1(e[5]=s("img",{src:ze,class:"mx-auto mb-4 w-16 h-16"},null,-1)),s("span",Ke,v(a.$t("Explore all activities in {cityName}",{cityName:w(f).city.name})),1),s("button",{class:"ts-button text-white px-6 py-3 rounded-lg transition-colors duration-200 font-medium",onClick:Y},v(a.$t("Show All Activities")),1)])),s("iframe",{width:_.value.width,height:_.value.height,style:{border:"0"},loading:"lazy",class:x(!A.value&&J.value?"mapEmbedDark":""),allowfullscreen:"",referrerpolicy:"no-referrer-when-downgrade",src:z.value},null,10,Ye)])),s("div",{ref_key:"mapRef",ref:C,class:x(["map touch-none",M.value?"":"hidden"]),style:ke({width:_.value.width+"px",height:_.value.height+"px"})},null,6)])],2)):(i(),u("div",Re,[P(o,{class:"w-full h-40 mb-2 pt-24"}),P(o,{class:"w-full h-[78vh]"})]))}}},Qe=ce(Je,[["__scopeId","data-v-29611bbc"]]),Ze={class:"h-screen"},Xe={class:"text-xl absolute bottom-2 bg-white dark:bg-[#121212] rounded-full py-3 px-5 z-20 ml-1"},lt={__name:"map",emits:["passDataToHeader"],async setup(h,{emit:b}){var B,E,f,U,z,l,C,S,_;let k,T;const c=$e(),{$seoManager:g}=ne(),D=b,M=Ce(),{locale:A}=se(),y=A.value.split("-")[0],p=r(null),{data:t,error:j}=([k,T]=oe(()=>re("/api/explore",{params:{type:"map",city_name:c.params.city_n,lang:y},server:!0,key:`explore-map-${c.params.city_n}-${y}`,onResponse({response:m}){const d=m.headers.get("location");(m.status===302||m.status===301)&&d&&(d.startsWith("/")||d.startsWith("http"))&&Le(d)},onResponseError({response:m}){}},"$C29YzrN64E")),k=await k,T(),k);t.value&&(p.value=t.value.cityURL,D("passDataToHeader",{popularSearches:(B=t==null?void 0:t.value)==null?void 0:B.top_links,currentPageName:(E=t==null?void 0:t.value)==null?void 0:E.title,cityID:t.value.id}),Se("RVDestinations",(U=(f=t==null?void 0:t.value)==null?void 0:f.identity)==null?void 0:U.destination_key)),g.setTitle((z=t==null?void 0:t.value)==null?void 0:z.meta_title),g.setDescription((l=t==null?void 0:t.value)==null?void 0:l.meta_description),g.setKeywords((C=t==null?void 0:t.value)==null?void 0:C.meta_keywords),g.setRobotsRule((S=t==null?void 0:t.value)!=null&&S.isIndexable?"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1":"noindex, follow"),g.setOpenGraph({image:(_=t.value)==null?void 0:_.featured_image});const I=le(()=>{var d,R;let m=[];if(t.value&&((d=t==null?void 0:t.value)!=null&&d.headless_guide)&&t.value.headless_guide.authors)for(const W of(R=t==null?void 0:t.value)==null?void 0:R.headless_guide.authors)m.push(M(W.url));return m});return g.setArticleAuthors(I.value),(m,d)=>(i(),u("div",Ze,[s("h1",Xe,v(w(t).title),1),P(Qe,{cityName:w(c).params.city_n,cityURL:p.value,fullScreen:!0,heightClass:"h-full"},null,8,["cityName","cityURL"])]))}};export{lt as default};
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.