{"version":3,"file":"js/ng.js","mappings":"uBAAAA,EAAOC,QAAU,i9F,YCAjBD,EAAOC,QAAU,+8E,YCAjBD,EAAOC,QAAU,6c,YCAjBD,EAAOC,QAAU,qvE,YCAjBD,EAAOC,QAAU,uxO,YCAjBD,EAAOC,QAAU,0xX,YCAjBD,EAAOC,QAAU,kmL,UCAjBD,EAAOC,QAAU,omD,YCAjBD,EAAOC,QAAU,y7B,YCAjBD,EAAOC,QAAU,ylD,YCAjBD,EAAOC,QAAU,glC,YCAjBD,EAAOC,QAAU,uvQ,YCAjBD,EAAOC,QAAU,y6G,YCAjBD,EAAOC,QAAU,gqK,YCAjBD,EAAOC,QAAU,wgoB,YCAjBD,EAAOC,QAAU,0hB,YCAjBD,EAAOC,QAAU,i5B,YCAjBD,EAAOC,QAAU,kzG,WCAjBD,EAAOC,QAAU,omU,YCAjBD,EAAOC,QAAU,mT,YCAjBD,EAAOC,QAAU,2jB,YCAjBD,EAAOC,QAAU,uiD,YCAjBD,EAAOC,QAAU,gtB,YCAjBD,EAAOC,QAAU,m5E,YCAjBD,EAAOC,QAAU,ikE,YCAjBD,EAAOC,QAAU,gr7J,YCAjBD,EAAOC,QAAU,ikE,YCAjBD,EAAOC,QAAU,45O,YCAjBD,EAAOC,QAAU,6kD,YCAjBD,EAAOC,QAAU,g8vB,YCAjBD,EAAOC,QAAU,+4yB,WCAjBD,EAAOC,QAAU,+0xB,WCIjBD,EAAOC,QAAU,SAASC,GACzB,SAASC,EAAIC,GACQ,oBAAZC,UACJA,QAAQD,OAASC,QAAQF,KAAK,kBAAmBC,EACtD,CAOA,IAC2B,oBAAfE,YAJmB,oBAAhBC,aAA2D,oBAArBC,iBAKnDF,WAAWJ,GACe,oBAATO,KACjBA,KAAKC,KAAK,KAAMR,GAEhBC,EAAI,wCAIN,CAFE,MAAOC,GACRD,EAAIC,EACL,CACD,C,kBC1BA,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,iBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,iBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,iBCApG,EAAQ,KAAR,CAA4F,EAAQ,K,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,iBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,M,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,gBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,kBCApG,EAAQ,KAAR,CAA4F,EAAQ,O,iBCApG,EAAQ,KAAR,CAA4F,EAAQ,M,GCChGO,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CCrBAW,EAAoBK,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAY,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACnB,EAASqB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAetB,KAAKmB,EAAKC,G","sources":["webpack://renewi-site/./src/js/ng/app.js","webpack://renewi-site/./src/js/ng/controllers/audiencePopupController.js","webpack://renewi-site/./src/js/ng/controllers/bannerController.js","webpack://renewi-site/./src/js/ng/controllers/branchController.js","webpack://renewi-site/./src/js/ng/controllers/cartController.js","webpack://renewi-site/./src/js/ng/controllers/catalogController.js","webpack://renewi-site/./src/js/ng/controllers/checkoutFlowController.js","webpack://renewi-site/./src/js/ng/controllers/crosssellController.js","webpack://renewi-site/./src/js/ng/controllers/languageSwitchController.js","webpack://renewi-site/./src/js/ng/controllers/miniCartController.js","webpack://renewi-site/./src/js/ng/controllers/productBundleFormController.js","webpack://renewi-site/./src/js/ng/controllers/productFormController.js","webpack://renewi-site/./src/js/ng/controllers/searchController.js","webpack://renewi-site/./src/js/ng/controllers/upsellController.js","webpack://renewi-site/./src/js/ng/controllers/wizardController.js","webpack://renewi-site/./src/js/ng/controllers/zipcodeController.js","webpack://renewi-site/./src/js/ng/directive/addToCartButton.js","webpack://renewi-site/./src/js/ng/directive/datePicker.js","webpack://renewi-site/./src/js/ng/directive/easyPieChart.js","webpack://renewi-site/./src/js/ng/directive/fallbacksrc.js","webpack://renewi-site/./src/js/ng/directive/lightCase.js","webpack://renewi-site/./src/js/ng/directive/quantityInput.js","webpack://renewi-site/./src/js/ng/directive/toolTipster.js","webpack://renewi-site/./src/js/ng/services/chartService.js","webpack://renewi-site/./src/js/ng/services/globalService.js","webpack://renewi-site/./vendor/ng/angular-animate.js","webpack://renewi-site/./vendor/ng/angular-cookies.min.js","webpack://renewi-site/./vendor/ng/angular-sanitize.min.js","webpack://renewi-site/./vendor/ng/ngStorage.min.js","webpack://renewi-site/./vendor/ng/xeditable.min.js","webpack://renewi-site/../node_modules/ng-mask/dist/ngMask.js","webpack://renewi-site/../node_modules/zebra_datepicker/public/javascript/zebra_datepicker.js","webpack://renewi-site/../node_modules/script-loader/addScript.js","webpack://renewi-site/./src/js/ng/app.js?ba01","webpack://renewi-site/./src/js/ng/controllers/audiencePopupController.js?6fd0","webpack://renewi-site/./src/js/ng/controllers/bannerController.js?c090","webpack://renewi-site/./src/js/ng/controllers/branchController.js?d157","webpack://renewi-site/./src/js/ng/controllers/cartController.js?f55b","webpack://renewi-site/./src/js/ng/controllers/catalogController.js?5102","webpack://renewi-site/./src/js/ng/controllers/checkoutFlowController.js?05a1","webpack://renewi-site/./src/js/ng/controllers/crosssellController.js?10cb","webpack://renewi-site/./src/js/ng/controllers/languageSwitchController.js?baee","webpack://renewi-site/./src/js/ng/controllers/miniCartController.js?9ef5","webpack://renewi-site/./src/js/ng/controllers/productBundleFormController.js?ead8","webpack://renewi-site/./src/js/ng/controllers/productFormController.js?f7e8","webpack://renewi-site/./src/js/ng/controllers/searchController.js?1131","webpack://renewi-site/./src/js/ng/controllers/upsellController.js?2864","webpack://renewi-site/./src/js/ng/controllers/wizardController.js?c13e","webpack://renewi-site/./src/js/ng/controllers/zipcodeController.js?1d30","webpack://renewi-site/./src/js/ng/directive/addToCartButton.js?e263","webpack://renewi-site/./src/js/ng/directive/datePicker.js?228c","webpack://renewi-site/./src/js/ng/directive/easyPieChart.js?63d8","webpack://renewi-site/./src/js/ng/directive/fallbacksrc.js?b23c","webpack://renewi-site/./src/js/ng/directive/lightCase.js?cfdc","webpack://renewi-site/./src/js/ng/directive/quantityInput.js?dc73","webpack://renewi-site/./src/js/ng/directive/toolTipster.js?c650","webpack://renewi-site/./src/js/ng/services/chartService.js?f521","webpack://renewi-site/./src/js/ng/services/globalService.js?3bbc","webpack://renewi-site/./vendor/ng/angular-animate.js?5408","webpack://renewi-site/./vendor/ng/angular-cookies.min.js?5222","webpack://renewi-site/./vendor/ng/angular-sanitize.min.js?d9fb","webpack://renewi-site/./vendor/ng/ngStorage.min.js?85f4","webpack://renewi-site/./vendor/ng/xeditable.min.js?74b0","webpack://renewi-site/../node_modules/ng-mask/dist/ngMask.js?8275","webpack://renewi-site/../node_modules/zebra_datepicker/public/javascript/zebra_datepicker.js?7854","webpack://renewi-site/webpack/bootstrap","webpack://renewi-site/webpack/runtime/compat get default export","webpack://renewi-site/webpack/runtime/define property getters","webpack://renewi-site/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["module.exports = \"// Add XSRF token to every header (Must be removed when switched to angular services calls)\\n$.ajaxSetup({\\n beforeSend: function (xhr) {\\n xhr.setRequestHeader(\\\"X-XSRF-Token\\\", $('input[name=__RequestVerificationToken]').val());\\n }\\n});\\nangular.module('audiencePopup', []);\\nangular.module('banner', []);\\nangular.module('branch', []);\\nangular.module('cart', []);\\nangular.module('catalog', []);\\nangular.module('checkoutFlow', []);\\nangular.module('crossSell', []);\\nangular.module('languageSwitch', []);\\nangular.module('miniCart', []);\\nangular.module('productForm', []);\\nangular.module('productBundleForm', []);\\nangular.module('upsell', []);\\nangular.module('upsellBanner', []);\\nangular.module('wizard', []);\\nangular.module('search', []);\\nangular.module(\\\"zipcode\\\", []);\\nangular.module('shopApp', ['audiencePopup', 'banner', 'branch', 'cart', 'catalog', 'checkoutFlow', 'crossSell', 'languageSwitch', 'miniCart', 'ngStorage', 'ngSanitize', 'ngCookies', 'ngAnimate', 'ngMask', 'productForm', 'productBundleForm', 'xeditable', 'upsell', 'upsellBanner', 'wizard', 'search', 'zipcode']).filter('to_trusted', ['$sce', function ($sce) {\\n return function (text) {\\n return $sce.trustAsHtml(text);\\n };\\n}]).config(['$cookiesProvider', function ($cookiesProvider) {\\n // Set $cookies defaults\\n $cookiesProvider.defaults.path = '/';\\n $cookiesProvider.defaults.secure = true;\\n}]).run(['$rootScope', '$http', function ($rootScope, $http) {\\n $http.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\\n\\n if (document.getElementsByName(\\\"__RequestVerificationToken\\\").length > 0) {\\n $http.defaults.headers.common['X-XSRF-Token'] = document.getElementsByName(\\\"__RequestVerificationToken\\\")[0].value;\\n }\\n\\n $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\\n\\n $http.defaults.transformRequest = function (obj) {\\n return $.param(obj);\\n };\\n /*\\r\\n * Handle datalayer\\r\\n * @param {Array} products - Array of products\\r\\n * @param {String} googleAnalyticsListName\\r\\n * @param {Int} startFrom - Return products from this index on\\r\\n */\\n\\n\\n $rootScope.handleDataLayer = function (products, googleAnalyticsListName, startFrom, event) {\\n startFrom = startFrom ? startFrom : '0'; // Loop through products array and return only the products starting from the `startFrom` index\\n\\n const datalayerProducts = products.reduce(function (result, product, index) {\\n if (index >= startFrom && product.AnalyticsProductImpressionModel) {\\n product.AnalyticsProductImpressionModel.position = index + 1;\\n product.AnalyticsProductImpressionModel.list = googleAnalyticsListName;\\n result.push(product.AnalyticsProductImpressionModel);\\n }\\n\\n return result;\\n }, []); // Update datalayer\\n\\n window.dataLayerHelpers.updateProductList(datalayerProducts, event);\\n };\\n}]);\\nangular.element(document).ready(function () {\\n $('html').removeClass('angular--wait').addClass('angular--loaded');\\n});\"","module.exports = \"angular.module('audiencePopup').controller('AudiencePopupController', ['$scope', '$cookies', 'GlobalService', function ($scope, $cookies, GlobalService) {\\n var audiencePopup = this;\\n $scope.validZipCode = false;\\n $scope.showPopup = false;\\n\\n audiencePopup.openPopup = function () {\\n var body = angular.element(\\\"body\\\");\\n body.addClass(\\\"overlay-open\\\");\\n var html = angular.element(\\\"html\\\");\\n html.css(\\\"overflow-y\\\", \\\"hidden\\\");\\n };\\n\\n audiencePopup.closePopup = function () {\\n var body = angular.element(\\\"body\\\");\\n body.removeClass(\\\"overlay-open\\\");\\n var html = angular.element(\\\"html\\\");\\n html.css(\\\"overflow-y\\\", \\\"visible\\\");\\n $scope.showPopup = false;\\n };\\n\\n audiencePopup.setToggleEvent = function () {\\n window.addEventListener(\\\"openZipCodePopup\\\", e => {\\n if (e.detail) {\\n $scope.zipCode = e.detail;\\n }\\n\\n audiencePopup.validateZipCode();\\n audiencePopup.openPopup();\\n $scope.showPopup = true;\\n });\\n };\\n\\n audiencePopup.validateZipCode = function () {\\n if ($scope.zipCode.length < $scope.zipCodeLength) return $scope.validZipCode = false;\\n $scope.isLoading = true;\\n GlobalService.postData({\\n scController: 'Catalog',\\n scAction: 'ValidateZipCode',\\n zipCode: $scope.zipCode\\n }).success(function (data) {\\n $scope.validZipCode = data;\\n $scope.isLoading = false;\\n }).error(function (data) {\\n $scope.validZipCode = false;\\n $scope.isLoading = false;\\n });\\n };\\n\\n audiencePopup.setTargetAudience = function (isBusiness) {\\n $cookies.put('isBusiness', isBusiness, {\\n expires: new Date(new Date().setFullYear(new Date().getFullYear() + 1))\\n }); // Set 'isBusiness' cookie\\n\\n $cookies.put('ExplicitAudience', true, {\\n expires: new Date(new Date().setFullYear(new Date().getFullYear() + 1))\\n }); // Set 'ExplicitAudience' cookie\\n\\n audiencePopup.storeZipCode();\\n window.location = $scope.baseUrl + '?business=' + isBusiness; // Redirect to alternative URL\\n };\\n\\n audiencePopup.reload = function () {\\n audiencePopup.storeZipCode();\\n $cookies.remove('city');\\n window.location.reload();\\n };\\n\\n audiencePopup.storeZipCode = function () {\\n if ($scope.validZipCode && $scope.zipCode.length >= $scope.zipCodeLength) {\\n $cookies.put(\\\"zipCode\\\", $scope.zipCode.toUpperCase(), {\\n expires: new Date(new Date().setDate(new Date().getDate() + 2))\\n });\\n }\\n };\\n}]);\"","module.exports = \"angular.module('banner').controller('BannerController', ['$rootScope', '$scope', 'GlobalService', function ($rootScope, $scope, GlobalService) {\\n $scope.scrollToLabel = function (label) {\\n GlobalService.scrollTo(label);\\n };\\n\\n $scope.initBanner = function (data) {\\n $scope.messages = data;\\n };\\n\\n $rootScope.$on('BANNER_UPDATE', function (event, data) {\\n if (data && !_.isEmpty(data)) {\\n $scope.messages = data;\\n }\\n });\\n}]);\"","module.exports = \"angular.module('branch').controller('BranchController', ['$scope', '$cookies', '$timeout', 'GlobalService', function ($scope, $cookies, $timeout, GlobalService) {\\n var BranchesCookieObj = $cookies.getObject('SelectedBranches');\\n var updateBranchTimer;\\n $scope.Branches = {};\\n\\n $scope.initSortByBranches = function (data) {\\n $scope.Branches.Branch = data.Branches;\\n $scope.Branches.SubBranch = data.SubBranches;\\n $scope.Branches.SelectedBranch = BranchesCookieObj ? getBranchById($scope.Branches.Branch, BranchesCookieObj.BranchId) : null;\\n $scope.Branches.SelectedSubBranch = BranchesCookieObj ? getBranchById($scope.Branches.SubBranch, BranchesCookieObj.SubBranchId) : null;\\n };\\n\\n $scope.updateBranchSelect = function () {\\n if (!$scope.Branches.SelectedBranch) $scope.Branches.SelectedSubBranch = null;\\n $timeout.cancel(updateBranchTimer);\\n updateBranchTimer = $timeout(function () {\\n var branchId = $scope.Branches.SelectedBranch ? $scope.Branches.SelectedBranch.Value : null;\\n var subBranchId = $scope.Branches.SelectedSubBranch ? $scope.Branches.SelectedSubBranch.Value : null;\\n var cookieValue = {\\n BranchId: branchId,\\n SubBranchId: subBranchId\\n };\\n var expireDate = new Date();\\n expireDate.setDate(expireDate.getDate() + 14);\\n $cookies.putObject('SelectedBranches', cookieValue, {\\n 'expires': expireDate,\\n 'path': '/'\\n });\\n $scope.$emit('BRANCH_UPDATE', cookieValue);\\n addEventToDataLayer($scope.Branches.SelectedBranch?.Name, $scope.Branches.SelectedSubBranch?.Name);\\n }, 200);\\n };\\n\\n function getBranchById(branchArray, branchId) {\\n var branchValue = _.find(branchArray, function (Branch) {\\n return Branch.Value == branchId;\\n });\\n\\n return branchValue || null;\\n }\\n\\n function addEventToDataLayer(branch, subBranch) {\\n dataLayer.push({\\n event: 'refineIndustry',\\n eventName: 'refine_industry',\\n branche_action: branch ? 'branche_verfijn' : 'branche_reset',\\n branche_name: branch,\\n sub_branche_name: subBranch,\\n eventCategory: 'Branche',\\n eventAction: branch ? 'verfijn' : 'reset',\\n eventLabel: branch ? `${branch}/${subBranch ?? branch}` : undefined\\n });\\n }\\n}]);\"","module.exports = \"angular.module('cart').controller('CartController', ['$rootScope', '$scope', '$sessionStorage', '$timeout', 'GlobalService', function ($rootScope, $scope, $sessionStorage, $timeout, GlobalService) {\\n $scope.$storage = $sessionStorage;\\n $scope.submitting = false;\\n $scope.$on('CART_UPDATE', function (event, data) {\\n $scope.getCartOverview($scope.currentPage);\\n });\\n /**\\r\\n * Scroll to the validation error element\\r\\n */\\n\\n function scrollToValidationError() {\\n GlobalService.scrollTo('.input-validation-error');\\n }\\n /*\\r\\n // TODO DELETE?\\r\\n angular.element(document).ready(function () {\\r\\n if ($rootScope.isInitialized == undefined) {\\r\\n $scope.ensureNumberOfProducts();\\r\\n $rootScope.isInitialized = true;\\r\\n }\\r\\n });*/\\n\\n\\n function checkPlacementDate(cartLine) {\\n if (!cartLine.IsValidPlacementDate || !cartLine.IsValidPickupDate) {\\n $timeout(function () {\\n angular.element('[name=\\\"cart.editableForm[' + cartLine.Id + ']\\\"].change').triggerHandler('click');\\n });\\n }\\n }\\n\\n $scope.getCartOverview = function () {\\n $scope.loading = true;\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'GetShoppingCartOverview'\\n }).success(function (data) {\\n $scope.loading = false;\\n\\n if (data !== undefined && data.Order.OrderLines !== undefined) {\\n _.each(data.Order.OrderLines, checkPlacementDate);\\n\\n $scope.cartOverview = data.Order;\\n $scope.productsInCartOverview = data.Order.OrderLines.length;\\n }\\n });\\n };\\n\\n $scope.ensureNumberOfProducts = function () {\\n if ($sessionStorage.NumberOfProducts == undefined) {\\n $scope.updateMiniCart();\\n }\\n };\\n\\n $scope.updateMiniCart = function () {\\n $rootScope.$broadcast('MINICART_UPDATE', '');\\n };\\n\\n $scope.addConditionalProduct = function (sku) {\\n $scope.conditionalProducts.push(sku);\\n };\\n\\n $scope.removeConditionalProduct = function (sku) {\\n // Find and remove item from an array\\n var i = $scope.conditionalProducts.indexOf(sku);\\n\\n if (i !== -1) {\\n $scope.conditionalProducts.splice(i, 1);\\n }\\n };\\n\\n $scope.updateServiceProductOrderline = function (data, placementDate, pickupDate, quantity, cartItem) {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'UpdateServiceProductInCart',\\n orderLineId: cartItem.Id,\\n quantity: quantity,\\n ServiceProperties: {\\n PlacementDate: placementDate,\\n PickupDate: pickupDate,\\n Timeslot: cartItem.Timeslot\\n },\\n sku: cartItem.Sku\\n }).success(function (data) {\\n _.each(data.Order.OrderLines, checkPlacementDate);\\n\\n $scope.cartOverview = data.Order;\\n $sessionStorage.NumberOfProducts = data.NumberOfProducts;\\n }).error(function (data) {\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup\\n });\\n };\\n\\n $scope.updateQuantity = function (quantity, orderLineId) {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'UpdateQuantity',\\n orderLineId: orderLineId,\\n quantity: quantity\\n }).success(function (data) {\\n $scope.cartOverview = data.Order; // Update datalayer\\n\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n return true;\\n }).error(function () {\\n return false;\\n });\\n };\\n\\n $scope.deleteFromCart = function (orderLineId) {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'RemoveOrderLineFromCart',\\n orderLineId: orderLineId\\n }).success(function (data) {\\n $scope.cartOverview = data.Order;\\n $sessionStorage.NumberOfProducts = data.NumberOfProducts;\\n $scope.productsInCartOverview = data.Order.OrderLines.length; // Update datalayer\\n\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n }).error(function (data) {\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup\\n });\\n };\\n\\n $scope.updateContractTerm = function () {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'UpdateContractTerm',\\n code: $scope.cartOverview.Contract.Code\\n }).success(function (data) {\\n $scope.cartOverview = data.Order;\\n $scope.cartOverview.Contract.IsValidContractDurationOption = true; // Update datalayer\\n\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n }).error(function (data) {\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup\\n });\\n };\\n\\n $scope.validateContractStartDate = function () {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'IsValidContractStartDate',\\n startDate: $scope.cartOverview.Contract.StartDate\\n }).success(function (data) {\\n $scope.cartOverview.Contract.IsValidStartDate = data;\\n }).error(function (data) {\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup\\n });\\n };\\n\\n $scope.initProductDetailPage = function () {\\n $scope.conditionalProducts = [];\\n };\\n\\n $scope.initCartOverview = function () {\\n $scope.cartOverview = [];\\n $scope.getCartOverview($scope.currentPage);\\n };\\n\\n $scope.setOrderQuestion = function (question, value) {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'SetOrderQuestionAnswer',\\n orderProperty: question,\\n value: value\\n }).success(function (data) {//TODO: error handling\\n });\\n };\\n\\n $scope.getCalendarRules = function (id, sku) {\\n var placementDateElement = $('.js-zebra-placementdate-' + id);\\n var pickupDateElement = $('.js-zebra-pickupdate-' + id);\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'GetCalendarRules',\\n sku: sku\\n }).success(function (data) {\\n placementDateElement.data('Zebra_DatePicker').update({\\n direction: [true, data.PlacementDateMaximumUpToDaysFromNow]\\n });\\n\\n if (pickupDateElement.length) {\\n pickupDateElement.data('Zebra_DatePicker').update({\\n direction: [data.PickupDateMinimumDaysFromPlacementDate, data.PickupDateMaximumDaysFromPlacementDate - 1]\\n });\\n }\\n });\\n };\\n\\n $scope.hasContractOptions = function () {\\n return $scope.productsInCartOverview && $scope.cartOverview.OrderLines?.filter(line => line.SubscriptionType === 2).length && !$scope.cartOverview.OrderLines?.filter(line => line.Product.PriceOnRequest).length;\\n };\\n\\n $scope.submitForm = function (event) {\\n let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\\n const typeOfRequest = event.currentTarget.form.elements[\\\"typeOfRequest\\\"]; // is a duration selection made\\n\\n const IsValidContractDurationOption = $scope.cartOverview.Contract.Code !== null;\\n $scope.cartOverview.Contract.IsValidContractDurationOption = IsValidContractDurationOption; // update hidden field with correct order type\\n\\n if (typeOfRequest) {\\n typeOfRequest.value = type;\\n }\\n\\n $scope.submitting = true;\\n const contract = $scope.cartOverview.Contract;\\n\\n if (!$scope.hasContractOptions() || contract.IsValidStartDate && contract.IsValidContractDurationOption) {\\n event.currentTarget.form.submit();\\n }\\n };\\n}]);\"","module.exports = \"angular.module('catalog').controller('CatalogController', ['$scope', '$element', '$location', '$timeout', '$sessionStorage', '$document', '$window', '$cookies', 'GlobalService', function ($scope, $element, $location, $timeout, $sessionStorage, $document, $window, $cookies, GlobalService) {\\n var catalog = this;\\n var useFilterDependencies = false;\\n var showPricesWithVat = false;\\n $scope.triggerDataLayer = true;\\n $scope.dataLayerEvent = {\\n 'event': 'filter',\\n 'eventName': 'filter',\\n 'eventCategory': 'enhanced ecommerce',\\n 'eventAction': 'impressions',\\n 'eventLabel': 'filter'\\n };\\n\\n catalog.filter = function (queryOnUrl) {\\n queryOnUrl = typeof queryOnUrl !== 'undefined' ? queryOnUrl : true;\\n\\n if (useFilterDependencies == 'True') {\\n filterSequence();\\n } else {\\n filterFreeSelection();\\n }\\n /**\\r\\n * This function causes the selectbox filters to be dependend and function in a sequence.\\r\\n * second and thirth are disabled when first is not selected\\r\\n */\\n\\n\\n function filterSequence() {\\n //If the wastestream is selected, the filters should reset\\n if ($scope.selectedFilter1 != $scope.filter1) {\\n $scope.filter2 = null;\\n $scope.selectedFilter2 = '';\\n $scope.filter3 = null;\\n $scope.selectedFilter3 = '';\\n }\\n\\n if ($scope.selectedFilter2 != $scope.filter2) {\\n $scope.filter3 = null;\\n $scope.selectedFilter3 = '';\\n }\\n\\n if ($scope.filter1 && $scope.filter1 != '') {\\n $scope.selectedFilter1 = $scope.filter1;\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[0], $scope.filter1);\\n }\\n } else {\\n $scope.selectedFilter1 = '';\\n $scope.filter2 = '';\\n $scope.filter3 = '';\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[0], null);\\n }\\n }\\n\\n if ($scope.filter2) {\\n $scope.selectedFilter2 = $scope.filter2;\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[1], $scope.filter2);\\n }\\n } else {\\n $scope.selectedFilter2 = '';\\n $scope.filter3 = '';\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[1], null);\\n }\\n }\\n\\n if ($scope.filter3) {\\n $scope.selectedFilter3 = $scope.filter3;\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[2], $scope.filter3);\\n }\\n } else {\\n $scope.selectedFilter3 = '';\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[2], null);\\n }\\n }\\n } // end: filtersequence()\\n\\n /**\\r\\n * This function causes the selectbox filters to be free to choose\\r\\n * first, second and thirth are all enabled to choose from in the prefered order of the visitor\\r\\n */\\n\\n\\n function filterFreeSelection() {\\n $scope.selectedFilter1 = $scope.filter1;\\n $scope.selectedFilter2 = $scope.filter2;\\n $scope.selectedFilter3 = $scope.filter3;\\n\\n if (queryOnUrl) {\\n $location.search($scope.Filters[0], $scope.filter1);\\n $location.search($scope.Filters[1], $scope.filter2);\\n $location.search($scope.Filters[2], $scope.filter3);\\n }\\n } // end: filterFreeSelection()\\n\\n /**\\r\\n * Generate submit url\\r\\n */\\n\\n\\n if (typeof shopUrl != 'undefined') {\\n $scope.submitUrl = shopUrl;\\n } else {\\n var pathArray = window.location.pathname.split('/');\\n $scope.submitUrl = location.protocol + '//' + location.host + \\\"/\\\" + pathArray[1] + \\\"/\\\" + pathArray[2] + \\\"/\\\";\\n }\\n\\n if ($scope.filter1 != '' && $scope.filter1 != null) {\\n $scope.submitUrl += '#?' + $scope.Filters[0] + '=' + encodeURIComponent($scope.filter1);\\n } else if (typeof shopUrl != 'undefined') {\\n $scope.submitUrl = shopUrl;\\n }\\n\\n if ($scope.filter2 && $scope.filter2 != '') {\\n $scope.submitUrl += '&' + $scope.Filters[1] + '=' + encodeURIComponent($scope.filter2);\\n }\\n\\n if ($scope.filter3 && $scope.filter3 != '') {\\n $scope.submitUrl += '&' + $scope.Filters[2] + '=' + encodeURIComponent($scope.filter3);\\n }\\n\\n if ($scope.postbackOnChange) {\\n window.location = $scope.submitUrl;\\n } else {\\n catalog.getProductOverview(1);\\n }\\n }; // end: catalog.filter function\\n\\n\\n catalog.getProductOverview = function (page) {\\n let triggerDataLayer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\\n\\n if (page == 1) {\\n $scope.loading = true;\\n } else {\\n $location.search('page', page);\\n }\\n\\n $scope.buttonLoader = true;\\n $scope.currentPage = page;\\n var data = {\\n scController: 'Catalog',\\n scAction: 'GetCatalogOverview',\\n filter: {\\n CurrentPage: page,\\n RecordsPerPage: $scope.recordsPerPage,\\n IsBusiness: isBusinessUser(),\\n Filter: {\\n Filter1: $scope.selectedFilter1,\\n Filter2: $scope.selectedFilter2,\\n Filter3: $scope.selectedFilter3\\n },\\n IsPostBack: $scope.isPostBack,\\n Sorting: {\\n SortOrder: $scope.sortorder,\\n BranchId: $scope.BranchId,\\n SubBranchId: $scope.SubBranchId\\n }\\n }\\n };\\n GlobalService.getData(data).success(function (data) {\\n if ($scope.catalogOverview == undefined || $scope.catalogOverview.Products == undefined || page === 1) {\\n $scope.catalogOverview = data;\\n } else {\\n var products = $scope.catalogOverview.Products;\\n $scope.catalogOverview = data;\\n\\n for (var i = 0; i < products.length; i++) {\\n var productToAdd = products[products.length - i - 1];\\n productToAdd.isNew = false;\\n $scope.catalogOverview.Products.unshift(productToAdd);\\n }\\n }\\n\\n $scope.filter1 = data.DisplayProperties?.Filter?.Filter1;\\n $scope.filter2 = data.DisplayProperties?.Filter?.Filter2;\\n $scope.selectedFilter2 = data.DisplayProperties?.Filter?.Filter2;\\n $scope.filter3 = data.DisplayProperties?.Filter?.Filter3;\\n $scope.loading = false;\\n $scope.buttonLoader = false;\\n $scope.isPostBack = true;\\n $scope.postbackOnChange = data.DisplayProperties?.PostbackOnChange;\\n\\n if ($sessionStorage.productOverviewScroll != null && $sessionStorage.productOverviewScroll !== 0) {\\n window.scrollTo(0, $sessionStorage.productOverviewScroll);\\n $sessionStorage.productOverviewScroll = 0;\\n } // Handle Datalayer\\n\\n\\n if ($scope.triggerDataLayer && triggerDataLayer) {\\n // calculate from which index we'll return products\\n const startFrom = ($scope.currentPage - 1) * $scope.recordsPerPage;\\n const event = { ...$scope.dataLayerEvent,\\n filter_stream_type: $scope.filter1 || '',\\n filter_container_type: $scope.filter2 || '',\\n filter_capacity_type: $scope.filter3 || ''\\n };\\n $scope.handleDataLayer(data.Products, $scope.googleAnalyticsListName, startFrom, event);\\n }\\n }).error(function (e) {\\n console.info(e);\\n $timeout(function () {\\n $scope.loading = false;\\n }, 500);\\n });\\n };\\n\\n $scope.showContainersButtonClick = function () {\\n if ($scope.catalogOverview?.Products) {\\n dataLayer.push({ ...$scope.dataLayerEvent,\\n filter_stream_type: $scope.filter1 || '',\\n filter_container_type: $scope.filter2 || '',\\n filter_capacity_type: $scope.filter3 || ''\\n }); // Multiple products found\\n\\n if ($scope.catalogOverview.Products.length > 1) {\\n // Redirect to catalog page\\n window.location = $scope.submitUrl;\\n } // Only 1 product is found\\n else {\\n // Redirect to single product page\\n window.location = $scope.catalogOverview.Products[0].Url;\\n }\\n }\\n\\n return false;\\n };\\n\\n $scope.$on('BRANCH_UPDATE', function (event, data) {\\n $scope.BranchId = data.BranchId;\\n $scope.SubBranchId = data.SubBranchId;\\n catalog.getProductOverview(1, false);\\n });\\n\\n catalog.setTargetAudience = function (isBusiness, reload) {\\n reload = typeof reload !== 'undefined' ? reload : true; //Set the cookie for business, expires in 365 days\\n\\n $location.$search = {};\\n setCookie(\\\"isBusiness\\\", isBusiness, 365);\\n\\n if (reload) {\\n window.location = window.location.pathname;\\n }\\n\\n $scope.hideMessage = true;\\n };\\n\\n catalog.getQuerystringFilters = function () {\\n //Are there query string parameters to use for the filtering?\\n if ($location.search()[$scope.Filters[0]]) {\\n $scope.selectedFilter1 = $location.search()[$scope.Filters[0]];\\n $scope.filter1 = $scope.selectedFilter1;\\n }\\n\\n if ($location.search()[$scope.Filters[1]]) {\\n $scope.selectedFilter2 = $location.search()[$scope.Filters[1]];\\n $scope.filter2 = $scope.selectedFilter2;\\n }\\n\\n if ($location.search()[$scope.Filters[2]]) {\\n $scope.selectedFilter3 = $location.search()[$scope.Filters[2]];\\n $scope.filter3 = $scope.selectedFilter3;\\n }\\n\\n if ($location.search().page) {\\n $scope.recordsPerPage = $location.search().page * $scope.recordsPerPage;\\n }\\n };\\n\\n catalog.showAudienceMessage = function () {\\n var visitedCookie = getCookie(\\\"previousVisitor\\\");\\n\\n if (visitedCookie === 'true') {\\n $scope.previousVisitor = true;\\n } else {\\n $scope.previousVisitor = false;\\n setCookie(\\\"previousVisitor\\\", true, 365);\\n }\\n };\\n\\n catalog.showPricesWithVat = function () {\\n return showPricesWithVat;\\n };\\n\\n catalog.setScrollPosition = function () {\\n if ($(window).scrollTop() !== 0) {\\n sessionStorage.setItem('ngStorage-productOverviewScroll', $(window).scrollTop());\\n }\\n };\\n\\n catalog.resetFilters = function () {\\n $scope.selectedFilter1 = '';\\n $scope.selectedFilter2 = '';\\n $scope.selectedFilter3 = '';\\n };\\n\\n $('.c-shop-filter-form').on('click', '.js-reset-filters', function () {\\n catalog.resetFilters();\\n catalog.getProductOverview(1);\\n });\\n\\n $scope.initCatalogFilterComponent = function (data) {\\n if (typeof shopUrl !== 'undefined') {\\n $scope.submitUrl = shopUrl; // prefill default link target to shop\\n }\\n\\n $scope.triggerDataLayer = data.triggerDataLayer;\\n useFilterDependencies = data.UseFilterDependencies;\\n catalog.resetFilters();\\n $scope.Filters = data.Filters;\\n catalog.getProductOverview(1);\\n };\\n\\n $scope.initCatalogOverview = function (data) {\\n var BranchesCookieObj = $cookies.getObject('SelectedBranches');\\n $scope.BranchId = BranchesCookieObj ? BranchesCookieObj.BranchId : null;\\n $scope.SubBranchId = BranchesCookieObj ? BranchesCookieObj.SubBranchId : null; // Set var(s) global within controller\\n\\n useFilterDependencies = data.UseFilterDependencies !== undefined ? useFilterDependencies = data.UseFilterDependencies : 'False';\\n showPricesWithVat = data.ShowPricesWithVat == 'True' ? true : false;\\n\\n if ($location.search().business) {\\n if ($location.search().business == 'true') {\\n catalog.setTargetAudience(true, false);\\n } else {\\n catalog.setTargetAudience(false, false);\\n }\\n }\\n\\n catalog.resetFilters();\\n $scope.loading = false;\\n $scope.catalogOverview = [];\\n $scope.currentPage = 1;\\n $scope.recordsPerPage = 9;\\n $scope.tmpRecordsPerPage = $scope.recordsPerPage;\\n $scope.IsBusiness = isBusinessUser();\\n $scope.isPostBack = false;\\n $scope.Filters = data.Filters !== undefined ? data.Filters : ['', '', ''];\\n $scope.buttonLoader = false;\\n catalog.getQuerystringFilters();\\n catalog.showAudienceMessage();\\n catalog.getProductOverview($scope.currentPage, false);\\n\\n if ($scope.recordsPerPage !== $scope.tmpRecordsPerPage) {\\n $scope.recordsPerPage = $scope.tmpRecordsPerPage;\\n $scope.currentPage = parseInt($location.search().page);\\n }\\n };\\n}]);\"","module.exports = \"angular.module('checkoutFlow').controller('CheckoutFlowController', ['$rootScope', '$scope', '$sessionStorage', 'GlobalService', function ($rootScope, $scope, $sessionStorage, GlobalService) {\\n var checkoutFlow = this; // Get companies by name\\n\\n checkoutFlow.GetCompaniesByName = function () {\\n if ($scope.disableAutoCompleteOnCompanyName) {\\n $scope.disableAutoCompleteOnCompanyName = false;\\n return;\\n }\\n\\n if (typeof $scope.companyName == \\\"undefined\\\" || $scope.companyName.length < 2) {\\n $scope.companyList = [];\\n return;\\n }\\n\\n $scope.isLoading = true; // display loading icon\\n\\n $.post(window.location, {\\n scController: 'CheckoutFlow',\\n scAction: 'GetCompaniesByName',\\n companyName: $scope.companyName\\n }).done(function (data) {\\n $scope.companyList = data.Companies;\\n $scope.isLoading = false; // hide loading icon\\n\\n $scope.$apply();\\n }).error(function () {\\n $scope.companyList = [];\\n $scope.isLoading = false;\\n $scope.$apply();\\n });\\n }; // Get companies by coc number\\n\\n\\n checkoutFlow.GetCompaniesByCocNumber = function () {\\n if ($scope.disableAutoCompleteOnCocNumber) {\\n $scope.disableAutoCompleteOnCocNumber = false;\\n return;\\n }\\n\\n if (typeof $scope.cocNumber == \\\"undefined\\\" || $scope.cocNumber.length < 8) {\\n $scope.companyList = [];\\n return;\\n }\\n\\n $.post(window.location, {\\n scController: 'CheckoutFlow',\\n scAction: 'GetCompaniesByCocNumber',\\n cocNumber: $scope.cocNumber\\n }).done(function (data) {\\n $scope.companyList = data.Companies;\\n $scope.$apply();\\n });\\n }; // Get cart overview\\n\\n\\n checkoutFlow.GetCartOverview = function () {\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'GetShoppingCartOverview'\\n }).success(function (data) {\\n if (data !== undefined && data.Order.OrderLines !== undefined) {\\n $scope.cartOverview = data.Order;\\n }\\n });\\n }; // Set the selected company\\n\\n\\n checkoutFlow.SetCompany = function (company) {\\n $scope.disableAutoCompleteOnCompanyName = true;\\n $scope.disableAutoCompleteOnCocNumber = true;\\n $scope.company = company;\\n $scope.companyName = company.CompanyName;\\n $scope.cocNumber = company.CocNumber;\\n $scope.companyList = [];\\n validatePrefilledFields();\\n }; // Set the company name for prefill\\n\\n\\n checkoutFlow.SetCompanyName = function (companyName) {\\n $scope.disableAutoCompleteOnCompanyName = true;\\n $scope.companyName = companyName;\\n $scope.companyList = [];\\n }; // Set coc number for prefill\\n\\n\\n checkoutFlow.SetCocNumber = function (cocNumber) {\\n $scope.disableAutoCompleteOnCocNumber = true;\\n $scope.cocNumber = cocNumber;\\n $scope.companyList = [];\\n }; // Set coupon code\\n\\n\\n checkoutFlow.AddCouponCode = function (coupon) {\\n //TODO: Add zipcode to coupon validation on ucommerce\\n //var zipCode;\\n //if ($scope.deliveryAddress.Specified === 'True') {\\n // zipCode = $scope.deliveryAddress.ZipCode;\\n //} else {\\n // zipCode = $scope.company.ZipCode;\\n //}\\n GlobalService.postData({\\n scController: 'Cart',\\n scAction: 'AddCoupon',\\n coupon: coupon\\n }).success(function (data) {\\n $scope.showCouponAdded = true;\\n $scope.cartOverview = data.Order;\\n $sessionStorage.NumberOfProducts = data.NumberOfProducts;\\n $rootScope.$broadcast('CART_UPDATE', '');\\n }).error(function (data) {\\n var responseJSON = data ? data.error : 'error';\\n lightcase.start({\\n href: '#',\\n height: 'auto',\\n onFinish: {\\n getContent: function () {\\n var msg = $('
' + responseJSON + '
');\\n $('#lightcase-case .lightcase-inlineWrap').html(msg);\\n $(window).trigger('resize');\\n },\\n closeButton: function () {\\n $('.js-close-popup').on('click', function (e) {\\n e.preventDefault();\\n lightcase.close();\\n });\\n }\\n }\\n });\\n });\\n }; // Validate prefilled fields after selecting a company from autocomplete\\n\\n\\n function validatePrefilledFields() {\\n var $fieldBlurCheck = $('.js-field-blur-check');\\n setTimeout(function () {\\n $fieldBlurCheck.find('input').each(function () {\\n $(this).blur();\\n });\\n }, 200);\\n }\\n\\n checkoutFlow.blurCompany = function () {\\n setTimeout(function () {\\n $scope.companyList = [];\\n $scope.isLoading = false;\\n $scope.$apply();\\n }, 200);\\n };\\n\\n checkoutFlow.selectShipmentMethod = function (id) {\\n // If id equals null, get id from dom\\n if (id == undefined) {\\n id = $scope.selectedShipmentMethod;\\n } // Get shipping method field (hidden input)\\n\\n\\n var $shippingMethod = $('.js-shipping-method'); // Set value\\n\\n $shippingMethod.val(id);\\n }; // INIT function\\n\\n\\n $scope.init = function () {\\n $scope.test = $scope.company;\\n $scope.isLoading = false; // hide loading icon\\n\\n $scope.disableAutoCompleteOnCompanyName = false;\\n $scope.disableAutoCompleteOnCocNumber = false;\\n $scope.showCouponAdded = false;\\n $scope.canAddCouponCode = false;\\n $scope.deliveryAddress = {};\\n $scope.companyList = [];\\n $scope.cartOverview = []; // Get cart overview\\n\\n checkoutFlow.GetCartOverview();\\n }; // Watch changes on the company and coc input fields and call service for autocomplete\\n\\n\\n $scope.$watch(\\\"companyName\\\", checkoutFlow.GetCompaniesByName);\\n $scope.$watch(\\\"cocNumber\\\", checkoutFlow.GetCompaniesByCocNumber);\\n}]);\"","module.exports = \"angular.module('crossSell').controller('CrossSellController', ['$rootScope', '$scope', '$element', '$timeout', 'GlobalService', function ($rootScope, $scope, $element, $timeout, GlobalService) {\\n var nrOfProductsToShow = 3;\\n $scope.crossSellList = [];\\n $scope.dataLayerEvent = {\\n 'event': 'crosssell',\\n 'eventCategory': 'enhanced ecommerce',\\n 'eventAction': 'impressions',\\n 'eventLabel': 'crosssell'\\n };\\n $scope.$on('BRANCH_UPDATE', function (event, data) {\\n getCrossSellProducts(data.BranchId, data.SubBranchId);\\n });\\n\\n $scope.initCrossSell = function (products, googleAnalyticsListName) {\\n $scope.loading = false;\\n $scope.crossSellList = products; // Handle Datalayer\\n\\n $scope.googleAnalyticsListName = googleAnalyticsListName;\\n $scope.handleDataLayer($scope.crossSellList, $scope.googleAnalyticsListName, false, $scope.dataLayerEvent);\\n };\\n\\n function getCrossSellProducts(branchId, subBranchId) {\\n $scope.loading = true;\\n var data = {\\n scController: 'Catalog',\\n scAction: 'GetCatalogOverview',\\n filter: {\\n Sorting: {\\n BranchId: branchId,\\n SubBranchId: subBranchId\\n }\\n }\\n };\\n GlobalService.getData(data).success(function (data) {\\n $scope.loading = false;\\n $scope.crossSellList = data.Products.slice(0, nrOfProductsToShow); // Handle Datalayer\\n\\n $scope.handleDataLayer($scope.crossSellList, $scope.googleAnalyticsListName, false, $scope.dataLayerEvent);\\n }).error(function (e) {\\n $timeout(function () {\\n $scope.loading = false;\\n }, 500);\\n });\\n }\\n}]);\"","module.exports = \"angular.module('languageSwitch').controller('LanguageSwitchController', ['$rootScope', '$scope', '$sessionStorage', '$cookies', function ($rootScope, $scope, $sessionStorage, $cookies) {\\n $scope.selectedLanguage = '';\\n\\n $scope.switchLanguage = function ($event, newActiveLanguageBaseUrl) {\\n if ($event) {\\n $event.preventDefault();\\n }\\n\\n $cookies.remove('zipCode');\\n $cookies.remove('isBusiness');\\n window.location.href = newActiveLanguageBaseUrl;\\n /* $.post(window.location,\\r\\n {\\r\\n scController: 'Cart',\\r\\n scAction: 'ClearCart'\\r\\n }).done(function(data) {\\r\\n $scope.NrOfProducts = data.NumberOfProducts;\\r\\n $sessionStorage.NumberOfProducts = data.NumberOfProducts;\\r\\n $scope.$apply();\\r\\n window.location.href = newActiveLanguageBaseUrl;\\r\\n }).error(function(data) {\\r\\n alert(data.responseJSON.error);\\r\\n }); */\\n };\\n}]);\"","module.exports = \"angular.module('miniCart').controller('MiniCartController', ['$rootScope', '$scope', '$sessionStorage', function ($rootScope, $scope, $sessionStorage) {\\n $scope.$on('MINICART_UPDATE', function (event, arg) {\\n $scope.LoadMiniCart();\\n });\\n\\n $scope.LoadMiniCart = function () {\\n $scope.loading = true;\\n $.post(window.location, {\\n scController: 'Cart',\\n scAction: 'GetMiniShoppingCart'\\n }).done(function (data) {\\n $scope.cartItems = new Array(); // Slice array to chunks of two (because they are showed in two columns)\\n\\n var i,\\n counter = 0,\\n j,\\n tempArray,\\n chunk = 2;\\n\\n for (i = 0, j = data.RecentOrderLines.length; i < j; i += chunk) {\\n tempArray = data.RecentOrderLines.slice(i, i + chunk);\\n $scope.cartItems[counter] = tempArray;\\n counter++;\\n }\\n\\n $scope.NrOfProducts = data.NrOfProducts;\\n $sessionStorage.NumberOfProducts = data.NrOfProducts;\\n $scope.loading = false;\\n $scope.$apply();\\n });\\n };\\n\\n $scope.deleteFromCart = function (orderLineId) {\\n $.post(window.location, {\\n scController: 'Cart',\\n scAction: 'RemoveOrderLineFromCart',\\n orderLineId: orderLineId\\n }).done(function (data) {\\n $scope.LoadMiniCart(); // Update datalayer\\n\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n }).error(function (data) {\\n alert(data.responseJSON.error); // TODO: Nice popup\\n });\\n };\\n\\n $scope.initMiniCartOverview = function () {\\n $scope.NrOfProducts = 0;\\n $scope.LoadMiniCart();\\n };\\n}]);\"","module.exports = \"angular.module('productBundleForm').controller('ProductBundleFormController', ['$rootScope', '$scope', '$sessionStorage', 'GlobalService', function ($rootScope, $scope, $sessionStorage, GlobalService) {\\n $scope.isLoading = $scope.isSubmitted = false;\\n $scope.isSubmitted = false;\\n /**\\r\\n * Enable default button on form change\\r\\n * Normally after submit\\r\\n */\\n\\n $scope.addProductBundle = function (products) {\\n $scope.isLoading = true;\\n var options = {\\n scController: 'Cart',\\n scAction: 'AddBundledProductsToCart',\\n productForms: products\\n };\\n GlobalService.postData(options).success(function (data) {\\n $scope.isLoading = false;\\n $scope.isSubmitted = true;\\n\\n $scope.changeForm = function () {\\n $scope.isSubmitted = false;\\n };\\n\\n $rootScope.$broadcast('MINICART_UPDATE', '');\\n $rootScope.$broadcast('CART_UPDATE', '');\\n }).error(function (data) {\\n $scope.isLoading = false;\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup \\n });\\n };\\n}]);\"","module.exports = \"angular.module('productForm').controller('ProductFormController', ['$rootScope', '$scope', '$sessionStorage', '$filter', 'GlobalService', function ($rootScope, $scope, $sessionStorage, $filter, GlobalService) {\\n /**\\r\\n * isLoading - loading icon\\r\\n * isSucceeded - form post succeeded\\r\\n * isLocked - lock form to prevent posting data twice\\r\\n */\\n $scope.isLoading = $scope.isSucceeded = $scope.isLocked = false;\\n $scope.conditionalProducts = [];\\n /**\\r\\n * After submitting the product check whether the product submit is allowed:\\r\\n * If the cart is empty; allow adding the product\\r\\n * If the cart contains business items and the product is a business item; allow adding the product\\r\\n * If the cart contains consumer items and the product is a consumer item; allow adding the product\\r\\n *\\r\\n * or disallowed:\\r\\n * Cart has items of # category, product is from another category, give user option using modal:\\r\\n * Empty cart and add the desired product\\r\\n * Leave cart and don't add the desired product\\r\\n */\\n\\n $scope.addProductOrderline = function (event, fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot, productAllowed) {\\n if (!$scope.isLocked) {\\n $scope.isLocked = true;\\n var isValid = $('form#addProduct').valid();\\n const isQuickview = !!$(event.target).closest('.c-quickview').length;\\n\\n if (isValid) {\\n if (!productAllowed) {\\n lightcase.start({\\n href: '#',\\n // Needed to open modal programmaticially\\n onFinish: {\\n injectContent: function () {\\n // Element that holds modal content\\n var contentElement = $('#productNotAllowedInBasket'); // Set content\\n\\n var contentInner = lightcase.get('contentInner');\\n contentInner.children().html(contentElement.html()); // Resize lightcase to content\\n\\n lightcase.resize(); // Find DOM element that lightcase injects\\n\\n var lightcaseDom = lightcase.get('case'); // Setup default handler for DOM buttons click event which prevents default behaviour,\\n // closes the modal and optionally invoke a callback afterwards.\\n\\n var defaultModalClickHandler = (e, callback) => {\\n e.preventDefault();\\n lightcase.close();\\n\\n if (callback !== undefined) {\\n callback();\\n } // Remove lock when one of the buttons is clicked\\n\\n\\n $scope.isLocked = false;\\n }; // Bind click events on accept and reject buttons\\n\\n\\n lightcaseDom.find(\\\".js-accept\\\").on('click', e => defaultModalClickHandler(e, () => {\\n // The user gave permission to switch from one audience to another, this means the backend will empty the current cart\\n // and we can continue the flow of adding a item of the current audience\\n addProductOrderline(fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot, isQuickview);\\n }));\\n lightcaseDom.find(\\\".js-reject\\\").on('click', e => defaultModalClickHandler(e)); // Hide default close button for tablets resolutions and onwards\\n\\n $('.lightcase-icon-close').addClass(\\\"u-hidden@tablet-and-up\\\");\\n }\\n },\\n // Remove lock when user closes modal\\n onClose: {\\n resetLock: function () {\\n $scope.isLocked = false;\\n }\\n }\\n });\\n return false;\\n } // Cart contains no items yet or contains items that have the similear audience as the product to be added\\n\\n\\n addProductOrderline(fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot, isQuickview);\\n }\\n }\\n };\\n\\n $scope.onVariantChange = function (variant) {\\n $scope.changeForm();\\n\\n if (variant == null || $scope.price == null || $scope.price == 0) {\\n if ($scope.showPricesInclVat) {\\n $scope.price = $scope.variants[$scope.variants.length - 1].PriceIncVat;\\n } else {\\n $scope.price = $scope.variants[$scope.variants.length - 1].PriceExVat;\\n }\\n }\\n\\n if ($scope.showPricesInclVat) {\\n if (variant.PriceIncVat == 0) return;\\n $scope.price = variant.PriceIncVat;\\n } else {\\n if (variant.PriceExVat == 0) return;\\n $scope.price = variant.PriceExVat;\\n }\\n\\n $scope.updateVariants();\\n };\\n\\n $scope.updateVariants = function () {\\n if ($scope.variants == null || $scope.priceOnRequest || $scope.price == null || $scope.price == 0) return;\\n $scope.variants.forEach(function (variant) {\\n var priceDifference = ($scope.showPricesInclVat ? variant.PriceIncVat : variant.PriceExVat) - $scope.price; // Remove the \\\"(� ##.##)\\\" from frequency\\n\\n variant.Frequency = variant.Frequency.replace(/\\\\s*\\\\(.*?\\\\)\\\\s*$/g, \\\"\\\");\\n\\n if (priceDifference != 0) {\\n // Add \\\"(� ##.##)\\\" on frequency, Math.abs is required to put a plus sign\\n variant.Frequency += ' (' + (priceDifference > 0 ? '+' : '-') + $filter('currency')(Math.abs(priceDifference)) + ')';\\n }\\n });\\n };\\n /**\\r\\n * Internal private function that validates the passed form properties and tries to add an item to the cart.\\r\\n */\\n\\n\\n function addProductOrderline(fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot, isQuickview) {\\n $scope.isLoading = true;\\n var productForm = prepareProductFormForSubmit(fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot);\\n var options = {\\n scController: 'Cart',\\n scAction: 'AddProductToCart',\\n productForm: productForm\\n };\\n GlobalService.postData(options).success(function (data) {\\n $scope.isLoading = false;\\n $scope.isSucceeded = true;\\n $scope.addedQuantity = quantity;\\n $scope.LastCreatedOrderLineId = data.LastCreatedOrderLineId;\\n $sessionStorage.NumberOfProducts = data.NumberOfProducts; // Update datalayer\\n\\n data?.ECommerceDataLayerModels.forEach(data => {\\n if (data?.ecommerce?.add) {\\n data.ecommerce.add.actionField = {\\n list: isQuickview ? 'Quickview' : 'detail page'\\n };\\n }\\n });\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n $rootScope.$broadcast('MINICART_UPDATE', '');\\n $rootScope.$broadcast('CART_UPDATE', '');\\n }).error(function (data) {\\n $scope.isLoading = false;\\n $scope.isLocked = false;\\n alert(GlobalService.formatErrorMessage(data.error, data.validationData)); // TODO: Nice popup\\n });\\n }\\n /**\\r\\n * Prepares product for submit\\r\\n */\\n\\n\\n function prepareProductFormForSubmit(fullyQualifiedType, sku, quantity, variantSku, placementDate, pickupDate, timeSlot) {\\n var productForm = {\\n FullyQualifiedType: fullyQualifiedType,\\n ParentOrderlineId: $scope.$parent.LastCreatedOrderLineId,\\n SKU: sku,\\n Quantity: quantity,\\n VariantSku: variantSku,\\n AdditionalSkusToAdd: $scope.conditionalProducts,\\n PlacementDate: placementDate,\\n PickupDate: pickupDate,\\n Timeslot: timeSlot\\n };\\n return productForm;\\n }\\n /**\\r\\n * Enable default button on form change\\r\\n * Normally after submit\\r\\n */\\n\\n\\n $scope.changeForm = function () {\\n if (!$scope.isLoading) {\\n $scope.isLocked = false;\\n $scope.isSucceeded = false;\\n }\\n };\\n\\n $scope.$watch(\\\"quantity\\\", function (newValue, oldValue) {\\n if (newValue !== oldValue) {\\n $scope.isLocked = false;\\n $scope.isSucceeded = false;\\n }\\n });\\n /**\\r\\n * Add conditional product to conditionalProducts array\\r\\n */\\n\\n $scope.addConditionalProduct = function (sku) {\\n var i = $scope.conditionalProducts.indexOf(sku);\\n\\n if (i === -1) {\\n $scope.conditionalProducts.push(sku);\\n }\\n };\\n /**\\r\\n * Remove conditional product\\r\\n * Finds and removes item from array\\r\\n */\\n\\n\\n $scope.removeConditionalProduct = function (sku) {\\n var i = $scope.conditionalProducts.indexOf(sku);\\n\\n if (i !== -1) {\\n $scope.conditionalProducts.splice(i, 1);\\n }\\n };\\n}]);\"","module.exports = \"angular.module(\\\"search\\\").controller(\\\"SearchController\\\", [\\\"$scope\\\", \\\"$location\\\", function ($scope, $location) {\\n $scope.searchResults = [];\\n $scope.searchStr = \\\"\\\";\\n $scope.lastSearch = \\\"\\\";\\n $scope.noResults = false;\\n $scope.paging = {\\n index: 0,\\n total: 0,\\n pages: []\\n };\\n $scope.inputClass = '';\\n $scope.pageSize = 10;\\n\\n $scope.initSearchResults = function () {\\n const search = $location.search();\\n\\n if (search.query) {\\n $scope.searchStr = search.query;\\n $scope.paging.index = search.index || 0;\\n $scope.getSearchResults();\\n }\\n };\\n\\n $scope.keyUp = function (e) {\\n if ($scope.inputClass !== '') {\\n $scope.inputClass = '';\\n }\\n\\n if (e.key === \\\"Enter\\\" || e.keyCode === 13) {\\n this.doSearch();\\n }\\n };\\n\\n $scope.getSearchResults = function (paginate) {\\n if (!paginate) {\\n $scope.paging.index = 0;\\n $scope.lastSearch = $scope.searchStr;\\n }\\n\\n const data = {\\n Index: $scope.paging.index * $scope.pageSize,\\n Size: $scope.pageSize,\\n SearchQuery: paginate ? $scope.lastSearch : $scope.searchStr\\n };\\n fetch('/api/search', {\\n method: 'POST',\\n mode: 'cors',\\n cache: 'no-cache',\\n credentials: 'same-origin',\\n headers: {\\n 'Content-Type': 'application/json'\\n },\\n redirect: 'follow',\\n referrerPolicy: 'no-referrer',\\n body: JSON.stringify(data)\\n }).then(res => res.json()).then(res => {\\n $scope.searchResults = res.searchResults.map(result => {\\n result.class = `c-search__result__icon--${result.tag.toLowerCase()}`;\\n return result;\\n });\\n $scope.paging.total = res.totalItems;\\n $scope.paging.totalPages = Math.ceil(res.totalItems / $scope.pageSize);\\n $scope.noResults = $scope.paging.total === 0;\\n $scope.createPaging();\\n $scope.$apply();\\n }).catch(err => {\\n console.log(err);\\n });\\n };\\n\\n $scope.searchQuickLink = function (searchTerm) {\\n $scope.searchStr = searchTerm;\\n $scope.doSearch();\\n };\\n\\n $scope.createPaging = function () {\\n const n = $scope.paging.totalPages;\\n\\n if (n <= 1) {\\n $scope.paging.pages = [];\\n } else {\\n const pages = new Array(n).fill().map((_, i) => {\\n return {\\n pageNumber: i + 1,\\n class: \\\"\\\",\\n index: i\\n };\\n }).map((page, index) => {\\n if (page.index === $scope.paging.index) {\\n page.class = \\\"c-search__paging__button--current\\\";\\n }\\n\\n if (index < $scope.paging.index - 2 || index > $scope.paging.index + 2) {\\n return undefined;\\n }\\n\\n return page;\\n }).filter(page => page);\\n console.log(pages);\\n $scope.paging.pages = pages;\\n }\\n };\\n\\n $scope.paginate = function (index) {\\n $scope.paging.index = index;\\n $scope.getSearchResults(true);\\n };\\n\\n $scope.doSearch = function () {\\n $scope.setUrl();\\n\\n if ($scope.searchStr.length > 0) {\\n $scope.getSearchResults();\\n } else {\\n $scope.inputClass = \\\"error\\\";\\n }\\n };\\n\\n $scope.setUrl = function () {\\n console.log($scope.searchStr);\\n $location.search(\\\"query\\\", $scope.searchStr);\\n };\\n}]);\\n\\nconst setIcon = tag => {\\n const iconRoot = '~/Frontend/Renewi/dist/svg/renewi.sprite.svg#';\\n\\n switch (tag) {\\n default:\\n return [{\\n backgroundColor: \\\"#78be20\\\"\\n }, `${iconRoot}report`];\\n }\\n};\"","module.exports = \"angular.module('upsell').controller('UpsellController', ['$rootScope', '$scope', '$timeout', 'GlobalService', function ($rootScope, $scope, $timeout, GlobalService) {\\n $scope.dataLayerEvent = {\\n 'event': 'upsell',\\n 'eventCategory': 'enhanced ecommerce',\\n 'eventAction': 'impressions',\\n 'eventLabel': 'upsell'\\n };\\n $scope.$on('BRANCH_UPDATE', function (event, data) {\\n if ($scope.sku) {\\n getUpsellPackage($scope.sku, data.BranchId, data.SubBranchId);\\n }\\n });\\n\\n $scope.initUpsell = function (data, googleAnalyticsListName) {\\n $scope.loading = false;\\n $scope.buttonLoader = false;\\n $scope.addedToCart = false;\\n $scope.sku = data.ProductSku;\\n $scope.errors = {};\\n $scope.upsellList = extendUpsellItems(data.ProductForms);\\n updateCustomUpsellList();\\n $rootScope.$emit('BANNER_UPDATE', data); // Handle Datalayer\\n\\n var products = $scope.upsellList.map(function (element) {\\n return element.Product;\\n });\\n $scope.googleAnalyticsListName = $scope.googleAnalyticsListName || googleAnalyticsListName;\\n $scope.handleDataLayer(products, $scope.googleAnalyticsListName, false, $scope.dataLayerEvent);\\n };\\n\\n $scope.toggleUpsellInclude = function (Item, boolean) {\\n if (typeof boolean == 'undefined') {\\n Item.Include = !Item.Include;\\n } else {\\n Item.Include = boolean;\\n }\\n\\n Item.editableForm.$visible = false;\\n updateCustomUpsellList();\\n };\\n\\n $scope.updateUpsellItemOptions = function ($data, frequency, placementDate, Item) {\\n Item.PlacementDate = placementDate;\\n Item.EmptyingFrequency = frequency;\\n Item.editableForm.$visible = false;\\n };\\n\\n $scope.submitUpsellRequest = function () {\\n var productForms = [];\\n\\n _.each($scope.CustomUpsellList, function (element, index) {\\n productForms.push({\\n FullyQualifiedType: element.FullyQualifiedType,\\n Sku: element.Product.SKU,\\n VariantSku: element.Product.Variants != null ? element.EmptyingFrequency.SKU : null,\\n Quantity: 1,\\n PlacementDate: element.PlacementDate,\\n Product: {\\n Type: element.Product.Type\\n }\\n });\\n });\\n\\n var data = {\\n scController: 'Cart',\\n scAction: 'AddProductsToCart',\\n productForms: productForms\\n };\\n $scope.buttonLoader = true;\\n $scope.addedToCart = false;\\n GlobalService.postData(data).success(function (data) {\\n $scope.addedQuantity = productForms.length;\\n $scope.addedToCart = true;\\n $scope.buttonLoader = false;\\n $scope.updateMiniCart(); // Handle Datalayer\\n\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n }).error(function (data) {\\n appendErrorsToProductsAndOpenEditMode(data.validationData);\\n $scope.errors = data;\\n $scope.buttonLoader = false;\\n $scope.addedToCart = false;\\n console.error(data);\\n });\\n };\\n\\n $scope.isAddToCartButtonDisabled = function () {\\n return _.any($scope.upsellList, function (Item) {\\n if (Item.editableForm !== undefined) return Item.editableForm.$visible !== false ? true : false;\\n return false;\\n });\\n };\\n\\n $scope.updateMiniCart = function () {\\n $rootScope.$broadcast('MINICART_UPDATE', '');\\n };\\n\\n function appendErrorsToProductsAndOpenEditMode(errors) {\\n _.each($scope.upsellList, function (Item, index) {\\n var error = _.find(errors, function (validationData) {\\n return validationData[\\\"Sku\\\"] == Item.Product.SKU;\\n });\\n\\n if (error) {\\n Item.error = error;\\n Item.editableForm.$visible = true;\\n }\\n });\\n }\\n\\n function updateCustomUpsellList() {\\n var CustomUpsellList = _.filter($scope.upsellList, function (Item) {\\n return Item.Include !== false;\\n });\\n\\n $scope.CustomUpsellList = CustomUpsellList;\\n } // Extend UpsellDataArray\\n\\n\\n function extendUpsellItems(productForms) {\\n _.each(productForms, function (productForm, index) {\\n productForm.Include = true;\\n productForm.PlacementDate = moment(productForm.PlacementDate).format('DD-MM-YYYY');\\n\\n if (productForm.VariantSku) {\\n var EmptyingFrequency = _.filter(productForm.Product.Variants, function (Variant) {\\n return Variant.SKU === productForm.VariantSku;\\n });\\n\\n productForm.EmptyingFrequency = EmptyingFrequency[0];\\n } // If EmptyingFrequency is not set, pick first\\n else if (productForm.Product.Variants != null && productForm.EmptyingFrequency == undefined) {\\n productForm.EmptyingFrequency = productForm.Product.Variants[0];\\n }\\n });\\n\\n return productForms;\\n }\\n\\n function getUpsellPackage(sku, branchId, subBranchId) {\\n $scope.loading = true;\\n var data = {\\n scController: 'Upsell',\\n scAction: 'GetUpsellPackage',\\n Sku: sku,\\n BranchId: branchId,\\n SubbranchId: subBranchId\\n };\\n $scope.buttonLoader = true;\\n GlobalService.getData(data).success(function (data) {\\n // Empty current upsellList so forms get reinitialized\\n $scope.upsellList = [];\\n $scope.initUpsell(data);\\n $scope.buttonLoader = false;\\n }).error(function (data) {\\n console.error(data);\\n });\\n }\\n}]);\"","module.exports = \"angular.module('wizard').controller('WizardController', ['$scope', '$element', 'ChartService', 'GlobalService', function ($scope, $element, ChartService, GlobalService) {\\n var wizard = this,\\n wizUserData = JSON.parse(localStorage.getItem('wizUserData')) || {},\\n UnitVolume,\\n AmountOptions = {\\n Rol: {\\n Name: 'zakken',\\n IconUrl: '/Frontend/Renewi/dist/img/icons/garbagebag.svg',\\n Unit: {\\n Name: 'Liters',\\n Volume: 'Liter'\\n },\\n Type: 'Bags',\\n Frequency: 'week'\\n },\\n Afzet: {\\n Name: 'aanhangwagens',\\n IconUrl: '/Frontend/Renewi/dist/img/icons/trailer.svg',\\n Unit: {\\n Name: 'CubicMeters',\\n Volume: 'm³'\\n },\\n Type: 'Trailers',\\n Frequency: 'once'\\n }\\n };\\n $scope.steps = [{\\n id: '#step1',\\n active: true\\n }, {\\n id: '#step2',\\n active: false\\n }, {\\n id: '#step3',\\n active: false\\n }, {\\n id: '#step4',\\n active: false\\n }, {\\n id: '#step5',\\n active: false\\n }, {\\n id: '#stapContact',\\n actief: false\\n }, {\\n id: '#stapOffer',\\n actief: false\\n }];\\n $scope.Branches = {};\\n $scope.SelectedStreams = [];\\n $scope.buttonLoader = false;\\n $scope.dataLayerEvent = {\\n 'event': 'wizard',\\n 'eventCategory': 'enhanced ecommerce',\\n 'eventAction': 'impressions',\\n 'eventLabel': 'wizard'\\n };\\n /** -- Branches ----------------------------- **/\\n\\n $scope.initWizardBranches = function (data) {\\n // Add 'Branches' object if it doesnt exist\\n if (typeof wizUserData.Branches === 'undefined') {\\n wizUserData.Branches = {\\n Branche: null,\\n SubBranche: null\\n };\\n }\\n\\n $scope.Branches.Branche = data.Branches;\\n $scope.Branches.SubBranche = data.SubBranches;\\n $scope.Branches.SelectedBranche = wizUserData.Branches.Branche;\\n $scope.Branches.SelectedSubBranche = wizUserData.Branches.SubBranche;\\n $scope.$watchGroup(['Branches.SelectedBranche', 'Branches.SelectedSubBranche'], $scope.updateBranches);\\n };\\n\\n $scope.updateSelect = function () {};\\n\\n $scope.updateBranches = function () {\\n // Set wizUserData branches based on selected branche/sub-branche\\n wizUserData.Branches.Branche = $scope.Branches.SelectedBranche;\\n wizUserData.Branches.SubBranche = $scope.Branches.SelectedSubBranche;\\n $scope.updateUserData(); // Update wizUserData\\n\\n $scope.steps[1].active = false;\\n $scope.steps[2].active = false;\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false;\\n $scope.steps[6].active = false;\\n };\\n /** -- Branches ----------------------------- **/\\n\\n /** -- WasteStreams ----------------------------- **/\\n\\n\\n $scope.getWasteStreams = function () {\\n var data = {\\n scController: 'DecisionAid',\\n scAction: 'GetWasteStreams',\\n BranchId: $scope.Branches.SelectedBranche.Value,\\n SubbranchId: $scope.Branches.SelectedSubBranche.Value,\\n ItemId: $scope.guid\\n };\\n $scope.buttonLoader = true;\\n GlobalService.getData(data).success(function (data) {\\n $scope.steps[1].active = data.WasteStreams ? true : false;\\n $scope.steps[5].active = data.EnableDirectContact ? true : false;\\n\\n if (data.WasteStreams) {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/' + document.location.search)\\n });\\n } else {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/contact-voor-advies/' + document.location.search)\\n });\\n }\\n\\n $scope.wasteStreams = data.WasteStreams; // Extend wasteStreams\\n\\n _.each($scope.wasteStreams, function (Stream, index) {\\n _.extend(Stream, {\\n Amount: {\\n Frequency: AmountOptions[Stream.ContainerType].Frequency,\\n Liters: 0,\\n CubicMeters: 0,\\n Value: '',\\n Name: AmountOptions[Stream.ContainerType].Name,\\n Type: AmountOptions[Stream.ContainerType].Type,\\n IconUrl: AmountOptions[Stream.ContainerType].IconUrl,\\n Unit: {\\n Name: AmountOptions[Stream.ContainerType].Unit.Name,\\n Volume: AmountOptions[Stream.ContainerType].Unit.Volume\\n }\\n }\\n });\\n\\n Stream.Selected = Stream.PreSelect;\\n }); // Set selected streams based on pre-selected waste streams\\n\\n\\n $scope.SelectedStreams = _.filter(data.WasteStreams, function (stream) {\\n return stream.PreSelect !== false;\\n }); // Set waste streams savings chart\\n\\n if ($scope.SelectedStreams.length) getSavings();\\n if (data.WasteStreams) GlobalService.scrollTo($scope.steps[1].id);\\n if (data.EnableDirectContact) GlobalService.scrollTo($scope.steps[5].id);\\n $scope.buttonLoader = false;\\n }).error(function (e) {\\n console.info(e);\\n });\\n }; // change the state of the waste stream\\n\\n\\n $scope.selectWasteStream = function (stream) {\\n $scope.steps[2].active = false;\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false;\\n $scope.steps[6].active = false; //Toggle selected state\\n\\n stream.Selected = stream.Selected ? false : true; // Set selected streams based on pre-selected waste streams\\n\\n $scope.SelectedStreams = _.filter($scope.wasteStreams, function (stream) {\\n return stream.Selected !== false;\\n });\\n getSavings(); // Update stream chart\\n }; // Sync scope selected streams with previously selected (localStorage) choises\\n\\n\\n $scope.$watch('SelectedStreams', function (SelectedStreams) {\\n // Set wizUserData selected streams\\n wizUserData.SelectedStreams = $scope.SelectedStreams;\\n $scope.updateUserData(); // Update wizUserData\\n\\n if (!$scope.SelectedStreams.length) {\\n $scope.steps[2].active = false;\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n } else {\\n $scope.steps[5].active = false;\\n }\\n }, true); // create a default waste streams chart\\n\\n $scope.wasteStreamsChart = ChartService.create({\\n percent: 0,\\n step: 0,\\n options: {\\n gradientBeginColor: '#0161AE',\\n gradientEndColor: '#39BB5D',\\n textColor: '#0161AE',\\n size: 180,\\n lineWidth: 10\\n }\\n });\\n\\n function getSavings() {\\n var data = {\\n scController: 'DecisionAid',\\n scAction: 'GetSavings',\\n BranchId: $scope.Branches.SelectedBranche.Value,\\n SubbranchId: $scope.Branches.SelectedSubBranche.Value,\\n WasteStreams: _.pluck($scope.SelectedStreams, 'Value'),\\n ItemId: $scope.guid\\n };\\n GlobalService.getData(data).success(function (data) {\\n $scope.wasteStreamsChart.percent = data.RawMaterialSavings;\\n }).error(function (e) {\\n console.info(e);\\n });\\n }\\n\\n $scope.moreInfo = function (e, stream) {\\n e.preventDefault();\\n lightcase.start({\\n href: '#',\\n onFinish: {\\n baz: function () {\\n // dummycontent, change to description in stream info\\n var content = \\\"\\\" + stream.Description + \\\"
\\\";\\n $('.lightcase-inlineWrap').html(content);\\n lightcase.resize();\\n }\\n }\\n });\\n };\\n /** -- WasteStreams ----------------------------- **/\\n\\n /** -- Amount ----------------------------- **/\\n\\n\\n $scope.initAmountPanel = function () {\\n if ($scope.SelectedStreams.length) {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/hoeveelheid/' + document.location.search)\\n });\\n } else {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/contact-voor-advies/' + document.location.search)\\n });\\n }\\n\\n $scope.steps[2].active = $scope.SelectedStreams.length ? true : false;\\n $scope.steps[5].active = $scope.SelectedStreams.length ? false : true;\\n GlobalService.scrollTo($scope.SelectedStreams.length ? $scope.steps[2].id : $scope.steps[5].id);\\n };\\n\\n $scope.changeStreamAmountFrequency = function (stream, frequency) {\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false;\\n stream.Amount.Frequency = frequency;\\n };\\n\\n function round(value, precision) {\\n var multiplier = Math.pow(10, precision || 0);\\n return Math.round(value * multiplier) / multiplier;\\n }\\n\\n $scope.changeStreamAmount = function (stream) {\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false; // first we determine the weight per bag\\n\\n var liter = stream.Amount.Value * UnitVolume[stream.Amount.Type],\\n cubic = liter / 1000;\\n stream.Amount.Liters = round(liter);\\n stream.Amount.CubicMeters = round(cubic, 1);\\n };\\n /** -- Amount ----------------------------- **/\\n\\n /** -- ExtraChoices ----------------------------- **/\\n\\n\\n $scope.initExtraChoices = function () {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/wensen/' + document.location.search)\\n });\\n $scope.steps[3].active = true;\\n GlobalService.scrollTo($scope.steps[3].id);\\n }; // Sync scope extra choices with previously selected (localStorage) choices\\n\\n\\n $scope.ExtraChoices = wizUserData.ExtraChoices || {\\n ThroughDoor: false,\\n OnParkingSpot: false\\n };\\n $scope.$watch('ExtraChoices', function (ExtraChoices) {\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false;\\n $scope.steps[6].active = false;\\n wizUserData.ExtraChoices = ExtraChoices;\\n $scope.updateUserData();\\n }, true);\\n /** -- ExtraChoices ----------------------------- **/\\n\\n /** -- Advice ----------------------------- **/\\n\\n $scope.adviceList = [];\\n\\n $scope.initAdvicePanel = function () {\\n var WasteStreams = {};\\n\\n _.each($scope.SelectedStreams, function (element, index) {\\n var tmpObject = [];\\n tmpObject[element.Value] = {\\n Volume: element.Amount.Liters,\\n Interval: element.Amount.Frequency\\n };\\n\\n _.extend(WasteStreams, tmpObject);\\n });\\n\\n var data = {\\n scController: 'DecisionAid',\\n scAction: 'GetAdvice',\\n BranchId: $scope.Branches.SelectedBranche.Value,\\n SubbranchId: $scope.Branches.SelectedSubBranche.Value,\\n ItemId: $scope.guid,\\n WasteStreams: WasteStreams,\\n Specials: $scope.ExtraChoices\\n };\\n $scope.buttonLoader = true;\\n GlobalService.getData(data).success(function (data) {\\n if (data.EnableDirectContact) {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/contact-voor-advies/' + document.location.search)\\n });\\n $scope.steps[5].active = true;\\n GlobalService.scrollTo($scope.steps[5].id);\\n } else if (data.length) {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/advies/' + document.location.search)\\n });\\n $scope.steps[4].active = true;\\n $scope.steps[6].active = true;\\n $scope.adviceList = data; // Extend adviceList\\n\\n _.each($scope.adviceList, function (Advice, index) {\\n Advice.Include = true;\\n Advice.IsValidPickupDate = true;\\n\\n if (Advice.VariantSku) {\\n var Ledegingsfrequentie = _.filter(Advice.Product.Variants, function (Variant) {\\n return Variant.SKU == Advice.VariantSku;\\n });\\n\\n Advice.Ledegingsfrequentie = Ledegingsfrequentie[0];\\n }\\n });\\n\\n $scope.getWasteProfile(WasteStreams);\\n GlobalService.scrollTo($scope.steps[4].id);\\n }\\n\\n $scope.buttonLoader = false; // Handle Datalayer\\n\\n var products = data.map(function (product) {\\n return product.Product;\\n });\\n $scope.handleDataLayer(products, $scope.googleAnalyticsListName, false, $scope.dataLayerEvent);\\n }).error(function (e) {\\n console.info(e);\\n });\\n };\\n\\n $scope.getWasteProfile = function (WasteStreams) {\\n var data = {\\n scController: 'DecisionAid',\\n scAction: 'GetWasteProfile',\\n BranchId: $scope.Branches.SelectedBranche.Value,\\n SubbranchId: $scope.Branches.SelectedSubBranche.Value,\\n ItemId: $scope.guid,\\n WasteStreams: WasteStreams\\n };\\n GlobalService.getData(data).success(function (data) {\\n $scope.WasteProfile = data;\\n google.charts.load(\\\"current\\\", {\\n packages: [\\\"corechart\\\"]\\n });\\n google.charts.setOnLoadCallback(drawChart);\\n\\n function drawChart() {\\n var data = google.visualization.arrayToDataTable([['Task', 'Hours per Day'], ['Grondstof', $scope.WasteProfile.RawMaterials], ['Groene energie', $scope.WasteProfile.GreenEnergy], ['Grijze energie', $scope.WasteProfile.GreyEnergy], ['Resudu', $scope.WasteProfile.Residu]]);\\n var options = {\\n legend: 'none',\\n enableInteractivity: false,\\n pieHole: 0.88,\\n tooltip: {\\n trigger: 'none'\\n },\\n pieSliceText: 'none',\\n chartArea: {\\n left: 0,\\n top: 0,\\n width: '100%',\\n height: '100%'\\n },\\n slices: {\\n 0: {\\n color: '#0161AE'\\n },\\n 1: {\\n color: '#39BB5D'\\n },\\n 2: {\\n color: '#E0E2E4'\\n },\\n 3: {\\n color: '#1FBBEF'\\n }\\n }\\n };\\n var chart = new google.visualization.PieChart(document.getElementById('js-wizard-profile-chart'));\\n chart.draw(data, options);\\n }\\n }).error(function (e) {\\n console.info(e);\\n });\\n };\\n\\n $scope.toggleAdviceInclude = function (stream, boolean) {\\n stream.Include = boolean;\\n };\\n\\n $scope.$watch('adviceList', function () {\\n var CustomAdvice = _.filter($scope.adviceList, function (Advice) {\\n return Advice.Include !== false;\\n });\\n\\n $scope.CustomAdvice = CustomAdvice;\\n $scope.steps[5].active = $scope.CustomAdvice.length ? false : true;\\n $scope.steps[6].active = $scope.CustomAdvice.length ? true : false;\\n }, true);\\n\\n $scope.updateAdvice = function (data, placementDate, pickupDate, advice) {\\n var newPlacementDate = moment(placementDate, 'DD-MM-YYYY').format('YYYY-MM-DDTHH:mm:ssZ'),\\n newPickupDate = moment(pickupDate, 'DD-MM-YYYY').format('YYYY-MM-DDTHH:mm:ssZ');\\n\\n if (newPickupDate > newPlacementDate) {\\n advice.IsValidPickupDate = true;\\n if (pickupDate) advice.PickupDate = newPickupDate;\\n if (placementDate) advice.PlacementDate = newPlacementDate;\\n } else {\\n advice.IsValidPickupDate = false;\\n return 'Invalid Pickup Date';\\n }\\n };\\n /** -- Advice ----------------------------- **/\\n\\n /** -- OfferRequest ----------------------------- **/\\n\\n\\n $scope.submitOfferRequest = function (url) {\\n var Products = [];\\n\\n _.each($scope.CustomAdvice, function (element, index) {\\n Products[Products.length] = {\\n ProductSku: element.Product.SKU,\\n VariantSku: element.VariantSku,\\n Amount: element.Quantity,\\n PlacementDate: element.PlacementDate,\\n PickupDate: element.PickupDate\\n };\\n });\\n\\n var data = {\\n scController: 'DecisionAid',\\n scAction: 'GetQuote',\\n ItemId: $scope.guid,\\n Products: Products\\n };\\n $scope.buttonLoader = true;\\n GlobalService.getData(data).success(function (data) {\\n if (data.CartUpdated) {\\n window.location = url;\\n } else {\\n $scope.steps[5].active = true;\\n GlobalService.scrollTo($scope.steps[5].id);\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + '/' + GlobalService.toNiceName($scope.Branches.SelectedBranche.Name) + '/' + GlobalService.toNiceName($scope.Branches.SelectedSubBranche.Name) + '/contact-voor-advies/' + document.location.search)\\n });\\n }\\n\\n $scope.buttonLoader = false;\\n window.dataLayerHelpers.updateCart(data.ECommerceDataLayerModels);\\n }).error(function (e) {\\n console.info(e);\\n });\\n };\\n /** -- OfferRequest ----------------------------- **/\\n\\n /** -- Base ----------------------------- **/\\n\\n\\n $scope.updateUserData = function () {\\n if (window.localStorage) localStorage.setItem('wizUserData', JSON.stringify(wizUserData));\\n };\\n\\n $scope.init = function (guid, trashbagVolume, trailerVolume, translationBags, translationTrailers, googleAnalyticsListName) {\\n $scope.guid = guid;\\n UnitVolume = {\\n Bags: trashbagVolume ? parseFloat(trashbagVolume) : 40,\\n Trailers: trailerVolume ? parseFloat(trailerVolume) : 1600\\n };\\n $scope.googleAnalyticsListName = googleAnalyticsListName;\\n\\n if (window.location.hash === $scope.steps[1].id && wizUserData.Branches.SubBranche) {\\n $scope.Branches.SelectedBranche = wizUserData.Branches.Branche;\\n $scope.Branches.SelectedSubBranche = wizUserData.Branches.SubBranche;\\n $scope.getWasteStreams();\\n } else {\\n dataLayer.push({\\n 'event': 'virtualPageview',\\n 'virtualDocumentPath': GlobalService.toUrl(document.location.pathname + document.location.search)\\n });\\n }\\n };\\n\\n $scope.startWizard = function () {\\n $scope.getWasteStreams();\\n $scope.steps[1].active = false;\\n $scope.steps[2].active = false;\\n $scope.steps[3].active = false;\\n $scope.steps[4].active = false;\\n $scope.steps[5].active = false;\\n $scope.steps[6].active = false;\\n };\\n\\n $scope.startWizardChat = function ($event, msg) {\\n $event.preventDefault();\\n\\n if (typeof $zopim !== 'undefined') {\\n var chatNotes = '';\\n $zopim.livechat.say(msg);\\n chatNotes += 'Branche: ' + $scope.Branches.SelectedBranche.Name + '\\\\n';\\n chatNotes += 'Sub-branche: ' + $scope.Branches.SelectedSubBranche.Name + '\\\\n';\\n chatNotes += '\\\\n';\\n if (!_.isEmpty($scope.SelectedStreams)) chatNotes += 'Selected stream: \\\\n';\\n\\n _.each($scope.SelectedStreams, function (Stream, index) {\\n chatNotes += Stream.Name + '\\\\n';\\n chatNotes += Stream.Amount[Stream.Amount.Unit.Name] + ' ' + Stream.Amount.Unit.Name + '\\\\n';\\n chatNotes += Stream.Amount.Frequency + '\\\\n\\\\n';\\n });\\n\\n if ($scope.ExtraChoices.ThroughDoor || $scope.ExtraChoices.OnParkingSpot) chatNotes += 'Extra choise: \\\\n';\\n if ($scope.ExtraChoices.ThroughDoor) chatNotes += document.getElementById('fit_through_door').dataset.zopimNote + '\\\\n';\\n if ($scope.ExtraChoices.OnParkingSpot) chatNotes += document.getElementById('parking_space').dataset.zopimNote + '\\\\n';\\n $zopim.livechat.setNotes(chatNotes);\\n }\\n };\\n /** -- Base ----------------------------- **/\\n\\n}]);\"","module.exports = \"angular.module(\\\"zipcode\\\").controller(\\\"zipcodeController\\\", [\\\"$rootScope\\\", \\\"$scope\\\", \\\"$sessionStorage\\\", \\\"$cookies\\\", function ($rootScope, $scope, $sessionStorage, $cookies) {\\n $scope.initZipcode = function (zipCode) {\\n $scope.zipCode = zipCode;\\n $scope.value = zipCode || $scope.postalPlaceholder;\\n };\\n\\n $scope.openPopup = function () {\\n const event = new CustomEvent('openZipCodePopup', {\\n detail: $scope.value !== $scope.placeholder ? $scope.value : null\\n });\\n window.dispatchEvent(event);\\n };\\n}]);\"","module.exports = \"angular.module('shopApp').directive('addToCartButton', function () {\\n return {\\n restrict: 'AE',\\n template: '',\\n scope: {\\n translation: '=',\\n // translate for default state\\n translationadded: '=',\\n // translate when submitted (green button)\\n isLoading: '=',\\n // true when loading (loader button)\\n isSubmitted: '=',\\n // true when submitted (green button)\\n addedQuantity: '='\\n },\\n link: function ($scope, element, attrs) {}\\n };\\n});\"","module.exports = \"// global language\\nvar translations = {\\n nl: {\\n month: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],\\n day: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],\\n format: 'dd-mm-jjjj',\\n formatDatepicker: 'd-m-Y'\\n },\\n en: {\\n month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\\n day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\\n format: 'mm-dd-yyyy',\\n formatDatepicker: 'm-d-Y'\\n },\\n fr: {\\n month: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Julliet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],\\n day: ['Dimanche', 'Lundi', 'Mardi', 'Mecredi', 'Jeudi', 'Vendredi', 'Samedi'],\\n format: 'jj-mm-aaaa',\\n formatDatepicker: 'd-m-Y'\\n }\\n};\\n\\nvar setDatePicker = function (disabledDates, element, scope, ngModel) {\\n var currentLang = $('html').attr('lang') ? $('html').attr('lang') : 'en';\\n\\n if (disabledDates === null || disabledDates === undefined) {\\n disabledDates = [];\\n } //Add sunday to the disabled dates\\n\\n\\n disabledDates.push(\\\"* * * 0\\\");\\n var zebraOptions = {\\n first_day_of_week: 1,\\n direction: true,\\n show_select_today: false,\\n show_icon: false,\\n show_clear_date: false,\\n select_other_months: true,\\n disabled_dates: disabledDates,\\n container: element.closest('.c-input-date'),\\n format: translations[currentLang].formatDatepicker,\\n months: translations[currentLang].month,\\n days: translations[currentLang].day,\\n onOpen: function () {\\n $(this).prop('disabled', true);\\n },\\n onClose: function () {\\n $(this).prop('disabled', false);\\n },\\n onSelect: function (dateText) {\\n scope.$apply(function () {\\n ngModel.$setViewValue(dateText);\\n }); // Trigger on change event\\n\\n $(this).change();\\n }\\n }; //// Dynamic placementDate - Sitecore setting\\n\\n if ($(element).attr('ng-model') === 'placementDate') {\\n // Pair pickupDate with placementDate\\n zebraOptions.pair = $('input[ng-model=pickupDate]');\\n zebraOptions.direction = [true, $(element).attr('maxdaysfromnow')];\\n\\n if ($(element).attr('maxdaysfromnow') === '0') {\\n zebraOptions.direction = 1;\\n }\\n } // Dynamic pickupDate relative to placementDate - Sitecore setting\\n\\n\\n if ($(element).attr('ng-model') === 'pickupDate') {\\n zebraOptions.direction = [$(element).attr('mindaysfromplacementdate'), $(element).attr('maxdaysfromplacementdate') - 1];\\n\\n if ($(element).attr('maxdaysfromplacementdate') === '0') {\\n zebraOptions.direction = 1;\\n }\\n }\\n\\n element.Zebra_DatePicker(zebraOptions);\\n};\\n\\nangular.module('shopApp').directive('datepicker', function () {\\n return {\\n require: 'ngModel',\\n link: function (scope, el, attr, ngModel) {\\n var sku = $('input[id=sku]').val() ? $('input[id=sku]').val() : scope.SKU;\\n $.post(window.location, {\\n scController: 'Cart',\\n scAction: 'GetNonDeliveryDates',\\n sku: sku\\n }).error(function () {\\n setDatePicker(null, $(el), scope, ngModel);\\n }).done(function (data) {\\n setDatePicker(data, $(el), scope, ngModel);\\n });\\n }\\n };\\n});\"","module.exports = \"/**\\r\\n * BEWARE This directive is a custom edited version of https://github.com/rendro/easy-pie-chart\\r\\n * So DON'T just update this directive without the proper checks\\r\\n */\\nangular.module('wizard').directive('easypiechart', function () {\\n return {\\n restrict: 'AE',\\n require: '?ngModel',\\n scope: {\\n percent: '=',\\n options: '='\\n },\\n link: function (scope, element, attrs) {\\n scope.percent = scope.percent || 0;\\n /**\\r\\n * default easy pie chart options\\r\\n * @type {Object}\\r\\n */\\n\\n var options = {\\n barColor: '#ef1e25',\\n trackColor: '#f9f9f9',\\n scaleColor: '#dfe0e0',\\n scaleLength: 5,\\n lineCap: 'round',\\n lineWidth: 3,\\n size: 110,\\n rotate: 0,\\n animate: {\\n duration: 1000,\\n enabled: true\\n }\\n };\\n scope.options = angular.extend(options, scope.options);\\n var pieChart = new EasyPieChart(element[0], options);\\n scope.$watch('percent', function (newVal, oldVal) {\\n pieChart.update(newVal);\\n });\\n }\\n };\\n});\\n/**\\r\\n * Renderer to render the chart on a canvas object\\r\\n * @param {DOMElement} el DOM element to host the canvas (root of the plugin)\\r\\n * @param {object} options options object of the plugin\\r\\n */\\n\\nvar CanvasRenderer = function (el, options) {\\n var cachedBackground;\\n var canvas = document.createElement('canvas');\\n el.appendChild(canvas);\\n\\n if (typeof G_vmlCanvasManager === 'object') {\\n G_vmlCanvasManager.initElement(canvas);\\n }\\n\\n var ctx = canvas.getContext('2d');\\n canvas.width = canvas.height = options.size; // canvas on retina devices\\n\\n var scaleBy = 1;\\n\\n if (window.devicePixelRatio > 1) {\\n scaleBy = window.devicePixelRatio;\\n canvas.style.width = canvas.style.height = [options.size, 'px'].join('');\\n canvas.width = canvas.height = options.size * scaleBy;\\n ctx.scale(scaleBy, scaleBy);\\n } // move 0,0 coordinates to the center\\n\\n\\n ctx.translate(options.size / 2, options.size / 2); // rotate canvas -90deg\\n\\n ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI);\\n var radius = (options.size - options.lineWidth) / 2;\\n\\n if (options.scaleColor && options.scaleLength) {\\n radius -= options.scaleLength + 2; // 2 is the distance between scale and bar\\n } // IE polyfill for Date\\n\\n\\n Date.now = Date.now || function () {\\n return +new Date();\\n };\\n /**\\r\\n * Draw a circle around the center of the canvas\\r\\n * @param {strong} color Valid CSS color string\\r\\n * @param {number} lineWidth Width of the line in px\\r\\n * @param {number} percent Percentage to draw (float between -1 and 1)\\r\\n */\\n\\n\\n var drawCircle = function (color, lineWidth, percent) {\\n percent = Math.min(Math.max(-1, percent || 0), 1);\\n var isNegative = percent <= 0 ? true : false;\\n ctx.beginPath();\\n ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative);\\n ctx.strokeStyle = color;\\n ctx.lineWidth = lineWidth;\\n ctx.stroke();\\n };\\n /**\\r\\n * Draw the scale of the chart\\r\\n */\\n\\n\\n var drawScale = function () {\\n var offset;\\n var length;\\n ctx.lineWidth = 1;\\n ctx.fillStyle = options.scaleColor;\\n ctx.save();\\n\\n for (var i = 24; i > 0; --i) {\\n if (i % 6 === 0) {\\n length = options.scaleLength;\\n offset = 0;\\n } else {\\n length = options.scaleLength * 0.6;\\n offset = options.scaleLength - length;\\n }\\n\\n ctx.fillRect(-options.size / 2 + offset, 0, length, 1);\\n ctx.rotate(Math.PI / 12);\\n }\\n\\n ctx.restore();\\n };\\n /**\\r\\n * Request animation frame wrapper with polyfill\\r\\n * @return {function} Request animation frame method or timeout fallback\\r\\n */\\n\\n\\n var reqAnimationFrame = function () {\\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) {\\n window.setTimeout(callback, 1000 / 60);\\n };\\n }();\\n /**\\r\\n * Draw the background of the plugin including the scale and the track\\r\\n */\\n\\n\\n var drawBackground = function () {\\n if (options.scaleColor) drawScale();\\n if (options.trackColor) drawCircle(options.trackColor, options.trackWidth || options.lineWidth, 1);\\n };\\n /**\\r\\n * Canvas accessor\\r\\n */\\n\\n\\n this.getCanvas = function () {\\n return canvas;\\n };\\n /**\\r\\n * Canvas 2D context 'ctx' accessor\\r\\n */\\n\\n\\n this.getCtx = function () {\\n return ctx;\\n };\\n /**\\r\\n * Clear the complete canvas\\r\\n */\\n\\n\\n this.clear = function () {\\n ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size);\\n };\\n /**\\r\\n * Draw the complete chart\\r\\n * @param {number} percent Percent shown by the chart between -100 and 100\\r\\n */\\n\\n\\n this.draw = function (percent) {\\n // do we need to render a background\\n if (!!options.scaleColor || !!options.trackColor) {\\n // getImageData and putImageData are supported\\n if (ctx.getImageData && ctx.putImageData) {\\n if (!cachedBackground) {\\n drawBackground();\\n cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy);\\n } else {\\n ctx.putImageData(cachedBackground, 0, 0);\\n }\\n } else {\\n this.clear();\\n drawBackground();\\n }\\n } else {\\n this.clear();\\n }\\n\\n ctx.lineCap = options.lineCap; // if barcolor is a function execute it and pass the percent as a value\\n\\n var color;\\n\\n if (typeof options.barColor === 'function') {\\n color = options.barColor(percent);\\n } else {\\n color = options.barColor;\\n } // draw bar\\n\\n\\n drawCircle(color, options.lineWidth, percent / 100);\\n }.bind(this);\\n /**\\r\\n * Animate from some percent to some other percentage\\r\\n * @param {number} from Starting percentage\\r\\n * @param {number} to Final percentage\\r\\n */\\n\\n\\n this.animate = function (from, to) {\\n var startTime = Date.now();\\n options.onStart(from, to);\\n\\n var animation = function () {\\n var process = Math.min(Date.now() - startTime, options.animate.duration);\\n var currentValue = options.easing(this, process, from, to - from, options.animate.duration);\\n this.draw(currentValue);\\n options.onStep(from, to, currentValue);\\n\\n if (process >= options.animate.duration) {\\n options.onStop(from, to);\\n } else {\\n reqAnimationFrame(animation);\\n }\\n }.bind(this);\\n\\n reqAnimationFrame(animation);\\n }.bind(this);\\n};\\n\\nvar EasyPieChart = function (el, opts) {\\n var defaultOptions = {\\n barColor: '#ef1e25',\\n trackColor: '#f9f9f9',\\n scaleColor: '#dfe0e0',\\n scaleLength: 5,\\n lineCap: 'round',\\n lineWidth: 3,\\n trackWidth: undefined,\\n size: 110,\\n rotate: 0,\\n animate: {\\n duration: 1000,\\n enabled: true\\n },\\n easing: function (x, t, b, c, d) {\\n // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/\\n t = t / (d / 2);\\n\\n if (t < 1) {\\n return c / 2 * t * t + b;\\n }\\n\\n return -c / 2 * (--t * (t - 2) - 1) + b;\\n },\\n onStart: function (from, to) {\\n return;\\n },\\n onStep: function (from, to, currentValue) {\\n return;\\n },\\n onStop: function (from, to) {\\n return;\\n }\\n }; // detect present renderer\\n\\n if (typeof CanvasRenderer !== 'undefined') {\\n defaultOptions.renderer = CanvasRenderer;\\n } else if (typeof SVGRenderer !== 'undefined') {\\n defaultOptions.renderer = SVGRenderer;\\n } else {\\n throw new Error('Please load either the SVG- or the CanvasRenderer');\\n }\\n\\n var options = {};\\n var currentValue = 0;\\n /**\\r\\n * Initialize the plugin by creating the options object and initialize rendering\\r\\n */\\n\\n var init = function () {\\n this.el = el;\\n this.options = options; // merge user options into default options\\n\\n for (var i in defaultOptions) {\\n if (defaultOptions.hasOwnProperty(i)) {\\n options[i] = opts && typeof opts[i] !== 'undefined' ? opts[i] : defaultOptions[i];\\n\\n if (typeof options[i] === 'function') {\\n options[i] = options[i].bind(this);\\n }\\n }\\n } // check for jQuery easing\\n\\n\\n if (typeof options.easing === 'string' && typeof jQuery !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) {\\n options.easing = jQuery.easing[options.easing];\\n } else {\\n options.easing = defaultOptions.easing;\\n } // process earlier animate option to avoid bc breaks\\n\\n\\n if (typeof options.animate === 'number') {\\n options.animate = {\\n duration: options.animate,\\n enabled: true\\n };\\n }\\n\\n if (typeof options.animate === 'boolean' && !options.animate) {\\n options.animate = {\\n duration: 1000,\\n enabled: options.animate\\n };\\n } // create renderer\\n\\n\\n this.renderer = new options.renderer(el, options); // initial draw\\n\\n this.renderer.draw(currentValue); // initial update\\n\\n if (el.dataset && el.dataset.percent) {\\n this.update(parseFloat(el.dataset.percent));\\n } else if (el.getAttribute && el.getAttribute('data-percent')) {\\n this.update(parseFloat(el.getAttribute('data-percent')));\\n }\\n }.bind(this);\\n /**\\r\\n * Update the value of the chart\\r\\n * @param {number} newValue Number between 0 and 100\\r\\n * @return {object} Instance of the plugin for method chaining\\r\\n */\\n\\n\\n this.update = function (newValue) {\\n newValue = parseFloat(newValue);\\n\\n if (options.animate.enabled) {\\n this.renderer.animate(currentValue, newValue);\\n } else {\\n this.renderer.draw(newValue);\\n }\\n\\n currentValue = newValue;\\n return this;\\n }.bind(this);\\n /**\\r\\n * Disable animation\\r\\n * @return {object} Instance of the plugin for method chaining\\r\\n */\\n\\n\\n this.disableAnimation = function () {\\n options.animate.enabled = false;\\n return this;\\n };\\n /**\\r\\n * Enable animation\\r\\n * @return {object} Instance of the plugin for method chaining\\r\\n */\\n\\n\\n this.enableAnimation = function () {\\n options.animate.enabled = true;\\n return this;\\n };\\n\\n init();\\n};\"","module.exports = \"angular.module('shopApp').directive('fallbackSrc', function () {\\n var fallbackSrc = {\\n link: function postLink(scope, iElement, iAttrs) {\\n iElement.bind('error', function () {\\n angular.element(this).attr(\\\"src\\\", iAttrs.fallbackSrc);\\n });\\n }\\n };\\n return fallbackSrc;\\n});\"","module.exports = \"angular.module('shopApp').directive('lightbox', function () {\\n return {\\n link: function (scope, el, attr, ngModel) {\\n el.lightcase({\\n functionBefore: function (origin, continueTooltip) {\\n origin.tooltipster('content', origin.children('.js-tooltip-content').html());\\n continueTooltip();\\n },\\n interactive: 'true',\\n animation: 'fade',\\n delay: 200,\\n theme: 'tooltipster-shadow',\\n contentAsHTML: true,\\n touchDevices: false,\\n trigger: 'hover'\\n });\\n }\\n };\\n});\"","module.exports = \"angular.module('shopApp').directive('quantityInput', function () {\\n return {\\n restrict: 'AE',\\n template: `\\nPlease click on an element
\\r\\n \\r\\n {{ record.title }}\\r\\n \\r\\n'+R.settings.header_navigation[0]+' | '+R.settings.header_navigation[1]+' |
\\\"+L+' | \\\"+R.settings.lang_clear_date+\\\" |