1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4032],{14032:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var i=n(37876);n(14232);var o=n(19860),a=n(97782);function s(e,t){var n,o,s;return(0,i.jsx)(a.A,{isMap:!0,isMobile:t,destinationType:(null==(s=e.node.destinationTypes)||null==(o=s.edges[0])||null==(n=o.node)?void 0:n.name)||"",title:e.node.title,relativeUri:e.node.relativeUri,descriptionText:e.node.excerpt,images:e.node.acfDestination.destinationListing,classification:e.node.acfDestination.destinationClassification,cta:e.node.acfDestination.ctaListing,accomodations:e.node.accommodations,siteId:e.node.acfDestination.destinationSiteId,details:e.node.acfDestination},e.node.id)}function l(e){let{destinations:t}=e;return(0,i.jsx)(o.A,{destinations:t,desktopPopupClassName:"min-h-[250px]",renderDesktopPopup:e=>s(e,!1),renderMobilePopup:e=>(0,i.jsx)("div",{className:"fixed bottom-20 left-1/2 w-[70%] max-w-md -translate-x-1/2 xl:hidden",children:(0,i.jsx)("div",{className:"relative rounded-lg bg-white shadow-lg",children:s(e,!0)})})})}},19860:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var i=n(37876),o=n(14232),a=n(20061),s=n(76251),l=n(39523),r=n(62529),d=n(16806),u=n(61397),c=n.n(u);let p=n(65364).env.NEXT_PUBLIC_MAPBOX_TOKEN||"pk.eyJ1IjoiZGVubmlzZmMiLCJhIjoiY2xidW40anVxMGh2ODNwdDBobXc3cjA1bSJ9.dcn2eM0m0T137r0r25mdKQ",g={longitude:14.921691,latitude:58.837119};function m(e){var t,n,i,o,a,s;let l=null==e||null==(i=e.node)||null==(n=i.acfDestination)||null==(t=n.destinationMap)?void 0:t.longitude,r=null==e||null==(s=e.node)||null==(a=s.acfDestination)||null==(o=a.destinationMap)?void 0:o.latitude;return"number"==typeof l&&Number.isFinite(l)&&0!==l&&"number"==typeof r&&Number.isFinite(r)&&0!==r}function f(e,t){if(0===t.length)return;if(1===t.length)return void e.easeTo({center:[t[0].longitude,t[0].latitude],zoom:9,duration:800});let n=(0,l.default)(t);if(n.minLng===n.maxLng&&n.minLat===n.maxLat)return void e.easeTo({center:[n.minLng,n.minLat],zoom:9,duration:800});e.fitBounds([[n.minLng,n.minLat],[n.maxLng,n.maxLat]],{padding:{top:10,left:10,right:10,bottom:10},duration:800})}function h(e){let{destinations:t,renderDesktopPopup:n,renderMobilePopup:l,desktopPopupClassName:u=""}=e,{enabled:h}=(0,d.Yq)(),x=(0,o.useRef)(null),v=(0,o.useRef)(!1),[y,M]=(0,o.useState)(null),[b,w]=(0,o.useState)(0),j=(0,o.useMemo)(()=>t.filter(m).map(e=>{var t,n,i,o;return{destination:e,longitude:e.node.acfDestination.destinationMap.longitude,latitude:e.node.acfDestination.destinationMap.latitude,destinationType:(null==(o=e.node.destinationTypes)||null==(i=o.edges)||null==(n=i[0])||null==(t=n.node)?void 0:t.name)||""}}),[t]),C=(0,o.useRef)(null);if(null===C.current){let e=j.map(e=>({longitude:e.longitude,latitude:e.latitude})),t=e.length>0?(0,s.default)(e):null;C.current={longitude:t?t.longitude:g.longitude,latitude:t?t.latitude:g.latitude,zoom:4.5}}let D=(0,o.useMemo)(()=>j.map(e=>({type:"Feature",properties:{cluster:!1,destinationId:e.destination.node.id,destination:e.destination,destinationType:e.destinationType,isEasy:+("Easy"===e.destinationType),isResort:+("Resort"===e.destinationType)},geometry:{type:"Point",coordinates:[e.longitude,e.latitude]}})),[j]),k=(0,o.useMemo)(()=>{let e=new r.A({radius:50,maxZoom:14,reduce:(e,t)=>{e.hasEasy=e.hasEasy||t.isEasy,e.hasResort=e.hasResort||t.isResort}});return e.load(D),e},[D]),E=(0,o.useMemo)(()=>{var e;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return[];try{let e=Math.round(t.getZoom());return k.getClusters([-180,-85,180,85],e)}catch(e){return console.error("[ClusterMap] getClusters error",e),[]}},[k,b,D.length]),{clusterMarkers:L,pointMarkers:T}=(0,o.useMemo)(()=>{let e=[],t=[];return E.forEach(n=>{n.properties.cluster?e.push(n):t.push(n)}),{clusterMarkers:e,pointMarkers:t}},[E]);(0,o.useEffect)(()=>{var e;if(!v.current)return;let t=null==(e=x.current)?void 0:e.getMap();t&&f(t,j)},[j]),(0,o.useEffect)(()=>{var e;if(!y)return;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return;let n=y.node.acfDestination.destinationMap.longitude,i=y.node.acfDestination.destinationMap.latitude;null!=n&&null!=i&&t.easeTo({center:[n,i],duration:500,offset:[0,-100]})},[y]),(0,o.useEffect)(()=>{var e;if(0===b)return;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return;let n=t.getContainer(),i=new ResizeObserver(()=>{t.resize()});return i.observe(n),()=>i.disconnect()},[b]);let N=e=>e<4?30:e<8?38:e<16?48:60,_=()=>M(null);
1return h?(0,i.jsx)("section",{className:"h-[calc(100vh-130px)] flex-1 bg-gray-100 lg:sticky lg:top-[113px] lg:block lg:h-[calc(100vh-113px)]",children:(0,i.jsxs)("div",{className:"h-full",children:[(0,i.jsx)("div",{className:"h-full w-full lg:absolute lg:inset-0 lg:h-auto",children:(0,i.jsxs)(a.Ay,{ref:x,initialViewState:C.current,onLoad:()=>{var e;v.current=!0;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return void w(e=>e+1);j.length>0&&f(t,j),w(e=>e+1)},onMoveEnd:()=>{w(e=>e+1)},style:{width:"100%",height:"100%"},mapStyle:"mapbox://styles/mapbox/streets-v11",mapboxAccessToken:p,children:[(0,i.jsx)(a.ov,{showCompass:!1}),L.map(e=>{let[t,n]=e.geometry.coordinates,{point_count:o,cluster_id:s}=e.properties;return(0,i.jsx)(a.pH,{longitude:t,latitude:n,onClick:()=>((e,t,n)=>{var i;let o=Math.min(k.getClusterExpansionZoom(e),20);null==(i=x.current)||i.easeTo({center:[t,n],zoom:o,duration:500})})(s,t,n),children:(0,i.jsx)("div",{style:{width:"".concat(N(o),"px"),height:"".concat(N(o),"px"),borderRadius:"50%",backgroundColor:"#d71e25",border:"1px solid white",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:o<8?"13px":o<16?"14px":"16px",fontWeight:"bold",cursor:"pointer"},children:o})},"cluster-".concat(s))}),T.map(e=>{let[t,n]=e.geometry.coordinates,{destination:o,destinationType:s}=e.properties;return(0,i.jsx)(a.pH,{longitude:t,latitude:n,anchor:"bottom",onClick:e=>{e.originalEvent.stopPropagation(),M(o)},children:(e=>{switch(e){case"Easy":return(0,i.jsx)("img",{src:"/easy-pin.svg",alt:"",width:"32",height:"32"});case"Resort":return(0,i.jsx)("img",{src:"/resort-pin.svg",alt:"",width:"32",height:"32"});default:return(0,i.jsx)("img",{src:"/pin.svg",alt:"",width:"32",height:"32"})}})(s)},"point-".concat(o.node.id))}),y&&null!=y.node.acfDestination.destinationMap.longitude&&null!=y.node.acfDestination.destinationMap.latitude&&(0,i.jsx)(a.zD,{anchor:"top",longitude:y.node.acfDestination.destinationMap.longitude,latitude:y.node.acfDestination.destinationMap.latitude,onClose:_,className:"".concat(c().popup," mt-2 !hidden xl:!block ").concat(u),children:n(y,_)}),(0,i.jsx)(a.tG,{trackUserLocation:!0,showUserLocation:!0,showAccuracyCircle:!0,showUserHeading:!0,fitBoundsOptions:{maxZoom:8}})]})}),y&&l(y,_)]})}):null}},61397:e=>{e.exports={popup:"ClusterMap_popup__ZiAvi"}}}]);
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.