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BQ,EAAUI,EAAWC,GAAQ7E,CACtC,CAkEa4F,CAAYtB,GAErB,GAAIG,EAIF,OAFAoB,aAAaxB,GACbA,EAAUiB,WAAWF,EAAcpB,GAC5BY,EAAWN,EAEtB,CAIA,YAHgBU,IAAZX,IACFA,EAAUiB,WAAWF,EAAcpB,IAE9BhE,CACT,CAGA,OA3GAgE,EAAOT,EAASS,IAAS,EACrBX,EAASY,KACXO,IAAYP,EAAQO,QAEpBJ,GADAK,EAAS,YAAaR,GACHT,EAAUD,EAASU,EAAQG,UAAY,EAAGJ,GAAQI,EACrEM,EAAW,aAAcT,IAAYA,EAAQS,SAAWA,GAoG1De,EAAUK,OApCV,gBACkBd,IAAZX,GACFwB,aAAaxB,GAEfE,EAAiB,EACjBL,EAAWI,EAAeH,EAAWE,OAAUW,CACjD,EA+BAS,EAAUM,MA7BV,WACE,YAAmBf,IAAZX,EAAwBrE,EAASqF,EAAa/B,IACvD,EA4BOmC,CACT,C,wBC5LA,IAAIO,EAAO,EAAQ,OAsBnBnC,EAAOC,QAJG,WACR,OAAOkC,EAAKC,KAAK3C,KACnB,C","sources":["webpack://@whistleout/webui/./Areas/MobilePhones/js/Search.js","webpack://@whistleout/webui/../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","webpack://@whistleout/webui/../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js"],"sourcesContent":["import debounce from 'lodash/debounce';\nimport { createElement } from 'react';\nimport { render, unmountComponentAtNode } from 'react-dom';\n\nimport { waitFor } from '../../Shared/js/utils/timer';\nimport AddressSearch from '../../Shared/React/js/components/addressSearch/AddressSearch';\n\n(function () {\n 'use strict';\n\n async function main() {\n\n var searchPage = wo$('[data-search-page]');\n if (!searchPage.length) return;\n\n var searchController = {\n init: async function () {\n searchController.registerNotifications();\n searchController.initHistoryTracker();\n searchController.loadSearchModal();\n searchController.trackPage(false);\n WhistleOut.getAds('MobilePhones');\n\n if (wo$('[data-coverage-maps]').length) {\n await waitFor(() => !!WhistleOut.CoverageMap);\n if (WhistleOut.CoverageMap) {\n WhistleOut.CoverageMap.init(wo$('body'));\n }\n }\n\n WhistleOut.bindCitiesAutoComplete(wo$('body'));\n wo$('a[data-action=\"scroll-top\"]').click(function () {\n WhistleOut.scrollTo(0);\n return false;\n });\n },\n\n registerNotifications: function () {\n // WARNING: jQuery.Callbacks() doesn't seem to support async functions\n WhistleOut.notifications.add((notification, data) => {\n if (data && data.criteria && data.type !== 'Page') {\n data.criteria.page = 1;\n }\n\n switch (notification) {\n case 'FilterChanged':\n this.onFilterChanged(data);\n break;\n\n case 'TabChanged':\n this.onTabChanged(data);\n break;\n\n case 'SearchResultsRendered':\n this.onSearchResultsRendered(data).then();\n break;\n\n default:\n break;\n }\n });\n },\n\n onFilterChanged: (data) => {\n wo$('[data-enable-when-ready]').attr('disabled', 'disabled');\n\n var renderFilters = data.type === 'Lines' || data.criteria.lines.length > 1;\n var fullReload = data.type === 'Page';\n if (wo$('[data-search-page]').data('search-page') === 'redirect') {\n fullReload = true;\n // Reset result flags when redirecting from embedded to full results\n data.criteria.hideShare = false;\n data.criteria.hideCoverage = false;\n data.criteria.hideCoverageStrip = false;\n data.criteria.hideWidenResults = false;\n\n if (!data.criteria.address ||\n data.criteria.address.toLowerCase() === 'australia' ||\n data.criteria.address.toLowerCase() === 'united states') {\n WhistleOut.getCurrentLocation(\n function (e) {\n var address = e.label;\n if (address.length > 1) {\n data.criteria.address = address;\n }\n searchController.updateFilters(data.criteria, renderFilters, fullReload);\n },\n function () {\n searchController.updateFilters(data.criteria, renderFilters, fullReload);\n });\n } else {\n searchController.updateFilters(data.criteria, renderFilters, fullReload);\n }\n\n } else {\n searchController.updateFilters(data.criteria, renderFilters, fullReload);\n }\n \n },\n\n onTabChanged: (data) => {\n var queryString = '?' + WhistleOut.MobilePhones.generateQueryString(data.criteria);\n searchController.HistoryWrapper.pushQuery(queryString);\n searchController.loadSearchModal();\n },\n\n onSearchResultsRendered: async (data) => {\n searchController.loadSearchModal();\n searchController.trackPage(data.isAjax);\n WhistleOut.getAds('MobilePhones');\n\n if (wo$('[data-coverage-maps]').length) {\n await waitFor(() => !!WhistleOut.CoverageMap);\n if (WhistleOut.CoverageMap) {\n WhistleOut.CoverageMap.init(wo$('body'));\n }\n }\n\n wo$(window).resize();\n },\n\n loadSearchModal: function () {\n var criteria = WhistleOut.readLookupData(wo$('[data-search-criteria]'));\n var modalUrl = criteria.lines.length > 1 ? criteria.multiLineModalAjaxUrl : criteria.singleLineModalAjaxUrl;\n\n wo$.ajax({\n url: modalUrl + window.location.search,\n type: 'GET',\n success: function (result) {\n var $results = wo$('#filters-modal-partial');\n $results.html(result);\n WhistleOut.notifications.fire('FiltersModalReady');\n }\n });\n },\n\n trackPage: function (isAjax) {\n var criteria = WhistleOut.readLookupData(wo$('[data-search-criteria]'));\n var resultCount = wo$('#search-results-partial').find('[data-result-count]').data('result-count');\n\n var currentSupplierId = criteria.currentsupplierid && criteria.currentsupplierid > 0\n ? criteria.currentsupplierid\n : null;\n\n var values = [];\n values.push(currentSupplierId);\n values.push(criteria.minSpend);\n values.push(criteria.maxSpend);\n values.push(criteria.lines.length === 1 ? criteria.lines[0].data : null);\n values.push(criteria.lines.length === 1 ? criteria.lines[0].calls ? criteria.lines[0].calls : criteria.lines[0].minutes : null);\n values.push(criteria.lines.length === 1 ? criteria.lines[0].sms : null);\n values.push(criteria.lines.length === 1 ? criteria.lines[0].phone : null);\n values.push(criteria.dealsonly);\n values.push(criteria.sortExpression);\n values.push(criteria.sortAscending);\n values.push(criteria.maxupfront > -1 ? criteria.maxupfront : null);\n values.push(resultCount);\n values.push(criteria.lines.length);\n var valuesString = values.join('|');\n\n WhistleOut.trackPageView(null, valuesString, isAjax);\n\n if (isAjax) {\n var phone = '';\n var phoneBrand = '';\n if (criteria.lines.length === 1) {\n if (criteria.lines[0].phone) {\n phone = criteria.lines[0].phone;\n phoneBrand = criteria.lines[0].phoneManufacturer;\n } else if (criteria.lines[0].simOnly === true) {\n phone = 'BYO';\n }\n }\n\n var remarketing = {\n 'supplier': criteria.suppliers ? criteria.suppliers.join() : '',\n 'postcode': criteria.postcode,\n 'numberOfLines': criteria.lines.length,\n 'data': criteria.lines.length === 1 ? criteria.lines[0].data : '',\n 'phoneBrand': phoneBrand,\n 'phone': phone\n };\n WhistleOut.remarketing(remarketing);\n }\n\n Cookies.set('CurrentSupplierMobilePhones', currentSupplierId == null ? '' : currentSupplierId, { path: '/', expires: 60 });\n },\n\n updateFilters: debounce(function (criteria, reloadFilters, fullReload) {\n WhistleOut.startProgress('#search-results-partial', 0.1, 50);\n\n var queryString = '?' + WhistleOut.MobilePhones.generateQueryString(criteria);\n if (fullReload) {\n location.href = criteria.searchUrl + queryString;\n WhistleOut.endProgress();\n return;\n } else if (reloadFilters) {\n var filtersUrl = criteria.lines.length > 1 ? criteria.multiLineFiltersAjaxUrl : criteria.singleLineFiltersAjaxUrl;\n wo$.ajax({\n url: filtersUrl + queryString,\n type: 'GET',\n success: function (result) {\n var $filters = wo$('#search-filters-partial');\n $filters.html(result);\n wo$(window).resize();\n WhistleOut.notifications.fire('SearchFiltersRendered');\n }\n });\n }\n\n var resultsUrl = criteria.lines.length > 1 ? criteria.multiLineAjaxUrl : criteria.singleLineAjaxUrl;\n\n const $addressBar = wo$('[data-search-address] > div');\n if ($addressBar.length > 0) {\n unmountComponentAtNode($addressBar[0]);\n }\n\n wo$.ajax({\n url: resultsUrl + queryString,\n type: 'GET',\n success: function (result) {\n \n \n var $results = wo$('#search-results-partial');\n $results.html(result);\n\n WhistleOut.applyPopover($results);\n\n searchController.HistoryWrapper.pushQuery(queryString);\n\n WhistleOut.endProgress();\n\n WhistleOut.notifications.fire('SearchResultsRendered', { criteria: criteria, isAjax: true });\n\n const nodeToAttach = $results.find('[data-search-address]');\n if (nodeToAttach.length > 0) {\n render(createElement(AddressSearch, nodeToAttach.data('search-address')), nodeToAttach.find('div')[0]);\n }\n\n wo$(window).resize();\n },\n error: function () {\n WhistleOut.endProgress();\n }\n });\n }, 300),\n\n initHistoryTracker: function () {\n WhistleOut.initHistoryTracker(searchController);\n }\n };\n\n await searchController.init();\n };\n\n WhistleOut.initModule(import.meta.url, main);\n\n}());","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n"],"names":["WhistleOut","initModule","import","async","wo$","length","searchController","init","registerNotifications","initHistoryTracker","loadSearchModal","trackPage","getAds","waitFor","CoverageMap","bindCitiesAutoComplete","click","scrollTo","notifications","add","notification","data","criteria","type","page","this","onFilterChanged","onTabChanged","onSearchResultsRendered","then","attr","renderFilters","lines","fullReload","hideShare","hideCoverage","hideCoverageStrip","hideWidenResults","address","toLowerCase","updateFilters","getCurrentLocation","e","label","queryString","MobilePhones","generateQueryString","HistoryWrapper","pushQuery","isAjax","window","resize","readLookupData","modalUrl","multiLineModalAjaxUrl","singleLineModalAjaxUrl","ajax","url","location","search","success","result","html","fire","resultCount","find","currentSupplierId","currentsupplierid","values","push","minSpend","maxSpend","calls","minutes","sms","phone","dealsonly","sortExpression","sortAscending","maxupfront","valuesString","join","trackPageView","phoneBrand","phoneManufacturer","simOnly","remarketing","suppliers","postcode","Cookies","set","path","expires","debounce","reloadFilters","startProgress","href","searchUrl","endProgress","filtersUrl","multiLineFiltersAjaxUrl","singleLineFiltersAjaxUrl","resultsUrl","multiLineAjaxUrl","singleLineAjaxUrl","$addressBar","unmountComponentAtNode","$results","applyPopover","nodeToAttach","render","createElement","AddressSearch","error","isObject","now","toNumber","nativeMax","Math","max","nativeMin","min","module","exports","func","wait","options","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","timeWaiting","remainingWait","debounced","isInvoking","arguments","leadingEdge","clearTimeout","cancel","flush","root","Date"],"sourceRoot":""}