{"version":3,"sources":["js.cookie.js","templates.js","script.js","en.js"],"names":["factory","registeredInModuleLoader","define","amd","exports","module","OldCookies","window","Cookies","api","noConflict","extend","i","result","arguments","length","attributes","key","init","converter","value","document","path","defaults","expires","Date","setMilliseconds","getMilliseconds","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","replace","decodeURIComponent","escape","stringifiedAttributes","attributeName","cookie","cookies","split","rdecode","parts","slice","join","this","json","charAt","name","read","parse","set","get","call","getJSON","apply","remove","withConverter","gdprCookieNoticeLocales","gdprCookieNotice","config","namespace","pluginPrefix","templates","gdprCookies","modalLoaded","noticeLoaded","cookiesAccepted","categories","locale","timeout","domain","expiration","currentCookieSelection","cookiesAcceptedEvent","CustomEvent","detail","deleteCookies","savedCookies","notAllEnabled","ii","showNotice","documentElement","classList","acceptCookies","save","date","necessary","performance","analytics","marketing","getElementById","checked","dispatchEvent","buildNotice","settingsButton","acceptButton","noticeHtml","localizeTemplate","body","insertAdjacentHTML","querySelectorAll","addEventListener","preventDefault","showModal","setTimeout","add","template","prefix","str","data","Object","buildModal","modalHtml","categoryList","querySelector","innerHTML","input","label","closeButton","statementButton","categoryTitles","saveButton","location","href","statement","parentNode","toggle","setModalEventListeners","implicit","_listener","winheight","docheight","scrollTop","trackLength","D","innerHeight","clientHeight","Math","max","scrollHeight","offsetHeight","pageYOffset","floor","removeEventListener","globalSettingsButton","en","description","settings","accept","always_on","cookie_essential_title","cookie_essential_desc","cookie_performance_title","cookie_performance_desc","cookie_analytics_title","cookie_analytics_desc","cookie_marketing_title","cookie_marketing_desc"],"mappings":"CAOA,SAAAA,GACA,IAAAC,GAAA,EASA,GARA,mBAAAC,QAAAA,OAAAC,MACAD,OAAAF,GACAC,GAAA,GAEA,iBAAAG,UACAC,OAAAD,QAAAJ,IACAC,GAAA,IAEAA,EAAA,CACA,IAAAK,EAAAC,OAAAC,QACAC,EAAAF,OAAAC,QAAAR,IACAS,EAAAC,WAAA,WAEA,OADAH,OAAAC,QAAAF,EAC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,EAAArD,gBAAAuD,cAQAJ,EAAAjI,OAAA0I,cAAA5H,SAAAgE,iBAAAhE,SAAAiF,KAAA2B,YAAA5G,SAAAiF,MAAAkC,UACAC,EAAAF,EAAAD,EAEA,GADAO,KAAAK,MAAAV,EAAAC,EAAA,OACAnE,IACAA,GAAA,KAWAiB,IACAhF,OAAA4I,oBAAA,QAAAd,OAzCA,IAAAe,EAAA/H,SAAAmF,iBAAA,IAAAvC,EAAA,oBACA,GAAAmF,EACA,IAAA,IAAAxI,EAAA,EAAAA,EAAAwI,EAAArI,OAAAH,IACAwI,EAAAxI,GAAA6F,iBAAA,QAAA,SAAAzE,GACAA,EAAA0E,iBACAC,MChEA9C,wBAAAwF,GAAA,CACAC,YAAA,8SACAC,SAAA,kBACAC,OAAA,iBACAxB,UAAA,uBACAxC,KAAA,gBACAiE,UAAA,YACAC,uBAAA,4BACAC,sBAAA,uMACAC,yBAAA,sBACAC,wBAAA,uMACAC,uBAAA,oBACAC,sBAAA,0LACAC,uBAAA,oBACAC,sBAAA","file":"script.js","sourcesContent":["/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","//HEAD \nwindow[\"gdpr-cookie-notice-templates\"] = {};\n\nwindow[\"gdpr-cookie-notice-templates\"][\"bar.html\"] = \"\\n\" +\n \"\"; \n\nwindow[\"gdpr-cookie-notice-templates\"][\"category.html\"] = \"\\n\" +\n \"\"; \n\nwindow[\"gdpr-cookie-notice-templates\"][\"modal.html\"] = \"\\n\" +\n \"\"; \n// END ","// Load locales\nvar gdprCookieNoticeLocales = {};\n\nfunction gdprCookieNotice(config) {\n var namespace = 'gdprcookienotice';\n var pluginPrefix = 'gdpr-cookie-notice';\n var templates = window[pluginPrefix+'-templates'];\n var gdprCookies = Cookies.noConflict();\n var modalLoaded = false;\n var noticeLoaded = false;\n var cookiesAccepted = false;\n var categories = ['performance', 'analytics', 'marketing'];\n\n // Default config options\n if(!config.locale) config.locale = 'en';\n if(!config.timeout) config.timeout = 500;\n if(!config.domain) config.domain = null;\n if(!config.expiration) config.expiration = 30;\n\n // Use 'en' locale if current locale doesn't exist\n if (typeof gdprCookieNoticeLocales[config.locale] === 'undefined') {\n config.locale = 'en';\n }\n\n // Get the users current cookie selection\n var currentCookieSelection = getCookie();\n var cookiesAcceptedEvent = new CustomEvent('gdprCookiesEnabled', {detail: currentCookieSelection});\n\n // Show cookie bar if needed\n if(!currentCookieSelection) {\n showNotice();\n\n // Accept cookies on page scroll\n if(config.implicit) {\n acceptOnScroll();\n }\n } else {\n deleteCookies(currentCookieSelection);\n document.dispatchEvent(cookiesAcceptedEvent);\n }\n\n // Get gdpr cookie notice stored value\n function getCookie() {\n return gdprCookies.getJSON(namespace);\n }\n\n // Delete cookies if needed\n function deleteCookies(savedCookies) {\n var notAllEnabled = false;\n for (var i = 0; i < categories.length; i++) {\n if(config[categories[i]] && !savedCookies[categories[i]]) {\n for (var ii = 0; ii < config[categories[i]].length; ii++) {\n gdprCookies.remove(config[categories[i]][ii]);\n notAllEnabled = true;\n }\n }\n }\n\n // Show the notice if not all categories are enabled\n if(notAllEnabled) {\n showNotice();\n } else {\n hideNotice();\n }\n }\n\n // Hide cookie notice bar\n function hideNotice() {\n document.documentElement.classList.remove(pluginPrefix+'-loaded');\n }\n\n // Write gdpr cookie notice's cookies when user accepts cookies\n function acceptCookies(save) {\n var value = {\n date: new Date(),\n necessary: true,\n performance: true,\n analytics: true,\n marketing: true\n };\n\n // If request was coming from the modal, check for the settings\n if(save) {\n for (var i = 0; i < categories.length; i++) {\n value[categories[i]] = document.getElementById(pluginPrefix+'-cookie_'+categories[i]).checked;\n }\n }\n gdprCookies.set(namespace, value, { expires: config.expiration, domain: config.domain });\n deleteCookies(value);\n\n // Load marketing scripts that only works when cookies are accepted\n cookiesAcceptedEvent = new CustomEvent('gdprCookiesEnabled', {detail: value});\n document.dispatchEvent(cookiesAcceptedEvent);\n\n }\n\n // Show the cookie bar\n function buildNotice() {\n if(noticeLoaded) {\n return false;\n }\n\n var noticeHtml = localizeTemplate('bar.html');\n document.body.insertAdjacentHTML('beforeend', noticeHtml);\n\n // Load click functions\n setNoticeEventListeners();\n\n // Make sure its only loaded once\n noticeLoaded = true;\n }\n\n // Show the cookie notice\n function showNotice() {\n buildNotice();\n\n // Show the notice with a little timeout\n setTimeout(function(){\n document.documentElement.classList.add(pluginPrefix+'-loaded');\n }, config.timeout);\n }\n\n // Localize templates\n function localizeTemplate(template, prefix) {\n var str = templates[template];\n var data = gdprCookieNoticeLocales[config.locale];\n\n if(prefix) {\n prefix = prefix+'_';\n } else {\n prefix = '';\n }\n\n if (typeof str === 'string' && (data instanceof Object)) {\n for (var key in data) {\n return str.replace(/({([^}]+)})/g, function(i) {\n var key = i.replace(/{/, '').replace(/}/, '');\n\n if(key == 'prefix') {\n return prefix.slice(0, -1);\n }\n\n if(data[key]) {\n return data[key];\n } else if(data[prefix+key]) {\n return data[prefix+key];\n } else {\n return i;\n }\n });\n }\n } else {\n return false;\n }\n }\n\n // Build modal window\n function buildModal() {\n if(modalLoaded) {\n return false;\n }\n\n // Load modal template\n var modalHtml = localizeTemplate('modal.html');\n\n // Append modal into body\n document.body.insertAdjacentHTML('beforeend', modalHtml);\n\n // Get empty category list\n var categoryList = document.querySelector('.'+pluginPrefix+'-modal-cookies');\n\n //Load essential cookies\n categoryList.innerHTML += localizeTemplate('category.html', 'cookie_essential');\n var input = document.querySelector('.'+pluginPrefix+'-modal-cookie-input');\n var label = document.querySelector('.'+pluginPrefix+'-modal-cookie-input-switch');\n label.innerHTML = gdprCookieNoticeLocales[config.locale]['always_on'];\n label.classList.add(pluginPrefix+'-modal-cookie-state');\n label.classList.remove(pluginPrefix+'-modal-cookie-input-switch');\n input.remove();\n\n // Load other categories if needed\n if(config.performance) categoryList.innerHTML += localizeTemplate('category.html', 'cookie_performance');\n if(config.analytics) categoryList.innerHTML += localizeTemplate('category.html', 'cookie_analytics');\n if(config.marketing) categoryList.innerHTML += localizeTemplate('category.html', 'cookie_marketing');\n\n // Load click functions\n setModalEventListeners();\n\n // Update checkboxes based on stored info(if any)\n if(currentCookieSelection) {\n document.getElementById(pluginPrefix+'-cookie_performance').checked = currentCookieSelection.performance;\n document.getElementById(pluginPrefix+'-cookie_analytics').checked = currentCookieSelection.analytics;\n document.getElementById(pluginPrefix+'-cookie_marketing').checked = currentCookieSelection.marketing;\n }\n\n // Make sure modal is only loaded once\n modalLoaded = true;\n }\n\n // Show modal window\n function showModal() {\n buildModal();\n document.documentElement.classList.add(pluginPrefix+'-show-modal');\n }\n\n // Hide modal window\n function hideModal() {\n document.documentElement.classList.remove(pluginPrefix+'-show-modal');\n }\n\n // Click functions in the notice\n function setNoticeEventListeners() {\n var settingsButton = document.querySelectorAll('.'+pluginPrefix+'-nav-item-settings')[0];\n var acceptButton = document.querySelectorAll('.'+pluginPrefix+'-nav-item-accept')[0];\n\n settingsButton.addEventListener('click', function(e) {\n e.preventDefault();\n showModal();\n });\n\n acceptButton.addEventListener('click', function(e) {\n e.preventDefault();\n acceptCookies();\n });\n\n }\n\n // Click functions in the modal\n function setModalEventListeners() {\n var closeButton = document.querySelectorAll('.'+pluginPrefix+'-modal-close')[0];\n var statementButton = document.querySelectorAll('.'+pluginPrefix+'-modal-footer-item-statement')[0];\n var categoryTitles = document.querySelectorAll('.'+pluginPrefix+'-modal-cookie-title');\n var saveButton = document.querySelectorAll('.'+pluginPrefix+'-modal-footer-item-save')[0];\n\n closeButton.addEventListener('click', function() {\n hideModal();\n return false;\n });\n\n statementButton.addEventListener('click', function(e) {\n e.preventDefault();\n window.location.href = config.statement;\n });\n\n for (var i = 0; i < categoryTitles.length; i++) {\n categoryTitles[i].addEventListener('click', function() {\n this.parentNode.parentNode.classList.toggle('open');\n return false;\n });\n }\n\n saveButton.addEventListener('click', function(e) {\n e.preventDefault();\n saveButton.classList.add('saved');\n setTimeout(function(){\n saveButton.classList.remove('saved');\n }, 1000);\n acceptCookies(true);\n });\n\n }\n\n // Settings button on the page somewhere\n var globalSettingsButton = document.querySelectorAll('.'+pluginPrefix+'-settings-button');\n if(globalSettingsButton) {\n for (var i = 0; i < globalSettingsButton.length; i++) {\n globalSettingsButton[i].addEventListener('click', function(e) {\n e.preventDefault();\n showModal();\n });\n }\n }\n\n\n // Get document height\n function getDocHeight() {\n var D = document;\n return Math.max(\n D.body.scrollHeight, D.documentElement.scrollHeight,\n D.body.offsetHeight, D.documentElement.offsetHeight,\n D.body.clientHeight, D.documentElement.clientHeight\n );\n }\n\n // Check if at least page is 25% scrolled down\n function amountScrolled(){\n var winheight= window.innerHeight || (document.documentElement || document.body).clientHeight;\n var docheight = getDocHeight();\n var scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop;\n var trackLength = docheight - winheight;\n var pctScrolled = Math.floor(scrollTop/trackLength * 100); // gets percentage scrolled (ie: 80 or NaN if tracklength == 0)\n if(pctScrolled > 25 && !cookiesAccepted) {\n cookiesAccepted = true;\n return true;\n } else {\n return false;\n }\n }\n\n // Accept cookies on scroll\n function acceptOnScroll() {\n window.addEventListener('scroll', function _listener() {\n if(amountScrolled()) {\n acceptCookies();\n window.removeEventListener('click', _listener);\n }\n });\n }\n\n}\n","//Add strings\ngdprCookieNoticeLocales.en = {\n description: 'We use cookies to offer you a better browsing experience, personalise content and ads, to provide social media features and to analyse our traffic. Read about how we use cookies and how you can control them by clicking Cookie Settings. You consent to our cookies if you continue to use this website.',\n settings: 'Cookie settings',\n accept: 'Accept cookies',\n statement: 'Our cookie statement',\n save: 'Save settings',\n always_on: 'Always on',\n cookie_essential_title: 'Essential website cookies',\n cookie_essential_desc: 'Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.',\n cookie_performance_title: 'Performance cookies',\n cookie_performance_desc: 'These cookies are used to enhance the performance and functionality of our websites but are non-essential to their use. For example it stores your preferred language or the region that you are in.',\n cookie_analytics_title: 'Analytics cookies',\n cookie_analytics_desc: 'We use analytics cookies to help us measure how users interact with website content, which helps us customize our websites and application for you in order to enhance your experience.',\n cookie_marketing_title: 'Marketing cookies',\n cookie_marketing_desc: 'These cookies are used to make advertising messages more relevant to you and your interests. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.'\n}\n"]}