"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getExternalCookie = void 0;
var _dataSources = require("@mirai/data-sources");
var _CookieBanner = require("../CookieBanner.constants");
const getExternalCookie = () => {
  let accepted;
  _CookieBanner.COOKIE_BANNERS.forEach(name => {
    const value = (0, _dataSources.getCookie)(name);
    if (value !== undefined) {
      const decodedValue = decodeURIComponent(value);
      accepted = decodedValue.includes('statistics:true') || decodedValue.includes('marketing:true') || decodedValue.includes('"thirdparty":"1"') || decodedValue.includes('"advanced":"1"') || value.includes('analytics:yes') || value.includes('advertisement:yes') || value === 'allow';
    }
  });
  return accepted !== undefined ? accepted ? _CookieBanner.GRANTED : _CookieBanner.DENIED : undefined;
};
exports.getExternalCookie = getExternalCookie;
//# sourceMappingURL=getExternalCookie.js.map