{"version":3,"file":"cta-popup-fJQHtxyo.js","sources":["../../Frontend/node_modules/js-cookie/dist/js.cookie.mjs","../../Frontend/js/modules/cta-popup.js"],"sourcesContent":["/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n    for (var key in source) {\n      target[key] = source[key];\n    }\n  }\n  return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n  read: function (value) {\n    if (value[0] === '\"') {\n      value = value.slice(1, -1);\n    }\n    return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n  },\n  write: function (value) {\n    return encodeURIComponent(value).replace(\n      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n      decodeURIComponent\n    )\n  }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n  function set (name, value, attributes) {\n    if (typeof document === 'undefined') {\n      return\n    }\n\n    attributes = assign({}, defaultAttributes, attributes);\n\n    if (typeof attributes.expires === 'number') {\n      attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n    }\n    if (attributes.expires) {\n      attributes.expires = attributes.expires.toUTCString();\n    }\n\n    name = encodeURIComponent(name)\n      .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n      .replace(/[()]/g, escape);\n\n    var stringifiedAttributes = '';\n    for (var attributeName in attributes) {\n      if (!attributes[attributeName]) {\n        continue\n      }\n\n      stringifiedAttributes += '; ' + attributeName;\n\n      if (attributes[attributeName] === true) {\n        continue\n      }\n\n      // Considers RFC 6265 section 5.2:\n      // ...\n      // 3.  If the remaining unparsed-attributes contains a %x3B (\";\")\n      //     character:\n      // Consume the characters of the unparsed-attributes up to,\n      // not including, the first %x3B (\";\") character.\n      // ...\n      stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n    }\n\n    return (document.cookie =\n      name + '=' + converter.write(value, name) + stringifiedAttributes)\n  }\n\n  function get (name) {\n    if (typeof document === 'undefined' || (arguments.length && !name)) {\n      return\n    }\n\n    // To prevent the for loop in the first place assign an empty array\n    // in case there are no cookies at all.\n    var cookies = document.cookie ? document.cookie.split('; ') : [];\n    var jar = {};\n    for (var i = 0; i < cookies.length; i++) {\n      var parts = cookies[i].split('=');\n      var value = parts.slice(1).join('=');\n\n      try {\n        var found = decodeURIComponent(parts[0]);\n        jar[found] = converter.read(value, found);\n\n        if (name === found) {\n          break\n        }\n      } catch (e) {}\n    }\n\n    return name ? jar[name] : jar\n  }\n\n  return Object.create(\n    {\n      set,\n      get,\n      remove: function (name, attributes) {\n        set(\n          name,\n          '',\n          assign({}, attributes, {\n            expires: -1\n          })\n        );\n      },\n      withAttributes: function (attributes) {\n        return init(this.converter, assign({}, this.attributes, attributes))\n      },\n      withConverter: function (converter) {\n        return init(assign({}, this.converter, converter), this.attributes)\n      }\n    },\n    {\n      attributes: { value: Object.freeze(defaultAttributes) },\n      converter: { value: Object.freeze(converter) }\n    }\n  )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","import Cookies from 'js-cookie';\r\n\r\nexport default function fInitSiteCta() {\r\n\r\n    const siteCtaPopup = document.querySelector('.js-cta-popup');\r\n    let cookie = Cookies.get('closedCta');\r\n    if (!siteCtaPopup) return;\r\n\r\n    const siteCtaPopupClose = siteCtaPopup.querySelector('.js-popup-close');\r\n    const siteCtaPopupLink = siteCtaPopup.querySelector('.js-popup-link')\r\n\r\n    if (cookie === undefined) {\r\n        const popup = document.querySelector('.js-cta-popup');\r\n        document.body.classList.add('has-cta-popup');\r\n        popup.classList.add('active');\r\n    }\r\n\r\n    siteCtaPopupClose.addEventListener('click', event => {\r\n        event.preventDefault();\r\n\r\n        document.body.classList.remove('has-cta-popup');\r\n        siteCtaPopup.classList.remove('active');\r\n\r\n        Cookies.set('closedCta', 'yes', { expires: 1 });\r\n    });\r\n\r\n    siteCtaPopupLink.addEventListener('click', event => {\r\n        Cookies.set('closedCta', 'yes', { expires: 1 });\r\n    });\r\n}\r\n"],"names":["assign","target","i","source","key","defaultConverter","value","init","converter","defaultAttributes","set","name","attributes","stringifiedAttributes","attributeName","get","cookies","jar","parts","found","api","fInitSiteCta","siteCtaPopup","cookie","Cookies","siteCtaPopupClose","siteCtaPopupLink","popup","event"],"mappings":"AAAA,6BAEA,SAASA,EAAQC,EAAQ,CACvB,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAS,UAAUD,CAAC,EACxB,QAASE,KAAOD,EACdF,EAAOG,CAAG,EAAID,EAAOC,CAAG,CAE3B,CACD,OAAOH,CACT,CAIA,IAAII,EAAmB,CACrB,KAAM,SAAUC,EAAO,CACrB,OAAIA,EAAM,CAAC,IAAM,MACfA,EAAQA,EAAM,MAAM,EAAG,EAAE,GAEpBA,EAAM,QAAQ,mBAAoB,kBAAkB,CAC5D,EACD,MAAO,SAAUA,EAAO,CACtB,OAAO,mBAAmBA,CAAK,EAAE,QAC/B,2CACA,kBACD,CACF,CACH,EAKA,SAASC,EAAMC,EAAWC,EAAmB,CAC3C,SAASC,EAAKC,EAAML,EAAOM,EAAY,CACrC,GAAI,SAAO,SAAa,KAIxB,CAAAA,EAAaZ,EAAO,CAAA,EAAIS,EAAmBG,CAAU,EAEjD,OAAOA,EAAW,SAAY,WAChCA,EAAW,QAAU,IAAI,KAAK,KAAK,IAAG,EAAKA,EAAW,QAAU,KAAK,GAEnEA,EAAW,UACbA,EAAW,QAAUA,EAAW,QAAQ,YAAW,GAGrDD,EAAO,mBAAmBA,CAAI,EAC3B,QAAQ,uBAAwB,kBAAkB,EAClD,QAAQ,QAAS,MAAM,EAE1B,IAAIE,EAAwB,GAC5B,QAASC,KAAiBF,EACnBA,EAAWE,CAAa,IAI7BD,GAAyB,KAAOC,EAE5BF,EAAWE,CAAa,IAAM,KAWlCD,GAAyB,IAAMD,EAAWE,CAAa,EAAE,MAAM,GAAG,EA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