1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[354],{29448:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/rental-finder",function(){return l(71795)}])},84101:function(e,t,l){"use strict";var r=l(24246),n=l(76387),i=l(83941),a=l(79569),o=l(89293);t.Z=e=>{let{rental:t,showDetail:l,getDirections:s,currentUserPositionToRentalDistance:u,...c}=e,[d]=(0,n.dd)(a.P4,{rental:t,getDirections:s}),{stringify:h}=(0,i.$Y)();return(0,r.jsx)(n.Zb,{variant:"outline",body:(0,r.jsxs)(n.kC,{flexDirection:"column",width:"100%",height:"100%",justifyContent:"space-between",children:[(0,r.jsxs)(n.kC,{flexDirection:"row",justifyContent:"space-between",children:[(0,r.jsxs)(n.xu,{pl:"3rem",pt:"3rem",children:[(0,r.jsx)(n.ZT,{variant:"h4",color:"#1E1E1E",children:h(t.values.title)}),(0,r.jsx)(n.xu,{maxHeight:"10rem",overflow:"hidden",style:{whiteSpace:"pre-wrap"},children:(0,r.jsx)(o.Z,{value:t.values.address})})]}),(0,r.jsx)(n.xu,{children:u&&(0,r.jsxs)(n.Vp,{position:"relative",top:"-2px",right:"-2px",children:[u," km"]})})]}),(0,r.jsx)(n.ZT,{mt:"2rem",px:"3rem",pb:"3rem",children:(0,r.jsx)(n.rU,{v:"underline",maxWidth:"100%",onClick:()=>d({}),children:null!=l?l:"Show detail"})})]}),_body:{padding:"0"},boxShadow:"none",height:"auto",justifyContent:"space-between",maxWidth:"none",...c})}},71795:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSG:function(){return z},default:function(){return D}});
1var r=l(24246),n=l(87685),i=l(76387),a=l(3755),o=l(65218),s=l.n(o),u=l(27378),c=e=>{let{styles:t={},...l}=e;return(0,r.jsxs)("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:[(0,r.jsx)("g",{clipPath:"url(#clip0_4_2)",children:(0,r.jsx)("path",{d:"M8 .25a7.75 7.75 0 100 15.5A7.75 7.75 0 008 .25zm2.572 11.175l-.354.352a.747.747 0 00-.193.335c-.047.177-.085.356-.149.527l-.543 1.464c-.43.094-.875.147-1.333.147v-.856c.053-.394-.239-1.133-.707-1.601A1 1 0 017 11.086v-1a.997.997 0 00-.514-.875 51.542 51.542 0 00-1.526-.816c-.358-.18-.69-.41-.989-.68l-.025-.022a3.587 3.587 0 01-.564-.648c-.293-.43-.77-1.138-1.081-1.598a6.284 6.284 0 013.225-3.184l.75.375A.5.5 0 007 2.191v-.353c.25-.04.504-.066.762-.076l.885.885a.5.5 0 010 .707L8.5 3.5l-.323.323a.25.25 0 000 .354l.146.146a.25.25 0 010 .354l-.25.25A.25.25 0 017.897 5h-.281a.25.25 0 00-.175.07l-.31.302a.25.25 0 00-.05.291l.488.975A.25.25 0 017.346 7h-.177a.25.25 0 01-.163-.062l-.29-.251a.5.5 0 00-.486-.097l-.974.324a.373.373 0 00-.05.689l.347.173c.294.147.619.224.947.224.33 0 .706.852 1 1h2.086a1 1 0 01.707.293l.428.427c.179.18.28.422.28.674a1.457 1.457 0 01-.43 1.031zm2.71-2.855a.75.75 0 01-.443-.311l-.562-.843a.75.75 0 010-.832l.612-.918a.75.75 0 01.29-.255l.405-.203A6.2 6.2 0 0114.25 8c0 .27-.023.536-.057.798l-.912-.228z",fill:"#000"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_4_2",children:(0,r.jsx)("path",{fill:"#fff",d:"M0 0h16v16H0z"})})})]})},d=e=>{let{styles:t={},...l}=e;return(0,r.jsx)("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:(0,r.jsx)("path",{d:"M8 15l-.56.828a1 1 0 001.12 0L8 15zM8 1V0C4.172 0 1 2.99 1 6.765h2C3 4.17 5.2 2 8 2V1zM2 6.765H1c0 1.28.458 2.491 1.073 3.55.618 1.062 1.427 2.026 2.211 2.83a23.15 23.15 0 003.153 2.681l.001.001c.001 0 .001.001.562-.827l.561-.828H8.56a21.174 21.174 0 01-2.844-2.422C5 11.015 4.31 10.18 3.803 9.309 3.292 8.431 3 7.57 3 6.764H2zM8 15l.561.828.002-.002a23.14 23.14 0 003.152-2.68c.785-.805 1.594-1.77 2.212-2.832C14.542 9.256 15 8.044 15 6.764h-2c0 .807-.292 1.668-.802 2.545-.508.873-1.198 1.707-1.914 2.44a21.177 21.177 0 01-2.843 2.422l-.002.001L8 15zm6-8.235h1C15 2.99 11.829 0 8 0v2c2.8 0 5 2.17 5 4.765h1zm-3.636.142h-1c0 .665-.572 1.271-1.364 1.271v2c1.82 0 3.364-1.427 3.364-3.271h-1zM8 9.178v-1c-.792 0-1.365-.606-1.365-1.271h-2c0 1.844 1.545 3.271 3.365 3.271v-1zM5.635 6.907h1c0-.665.573-1.272 1.365-1.272v-2c-1.82 0-3.365 1.427-3.365 3.272h1zM8 4.635v1c.792 0 1.365.607 1.365 1.272h2c0-1.845-1.545-3.272-3.365-3.272v1z",fill:"#B83E3E"})})},h=l(67424),v=l(84101),m=l(45495),p=l(46197),x=l(79569),g=l(71038),f=l(46737),j=l(1599),w=l(83941);let b=()=>{var e;let t=(0,n.lt)(),{stringify:l}=(0,w.$Y)(),[r,i]=(0,j.v)("r"),{data:a}=(0,n.RA)(e=>r.length?e.content.listByIds(r.map(e=>+e)):null);return{query:r,selectProps:{value:null!==(e=null==a?void 0:a.contents.map(e=>({value:e.id,label:l(e.title)})))&&void 0!==e?e:[],onChange:(0,u.useCallback)(e=>{var t;y(e)&&i(null!==(t=null==e?void 0:e.map(e=>"".concat(e.value)))&&void 0!==t?t:[])},[i]),loadOptions:async e=>await (null==t?void 0:t.content.search(e,["region"],{perPage:1e3}).then(e=>{var t,r;return null!==(r=null==e?void 0:null===(t=e.region)||void 0===t?void 0:t.items.map(e=>({value:e.id,label:l(e.title)})).sort((e,t)=>e.label.localeCompare(t.label)))&&void 0!==r?r:[]}).catch(t=>((0,f.Mr)({error:t,message:"Error loading region options for Rental Finder region filter",context:{searchQuery:e}}),[])))}}},M=e=>{let{stringify:t}=(0,w.$Y)(),[l,r]=(0,j.v)("p"),n=e=>({value:e.id,label:t(e.title)}),i=new Map(e.flatMap(e=>e.values.products).filter(Boolean).map(e=>[e.id,e]));return{query:l,selectProps:{options:[...i.values()].sort((e,l)=>new Date(t(l.publishedAt)).getTime()-new Date(t(e.publishedAt)).getTime()).map(n),value:l.map(e=>i.get(+e)).filter(Boolean).map(n),onChange:(0,u.useCallback)(e=>{var t;return y(e)&&r(null!==(t=null==e?void 0:e.map(e=>"".concat(e.value)))&&void 0!==t?t:[])},[r])}}},y=e=>!e||Array.isArray(e),P=s()(()=>Promise.all([l.e(9774),l.e(9934),l.e(2376),l.e(1711)]).then(l.bind(l,21711)),{loadableGenerated:{webpack:()=>[21711]},ssr:!1}),C=()=>{let{stringify:e}=(0,n.lV)(),t=(0,n.bL)(),[l]=(0,n.CT)(),[a]=(0,i.dd)(x.P4),[o,s]=(0,u.useState)(null),j=()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{let{coords:{latitude:t,longitude:l}}=e;s({latitude:t,longitude:l})},l=>{switch(l.code){case 0:g.Am.error(e(t.values.locationReqTimeoutError));break;
1case 1:g.Am.info(e(t.values.locationPermissionError));break;case 2:g.Am.error(e(t.values.locationUnknownError));break;default:(0,f.Mr)({error:l,message:"Unexpected error code received from geolocation API"})}}):g.Am.error(e(t.values.locationUnknownError))},w=M(l),y=b(),C=(0,u.useMemo)(()=>{let t=l;0!==w.query.length&&(t=t.filter(e=>w.query.every(t=>{var l;return null===(l=e.values.products)||void 0===l?void 0:l.some(e=>t==="".concat(e.id))}))),0!==y.query.length&&(t=t.filter(e=>{var t;return y.query.includes("".concat(null===(t=e.values.region)||void 0===t?void 0:t.id))}));let r=t.map(e=>{let t=o?_({currentUserPosition:o,rentalPosition:{latitude:Number(e.values.latitude),longitude:Number(e.values.longitude)}}):null;return{rental:e,currentUserPositionToRentalDistance:t}});return o?r.sort((e,t)=>e.currentUserPositionToRentalDistance-t.currentUserPositionToRentalDistance):r.sort((t,l)=>{let{rental:r}=t,{rental:n}=l;return e(r.title).localeCompare(e(n.title))})},[l,w.query,y.query,e,o]),k=(0,u.useMemo)(()=>{var l;return null!==(l=null==C?void 0:C.map(l=>{let{rental:r}=l,n=+(r.values.longitude||0)||0,i=+(r.values.latitude||0)||0;return{latitude:i,longitude:n,options:{onClick:l=>{var o;null===(o=l.map)||void 0===o||o.flyTo([i,n],13,{animate:!0,duration:.1}),a({rental:r,getDirections:e(t.values.backToListing)})},title:e(r.title)}}}))&&void 0!==l?l:[]},[C,a,e,t.values.backToListing]),A=(0,u.useMemo)(()=>o?[...k,{...o,options:{title:e(t.values.youAreHere),currentUserPositionMarker:!0,onClick:e=>{var t;null===(t=e.map)||void 0===t||t.flyTo([o.latitude,o.longitude],14,{animate:!0,duration:.1})}}}]:k,[k]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.Kq,{direction:{_:"column",md:"row"},gap:{_:"1.5rem",sm:"3rem"},width:"100%",mt:"3rem",children:[(0,r.jsx)(m.NI,{labelText:e(t.values.leftFilterLabel),width:"100%",children:(0,r.jsx)(p.Z,{isMulti:!0,...w.selectProps})}),(0,r.jsx)(m.NI,{labelRightText:(0,r.jsx)(i.xv,{onClick:()=>{if(!o){j();return}s(null)},display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",height:"fit-content",position:"relative",top:"-2px",children:o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.JO,{svg:(0,r.jsx)(c,{}),_icon:{fill:"#ee0037"},mr:"1rem"}),(0,r.jsx)("span",{style:{textDecoration:"underline",color:"#ee0037"},children:e(t.values.allPositions)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.JO,{svg:(0,r.jsx)(d,{}),_icon:{fill:"#5E6062"},mr:"1rem"}),(0,r.jsx)("span",{style:{textDecoration:"underline"},children:e(t.values.myPosition)})]})}),labelNoPointerEvents:!0,labelText:e(t.values.rightFilterLabel),width:"100%",children:(0,r.jsx)(p.q,{isMulti:!0,defaultOptions:!0,...y.selectProps})})]}),A.length?(0,r.jsx)(P,{zIndex:1,height:"60rem",alignItems:"center",justifyContent:"center",mt:"3rem",markers:A,bounds:A,currentUserPosition:o}):(0,r.jsx)(i.xv,{fontSize:"2rem",textAlign:"center",mt:"5rem",children:e(t.values.noRental)}),C?(0,r.jsx)(i.rj,{columns:{_:"1fr",xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(3, 1fr)"},rows:"auto",gap:"3rem",mt:"3rem",style:{whiteSpace:"pre-wrap"},children:C.map(l=>{let{rental:n,currentUserPositionToRentalDistance:i}=l;return(0,r.jsx)(v.Z,{rental:n,currentUserPositionToRentalDistance:i,showDetail:e(t.values.rentalDetail),getDirections:e(t.values.backToListing)},n.id)})}):(0,r.jsx)(h.Z,{})]})},_=e=>{let{currentUserPosition:t,rentalPosition:l}=e,r=(t.latitude-l.latitude)*Math.PI/180,n=(t.longitude-l.longitude)*Math.PI/180,i=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.latitude*Math.PI/180)*Math.cos(l.latitude*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return Math.round(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371)};var k=l(89293),A=l(38331),T=l(86677);let E=()=>{let{stringify:e}=(0,n.lV)(),t=(0,n.bL)(),{isReady:l}=(0,T.useRouter)();return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(i.W2,{flexDirection:"column",py:"5rem",children:[(0,r.jsx)(A.Z,{mb:"3rem",children:(0,r.jsx)(n.CR,{value:e(t.values.title)})}),(0,r.jsx)(i.xu,{width:"107rem",maxWidth:"100%",mx:"auto",mb:"3rem",children:(0,r.jsx)(k.Z,{value:t.values.subheadline,_paragraph:{variant:"lead",textAlign:"center"},_link:{fontSize:"inherit",lineHeight:"inherit"}})}),l?(0,r.jsx)(C,{}):(0,r.jsx)(i.kC,{justifyContent:"center",height:"60rem",alignItems:"center",children:(0,r.jsx)(h.Z,{})})]})})};E.Layout=a.ZP;var z=!0,D=E}},function(e){e.O(0,[2582,7182,6671,9170,7168,9569,2888,9774,179],function(){return e(e.s=29448)}),_N_E=e.O()}]);
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.