1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10(function (global) { 11 12 function b64DecodeUnicode(str) { 13 // Convert base64 to a string 14 const binaryString = atob(str); 15 16 // Convert binary string to a byte array 17 const byteArray = new Uint8Array(binaryString.length); 18 for (var i = 0; i < binaryString.length; i++) { 19 byteArray[i] = binaryString.charCodeAt(i); 20 } 21 // Convert byte array to a string 22 const decoder = new TextDecoder('utf-8'); 23 return decoder.decode(byteArray); 24 } 25 26 global.insiteScripts = global.insiteScripts || {}; 27 global.insiteScripts.popup = 28 global.insiteScripts.popup || 29 function message(scriptOptions) { 30 const dmSmartScriptDuration = scriptOptions.duration, 31 dmSmartScriptSettings = scriptOptions.settings, 32 dmSmartScriptRuleId = scriptOptions.ruleId, 33 dmSmartScriptRuleType = scriptOptions.ruleType, 34 isForced = scriptOptions.isForced; 35 36 //popupName and settings are coming from BE 37 const shouldShowPopup = function (popupName, settings) { 38 const { 39 shouldCheckUserVisitsCondition, 40 shouldCheckDateTimeRangeCondition, 41 } = shouldShowActionRule(settings); 42 43 const cookieName = getSmartRuleCookieName( 44 popupName, 45 ActionType.POPUP 46 ); 47 48 if (shouldCheckUserVisitsCondition) { 49 return ( 50 isForced || 51 shouldShowRuleObjectForUserVisit( 52 popupName, 53 settings, 54 ActionType.POPUP 55 ) 56 ); 57 } 58 if (shouldCheckDateTimeRangeCondition) { 59 return ( 60 isForced || 61 shouldShowRuleObjectForDateTimeRange( 62 popupName, 63 settings, 64 ActionType.POPUP 65 ) 66 ); 67 } 68 return isForced || getCookie(cookieName) === null; 69 }; 70 71 // If insite configured to show a popup then we don't want to show it everytime, once every "popup.insite.cookie.ttl" hours. 72 const onOpenPopup = function (popupName, event) { 73 if (isForced || window.Parameters?.disableTracking) { 74 return; 75 } 76 setSmartRuleCookie(popupName, ActionType.POPUP); 77 }; 78 79 const applyPopUp = () => { 80 const settings = JSON.parse( 81 b64DecodeUnicode(dmSmartScriptSettings) 82 ); 83 const popupName = settings.popupName; 84 const delay = settings.delay; 85 86 const options = { 87 onOpen: onOpenPopup.bind(null, popupName), 88 additionalAttributes: [ 89 { 90 name: 'data-rule', 91 value: dmSmartScriptRuleId, 92 }, 93 { 94 name: 'data-rule-type', 95 value: dmSmartScriptRuleType, 96 }, 97 ], 98 }; 99 100 const canShowPopup = shouldShowPopup(popupName, settings); 101 102 if (popupName && canShowPopup) { 103 setTimeout(function () { 104 window?.waitForDeferred?.('dmAjax', () => { 105 $.dmrt.onLoad( 106 $.dmrt.components.popupService.displayPopup.bind( 107 null, 108 popupName, 109 options 110 ) 111 ); 112 if (window.dmsnowplow) { 113 dmsnowplow( 114 'trackStructEvent', 115 'insite', 116 'impression', 117 scriptOptions.ruleType, 118 scriptOptions.ruleId 119 ); 120 } 121 }); 122 123 }, (delay + dmSmartScriptDuration) * 1000); 124 } 125 }; 126 127 (function () { 128 applyPopUp(); 129 })(); 130 }; 131})(this); 132 133}
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.