prebid.js 7.22.0 → 7.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/aaxBlockmeterRtdProvider.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/admaticBidAdapter.js +1 -0
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/analyticsAdapter.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/audiencerunBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidViewability.js +1 -1
  21. package/dist/bidViewabilityIO.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/browsiRtdProvider.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -0
  30. package/dist/cleanioRtdProvider.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consentManagement.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/currency.js +1 -1
  41. package/dist/dependencies.json +19 -0
  42. package/dist/dfpAdServerVideo.js +1 -1
  43. package/dist/dgkeywordRtdProvider.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/gdprEnforcement.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/gmosspBidAdapter.js +1 -1
  50. package/dist/goldbachBidAdapter.js +1 -1
  51. package/dist/googleAnalyticsAdapter.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gridNMBidAdapter.js +1 -1
  54. package/dist/growthCodeIdSystem.js +1 -1
  55. package/dist/gumgumBidAdapter.js +1 -1
  56. package/dist/h12mediaBidAdapter.js +1 -1
  57. package/dist/id5AnalyticsAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/impactifyBidAdapter.js +1 -1
  60. package/dist/improvedigitalBidAdapter.js +1 -1
  61. package/dist/inmarBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/instreamTracking.js +1 -1
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/jixieBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/jwplayerVideoProvider.js +1 -0
  68. package/dist/kargoBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -0
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  75. package/dist/logicadBidAdapter.js +1 -1
  76. package/dist/loglyliftBidAdapter.js +1 -1
  77. package/dist/magniteAnalyticsAdapter.js +1 -1
  78. package/dist/malltvAnalyticsAdapter.js +1 -1
  79. package/dist/marsmediaBidAdapter.js +1 -1
  80. package/dist/mediafuseBidAdapter.js +1 -1
  81. package/dist/mediakeysBidAdapter.js +1 -1
  82. package/dist/mediasquareBidAdapter.js +1 -1
  83. package/dist/mgidBidAdapter.js +1 -1
  84. package/dist/mgidRtdProvider.js +1 -0
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/multibid.js +1 -1
  87. package/dist/not-for-prod/prebid.js +153 -141
  88. package/dist/oguryBidAdapter.js +1 -1
  89. package/dist/onetagBidAdapter.js +1 -1
  90. package/dist/ooloAnalyticsAdapter.js +1 -1
  91. package/dist/openxOrtbBidAdapter.js +1 -1
  92. package/dist/ortbConverter.js +1 -0
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionRtdProvider.js +1 -0
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pbsExtensions.js +1 -0
  97. package/dist/permutiveRtdProvider.js +1 -1
  98. package/dist/pixfutureBidAdapter.js +1 -1
  99. package/dist/prebid-core.js +1 -1
  100. package/dist/prebidServerBidAdapter.js +1 -1
  101. package/dist/priceFloors.js +1 -1
  102. package/dist/pubCommonId.js +1 -1
  103. package/dist/publinkIdSystem.js +1 -1
  104. package/dist/pubmaticBidAdapter.js +1 -1
  105. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  106. package/dist/pxyzBidAdapter.js +1 -1
  107. package/dist/quantcastBidAdapter.js +1 -1
  108. package/dist/readpeakBidAdapter.js +1 -1
  109. package/dist/relaidoBidAdapter.js +1 -1
  110. package/dist/rhythmoneBidAdapter.js +1 -1
  111. package/dist/riseBidAdapter.js +1 -1
  112. package/dist/rtdModule.js +1 -1
  113. package/dist/rubiconAnalyticsAdapter.js +1 -1
  114. package/dist/rubiconBidAdapter.js +1 -1
  115. package/dist/schain.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  119. package/dist/sharethroughBidAdapter.js +1 -1
  120. package/dist/shinezBidAdapter.js +1 -1
  121. package/dist/smaatoBidAdapter.js +1 -1
  122. package/dist/smartadserverBidAdapter.js +1 -1
  123. package/dist/smartxBidAdapter.js +1 -1
  124. package/dist/smilewantedBidAdapter.js +1 -1
  125. package/dist/sonobiBidAdapter.js +1 -1
  126. package/dist/sovrnAnalyticsAdapter.js +1 -1
  127. package/dist/sovrnBidAdapter.js +1 -1
  128. package/dist/spotxBidAdapter.js +1 -1
  129. package/dist/sspBCBidAdapter.js +1 -1
  130. package/dist/sublimeBidAdapter.js +1 -1
  131. package/dist/synacormediaBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/teadsIdSystem.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/ttdBidAdapter.js +1 -1
  138. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  139. package/dist/underdogmediaBidAdapter.js +1 -1
  140. package/dist/undertoneBidAdapter.js +1 -1
  141. package/dist/userId.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/video.js +1 -0
  144. package/dist/videoModule.js +1 -0
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/videojsVideoProvider.js +1 -0
  147. package/dist/visxBidAdapter.js +1 -1
  148. package/dist/vuukleBidAdapter.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
  155. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
  156. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
  157. package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
  158. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
  159. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
  160. package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
  161. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
  162. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
  163. package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
  164. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
  165. package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
  166. package/integrationExamples/videoModule/videojs/playlist.html +151 -0
  167. package/libraries/ortbConverter/README.md +378 -0
  168. package/libraries/ortbConverter/converter.js +135 -0
  169. package/libraries/ortbConverter/lib/composer.js +43 -0
  170. package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
  171. package/libraries/ortbConverter/lib/sizes.js +14 -0
  172. package/libraries/ortbConverter/processors/banner.js +40 -0
  173. package/libraries/ortbConverter/processors/default.js +167 -0
  174. package/libraries/ortbConverter/processors/mediaType.js +21 -0
  175. package/libraries/ortbConverter/processors/native.js +37 -0
  176. package/libraries/ortbConverter/processors/video.js +66 -0
  177. package/libraries/pbsExtensions/pbsExtensions.js +12 -0
  178. package/libraries/pbsExtensions/processors/aliases.js +17 -0
  179. package/libraries/pbsExtensions/processors/mediaType.js +23 -0
  180. package/libraries/pbsExtensions/processors/params.js +22 -0
  181. package/libraries/pbsExtensions/processors/pbs.js +99 -0
  182. package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
  183. package/libraries/pbsExtensions/processors/video.js +23 -0
  184. package/libraries/video/constants/enums.js +5 -0
  185. package/libraries/video/constants/events.js +97 -0
  186. package/libraries/video/constants/ortb.js +169 -0
  187. package/libraries/video/constants/vendorCodes.js +6 -0
  188. package/libraries/video/shared/eventHandler.js +18 -0
  189. package/libraries/video/shared/parentModule.js +82 -0
  190. package/libraries/video/shared/state.js +47 -0
  191. package/libraries/video/shared/vastXmlBuilder.js +77 -0
  192. package/libraries/video/shared/vastXmlEditor.js +115 -0
  193. package/modules/.submodules.json +7 -1
  194. package/modules/aaxBlockmeterRtdProvider.js +59 -0
  195. package/modules/aaxBlockmeterRtdProvider.md +48 -0
  196. package/modules/admaticBidAdapter.js +147 -0
  197. package/modules/admaticBidAdapter.md +48 -0
  198. package/modules/amxBidAdapter.js +1 -0
  199. package/modules/appnexusBidAdapter.js +38 -1
  200. package/modules/chtnwBidAdapter.js +110 -0
  201. package/modules/chtnwBidAdapter.md +31 -0
  202. package/modules/concertBidAdapter.js +44 -2
  203. package/modules/connectIdSystem.js +36 -23
  204. package/modules/connectIdSystem.md +3 -2
  205. package/modules/consentManagement.js +22 -1
  206. package/modules/consentManagementUsp.js +29 -7
  207. package/modules/criteoBidAdapter.js +25 -5
  208. package/modules/currency.js +9 -0
  209. package/modules/dgkeywordRtdProvider.js +3 -3
  210. package/modules/gridNMBidAdapter.js +10 -14
  211. package/modules/growthCodeIdSystem.js +9 -5
  212. package/modules/gumgumBidAdapter.js +4 -0
  213. package/modules/improvedigitalBidAdapter.js +191 -470
  214. package/modules/ixBidAdapter.js +54 -71
  215. package/modules/jwplayerVideoProvider.js +929 -0
  216. package/modules/jwplayerVideoProvider.md +25 -0
  217. package/modules/kargoBidAdapter.js +1 -1
  218. package/modules/kueezRtbBidAdapter.js +278 -0
  219. package/modules/kueezRtbBidAdapter.md +35 -0
  220. package/modules/magniteAnalyticsAdapter.js +6 -1
  221. package/modules/mgidRtdProvider.js +190 -0
  222. package/modules/mgidRtdProvider.md +51 -0
  223. package/modules/multibid/index.js +12 -0
  224. package/modules/openxOrtbBidAdapter.js +120 -275
  225. package/modules/oxxionRtdProvider.js +119 -0
  226. package/modules/oxxionRtdProvider.md +48 -0
  227. package/modules/permutiveRtdProvider.js +2 -1
  228. package/modules/permutiveRtdProvider.md +36 -1
  229. package/modules/prebidServerBidAdapter/index.js +19 -716
  230. package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
  231. package/modules/priceFloors.js +73 -1
  232. package/modules/pubmaticBidAdapter.js +21 -29
  233. package/modules/rtdModule/index.js +22 -1
  234. package/modules/schain.js +24 -1
  235. package/modules/spotxBidAdapter.js +16 -15
  236. package/modules/synacormediaBidAdapter.js +1 -1
  237. package/modules/teadsIdSystem.js +5 -0
  238. package/modules/tripleliftBidAdapter.js +1 -1
  239. package/modules/userId/eids.js +3 -10
  240. package/modules/userId/index.js +64 -6
  241. package/modules/videoModule/addingSubmodule.md +521 -0
  242. package/modules/videoModule/coreVideo.js +234 -0
  243. package/modules/videoModule/gamAdServerSubmodule.js +27 -0
  244. package/modules/videoModule/index.js +244 -0
  245. package/modules/videoModule/videoImpressionVerifier.js +206 -0
  246. package/modules/videojsVideoProvider.js +854 -0
  247. package/modules/videojsVideoProvider.md +17 -0
  248. package/package.json +12 -8
  249. package/src/adRendering.js +1 -1
  250. package/src/adapterManager.js +56 -7
  251. package/src/adloader.js +3 -1
  252. package/src/auction.js +6 -1
  253. package/src/events.js +5 -1
  254. package/src/pbjsORTB.js +35 -0
  255. package/src/prebid.js +137 -112
  256. package/src/targeting.js +10 -2
  257. package/src/utils/currency.js +16 -0
  258. package/src/utils.js +21 -0
  259. package/test/spec/auctionmanager_spec.js +15 -0
  260. package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
  261. package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
  262. package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
  263. package/test/spec/modules/concertBidAdapter_spec.js +56 -0
  264. package/test/spec/modules/connectIdSystem_spec.js +175 -5
  265. package/test/spec/modules/consentManagementUsp_spec.js +64 -18
  266. package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
  267. package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
  268. package/test/spec/modules/eids_spec.js +10 -7
  269. package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
  270. package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
  271. package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
  272. package/test/spec/modules/ixBidAdapter_spec.js +412 -350
  273. package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
  274. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
  275. package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
  276. package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
  277. package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
  278. package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
  279. package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
  280. package/test/spec/modules/realTimeDataModule_spec.js +65 -0
  281. package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
  282. package/test/spec/modules/userId_spec.js +67 -1
  283. package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
  284. package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
  285. package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
  286. package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
  287. package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
  288. package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
  289. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
  290. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
  291. package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
  292. package/test/spec/ortbConverter/banner_spec.js +203 -0
  293. package/test/spec/ortbConverter/composer_spec.js +69 -0
  294. package/test/spec/ortbConverter/converter_spec.js +283 -0
  295. package/test/spec/ortbConverter/currency_spec.js +40 -0
  296. package/test/spec/ortbConverter/default_processors_spec.js +61 -0
  297. package/test/spec/ortbConverter/gdpr_spec.js +38 -0
  298. package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
  299. package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
  300. package/test/spec/ortbConverter/multibid_spec.js +35 -0
  301. package/test/spec/ortbConverter/native_spec.js +95 -0
  302. package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
  303. package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
  304. package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
  305. package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
  306. package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
  307. package/test/spec/ortbConverter/schain_spec.js +33 -0
  308. package/test/spec/ortbConverter/userId_spec.js +21 -0
  309. package/test/spec/ortbConverter/usp_spec.js +15 -0
  310. package/test/spec/ortbConverter/video_spec.js +189 -0
  311. package/test/spec/unit/core/adapterManager_spec.js +102 -0
  312. package/test/spec/unit/core/targeting_spec.js +34 -0
  313. package/test/spec/unit/pbjs_api_spec.js +124 -45
  314. package/test/spec/utils_spec.js +45 -1
@@ -0,0 +1,234 @@
1
+ import { module } from '../../src/hook.js';
2
+ import { ParentModule, SubmoduleBuilder } from '../../libraries/video/shared/parentModule.js';
3
+
4
+ // define, ortb object, events
5
+
6
+ /**
7
+ * Video Provider Submodule interface. All submodules of the Core Video module must adhere to this.
8
+ * @description attached to a video player instance.
9
+ * @typedef {Object} VideoProvider
10
+ * @function init - Instantiates the Video Provider and the video player, if not already instantiated.
11
+ * @function getId - retrieves the div id (unique identifier) of the attached player instance.
12
+ * @function getOrtbVideo - retrieves the oRTB Video params for a player's current video session.
13
+ * @function getOrtbContent - retrieves the oRTB Content params for a player's current video session.
14
+ * @function setAdTagUrl - Requests that a player render the ad in the provided ad tag url.
15
+ * @function onEvent - attaches an event listener to the player instance.
16
+ * @function offEvent - removes event listener to the player instance.
17
+ * @function destroy - deallocates the player instance
18
+ */
19
+
20
+ /**
21
+ * @function VideoProvider#init
22
+ */
23
+
24
+ /**
25
+ * @function VideoProvider#getId
26
+ * @returns {string}
27
+ */
28
+
29
+ /**
30
+ * @function VideoProvider#getOrtbVideo
31
+ * @returns {Object}
32
+ */
33
+
34
+ /**
35
+ * @function VideoProvider#getOrtbContent
36
+ * @returns {Object}
37
+ */
38
+
39
+ /**
40
+ * @function VideoProvider#setAdTagUrl
41
+ * @param {string} adTagUrl - URL to a VAST ad tag
42
+ * @param {Object} options - Optional params
43
+ */
44
+
45
+ /**
46
+ * @function VideoProvider#onEvent
47
+ * @param {string} event - name of event for which the listener should be added
48
+ * @param {function} callback - function that will get called when the event is triggered
49
+ * @param {Object} basePayload - Base payload for every event; includes common parameters such as divId and type. Event payload should be built on top of this.
50
+ */
51
+
52
+ /**
53
+ * @function VideoProvider#offEvent
54
+ * @param {string} event - name of event for which the attached listener should be removed
55
+ * @param {function} callback - function that was assigned as a callback when the listener was added
56
+ */
57
+
58
+ /**
59
+ * @function VideoProvider#destroy
60
+ */
61
+
62
+ /**
63
+ * @typedef {Object} videoProviderConfig
64
+ * @name videoProviderConfig
65
+ * @summary contains data indicating which submodule to create and which player instance to attach it to
66
+ * @property {string} divId - unique identifier of the player instance
67
+ * @property {number} vendorCode - numeric identifier of the Video Provider type i.e. video.js or jwplayer
68
+ * @property {playerConfig} playerConfig
69
+ */
70
+
71
+ /**
72
+ * @typedef {Object} playerConfig
73
+ * @name playerConfig
74
+ * @summary contains data indicating the behavior the player instance should have
75
+ * @property {boolean} autoStart - determines if the player should start automatically when instantiated
76
+ * @property {boolean} mute - determines if the player should be muted when instantiated
77
+ * @property {string} licenseKey - authentication key required for commercial players. Optional for free players.
78
+ * @property {playerVendorParams} params
79
+ */
80
+
81
+ /**
82
+ * @typedef playerVendorParams
83
+ * @name playerVendorParams
84
+ * @summary configuration options specific to a Video Vendor's Provider
85
+ * @property {Object} vendorConfig - the settings object which can be used as an argument when instantiating a player. Specific to the video player's API.
86
+ */
87
+
88
+ /**
89
+ * @typedef videoEvent
90
+ *
91
+ */
92
+
93
+ /**
94
+ * Routes commands to the appropriate video submodule.
95
+ * @typedef {Object} VideoCore
96
+ * @class
97
+ * @function registerProvider
98
+ * @function getOrtbVideo
99
+ * @function getOrtbContent
100
+ * @function setAdTagUrl
101
+ * @function onEvents
102
+ * @function offEvents
103
+ */
104
+
105
+ /**
106
+ * @summary Maps a Video Provider factory to the video player's vendor code.
107
+ * @type {vendorSubmoduleDirectory}
108
+ */
109
+ const videoVendorDirectory = {};
110
+
111
+ /**
112
+ * @constructor
113
+ * @param {ParentModule} parentModule_
114
+ * @returns {VideoCore}
115
+ */
116
+ export function VideoCore(parentModule_) {
117
+ const parentModule = parentModule_;
118
+
119
+ /**
120
+ * requests that a submodule be instantiated for the specific player instance described by the @providerConfig
121
+ * @name VideoCore#registerProvider
122
+ * @param {videoProviderConfig} providerConfig
123
+ */
124
+ function registerProvider(providerConfig) {
125
+ try {
126
+ parentModule.registerSubmodule(providerConfig.divId, providerConfig.vendorCode, providerConfig);
127
+ } catch (e) {}
128
+ }
129
+
130
+ /**
131
+ * @name VideoCore#getOrtbVideo
132
+ * @summary Obtains the oRTB Video params for a player's current video session.
133
+ * @param {string} divId - unique identifier of the player instance
134
+ * @returns {Object} oRTB Video params
135
+ */
136
+ function getOrtbVideo(divId) {
137
+ const submodule = parentModule.getSubmodule(divId);
138
+ return submodule && submodule.getOrtbVideo();
139
+ }
140
+
141
+ /**
142
+ * @name VideoCore#getOrtbContent
143
+ * @summary Obtains the oRTB Content params for a player's current video session.
144
+ * @param {string} divId - unique identifier of the player instance
145
+ * @returns {Object} oRTB Content params
146
+ */
147
+ function getOrtbContent(divId) {
148
+ const submodule = parentModule.getSubmodule(divId);
149
+ return submodule && submodule.getOrtbContent();
150
+ }
151
+
152
+ /**
153
+ * @name VideoCore#setAdTagUrl
154
+ * @summary Requests that a player render the ad in the provided ad tag
155
+ * @param {string} adTagUrl - URL to a VAST ad tag
156
+ * @param {string} divId - unique identifier of the player instance
157
+ * @param {Object} options - additional params
158
+ */
159
+ function setAdTagUrl(adTagUrl, divId, options) {
160
+ const submodule = parentModule.getSubmodule(divId);
161
+ submodule && submodule.setAdTagUrl(adTagUrl, options);
162
+ }
163
+
164
+ /**
165
+ * @name VideoCore#onEvents
166
+ * @summary attaches event listeners
167
+ * @param {[string]} events - List of event names for which the listener should be added
168
+ * @param {function} callback - function that will get called when one of the events is triggered
169
+ * @param {string} divId - unique identifier of the player instance
170
+ */
171
+ function onEvents(events, callback, divId) {
172
+ if (!callback) {
173
+ return;
174
+ }
175
+
176
+ const submodule = parentModule.getSubmodule(divId);
177
+ if (!submodule) {
178
+ return;
179
+ }
180
+
181
+ for (let i = 0; i < events.length; i++) {
182
+ const type = events[i];
183
+ const basePayload = {
184
+ divId,
185
+ type
186
+ };
187
+ submodule.onEvent(type, callback, basePayload);
188
+ }
189
+ }
190
+
191
+ /**
192
+ * @name VideoCore#offEvents
193
+ * @summary removes event listeners
194
+ * @param {[string]} events - List of event names for which the listener should be removed
195
+ * @param {function} callback - function that was assigned as a callback when the listener was added
196
+ * @param {string} divId - unique identifier of the player instance
197
+ */
198
+ function offEvents(events, callback, divId) {
199
+ const submodule = parentModule.getSubmodule(divId);
200
+ if (!submodule) {
201
+ return;
202
+ }
203
+
204
+ events.forEach(event => {
205
+ submodule.offEvent(event, callback);
206
+ });
207
+ }
208
+
209
+ return {
210
+ registerProvider,
211
+ getOrtbVideo,
212
+ getOrtbContent,
213
+ setAdTagUrl,
214
+ onEvents,
215
+ offEvents
216
+ };
217
+ }
218
+
219
+ /**
220
+ * @function videoCoreFactory
221
+ * @summary Factory to create a Video Core instance
222
+ * @returns {VideoCore}
223
+ */
224
+ export function videoCoreFactory() {
225
+ const videoSubmoduleBuilder = SubmoduleBuilder(videoVendorDirectory);
226
+ const parentModule = ParentModule(videoSubmoduleBuilder);
227
+ return VideoCore(parentModule);
228
+ }
229
+
230
+ function attachVideoProvider(submoduleFactory) {
231
+ videoVendorDirectory[submoduleFactory.vendorCode] = submoduleFactory;
232
+ }
233
+
234
+ module('video', attachVideoProvider);
@@ -0,0 +1,27 @@
1
+ import { GAM_VENDOR } from '../../libraries/video/constants/vendorCodes.js';
2
+ import { getGlobal } from '../../src/prebidGlobal.js';
3
+
4
+ /**
5
+ * @constructor
6
+ * @param {Object} dfpModule_ - the DFP ad server module
7
+ * @returns {AdServerProvider}
8
+ */
9
+ function GamAdServerProvider(dfpModule_) {
10
+ const dfp = dfpModule_;
11
+
12
+ function getAdTagUrl(adUnit, baseAdTag, params) {
13
+ return dfp.buildVideoUrl({ adUnit: adUnit, url: baseAdTag, params });
14
+ }
15
+
16
+ return {
17
+ getAdTagUrl
18
+ }
19
+ }
20
+
21
+ export function gamSubmoduleFactory() {
22
+ const dfp = getGlobal().adServers.dfp;
23
+ const gamProvider = GamAdServerProvider(dfp);
24
+ return gamProvider;
25
+ }
26
+
27
+ gamSubmoduleFactory.vendorCode = GAM_VENDOR;
@@ -0,0 +1,244 @@
1
+ import { config } from '../../src/config.js';
2
+ import { find } from '../../src/polyfill.js';
3
+ import * as events from '../../src/events.js';
4
+ import { mergeDeep } from '../../src/utils.js';
5
+ import { getGlobal } from '../../src/prebidGlobal.js';
6
+ import CONSTANTS from '../../src/constants.json';
7
+ import {
8
+ videoEvents, AUCTION_AD_LOAD_ATTEMPT, AD_IMPRESSION, AD_ERROR, BID_IMPRESSION, BID_ERROR, AUCTION_AD_LOAD_ABORT
9
+ } from '../../libraries/video/constants/events.js'
10
+ import { PLACEMENT } from '../../libraries/video/constants/ortb.js';
11
+ import { videoCoreFactory } from './coreVideo.js';
12
+ import { gamSubmoduleFactory } from './gamAdServerSubmodule.js';
13
+ import { videoImpressionVerifierFactory } from './videoImpressionVerifier.js';
14
+
15
+ const videoKey = 'video';
16
+
17
+ const allVideoEvents = Object.keys(videoEvents).map(eventKey => videoEvents[eventKey]);
18
+ events.addEvents(allVideoEvents.concat([AUCTION_AD_LOAD_ATTEMPT, AUCTION_AD_LOAD_ABORT, BID_IMPRESSION, BID_ERROR]).map(getExternalVideoEventName));
19
+
20
+ /**
21
+ * This module adds User Video support to prebid.js
22
+ * @module modules/videoModule
23
+ */
24
+ export function PbVideo(videoCore_, getConfig_, pbGlobal_, pbEvents_, videoEvents_, gamAdServerFactory_, videoImpressionVerifierFactory_) {
25
+ const videoCore = videoCore_;
26
+ const getConfig = getConfig_;
27
+ const pbGlobal = pbGlobal_;
28
+ const requestBids = pbGlobal.requestBids;
29
+ const pbEvents = pbEvents_;
30
+ const videoEvents = videoEvents_;
31
+ const gamAdServerFactory = gamAdServerFactory_;
32
+ let gamSubmodule;
33
+ let mainContentDivId;
34
+ let contentEnrichmentEnabled = true;
35
+ const videoImpressionVerifierFactory = videoImpressionVerifierFactory_;
36
+ let videoImpressionVerifier;
37
+
38
+ function init() {
39
+ const cache = getConfig('cache');
40
+ videoImpressionVerifier = videoImpressionVerifierFactory(!!cache);
41
+ getConfig(videoKey, ({ video }) => {
42
+ video.providers.forEach(provider => {
43
+ videoCore.registerProvider(provider);
44
+ videoCore.onEvents(videoEvents, (type, payload) => {
45
+ pbEvents.emit(getExternalVideoEventName(type), payload);
46
+ }, provider.divId);
47
+
48
+ const adServerConfig = provider.adServer;
49
+ if (!gamSubmodule && adServerConfig) {
50
+ gamSubmodule = gamAdServerFactory();
51
+ }
52
+ });
53
+ contentEnrichmentEnabled = video.contentEnrichmentEnabled !== false;
54
+ mainContentDivId = contentEnrichmentEnabled ? video.mainContentDivId : null;
55
+ });
56
+
57
+ requestBids.before(beforeBidsRequested, 40);
58
+
59
+ pbEvents.on(CONSTANTS.EVENTS.BID_ADJUSTMENT, function (bid) {
60
+ videoImpressionVerifier.trackBid(bid);
61
+ });
62
+
63
+ pbEvents.on(getExternalVideoEventName(AD_IMPRESSION), function (payload) {
64
+ triggerVideoBidEvent(BID_IMPRESSION, payload);
65
+ });
66
+
67
+ pbEvents.on(getExternalVideoEventName(AD_ERROR), function (payload) {
68
+ triggerVideoBidEvent(BID_ERROR, payload);
69
+ });
70
+ }
71
+
72
+ function renderBid(divId, bid, options = {}) {
73
+ const adUrl = bid.vastUrl;
74
+ options.adXml = bid.vastXml;
75
+ options.winner = bid.bidder;
76
+ loadAdTag(adUrl, divId, options);
77
+ }
78
+
79
+ function getOrtbVideo(divId) {
80
+ return videoCore.getOrtbVideo(divId);
81
+ }
82
+
83
+ function getOrtbContent(divId) {
84
+ return videoCore.getOrtbContent(divId);
85
+ }
86
+
87
+ return { init, renderBid, getOrtbVideo, getOrtbContent };
88
+
89
+ function beforeBidsRequested(nextFn, bidderRequest) {
90
+ enrichAuction(bidderRequest);
91
+
92
+ const bidsBackHandler = bidderRequest.bidsBackHandler;
93
+ if (!bidsBackHandler || typeof bidsBackHandler !== 'function') {
94
+ pbEvents.on(CONSTANTS.EVENTS.AUCTION_END, auctionEnd);
95
+ }
96
+
97
+ return nextFn.call(this, bidderRequest);
98
+ }
99
+
100
+ function enrichAuction(bidderRequest) {
101
+ if (mainContentDivId) {
102
+ enrichOrtb2(mainContentDivId, bidderRequest);
103
+ }
104
+
105
+ const adUnits = bidderRequest.adUnits || pbGlobal.adUnits || [];
106
+ adUnits.forEach(adUnit => {
107
+ const divId = getDivId(adUnit);
108
+ enrichAdUnit(adUnit, divId);
109
+ if (contentEnrichmentEnabled && !mainContentDivId) {
110
+ enrichOrtb2(divId, bidderRequest);
111
+ }
112
+ });
113
+ }
114
+
115
+ function getDivId(adUnit) {
116
+ const videoConfig = adUnit.video;
117
+ if (!adUnit.mediaTypes.video || !videoConfig) {
118
+ return;
119
+ }
120
+
121
+ return videoConfig.divId;
122
+ }
123
+
124
+ function enrichAdUnit(adUnit, videoDivId) {
125
+ const ortbVideo = getOrtbVideo(videoDivId);
126
+ if (!ortbVideo) {
127
+ return;
128
+ }
129
+
130
+ const video = Object.assign({}, adUnit.mediaTypes.video, ortbVideo);
131
+
132
+ video.context = ortbVideo.placement === PLACEMENT.INSTREAM ? 'instream' : 'outstream';
133
+
134
+ const width = ortbVideo.w;
135
+ const height = ortbVideo.h;
136
+ if (width && height) {
137
+ video.playerSize = [width, height];
138
+ }
139
+
140
+ adUnit.mediaTypes.video = video;
141
+ }
142
+
143
+ function enrichOrtb2(divId, bidderRequest) {
144
+ const ortbContent = getOrtbContent(divId);
145
+ if (!ortbContent) {
146
+ return;
147
+ }
148
+ bidderRequest.ortb2 = mergeDeep({}, bidderRequest.ortb2, { site: { content: ortbContent } });
149
+ }
150
+
151
+ function auctionEnd(auctionResult) {
152
+ auctionResult.adUnits.forEach(adUnit => {
153
+ if (adUnit.video) {
154
+ renderWinningBid(adUnit);
155
+ }
156
+ });
157
+ pbEvents.off(CONSTANTS.EVENTS.AUCTION_END, auctionEnd);
158
+ }
159
+
160
+ function getAdServerConfig(adUnitVideoConfig) {
161
+ const globalVideoConfig = getConfig(videoKey);
162
+ const globalProviderConfig = globalVideoConfig.providers.find(provider => provider.divId === adUnitVideoConfig.divId) || {};
163
+ if (!globalVideoConfig.adServer && !globalProviderConfig.adServer && !adUnitVideoConfig.adServer) {
164
+ return;
165
+ }
166
+ return mergeDeep({}, globalVideoConfig.adServer, globalProviderConfig.adServer, adUnitVideoConfig.adServer);
167
+ }
168
+
169
+ function renderWinningBid(adUnit) {
170
+ const adUnitCode = adUnit.code;
171
+ const options = { adUnitCode };
172
+
173
+ const videoConfig = adUnit.video;
174
+ const divId = videoConfig.divId;
175
+ const adServerConfig = getAdServerConfig(videoConfig);
176
+ let adUrl;
177
+ if (adServerConfig) {
178
+ adUrl = gamSubmodule.getAdTagUrl(adUnit, adServerConfig.baseAdTagUrl, adServerConfig.params);
179
+ }
180
+
181
+ if (adUrl) {
182
+ loadAdTag(adUrl, divId, options);
183
+ return;
184
+ }
185
+
186
+ const highestCpmBids = pbGlobal.getHighestCpmBids(adUnitCode);
187
+ if (!highestCpmBids.length) {
188
+ pbEvents.emit(getExternalVideoEventName(AUCTION_AD_LOAD_ABORT), options);
189
+ return;
190
+ }
191
+
192
+ const highestBid = highestCpmBids.shift();
193
+ if (!highestBid) {
194
+ return;
195
+ }
196
+
197
+ renderBid(divId, highestBid, options);
198
+ }
199
+
200
+ // options: adXml, winner, adUnitCode,
201
+ function loadAdTag(adTagUrl, divId, options) {
202
+ const payload = Object.assign({ adTagUrl }, options);
203
+ pbEvents.emit(getExternalVideoEventName(AUCTION_AD_LOAD_ATTEMPT), payload);
204
+ videoCore.setAdTagUrl(adTagUrl, divId, options);
205
+ }
206
+
207
+ function triggerVideoBidEvent(eventName, adEventPayload) {
208
+ const bid = getBid(adEventPayload);
209
+ if (!bid) {
210
+ return;
211
+ }
212
+
213
+ pbGlobal.markWinningBidAsUsed(bid);
214
+ pbEvents.emit(getExternalVideoEventName(eventName), { bid, adEvent: adEventPayload });
215
+ }
216
+
217
+ function getBid(adPayload) {
218
+ const { adId, adTagUrl, wrapperAdIds } = adPayload;
219
+ const bidIdentifiers = videoImpressionVerifier.getBidIdentifiers(adId, adTagUrl, wrapperAdIds);
220
+ if (!bidIdentifiers) {
221
+ return;
222
+ }
223
+
224
+ const { adUnitCode, requestId, auctionId } = bidIdentifiers;
225
+ const bidAdId = bidIdentifiers.adId;
226
+ const { bids } = pbGlobal.getBidResponsesForAdUnitCode(adUnitCode);
227
+ return find(bids, bid => bid.adId === bidAdId && bid.requestId === requestId && bid.auctionId === auctionId);
228
+ }
229
+ }
230
+
231
+ export function pbVideoFactory() {
232
+ const videoCore = videoCoreFactory();
233
+ const pbGlobal = getGlobal();
234
+ const pbVideo = PbVideo(videoCore, config.getConfig, pbGlobal, events, allVideoEvents, gamSubmoduleFactory, videoImpressionVerifierFactory);
235
+ pbVideo.init();
236
+ pbGlobal.videoModule = pbVideo;
237
+ return pbVideo;
238
+ }
239
+
240
+ function getExternalVideoEventName(eventName) {
241
+ return videoKey + eventName.replace(/^./, eventName[0].toUpperCase());
242
+ }
243
+
244
+ pbVideoFactory();
@@ -0,0 +1,206 @@
1
+ import { find } from '../../src/polyfill.js';
2
+ import { vastXmlEditorFactory } from '../../libraries/video/shared/vastXmlEditor.js';
3
+ import { generateUUID } from '../../src/utils.js';
4
+
5
+ export const PB_PREFIX = 'pb_';
6
+ export const UUID_MARKER = PB_PREFIX + 'uuid';
7
+
8
+ /**
9
+ * Video Impression Verifier interface. All implementations of a Video Impression Verifier must comply with this interface.
10
+ * @description adds tracking markers to an ad and extracts the bid identifiers from ad event information.
11
+ * @typedef {Object} VideoImpressionVerifier
12
+ * @function trackBid - requests that a bid's ad be tracked for impression verification.
13
+ * @function getBidIdentifiers - requests information from the ad event data that can be used to match the ad to a tracked bid.
14
+ */
15
+
16
+ /**
17
+ * @function VideoImpressionVerifier#trackBid
18
+ * @param {Object} bid - Bid that should be tracked.
19
+ * @return {String} - Identifier for the bid being tracked.
20
+ */
21
+
22
+ /**
23
+ * @function VideoImpressionVerifier#getBidIdentifiers
24
+ * @param {String} adId - In the VAST tag, this value is present in the Ad element's id property.
25
+ * @param {String} adTagUrl - The ad tag url that was loaded into the player.
26
+ * @param {[String]} adWrapperIds - List of ad id's that were obtained from the different wrappers. Each redirect points to an ad wrapper.
27
+ * @return {bidIdentifier} - Object allowing the bid matching the ad event to be identified.
28
+ */
29
+
30
+ /**
31
+ * @typedef {Object} bidIdentifier
32
+ * @property {String} adId - Bid identifier.
33
+ * @property {String} adUnitCode - Identifier for the Ad Unit for which the bid was made.
34
+ * @property {String} auctionId - Id of the auction in which the bid was made.
35
+ * @property {String} requestId - Id of the bid request which resulted in the bid.
36
+ */
37
+
38
+ /**
39
+ * Factory function for obtaining a Video Impression Verifier.
40
+ * @param {Boolean} isCacheUsed - wether Prebid is configured to use a cache.
41
+ * @return {VideoImpressionVerifier}
42
+ */
43
+ export function videoImpressionVerifierFactory(isCacheUsed) {
44
+ const vastXmlEditor = vastXmlEditorFactory();
45
+ const bidTracker = tracker();
46
+ if (isCacheUsed) {
47
+ return cachedVideoImpressionVerifier(vastXmlEditor, bidTracker);
48
+ }
49
+
50
+ return videoImpressionVerifier(vastXmlEditor, bidTracker);
51
+ }
52
+
53
+ export function videoImpressionVerifier(vastXmlEditor_, bidTracker_) {
54
+ const verifier = baseImpressionVerifier(bidTracker_);
55
+ const superTrackBid = verifier.trackBid;
56
+ const vastXmlEditor = vastXmlEditor_;
57
+
58
+ verifier.trackBid = function(bid) {
59
+ let { vastXml, vastUrl } = bid;
60
+ if (!vastXml && !vastUrl) {
61
+ return;
62
+ }
63
+
64
+ const uuid = superTrackBid(bid);
65
+
66
+ if (vastUrl) {
67
+ const url = new URL(vastUrl);
68
+ url.searchParams.append(UUID_MARKER, uuid);
69
+ bid.vastUrl = url.toString();
70
+ } else if (vastXml) {
71
+ bid.vastXml = vastXmlEditor.getVastXmlWithTracking(vastXml, uuid);
72
+ }
73
+
74
+ return uuid;
75
+ }
76
+
77
+ return verifier;
78
+ }
79
+
80
+ export function cachedVideoImpressionVerifier(vastXmlEditor_, bidTracker_) {
81
+ const verifier = baseImpressionVerifier(bidTracker_);
82
+ const superTrackBid = verifier.trackBid;
83
+ const superGetBidIdentifiers = verifier.getBidIdentifiers;
84
+ const vastXmlEditor = vastXmlEditor_;
85
+
86
+ verifier.trackBid = function (bid, globalAdUnits) {
87
+ const adIdOverride = superTrackBid(bid);
88
+ let { vastXml, vastUrl, adId, adUnitCode } = bid;
89
+ const adUnit = find(globalAdUnits, adUnit => adUnitCode === adUnit.code);
90
+ const videoConfig = adUnit && adUnit.video;
91
+ const adServerConfig = videoConfig && videoConfig.adServer;
92
+ const trackingConfig = adServerConfig && adServerConfig.tracking;
93
+ let impressionUrl;
94
+ let impressionId;
95
+ let errorUrl;
96
+ const impressionTracking = trackingConfig.impression;
97
+ const errorTracking = trackingConfig.error;
98
+
99
+ if (impressionTracking) {
100
+ impressionUrl = getTrackingUrl(impressionTracking.getUrl, bid);
101
+ impressionId = impressionTracking.id || adId + '-impression';
102
+ }
103
+
104
+ if (errorTracking) {
105
+ errorUrl = getTrackingUrl(errorTracking.getUrl, bid);
106
+ }
107
+
108
+ if (vastXml) {
109
+ vastXml = vastXmlEditor.getVastXmlWithTracking(vastXml, adIdOverride, impressionUrl, impressionId, errorUrl);
110
+ } else if (vastUrl) {
111
+ vastXml = vastXmlEditor.buildVastWrapper(adIdOverride, vastUrl, impressionUrl, impressionId, errorUrl);
112
+ }
113
+
114
+ bid.vastXml = vastXml;
115
+ return adIdOverride;
116
+ }
117
+
118
+ verifier.getBidIdentifiers = function (adId, adTagUrl, adWrapperIds) {
119
+ // When the video is cached, the ad tag loaded into the player is a parent wrapper of the cache url.
120
+ // As a result, the ad tag Url cannot include identifiers.
121
+ return superGetBidIdentifiers(adId, null, adWrapperIds);
122
+ }
123
+
124
+ return verifier;
125
+
126
+ function getTrackingUrl(getUrl, bid) {
127
+ if (!getUrl || typeof getUrl !== 'function') {
128
+ return;
129
+ }
130
+
131
+ return getUrl(bid);
132
+ }
133
+ }
134
+
135
+ export function baseImpressionVerifier(bidTracker_) {
136
+ const bidTracker = bidTracker_;
137
+
138
+ function trackBid(bid) {
139
+ let { adId, adUnitCode, requestId, auctionId } = bid;
140
+ const trackingId = PB_PREFIX + generateUUID(10 ** 13);
141
+ bidTracker.store(trackingId, { adId, adUnitCode, requestId, auctionId });
142
+ return trackingId;
143
+ }
144
+
145
+ function getBidIdentifiers(adId, adTagUrl, adWrapperIds) {
146
+ return bidTracker.remove(adId) || getBidForAdTagUrl(adTagUrl) || getBidForAdWrappers(adWrapperIds);
147
+ }
148
+
149
+ return {
150
+ trackBid,
151
+ getBidIdentifiers
152
+ };
153
+
154
+ function getBidForAdTagUrl(adTagUrl) {
155
+ if (!adTagUrl) {
156
+ return;
157
+ }
158
+
159
+ let url;
160
+ try {
161
+ url = new URL(adTagUrl);
162
+ } catch (e) {
163
+ return;
164
+ }
165
+
166
+ const queryParams = url.searchParams;
167
+ let uuid = queryParams.get(UUID_MARKER);
168
+ return uuid && bidTracker.remove(uuid);
169
+ }
170
+
171
+ function getBidForAdWrappers(adWrapperIds) {
172
+ if (!adWrapperIds || !adWrapperIds.length) {
173
+ return;
174
+ }
175
+
176
+ for (const wrapperId in adWrapperIds) {
177
+ const bidInfo = bidTracker.remove(wrapperId);
178
+ if (bidInfo) {
179
+ return bidInfo;
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+ export function tracker() {
186
+ const model = {};
187
+
188
+ function store(key, value) {
189
+ model[key] = value;
190
+ }
191
+
192
+ function remove(key) {
193
+ const value = model[key];
194
+ if (!value) {
195
+ return;
196
+ }
197
+
198
+ delete model[key];
199
+ return value;
200
+ }
201
+
202
+ return {
203
+ store,
204
+ remove
205
+ }
206
+ }