{"version":3,"sources":["../ts/t3europe/gdpr_consent.ts"],"names":["jquery_1","default","cookieName","cookieExpire","$consentBox","gdprCookies","js_cookie_1","withConverter","read","value","name","decodeURI","toString","write","encodeURI","setCookie","cookieData","i","mo2Val","push","expires","Date","cookieValue","setDate","getDate","join","set","domain","hostName","window","location","hostname","substring","lastIndexOf","path","refreshCookie","values","get","optOut","optOutData","split","length","e","toggle","on","script","preventDefault","ts","getTime","consent","c1","c2","c3","c4","c5","c6","c7","c8","c9","c10","c11","c12","c13","c14","c15","hide","indexOf","scripts","document","getElementsByTagName","createElement","type","async","src","parentNode","insertBefore"],"mappings":"oQAGAA,SAAAC,QAAG,KACF,MAAMC,WAAa,aACnBC,aAAe,GACfC,YAAcJ,SAAAC,QAAG,gBAAgB,EACjC,IAAII,YAAcC,YAAAL,QAAQM,cAAc,CACvCC,KAAM,SAAUC,MAAOC,MACtB,OAAOC,UAAUF,MAAMG,SAAQ,CAAE,CAClC,EACAC,MAAO,SAAUJ,MAAOC,MACvB,OAAOI,UAAUL,MAAMG,SAAQ,CAAE,CAClC,C,CACA,EAWD,SAASG,UAAUC,YAClB,IACQC,EADJC,OAAkB,GACtB,IAAQD,KAAKD,WACZE,OAAOC,KAAKF,EAAI,IAAMD,WAAWC,EAAE,EAEpC,IAAIG,QAAQ,IAAIC,KAEZC,aADJF,QAAQG,QAAQH,QAAQI,QAAO,EAAKrB,YAAY,EAC7Be,OAAOO,KAAK,GAAI,GACnCpB,YAAYqB,IAAKxB,WAAYoB,YAAa,CACzCK,QAbqBC,YAaCC,OAAOC,SAASC,UAZvBC,UAAUJ,YAASK,YAAY,IAAKL,YAASK,YAAY,GAAG,EAAI,CAAC,CAAC,EAajFb,QAAAA,QACAc,KAAM,G,CACN,CACF,CAEA,SAASC,gBACRpB,UAGD,WACC,IAAIqB,OAAO,GACX,IACC,IAAIpB,WAAcX,YAAYgC,IAAInC,UAAU,EAC5C,GAAGc,WAAW,CACb,IAAIC,EAAEqB,OAAOC,WAAW,W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ookieName = 'CONSENTMGR',\r\n\tcookieExpire = 60,\r\n\t$consentBox = $( '#tiGDPRecModal' );\r\n\tvar gdprCookies = cookies.withConverter({\r\n\t\tread: function (value, name) {\r\n\t\t\treturn decodeURI(value.toString());\r\n\t\t},\r\n\t\twrite: function (value, name) {\r\n\t\t\treturn encodeURI(value.toString());\r\n\t\t}\r\n\t});\r\n\r\n\tfunction setPreferencesValues() {\r\n\t\tvar cookieData={ts:new Date().getTime(),consent:true,c1:1,c2:1,c3:1,c4:1,c5:1,c6:1,c7:1,c8:1,c9:1,c10:1,c11:1,c12:1,c13:1,c14:1,c15:1};\r\n\t\tsetCookie(cookieData);\r\n\t}\r\n\r\n\tfunction getDomainName(hostName) {\r\n\t\treturn hostName.substring(hostName.lastIndexOf(\".\", hostName.lastIndexOf(\".\") - 1));\r\n\t}\r\n\r\n\tfunction setCookie(cookieData) {\r\n\t\tvar mo2Val: string[]= [];\r\n\t\tfor(var i in cookieData) {\r\n\t\t\tmo2Val.push(i + \":\" + cookieData[i]);\r\n\t\t}\r\n\t\tvar expires=new Date();\r\n\t\texpires.setDate(expires.getDate() + cookieExpire);\r\n\t\tvar cookieValue = (mo2Val.join(\"|\"));\r\n\t\tgdprCookies.set( cookieName, cookieValue, {\r\n\t\t\tdomain: getDomainName(window.location.hostname),\r\n\t\t\texpires,\r\n\t\t\tpath: '/'\r\n\t\t} );\r\n\t}\r\n\t\r\n\tfunction refreshCookie() {\r\n\t\tsetCookie(getGDPRCookieValues());\r\n\t}\r\n\t\r\n\tfunction getGDPRCookieValues() {\r\n\t\tvar values={}; \r\n\t\ttry{\r\n\t\t\tvar cookieData = gdprCookies.get(cookieName);\r\n\t\t\tif(cookieData){\r\n\t\t\t\tvar i,optOut,optOutData=(cookieData).split(\"|\");\r\n\t\t\t\tfor(i=0;i= 0) {\r\n\t\t\t\tvar scripts = document.getElementsByTagName(\"script\")[0];\r\n\t\t\t\tvar script = document.createElement(\"script\");\t\t\t\t\r\n\t\t\t\tscript.type = \"text/javascript\",\r\n\t\t\t\tscript.async = !0,\r\n\t\t\t\tscript.src = \"/App_Themes/v2/js/t3europe/analytics.js\",\r\n\t\t\t\tscripts.parentNode.insertBefore(script, scripts);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif(cookies.get( cookieName )) {\r\n\t\trefreshCookie();\r\n\t}\r\n\r\n\tif( !$consentBox.length ) return;\r\n\t$consentBox.toggle( !cookies.get( cookieName ) );\r\n\t\r\n\r\n\t$consentBox.on( 'click', '#consent_prompt_submit', e => {\r\n\t\te.preventDefault();\r\n\t\tsetPreferencesValues();\t\t\r\n\t\t$consentBox.hide();\r\n\t\tloadGACode();\r\n\t\t//location.reload();\r\n\t} );\r\n\r\n\t$consentBox.on( 'click', '#privacy_link_optin', e => {\r\n\t\t//e.preventDefault();\r\n\t\t//setPreferencesValues();\r\n\t\t//$cookieBox.hide();\r\n\t} );\r\n\r\n\t$consentBox.on( 'click', '#consent_pref_center', e => {\r\n\t\t//e.preventDefault();\r\n\t\t//setPreferencesValues();\r\n\t\t//$consentBox.hide();\r\n\t} );\r\n} );\r\n"]}