1angular.module('AboShopApp').factory('marfeelManager', ['commonConfig', '$rootScope', '$location', 2 function (commonConfig, $rootScope, $location) { 3 const factory = {}; 4 let marfeelEnable = false; 5 6 factory.init = function init() { 7 if (commonConfig.marfeelTag && commonConfig.marfeelId != null) { 8 console.log("init marfeel"); 9 !function(){ 10 "use strict"; 11 function e(e){ 12 var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],c=document.createElement("script"); 13 c.src=e,t?c.type="module":(c.async=!0,c.type="text/javascript",c.setAttribute("nomodule","")); 14 var n=document.getElementsByTagName("script")[0]; 15 n.parentNode.insertBefore(c,n) 16 } 17 !function(t,c){ 18 !function(t,c,n){ 19 var a,o,r; 20 n.accountId=c,null!==(a=t.marfeel)&&void 0!==a||(t.marfeel={}),null!==(o=(r=t.marfeel).cmd)&&void 0!==o||(r.cmd=[]),t.marfeel.config=n; 21 var i="https://sdk.mrf.io/statics"; 22 e("".concat(i,"/marfeel-sdk.js?id=").concat(c),!0),e("".concat(i,"/marfeel-sdk.es5.js?id=").concat(c),!1) 23 }(t,c,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}) 24 }(window,commonConfig.marfeelId,{}) 25 }(); 26 marfeelEnable = true; 27 } 28 }; 29 30 const _push = function _push(fn) { 31 if (marfeelEnable) { 32 window.marfeel = window.marfeel || { cmd: [] }; 33 window.marfeel.cmd.push(['compass', fn]); 34 } 35 }; 36 37 factory.trackNewPage = function trackNewPage() { 38 _push(function (compass) { 39 compass.trackNewPage(); 40 }); 41 }; 42 43 factory.trackConversion = function trackConversion(data) { 44 _push(function (compass) { 45 compass.trackConversion(data); 46 }); 47 }; 48 49 factory.trackPaymentOK = function trackPaymentOK(order){ 50 if (order != null && order.livraison != null && order.lignes.length > 0) { 51 order.lignes.forEach(function (ligne) { 52 const produit = ligne.produit; 53 if (produit != null) { 54 let typeProduit; 55 if (produit.estUneFormule) { 56 typeProduit = 'Abonnement'; 57 } else if (produit.estUnArticleLibre) { 58 typeProduit = 'Achat'; 59 } 60 if (typeProduit != null) { 61 factory.trackConversion([typeProduit]); 62 } 63 } 64 }); 65 } 66 } 67 68 return factory; 69 } 70]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.