{"version":3,"sources":["webpack:///D:/a/1/s/frontend/src/views/pages/parkingLocationSearchPage/js/parkingLocationSearchPage.js","webpack:///./dataLayer.js"],"names":["dataLayer","__webpack_require__","ParkingLocationSearchPage","$el","_classCallCheck3","default","this","setParkingLocationSearchPage","visitorGroup","$","data","pushPageView","dataGroup","window","push","event","ecommerce","index","value","pushFormSubmit","formID","category","action","label","eventCallback","pushCarparkSearch","arrivalDate","departureDate","location"],"mappings":"2OAIYA,0JAAZC,EAAA,iEAEaC,qCACZ,SAAAA,EAAYC,IAAK,EAAAC,EAAAC,SAAAC,KAAAJ,GAEhBI,KAAKH,IAAMA,sDAIXG,KAAKC,+BAGLD,KAAKE,aAAeC,EAAE,QAAQC,KAAK,SACnCV,EAAUW,aAAaL,KAAKE,qEAMhBC,EAAEH,KAAKH,uIClBLQ,aAAT,SAAsBC,GAC5BC,OAAOb,UAAUc,MAChBC,MAAO,WACPC,WAICC,MAAO,MACPC,MAAON,cAKMO,eAAT,SAAwBC,GAC9BP,OAAOb,UAAUc,MAChBC,MAAO,aACPC,WACCK,SAAU,OACVC,OAAQ,SACRC,MAAOH,EACPF,MAAO,MAERM,cAAe,wBAYDC,kBAAT,SAA2BC,EAAaC,EAAeC,GACzDf,OAAOb,WACVa,OAAOb,UAAUc,MAChBC,MAAO,aACPC,WACCU,cACAC,gBACAC","file":"page-2.b9f88d4cffa17521b332.js","sourcesContent":["const NS = 'ParkingLocationSearchPage';\nconst CLS = 'parkingLocationSearchPage';\nconst PG = '.' + CLS + '-';\n\nimport * as dataLayer from '../../../../global/js/dataLayer';\n\nexport class ParkingLocationSearchPage {\n\tconstructor($el) {\n\t\t// $el is the page node return by the ParkingLocationSearchPage function\n\t\tthis.$el = $el;\n\t}\n\n\tinit() {\n\t\tthis.setParkingLocationSearchPage();\n\n\t\t// GTM Page View Tracking\n\t\tthis.visitorGroup = $('body').data('group');\n\t\tdataLayer.pushPageView(this.visitorGroup);\n\t}\n\n\tsetParkingLocationSearchPage() {\n\t\t// Add Some logic here\n\t\tconst This = this;\n\t\tconst $pg = $(this.$el);\n\t}\n\n\t// Add more functions like on above here\n}\n","/* eslint-disable no-trailing-spaces */\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\", \"info\"] }] */\n/* eslint no-invalid-this: 0 */\n/* eslint max-len: 0 */\n/* eslint comma-dangle: 0 */\nexport function pushPageView(dataGroup) {\n\twindow.dataLayer.push({\n\t\tevent: 'pageView',\n\t\tecommerce: {\n\t\t\t// index: CustomDimensionID is TBA,\n\t\t\t// dataGroup needs to be specified in BE\n\t\t\t// Body tag in HTML to include Visitor Groups via a custom data attribute - data-group=\"{VisitorGroup}\"\n\t\t\tindex: '123',\n\t\t\tvalue: dataGroup,\n\t\t},\n\t});\n}\n\nexport function pushFormSubmit(formID) {\n\twindow.dataLayer.push({\n\t\tevent: 'formSubmit',\n\t\tecommerce: {\n\t\t\tcategory: 'form',\n\t\t\taction: 'submit',\n\t\t\tlabel: formID,\n\t\t\tvalue: null\n\t\t},\n\t\teventCallback: function() {\n\t\t\t// may need callback logic in the future..\n\t\t\t// if (url) {\n\t\t\t// \twindow.location = url;\n\t\t\t// }\n\t\t\t// if (form) {\n\t\t\t// \t$(form).submit();\n\t\t\t// }\n\t\t}\n\t});\n}\n\nexport function pushCarparkSearch(arrivalDate, departureDate, location) {\n\tif (window.dataLayer) {\n\t\twindow.dataLayer.push({\n\t\t\tevent: 'formSubmit',\n\t\t\tecommerce: {\n\t\t\t\tarrivalDate,\n\t\t\t\tdepartureDate,\n\t\t\t\tlocation,\n\t\t\t}\n\t\t});\n\t}\n}\n// reference for GTM carpark tracking\n// export function cartCheckoutButton(products, form) {\n// \t// map props to what we need only\n// \tlet mappedProducts = products.map(function(product) {\n// \t\tlet obj = {\n// \t\t\tid: product.itemSkuNumber,\n// \t\t\tname: product.name,\n// \t\t\tbrand: product.brand,\n// \t\t\tcategory: product.categoryName,\n// \t\t\tprice: (product.lineItemDiscountTotal.amount) ? product.lineItemDiscountTotal.amount || 0 : product.price.amount || 0,\n// \t\t\tquantity: product.quantity || 1\n// \t\t};\n// \t\tif (obj.name || obj.id) return obj;\n// \t});\n// \tif (mappedProducts.length > 0) {\n// \t\twindow.dataLayer.push({\n// \t\t\tevent: 'checkout',\n// \t\t\tecommerce: {\n// \t\t\t\tcheckout: {\n// \t\t\t\t\tactionField: {\n// \t\t\t\t\t\tstep: 1,\n// \t\t\t\t\t\toption: 'Checkout'\n// \t\t\t\t\t},\n// \t\t\t\t\tproducts: mappedProducts\n// \t\t\t\t}\n// \t\t\t},\n// \t\t\teventCallback: function() {\n// \t\t\t\t$(form).submit();\n// \t\t\t}\n// \t\t});\n// \t}\n// }\n"],"sourceRoot":""}