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G,SAAST,SAASiE,KACvBC,OAAQlK,EAAOkK,UAChB,IACP,EACAzB,UAAW,WACPiB,mBAAmB/I,KAAKuH,iBACxBvH,KAAKuH,gBAAkByB,oBAAoBhJ,KAAKwJ,WAAW7K,KAAKqB,MAAO,CACnEkJ,QAAS,KAEjB,EACAM,WAAY,WACRvK,OAAOkK,OAAOC,YAAY,CACtBC,SAAU,MACVnB,KAAM,aACNqB,OAAQlK,EAAOkK,UAChB,IACP,GAEO7K,MACf,GACJ,C","sources":["webpack://@whistleout/webui/./Areas/Widgets/js/MobilePhoneSearchForm.js","webpack://@whistleout/webui/./Areas/Widgets/js/common/utils/EventHelper.js","webpack://@whistleout/webui/../node_modules/.pnpm/core-js@3.31.1/node_modules/core-js/modules/esnext.iterator.find.js","webpack://@whistleout/webui/./Areas/Widgets/js/common/common.ts","webpack://@whistleout/webui/./Areas/Widgets/js/common/index.ts","webpack://@whistleout/webui/./Areas/Widgets/js/common/widget.ts"],"sourcesContent":["(function () {\n 'use strict';\n\n function main() {\n\n var controller = {\n init: function () {\n controller.bind();\n },\n\n bind: function () {\n\n var widgets = wo$('[data-widget-type=\"mobile-phone-search-form\"]');\n if (!widgets.length) return;\n\n var doSearch = function (url) {\n var win = window.open(url, '_top');\n win.focus();\n };\n\n var selectValuesFromQuery = function (widget) {\n var query = decodeURIComponent(wo$(widget).find('[data-search-button]').data('query'));\n\n var simOnly = WhistleOut.getQueryStringParameter('simonly', query);\n if (simOnly) {\n wo$(widget).find('select#phone-select option[value=\"-1\"]').prop('selected', true);\n }\n\n var phone = WhistleOut.getQueryStringParameter('phone', query);\n if (phone) {\n wo$(widget).find('select#phone-select [data-shorturl=\"' + phone + '\"]').prop('selected', true);\n }\n\n var data = WhistleOut.getQueryStringParameter('data', query);\n if (data) {\n wo$(widget).find('select#data-select option[value=\"' + data + '\"]').prop('selected', true);\n }\n };\n\n for (var index = 0; index < widgets.length; index++) {\n selectValuesFromQuery(widgets[index]);\n }\n\n widgets.off('click');\n\n widgets.on('click', '[data-search-button]', function () {\n wo$(this).find('.fa-spinner').show();\n\n WhistleOut.trackEvent('MobilePhoneSearchForm', 'Search');\n\n var widget = wo$(this).parents('[data-widget-type=\"mobile-phone-search-form\"]');\n var searchUrl = wo$(this).data('searchurl');\n var detectLocation = wo$(this).data('detectlocation');\n var initialQueryParams = wo$(this).data('query');\n\n var phoneSelectElement = widget.find('#phone-select');\n var selectedPhoneOption = phoneSelectElement.find('option:selected');\n var selectedPhoneShortUrl = selectedPhoneOption.data('shorturl');\n\n var data = widget.find('#data-select').val();\n\n var queryString = '';\n\n if (initialQueryParams) {\n queryString = decodeURIComponent(initialQueryParams);\n if (queryString.indexOf('?') === -1)\n queryString = '?' + queryString;\n }\n\n if (selectedPhoneShortUrl === '') {\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'phone', null);\n } else if (selectedPhoneShortUrl) {\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'phone', selectedPhoneShortUrl);\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'simonly', null);\n }\n\n if (selectedPhoneOption.val() === '-1') {\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'simonly', true);\n }\n\n if (data && data !== '0') {\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'data', data);\n }\n\n if (detectLocation === true || detectLocation === 'True') {\n WhistleOut.getCurrentLocation(\n function (e) {\n var address = e.label;\n if (address && address.length > 1) {\n queryString = WhistleOut.updateQueryStringParameter(queryString, 'address', address.replace(/\\s+/g, '+'));\n }\n doSearch(searchUrl + queryString);\n },\n function () {\n doSearch(searchUrl + queryString);\n });\n } else {\n doSearch(searchUrl + queryString);\n }\n });\n\n }\n\n };\n\n WhistleOut.initWidget = controller.init;\n controller.init();\n };\n\n WhistleOut.initModule(import.meta.url, main);\n\n}());","export function addEventListener(elements, events, handler) {\n _addOrRemoveListener('add', elements, events, handler);\n}\n\nexport function removeEventListener(elements, events, handler) {\n _addOrRemoveListener('remove', elements, events, handler);\n}\n\nexport function _addOrRemoveListener(action, elements, events, handler) {\n const eventsArray = events.split(' ');\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n\n for (let j = 0; j < eventsArray.length; j++) {\n const event = eventsArray[j];\n\n if (action === 'add') {\n element.addEventListener(event, handler);\n } else {\n element.removeEventListener(event, handler);\n }\n }\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\n\n// `Iterator.prototype.find` method\n// https://github.com/tc39/proposal-iterator-helpers\n$({ target: 'Iterator', proto: true, real: true }, {\n find: function find(predicate) {\n anObject(this);\n aCallable(predicate);\n var record = getIteratorDirect(this);\n var counter = 0;\n return iterate(record, function (value, stop) {\n if (predicate(value, counter++)) return stop(value);\n }, { IS_RECORD: true, INTERRUPTED: true }).result;\n }\n});\n","/* globals ga */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { WhistleOutContext } from '../../../Shared/js/common/common';\nexport class WhistleOutContextWidget extends WhistleOutContext {\n constructor() {\n super();\n this.scope = 'widget';\n }\n pushGtmEvent(category, action, label, value) {\n try {\n const analyticsClientSideData = this.getAnalyticsClientSideData();\n const data = analyticsClientSideData.data;\n this.pushDataLayerItem({\n event: `wo_${category}_${action}`.toLowerCase(),\n customCategory: category,\n customAction: action,\n customLabel: label,\n customValue: isNaN(value) ? undefined : +value,\n customCountry: data.country,\n customProductAreaId: data.productAreaId\n });\n }\n catch (err) {\n this.Rollbar.error(`WhistleOut.pushGtmEvent: category=${category}, action=${action}, label=${label}`, err);\n }\n }\n sendPageView(url) {\n const analyticsClientSideData = this.getAnalyticsClientSideData();\n const config = analyticsClientSideData.config;\n try {\n if (config.trackPageImpression) {\n if ((!url || url.length <= 0) && analyticsClientSideData.data)\n url = analyticsClientSideData.data.trackingUrl;\n wo$.each(config.accounts, function (index, account) {\n ga('create', account.accountNumber, { name: account.trackerId, useAmpClientId: true }, 'auto');\n if (account.linkIdTracking) {\n ga(account.trackerId + '.require', 'linkid');\n }\n ga(account.trackerId + '.set', 'anonymizeIp', true);\n if (!url || url.length <= 0) {\n ga(account.trackerId + '.send', 'pageview');\n }\n else {\n ga(account.trackerId + '.send', 'pageview', {\n page: url\n });\n }\n });\n }\n }\n catch (err) {\n this.Rollbar.error(`WhistleOut.sendPageView url=${url}`, err);\n }\n }\n pushGtmWidgetPageView(url) {\n try {\n const analyticsClientSideData = this.getAnalyticsClientSideData();\n const customCountry = analyticsClientSideData.data.country;\n if (!url || url.length <= 0) {\n url = analyticsClientSideData.data.trackingUrl;\n }\n if (!url || url.length <= 0)\n url = `${location.pathname}${location.search}`;\n const dataLayerValue = {\n event: 'widgetCustomPageView',\n customUrl: url,\n customCountry: customCountry\n };\n this.pushDataLayerItem(dataLayerValue);\n }\n catch (err) {\n this.Rollbar.error('WhistleOut.ushGtmPageView', err);\n }\n }\n trackPageView(url) {\n try {\n this.sendPageView(url);\n this.pushGtmWidgetPageView(url);\n }\n catch (err) {\n this.Rollbar.error(`WhistleOut.trackPageView url=${url}`, err);\n }\n }\n encodeHtml(str) {\n const el = document.createElement('span');\n el.append(document.createTextNode(str));\n return el.innerHTML;\n }\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.isInitRequested) {\n return;\n }\n yield this.initBase();\n });\n }\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport '../../../Shared/js/polyfills';\nimport { WhistleOutContextWidget as WhistleOutContext } from './common';\nimport { widgetInit } from './widget';\n(() => __awaiter(void 0, void 0, void 0, function* () {\n if (window.WhistleOut.isInitRequested) {\n return;\n }\n yield import(/* webpackMode: 'eager' */ '../vendor');\n // Some properties of window.WhistleOut can be initialised\n // by inline scripts before this main initialisation,\n // so we need to merge it\n window.WhistleOut = Object.assign(new WhistleOutContext(), window.WhistleOut || {});\n yield window.WhistleOut.init();\n widgetInit();\n}))();\n","import { pushDataLayerItemWidget } from '../../../Shared/js/utils/datalayer';\nimport * as EventHelper from './utils/EventHelper';\nexport function getWidget() {\n return wo$('#widget');\n}\nexport function widgetInit() {\n wo$(function () {\n const widget = getWidget();\n if (!widget.length)\n return;\n const controller = {\n resizeTaskId: null,\n resizeTaskAmpId: null,\n init: function () {\n const amp = widget.data('amp').toLowerCase() === 'true';\n const url = widget.data('url');\n const startTime = Date.now();\n pushDataLayerItemWidget({\n event: 'widget_load_begin',\n widget_placement: 'iframe'\n });\n const el = widget[0];\n if (amp) {\n EventHelper.addEventListener([window, el, el.parentElement], 'resize', this.resizeAmp.bind(this));\n EventHelper.addEventListener([window], 'load', this.resizeAmp.bind(this));\n }\n else {\n EventHelper.addEventListener([window, el, el.parentElement], 'resize', this.resize.bind(this));\n EventHelper.addEventListener([window], 'load', this.resize.bind(this));\n }\n wo$.ajax({\n context: this,\n type: 'GET',\n url: url,\n contentType: 'text/html'\n })\n .done(function (data) {\n widget.find('#widget-content').html(data);\n WhistleOut.applyPopover();\n WhistleOut.showTracking();\n if (WhistleOut.initWidget) {\n WhistleOut.initWidget();\n }\n })\n .fail(function (jqXHR, textStatus, error) {\n widget.find('#widget-content').html(widget.find('#widget-error').html());\n WhistleOut.Rollbar.error(`ajax error in Widget.js requesting ${url}, status: ${textStatus}, error: ${error}, responseText: ${jqXHR.responseText}`);\n pushDataLayerItemWidget({\n event: 'widget_error',\n widget_placement: 'iframe',\n error: error\n });\n })\n .always(() => {\n widget.find('#widget-error').remove();\n widget.find('#widget-loading').remove();\n const endTime = Date.now();\n pushDataLayerItemWidget({\n event: 'widget_load_end',\n widget_placement: 'iframe',\n duration: (endTime - startTime) / 1000\n });\n if (amp) {\n this.resizeAmp();\n }\n else {\n this.resize();\n }\n });\n },\n resize: function () {\n cancelIdleCallback(this.resizeTaskId);\n this.resizeTaskId = requestIdleCallback(this._resize.bind(this), {\n timeout: 300\n });\n },\n _resize: function () {\n window.parent.postMessage({\n sentinel: 'whistleout-widget',\n url: document.location.href,\n height: widget.height()\n }, '*');\n },\n resizeAmp: function () {\n cancelIdleCallback(this.resizeTaskAmpId);\n this.resizeTaskAmpId = requestIdleCallback(this._resizeAmp.bind(this), {\n timeout: 300\n });\n },\n _resizeAmp: function () {\n window.parent.postMessage({\n sentinel: 'amp',\n type: 'embed-size',\n height: widget.height()\n }, '*');\n }\n };\n controller.init();\n });\n}\n"],"names":["WhistleOut","initModule","import","controller","init","bind","widgets","wo$","length","doSearch","url","window","open","focus","selectValuesFromQuery","widget","query","decodeURIComponent","find","data","getQueryStringParameter","prop","phone","index","off","on","this","show","trackEvent","parents","searchUrl","detectLocation","initialQueryParams","selectedPhoneOption","selectedPhoneShortUrl","val","queryString","indexOf","updateQueryStringParameter","getCurrentLocation","e","address","label","replace","initWidget","addEventListener","elements","events","handler","action","eventsArray","split","i","element","j","event","_addOrRemoveListener","$","iterate","aCallable","anObject","getIteratorDirect","target","proto","real","predicate","record","counter","value","stop","IS_RECORD","INTERRUPTED","result","WhistleOutContextWidget","constructor","super","scope","pushGtmEvent","category","getAnalyticsClientSideData","pushDataLayerItem","toLowerCase","customCategory","customAction","customLabel","customValue","isNaN","undefined","customCountry","country","customProductAreaId","productAreaId","err","Rollbar","error","sendPageView","analyticsClientSideData","config","trackPageImpression","trackingUrl","each","accounts","account","ga","accountNumber","name","trackerId","useAmpClientId","linkIdTracking","page","pushGtmWidgetPageView","location","pathname","search","dataLayerValue","customUrl","trackPageView","encodeHtml","str","el","document","createElement","append","createTextNode","innerHTML","thisArg","generator","isInitRequested","initBase","P","Promise","resolve","reject","fulfilled","step","next","rejected","done","then","apply","Object","assign","getWidget","widgetInit","resizeTaskId","resizeTaskAmpId","amp","startTime","Date","now","widget_placement","parentElement","resizeAmp","resize","ajax","context","type","contentType","html","applyPopover","showTracking","fail","jqXHR","textStatus","responseText","always","remove","endTime","duration","cancelIdleCallback","requestIdleCallback","_resize","timeout","parent","postMessage","sentinel","href","height","_resizeAmp"],"sourceRoot":""}