diff --git a/allowedModules.js b/allowedModules.js index a8e1968a841..81920cdc15f 100644 --- a/allowedModules.js +++ b/allowedModules.js @@ -1,9 +1,12 @@ const sharedWhiteList = [ - 'prebidjs-polyfill/arrayFrom', - 'prebidjs-polyfill/find', - 'prebidjs-polyfill/findIndex', - 'prebidjs-polyfill/includes', + 'core-js-pure/features/array/find', // no ie11 + 'core-js-pure/features/array/includes', // no ie11 + 'core-js-pure/features/set', // ie11 supports Set but not Set#values + 'core-js-pure/features/string/includes', // no ie11 + 'core-js-pure/features/number/is-integer', // no ie11, + 'core-js-pure/features/array/from', // no ie11 + 'core-js-pure/web/url-search-params' // no ie11 ]; module.exports = { diff --git a/modules/adagioBidAdapter.js b/modules/adagioBidAdapter.js index 1a7677b98b2..3381f00ff8f 100644 --- a/modules/adagioBidAdapter.js +++ b/modules/adagioBidAdapter.js @@ -1,4 +1,4 @@ -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { isInteger, isArray, deepAccess, mergeDeep, logWarn, logInfo, logError, getWindowTop, getWindowSelf, generateUUID, _map, getDNT, parseUrl, getUniqueIdentifierStr, isNumber, cleanObj, isFn, inIframe, deepClone, getGptSlotInfoForAdUnitCode diff --git a/modules/adbookpspBidAdapter.js b/modules/adbookpspBidAdapter.js index dc6d316d05a..1b93d4fe1c6 100644 --- a/modules/adbookpspBidAdapter.js +++ b/modules/adbookpspBidAdapter.js @@ -1,5 +1,5 @@ -import includes from 'prebidjs-polyfill/includes.js'; -import find from 'prebidjs-polyfill/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; +import find from 'core-js-pure/features/array/find'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { getStorageManager } from '../src/storageManager.js'; diff --git a/modules/adhashBidAdapter.js b/modules/adhashBidAdapter.js index 2a8d06ef3b1..6a8c98650c0 100644 --- a/modules/adhashBidAdapter.js +++ b/modules/adhashBidAdapter.js @@ -1,5 +1,5 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { BANNER } from '../src/mediaTypes.js'; const VERSION = '1.0'; diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index 80a83720f53..c23eca2f96a 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -4,8 +4,8 @@ import { } from '../src/utils.js'; import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import {config} from '../src/config.js'; /* diff --git a/modules/adlooxAnalyticsAdapter.js b/modules/adlooxAnalyticsAdapter.js index 56affa6b847..781b8db830a 100644 --- a/modules/adlooxAnalyticsAdapter.js +++ b/modules/adlooxAnalyticsAdapter.js @@ -10,7 +10,7 @@ import { loadExternalScript } from '../src/adloader.js'; import { auctionManager } from '../src/auctionManager.js'; import { AUCTION_COMPLETED } from '../src/auction.js'; import CONSTANTS from '../src/constants.json'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { deepAccess, logInfo, isPlainObject, logError, isStr, isNumber, getGptSlotInfoForAdUnitCode, isFn, mergeDeep, logMessage, insertElement, logWarn, getUniqueIdentifierStr, parseUrl diff --git a/modules/adlooxRtdProvider.js b/modules/adlooxRtdProvider.js index 43e2b536322..34d1428ea1d 100644 --- a/modules/adlooxRtdProvider.js +++ b/modules/adlooxRtdProvider.js @@ -20,7 +20,7 @@ import { getAdUnitSizes, logInfo, isPlainObject, logError, isStr, isInteger, isArray, isBoolean, mergeDeep, deepAccess, _each, deepSetValue, logWarn, getGptSlotInfoForAdUnitCode } from '../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'adloox'; const MODULE = `${MODULE_NAME}RtdProvider`; diff --git a/modules/adnowBidAdapter.js b/modules/adnowBidAdapter.js index f0e50bab420..badf57ed5c9 100644 --- a/modules/adnowBidAdapter.js +++ b/modules/adnowBidAdapter.js @@ -1,7 +1,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { NATIVE, BANNER } from '../src/mediaTypes.js'; import { parseSizesInput, deepAccess, parseQueryStringParameters } from '../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const BIDDER_CODE = 'adnow'; const ENDPOINT = 'https://n.ads3-adnow.com/a'; diff --git a/modules/adomikAnalyticsAdapter.js b/modules/adomikAnalyticsAdapter.js index 7c1611f183e..e81f6e50054 100644 --- a/modules/adomikAnalyticsAdapter.js +++ b/modules/adomikAnalyticsAdapter.js @@ -2,8 +2,8 @@ import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; import { logInfo } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; -import findIndex from 'prebidjs-polyfill/findIndex.js'; +import find from 'core-js-pure/features/array/find.js'; +import findIndex from 'core-js-pure/features/array/find-index.js'; // Events used in adomik analytics adapter const auctionInit = CONSTANTS.EVENTS.AUCTION_INIT; diff --git a/modules/adotBidAdapter.js b/modules/adotBidAdapter.js index e389a668a7d..b1adcd1311d 100644 --- a/modules/adotBidAdapter.js +++ b/modules/adotBidAdapter.js @@ -1,8 +1,8 @@ -import { Renderer } from '../src/Renderer.js'; -import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import { isFn, isArray, isBoolean, isStr, isPlainObject, logError, replaceAuctionPrice } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import {Renderer} from '../src/Renderer.js'; +import {registerBidder} from '../src/adapters/bidderFactory.js'; +import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; +import {isStr, isFn, isArray, isPlainObject, isBoolean, logError, replaceAuctionPrice} from '../src/utils.js'; +import find from 'core-js-pure/features/array/find.js'; import { config } from '../src/config.js'; import { OUTSTREAM } from '../src/video.js'; diff --git a/modules/adpod.js b/modules/adpod.js index 7227a563f67..eac8d8afdf0 100644 --- a/modules/adpod.js +++ b/modules/adpod.js @@ -23,11 +23,12 @@ import { setupBeforeHookFnOnce, module } from '../src/hook.js'; import { store } from '../src/videoCache.js'; import { config } from '../src/config.js'; import { ADPOD } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import Set from 'core-js-pure/features/set'; +import find from 'core-js-pure/features/array/find.js'; import { auctionManager } from '../src/auctionManager.js'; import CONSTANTS from '../src/constants.json'; -const from = require('prebidjs-polyfill/arrayFrom.js'); +const from = require('core-js-pure/features/array/from.js'); const TARGETING_KEY_PB_CAT_DUR = 'hb_pb_cat_dur'; const TARGETING_KEY_CACHE_ID = 'hb_cache_id'; diff --git a/modules/adrelevantisBidAdapter.js b/modules/adrelevantisBidAdapter.js index 153a6f3a612..649031d1e3b 100644 --- a/modules/adrelevantisBidAdapter.js +++ b/modules/adrelevantisBidAdapter.js @@ -6,8 +6,8 @@ import { import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { OUTSTREAM, INSTREAM } from '../src/video.js'; const BIDDER_CODE = 'adrelevantis'; diff --git a/modules/adtargetBidAdapter.js b/modules/adtargetBidAdapter.js index 42225b1d3af..0ad0177815a 100644 --- a/modules/adtargetBidAdapter.js +++ b/modules/adtargetBidAdapter.js @@ -2,7 +2,7 @@ import { deepAccess, isArray, chunk, _map, flatten, logError, parseSizesInput } import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const ENDPOINT = 'https://ghb.console.adtarget.com.tr/v2/auction/'; const BIDDER_CODE = 'adtarget'; diff --git a/modules/adtelligentBidAdapter.js b/modules/adtelligentBidAdapter.js index 9c844a75ee9..44a9c90d438 100644 --- a/modules/adtelligentBidAdapter.js +++ b/modules/adtelligentBidAdapter.js @@ -3,7 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { ADPOD, BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; import { Renderer } from '../src/Renderer.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const subdomainSuffixes = ['', 1, 2]; const AUCTION_PATH = '/v2/auction/'; diff --git a/modules/advangelistsBidAdapter.js b/modules/advangelistsBidAdapter.js index 31b78f8366e..854c65b1f22 100755 --- a/modules/advangelistsBidAdapter.js +++ b/modules/advangelistsBidAdapter.js @@ -2,8 +2,8 @@ import { isEmpty, deepAccess, isFn, parseSizesInput, generateUUID, parseUrl } fr import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { VIDEO, BANNER } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; const ADAPTER_VERSION = '1.0'; const BIDDER_CODE = 'advangelists'; diff --git a/modules/adxpremiumAnalyticsAdapter.js b/modules/adxpremiumAnalyticsAdapter.js index 7de5d0b77d2..3e30de14052 100644 --- a/modules/adxpremiumAnalyticsAdapter.js +++ b/modules/adxpremiumAnalyticsAdapter.js @@ -3,7 +3,7 @@ import { ajax } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const analyticsType = 'endpoint'; const defaultUrl = 'https://adxpremium.services/graphql'; diff --git a/modules/adyoulikeBidAdapter.js b/modules/adyoulikeBidAdapter.js index fd4e55bc6aa..e04121c60ca 100644 --- a/modules/adyoulikeBidAdapter.js +++ b/modules/adyoulikeBidAdapter.js @@ -2,7 +2,7 @@ import { deepAccess, buildUrl, parseSizesInput } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { createEidsArray } from './userId/eids.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; const VERSION = '1.0'; diff --git a/modules/afpBidAdapter.js b/modules/afpBidAdapter.js index 9efa7cf8454..68941ff17c9 100644 --- a/modules/afpBidAdapter.js +++ b/modules/afpBidAdapter.js @@ -1,4 +1,4 @@ -import includes from 'prebidjs-polyfill/includes.js' +import includes from 'core-js-pure/features/array/includes.js' import { registerBidder } from '../src/adapters/bidderFactory.js' import { Renderer } from '../src/Renderer.js' import { BANNER, VIDEO } from '../src/mediaTypes.js' diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index dc2eadbfee9..1829323df2a 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -4,8 +4,8 @@ import { config } from '../src/config.js'; import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO, ADPOD } from '../src/mediaTypes.js'; import { auctionManager } from '../src/auctionManager.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { OUTSTREAM, INSTREAM } from '../src/video.js'; import { getStorageManager } from '../src/storageManager.js'; import { bidderSettings } from '../src/bidderSettings.js'; diff --git a/modules/beachfrontBidAdapter.js b/modules/beachfrontBidAdapter.js index 69bf4afeae5..e705156d4a2 100644 --- a/modules/beachfrontBidAdapter.js +++ b/modules/beachfrontBidAdapter.js @@ -3,8 +3,8 @@ import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { Renderer } from '../src/Renderer.js'; import { VIDEO, BANNER } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; const ADAPTER_VERSION = '1.19'; const ADAPTER_NAME = 'BFIO_PREBID'; diff --git a/modules/betweenBidAdapter.js b/modules/betweenBidAdapter.js index 0e88950c118..b2f63488e12 100644 --- a/modules/betweenBidAdapter.js +++ b/modules/betweenBidAdapter.js @@ -6,7 +6,7 @@ const BIDDER_CODE = 'between'; let ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid'; const CODE_TYPES = ['inpage', 'preroll', 'midroll', 'postroll']; -const includes = require('prebidjs-polyfill/includes.js'); +const includes = require('core-js-pure/features/array/includes.js'); export const spec = { code: BIDDER_CODE, aliases: ['btw'], diff --git a/modules/bidViewability.js b/modules/bidViewability.js index 7072d837105..545d57940da 100644 --- a/modules/bidViewability.js +++ b/modules/bidViewability.js @@ -8,7 +8,7 @@ import CONSTANTS from '../src/constants.json'; import { logWarn, isFn, triggerPixel } from '../src/utils.js'; import { getGlobal } from '../src/prebidGlobal.js'; import adapterManager, { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const MODULE_NAME = 'bidViewability'; const CONFIG_ENABLED = 'enabled'; diff --git a/modules/bluebillywigBidAdapter.js b/modules/bluebillywigBidAdapter.js index 95f3ff92525..03fb0b92c8f 100644 --- a/modules/bluebillywigBidAdapter.js +++ b/modules/bluebillywigBidAdapter.js @@ -1,5 +1,5 @@ import { deepAccess, deepSetValue, deepClone, logWarn, logError } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; diff --git a/modules/bridgewellBidAdapter.js b/modules/bridgewellBidAdapter.js index ced9f48b7da..5d545b6f722 100644 --- a/modules/bridgewellBidAdapter.js +++ b/modules/bridgewellBidAdapter.js @@ -1,7 +1,7 @@ import { _each, inIframe, deepSetValue } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'bridgewell'; const REQUEST_ENDPOINT = 'https://prebid.scupio.com/recweb/prebid.aspx?cb='; diff --git a/modules/browsiRtdProvider.js b/modules/browsiRtdProvider.js index 49504efbe0a..a1943afda8d 100644 --- a/modules/browsiRtdProvider.js +++ b/modules/browsiRtdProvider.js @@ -20,9 +20,9 @@ import {submodule} from '../src/hook.js'; import {ajaxBuilder} from '../src/ajax.js'; import {loadExternalScript} from '../src/adloader.js'; import {getStorageManager} from '../src/storageManager.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import {getGlobal} from '../src/prebidGlobal.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const storage = getStorageManager(); diff --git a/modules/cleanmedianetBidAdapter.js b/modules/cleanmedianetBidAdapter.js index 090bc9a7a54..3c2d3c51bf5 100644 --- a/modules/cleanmedianetBidAdapter.js +++ b/modules/cleanmedianetBidAdapter.js @@ -3,7 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; import {Renderer} from '../src/Renderer.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; export const helper = { getTopWindowDomain: function (url) { diff --git a/modules/connectIdSystem.js b/modules/connectIdSystem.js index db1ae9804a0..ac44a8b5a2d 100644 --- a/modules/connectIdSystem.js +++ b/modules/connectIdSystem.js @@ -8,7 +8,7 @@ import {ajax} from '../src/ajax.js'; import {submodule} from '../src/hook.js'; import {logError, formatQS} from '../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'connectId'; const VENDOR_ID = 25; diff --git a/modules/consentManagement.js b/modules/consentManagement.js index c304ed739bb..ecd0c0eec4b 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -8,7 +8,8 @@ import { logInfo, isFn, getAdUnitSizes, logWarn, isStr, isPlainObject, logError, isNumber } from '../src/utils.js'; import { config } from '../src/config.js'; import { gdprDataHandler } from '../src/adapterManager.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; +import strIncludes from 'core-js-pure/features/string/includes.js'; const DEFAULT_CMP = 'iab'; const DEFAULT_CONSENT_TIMEOUT = 10000; @@ -248,7 +249,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { function readPostMessageResponse(event) { let cmpDataPkgName = `${apiName}Return`; - let json = (typeof event.data === 'string' && includes(event.data, cmpDataPkgName)) ? JSON.parse(event.data) : event.data; + let json = (typeof event.data === 'string' && strIncludes(event.data, cmpDataPkgName)) ? JSON.parse(event.data) : event.data; if (json[cmpDataPkgName] && json[cmpDataPkgName].callId) { let payload = json[cmpDataPkgName]; // TODO - clean up this logic (move listeners?); we have duplicate messages responses because 2 eventlisteners are active from the 2 cmp requests running in parallel diff --git a/modules/craftBidAdapter.js b/modules/craftBidAdapter.js index fd9d202840b..812ec53d686 100644 --- a/modules/craftBidAdapter.js +++ b/modules/craftBidAdapter.js @@ -2,8 +2,8 @@ import { logError, convertTypes, convertCamelToUnderscore, isArray, deepAccess, import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { auctionManager } from '../src/auctionManager.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { getStorageManager } from '../src/storageManager.js'; import {ajax} from '../src/ajax.js'; diff --git a/modules/criteoBidAdapter.js b/modules/criteoBidAdapter.js index 63b5970a947..0285ab6be5b 100644 --- a/modules/criteoBidAdapter.js +++ b/modules/criteoBidAdapter.js @@ -3,7 +3,7 @@ import {loadExternalScript} from '../src/adloader.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2 import { getStorageManager } from '../src/storageManager.js'; diff --git a/modules/cwireBidAdapter.js b/modules/cwireBidAdapter.js index 88f1fb01e6b..c9caa78e5e7 100644 --- a/modules/cwireBidAdapter.js +++ b/modules/cwireBidAdapter.js @@ -16,7 +16,7 @@ import { logWarn, } from '../src/utils.js'; import { Renderer } from '../src/Renderer.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; // ------------------------------------ const BIDDER_CODE = 'cwire'; diff --git a/modules/dailyhuntBidAdapter.js b/modules/dailyhuntBidAdapter.js index 3679c164ba5..cdcc9f1d038 100644 --- a/modules/dailyhuntBidAdapter.js +++ b/modules/dailyhuntBidAdapter.js @@ -2,7 +2,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import * as mediaTypes from '../src/mediaTypes.js'; import {deepAccess, _map, isEmpty} from '../src/utils.js'; import { ajax } from '../src/ajax.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { OUTSTREAM, INSTREAM } from '../src/video.js'; const BIDDER_CODE = 'dailyhunt'; diff --git a/modules/dchain.js b/modules/dchain.js index 7f13e28165e..6a1bd1ebf70 100644 --- a/modules/dchain.js +++ b/modules/dchain.js @@ -1,4 +1,4 @@ -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { config } from '../src/config.js'; import { getHook } from '../src/hook.js'; import { _each, isStr, isArray, isPlainObject, hasOwn, deepClone, deepAccess, logWarn, logError } from '../src/utils.js'; diff --git a/modules/emx_digitalBidAdapter.js b/modules/emx_digitalBidAdapter.js index 52bbd711e53..0ed23f11631 100644 --- a/modules/emx_digitalBidAdapter.js +++ b/modules/emx_digitalBidAdapter.js @@ -2,8 +2,8 @@ import { isArray, logWarn, logError, parseUrl, deepAccess, isStr, _each, getBidI import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { Renderer } from '../src/Renderer.js'; -import includes from 'prebidjs-polyfill/includes.js'; -import find from 'prebidjs-polyfill/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'emx_digital'; const ENDPOINT = 'hb.emxdgt.com'; diff --git a/modules/fluctBidAdapter.js b/modules/fluctBidAdapter.js index 5b4434ea109..2aa86077991 100644 --- a/modules/fluctBidAdapter.js +++ b/modules/fluctBidAdapter.js @@ -1,5 +1,6 @@ import { _each, isEmpty } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; +import URLSearchParams from 'core-js-pure/web/url-search-params' const BIDDER_CODE = 'fluct'; const END_POINT = 'https://hb.adingo.jp/prebid'; diff --git a/modules/gamoshiBidAdapter.js b/modules/gamoshiBidAdapter.js index 043b0b52a0c..34b164f26ca 100644 --- a/modules/gamoshiBidAdapter.js +++ b/modules/gamoshiBidAdapter.js @@ -3,7 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; import {Renderer} from '../src/Renderer.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const ENDPOINTS = { 'gamoshi': 'https://rtb.gamoshi.io' diff --git a/modules/gdprEnforcement.js b/modules/gdprEnforcement.js index 4c2e373c1da..978bd8de9e3 100644 --- a/modules/gdprEnforcement.js +++ b/modules/gdprEnforcement.js @@ -5,8 +5,8 @@ import { deepAccess, logWarn, isArray, hasDeviceAccess } from '../src/utils.js'; import { config } from '../src/config.js'; import adapterManager, { gdprDataHandler } from '../src/adapterManager.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { registerSyncInner } from '../src/adapters/bidderFactory.js'; import { getHook } from '../src/hook.js'; import { validateStorageEnforcement } from '../src/storageManager.js'; diff --git a/modules/glomexBidAdapter.js b/modules/glomexBidAdapter.js index ce329e78c31..617a1a3d721 100644 --- a/modules/glomexBidAdapter.js +++ b/modules/glomexBidAdapter.js @@ -1,5 +1,5 @@ import { registerBidder } from '../src/adapters/bidderFactory.js' -import find from 'prebidjs-polyfill/find.js' +import find from 'core-js-pure/features/array/find.js' import { BANNER } from '../src/mediaTypes.js' const ENDPOINT = 'https://prebid.mes.glomex.cloud/request-bid' diff --git a/modules/goldbachBidAdapter.js b/modules/goldbachBidAdapter.js index 07b0bd79898..8057925a62c 100644 --- a/modules/goldbachBidAdapter.js +++ b/modules/goldbachBidAdapter.js @@ -27,8 +27,8 @@ import { config } from '../src/config.js'; import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO, ADPOD } from '../src/mediaTypes.js'; import { auctionManager } from '../src/auctionManager.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { OUTSTREAM, INSTREAM } from '../src/video.js'; const BIDDER_CODE = 'goldbach'; diff --git a/modules/gptPreAuction.js b/modules/gptPreAuction.js index 14831ffae65..88f90419aeb 100644 --- a/modules/gptPreAuction.js +++ b/modules/gptPreAuction.js @@ -1,7 +1,7 @@ import { isGptPubadsDefined, isAdUnitCodeMatchingSlot, deepAccess, pick, logInfo } from '../src/utils.js'; import { config } from '../src/config.js'; import { getHook } from '../src/hook.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const MODULE_NAME = 'GPT Pre-Auction'; export let _currentConfig = {}; diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index bfa7a52f74d..8e06eb43c14 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -3,7 +3,7 @@ import { _each, deepAccess, logError, logWarn, parseSizesInput } from '../src/ut import { config } from '../src/config.js' import { getStorageManager } from '../src/storageManager.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes'; import { registerBidder } from '../src/adapters/bidderFactory.js' const storage = getStorageManager(); diff --git a/modules/hybridBidAdapter.js b/modules/hybridBidAdapter.js index 96a0c201786..4383e62c16e 100644 --- a/modules/hybridBidAdapter.js +++ b/modules/hybridBidAdapter.js @@ -3,7 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js' import { auctionManager } from '../src/auctionManager.js' import { BANNER, VIDEO } from '../src/mediaTypes.js' import {Renderer} from '../src/Renderer.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'hybrid'; const DSP_ENDPOINT = 'https://hbe198.hybrid.ai/prebidhb'; diff --git a/modules/improvedigitalBidAdapter.js b/modules/improvedigitalBidAdapter.js index 6917a1fd7b2..a68e90754fb 100644 --- a/modules/improvedigitalBidAdapter.js +++ b/modules/improvedigitalBidAdapter.js @@ -4,7 +4,7 @@ import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import {Renderer} from '../src/Renderer.js'; import { createEidsArray } from './userId/eids.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const BIDDER_CODE = 'improvedigital'; const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js'; diff --git a/modules/insticatorBidAdapter.js b/modules/insticatorBidAdapter.js index 746ae3d1562..47a3353a897 100644 --- a/modules/insticatorBidAdapter.js +++ b/modules/insticatorBidAdapter.js @@ -7,7 +7,7 @@ import { logError, } from '../src/utils.js'; import { getStorageManager } from '../src/storageManager.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'insticator'; const ENDPOINT = 'https://ex.ingage.tech/v1/openrtb'; // production endpoint diff --git a/modules/intersectionRtdProvider.js b/modules/intersectionRtdProvider.js index d75faec36c4..4404c4148fe 100644 --- a/modules/intersectionRtdProvider.js +++ b/modules/intersectionRtdProvider.js @@ -2,7 +2,7 @@ import {submodule} from '../src/hook.js'; import {isFn, logError} from '../src/utils.js'; import {config} from '../src/config.js'; import {getGlobal} from '../src/prebidGlobal.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import '../src/adapterManager.js'; let observerAvailable = true; function getIntersectionData(requestBidsObject, onDone, providerConfig, userConsent) { diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 969610bc6ff..595b7585cba 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -4,10 +4,10 @@ import { config } from '../src/config.js'; import CONSTANTS from '../src/constants.json'; import { getStorageManager, validateStorageEnforcement } from '../src/storageManager.js'; import events from '../src/events.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { INSTREAM, OUTSTREAM } from '../src/video.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { Renderer } from '../src/Renderer.js'; const BIDDER_CODE = 'ix'; diff --git a/modules/jwplayerRtdProvider.js b/modules/jwplayerRtdProvider.js index 12f31525cde..5a7e9f13686 100644 --- a/modules/jwplayerRtdProvider.js +++ b/modules/jwplayerRtdProvider.js @@ -13,7 +13,7 @@ import { submodule } from '../src/hook.js'; import { config } from '../src/config.js'; import { ajaxBuilder } from '../src/ajax.js'; import { logError } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { getGlobal } from '../src/prebidGlobal.js'; const SUBMODULE_NAME = 'jwplayer'; diff --git a/modules/livewrappedBidAdapter.js b/modules/livewrappedBidAdapter.js index fa36546690f..6b7c055b295 100644 --- a/modules/livewrappedBidAdapter.js +++ b/modules/livewrappedBidAdapter.js @@ -1,7 +1,7 @@ import { isSafariBrowser, deepAccess, getWindowTop, mergeDeep } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { getStorageManager } from '../src/storageManager.js'; diff --git a/modules/mediakeysBidAdapter.js b/modules/mediakeysBidAdapter.js index 9361e8b7050..72dca2f1add 100644 --- a/modules/mediakeysBidAdapter.js +++ b/modules/mediakeysBidAdapter.js @@ -1,5 +1,5 @@ -import find from 'prebidjs-polyfill/find.js'; -import arrayFrom from 'prebidjs-polyfill/arrayFrom.js'; +import find from 'core-js-pure/features/array/find.js'; +import arrayFrom from 'core-js-pure/features/array/from'; import { getWindowTop, isFn, logWarn, getDNT, deepAccess, isArray, inIframe, mergeDeep, isStr, isEmpty, deepSetValue, deepClone, parseUrl, cleanObj, logError, triggerPixel, isInteger, isNumber } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; diff --git a/modules/medianetAnalyticsAdapter.js b/modules/medianetAnalyticsAdapter.js index 58eeebdf815..d484ce643a1 100644 --- a/modules/medianetAnalyticsAdapter.js +++ b/modules/medianetAnalyticsAdapter.js @@ -5,7 +5,7 @@ import CONSTANTS from '../src/constants.json'; import { ajax } from '../src/ajax.js'; import { getRefererInfo } from '../src/refererDetection.js'; import { AUCTION_COMPLETED, AUCTION_IN_PROGRESS, getPriceGranularity } from '../src/auction.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const analyticsType = 'endpoint'; const ENDPOINT = 'https://pb-logs.media.net/log?logid=kfk&evtid=prebid_analytics_events_client'; diff --git a/modules/medianetRtdProvider.js b/modules/medianetRtdProvider.js index 45666cd451c..cd86bf891f3 100644 --- a/modules/medianetRtdProvider.js +++ b/modules/medianetRtdProvider.js @@ -1,7 +1,7 @@ import { isStr, isEmptyStr, logError, mergeDeep, isFn, insertElement } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getGlobal } from '../src/prebidGlobal.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'medianet'; const SOURCE = MODULE_NAME + 'rtd'; diff --git a/modules/nextrollBidAdapter.js b/modules/nextrollBidAdapter.js index 52aa3edbaae..b5af7ec1486 100644 --- a/modules/nextrollBidAdapter.js +++ b/modules/nextrollBidAdapter.js @@ -12,7 +12,7 @@ import { import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'nextroll'; const BIDDER_ENDPOINT = 'https://d.adroll.com/bid/prebid/'; diff --git a/modules/onetagBidAdapter.js b/modules/onetagBidAdapter.js index 4ef23cbd782..5642dce9018 100644 --- a/modules/onetagBidAdapter.js +++ b/modules/onetagBidAdapter.js @@ -3,7 +3,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { INSTREAM, OUTSTREAM } from '../src/video.js'; import { Renderer } from '../src/Renderer.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { getStorageManager } from '../src/storageManager.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { createEidsArray } from './userId/eids.js'; diff --git a/modules/openwebBidAdapter.js b/modules/openwebBidAdapter.js index 4f06c2a31fc..9476d2d2914 100644 --- a/modules/openwebBidAdapter.js +++ b/modules/openwebBidAdapter.js @@ -2,7 +2,7 @@ import { isNumber, deepAccess, isArray, flatten, convertTypes, parseSizesInput } import { registerBidder } from '../src/adapters/bidderFactory.js'; import { ADPOD, BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const ENDPOINT = 'https://ghb.spotim.market/v2/auction'; const BIDDER_CODE = 'openweb'; diff --git a/modules/openxAnalyticsAdapter.js b/modules/openxAnalyticsAdapter.js index 7efe1c9d487..f67f8bd0c75 100644 --- a/modules/openxAnalyticsAdapter.js +++ b/modules/openxAnalyticsAdapter.js @@ -3,8 +3,8 @@ import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; import { ajax } from '../src/ajax.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; export const AUCTION_STATES = { INIT: 'initialized', // auction has initialized diff --git a/modules/openxBidAdapter.js b/modules/openxBidAdapter.js index e5c4289ab99..60b441e2c10 100644 --- a/modules/openxBidAdapter.js +++ b/modules/openxBidAdapter.js @@ -2,7 +2,7 @@ import { deepAccess, convertTypes, isArray, inIframe, _map, deepSetValue, _each, import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; -import includes from 'prebidjs-polyfill/includes.js' +import includes from 'core-js-pure/features/array/includes.js' const SUPPORTED_AD_TYPES = [BANNER, VIDEO]; const VIDEO_TARGETING = ['startdelay', 'mimes', 'minduration', 'maxduration', diff --git a/modules/parrableIdSystem.js b/modules/parrableIdSystem.js index 40e6368556e..b1553bcb134 100644 --- a/modules/parrableIdSystem.js +++ b/modules/parrableIdSystem.js @@ -8,7 +8,7 @@ // ci trigger: 1 import { timestamp, logError, logWarn, isEmpty, contains, inIframe, deepClone, isPlainObject } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getRefererInfo } from '../src/refererDetection.js'; diff --git a/modules/permutiveRtdProvider.js b/modules/permutiveRtdProvider.js index fdff3343615..40282567506 100644 --- a/modules/permutiveRtdProvider.js +++ b/modules/permutiveRtdProvider.js @@ -10,7 +10,7 @@ import { submodule } from '../src/hook.js' import { getStorageManager } from '../src/storageManager.js' import { deepSetValue, deepAccess, isFn, mergeDeep, logError } from '../src/utils.js' import { config } from '../src/config.js' -import includes from 'prebidjs-polyfill/includes.js' +import includes from 'core-js-pure/features/array/includes.js' const MODULE_NAME = 'permutive' export const storage = getStorageManager(null, MODULE_NAME) diff --git a/modules/pixfutureBidAdapter.js b/modules/pixfutureBidAdapter.js index b0924ebcac5..e9db875fc2f 100644 --- a/modules/pixfutureBidAdapter.js +++ b/modules/pixfutureBidAdapter.js @@ -2,10 +2,10 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; import { BANNER } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js'; import { auctionManager } from '../src/auctionManager.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const SOURCE = 'pbjs'; const storageManager = getStorageManager(); diff --git a/modules/prebidServerBidAdapter/index.js b/modules/prebidServerBidAdapter/index.js index 3ea56d387f7..a5cd0c4c221 100644 --- a/modules/prebidServerBidAdapter/index.js +++ b/modules/prebidServerBidAdapter/index.js @@ -12,10 +12,10 @@ import { config } from '../../src/config.js'; import { VIDEO, NATIVE } from '../../src/mediaTypes.js'; import { isValid } from '../../src/adapters/bidderFactory.js'; import events from '../../src/events.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { S2S_VENDORS } from './config.js'; import { ajax } from '../../src/ajax.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const getConfig = config.getConfig; diff --git a/modules/priceFloors.js b/modules/priceFloors.js index bf794d6ded4..5bca25671c0 100644 --- a/modules/priceFloors.js +++ b/modules/priceFloors.js @@ -6,7 +6,7 @@ import events from '../src/events.js'; import CONSTANTS from '../src/constants.json'; import { getHook } from '../src/hook.js'; import { createBid } from '../src/bidfactory.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { getRefererInfo } from '../src/refererDetection.js'; import {auctionManager} from '../src/auctionManager.js'; import {bidderSettings} from '../src/bidderSettings.js'; diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index 7c087753a24..e168339426d 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -3,7 +3,7 @@ import { ajax } from '../src/ajax.js'; import { config } from '../src/config.js'; import { getStorageManager } from '../src/storageManager.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'quantcast'; const DEFAULT_BID_FLOOR = 0.0000000001; diff --git a/modules/reconciliationRtdProvider.js b/modules/reconciliationRtdProvider.js index f3ba8c4ab9a..fc5f0ab621a 100644 --- a/modules/reconciliationRtdProvider.js +++ b/modules/reconciliationRtdProvider.js @@ -19,7 +19,7 @@ import { submodule } from '../src/hook.js'; import { ajaxBuilder } from '../src/ajax.js'; import { isGptPubadsDefined, timestamp, generateUUID, logError } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; /** @type {Object} */ const MessageType = { diff --git a/modules/roxotAnalyticsAdapter.js b/modules/roxotAnalyticsAdapter.js index c511521851c..c9245d4ae08 100644 --- a/modules/roxotAnalyticsAdapter.js +++ b/modules/roxotAnalyticsAdapter.js @@ -2,7 +2,7 @@ import { deepClone, getParameterByName, logInfo, logError } from '../src/utils.j import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import {ajaxBuilder} from '../src/ajax.js'; import { getStorageManager } from '../src/storageManager.js'; diff --git a/modules/rtbhouseBidAdapter.js b/modules/rtbhouseBidAdapter.js index 28902063ff7..a96abed9252 100644 --- a/modules/rtbhouseBidAdapter.js +++ b/modules/rtbhouseBidAdapter.js @@ -1,7 +1,7 @@ import { isArray, deepAccess, getOrigin, logError } from '../src/utils.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const BIDDER_CODE = 'rtbhouse'; const REGIONS = ['prebid-eu', 'prebid-us', 'prebid-asia']; diff --git a/modules/rtdModule/index.js b/modules/rtdModule/index.js index ff544fd783b..6c88d66999a 100644 --- a/modules/rtdModule/index.js +++ b/modules/rtdModule/index.js @@ -156,7 +156,7 @@ import {logError, logInfo, logWarn} from '../../src/utils.js'; import events from '../../src/events.js'; import CONSTANTS from '../../src/constants.json'; import {gdprDataHandler, uspDataHandler} from '../../src/adapterManager.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import {getGlobal} from '../../src/prebidGlobal.js'; /** @type {string} */ diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 195a8d5db90..9f3ba28a27c 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -2,7 +2,7 @@ import { mergeDeep, _each, logError, deepAccess, deepSetValue, isStr, isNumber, import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { Renderer } from '../src/Renderer.js'; import { getGlobal } from '../src/prebidGlobal.js'; diff --git a/modules/saambaaBidAdapter.js b/modules/saambaaBidAdapter.js index 125a71e76c0..2810853532d 100644 --- a/modules/saambaaBidAdapter.js +++ b/modules/saambaaBidAdapter.js @@ -1,420 +1,420 @@ -import { deepAccess, isFn, generateUUID, parseUrl, isEmpty, parseSizesInput } from '../src/utils.js'; -import { config } from '../src/config.js'; -import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { VIDEO, BANNER } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; - -const ADAPTER_VERSION = '1.0'; -const BIDDER_CODE = 'saambaa'; - -export const VIDEO_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid='; -export const BANNER_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid='; -export const OUTSTREAM_SRC = 'https://player-cdn.beachfrontmedia.com/playerapi/loader/outstream.js'; -export const VIDEO_TARGETING = ['mimes', 'playbackmethod', 'maxduration', 'skip', 'playerSize', 'context']; -export const DEFAULT_MIMES = ['video/mp4', 'application/javascript']; - -let pubid = ''; - -export const spec = { - code: BIDDER_CODE, - supportedMediaTypes: [BANNER, VIDEO], - - isBidRequestValid(bidRequest) { - if (typeof bidRequest != 'undefined') { - if (bidRequest.bidder !== BIDDER_CODE && typeof bidRequest.params === 'undefined') { return false; } - if (bidRequest === '' || bidRequest.params.placement === '' || bidRequest.params.pubid === '') { return false; } - return true; - } else { return false; } - }, - - buildRequests(bids, bidderRequest) { - let requests = []; - let videoBids = bids.filter(bid => isVideoBidValid(bid)); - let bannerBids = bids.filter(bid => isBannerBidValid(bid)); - videoBids.forEach(bid => { - pubid = getVideoBidParam(bid, 'pubid'); - requests.push({ - method: 'POST', - url: VIDEO_ENDPOINT + pubid, - data: createVideoRequestData(bid, bidderRequest), - bidRequest: bid - }); - }); - - bannerBids.forEach(bid => { - pubid = getBannerBidParam(bid, 'pubid'); - - requests.push({ - method: 'POST', - url: BANNER_ENDPOINT + pubid, - data: createBannerRequestData(bid, bidderRequest), - bidRequest: bid - }); - }); - return requests; - }, - - interpretResponse(serverResponse, {bidRequest}) { - let response = serverResponse.body; - if (response !== null && isEmpty(response) == false) { - if (isVideoBid(bidRequest)) { - let bidResponse = { - requestId: response.id, - bidderCode: BIDDER_CODE, - cpm: response.seatbid[0].bid[0].price, - width: response.seatbid[0].bid[0].w, - height: response.seatbid[0].bid[0].h, - ttl: response.seatbid[0].bid[0].ttl || 60, - creativeId: response.seatbid[0].bid[0].crid, - currency: response.cur, - meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain }, - mediaType: VIDEO, - netRevenue: true - } - - if (response.seatbid[0].bid[0].adm) { - bidResponse.vastXml = response.seatbid[0].bid[0].adm; - bidResponse.adResponse = { - content: response.seatbid[0].bid[0].adm - }; - } else { - bidResponse.vastUrl = response.seatbid[0].bid[0].nurl; - } - - return bidResponse; - } else { - return { - requestId: response.id, - bidderCode: BIDDER_CODE, - cpm: response.seatbid[0].bid[0].price, - width: response.seatbid[0].bid[0].w, - height: response.seatbid[0].bid[0].h, - ad: response.seatbid[0].bid[0].adm, - ttl: response.seatbid[0].bid[0].ttl || 60, - creativeId: response.seatbid[0].bid[0].crid, - currency: response.cur, - meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain }, - mediaType: BANNER, - netRevenue: true - } - } - } - } -}; - -function isBannerBid(bid) { - return deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); -} - -function isVideoBid(bid) { - return deepAccess(bid, 'mediaTypes.video'); -} - -function getBannerBidFloor(bid) { - let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {}; - return floorInfo.floor || getBannerBidParam(bid, 'bidfloor'); -} - -function getVideoBidFloor(bid) { - let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {}; - return floorInfo.floor || getVideoBidParam(bid, 'bidfloor'); -} - -function isVideoBidValid(bid) { - return isVideoBid(bid) && getVideoBidParam(bid, 'pubid') && getVideoBidParam(bid, 'placement'); -} - -function isBannerBidValid(bid) { - return isBannerBid(bid) && getBannerBidParam(bid, 'pubid') && getBannerBidParam(bid, 'placement'); -} - -function getVideoBidParam(bid, key) { - return deepAccess(bid, 'params.video.' + key) || deepAccess(bid, 'params.' + key); -} - -function getBannerBidParam(bid, key) { - return deepAccess(bid, 'params.banner.' + key) || deepAccess(bid, 'params.' + key); -} - -function isMobile() { - return (/(ios|ipod|ipad|iphone|android)/i).test(navigator.userAgent); -} - -function isConnectedTV() { - return (/(smart[-]?tv|hbbtv|appletv|googletv|hdmi|netcast\.tv|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b)/i).test(navigator.userAgent); -} - -function getDoNotTrack() { - return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes'; -} - -function findAndFillParam(o, key, value) { - try { - if (typeof value === 'function') { - o[key] = value(); - } else { - o[key] = value; - } - } catch (ex) {} -} - -function getOsVersion() { - let clientStrings = [ - { s: 'Android', r: /Android/ }, - { s: 'iOS', r: /(iPhone|iPad|iPod)/ }, - { s: 'Mac OS X', r: /Mac OS X/ }, - { s: 'Mac OS', r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ }, - { s: 'Linux', r: /(Linux|X11)/ }, - { s: 'Windows 10', r: /(Windows 10.0|Windows NT 10.0)/ }, - { s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ }, - { s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ }, - { s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ }, - { s: 'Windows Vista', r: /Windows NT 6.0/ }, - { s: 'Windows Server 2003', r: /Windows NT 5.2/ }, - { s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ }, - { s: 'UNIX', r: /UNIX/ }, - { s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ } - ]; - let cs = find(clientStrings, cs => cs.r.test(navigator.userAgent)); - return cs ? cs.s : 'unknown'; -} - -function getFirstSize(sizes) { - return (sizes && sizes.length) ? sizes[0] : { w: undefined, h: undefined }; -} - -function parseSizes(sizes) { - return parseSizesInput(sizes).map(size => { - let [ width, height ] = size.split('x'); - return { - w: parseInt(width, 10) || undefined, - h: parseInt(height, 10) || undefined - }; - }); -} - -function getVideoSizes(bid) { - return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); -} - -function getBannerSizes(bid) { - return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); -} - -function getTopWindowReferrer() { - try { - return window.top.document.referrer; - } catch (e) { - return ''; - } -} - -function getVideoTargetingParams(bid) { - const result = {}; - const excludeProps = ['playerSize', 'context', 'w', 'h']; - Object.keys(Object(bid.mediaTypes.video)) - .filter(key => !includes(excludeProps, key)) - .forEach(key => { - result[ key ] = bid.mediaTypes.video[ key ]; - }); - Object.keys(Object(bid.params.video)) - .filter(key => includes(VIDEO_TARGETING, key)) - .forEach(key => { - result[ key ] = bid.params.video[ key ]; - }); - return result; -} - -function createVideoRequestData(bid, bidderRequest) { - let topLocation = getTopWindowLocation(bidderRequest); - let topReferrer = getTopWindowReferrer(); - - // if size is explicitly given via adapter params - let paramSize = getVideoBidParam(bid, 'size'); - let sizes = []; - let coppa = config.getConfig('coppa'); - - if (typeof paramSize !== 'undefined' && paramSize != '') { - sizes = parseSizes(paramSize); - } else { - sizes = getVideoSizes(bid); - } - const firstSize = getFirstSize(sizes); - let floor = (getVideoBidFloor(bid) == null || typeof getVideoBidFloor(bid) == 'undefined') ? 0.5 : getVideoBidFloor(bid); - let video = getVideoTargetingParams(bid); - const o = { - 'device': { - 'langauge': (global.navigator.language).split('-')[0], - 'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0), - 'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2, - 'js': 1, - 'os': getOsVersion() - }, - 'at': 2, - 'site': {}, - 'tmax': 3000, - 'cur': ['USD'], - 'id': bid.bidId, - 'imp': [], - 'regs': { - 'ext': { - } - }, - 'user': { - 'ext': { - } - } - }; - - o.site['page'] = topLocation.href; - o.site['domain'] = topLocation.hostname; - o.site['search'] = topLocation.search; - o.site['domain'] = topLocation.hostname; - o.site['ref'] = topReferrer; - o.site['mobile'] = isMobile() ? 1 : 0; - const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0; - - o.device['dnt'] = getDoNotTrack() ? 1 : 0; - - findAndFillParam(o.site, 'name', function() { - return global.top.document.title; - }); - - findAndFillParam(o.device, 'h', function() { - return global.screen.height; - }); - findAndFillParam(o.device, 'w', function() { - return global.screen.width; - }); - - let placement = getVideoBidParam(bid, 'placement'); - - for (let j = 0; j < sizes.length; j++) { - o.imp.push({ - 'id': '' + j, - 'displaymanager': '' + BIDDER_CODE, - 'displaymanagerver': '' + ADAPTER_VERSION, - 'tagId': placement, - 'bidfloor': floor, - 'bidfloorcur': 'USD', - 'secure': secure, - 'video': Object.assign({ - 'id': generateUUID(), - 'pos': 0, - 'w': firstSize.w, - 'h': firstSize.h, - 'mimes': DEFAULT_MIMES - }, video) - - }); - } - if (coppa) { - o.regs.ext = {'coppa': 1}; - } - if (bidderRequest && bidderRequest.gdprConsent) { - let { gdprApplies, consentString } = bidderRequest.gdprConsent; - o.regs.ext = {'gdpr': gdprApplies ? 1 : 0}; - o.user.ext = {'consent': consentString}; - } - - return o; -} - -function getTopWindowLocation(bidderRequest) { - let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; - return parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); -} - -function createBannerRequestData(bid, bidderRequest) { - let topLocation = getTopWindowLocation(bidderRequest); - let topReferrer = getTopWindowReferrer(); - - // if size is explicitly given via adapter params - - let paramSize = getBannerBidParam(bid, 'size'); - let sizes = []; - let coppa = config.getConfig('coppa'); - if (typeof paramSize !== 'undefined' && paramSize != '') { - sizes = parseSizes(paramSize); - } else { - sizes = getBannerSizes(bid); - } - - let floor = (getBannerBidFloor(bid) == null || typeof getBannerBidFloor(bid) == 'undefined') ? 0.1 : getBannerBidFloor(bid); - const o = { - 'device': { - 'langauge': (global.navigator.language).split('-')[0], - 'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0), - 'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2, - 'js': 1 - }, - 'at': 2, - 'site': {}, - 'tmax': 3000, - 'cur': ['USD'], - 'id': bid.bidId, - 'imp': [], - 'regs': { - 'ext': { - } - }, - 'user': { - 'ext': { - } - } - }; - - o.site['page'] = topLocation.href; - o.site['domain'] = topLocation.hostname; - o.site['search'] = topLocation.search; - o.site['domain'] = topLocation.hostname; - o.site['ref'] = topReferrer; - o.site['mobile'] = isMobile() ? 1 : 0; - const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0; - - o.device['dnt'] = getDoNotTrack() ? 1 : 0; - - findAndFillParam(o.site, 'name', function() { - return global.top.document.title; - }); - - findAndFillParam(o.device, 'h', function() { - return global.screen.height; - }); - findAndFillParam(o.device, 'w', function() { - return global.screen.width; - }); - - let placement = getBannerBidParam(bid, 'placement'); - for (let j = 0; j < sizes.length; j++) { - let size = sizes[j]; - - o.imp.push({ - 'id': '' + j, - 'displaymanager': '' + BIDDER_CODE, - 'displaymanagerver': '' + ADAPTER_VERSION, - 'tagId': placement, - 'bidfloor': floor, - 'bidfloorcur': 'USD', - 'secure': secure, - 'banner': { - 'id': generateUUID(), - 'pos': 0, - 'w': size['w'], - 'h': size['h'] - } - }); - } - if (coppa) { - o.regs.ext = {'coppa': 1}; - } - if (bidderRequest && bidderRequest.gdprConsent) { - let { gdprApplies, consentString } = bidderRequest.gdprConsent; - o.regs.ext = {'gdpr': gdprApplies ? 1 : 0}; - o.user.ext = {'consent': consentString}; - } - - return o; -} -registerBidder(spec); +import { deepAccess, isFn, generateUUID, parseUrl, isEmpty, parseSizesInput } from '../src/utils.js'; +import { config } from '../src/config.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { VIDEO, BANNER } from '../src/mediaTypes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; + +const ADAPTER_VERSION = '1.0'; +const BIDDER_CODE = 'saambaa'; + +export const VIDEO_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid='; +export const BANNER_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid='; +export const OUTSTREAM_SRC = 'https://player-cdn.beachfrontmedia.com/playerapi/loader/outstream.js'; +export const VIDEO_TARGETING = ['mimes', 'playbackmethod', 'maxduration', 'skip', 'playerSize', 'context']; +export const DEFAULT_MIMES = ['video/mp4', 'application/javascript']; + +let pubid = ''; + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, VIDEO], + + isBidRequestValid(bidRequest) { + if (typeof bidRequest != 'undefined') { + if (bidRequest.bidder !== BIDDER_CODE && typeof bidRequest.params === 'undefined') { return false; } + if (bidRequest === '' || bidRequest.params.placement === '' || bidRequest.params.pubid === '') { return false; } + return true; + } else { return false; } + }, + + buildRequests(bids, bidderRequest) { + let requests = []; + let videoBids = bids.filter(bid => isVideoBidValid(bid)); + let bannerBids = bids.filter(bid => isBannerBidValid(bid)); + videoBids.forEach(bid => { + pubid = getVideoBidParam(bid, 'pubid'); + requests.push({ + method: 'POST', + url: VIDEO_ENDPOINT + pubid, + data: createVideoRequestData(bid, bidderRequest), + bidRequest: bid + }); + }); + + bannerBids.forEach(bid => { + pubid = getBannerBidParam(bid, 'pubid'); + + requests.push({ + method: 'POST', + url: BANNER_ENDPOINT + pubid, + data: createBannerRequestData(bid, bidderRequest), + bidRequest: bid + }); + }); + return requests; + }, + + interpretResponse(serverResponse, {bidRequest}) { + let response = serverResponse.body; + if (response !== null && isEmpty(response) == false) { + if (isVideoBid(bidRequest)) { + let bidResponse = { + requestId: response.id, + bidderCode: BIDDER_CODE, + cpm: response.seatbid[0].bid[0].price, + width: response.seatbid[0].bid[0].w, + height: response.seatbid[0].bid[0].h, + ttl: response.seatbid[0].bid[0].ttl || 60, + creativeId: response.seatbid[0].bid[0].crid, + currency: response.cur, + meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain }, + mediaType: VIDEO, + netRevenue: true + } + + if (response.seatbid[0].bid[0].adm) { + bidResponse.vastXml = response.seatbid[0].bid[0].adm; + bidResponse.adResponse = { + content: response.seatbid[0].bid[0].adm + }; + } else { + bidResponse.vastUrl = response.seatbid[0].bid[0].nurl; + } + + return bidResponse; + } else { + return { + requestId: response.id, + bidderCode: BIDDER_CODE, + cpm: response.seatbid[0].bid[0].price, + width: response.seatbid[0].bid[0].w, + height: response.seatbid[0].bid[0].h, + ad: response.seatbid[0].bid[0].adm, + ttl: response.seatbid[0].bid[0].ttl || 60, + creativeId: response.seatbid[0].bid[0].crid, + currency: response.cur, + meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain }, + mediaType: BANNER, + netRevenue: true + } + } + } + } +}; + +function isBannerBid(bid) { + return deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); +} + +function isVideoBid(bid) { + return deepAccess(bid, 'mediaTypes.video'); +} + +function getBannerBidFloor(bid) { + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {}; + return floorInfo.floor || getBannerBidParam(bid, 'bidfloor'); +} + +function getVideoBidFloor(bid) { + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {}; + return floorInfo.floor || getVideoBidParam(bid, 'bidfloor'); +} + +function isVideoBidValid(bid) { + return isVideoBid(bid) && getVideoBidParam(bid, 'pubid') && getVideoBidParam(bid, 'placement'); +} + +function isBannerBidValid(bid) { + return isBannerBid(bid) && getBannerBidParam(bid, 'pubid') && getBannerBidParam(bid, 'placement'); +} + +function getVideoBidParam(bid, key) { + return deepAccess(bid, 'params.video.' + key) || deepAccess(bid, 'params.' + key); +} + +function getBannerBidParam(bid, key) { + return deepAccess(bid, 'params.banner.' + key) || deepAccess(bid, 'params.' + key); +} + +function isMobile() { + return (/(ios|ipod|ipad|iphone|android)/i).test(navigator.userAgent); +} + +function isConnectedTV() { + return (/(smart[-]?tv|hbbtv|appletv|googletv|hdmi|netcast\.tv|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b)/i).test(navigator.userAgent); +} + +function getDoNotTrack() { + return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes'; +} + +function findAndFillParam(o, key, value) { + try { + if (typeof value === 'function') { + o[key] = value(); + } else { + o[key] = value; + } + } catch (ex) {} +} + +function getOsVersion() { + let clientStrings = [ + { s: 'Android', r: /Android/ }, + { s: 'iOS', r: /(iPhone|iPad|iPod)/ }, + { s: 'Mac OS X', r: /Mac OS X/ }, + { s: 'Mac OS', r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ }, + { s: 'Linux', r: /(Linux|X11)/ }, + { s: 'Windows 10', r: /(Windows 10.0|Windows NT 10.0)/ }, + { s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ }, + { s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ }, + { s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ }, + { s: 'Windows Vista', r: /Windows NT 6.0/ }, + { s: 'Windows Server 2003', r: /Windows NT 5.2/ }, + { s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ }, + { s: 'UNIX', r: /UNIX/ }, + { s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ } + ]; + let cs = find(clientStrings, cs => cs.r.test(navigator.userAgent)); + return cs ? cs.s : 'unknown'; +} + +function getFirstSize(sizes) { + return (sizes && sizes.length) ? sizes[0] : { w: undefined, h: undefined }; +} + +function parseSizes(sizes) { + return parseSizesInput(sizes).map(size => { + let [ width, height ] = size.split('x'); + return { + w: parseInt(width, 10) || undefined, + h: parseInt(height, 10) || undefined + }; + }); +} + +function getVideoSizes(bid) { + return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); +} + +function getBannerSizes(bid) { + return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); +} + +function getTopWindowReferrer() { + try { + return window.top.document.referrer; + } catch (e) { + return ''; + } +} + +function getVideoTargetingParams(bid) { + const result = {}; + const excludeProps = ['playerSize', 'context', 'w', 'h']; + Object.keys(Object(bid.mediaTypes.video)) + .filter(key => !includes(excludeProps, key)) + .forEach(key => { + result[ key ] = bid.mediaTypes.video[ key ]; + }); + Object.keys(Object(bid.params.video)) + .filter(key => includes(VIDEO_TARGETING, key)) + .forEach(key => { + result[ key ] = bid.params.video[ key ]; + }); + return result; +} + +function createVideoRequestData(bid, bidderRequest) { + let topLocation = getTopWindowLocation(bidderRequest); + let topReferrer = getTopWindowReferrer(); + + // if size is explicitly given via adapter params + let paramSize = getVideoBidParam(bid, 'size'); + let sizes = []; + let coppa = config.getConfig('coppa'); + + if (typeof paramSize !== 'undefined' && paramSize != '') { + sizes = parseSizes(paramSize); + } else { + sizes = getVideoSizes(bid); + } + const firstSize = getFirstSize(sizes); + let floor = (getVideoBidFloor(bid) == null || typeof getVideoBidFloor(bid) == 'undefined') ? 0.5 : getVideoBidFloor(bid); + let video = getVideoTargetingParams(bid); + const o = { + 'device': { + 'langauge': (global.navigator.language).split('-')[0], + 'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0), + 'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2, + 'js': 1, + 'os': getOsVersion() + }, + 'at': 2, + 'site': {}, + 'tmax': 3000, + 'cur': ['USD'], + 'id': bid.bidId, + 'imp': [], + 'regs': { + 'ext': { + } + }, + 'user': { + 'ext': { + } + } + }; + + o.site['page'] = topLocation.href; + o.site['domain'] = topLocation.hostname; + o.site['search'] = topLocation.search; + o.site['domain'] = topLocation.hostname; + o.site['ref'] = topReferrer; + o.site['mobile'] = isMobile() ? 1 : 0; + const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0; + + o.device['dnt'] = getDoNotTrack() ? 1 : 0; + + findAndFillParam(o.site, 'name', function() { + return global.top.document.title; + }); + + findAndFillParam(o.device, 'h', function() { + return global.screen.height; + }); + findAndFillParam(o.device, 'w', function() { + return global.screen.width; + }); + + let placement = getVideoBidParam(bid, 'placement'); + + for (let j = 0; j < sizes.length; j++) { + o.imp.push({ + 'id': '' + j, + 'displaymanager': '' + BIDDER_CODE, + 'displaymanagerver': '' + ADAPTER_VERSION, + 'tagId': placement, + 'bidfloor': floor, + 'bidfloorcur': 'USD', + 'secure': secure, + 'video': Object.assign({ + 'id': generateUUID(), + 'pos': 0, + 'w': firstSize.w, + 'h': firstSize.h, + 'mimes': DEFAULT_MIMES + }, video) + + }); + } + if (coppa) { + o.regs.ext = {'coppa': 1}; + } + if (bidderRequest && bidderRequest.gdprConsent) { + let { gdprApplies, consentString } = bidderRequest.gdprConsent; + o.regs.ext = {'gdpr': gdprApplies ? 1 : 0}; + o.user.ext = {'consent': consentString}; + } + + return o; +} + +function getTopWindowLocation(bidderRequest) { + let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; + return parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); +} + +function createBannerRequestData(bid, bidderRequest) { + let topLocation = getTopWindowLocation(bidderRequest); + let topReferrer = getTopWindowReferrer(); + + // if size is explicitly given via adapter params + + let paramSize = getBannerBidParam(bid, 'size'); + let sizes = []; + let coppa = config.getConfig('coppa'); + if (typeof paramSize !== 'undefined' && paramSize != '') { + sizes = parseSizes(paramSize); + } else { + sizes = getBannerSizes(bid); + } + + let floor = (getBannerBidFloor(bid) == null || typeof getBannerBidFloor(bid) == 'undefined') ? 0.1 : getBannerBidFloor(bid); + const o = { + 'device': { + 'langauge': (global.navigator.language).split('-')[0], + 'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0), + 'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2, + 'js': 1 + }, + 'at': 2, + 'site': {}, + 'tmax': 3000, + 'cur': ['USD'], + 'id': bid.bidId, + 'imp': [], + 'regs': { + 'ext': { + } + }, + 'user': { + 'ext': { + } + } + }; + + o.site['page'] = topLocation.href; + o.site['domain'] = topLocation.hostname; + o.site['search'] = topLocation.search; + o.site['domain'] = topLocation.hostname; + o.site['ref'] = topReferrer; + o.site['mobile'] = isMobile() ? 1 : 0; + const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0; + + o.device['dnt'] = getDoNotTrack() ? 1 : 0; + + findAndFillParam(o.site, 'name', function() { + return global.top.document.title; + }); + + findAndFillParam(o.device, 'h', function() { + return global.screen.height; + }); + findAndFillParam(o.device, 'w', function() { + return global.screen.width; + }); + + let placement = getBannerBidParam(bid, 'placement'); + for (let j = 0; j < sizes.length; j++) { + let size = sizes[j]; + + o.imp.push({ + 'id': '' + j, + 'displaymanager': '' + BIDDER_CODE, + 'displaymanagerver': '' + ADAPTER_VERSION, + 'tagId': placement, + 'bidfloor': floor, + 'bidfloorcur': 'USD', + 'secure': secure, + 'banner': { + 'id': generateUUID(), + 'pos': 0, + 'w': size['w'], + 'h': size['h'] + } + }); + } + if (coppa) { + o.regs.ext = {'coppa': 1}; + } + if (bidderRequest && bidderRequest.gdprConsent) { + let { gdprApplies, consentString } = bidderRequest.gdprConsent; + o.regs.ext = {'gdpr': gdprApplies ? 1 : 0}; + o.user.ext = {'consent': consentString}; + } + + return o; +} +registerBidder(spec); diff --git a/modules/sigmoidAnalyticsAdapter.js b/modules/sigmoidAnalyticsAdapter.js index d65e25bd06a..da0ca9e38e5 100644 --- a/modules/sigmoidAnalyticsAdapter.js +++ b/modules/sigmoidAnalyticsAdapter.js @@ -1,6 +1,6 @@ /* Sigmoid Analytics Adapter for prebid.js v1.1.0-pre Updated : 2018-03-28 */ -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; diff --git a/modules/sirdataRtdProvider.js b/modules/sirdataRtdProvider.js index 23eecc18a11..344357bcb62 100644 --- a/modules/sirdataRtdProvider.js +++ b/modules/sirdataRtdProvider.js @@ -10,7 +10,7 @@ import {getGlobal} from '../src/prebidGlobal.js'; import { deepAccess, logError, deepEqual, deepSetValue, isEmpty, mergeDeep } from '../src/utils.js'; import {submodule} from '../src/hook.js'; import {ajax} from '../src/ajax.js'; -import findIndex from 'prebidjs-polyfill/findIndex.js'; +import findIndex from 'core-js-pure/features/array/find-index.js'; import { getRefererInfo } from '../src/refererDetection.js'; import { config } from '../src/config.js'; diff --git a/modules/sizeMappingV2.js b/modules/sizeMappingV2.js index a641b15e549..b3a6d32b2d8 100644 --- a/modules/sizeMappingV2.js +++ b/modules/sizeMappingV2.js @@ -6,7 +6,7 @@ import { isArray, logError, isArrayOfNums, deepClone, logWarn, getWindowTop, deepEqual, logInfo, isValidMediaTypes, deepAccess, getDefinedParams, getUniqueIdentifierStr, flatten } from '../src/utils.js'; import { adunitCounter } from '../src/adUnits.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { getHook } from '../src/hook.js'; import { adUnitSetupChecks } from '../src/prebid.js'; diff --git a/modules/smarticoBidAdapter.js b/modules/smarticoBidAdapter.js index a43424ff793..2399a12f932 100644 --- a/modules/smarticoBidAdapter.js +++ b/modules/smarticoBidAdapter.js @@ -1,6 +1,6 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const SMARTICO_CONFIG = { bidRequestUrl: 'https://trmads.eu/preBidRequest', diff --git a/modules/sovrnAnalyticsAdapter.js b/modules/sovrnAnalyticsAdapter.js index 305c1ff4556..aee7ddd2690 100644 --- a/modules/sovrnAnalyticsAdapter.js +++ b/modules/sovrnAnalyticsAdapter.js @@ -4,8 +4,8 @@ import adaptermanager from '../src/adapterManager.js' import CONSTANTS from '../src/constants.json' import {ajaxBuilder} from '../src/ajax.js' import {config} from '../src/config.js' -import find from 'prebidjs-polyfill/find.js' -import includes from 'prebidjs-polyfill/includes.js' +import find from 'core-js-pure/features/array/find.js' +import includes from 'core-js-pure/features/array/includes.js' const ajax = ajaxBuilder(0) diff --git a/modules/sspBCBidAdapter.js b/modules/sspBCBidAdapter.js index 740d91546f4..02b786f4fd2 100644 --- a/modules/sspBCBidAdapter.js +++ b/modules/sspBCBidAdapter.js @@ -2,7 +2,7 @@ import { isArray, deepAccess, logWarn, parseUrl } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import strIncludes from 'prebidjs-polyfill/includes.js'; +import strIncludes from 'core-js-pure/features/string/includes.js'; const BIDDER_CODE = 'sspBC'; const BIDDER_URL = 'https://ssp.wp.pl/bidder/'; diff --git a/modules/synacormediaBidAdapter.js b/modules/synacormediaBidAdapter.js index d8c8e2504ac..96616bb6a48 100644 --- a/modules/synacormediaBidAdapter.js +++ b/modules/synacormediaBidAdapter.js @@ -3,7 +3,7 @@ import { getAdUnitSizes, logWarn, deepSetValue, isFn, isPlainObject } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; import {config} from '../src/config.js'; const BID_SCHEME = 'https://'; diff --git a/modules/targetVideoBidAdapter.js b/modules/targetVideoBidAdapter.js index 87fe318b13d..5714916c131 100644 --- a/modules/targetVideoBidAdapter.js +++ b/modules/targetVideoBidAdapter.js @@ -1,4 +1,4 @@ -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { getBidRequest } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; diff --git a/modules/userId/index.js b/modules/userId/index.js index 2ed4825013c..42fff2cd16c 100644 --- a/modules/userId/index.js +++ b/modules/userId/index.js @@ -130,7 +130,7 @@ * @property {(string[]|undefined)} submoduleNames - submodules to refresh */ -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { config } from '../../src/config.js'; import events from '../../src/events.js'; import { getGlobal } from '../../src/prebidGlobal.js'; @@ -143,7 +143,7 @@ import { getPrebidInternal, isPlainObject, logError, isArray, cyrb53Hash, deepAccess, timestamp, delayExecution, logInfo, isFn, logWarn, isEmptyStr, isNumber, isGptPubadsDefined } from '../../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'User ID'; const COOKIE = 'cookie'; diff --git a/modules/ventesBidAdapter.js b/modules/ventesBidAdapter.js index 53d282dbe63..a9de52a86ba 100644 --- a/modules/ventesBidAdapter.js +++ b/modules/ventesBidAdapter.js @@ -11,7 +11,7 @@ import { isPlainObject, replaceAuctionPrice } from '../src/utils.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; diff --git a/modules/verizonMediaIdSystem.js b/modules/verizonMediaIdSystem.js index 23b6bb9c63d..280a6c47894 100644 --- a/modules/verizonMediaIdSystem.js +++ b/modules/verizonMediaIdSystem.js @@ -8,7 +8,7 @@ import {ajax} from '../src/ajax.js'; import {submodule} from '../src/hook.js'; import { logError, formatQS } from '../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'verizonMediaId'; const VENDOR_ID = 25; diff --git a/modules/viewability.js b/modules/viewability.js index 4a8bea688a8..b12c53b7f59 100644 --- a/modules/viewability.js +++ b/modules/viewability.js @@ -1,6 +1,6 @@ import { logWarn, logInfo, isStr, isFn, triggerPixel, insertHtmlIntoIframe } from '../src/utils.js'; import { getGlobal } from '../src/prebidGlobal.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; export const MODULE_NAME = 'viewability'; diff --git a/modules/viewdeosDXBidAdapter.js b/modules/viewdeosDXBidAdapter.js index 47dcbaa8cf4..e3d02938c5b 100644 --- a/modules/viewdeosDXBidAdapter.js +++ b/modules/viewdeosDXBidAdapter.js @@ -2,7 +2,7 @@ import { deepAccess, isArray, flatten, logError, parseSizesInput } from '../src/ import {registerBidder} from '../src/adapters/bidderFactory.js'; import {VIDEO, BANNER} from '../src/mediaTypes.js'; import {Renderer} from '../src/Renderer.js'; -import findIndex from 'prebidjs-polyfill/findIndex.js'; +import findIndex from 'core-js-pure/features/array/find-index.js'; const URL = 'https://ghb.sync.viewdeos.com/auction/'; const OUTSTREAM_SRC = 'https://player.sync.viewdeos.com/outstream-unit/2.01/outstream.min.js'; diff --git a/modules/voxBidAdapter.js b/modules/voxBidAdapter.js index c75392e59e1..8db97800630 100644 --- a/modules/voxBidAdapter.js +++ b/modules/voxBidAdapter.js @@ -1,7 +1,7 @@ import { _map, logWarn, deepAccess, isArray } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js' import {BANNER, VIDEO} from '../src/mediaTypes.js' -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; import {auctionManager} from '../src/auctionManager.js'; import {Renderer} from '../src/Renderer.js'; diff --git a/modules/waardexBidAdapter.js b/modules/waardexBidAdapter.js index 82932951f7c..ee17a71dd35 100644 --- a/modules/waardexBidAdapter.js +++ b/modules/waardexBidAdapter.js @@ -2,7 +2,7 @@ import { logError, isArray, deepAccess, getBidIdParameter } from '../src/utils.j import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; -import find from 'prebidjs-polyfill/find.js'; +import find from 'core-js-pure/features/array/find.js'; const ENDPOINT = `https://hb.justbidit.xyz:8843/prebid`; const BIDDER_CODE = 'waardex'; diff --git a/modules/widespaceBidAdapter.js b/modules/widespaceBidAdapter.js index 21876542d43..7890628f94b 100644 --- a/modules/widespaceBidAdapter.js +++ b/modules/widespaceBidAdapter.js @@ -4,8 +4,8 @@ import { parseQueryStringParameters, parseSizesInput } from '../src/utils.js'; -import includes from 'prebidjs-polyfill/includes.js'; -import find from 'prebidjs-polyfill/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; +import find from 'core-js-pure/features/array/find.js'; import { getStorageManager } from '../src/storageManager.js'; export const storage = getStorageManager(); diff --git a/modules/winrBidAdapter.js b/modules/winrBidAdapter.js index fa3b7311478..9213c113460 100644 --- a/modules/winrBidAdapter.js +++ b/modules/winrBidAdapter.js @@ -2,8 +2,8 @@ import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; -import find from 'prebidjs-polyfill/find.js'; -import includes from 'prebidjs-polyfill/includes.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; import { getStorageManager } from '../src/storageManager.js'; export const storage = getStorageManager(); @@ -39,9 +39,9 @@ function wrapAd(bid, position) { - +