1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5893,8695],{11249:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-place/saved-searches",function(){return s(40187)}])},26948:(e,t,s)=>{"use strict";s.d(t,{A:()=>u});var a=s(37876);s(14232);var r=s(81130),l=s(32770),i=s(61602),n=s(15202),c=s(77334),d=s(74504),o=s(86047),h=s(39091),m=s(38632),x=s(61702);let u=e=>{let{modal:t,setModal:s,selectedSearch:u={}}=e,{updateAlertSchedule:p}=(0,m.A)();return(0,a.jsx)(r.a,{isOpen:"alert"===t,onClose:()=>s(!1),size:"narrow",children:(0,a.jsx)(r.a.Content,{children:(0,a.jsx)(o.l1,{initialValues:{schedule:u?.schedule?.value||""},validationSchema:h.Ik().shape({schedule:h.Yj().required("This is required")}),onSubmit:(e,t)=>{let{setSubmitting:a}=t;s(!1),p({values:e,id:u.id}),a(!1)},children:(0,a.jsxs)(o.lV,{children:[(0,a.jsx)(l.D,{size:2,as:"h2",children:"Alert settings"}),(0,a.jsxs)("div",{className:"space-y-4 pt-6 mx-auto md:w-80",children:[(0,a.jsx)(i.B,{description:u.description,name:u.name}),(0,a.jsx)(n.w,{size:"small",borderColor:"transparent",bgColor:"dove/20",children:(0,a.jsx)(c.q,{name:"schedule",items:x.vV})}),(0,a.jsx)(d.$,{className:"w-full",type:"submit",children:"Save"})]})]})})})})}},38632:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var a=s(31777),r=s(52333),l=s(97685),i=s(91504),n=s(39725),c=s(61702);let d=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return fetch(...t).then(e=>e.json())};function o(){let e=(0,a.d4)(e=>e.account.status),{data:t,error:s,mutate:o}=(0,r.u)("authenticated"===e?"/my-place/async/saved-searches/":null,d,{use:[i.A]}),h=t?.searches||[];return{searches:h,isLoading:!s&&!h,error:s,mutate:o,deleteAlert:function(e){let{id:t}=e,s=h.filter(e=>e.id!==t);async function a(){let e=await fetch(`/my-place/async/saved-searches/${t}/`,{...n.Xm,method:"DELETE"});if(!e.ok)throw Error(`Error: ${e.message}`);return{searches:s}}l.Ay.promise(o(a(),{optimisticData:{searches:s},rollbackOnError:!0}),{loading:"Deleting...",success:"Search deleted.",error:e=>e.message||"There was an error."})},updateAlertSchedule:function(e){let{values:t,id:s}=e,a={...h.filter(e=>e.id===s)[0],schedule:c.vV.filter(e=>e.value===t.schedule)[0]},r=h.map(e=>e.id===s?a:e);async function i(){let e={...t},a=await fetch(`/my-place/async/saved-searches/${s}/`,{...n.Xm,body:JSON.stringify(e)}),r=await a.json();if(!a.ok)throw Error(`Error: ${r.message||a.status}`);return{searches:h.map(e=>e.id===s?r:e)}}l.Ay.promise(o(i(),{optimisticData:{searches:r},rollbackOnError:!0}),{loading:"Saving...",success:"Alert settings updated.",error:e=>e.message||"There was an error."})},saveSearch:function(e,t){async function s(){let t=await fetch("/my-place/async/saved-searches/",{...n.Xm,body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(`Error: ${s.message||t.status}`);return{searches:[...h,s]}}return l.Ay.promise(o(s(),{optimisticData:{searches:[...h,e]},rollbackOnError:!0}),{loading:"Saving...",success:()=>(localStorage.removeItem(`UserRecentSearches-${t}`),"Alert saved."),error:e=>e.message||"There was an error."})}}}},38695:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(37876),r=s(14232),l=s(24792),i=s(10999);class n extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){}render(){let{hasError:e}=this.state,{children:t,className:s}=this.props;return e?(0,a.jsx)(l.W,{className:(0,i.XS)([s])}):t}}let c=n},40187:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var a=s(37876),r=s(14232),l=s(87968),i=s(74123),n=s(45241),c=s(77328),d=s.n(c),o=s(10999),h=s(51174),m=s(32770),x=s(79787),u=s(17446),p=s(75784),j=s(25038),v=s(38632),g=s(81130),y=s(74504);let f=e=>{let{modal:t,setModal:s}=e;return(0,a.jsxs)(g.a,{isOpen:"create"===t,onClose:()=>s(!1),size:"narrow",children:[(0,a.jsx)(g.a.Content,{children:(0,a.jsx)(m.D,{size:2,as:"h2",children:"Create new alert"})}),(0,a.jsxs)(g.a.Footer,{className:"flex justify-between items-center",children:[(0,a.jsx)(y.$,{variant:"outline",className:"text-denim underline px-0 py-0 bg-transparent border-none",children:"Cancel"}),(0,a.jsx)(y.$,{children:"Save"})]})]})};var b=s(61602);let w=e=>{let{modal:t,setModal:s,selectedSearch:r}=e,{deleteAlert:l}=(0,v.A)();return(0,a.jsxs)(g.a,{isOpen:"delete"===t,onClose:()=>s(!1),size:"narrow",children:[(0,a.jsxs)(g.a.Content,{children:[(0,a.jsx)(m.D,{size:2,as:"h2",children:"Delete search"}),(0,a.jsx)("div",{className:"text-body2 text-slate pt-2",children:"Are you sure you want to delete this search? Property alerts for this search will also be deleted."}),(0,a.jsx)("div",{className:"space-y-4 pt-6 mx-auto md:w-80",children:(0,a.jsx)(b.B,{description:r.description,name:r.name,schedule:r.schedule})})]}),(0,a.jsxs)(g.a.Footer,{className:"flex items-center justify-between mt-4",children:[(0,a.jsx)(y.$,{variant:"link",className:"text-denim underline px-0 py-0 bg-transparent border-none",onClick:()=>s(!1),children:"No, cancel"}),(0,a.jsx)(y.$,{onClick:()=>{s(!1),l({id:r.id})},children:"Yes, delete"})]})]})};var N=s(26948);let S=()=>{let{searches:e,isLoading:t}=(0,v.A)(),[s,l]=(0,r.useState)(),[i,n]=(0,r.useState)({}),c=e=>{let{search:t,type:s}=e;l(s),"create"!==s&&n(t)};return(0,a.jsxs)("div",{className:"lg:flex lg:items-start",children:[(0,a.jsxs)("div",{className:"pt-4 md:flex-grow",children:[!t&&(!e||0===e.length)&&(0,a.jsxs)(h.p,{children:[(0,a.jsx)(m.D,{as:"h4",size:4,children:"You donât have any saved searches"}),(0,a.jsx)("div",{className:"hidden md:block text-md",children:"Save your property search or create an alert, and weâll save it here for you to view later."})]}),t?(0,a.jsx)(x.y,{className:"h-14 mx-auto !block"}):(0,a.jsx)(p.N,{children:(0,a.jsx)(j.PY1.div,{variants:{initial:{},animate:{transition:{staggerChildren:.15}},exit:{}},initial:"initial",animate:"animate",exit:"exit",className:"space-y-8",children:e&&e.map(e=>(0,a.jsx)(j.PY1.div,{variants:{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},layout:!0,className:"flex",children:(0,a.jsx)(u.M,{...e,images:[{default:e?.staticMapUrls?.w360Xh235,postrait:!1}],onDeleteButtonClick:()=>c({search:e,type:"delete"}),onAlertButtonClick:()=>c({search:e,type:"alert"})})},e.id))})})]}),(0,a.jsx)(f,{modal:s,setModal:l}),(0,a.jsx)(w,{modal:s,setModal:l,selectedSearch:i}),(0,a.jsx)(N.A,{modal:s,setModal:l,selectedSearch:i})]})};var A=s(31777),k=s(97685),C=s(6266),E=s(39725),D=s(95577),$=s(90194),z=s(53538);let O=()=>{let{searches:e,saveSearch:t}=(0,v.A)(),s=(0,A.d4)(e=>e.account.email),[l,i]=(0,r.useState)(!1),[n,c]=(0,$.A)(!1),[d,x]=(0,$.A)(!1);function f(e){let{id:t,all:s}=e;if(s){Object.keys(localStorage).filter(e=>e.indexOf("UserRecentSearches-")>-1).forEach(e=>localStorage.removeItem(e)),i([]);return}localStorage.removeItem(`UserRecentSearches-${t}`),i(l.filter(e=>e.id!==t)),k.Ay.success(`Recent ${s?"searches":"search"} deleted`)}(0,r.useEffect)(()=>{c(!0),x(!1);let t=Object.keys(localStorage).filter(e=>e.indexOf("UserRecentSearches-")>-1).map(e=>JSON.parse(localStorage.getItem(e))).filter(e=>e.userId===s&&e.searchUrl&&e.query?.criteria).filter(t=>!e.some(e=>(0,C.A)((0,D.j)(e.criteria),(0,D.j)((0,o.Tz)(t.query.criteria))))).sort((e,t)=>new Date(t.date)-new Date(e.date)),a=t.slice(0,20).map(e=>({criteria:e.query.criteria}));fetch("/my-place/async/recent-searches/",{...E.Xm,body:JSON.stringify({"recent-searches":a})}).then(e=>e.json()).then(e=>{i(e["recent-searches"].map((e,s)=>({...e,id:t[s].id}))),c(!1)}).catch(e=>x(e.message))},[s]);let b="delete",[w,N]=(0,r.useState)(),[S,O]=(0,r.useState)({});return(0,a.jsxs)("div",{className:"lg:flex lg:items-start",children:[(0,a.jsxs)("div",{className:"pt-4 md:flex-grow",children:[!n&&!d&&0===l.length&&(0,a.jsxs)(h.p,{children:[(0,a.jsx)(m.D,{as:"h4",size:4,children:"You donât have any recent searches"}),(0,a.jsx)("div",{className:"hidden md:block text-md",children:"Your most recent search history will be recorded here for you to access later."})]}),n?(0,a.jsx)(z.A,{className:"h-14 mx-auto !block"}):(0,a.jsxs)(p.N,{children:[(0,a.jsx)(j.PY1.div,{variants:{initial:{},animate:{transition:{staggerChildren:.15}},exit:{}},initial:"initial",animate:"animate",exit:"exit",className:"space-y-8",children:l&&l.map((e,s)=>(0,a.jsx)(j.PY1.div,{variants:{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},layout:!0,className:"flex",children:(0,a.jsx)(u.M,{...(0,o.Tz)(e),savedSearchDisallowed:!(0,o.Tz)(e).savedSearchPermitted,images:[{default:(0,o.Tz)(e).staticMapUrls?.w360Xh235,postrait:!1}],onDeleteButtonClick:()=>(function(e){let{search:t,type:s}=e;N(s),O(t)})({search:e,type:b}),onSaveButtonClick:()=>{t({schedule:"instant",criteria:e.criteria},e.id).then(()=>i(l.filter(t=>t!==e)))}})},`recent-search-${s}`))}),l&&l.length>0&&(0,a.jsx)(y.$,{onClick:()=>f({all:!0}),variant:"link",className:"text-link mt-3",children:"Clear all"})]})]}),(0,a.jsxs)(g.a,{isOpen:w===b,onClose:()=>N(!1),size:"narrow",children:[(0,a.jsxs)(g.a.Content,{children:[(0,a.jsx)(m.D,{size:2,as:"h2",children:"Delete recent search"}),(0,a.jsx)("div",{className:"text-body2 text-slate pt-2",children:"Are you sure you want to delete this recent search?"})]}),(0,a.jsxs)(g.a.Footer,{className:"flex items-center justify-between mt-4",children:[(0,a.jsx)(y.$,{variant:"outline",className:"text-denim underline px-0 py-0 bg-transparent border-none",onClick:()=>N(!1),children:"No, cancel"}),(0,a.jsx)(y.$,{onClick:()=>{N(!1),f({id:S.id})},children:"Yes, delete"})]})]})]})};var T=s(90856),X=s(76292),_=s(64390),I=s(61702);let Y=["Saved","Recent"],P=()=>(0,a.jsxs)(X.A,{rightCol:(0,a.jsx)(_.A,{className:"hidden xl:block"}),rightColClassNames:"hidden xl:block",topContent:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.p,{navItems:I.lv,activeItem:2,className:"mb-4 [&_ul>li:last-of-type]:pr-5 lg:mb-12"}),(0,a.jsx)("h1",{className:"mb-4 md:mb-8",children:"Saved searches"})]}),children:[(0,a.jsx)(d(),{children:(0,a.jsx)("title",{children:"Saved Searches | OnTheMarket"})}),(0,a.jsx)(T.A,{}),(0,a.jsxs)(n.fu,{children:[(0,a.jsx)(n.wb,{className:"flex items-center justify-between p-1.5 rounded-full bg-cadet-blue/10 md:w-[60%]",children:Y.map(e=>(0,a.jsx)(n.oz,{as:r.Fragment,children:t=>{let{selected:s}=t;return(0,a.jsx)("button",{type:"button",className:(0,o.XS)(["flex-1 text-body2 py-1 outline-none","text-cadet-blue rounded-full hover:bg-cadet-blue/20 text-center py-2 font-semibold !text-sm",s?"text-denim bg-white hover:!bg-white/70":"text-cadet-blue"]),children:e})}},e))}),(0,a.jsxs)(n.T2,{children:[(0,a.jsx)(n.Kp,{children:(0,a.jsx)(S,{})}),(0,a.jsx)(n.Kp,{children:(0,a.jsx)(O,{})})]})]})]});var q=s(63792),M=s(30493),R=s(82580);let F=()=>(0,a.jsx)(P,{});F.getInitialProps=async e=>{if(R.S$){let t=await (0,l.json)(e.req);await e.reduxStore.dispatch((0,q.$)(t.globals)),await e.reduxStore.dispatch((0,M.i)(t.data))}return{}};let U=F},55435:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(37876);s(14232);var r=s(31777),l=s(89099),i=s(10999);let n=()=>{let e=(0,r.d4)(e=>e.globals.brand),{"page-header-iframe-url":t}=e,s=e&&e.name&&"otm"!==e.name||!1,{pathname:n}=(0,l.useRouter)();return s?(0,a.jsx)("div",{className:(0,i.XS)(["otm-brand-header-container",n.includes("/details/[id]")&&"fixed top-[50px] w-full md:static"]),children:(0,a.jsx)("iframe",{name:"co-branding-page-header",title:"nav",src:t,sandbox:"allow-scripts allow-top-navigation",seamless:"seamless",width:"100%",height:"50",scrolling:"no"})}):null}},64390:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var a=s(37876);s(14232);var r=s(15202),l=s(32770),i=s(74504),n=s(31777),c=s(10999);let d=e=>{let{className:t}=e,s=(0,n.d4)(e=>e.globals["static-url-prefix"]);return(0,a.jsxs)(r.w,{bgColor:"brand-bright",borderColor:"none",className:(0,c.XS)(["bg-no-repeat bg-left-bottom bg-[length:80%] lg:!pb-[55%]",t]),style:{backgroundImage:`url(${s}/images/[email protected])`},children:[(0,a.jsx)(l.D,{as:"div",size:2,children:"Value my home"}),(0,a.jsx)("p",{className:"text-body2 text-denim mb-5 mt-1",children:"Get a reliable, up-to-date valuation from local property experts."}),(0,a.jsx)(i.$,{variant:"outline",className:"bg-white",href:"/property-valuation/",children:"Request free valuation"})]})}},71993:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(37876);s(14232);let r=()=>(0,a.jsx)("a",{href:"#maincontent",className:"sr-only focus:not-sr-only",tabIndex:"0",children:"Skip to main content"})},76292:(e,t,s)=>{"use strict";s.d(t,{A:()=>
1o});var a=s(37876);s(14232);var r=s(44136),l=s(71993),i=s(79004),n=s(10999),c=s(38695),d=s(55435);let o=e=>{let{children:t,rightCol:s,bottomContent:o,topContent:h,transparentNav:m,transparentNavWhiteText:x,stickyHeader:u,mainContentClassNames:p,mainColClassNames:j,rightColClassNames:v,headerClassNames:g,footerClassNames:y}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.A,{}),(0,a.jsx)(r.A,{transparentNav:m,transparentNavWhiteText:x,stickyHeader:u,className:g}),(0,a.jsx)(d.A,{}),(0,a.jsxs)("div",{id:"maincontent",className:(0,n.XS)(["max-w-screen-xl p-5","sm:p-8","lg:py-10","xl:mx-auto","2xl:px-0",m&&"!pt-0",p]),children:[h&&(0,a.jsx)("div",{children:(0,a.jsx)(c.A,{children:h})}),s?(0,a.jsxs)("div",{className:"lg:flex lg:flex-row-reverse lg:items-start",children:[(0,a.jsx)("div",{className:(0,n.XS)(["lg:pl-16 lg:box-content lg:shrink-0 lg:w-1/3 lg:sticky lg:top-5",v]),children:(0,a.jsx)(c.A,{children:s})}),(0,a.jsx)("div",{className:(0,n.XS)(["mt-6 flex-1 min-w-0 lg:mt-0",j]),children:(0,a.jsx)(c.A,{children:t})})]}):(0,a.jsx)(c.A,{children:t}),o&&(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(c.A,{children:o})})]}),(0,a.jsx)(i.A,{className:y})]})}},87968:()=>{},91504:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(10999);function r(e){return(t,s,r)=>{let l=e(t,s,r);return{...l,data:(0,a.Tz)(l.data)}}}}},e=>{e.O(0,[6701,7725,8233,4540,3774,5038,5608,623,409,856,636,6593,8792],()=>e(e.s=11249)),_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.