{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/packs/tcf_api_adapter_oekotest.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","tcfApiConsentAdapter","this","UTOPIA_PURPOSES","FUNCTIONAL","WRITE_COOKIES","ANALYTICS","PUSH_ENGAGE","FULL_CONSENT","FUNCTION_TO_PURPOSE","CREATE_PERSONALIZED_ADS_PROFILE","CUSTOM_VENDOR_IDS","SKIP_PURPOSES","self","MY_CONSENT_PREFERENCES","__tcfapi","tcData","success","Error","eventStatus","vendorConsents","customVendors","consents","consentedVendors","filter","vendor","grants","_id","vendorGrant","validate","allowByPurpose","data","purpose","websitePurposes","tagManagerPurposes","vendorId","length","item","keys","legitimateInterests","indexOf","allPurposesGiven","MY_CONSENT_CALLBACK"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAA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lB,IAIvC,CAAmBhB","file":"js/tcf_api_adapter_oekotest-6b59fcf4aaf90ce58a97.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n","function TcfApiAdapter( window ) {\n // internal purposes, non IAB conform\n this.UTOPIA_PURPOSES = {\n FUNCTIONAL: '1',\n WRITE_COOKIES: '2',\n ANALYTICS: '3',\n PUSH_ENGAGE: '4',\n FULL_CONSENT: '6'\n };\n\n // internal functionality to IAB PURPOSES\n this.FUNCTION_TO_PURPOSE = {\n PUSH_ENGAGE: '1',\n WRITE_COOKIES: '1',\n CREATE_PERSONALIZED_ADS_PROFILE: '3'\n };\n\n // custom vendor ids relevant to the website\n const CUSTOM_VENDOR_IDS = {\n ANALYTICS: '5e542b3a4cd8884eb41b5a72'\n };\n\n // These IAB purposes are not supported by us and shouldn't be checked\n const SKIP_PURPOSES = [5, 6];\n const self = this;\n\n // constructor\n function init() {\n window.MY_CONSENT_PREFERENCES = window.MY_CONSENT_PREFERENCES || {};\n window.__tcfapi( 'addEventListener', 2, function( tcData, success ) {\n if ( success === true ) {\n if ( tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete' ) {\n // consent given previously OR consent given right now\n window.__tcfapi( 'getCustomVendorConsents', 2, function( vendorConsents, success ) {\n\n if ( success ) {\n // add custom vendors to validation object\n tcData.customVendors = {};\n tcData.customVendors.consents = vendorConsents.consentedVendors.filter( function( vendor ) {\n return vendorConsents.grants[vendor._id].vendorGrant === true;\n } );\n\n self.validate( tcData );\n }\n } );\n }\n } else {\n throw Error( 'addEventListener throws error' );\n }\n } );\n }\n\n init();\n\n // private\n function allowCustomVendor( data, vendorId ) {\n if ( data.customVendors.consents.length === 0 ) {\n return false;\n }\n\n return !!data.customVendors.consents.filter( function( item ) {\n return item._id === vendorId;\n } ).length;\n }\n\n // check if all standard IAB TCF v2.0 purposes were granted\n function allPurposesGiven( data ) {\n if ( !data.purpose.consents ) {\n return false;\n }\n\n let keys = Object.keys( data.purpose.consents );\n // compare length to legitimateInterests, because they always contain the full set of supported purposes\n if ( keys.length < Object.keys( data.purpose.legitimateInterests ).length ) {\n return false;\n }\n\n for ( let i = 1; i <= keys.length; i++ ) {\n if ( !data.purpose.consents[i] && SKIP_PURPOSES.indexOf( i ) === -1 ) {\n return false;\n }\n }\n\n return true;\n }\n\n // public\n\n // check for granted IAB TCF v2 purposes by purpose id ( 1-10 )\n this.allowByPurpose = function( data, purpose ) {\n if ( !data.purpose.consents ) {\n return false;\n }\n\n return data.purpose.consents[purpose];\n };\n\n this.validate = function( tcData ) {\n let websitePurposes = {};\n websitePurposes[this.UTOPIA_PURPOSES.FUNCTIONAL] = true;\n websitePurposes[this.UTOPIA_PURPOSES.PUSH_ENGAGE] = this.allowByPurpose( tcData, this.FUNCTION_TO_PURPOSE.PUSH_ENGAGE );\n\n let tagManagerPurposes = {};\n tagManagerPurposes[this.UTOPIA_PURPOSES.ANALYTICS] = allowCustomVendor( tcData, CUSTOM_VENDOR_IDS.ANALYTICS );\n tagManagerPurposes[this.UTOPIA_PURPOSES.WRITE_COOKIES] = this.allowByPurpose( tcData, this.FUNCTION_TO_PURPOSE.WRITE_COOKIES );\n tagManagerPurposes[this.UTOPIA_PURPOSES.FULL_CONSENT] = allPurposesGiven( tcData );\n\n /*eslint-disable */\n window.MY_CONSENT_CALLBACK( websitePurposes, tagManagerPurposes, tcData );\n /*eslint-enable */\n };\n}\nwindow.tcfApiConsentAdapter = new TcfApiAdapter( window );\n"],"sourceRoot":""}