1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,846399,e=>{"use strict";var t=e.i(563705),n=e.i(464645),o=e.i(920269),i=e.i(118226),r=e.i(760905),u=e.i(581393),a=e.i(615190);let l={name:"dealership_name",label:"Search for a Dealership",rules:{required:!0},customRequired:{value:!0,message:"*Please select a dealership location"}},s=(0,u.default)({})(e=>{let{setValue:u}=(0,o.useFormContext)(),[s,c]=(0,n.useState)(null),[d,f]=(0,n.useState)([]),[g,p]=(0,n.useState)(null),[m,h]=(0,n.useState)([]),[,I]=(0,n.useState)(!0),v=(0,n.useMemo)(()=>(0,i.createLocationAutosuggestOptions)(m),[m]),y=e=>{u("dealership_name",e?.name??null),u("location_id",e?.id??null),u("dealership_id",e?.dealership?.id??null),u("dealership_slug",e?.dealership?.slug??null)};(0,n.useEffect)(()=>{(async()=>{try{let t=await fetch("/api/manufacturer-locations");if(!t.ok)throw Error("Failed to fetch locations");let n=await t.json(),o=(0,i.processManufacturerLocations)(n,e.locationType);h(o)}catch(e){console.error("Error fetching manufacturer locations:",e)}finally{I(!1)}})()},[e.locationType]);let b=()=>{c(null),f([]),p(null)};return(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)(r.ManufacturerLocationAutosuggest,{...l,...e,locationOptions:v,priorityList:["dealership","google_place"],placeholder:e.placeholder??"Postcode, city or dealership name",label:"",onSelect:e=>{"dealership"===e.type?(y(e.data),b()):"google_place"===e.type&&(c(e.data),f((0,i.filterLocationsByDistance)(m,!0,{latitude:e.data.lat,longitude:e.data.lng},250).slice(0,5)),p(null))},onInputChange:e=>{e||(y(null),b())}}),s&&d.length>0&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsxs)("label",{className:"form-label",children:["Select a dealership near ",s.address]}),(0,t.jsx)("div",{className:"mt-2",children:d.map(e=>(0,t.jsx)("button",{type:"button",className:(0,a.cn)("btn btn-sm mr-2 mb-2",e.id===g?"btn-primary":"btn-outline-secondary"),onClick:()=>{p(e.id),y(e)},children:e.name},e.id))})]})]})});e.s(["ManufacturerDealerSearch",0,e=>(0,t.jsx)(s,{...l,...e})])},118226,e=>{"use strict";var t=e.i(563705),n=e.i(937202),o=e.i(635757);e.i(141974);var i=e.i(129182),r=e.i(491315);["mahindra-australia","snowy-river-caravans"].includes(i.WEBSITE.slug);let u=e=>{let t=e.name?.toLowerCase()??"",n=e.website_name?.toLowerCase()??"";return!!(t&&n&&(t.includes(n)||n.includes(t)))},a=(e,t)=>"all"===t?e:e.filter(e=>e.location_type?.toLowerCase()===t);e.s(["createLocationAutosuggestOptions",0,e=>e.map(e=>({value:`${e.name}`,display:`${e.name}`,type:"dealership",data:e,icon:(0,t.jsx)(n.FaStore,{})})),"defaultSearchRadiusIndex",0,2,"filterLocationsByDistance",0,(e,t,n,i=50)=>t&&n?.latitude&&n?.longitude?e.map(e=>{let t=(0,o.calculateDistance)(n.latitude,n.longitude,parseFloat(e.address.lat),parseFloat(e.address.long));return{...e,distance:t}}).filter(e=>e.distance<=i).sort((e,t)=>e.distance-t.distance):e,"filterLocationsByType",0,a,"generateBounds",0,e=>{let t=e.map(e=>parseFloat(e.address.lat)),n=e.map(e=>parseFloat(e.address.long)),o=Math.min(...t),i=Math.max(...t),r=Math.min(...n),u=Math.max(...n),a=new google.maps.LatLngBounds;return a.extend(new google.maps.LatLng(o,r)),a.extend(new google.maps.LatLng(i,u)),a},"getLocationMapIdx",0,(e,t,n=10)=>e.length<n?t.mapIndex:null,"handleZoomAfterBounds",0,(e,t=15)=>{google.maps.event.addListenerOnce(e,"bounds_changed",()=>{e.getZoom()>t&&e.setZoom(t)})},"modifyLocationsArray",0,(e,t)=>e.map((e,n)=>({...e,mapIndex:n+1,isSelected:t===e.id})),"processManufacturerLocations",0,(e,t="sales")=>a((e=>{if(!e)return[];let t=new Map,n=[];for(let o of e)for(let e of o.locations){let i={website_id:o.id,website_name:o.name,website_url:o.url,dealership:o.dealership,...e};if(r.isMahindra&&1454===i.website_id)continue;if(null==i.id){n.push(i);continue}let a=t.get(i.id);(!a||u(i)&&!u(a))&&t.set(i.id,i)}return[...t.values(),...n]})(e),t),"searchRadiusValues",0,[25,50,75,100,150,250,500,750,1e3],"updateLocationSuggestParams",0,(e,t)=>{let n=new URLSearchParams(e.toString());if(n.delete("locationId"),n.delete("userLocation"),n.delete("lat"),n.delete("lng"),"dealership"===t.type){let e=t.data;n.set("locationId",e.id.toString());let o=e.location_type.toLowerCase();n.set("locationType",o)}else if("google_place"===t.type){let e=t.data;n.set("lat",e.lat.toString()),n.set("lng",e.lng.toString())}return n}])},760905,735986,303830,482007,e=>{"use strict";var t=e.i(563705),n=e.i(974036),o=e.i(644926),i=e.i(757656),r=e.i(10632),u=e.i(464645);function a(e,t){if(null==e)return{};var n={};for(var o in e)if(({}).hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function l(){return(l=Object.assign.bind()).apply(null,arguments)}var s=e.i(31591);e.i(152166);let c=e=>"object"==typeof e&&null!=e&&1===e.nodeType,d=(e,t)=>
1(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,f=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n,o=getComputedStyle(e,null);return d(o.overflowY,t)||d(o.overflowX,t)||!!(n=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e))&&(n.clientHeight<e.scrollHeight||n.clientWidth<e.scrollWidth)}return!1},g=(e,t,n,o,i,r,u,a)=>r<e&&u>t||r>e&&u<t?0:r<=e&&a<=n||u>=t&&a>=n?r-e-o:u>t&&a<n||r<e&&a>n?u-t+i:0,p=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var m=e.i(828683),h=0;function I(){}function v(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function y(e,t){var n;function o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=Array(i),u=0;u<i;u++)r[u]=arguments[u];o(),n=setTimeout(function(){n=null,e.apply(void 0,r)},t)}return i.cancel=o,i}function b(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function x(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){"function"==typeof t?t(e):t&&(t.current=e)})}}function w(e,t){return e&&t?Object.keys(e).reduce(function(n,o){return n[o]=void 0!==t[o]?t[o]:e[o],n},{}):e}function _(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function C(e,t,n,o,i){void 0===i&&(i=!1);var r=n.length;if(0===r)return -1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var a=e+t;a<0?a=i?u:0:a>u&&(a=i?0:u);var l=M(a,t<0,n,o,i);return -1===l?e>=r?-1:e:l}function M(e,t,n,o,i){void 0===i&&(i=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!o(n[u],u))return u}else for(var a=e;a<r;a++)if(!o(n[a],a))return a;return i?M(t?r-1:0,t,n,o):-1}function S(e,t,n,o){return void 0===o&&(o=!0),n&&t.some(function(t){return t&&(v(t,e,n)||o&&v(t,n.document.activeElement,n))})}var D=y(function(e){k(e).textContent=""},500);function k(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t)),t}var E={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},O=y(function(e,t){e&&t&&(k(t).textContent=e,D(t))},200),L="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?u.useLayoutEffect:u.useEffect,T="useId"in u.default?function(e){var t=e.id,n=e.labelId,o=e.menuId,i=e.getItemId,r=e.toggleButtonId,a=e.inputId,l="downshift-"+u.default.useId();return t||(t=l),(0,u.useRef)({labelId:n||t+"-label",menuId:o||t+"-menu",getItemId:i||function(e){return t+"-item-"+e},toggleButtonId:r||t+"-toggle-button",inputId:a||t+"-input"}).current}:function(e){var t=e.id,n=void 0===t?"downshift-"+String(h++):t,o=e.labelId,i=e.menuId,r=e.getItemId,a=e.toggleButtonId,l=e.inputId;return(0,u.useRef)({labelId:o||n+"-label",menuId:i||n+"-menu",getItemId:r||function(e){return n+"-item-"+e},toggleButtonId:a||n+"-toggle-button",inputId:l||n+"-input"}).current};function R(e,t,n,o){var i,r;if(void 0===e){if(void 0===t)throw Error(o);i=n[t],r=t}else r=void 0===t?n.indexOf(e):t,i=e;return[i,r]}function V(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function F(e){var t=(0,u.useRef)(e);return t.current=e,t}function K(e,t,n,o){var i=(0,u.useRef)(),r=(0,u.useRef)(),a=(0,u.useCallback)(function(t,n){r.current=n;var o=e(t=w(t,n.props),n);return n.props.stateReducer(t,l({},n,{changes:o}))},[e]),s=(0,u.useReducer)(a,t,n),c=s[0],d=s[1],f=F(t),g=(0,u.useCallback)(function(e){return d(l({props:f.current},e))},[f]),p=r.current;return(0,u.useEffect)(function(){var e,t,n,r=w(i.current,null==p?void 0:p.props);p&&i.current&&!o(r,c)&&(e=p.props,t=p.type,n={},Object.keys(r).forEach(function(e){var t,o,i,u,a,s,d;t=e,o=p,i=r,u=c,a=o.props,s=o.type,a[d="on"+V(t)+"Change"]&&void 0!==u[t]&&u[t]!==i[t]&&a[d](l({type:s},u)),c[e]!==r[e]&&(n[e]=c[e])}),e.onStateChange&&Object.keys(n).length&&e.onStateChange(l({type:t},n))),i.current=c},[c,p,o]),[c,g]}var B={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:function(e,t){e&&((e,t)=>{var n,o,i,r;let u;if("u"<typeof document)return[];
1let{scrollMode:a,block:l,inline:s,boundary:d,skipOverflowHiddenElements:m}=t,h="function"==typeof d?d:e=>e!==d;if(!c(e))throw TypeError("Invalid target");let I=document.scrollingElement||document.documentElement,v=[],y=e;for(;c(y)&&h(y);){if((y=p(y))===I){v.push(y);break}null!=y&&y===document.body&&f(y)&&!f(document.documentElement)||null!=y&&f(y,m)&&v.push(y)}let b=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,x=null!=(r=null==(i=window.visualViewport)?void 0:i.height)?r:innerHeight,{scrollX:w,scrollY:_}=window,{height:C,width:M,top:S,right:D,bottom:k,left:E}=e.getBoundingClientRect(),{top:O,right:L,bottom:T,left:R}={top:parseFloat((u=window.getComputedStyle(e)).scrollMarginTop)||0,right:parseFloat(u.scrollMarginRight)||0,bottom:parseFloat(u.scrollMarginBottom)||0,left:parseFloat(u.scrollMarginLeft)||0},V="start"===l||"nearest"===l?S-O:"end"===l?k+T:S+C/2-O+T,F="center"===s?E+M/2-R+L:"end"===s?D+L:E-R,K=[];for(let e=0;e<v.length;e++){let t=v[e],{height:n,width:o,top:i,right:r,bottom:u,left:c}=t.getBoundingClientRect();if("if-needed"===a&&S>=0&&E>=0&&k<=x&&D<=b&&S>=i&&k<=u&&E>=c&&D<=r)break;let d=getComputedStyle(t),f=parseInt(d.borderLeftWidth,10),p=parseInt(d.borderTopWidth,10),m=parseInt(d.borderRightWidth,10),h=parseInt(d.borderBottomWidth,10),y=0,O=0,L="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-m:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-p-h:0,R="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(I===t)y="start"===l?V:"end"===l?V-x:"nearest"===l?g(_,_+x,x,p,h,_+V,_+V+C,C):V-x/2,O="start"===s?F:"center"===s?F-b/2:"end"===s?F-b:g(w,w+b,b,f,m,w+F,w+F+M,M),y=Math.max(0,y+_),O=Math.max(0,O+w);else{y="start"===l?V-i-p:"end"===l?V-u+h+T:"nearest"===l?g(i,u,n,p,h+T,V,V+C,C):V-(i+n/2)+T/2,O="start"===s?F-c-f:"center"===s?F-(c+o/2)+L/2:"end"===s?F-r+m+L:g(c,r,o,f,m+L,F,F+M,M);let{scrollLeft:e,scrollTop:a}=t;y=0===B?0:Math.max(0,Math.min(a+y/B,t.scrollHeight-n/B+T)),O=0===R?0:Math.max(0,Math.min(e+O/R,t.scrollWidth-o/R+L)),V+=a-y,F+=e-O}K.push({el:t,top:y,left:O})}return K})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}
1).forEach(function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o})},environment:"u"<typeof window?void 0:window};function A(e,t,n){void 0===n&&(n=E);var o=e["default"+V(t)];return void 0!==o?o:n[t]}function j(e,t,n){void 0===n&&(n=E);var o=e[t];if(void 0!==o)return o;var i=e["initial"+V(t)];return void 0!==i?i:A(e,t,n)}function P(e){var t,n,o=j(e,"selectedItem"),i=j(e,"isOpen"),r=(n=j(t=e,"highlightedIndex"))>-1&&t.isItemDisabled(t.items[n],n)?-1:n,u=j(e,"inputValue");return{highlightedIndex:r<0&&o&&i?e.items.findIndex(function(t){return e.itemToKey(t)===e.itemToKey(o)}):r,isOpen:i,selectedItem:o,inputValue:u}}function N(e,t,n){var o=e.items,i=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,a=e.itemToKey,l=t.selectedItem,s=t.highlightedIndex;return 0===o.length?-1:void 0===i||s!==i||u(o[i],i)?void 0===r||u(o[r],r)?l?o.findIndex(function(e){return a(l)===a(e)}):n<0&&!u(o[o.length-1],o.length-1)?o.length-1:n>0&&!u(o[0],0)?0:-1:r:i}function H(e,t,n){var o=(0,u.useRef)({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return(0,u.useEffect)(function(){if(!e)return I;var i=n.map(function(e){return e.current});function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,S(n.target,i,e)||t()}function a(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function s(n){o.current.isTouchEnd=!0,o.current.isTouchMove||S(n.target,i,e,!1)||t()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",a),e.addEventListener("touchmove",l),e.addEventListener("touchend",s),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",s)}},[n,e,t]),o.current}var $=function(){return I};function J(e,t,n,o){void 0===o&&(o={});var i=o.document,r=U();(0,u.useEffect)(function(){e&&!r&&i&&O(e(t),i)},n),(0,u.useEffect)(function(){return function(){var e;O.cancel(),(e=null==i?void 0:i.getElementById("a11y-status-message"))&&e.remove()}},[i])}function W(e){var t=e.highlightedIndex,n=e.isOpen,o=e.itemRefs,i=e.getItemNodeFromIndex,r=e.menuElement,a=e.scrollIntoView,l=(0,u.useRef)(!0);return L(function(){!(t<0)&&n&&Object.keys(o.current).length&&(!1===l.current?l.current=!0:a(i(t),r))},[t]),l}function z(e,t,n){void 0===n&&(n=!0);var o,i=(null==(o=e.items)?void 0:o.length)&&t>=0;return l({isOpen:!1,highlightedIndex:-1},i&&l({selectedItem:e.items[t],isOpen:A(e,"isOpen"),highlightedIndex:A(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function q(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function U(){var e=u.default.useRef(!0);return u.default.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function G(e){var t=A(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Z={environment:s.default.shape({addEventListener:s.default.func.isRequired,removeEventListener:s.default.func.isRequired,document:s.default.shape({createElement:s.default.func.isRequired,getElementById:s.default.func.isRequired,activeElement:s.default.any.isRequired,body:s.default.any.isRequired}).isRequired,Node:s.default.func.isRequired}),itemToString:s.default.func,itemToKey:s.default.func,stateReducer:s.default.func},X=l({},Z,{getA11yStatusMessage:s.default.func,highlightedIndex:s.default.number,defaultHighlightedIndex:s.default.number,initialHighlightedIndex:s.default.number,isOpen:s.default.bool,defaultIsOpen:s.default.bool,initialIsOpen:s.default.bool,selectedItem:s.default.any,initialSelectedItem:s.default.any,defaultSelectedItem:s.default.any,id:s.default.string,labelId:s.default.string,menuId:s.default.string,getItemId:s.default.func,toggleButtonId:s.default.string,onSelectedItemChange:s.default.func,onHighlightedIndexChange:s.default.func,onStateChange:s.default.func,onIsOpenChange:s.default.func,scrollIntoView:s.default.func});function Y(e,t,n){var o,i=t.type,r=t.props;switch(i){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:N(r,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:N(r,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:r.isItemDisabled(r.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:G(r),isOpen:A(r,"isOpen"),selectedItem:A(r,"selectedItem"),inputValue:A(r,"inputValue")};break;default:throw Error("Reducer called without proper action type.")}return l({},e,o)}(0,m.__assign)((0,m.__assign)({},X),{items:s.default.array.isRequired,isItemDisabled:s.default.func});var Q=(0,m.__assign)((0,m.__assign)({},B),{isItemDisabled:function(){return!1}}),ee=Object.freeze({__proto__:null,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:19,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,ItemClick:14,ItemMouseMove:13,MenuMouseLeave:12,ToggleButtonBlur:11,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:1,ToggleButtonKeyDownArrowUp:2,ToggleButtonKeyDownCharacter:3,ToggleButtonKeyDownEnd:6,ToggleButtonKeyDownEnter:7,ToggleButtonKeyDownEscape:4,ToggleButtonKeyDown
1Home:5,ToggleButtonKeyDownPageDown:10,ToggleButtonKeyDownPageUp:9,ToggleButtonKeyDownSpaceButton:8});var et=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:22,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:19,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,InputBlur:9,InputChange:8,InputClick:10,InputKeyDownArrowDown:0,InputKeyDownArrowUp:1,InputKeyDownEnd:4,InputKeyDownEnter:7,InputKeyDownEscape:2,InputKeyDownHome:3,InputKeyDownPageDown:6,InputKeyDownPageUp:5,ItemClick:13,ItemMouseMove:12,MenuMouseLeave:11,ToggleButtonClick:14});function en(e){var t=P(e),n=t.selectedItem,o=t.inputValue;return""===o&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(o=e.itemToString(n)),l({},t,{inputValue:o})}l({},X,{items:s.default.array.isRequired,isItemDisabled:s.default.func,inputValue:s.default.string,defaultInputValue:s.default.string,initialInputValue:s.default.string,inputId:s.default.string,onInputValueChange:s.default.func});var eo=l({},B,{isItemDisabled:function(){return!1}});function ei(e,t){var n,o,i=t.type,r=t.props,u=t.altKey;switch(i){case 13:o={isOpen:A(r,"isOpen"),highlightedIndex:G(r),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case 0:o=e.isOpen?{highlightedIndex:C(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:N(r,e,1),isOpen:r.items.length>=0};break;case 1:o=e.isOpen?u?z(r,e.highlightedIndex):{highlightedIndex:C(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:N(r,e,-1),isOpen:r.items.length>=0};break;case 7:o=z(r,e.highlightedIndex);break;case 2:o=l({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case 5:o={highlightedIndex:C(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case 6:o={highlightedIndex:C(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case 3:o={highlightedIndex:M(0,!1,r.items,r.isItemDisabled)};break;case 4:o={highlightedIndex:M(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case 9:o=l({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case 8:o={isOpen:!0,highlightedIndex:G(r),inputValue:t.inputValue};break;case 10:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:N(r,e,0)};break;case 19:o={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case 22:o={inputValue:t.inputValue};break;default:return Y(e,t,et)}return l({},e,o)}var er=["onMouseLeave","refKey","ref"],eu=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ea=["onClick","onPress","refKey","ref"],el=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function es(e){void 0===e&&(e={}),I();var t,n,o,i,r,s=l({},eo,e),c=s.items,d=s.scrollIntoView,f=s.environment,g=s.getA11yStatusMessage,p=(t=(0,u.useRef)(),o=(n=K(ei,s,en,q))[0],i=n[1],r=U(),(0,u.useEffect)(function(){void 0!==s.selectedItem&&(r||s.itemToKey(s.selectedItem)!==s.itemToKey(t.current)&&i({type:22,inputValue:s.itemToString(s.selectedItem)}),t.current=o.selectedItem===t.current?s.selectedItem:o.selectedItem)},[o.selectedItem,s.selectedItem]),[w(o,s),i]),m=p[0],h=p[1],v=m.isOpen,y=m.highlightedIndex,C=m.selectedItem,M=m.inputValue,S=(0,u.useRef)(null),D=(0,u.useRef)({}),k=(0,u.useRef)(null),E=(0,u.useRef)(null),O=U(),L=T(s),V=(0,u.useRef)(),B=F({state:m,props:s}),A=(0,u.useCallback)(function(e){return D.current[L.getItemId(e)]},[L]);J(g,m,[v,y,C,M],f);var P=W({menuElement:S.current,highlightedIndex:y,isOpen:v,itemRefs:D,scrollIntoView:d,getItemNodeFromIndex:A});I(),(0,u.useEffect)(function(){j(s,"isOpen")&&k.current&&k.current.focus()},[]),(0,u.useEffect)(function(){O||(V.current=c.length)});var N=H(f,(0,u.useCallback)(function(){B.current.state.isOpen&&h({type:9,selectItem:!1})},[h,B]),(0,u.useMemo)(function(){return[S,E,k]},[S.current,E.current,k.current])),z=$();(0,u.useEffect)(function(){v||(D.current={})},[v]),(0,u.useEffect)(function(){var e;v&&null!=f&&f.document&&null!=k&&null!=(e=k.current)&&e.focus&&f.document.activeElement!==k.current&&k.current.focus()},[v,f]);var G=(0,u.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),h({type:0,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),h({type:1,altKey:e.altKey})},Home:function(e){B.current.state.isOpen&&(e.preventDefault(),h({type:3}))},End:function(e){B.current.state.isOpen&&(e.preventDefault(),h({type:4}))},Escape:function(e){var t=B.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),h({type:2}))},Enter:function(e){B.current.state.isOpen&&229!==e.which&&(e.preventDefault(),h({type:7}))},PageUp:function(e){B.current.state.isOpen&&(e.preventDefault(),h({type:5}))},PageDown:function(e){B.current.state.isOpen&&(e.preventDefault(),h({type:6}))}}},[h,B]),Z=(0,u.useCallback)(function(e){return l({id:L.labelId,htmlFor:L.inputId},e)},[L]),X=(0,u.useCallback)(function(e,t){var n,o=void 0===e?{}:e,i=o.onMouseLeave,r=o.refKey,u=void 0===r?"ref":r,s=o.ref,c=a(o,er),d=(void 0===t?{}:t).suppressRefError;return z("getMenuProps",void 0!==d&&d,u,S),l(((n={}
1)[u]=x(s,function(e){S.current=e}),n.id=L.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+L.labelId,n.onMouseLeave=b(i,function(){h({type:11})}),n),c)},[h,z,L]),Y=(0,u.useCallback)(function(e){var t,n,o=void 0===e?{}:e,i=o.item,r=o.index,u=o.refKey,s=o.ref,c=o.onMouseMove,d=o.onMouseDown,f=o.onClick;o.onPress;var g=o.disabled,p=a(o,eu);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var m=B.current,I=m.props,v=m.state,y=R(i,r,I.items,"Pass either item or index to getItemProps!"),w=y[0],_=y[1],C=I.isItemDisabled(w,_);return l(((t={})[void 0===u?"ref":u]=x(s,function(e){e&&(D.current[L.getItemId(_)]=e)}),t["aria-disabled"]=C,t["aria-selected"]=_===v.highlightedIndex,t.id=L.getItemId(_),t.role="option",t),!C&&((n={}).onClick=b(f,function(){h({type:13,index:_})}),n),{onMouseMove:b(c,function(){N.isTouchEnd||_===v.highlightedIndex||(P.current=!1,h({type:12,index:_,disabled:C}))}),onMouseDown:b(d,function(e){return e.preventDefault()})},p)},[h,L,B,N,P]),Q=(0,u.useCallback)(function(e){var t,n=void 0===e?{}:e,o=n.onClick;n.onPress;var i=n.refKey,r=n.ref,u=a(n,ea),s=B.current.state;return l(((t={})[void 0===i?"ref":i]=x(r,function(e){E.current=e}),t["aria-controls"]=L.menuId,t["aria-expanded"]=s.isOpen,t.id=L.toggleButtonId,t.tabIndex=-1,t),!u.disabled&&l({},{onClick:b(o,function(){h({type:14})})}),u)},[h,B,L]),ee=(0,u.useCallback)(function(e,t){var n,o,i=void 0===e?{}:e,r=i.onKeyDown,u=i.onChange,s=i.onInput,c=i.onBlur;i.onChangeText;var d=i.onClick,g=i.refKey,p=void 0===g?"ref":g,m=i.ref,I=a(i,el),v=(void 0===t?{}:t).suppressRefError;z("getInputProps",void 0!==v&&v,p,k);var y=B.current.state,w={};return I.disabled||((o={}).onChange=b(u,s,function(e){h({type:8,inputValue:e.target.value})}),o.onKeyDown=b(r,function(e){var t=_(e);t&&G[t]&&G[t](e)}),o.onBlur=b(c,function(e){null!=f&&f.document&&y.isOpen&&!N.isMouseDown&&h({type:9,selectItem:null!==e.relatedTarget||f.document.activeElement===f.document.body})}),o.onClick=b(d,function(){h({type:10})}),w=o),l(((n={})[p]=x(m,function(e){k.current=e}),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?L.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=L.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=I&&I["aria-label"]?void 0:L.labelId,n.autoComplete="off",n.id=L.inputId,n.role="combobox",n.value=y.inputValue,n),w,I)},[h,L,f,G,B,N,z]),et=(0,u.useCallback)(function(){h({type:15})},[h]),es=(0,u.useCallback)(function(){h({type:17})},[h]),ec=(0,u.useCallback)(function(){h({type:16})},[h]),ed=(0,u.useCallback)(function(e){h({type:18,highlightedIndex:e})},[h]),ef=(0,u.useCallback)(function(e){h({type:19,selectedItem:e})},[h]);return{getItemProps:Y,getLabelProps:Z,getMenuProps:X,getInputProps:ee,getToggleButtonProps:Q,toggleMenu:et,openMenu:ec,closeMenu:es,setHighlightedIndex:ed,setInputValue:(0,u.useCallback)(function(e){h({type:20,inputValue:e})},[h]),selectItem:ef,reset:(0,u.useCallback)(function(){h({type:21})},[h]),highlightedIndex:y,isOpen:v,selectedItem:C,inputValue:M}}es.stateChangeTypes=et;Z.stateReducer,Z.itemToKey,Z.environment,s.default.array,s.default.array,s.default.array,s.default.func,s.default.number,s.default.number,s.default.number,s.default.func,s.default.func,s.default.string,s.default.string;var ec={itemToKey:B.itemToKey,stateReducer:B.stateReducer,environment:B.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},ed=Object.freeze({__proto__:null,DropdownClick:7,DropdownKeyDownBackspace:6,DropdownKeyDownNavigationPrevious:5,FunctionAddSelectedItem:8,FunctionRemoveSelectedItem:9,FunctionReset:12,FunctionSetActiveIndex:11,FunctionSetSelectedItems:10,SelectedItemClick:0,SelectedItemKeyDownBackspace:2,SelectedItemKeyDownDelete:1,SelectedItemKeyDownNavigationNext:3,SelectedItemKeyDownNavigationPrevious:4});e.s(["useCombobox",0,es],735986);var ef=e.i(539115),eg=e.i(216915);function ep({allOptions:e,priorityList:n,label:o,onSelect:i,onInputChange:r,onUserInputChange:a,showResultsImmediately:l,placeholder:s,defaultInputValue:c,inputAriaDescribedBy:d}){let f=u.useMemo(()=>{let t=[...e];return n&&t.sort((e,t)=>
1n.indexOf(e.type)-n.indexOf(t.type)),t},[e,n]),[g,p]=u.useState(c??""),[m,h]=u.useState([]),I=u.useRef(null),v=u.useRef(-1),{selectedItem:y,isOpen:b,getLabelProps:x,getMenuProps:w,getInputProps:_,highlightedIndex:C,getItemProps:M,setInputValue:S}=es({items:m,itemToString:e=>e?e.display||e.value:"",initialInputValue:c,onInputValueChange({inputValue:e=""}){r?.(e),p(e)},onStateChange(e){switch(e.type){case es.stateChangeTypes.ItemClick:{let t=e.selectedItem??I.current;t&&i(t);break}case es.stateChangeTypes.InputKeyDownEnter:{let t=e.selectedItem??(v.current>=0?I.current:null);t&&i(t);break}case es.stateChangeTypes.InputBlur:e.selectedItem&&i(e.selectedItem)}}});u.useEffect(()=>{I.current=y},[y]),u.useEffect(()=>{v.current=C},[C]),u.useEffect(()=>{S(c??"")},[c,S]),u.useEffect(()=>{h(f.filter(e=>{let t=e.value.toLowerCase(),n=g.toLowerCase();return t.includes(n)}))},[g,f]);let D=b&&(l||g.length>0);return(0,t.jsxs)("div",{className:eg.default.autocomplete,children:[o&&(0,t.jsx)("label",{...x(),className:eg.default.autocomplete__label,children:o}),(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:eg.default.autocomplete__inputWrapper,children:[(0,t.jsx)(ef.IoSearch,{size:30,className:eg.default.autocomplete__searchIcon}),(0,t.jsx)("input",{..._({placeholder:s,"aria-describedby":d,onChange:e=>{a?.(e.currentTarget.value)}}),className:eg.default.autocomplete__input})]})}),(0,t.jsx)("ul",{...w(),className:eg.default.autocomplete__menu,style:{display:D?void 0:"none"},children:D&&m.map((e,n)=>(0,t.jsxs)("li",{...M({index:n,item:e,className:`${eg.default.autocomplete__item} ${C===n?eg.default["autocomplete__item--highlighted"]:""} ${y?.value===e.value?eg.default["autocomplete__item--selected"]:""}`}),children:[e.icon&&(0,t.jsx)("span",{className:eg.default.autocomplete__itemIcon,children:e.icon}),e.display||e.value]},`${n}-${e.value}`))})]})}e.s(["Autosuggest",0,ep],303830),e.s([],482007);var em=e.i(307032);let eh=({locationOptions:e,priorityList:n=[],label:u="Search for a Dealership",placeholder:a,onSelect:l,onInputChange:s,useGoogleLocations:c=!0})=>{let d=c?(0,o.default)({googleMaps:{GoogleMaps:r.default},requestOptions:{componentRestrictions:{country:"AU"},types:["(regions)"]},debounce:300,cache:!1}):null,f=[...e,...c&&d?.suggestions.status==="OK"?d.suggestions.data.map(e=>({value:e.description,type:"google_place",data:e,icon:(0,t.jsx)(i.FaMapMarkerAlt,{})})):[]];return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)(ep,{label:u,placeholder:a,allOptions:f,priorityList:n,onSelect:async e=>{if(e)if("google_place"===e.type&&c){let t=e.data;try{let e={address:t.description,componentRestrictions:{country:"au"}},n=(await (0,o.getGeocode)(e))[0].geometry.location;l?.({type:"google_place",data:{lat:n.lat(),lng:n.lng(),address:t.description}})}catch(e){console.error("Error getting geocode:",e)}d?.clearSuggestions()}else l?.({type:"dealership",data:e.data})},onInputChange:e=>{c&&d?.setValue(e),s?.(e),!e&&c&&d?.clearSuggestions(),s?.(e)}})})})};e.s(["ManufacturerLocationAutosuggest",0,({useGoogleLocations:e=!0,...o})=>{let i=(0,n.useAtomValue)(r.googleMapsLoadedAtom);return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(r.default,{}),!e||i?(0,t.jsx)(eh,{locationOptions:o.locationOptions,priorityList:o.priorityList,label:o.label,onSelect:o.onSelect,onInputChange:o.onInputChange,useGoogleLocations:e,placeholder:o.placeholder}):(0,t.jsx)(em.Skeleton,{className:"h-12 w-full rounded-full"})]})}],760905)},937202,e=>{"use strict";e.i(37622);var t=e.i(272560);e.s(["FaCheck",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"}}]})(e)},"FaChevronDown",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"}}]})(e)},"FaChevronRight",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"}}]})(e)},"FaCircleCheck",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(e)},"FaFacebookF",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 320 512"}
1,child:[{tag:"path",attr:{d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"}}]})(e)},"FaStore",0,function(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M547.6 103.8L490.3 13.1C485.2 5 476.1 0 466.4 0L109.6 0C99.9 0 90.8 5 85.7 13.1L28.3 103.8c-29.6 46.8-3.4 111.9 51.9 119.4c4 .5 8.1 .8 12.1 .8c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4zM499.7 254.9c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3L448 384l-320 0 0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L64 384l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64 0-131.4c-4 1-8 1.8-12.3 2.3z"}}]})(e)}])},216915,e=>{e.v({autocomplete:"Autosuggest-module-scss-module__mrJtJa__autocomplete",autocomplete__input:"Autosuggest-module-scss-module__mrJtJa__autocomplete__input",autocomplete__inputWrapper:"Autosuggest-module-scss-module__mrJtJa__autocomplete__inputWrapper",autocomplete__item:"Autosuggest-module-scss-module__mrJtJa__autocomplete__item","autocomplete__item--highlighted":"Autosuggest-module-scss-module__mrJtJa__autocomplete__item--highlighted","autocomplete__item--selected":"Autosuggest-module-scss-module__mrJtJa__autocomplete__item--selected",autocomplete__itemIcon:"Autosuggest-module-scss-module__mrJtJa__autocomplete__itemIcon",autocomplete__label:"Autosuggest-module-scss-module__mrJtJa__autocomplete__label",autocomplete__menu:"Autosuggest-module-scss-module__mrJtJa__autocomplete__menu",autocomplete__searchIcon:"Autosuggest-module-scss-module__mrJtJa__autocomplete__searchIcon"})},482635,(e,t,n)=>{"use strict";var o,i=Symbol.for("react.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case u:case l:case a:case g:case p:return e;default:switch(e=e&&e.$$typeof){case d:case c:case f:case h:case m:case s:return e;default:return t}}case r:return t}}}o=Symbol.for("react.module.reference"),n.ContextConsumer=c,n.ContextProvider=s,n.Element=i,n.ForwardRef=f,n.Fragment=u,n.Lazy=h,n.Memo=m,n.Portal=r,n.Profiler=l,n.StrictMode=a,n.Suspense=g,n.SuspenseList=p,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(e){return v(e)===c},n.isContextProvider=function(e){return v(e)===s},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},n.isForwardRef=function(e){return v(e)===f},n.isFragment=function(e){return v(e)===u},n.isLazy=function(e){return v(e)===h},n.isMemo=function(e){return v(e)===m},n.isPortal=function(e){return v(e)===r},n.isProfiler=function(e){return v(e)===l},n.isStrictMode=function(e){return v(e)===a},n.isSuspense=function(e){return v(e)===g},n.isSuspenseList=function(e){return v(e)===p},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===u||e===l||e===a||e===g||e===p||e===I||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===o||void 0!==e.getModuleId)||!1},n.typeOf=v},152166,(e,t,n)=>{"use strict";e.i(175120),t.exports=e.r(482635)}]);
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.