1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{92780:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/store-finder",function(){return s(4349)}])},64884:function(e,t,s){"use strict";var n=s(85893);t.Z=e=>{let{...t}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 0c-4.198 0-8 3.403-8 7.602 0 4.198 3.469 9.21 8 16.398 4.531-7.188 8-12.2 8-16.398 0-4.199-3.801-7.602-8-7.602zm0 11c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3z"})})}},4349:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSG:function(){return K},default:function(){return ee}});var n=s(85893),r=s(67294),i=s(50361),o=s.n(i),l=s(61335),a=s(6158),c=s(61108),d=s(93967),u=s.n(d);s(80571);let m=()=>new Promise((e,t)=>{window.navigator.geolocation.getCurrentPosition(t=>{let{coords:{latitude:s,longitude:n}}=t;return e({latitude:s,longitude:n})},t)});var f=s(2962),h=s(24344),p=s.n(h),v=s(8930),x=s(93627),g=s.n(x);let j=(0,s(19472).Z)(350);var w=e=>{let{mapboxAccessToken:t,onSelect:s}=e,[i,o]=(0,r.useState)(""),[l,a]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[m,f]=(0,r.useState)([]),[h,x]=(0,r.useState)(!0),w=(0,r.useMemo)(()=>{if(t)return new(p())(t)},[t]);(0,r.useEffect)(()=>{let e=!!i.trim();!c&&e?d(!0):c&&a(e?"":"Location is required")},[i,c,d]);let b=e=>{if(!e)return f([]);j(()=>{w.geocodeForward(e,{length:5,country:"AU"}).then(e=>e.entity.features).then(f)})},_=e=>{if(o(e.place_name||i),x(!1),e){let[t,n]=e.center;s({longitude:t,latitude:n})}},N=h&&!!m.length;return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"react-geocoder relative",onBlur:()=>setTimeout(x,300,!1),children:[(0,n.jsx)(v.Z,{autoFocus:!0,label:"Enter Postcode or Address",className:"geocoder__input-container",value:i,onFocus:()=>x(!0),onChange:e=>{b(e),o(e)},errorMessage:l,inputClassName:u()([g().geocoder__input,{[g().inputError]:!!l}])}),N&&(0,n.jsx)("ul",{className:"react-geocoder-results absolute border w-full z-50 bg-white font-sans divide-y-2",children:m.map(e=>(0,n.jsx)("li",{onClick:()=>_(e),className:"react-geocoder-item hover:bg-gray-200 py-1",children:e.place_name},e.id))})]})})},b=s(36489),_=s(56481),N=s(94078),y=e=>{let{...t}=e;return(0,n.jsxs)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 638.4 624.1",...t,children:[(0,n.jsx)("path",{d:"M319.2,228
1c-22.3,0-43.6,8.9-59.4,24.6c-15.8,15.8-24.6,37.1-24.6,59.4s8.9,43.6,24.6,59.4c15.8,15.8,37.1,24.6,59.4,24.6 s43.6-8.9,59.4-24.6c15.8-15.8,24.6-37.1,24.6-59.4c0-22.3-8.9-43.6-24.6-59.4S341.5,228.1,319.2,228L319.2,228z M319.2,364.9 c-14,0-27.5-5.6-37.4-15.5c-9.9-9.9-15.5-23.4-15.5-37.4s5.6-27.5,15.5-37.4c9.9-9.9,23.4-15.5,37.4-15.5s27.5,5.6,37.4,15.5 c9.9,9.9,15.5,23.4,15.5,37.4c0,14-5.6,27.5-15.5,37.4C346.7,359.3,333.2,364.9,319.2,364.9L319.2,364.9z"}),(0,n.jsx)("path",{d:"M583.6,296.5h-78.5c-3.7-44-22.8-85.2-54-116.4c-31.2-31.2-72.4-50.3-116.4-54V47.6c0-5.6-3-10.7-7.8-13.5 c-4.8-2.8-10.7-2.8-15.6,0c-4.8,2.8-7.8,7.9-7.8,13.5V126c-44,3.7-85.2,22.8-116.4,54c-31.2,31.2-50.3,72.4-54,116.4H54.7 c-5.6,0-10.7,3-13.5,7.8c-2.8,4.8-2.8,10.7,0,15.6c2.8,4.8,7.9,7.8,13.5,7.8h78.5c3.7,44,22.8,85.2,54,116.4 c31.2,31.2,72.4,50.3,116.4,54v78.5c0,5.6,3,10.7,7.8,13.5c4.8,2.8,10.7,2.8,15.6,0c4.8-2.8,7.8-7.9,7.8-13.5V498 c44-3.7,85.2-22.8,116.4-54c31.2-31.2,50.3-72.4,54-116.4h78.5c5.6,0,10.7-3,13.5-7.8c2.8-4.8,2.8-10.7,0-15.6 C594.3,299.4,589.2,296.5,583.6,296.5L583.6,296.5z M334.8,466.8v-24.1c0-5.6-3-10.7-7.8-13.5c-4.8-2.8-10.7-2.8-15.6,0 c-4.8,2.8-7.8,7.9-7.8,13.5v24.1c-35.7-3.6-69-19.4-94.4-44.8c-25.4-25.4-41.2-58.7-44.8-94.4h24.1c5.6,0,10.7-3,13.5-7.8 c2.8-4.8,2.8-10.7,0-15.6c-2.8-4.8-7.9-7.8-13.5-7.8h-24.1c3.6-35.7,19.4-69,44.8-94.4c25.4-25.4,58.7-41.2,94.4-44.8v24.1 c0,5.6,3,10.7,7.8,13.5c4.8,2.8,10.7,2.8,15.6,0c4.8-2.8,7.8-7.9,7.8-13.5v-24.1c35.7,3.6,69,19.4,94.4,44.8 c25.4,25.4,41.2,58.7,44.8,94.4h-24.1c-5.6,0-10.7,3-13.5,7.8c-2.8,4.8-2.8,10.7,0,15.6c2.8,4.8,7.9,7.8,13.5,7.8h24.1 c-3.6,35.7-19.4,69-44.8,94.4C403.8,447.4,370.4,463.2,334.8,466.8z"})]})},k=s(41664),C=s.n(k),S=s(64884),L=s(56707),A=s(65989),G=s.n(A);function E(e){var t,s,i,o;let{latitude:l,longitude:a,isPopupOpen:d,onPopupClose:m,onMarkerClick:f,store:h}=e,[p,v]=(0,r.useState)("https://www.google.com/maps/search/?api=1&query=".concat(l,",").concat(a));return(0,r.useEffect)(()=>{var e;(0,L.d)(null==h?void 0:null===(e=h.data)||void 0===e?void 0:e.store_url)&&v(h.data.store_url.url)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Jx,{anchor:"bottom",latitude:l,longitude:a,children:(0,n.jsx)("a",{role:"button",onClick:f,children:(0,n.jsx)(S.Z,{})})}),d&&(0,n.jsx)(c.GI,{anchor:"bottom",latitude:l,longitude:a,offset:29,onClose:m,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!0,children:(0,n.jsxs)("div",{className:"text-xs font-sans font-bold",children:[(0,n.jsx)("div",{className:"mb-1 w-4/5 uppercase",children:h.data.name[0].text}),(0,n.jsxs)("div",{className:"mb-2 w-4/5",children:[(0,n.jsxs)("span",{children:[null===(t=h.data)||void 0===t?void 0:t.street_address,", "]}),(0,n.jsxs)("span",{children:[null===(s=h.data)||void 0===s?void 0:s.suburb,", "]}),(0,n.jsxs)("span",{children:[null===(i=h.data)||void 0===i?void 0:i.state," "]}),(0,n.jsx)("span",{className:"block",children:null===(o=h.data)||void 0===o?void 0:o.phone})]}),(0,n.jsxs)("div",{className:"flex",children:[(0,n.jsx)(C(),{passHref:!0,href:"stores/".concat(h.uid),className:"underline",children:"Store Details"}),(0,n.jsx)(C(),{passHref:!0,href:p,className:u()("underline",G().getDirectionsButton),children:"Get Directions"})]})]})})]})}var I=s(52640),T=s.n(I);function Z(e){var t,s,i,o,l;let{className:a,store:c,onActive:d,onClick:m}=e,f=(0,r.useRef)(null);return(0,r.useEffect)(()=>{c.isActive&&f.current&&"function"==typeof d&&d(f.current.offsetTop)},[c.isActive]),(0,n.jsxs)("div",{ref:f,className:u()(a,"text-sm border-b border-accents-2 relative cursor-pointer",T().storeListItem,{[T().storeListItemActive]:c.isActive}),onClick:()=>{"function"==typeof m&&m(c.id)},children:[(0,n.jsx)("div",{className:"text-sm mb-1 w-2/3 uppercase font-bold",children:null===(s=c.data)||void 0===s?void 0:null===(t=s.name[0])||void 0===t?void 0:t.text}),(0,n.jsxs)("div",{className:"mb-2.5 w-2/5",children:[(0,n.jsxs)("span",{children:[null===(i=c.data)||void 0===i?void 0:i.street_address,", "]}),(0,n.jsxs)("span",{children:[null===(o=c.data)||void 0===o?void 0:o.suburb,", "]}),(0,n.jsxs)("span",{children:[null===(l=c.data)||void 0===l?void 0:l.state," "]})]}),(0,n.jsx)(C(),{href:"stores/".concat(c.uid),legacyBehavior:!0,children:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("a",{href:"stores/".concat(c.uid),className:"text-xs underline",children:"Store Details"})})})]})}function D(e){let{stores:t,onListItemClick:s}=e,i=(0,r.useRef)(null),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!==e&&i.current&&i.current.scrollTo({behavior:"smooth",top:e-i.current.offsetTop})};return(0,n.jsx)(n.Fragment,{children:t&&t.length>0&&(0,n.jsx)("div",{ref:i,className:u()(T().root,"w-full"),children:t.map((e,t)=>(0,n.jsx)(Z,{className:0!==t?"pt-5":"",store:e,onActive:o,onClick:s},e.id))})})}Z.defaultProps={className:""};var z=s(21190),P=s(18716),B=s(7739),M=s.n(B),O=s(66604),F=s.n(O),H=s(5594),R=s(22049),V=s(42586),J=s.n(V);function W(e){let{store:t,onActive:s,onClick:i}=e,o=(0,r.useRef)(null),[l,a]=(0,r.useState)("https://www.google.com/maps/search/?api=1&query=".concat(t.data.geolocation.latitude,",").concat(t.data.geolocation.longitude));return(0,r.useEffect)(()=>{var e;(0,L.d)(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.store_url)&&a(t.data.store_url.url)},[]),(0,r.useEffect)(()=>{t.isActive&&o.current&&"function"==typeof s&&s(o.current.offsetTop)},[t.isActive]),(0,n.jsxs)("div",{ref:o,className:u()("border-accents-2 text-sm relative cursor-pointer",{[J().storeGroupListItemActive]:t.isActive},J().storeGroupListItem),onClick:()=>{"function"==typeof i&&i(t.id)},children:[(0,n.jsx)("p",{className:"text-sm mb-1 w-2/3 uppercase font-bold",children:t.data.name[0].text}),(0,n.jsxs)("div",{className:"mb-5 w-2/5",children:[(0,n.jsxs)("span",{children:[t.data.street_address,", "]}),(0,n.jsxs)("span",{children:[t.data.suburb,", "]}),(0,n.jsxs)("span",{children:[t.data.state," "]})]}),(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(C(),{href:l,passHref:!0,className:J().storeGroupListBtn,children:"Directions"}),(0,n.jsx)(C(),{href:"/stores/".concat(t.uid),passHref:!0,className:J().storeDetailsLink,onClick:e=>{e.stopPropagation()},children:"Store details"})]})]})}var q=(0,r.memo)(function(e){let t=(0,r.useRef)(null),[s,i]=(0,r.useState)(null);if((0,r.useEffect)(()=>
1{if(!Array.isArray(e.stores)||!e.stores.length)return;let t=F()(M()(e.stores,"data.state"),e=>({stores:e,isOpen:!1}));if(e.selectedState){let s=t[e.selectedState];s&&(s.isOpen=!0)}i(t)},[i,e.stores]),!s)return null;let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!==e&&t.current&&t.current.scrollTo({behavior:"smooth",top:e-t.current.offsetTop})},a=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";"function"==typeof e.onSelect&&e.onSelect(t)},c=e=>{i(t=>({...t,[e]:{...o()(t[e]),isOpen:!t[e].isOpen}}))};return(0,n.jsx)("div",{ref:t,className:u()(J().storeGroupedList,"border-t-2 border-gray-200 overflow-y-auto w-full mb-6 md:mb-0"),children:["VIC","NSW","QLD","SA","ACT","WA","TAS","NT"].map(t=>{let r=s[t];if(!r)return null;let{stores:i,isOpen:o}=r;return(0,n.jsxs)("div",{onClick:()=>a(t),className:"border-b-2 border-gray-200 pr-2",children:[(0,n.jsxs)("div",{role:"button",onClick:()=>c(t),className:"cursor-pointer flex items-center justify-between py-5 md:py-4",children:[(0,n.jsx)("span",{className:"text-xl uppercase",children:t}),(0,n.jsx)("span",{className:"text-xl mr-4",children:o?(0,n.jsx)(H.Z,{}):(0,n.jsx)(R.Z,{})})]}),(0,n.jsx)(z.M,{initial:!1,children:o&&(0,n.jsx)(P.E.div,{className:"overflow-y-hidden",initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{height:"auto"},collapsed:{height:0}},transition:{duration:.3,ease:[.85,0,.15,1]},children:i.map(t=>(0,n.jsx)(W,{store:t,onActive:l,onClick:e.onListItemClick},null==t?void 0:t.id))})})]},t)})})});let Q="pk.eyJ1IjoiZ2hhbmRhaXQiLCJhIjoiY2ttazQ3ZWoyMHhxNzJ2bzR6ZWJlcW1uNCJ9.h6AawxlWbJmDHCcm9qNQCA",U={right:10,top:10},X={width:"100%",height:"60vh"},Y="Ghanda Store Finder | Ghanda Clothing",$="Find a Ghanda Clothing store near you. View store locations, trading hours, contact details and other information for stores across Australia.";var K=!0;function ee(e){let t={latitude:-37.815018,longitude:144.946014},s=(0,r.useRef)(null),i=(0,r.useRef)(null),[d,h]=(0,r.useState)([]),[p,v]=(0,r.useState)({distance:25,state:""}),[x,g]=(0,r.useState)({...t}),[j,b]=(0,r.useState)(!1),k=(e,t)=>e.filter(e=>e.data.state===t.state),C=(e,t)=>e.filter(e=>T(e,x)<=t.distance),S=(0,r.useMemo)(()=>p.state?k(d,p):C(d,p),[d,p,x]);(0,r.useEffect)(()=>{h(()=>{var t;return(null===(t=e.pageData)||void 0===t?void 0:t.filter(e=>{var t;let{longitude:s,latitude:n}=(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.geolocation)||{};return s&&n}))||[]})},[h]),(0,r.useEffect)(()=>{if(S.length){let e=I(S);if(e&&s.current){let{lat:t,lng:n}=e.getCenter();g({latitude:t,longitude:n}),s.current.fitBounds(e,{padding:28,maxZoom:8})}}},[p.state]);let L=e=>{let t=d.map(t=>({...o()(t),isActive:t.id===e})),n=t.find(t=>t.id===e);if(n){let e=I([n]);e&&s.current&&s.current.fitBounds(e,{duration:400,maxDuration:700,maxZoom:8})}h(t)},A=e=>{h(t=>t.map(t=>({...o()(t),isActive:t.id!==e&&t.isActive})))},G=e=>{L(e)};function I(e){if(!e||!e.length)return null;let t=new a.LngLatBounds;return e.forEach(e=>{var s,n,r,i;let o=(null===(n=e.data)||void 0===n?void 0:null===(s=n.geolocation)||void 0===s?void 0:s.latitude)||0,l=(null===(i=e.data)||void 0===i?void 0:null===(r=i.geolocation)||void 0===r?void 0:r.longitude)||0;o&&l&&t.extend([l,o])}),t}function T(e,t){var s,n,r,i;let o=(0,l.xmu)([t.latitude,t.longitude]),a=(null===(n=e.data)||void 0===n?void 0:null===(s=n.geolocation)||void 0===s?void 0:s.latitude)||0,c=(null===(i=e.data)||void 0===i?void 0:null===(r=i.geolocation)||void 0===r?void 0:r.longitude)||0,d=(0,l.xmu)([a,c]);return(0,l.TE$)(o,d,{units:"kilometers"})}function Z(e,t){return e.reduce((e,s)=>!e||T(s,t)<=T(e,t)?s:e,null)}let z=(0,r.useMemo)(()=>S.map(e=>{let{latitude:t,longitude:s}=e.data.geolocation;return t&&s?(0,n.jsx)(E,{store:e,latitude:t,longitude:s,isPopupOpen:e.isActive,onMarkerClick:()=>L(e.id),onPopupClose:()=>A(e.id)},e.id):null}),[S]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f.PB,{title:Y,description:$,openGraph:{type:"website",title:Y,description:$}}),(0,n.jsxs)("div",{className:"pt-6 md:pt-12 pb-8 px-3 md:px-12 ignoreMinHeight",style:{minHeight:"516px"},id:"store-finder-container",children:[(0,n.jsx)("div",{className:"flex justify-center m-auto font-sans",children:(0,n.jsx)("h2",{className:"h2 font-sans store-finder-heading",children:"Find a Store"})}),(0,n.jsx)("div",{className:"flex w-full justify-center m-auto mt-3.5 font-sans search-container",children:(0,n.jsxs)("div",{className:"w-full flex flex-col md:flex-row flex-wrap justify-center md:flex-nowrap",children:[(0,n.jsxs)("div",{className:"w-full md:w-auto flex justify-center pb-3 md:pb-0 items-start",children:[(0,n.jsx)("div",{className:"search-input-container ",children:(0,n.jsx)(w,{mapboxAccessToken:Q,onSelect:e=>{b(!0),v(e=>({...e,state:""})),g({latitude:e.latitude,longitude:e.longitude});let t=Z(d,e);t&&L(t.id),s.current&&(s.current.setZoom(8),s.current.panTo([e.longitude,e.latitude]))}})}),(0,n.jsx)("div",{className:"ml-12 md:ml-18",children:(0,n.jsx)(_.Z,{type:"button",variant:"white-3",onClick:e=>{e.preventDefault(),m().then(e=>{b(!0),g({...e}),v(e=>({...e,state:""}));let t=Z(d,e);t&&L(t.id),s.current&&(s.current.setZoom(8),s.current.panTo([e.longitude,e.latitude]))})},children:(0,n.jsx)(y,{width:"23px"})})}),(0,n.jsx)("div",{className:"ml-12 md:ml-18 w-24",children:(0,n.jsx)(N.Z,{className:"w-full",onCh
1ange:e=>{let{value:t}=e;v(e=>({...e,state:"",distance:t}))},defaultValue:p.distance,label:"Select",data:[{label:"5km",value:5},{label:"10km",value:10},{label:"15km",value:15},{label:"20km",value:20},{label:"25km",value:25}]})})]}),(0,n.jsx)("div",{className:"flex md:pl-18",children:(0,n.jsx)(_.Z,{onClick:e=>{e.preventDefault()},className:"z-0 py-3 text-sm h-12 block w-full",style:{fontSize:"14px"},id:"search-btn",variant:"primary",children:"Search"})})]})}),(0,n.jsxs)("div",{className:"flex w-full flex-col container m-auto font-sans mt-2 md:mt-14",id:"store-finder-results-container",children:[j&&!!S.length&&(0,n.jsxs)("div",{className:"border-b border-accents-3 text-sm pb-4 mb-5 md:border-b-0 md:pb-0 md:mb-0 flex justify-between",children:[(0,n.jsxs)("span",{children:[S.length," Stores(s) within ",p.distance,"km"]}),(0,n.jsx)("a",{onClick:()=>{i.current&&window.scrollTo({behavior:"smooth",top:i.current.offsetTop-86})},className:"cursor-pointer underline",children:"View All Results"})]}),!!p.state&&!!S.length&&(0,n.jsxs)("div",{className:"hidden md:block",children:["All stores in ",p.state]}),(0,n.jsxs)("div",{id:"results-inner-container",className:u()("flex w-full md:flex-row md:flex-nowrap flex-wrap container m-auto font-sans md:pt-7",{"pt-0":!S.length}),children:[(0,n.jsxs)("div",{ref:i,id:"store-list-container",className:u()("md:w-1/4 md:flex w-full md:mr-6 md:order-1",{"order-3":j}),children:[j&&0===S.length&&(0,n.jsx)("div",{className:"w-full flex flex-col container m-auto font-sans",children:(0,n.jsx)("div",{className:" text-md py-3 font-sans",children:(0,n.jsx)("span",{children:"No Stores in your specified location"})})}),j&&(0,n.jsx)(D,{stores:S,onListItemClick:G}),!j&&(0,n.jsx)(q,{stores:d,onSelect:e=>{v(t=>({...t,state:e}))},selectedState:p.state,onListItemClick:G})]}),(0,n.jsx)("div",{className:u()("md:w-3/4 w-full order-2"),children:(0,n.jsxs)(c.ZP,{ref:s,mapboxAccessToken:Q,dragPan:!0,mapStyle:"mapbox://styles/ghandait/ckrk6vr7e8ztl18phhaz5263f",initialViewState:{...t,zoom:8},style:X,children:[(0,n.jsx)(c.Pv,{style:U}),z]})})]})]})]})]})}ee.Layout=b.Z},56707:function(e,t,s){"use strict";s.d(t,{d:function(){return n}});let n=e=>void 0!==e&&"Web"===e.link_type&&void 0!==e.url},93627:function(e){e.exports={geocoder__inputContainer:"Geocoder_geocoder__inputContainer__tDoH2",geocoder__input:"Geocoder_geocoder__input__ChCtb",inputError:"Geocoder_inputError__Q6eeU"}},42586:function(e){e.exports={storeGroupedList:"store-grouped-list_storeGroupedList__EOhlV",storeGroupListBtn:"store-grouped-list_storeGroupListBtn__fU6VP",storeGroupListItem:"store-grouped-list_storeGroupListItem__o1_Yb",storeGroupListItemActive:"store-grouped-list_storeGroupListItemActive__sGcIS",storeDetailsLink:"store-grouped-list_storeDetailsLink__0gOwR"}},52640:function(e){e.exports={root:"store-list_root__jLyL9",storeListItem:"store-list_storeListItem__oawqh",storeListItemActive:"store-list_storeListItemActive__usZPN"}},65989:function(e){e.exports={getDirectionsButton:"store-marker_getDirectionsButton__vNyxi"}}},function(e){e.O(0,[714,634,715,822,360,583,489,888,774,179],function(){return e(e.s=92780)}),_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.