var cookieSyncer;
/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "RtbCookieSyncer": () => (/* binding */ RtbCookieSyncer)
/* harmony export */ });
const loopmeOAndOPublisherID = 11571;
const loopmeMMPlusPublisherID = 11586;

class RtbCookieSyncer {
    #mmUserID;
    #encodedRedirectURL = '';
    #publisherType;
    #usPrivacy = '';
    #gdprInfo = {
        gdpr: '',
        gdprConsent: '',
    };
    #gppData = {
        gppString: '',
        gpp_sid: [],
    };
    #gppQuery = '';

    constructor(mmUserID, gdprInfo, usPrivacy, publisherType, gppData) {
        this.#mmUserID = mmUserID;
        this.#encodedRedirectURL = `https%3A%2F%2Frtb.voltaxam.com%2FcookieSync%3FvoltaxRTBUserID%3D${mmUserID}`;
        this.#publisherType = publisherType;
        this.#gppData = gppData;
        this.#gppQuery = this.#getGppQuery(gppData);
        this.#handleConsents(gdprInfo, usPrivacy)
        this.#doCookieSync();
    }

    #handleConsents(gdprInfo, usPrivacy) {
        this.#usPrivacy = this.#isEmpty(usPrivacy) ? '' : usPrivacy;
        if (this.#isEmpty(gdprInfo)) {
            return;
        }

        this.#gdprInfo = {
            gdpr: gdprInfo.gdpr ? 1 : 0,
            gdprConsent: gdprInfo.gdprConsent || '',
        };
    }

    #doCookieSync() {
        this.#doXandrCookieSync();
        this.#doTripleLiftCookieSync();
        this.#doSonobiCookieSync();
        this.#doPubmaticCookieSync();
        this.#doSovrnCookieSync();
        this.#doIXCookieSync();
        this.#doAdaptmxCookieSync();
        this.#doYieldmoCookieSync();
        this.#doLoopmeCookieSync();
        this.#doUnrulyCookieSync();
        this.#doOpenxCookieSync();
        this.#doRiseCookieSync();
        this.#doMediaNetCookieSync();
        this.#doSmartAdServerCookieSync();
        this.#doOneTagCookieSync();
        this.#doRubiconCookieSync();
    }

    #doRubiconCookieSync() {
        const src = `https://eus.rubiconproject.com/usync.html?p=minute_media_01&endpoint=us-west`;
        this.#doIframeCookieSync(src);
    }

    #doRiseCookieSync() {
        const src = `https://cs-server-s2s.yellowblue.io/sync-iframe?gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redirect=${this.#encodedRedirectURL}%26rise_uid%3D%7BpartnerId%7D`;
        this.#doIframeCookieSync(src);
    }

    #doSmartAdServerCookieSync() {
        const src = `https://ssbsync.smartadserver.com/api/sync?callerId=129&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&redirectUri=${this.#encodedRedirectURL}${this.#gppQuery}%26smartadserver_uid%3D%5Bssb_sync_pid%5D`;
        this.#doPixelCookieSync(src);
    }

    #doXandrCookieSync() {
        const src = `https://secure.adnxs.com/getuid?https://rtb.voltaxam.com/cookieSync?voltaxRTBUserID=${this.#mmUserID}&xandr_uid=$UID&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}`;
        this.#doPixelCookieSync(src);
    }

    #doIXCookieSync() {
        const src = `https://ssum-sec.casalemedia.com/usermatchredir?s=196326&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&cb=${this.#encodedRedirectURL}%26ix_uid%3D`;
        this.#doPixelCookieSync(src);
    }

    #doPubmaticCookieSync() {
        const src = `https://image8.pubmatic.com/AdServer/ImgSync?p=163062&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&pu=https%3A%2F%2Fimage4.pubmatic.com%2FAdServer%2FSPug%3FpartnerID%3D163062%26pmc%3DPM_PMC%26pr%3Dhttps%253A%252F%252Frtb.voltaxam.com%252FcookieSync%253FvoltaxRTBUserID%253D${this.#mmUserID}%2526pubmatic_uid%253D%2523PMUID%2526redir2%253Dtrue`;
        this.#doPixelCookieSync(src);
    }

    #doTripleLiftCookieSync() {
        const src = `https://eb2.3lift.com/getuid?gdpr=${this.#gdprInfo.gdpr}&cmp_cs=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redir=${this.#encodedRedirectURL}%26triplelift_uid%3D$UID`;
        this.#doPixelCookieSync(src);
    }

    #doSonobiCookieSync() {
        const src = `https://sync.go.sonobi.com/us?gdpr=${this.#gdprInfo.gdpr}&consent_string=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&loc=${this.#encodedRedirectURL}%26sonobi_uid%3D%5BUID%5D`;
        this.#doPixelCookieSync(src);
    }

    #doSovrnCookieSync() {
        const src = `https://ap.lijit.com/pixel?gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redir=${this.#encodedRedirectURL}%26sovrn_uid%3D%24UID`;
        this.#doPixelCookieSync(src);
    }

    #doAdaptmxCookieSync() {
        const src = `https://prebid.a-mo.net/cchain/0?gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&cb=${this.#encodedRedirectURL}%26adaptmx_uid%3D`;
        this.#doPixelCookieSync(src);
    }

    #doYieldmoCookieSync() {
        const src = `https://ads.yieldmo.com/pbsync?is=MMED_Voltax&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redirectUri=${this.#encodedRedirectURL}%26yieldmo_uid%3D%24UID`
        this.#doPixelCookieSync(src);
    }

    #doLoopmeCookieSync() {
        let publisherID = loopmeOAndOPublisherID;
        if (this.#publisherType === 'MMPlus') {
            publisherID = loopmeMMPlusPublisherID;
        }

        const src = `https://csync.loopme.me/?pubid=${publisherID}&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redirect=${this.#encodedRedirectURL}%26loopme_uid%3D%7Bviewer_token%7D`;
        this.#doPixelCookieSync(src);
    }

    #doUnrulyCookieSync() {
        const src = `https://sync.1rx.io/usersync2/rmpssp?sub=sportority&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&redir=${this.#encodedRedirectURL}%26unruly_uid%3D%5BRX_UUID%5D`;
        this.#doPixelCookieSync(src);
    }

    #doOpenxCookieSync() {
        const src = `https://u.openx.net/w/1.0/cm?id=6667519e-f89c-40a7-9fb6-e7217998098f&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}&r=${this.#encodedRedirectURL}%26openx_uid%3D%7BOPENX_ID%7D%20`
        this.#doPixelCookieSync(src);
    }

    #doMediaNetCookieSync() {
        const src = `https://cs.media.net/cksync.php?cs=81&type=vol&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}${this.#gppQuery}&redirect=${this.#encodedRedirectURL}%26medianet_uid%3D%3Cvsid%3E`
        this.#doPixelCookieSync(src);
    }

    #doOneTagCookieSync() {
        const src = `https://onetag-sys.com/usync/?pubId=7e42d776fe3e25a&gdpr=${this.#gdprInfo.gdpr}&gdpr_consent=${this.#gdprInfo.gdprConsent}&us_privacy=${this.#usPrivacy}${this.#gppQuery}`;
        this.#doIframeCookieSync(src);
    }

    #doIframeCookieSync = src => {
        const iframe = document.createElement('iframe');
        iframe.src = src;
        iframe.style.display = "none";
        document.body.append(iframe);
    }

    #doPixelCookieSync = (src) => {
        const img = document.createElement('img');
        img.src = src
        img.height = 1;
        img.width = 1;
        img.style.display = "none";
        document.body.append(img);
    }

    #isEmpty = element => typeof element === 'undefined' || element === null || element.length === 0;

    #getGppQuery(gppData) {
        let gppQuery = "";
        if (!this.#isEmpty(gppData.gppString)) {
            gppQuery = `${gppQuery}&gpp=${gppData.gppString}`;
        }
        if (!this.#isEmpty(gppData.gpp_sid) || gppData.gpp_sid === []) {
            gppQuery = `${gppQuery}&gpp_sid=${gppData.gpp_sid.join(',')}`;
        }
        return gppQuery;
    }
}


/***/ })
/******/ 	]);
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "initRtbCookieSyncer": () => (/* binding */ initRtbCookieSyncer)
/* harmony export */ });
/* harmony import */ var _rtbCookieSyncer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);


const initRtbCookieSyncer = (userID, gdprInfo, usPrivacy, publisherType, gppData) => new _rtbCookieSyncer__WEBPACK_IMPORTED_MODULE_0__.RtbCookieSyncer(userID, gdprInfo, usPrivacy, publisherType, gppData);

})();

cookieSyncer = __webpack_exports__;
/******/ })()
;