@optable/web-sdk 0.44.1 → 0.44.3

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.
package/README.md CHANGED
@@ -290,7 +290,7 @@ const eventProperties = {
290
290
  property_three: false,
291
291
  };
292
292
 
293
- sdk.witness("event.type.here", eventProperties).then(onSuccess).catch(onFailure);
293
+ sdk.witness("event_type_here", eventProperties).then(onSuccess).catch(onFailure);
294
294
  ```
295
295
 
296
296
  The specified event type and properties are associated with the logged event and which can be used for matching during audience assembly.
@@ -519,6 +519,8 @@ To automatically capture GPT [SlotRenderEndedEvent](https://developers.google.co
519
519
  </script>
520
520
  ```
521
521
 
522
+ The emitted event types are `gpt_events_slotRenderEnded` and `gpt_events_impressionViewable`.
523
+
522
524
  Note that you can call `installGPTEventListeners()` as many times as you like on an SDK instance, there will only be one set of registered event listeners per instance. Each SDK instance can register its own GPT event listeners.
523
525
 
524
526
  A working example of both targeting and event witnessing is available in the demo pages.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see sdk.js.LICENSE.txt */
2
- (()=>{var e={312:(e,t,r)=>{var i;!function(){"use strict";var t="input is invalid type",s="object"==typeof window,n=s?window:{};n.JS_SHA256_NO_WINDOW&&(s=!1);var o=!s&&"object"==typeof self,a=!n.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r.g:o&&(n=self);var c=!n.JS_SHA256_NO_COMMON_JS&&e.exports,d=r.amdO,u=!n.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],l=[24,16,8,0],g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],m=[];!n.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new b(t,!0).update(r)[e]()}},w=function(e){var t=y("hex",e);a&&(t=v(t,e)),t.create=function(){return new b(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var i=f[r];t[i]=y(i,e)}return t},v=function(e,i){var s,o=r(394),a=r(903).Buffer,c=i?"sha224":"sha256";return s=a.from&&!n.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(s(r)).digest("hex"):e(r)}},A=function(e,t){return function(r,i){return new P(r,t,!0).update(i)[e]()}},S=function(e){var t=A("hex",e);t.create=function(t){return new P(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var i=f[r];t[i]=A(i,e)}return t};function b(e,t){t?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function P(e,r,i){var s,n=typeof e;if("string"===n){var o,a=[],c=e.length,d=0;for(s=0;s<c;++s)(o=e.charCodeAt(s))<128?a[d++]=o:o<2048?(a[d++]=192|o>>>6,a[d++]=128|63&o):o<55296||o>=57344?(a[d++]=224|o>>>12,a[d++]=128|o>>>6&63,a[d++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),a[d++]=240|o>>>18,a[d++]=128|o>>>12&63,a[d++]=128|o>>>6&63,a[d++]=128|63&o);e=a}else{if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new b(r,!0).update(e).array());var h=[],p=[];for(s=0;s<64;++s){var l=e[s]||0;h[s]=92^l,p[s]=54^l}b.call(this,r,i),this.update(p),this.oKeyPad=h,this.inner=!0,this.sharedMemory=i}b.prototype.update=function(e){if(!this.finalized){var r,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var s,n,o=0,a=e.length,c=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),r)for(n=this.start;o<a&&n<64;++o)c[n>>>2]|=e[o]<<l[3&n++];else for(n=this.start;o<a&&n<64;++o)(s=e.charCodeAt(o))<128?c[n>>>2]|=s<<l[3&n++]:s<2048?(c[n>>>2]|=(192|s>>>6)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]):s<55296||s>=57344?(c[n>>>2]|=(224|s>>>12)<<l[3&n++],c[n>>>2]|=(128|s>>>6&63)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),c[n>>>2]|=(240|s>>>18)<<l[3&n++],c[n>>>2]|=(128|s>>>12&63)<<l[3&n++],c[n>>>2]|=(128|s>>>6&63)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=c[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},b.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=p[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},b.prototype.hash=function(){var e,t,r,i,s,n,o,a,c,d=this.h0,u=this.h1,h=this.h2,p=this.h3,l=this.h4,f=this.h5,m=this.h6,y=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((s=w[e-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,r=((s=w[e-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,w[e]=w[e-16]+t+w[e-7]+r|0;for(c=u&h,e=0;e<64;e+=4)this.first?(this.is224?(n=300032,y=(s=w[0]-1413257819)-150054599|0,p=s+24177077|0):(n=704751109,y=(s=w[0]-210244248)-1521486534|0,p=s+143694565|0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(n=d&u)^d&h^c,y=p+(s=y+(r=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&m)+g[e]+w[e])|0,p=s+(t+i)|0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(o=p&d)^p&u^n,m=h+(s=m+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&l^~y&f)+g[e+1]+w[e+1])|0,t=((h=s+(t+i)|0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(a=h&p)^h&d^o,f=u+(s=f+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&y^~m&l)+g[e+2]+w[e+2])|0,t=((u=s+(t+i)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(c=u&h)^u&p^a,l=d+(s=l+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&m^~f&y)+g[e+3]+w[e+3])|0,d=s+(t+i)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+d|0,this.h1=this.h1+u|0,this.h2=this.h2+h|0,this.h3=this.h3+p|0,this.h4=this.h4+l|0,this.h5=this.h5+f|0,this.h6=this.h6+m|0,this.h7=this.h7+y|0},b.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,s=this.h4,n=this.h5,o=this.h6,a=this.h7,c=h[e>>>28&15]+h[e>>>24&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>4&15]+h[15&e]+h[t>>>28&15]+h[t>>>24&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>4&15]+h[15&t]+h[r>>>28&15]+h[r>>>24&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>4&15]+h[15&r]+h[i>>>28&15]+h[i>>>24&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>4&15]+h[15&i]+h[s>>>28&15]+h[s>>>24&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>4&15]+h[15&s]+h[n>>>28&15]+h[n>>>24&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>4&15]+h[15&n]+h[o>>>28&15]+h[o>>>24&15]+h[o>>>20&15]+h[o>>>16&15]+h[o>>>12&15]+h[o>>>8&15]+h[o>>>4&15]+h[15&o];return this.is224||(c+=h[a>>>28&15]+h[a>>>24&15]+h[a>>>20&15]+h[a>>>16&15]+h[a>>>12&15]+h[a>>>8&15]+h[a>>>4&15]+h[15&a]),c},b.prototype.toString=b.prototype.hex,b.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,s=this.h4,n=this.h5,o=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},b.prototype.array=b.prototype.digest,b.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},P.prototype=new b,P.prototype.finalize=function(){if(b.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();b.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),b.prototype.finalize.call(this)}};var _=w();_.sha256=_,_.sha224=w(!0),_.sha256.hmac=S(),_.sha224.hmac=S(!0),c?e.exports=_:(n.sha256=_.sha256,n.sha224=_.sha224,d&&(void 0===(i=function(){return _}.call(_,r,_,e))||(e.exports=i)))}()},903:()=>{},394:()=>{}},t={};function r(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,r),n.exports}r.amdO={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";const e={r:"v0.44.1"};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function i(e,r,i){return(r=function(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}async function s(e){const t=await S("/config",e,{method:"GET",headers:{Accept:"application/json"}});return new A(e).setSite(t),t}const n={"Europe/Vienna":"gdpr","Europe/Brussels":"gdpr","Europe/Sofia":"gdpr","Europe/Zagreb":"gdpr","Asia/Nicosia":"gdpr","Europe/Nicosia":"gdpr","Europe/Prague":"gdpr","Europe/Copenhagen":"gdpr","Europe/Tallinn":"gdpr","Europe/Helsinki":"gdpr","Europe/Paris":"gdpr","Europe/Berlin":"gdpr","Europe/Athens":"gdpr","Europe/Budapest":"gdpr","Atlantic/Reykjavik":"gdpr","Europe/Dublin":"gdpr","Europe/Rome":"gdpr","Europe/Riga":"gdpr","Europe/Vaduz":"gdpr","Europe/Vilnius":"gdpr","Europe/Luxembourg":"gdpr","Europe/Malta":"gdpr","Europe/Oslo":"gdpr","Europe/Warsaw":"gdpr","Europe/Lisbon":"gdpr","Europe/Bucharest":"gdpr","Europe/Bratislava":"gdpr","Europe/Ljubljana":"gdpr","Europe/Madrid":"gdpr","Europe/Stockholm":"gdpr","Europe/Amsterdam":"gdpr","Atlantic/Azores":"gdpr","Atlantic/Canary":"gdpr","America/Cayenne":"gdpr","America/Guadeloupe":"gdpr","Atlantic/Madeira":"gdpr","America/Martinique":"gdpr","Indian/Mayotte":"gdpr","Indian/Reunion":"gdpr","America/Marigot":"gdpr","Europe/Zurich":"gdpr","Europe/London":"gdpr","America/Toronto":"can","America/Adak":"us","America/Anchorage":"us","America/Atka":"us","America/Boise":"us","America/Chicago":"us","America/Denver":"us","America/Detroit":"us","America/Indiana/Indianapolis":"us","America/Indiana/Knox":"us","America/Indiana/Marengo":"us","America/Indiana/Petersburg":"us","America/Indiana/Tell_City":"us","America/Indiana/Vevay":"us","America/Indiana/Vincennes":"us","America/Indiana/Winamac":"us","America/Indianapolis":"us","America/Juneau":"us","America/Kentucky/Louisville":"us","America/Kentucky/Monticello":"us","America/Knox_IN":"us","America/Los_Angeles":"us","America/Louisville":"us","America/Menominee":"us","America/Metlakatla":"us","America/New_York":"us","America/Nome":"us","America/North_Dakota/Beulah":"us","America/North_Dakota/Center":"us","America/North_Dakota/New_Salem":"us","America/Phoenix":"us","America/Shiprock":"us","America/Sitka":"us","America/Yakutat":"us","Pacific/Honolulu":"us"},o="tcfcav1",a="tcfeuv2",c=[2],d=[5],u=[7,8,10,12,17,13,18,14,19,20,21,15,22,16,11,9];function h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(e,t){const{gdprApplies:r,gppSectionIDs:i,gdprData:s}=t;if(void 0!==r)return r?"gdpr":"gdpr"===e?null:e;if(void 0!==s&&"gdpr"===e)return"gdpr";if(void 0===i||1===i.length&&0===i[0])return e;if(1===i.length&&-1===i[0])return null;if(i.some((e=>c.includes(e))))return"gdpr";if(i.some((e=>d.includes(e))))return"can";if(i.some((e=>u.includes(e))))return"us";switch(e){case"gdpr":if(!i.some((e=>c.includes(e))))return null;break;case"can":if(!i.some((e=>d.includes(e))))return null;break;case"us":if(!i.some((e=>u.includes(e))))return null}return e}(e,t),s={reg:i,gpp:t.gppString,gppSectionIDs:t.gppSectionIDs,gdpr:t.gdprString,gdprApplies:t.gdprApplies,deviceAccess:!1,createProfilesForAdvertising:!1,useProfilesForAdvertising:!1,measureAdvertisingPerformance:!1};switch(i){case"gdpr":t.gdprData?(s.deviceAccess=l(t.gdprData,1,r.tcfeuVendorID),s.createProfilesForAdvertising=l(t.gdprData,3,r.tcfeuVendorID),s.useProfilesForAdvertising=l(t.gdprData,4,r.tcfeuVendorID),s.measureAdvertisingPerformance=l(t.gdprData,7,r.tcfeuVendorID)):t.gppData&&(s.deviceAccess=f(t.gppData,1,r.tcfeuVendorID),s.createProfilesForAdvertising=f(t.gppData,3,r.tcfeuVendorID),s.useProfilesForAdvertising=f(t.gppData,4,r.tcfeuVendorID),s.measureAdvertisingPerformance=f(t.gppData,7,r.tcfeuVendorID));break;case"can":s.deviceAccess=!0,t.gppData&&(s.createProfilesForAdvertising=g(t.gppData,3,r.tcfcaVendorID),s.useProfilesForAdvertising=g(t.gppData,4,r.tcfcaVendorID),s.measureAdvertisingPerformance=g(t.gppData,7,r.tcfcaVendorID));break;default:s.deviceAccess=!0,s.createProfilesForAdvertising=!0,s.useProfilesForAdvertising=!0,s.measureAdvertisingPerformance=!0}return s}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={};!function(){if("function"==typeof window.__tcfapi)return;let e;const t={};let r=window;for(;r;){try{if(r.frames.__tcfapiLocator){e=r;break}}catch{}if(r===window.top)break;r=r.parent}e&&(window.__tcfapi=function(r,i,s){const n=Math.random()+"";t[n]=s,e.postMessage({__tcfapiCall:{command:r,version:i,callId:n}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch{}const i=r.__tcfapiReturn;i&&"function"==typeof t[i.callId]&&(t[i.callId](i.returnValue,i.success),delete t[i.callId])}),!1))}(),function(){if("function"==typeof window.__gpp)return;let e;const t={};let r=window;for(;r;){try{if(r.frames.__gppLocator){e=r;break}}catch{}if(r===window.top)break;r=r.parent}e&&(window.__gpp=function(r,i){const s=Math.random()+"";t[s]=i,e.postMessage({__gppCall:{command:r,version:"1.1",callId:s}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch{}const i=r.__gppReturn;i&&"function"==typeof t[i.callId]&&(t[i.callId](i.returnValue,i.success),delete t[i.callId])}),!1))}();const i=h(e,r,t);return"function"==typeof window.__tcfapi&&window.__tcfapi?.("addEventListener",2,((s,n)=>{n&&("tcloaded"===s.eventStatus||"useractioncomplete"===s.eventStatus)&&(s=>{r.gdprString=s.tcString,r.gdprApplies=s.gdprApplies,r.gdprData=s,Object.assign(i,h(e,r,t))})(s)})),"function"==typeof window.__gpp&&window.__gpp?.("addEventListener",((s,n)=>{n&&"signalStatus"===s.eventName&&"ready"===s.data&&(s=>{r.gppString=s.gppString,r.gppSectionIDs=s.applicableSections,r.gppData=s,Object.assign(i,h(e,r,t))})(s.pingData)})),i}function l(e,t,r){return r?!!e.purpose?.consents?.[t]&&!!e.vendor?.consents?.[r]:!!e.publisher?.consents?.[t]}function g(e,t,r){const i=t>1,s=e.parsedSections?.[o]||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let n=e.PurposesExpressConsent.includes(t)&&e.VendorExpressConsent.includes(r);return i&&(n||=e.PurposesImpliedConsent.includes(t)&&e.VendorImpliedConsent.includes(r)),n}const n=s.find((e=>"SubsectionType"in e&&3===e.SubsectionType));if(!n)return!1;let a=n.PubPurposesExpressConsent.includes(t);return i&&(a||=n.PubPurposesImpliedConsent.includes(t)),a}function f(e,t,r){const i=t>1,s=e.parsedSections?.[a]||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let n=e.PurposeConsent.includes(t)&&e.VendorConsent.includes(r);return i&&(n||=e.PurposesLITransparency.includes(t)&&e.VendorLegitimateInterest.includes(r)),n}const n=s.find((e=>"SegmentType"in e&&3===e.SegmentType));if(!n)return!1;let o=n.PubPurposesConsent.includes(t);return i&&(o||=n.PubPurposesLITransparency.includes(t)),o}class m{constructor(e){i(this,"consent",void 0),this.consent=e}getItem(e){return this.consent.deviceAccess?window.localStorage.getItem(e):null}setItem(e,t){this.consent.deviceAccess&&window.localStorage.setItem(e,t)}removeItem(e){this.consent.deviceAccess&&window.localStorage.removeItem(e)}}const y="_optable_pairId";function w(e){const t=new Uint16Array(e.length);for(let r=0;r<t.length;r++)t[r]=e.charCodeAt(r);return btoa(String.fromCharCode(...new Uint8Array(t.buffer)))}function v(e){return e.node?w(`${e.host}/${e.node}`):w(`${e.host}`)}class A{constructor(e){this.config=e,i(this,"passportKeys",void 0),i(this,"targetingKeys",void 0),i(this,"siteKeys",void 0),i(this,"pairKeys",void 0),i(this,"storage",void 0),this.passportKeys=function(e){const t=[],r=[],i=`OPTABLE_PASSPORT_${v(e)}`;return t.push(i),r.push(i),e.legacyHostCache?(r.push(`OPTABLE_PASSPORT_${w(`${e.legacyHostCache}`)}`),r.push(`OPTABLE_PASS_${w(`${e.legacyHostCache}/${e.site}`)}`)):r.push(`OPTABLE_PASS_${w(`${e.host}/${e.site}`)}`),{write:t,read:r}}(e),this.targetingKeys=function(e){const t=`OPTABLE_TARGETING_${v(e)}`;return{write:[t,e.optableCacheTargeting],read:[t]}}(e),this.siteKeys=function(e){const t=`OPTABLE_SITE_${v(e)}`;return{write:[t],read:[t]}}(e),this.pairKeys={write:[y],read:[y]},this.storage=new m(this.config.consent)}getPassport(){return this.readStorageKeys(this.passportKeys)}setPassport(e){this.writeToStorageKeys(this.passportKeys,e)}getTargeting(){const e=this.readStorageKeys(this.targetingKeys);return e?JSON.parse(e):null}setTargeting(e){e&&(this.writeToStorageKeys(this.targetingKeys,JSON.stringify(e)),this.setPairIDs(e))}getSite(){const e=this.readStorageKeys(this.siteKeys);return e?JSON.parse(e):null}setSite(e){e&&this.writeToStorageKeys(this.siteKeys,JSON.stringify(e))}setPairIDs(e){const t=e.ortb2?.user?.eids?.filter((e=>"pair-protocol.com"===e.source)),r=t?.flatMap((e=>e.uids));if(!r)return;const i=new Set(r.map((e=>e.id)));this.writeToStorageKeys(this.pairKeys,btoa(JSON.stringify({envelope:[...i]})))}getPairIDs(){const e=this.readStorageKeys(this.pairKeys);return e?JSON.parse(atob(e))?.envelope:null}readStorageKeys(e){for(const t of e.read){const e=this.storage.getItem(t);if(e)return e}return null}writeToStorageKeys(e,t){if(t)for(const r of e.write)this.storage.setItem(r,t)}clearStorageKeys(e){for(const t of[...e.read,...e.write])this.storage.removeItem(t)}clearPassport(){this.clearStorageKeys(this.passportKeys)}clearTargeting(){this.clearStorageKeys(this.targetingKeys)}clearSite(){this.clearStorageKeys(this.siteKeys)}}async function S(t,r,i){const s=await globalThis.fetch(function(t,r,i){const{host:s,cookies:n}=r,o=new URL(t,`https://${s}`);if(o.searchParams.set("osdk",`web-${e.r}`),o.searchParams.set("sid",r.sessionID),r.skipEnrichment&&o.searchParams.set("skip_enrichment",`${r.skipEnrichment}`),r.node&&o.searchParams.set("t",r.node),r.site&&o.searchParams.set("o",r.site),void 0!==r.consent.gpp&&o.searchParams.set("gpp",r.consent.gpp),void 0!==r.consent.gppSectionIDs&&o.searchParams.set("gpp_sid",r.consent.gppSectionIDs.join(",")),void 0!==r.consent.gdpr&&o.searchParams.set("gdpr_consent",r.consent.gdpr),void 0!==r.consent.gdprApplies&&o.searchParams.set("gdpr",Number(r.consent.gdprApplies).toString()),r.readOnly&&o.searchParams.set("ro","true"),r.timeout&&o.searchParams.set("timeout",r.timeout),n)o.searchParams.set("cookies","yes");else{const e=new A(r).getPassport();o.searchParams.set("cookies","no"),o.searchParams.set("passport",e||"")}const a={...i};return a.credentials=r.consent.deviceAccess?"include":"omit",r.mockedIP&&(a.headers=new Headers(a.headers),a.headers.set("X-Forwarded-For",r.mockedIP)),new Request(o.toString(),a)}(t,r,i)),n=s.headers.get("Content-Type"),o=n?.startsWith("application/json")?await s.json():await s.text();if(!s.ok)throw new Error(o.error);return o.passport&&(new A(r).setPassport(o.passport),delete o.passport),o}var b,P,_,I=((P=I||{})[P.Banner=1]="Banner",P[P.Video=2]="Video",P[P.Audio=3]="Audio",P[P.Native=4]="Native",P),E={},T={},k={};(_=b||(b={})).Placement=T,_.Media=k,_.Context=E;const C={cookies:!0,initPassport:!0,readOnly:!1,experiments:[],consent:{reg:null,deviceAccess:!0,createProfilesForAdvertising:!0,useProfilesForAdvertising:!0,measureAdvertisingPerformance:!0}};function D(){const e=new Uint8Array(16);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function O(e){return{user:{data:(e?.audience??[]).map((e=>({name:e.provider,segment:e.ids,ext:{segtax:e.rtb_segtax}}))),ext:{eids:(e?.user??[]).map((e=>({source:e.provider,uids:e.ids.map((e=>{let{id:t}=e;return{id:t,atype:3}}))})))}}}}function x(e){const t={};if(!e)return t;for(const r of e.audience??[])r.keyspace&&(r.keyspace in t||(t[r.keyspace]=[]),t[r.keyspace].push(...r.ids.map((e=>e.id))));return t}function N(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function K(){const e={};let t=0;return{refs:e,process:(r,i)=>{if(!r.refs)return i;for(const s of i.uids)if(N(s.ext?.optable)&&"ref"in s.ext.optable&&"string"==typeof s.ext.optable.ref){const i=r.refs[s.ext.optable.ref];t+=1;const n=t.toString(10);e[n]=i,s.ext.optable.ref=n}return i}}}var B=r(312);class V{constructor(e){i(this,"dcn",void 0),i(this,"init",void 0),this.dcn=function(e){const t={host:e.host,site:e.site,optableCacheTargeting:e.optableCacheTargeting??"optable-cache:targeting",cookies:e.cookies??C.cookies,initPassport:e.initPassport??C.initPassport,consent:C.consent,readOnly:e.readOnly??C.readOnly,node:e.node,legacyHostCache:e.legacyHostCache,experiments:e.experiments??C.experiments,mockedIP:e.mockedIP,sessionID:e.sessionID??D(),skipEnrichment:e.skipEnrichment,initTargeting:e.initTargeting,abTests:e.abTests,additionalTargetingSignals:e.additionalTargetingSignals,timeout:e.timeout};return e.consent?.static?t.consent=e.consent.static:e.consent?.cmpapi&&(t.consent=p(function(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=n[e];return"can"===t?["fr","fr-CA"].some((e=>navigator.languages.includes(e)))?"can":null:t??null}(),e.consent.cmpapi)),t}(e),this.init=this.initialize()}async initialize(){this.dcn.initPassport&&await s(this.dcn).catch((()=>{})),this.dcn.initTargeting&&this.targeting().catch((()=>{}))}async identify(){await this.init;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,t){return S("/identify",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}(this.dcn,t.filter((e=>e)))}async uid2Token(e){return await this.init,function(e,t){return S("/uid2/token",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}(this.dcn,e)}async targeting(){const e=function(e){if("string"==typeof e)return{ids:[e],hids:[]};if(N(e))return{ids:e?.ids??[],hids:e?.hids??[]};throw"Invalid request type for targeting. Expected string or object."}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__passport__");return await this.init,async function(e,t){const r=new URLSearchParams;t.ids.forEach((e=>r.append("id",e))),t.hids.forEach((e=>r.append("hid",e)));const i=function(e){if(!e||0===e.length)return null;if(e.reduce(((e,t)=>e+t.trafficPercentage),0)>100)return console.error("AB Test Config Error: Traffic Percentage Sum Exceeds 100%"),null;const t=Math.floor(100*Math.random());let r=0;for(const i of e)if(r+=i.trafficPercentage,t<r)return i;return null}(e.abTests);i&&(r.append("ab_test_id",i.id),i.matcher_override&&[...i.matcher_override].sort(((e,t)=>e.rank-t.rank)).forEach((e=>{r.append("matcher_override",e.id)})),i.skipMatchers&&r.append("skip_matchers",i.skipMatchers.join(",")));e.additionalTargetingSignals?.ref&&r.append("ref",`${window.location.protocol}//${window.location.host}${window.location.pathname}`);const s="/v2/targeting?"+r.toString(),n=await S(s,e,{method:"GET",headers:{Accept:"application/json"}});return n&&(new A(e).setTargeting(n),function(e,t){const r=t.ortb2?.user?.eids?.map((e=>e.matcher));window.dispatchEvent(new CustomEvent("optable-targeting:change",{detail:{instance:e.node||e.host,resolved:!!t.ortb2?.user?.eids?.length,resolvedIDs:t.resolved_ids??[],abTestID:t.ab_test_id??void 0,ortb2:t.ortb2,provenance:new Set(r)}}))}(e,n)),n}(this.dcn,e)}targetingFromCache(){return e=this.dcn,new A(e).getTargeting();var e}async site(){return s(this.dcn)}siteFromCache(){return e=this.dcn,new A(e).getSite();var e}targetingClearCache(){var e;e=this.dcn,new A(e).clearTargeting()}async prebidORTB2(){return O(await this.targeting())}prebidORTB2FromCache(){return O(this.targetingFromCache())}async targetingKeyValues(){return x(await this.targeting())}targetingKeyValuesFromCache(){return x(this.targetingFromCache())}async witness(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this.init,function(e,t,r){const i={event:t,properties:r};return S("/witness",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,e,t)}async profile(e){return await this.init,function(e,t){const r={traits:t};return S("/profile",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,e)}async tokenize(e){return await this.init,function(e,t){let r={id:t};return S("/v2/tokenize",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,e)}async resolve(e){return await this.init,async function(e,t){const r=new URLSearchParams;"string"==typeof t&&r.append("id",t);const i="/v1/resolve?"+r.toString();return function(e){const t={clusters:[],lmpid:""};if("object"!=typeof e||null===e)return t;if("lmpid"in e&&"string"==typeof e?.lmpid&&(t.lmpid=e.lmpid),!("clusters"in e)||!Array.isArray(e?.clusters))return t;for(const r of e.clusters){const e={ids:[],traits:[]};if(Array.isArray(r?.ids))for(const t of r.ids)"string"==typeof t&&e.ids.push(t);if(Array.isArray(r?.traits))for(const t of r.traits)"string"==typeof t?.key&&"string"==typeof t?.value&&e.traits.push({key:t.key,value:t.value});(e.ids.length>0||e.traits.length>0)&&t.clusters.push(e)}return t}(await S(i,e,{method:"GET",headers:{Accept:"application/json"}}))}(this.dcn,e)}static eid(e){return e?"e:"+B.sha256.hex(e.toLowerCase().trim()):""}static sha256(e){return e?B.sha256.hex(e):""}static cid(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r="c:";if("string"!=typeof e)throw new Error("Invalid ppid");if("number"!=typeof t||isNaN(t)||t<0||t>19)throw new Error("Invalid variant");return t>0&&(r=`c${t}:`),e?r+e.trim():""}static TargetingKeyValues(e){return x(e)}static PrebidORTB2(e){return O(e)}}i(V,"version",e.r);const j=V;function L(e){return{advertiserId:e.advertiserId?.toString(),campaignId:e.campaignId?.toString(),creativeId:e.creativeId?.toString(),isEmpty:e.isEmpty?.toString(),lineItemId:e.lineItemId?.toString(),serviceName:e.serviceName?.toString(),size:e.size?.toString(),slotElementId:e.slot?.getSlotElementId(),sourceAgnosticCreativeId:e.sourceAgnosticCreativeId?.toString(),sourceAgnosticLineItemId:e.sourceAgnosticLineItemId?.toString()}}j.prototype.installGPTEventListeners=function(){const e=this;e.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};const t=window.googletag;t.cmd.push((function(){t.pubads().addEventListener("slotRenderEnded",(function(t){e.witness("googletag.events.slotRenderEnded",L(t))})),t.pubads().addEventListener("impressionViewable",(function(t){e.witness("googletag.events.impressionViewable",L(t))}))}))},j.prototype.installGPTSecureSignals=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];window.googletag=window.googletag||{cmd:[]};const i=window.googletag;t&&t.length>0&&i.cmd.push((()=>{t.forEach((e=>{let{provider:t,id:r}=e;i.secureSignalProviders.push({id:t,collectorFunction:()=>Promise.resolve(r)})}))}))};const F=/^[a-f0-9]{64}$/i;j.prototype.tryIdentifyFromParams=function(e,t){const r=new RegExp(`^${e||"oeid"}$`,"i"),i=new URLSearchParams(window.location.search);let s="";for(const[e,t]of i)if(r.test(e)){s=t;break}""!=s&&(t||function(e){return F.test(e)}(s))&&this.identify((t||"e")+":"+s.toLowerCase())},window.optable=window.optable||{},window.optable.SDK=j,window.optable.cmd=new class{constructor(e){if(this.cmds=e,Array.isArray(this.cmds))for(const e of this.cmds)"function"==typeof e&&e()}push(e){e()}}(window.optable.cmd||[]),window.optable.utils={resolveMultiNodeTargeting:async function(e){return e?e.some((e=>e.priority))?async function(e){const t=new Set,r=new Set,{refs:i,process:s}=K(),n={user:{data:[],eids:[]}},o=new Map,a=new Map,c=new Map;const d=e.map((e=>{let{targetingFn:t,matcher:r,mm:i,priority:d}=e;return t().then((e=>function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const d=Math.max(0,i),{data:u=[],eids:h=[]}=e.ortb2?.user??{};n.user.data.push(...u),c.set(d,e.resolved_ids??[]),h.filter((e=>e.uids.length)).forEach((i=>{const n=i.matcher??t,c=o.get(d)??[];n&&o.set(d,[...c,n]);const u={...s(e,i),matcher:i.matcher??t,mm:i.mm??r},h=a.get(d)??[];a.set(d,[...h,u])}))}(e,r,i,d)))}));await Promise.allSettled(d);const u=Array.from(a.keys()).sort(((e,t)=>e-t)).filter((e=>a.get(e)?.length)).shift();if(u){const e=o.get(u)||[],i=c.get(u)||[];n.user.eids.push(...a.get(u)||[]),e.forEach((e=>t.add(e))),i.forEach((e=>r.add(e)))}return{ortb2:n,eidSources:t,refs:i,resolvedIds:r}}(e):async function(e){const t=new Set,r=new Set,{refs:i,process:s}=K(),n={user:{data:[],eids:[]}};const o=e.map((e=>{let{targetingFn:i,matcher:o,mm:a}=e;return i().then((e=>function(e,i,o){const{data:a=[],eids:c=[]}=e.ortb2?.user??{};n.user.data.push(...a),e.resolved_ids?.forEach((e=>r.add(e))),c.filter((e=>e.uids.length)).forEach((r=>{const a=r.matcher??i;a&&t.add(a),n.user.eids.push({...s(e,r),mm:r.mm??o,matcher:r.matcher??i})}))}(e,o,a)))}));return await Promise.allSettled(o),{ortb2:n,eidSources:t,refs:i,resolvedIds:r}}(e):Promise.reject("No targeting rules provided")}},window.optable.instance_config&&(window.optable.instance=new j(window.optable.instance_config))})()})();
2
+ (()=>{var e={312:(e,t,r)=>{var i;!function(){"use strict";var t="input is invalid type",s="object"==typeof window,n=s?window:{};n.JS_SHA256_NO_WINDOW&&(s=!1);var o=!s&&"object"==typeof self,a=!n.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r.g:o&&(n=self);var c=!n.JS_SHA256_NO_COMMON_JS&&e.exports,d=r.amdO,u=!n.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],l=[24,16,8,0],g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],m=[];!n.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new b(t,!0).update(r)[e]()}},w=function(e){var t=y("hex",e);a&&(t=v(t,e)),t.create=function(){return new b(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var i=f[r];t[i]=y(i,e)}return t},v=function(e,i){var s,o=r(394),a=r(903).Buffer,c=i?"sha224":"sha256";return s=a.from&&!n.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(s(r)).digest("hex"):e(r)}},A=function(e,t){return function(r,i){return new P(r,t,!0).update(i)[e]()}},S=function(e){var t=A("hex",e);t.create=function(t){return new P(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var i=f[r];t[i]=A(i,e)}return t};function b(e,t){t?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function P(e,r,i){var s,n=typeof e;if("string"===n){var o,a=[],c=e.length,d=0;for(s=0;s<c;++s)(o=e.charCodeAt(s))<128?a[d++]=o:o<2048?(a[d++]=192|o>>>6,a[d++]=128|63&o):o<55296||o>=57344?(a[d++]=224|o>>>12,a[d++]=128|o>>>6&63,a[d++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),a[d++]=240|o>>>18,a[d++]=128|o>>>12&63,a[d++]=128|o>>>6&63,a[d++]=128|63&o);e=a}else{if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new b(r,!0).update(e).array());var h=[],p=[];for(s=0;s<64;++s){var l=e[s]||0;h[s]=92^l,p[s]=54^l}b.call(this,r,i),this.update(p),this.oKeyPad=h,this.inner=!0,this.sharedMemory=i}b.prototype.update=function(e){if(!this.finalized){var r,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var s,n,o=0,a=e.length,c=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),r)for(n=this.start;o<a&&n<64;++o)c[n>>>2]|=e[o]<<l[3&n++];else for(n=this.start;o<a&&n<64;++o)(s=e.charCodeAt(o))<128?c[n>>>2]|=s<<l[3&n++]:s<2048?(c[n>>>2]|=(192|s>>>6)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]):s<55296||s>=57344?(c[n>>>2]|=(224|s>>>12)<<l[3&n++],c[n>>>2]|=(128|s>>>6&63)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),c[n>>>2]|=(240|s>>>18)<<l[3&n++],c[n>>>2]|=(128|s>>>12&63)<<l[3&n++],c[n>>>2]|=(128|s>>>6&63)<<l[3&n++],c[n>>>2]|=(128|63&s)<<l[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=c[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},b.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=p[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},b.prototype.hash=function(){var e,t,r,i,s,n,o,a,c,d=this.h0,u=this.h1,h=this.h2,p=this.h3,l=this.h4,f=this.h5,m=this.h6,y=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((s=w[e-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,r=((s=w[e-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,w[e]=w[e-16]+t+w[e-7]+r|0;for(c=u&h,e=0;e<64;e+=4)this.first?(this.is224?(n=300032,y=(s=w[0]-1413257819)-150054599|0,p=s+24177077|0):(n=704751109,y=(s=w[0]-210244248)-1521486534|0,p=s+143694565|0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(n=d&u)^d&h^c,y=p+(s=y+(r=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&m)+g[e]+w[e])|0,p=s+(t+i)|0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(o=p&d)^p&u^n,m=h+(s=m+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&l^~y&f)+g[e+1]+w[e+1])|0,t=((h=s+(t+i)|0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(a=h&p)^h&d^o,f=u+(s=f+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&y^~m&l)+g[e+2]+w[e+2])|0,t=((u=s+(t+i)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(c=u&h)^u&p^a,l=d+(s=l+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&m^~f&y)+g[e+3]+w[e+3])|0,d=s+(t+i)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+d|0,this.h1=this.h1+u|0,this.h2=this.h2+h|0,this.h3=this.h3+p|0,this.h4=this.h4+l|0,this.h5=this.h5+f|0,this.h6=this.h6+m|0,this.h7=this.h7+y|0},b.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,s=this.h4,n=this.h5,o=this.h6,a=this.h7,c=h[e>>>28&15]+h[e>>>24&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>4&15]+h[15&e]+h[t>>>28&15]+h[t>>>24&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>4&15]+h[15&t]+h[r>>>28&15]+h[r>>>24&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>4&15]+h[15&r]+h[i>>>28&15]+h[i>>>24&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>4&15]+h[15&i]+h[s>>>28&15]+h[s>>>24&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>4&15]+h[15&s]+h[n>>>28&15]+h[n>>>24&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>4&15]+h[15&n]+h[o>>>28&15]+h[o>>>24&15]+h[o>>>20&15]+h[o>>>16&15]+h[o>>>12&15]+h[o>>>8&15]+h[o>>>4&15]+h[15&o];return this.is224||(c+=h[a>>>28&15]+h[a>>>24&15]+h[a>>>20&15]+h[a>>>16&15]+h[a>>>12&15]+h[a>>>8&15]+h[a>>>4&15]+h[15&a]),c},b.prototype.toString=b.prototype.hex,b.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,s=this.h4,n=this.h5,o=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},b.prototype.array=b.prototype.digest,b.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},P.prototype=new b,P.prototype.finalize=function(){if(b.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();b.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),b.prototype.finalize.call(this)}};var _=w();_.sha256=_,_.sha224=w(!0),_.sha256.hmac=S(),_.sha224.hmac=S(!0),c?e.exports=_:(n.sha256=_.sha256,n.sha224=_.sha224,d&&(void 0===(i=function(){return _}.call(_,r,_,e))||(e.exports=i)))}()},903:()=>{},394:()=>{}},t={};function r(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,r),n.exports}r.amdO={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";const e={r:"v0.44.3"};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function i(e,r,i){return(r=function(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}async function s(e){const t=await S("/config",e,{method:"GET",headers:{Accept:"application/json"}});return new A(e).setSite(t),t}const n={"Europe/Vienna":"gdpr","Europe/Brussels":"gdpr","Europe/Sofia":"gdpr","Europe/Zagreb":"gdpr","Asia/Nicosia":"gdpr","Europe/Nicosia":"gdpr","Europe/Prague":"gdpr","Europe/Copenhagen":"gdpr","Europe/Tallinn":"gdpr","Europe/Helsinki":"gdpr","Europe/Paris":"gdpr","Europe/Berlin":"gdpr","Europe/Athens":"gdpr","Europe/Budapest":"gdpr","Atlantic/Reykjavik":"gdpr","Europe/Dublin":"gdpr","Europe/Rome":"gdpr","Europe/Riga":"gdpr","Europe/Vaduz":"gdpr","Europe/Vilnius":"gdpr","Europe/Luxembourg":"gdpr","Europe/Malta":"gdpr","Europe/Oslo":"gdpr","Europe/Warsaw":"gdpr","Europe/Lisbon":"gdpr","Europe/Bucharest":"gdpr","Europe/Bratislava":"gdpr","Europe/Ljubljana":"gdpr","Europe/Madrid":"gdpr","Europe/Stockholm":"gdpr","Europe/Amsterdam":"gdpr","Atlantic/Azores":"gdpr","Atlantic/Canary":"gdpr","America/Cayenne":"gdpr","America/Guadeloupe":"gdpr","Atlantic/Madeira":"gdpr","America/Martinique":"gdpr","Indian/Mayotte":"gdpr","Indian/Reunion":"gdpr","America/Marigot":"gdpr","Europe/Zurich":"gdpr","Europe/London":"gdpr","America/Toronto":"can","America/Adak":"us","America/Anchorage":"us","America/Atka":"us","America/Boise":"us","America/Chicago":"us","America/Denver":"us","America/Detroit":"us","America/Indiana/Indianapolis":"us","America/Indiana/Knox":"us","America/Indiana/Marengo":"us","America/Indiana/Petersburg":"us","America/Indiana/Tell_City":"us","America/Indiana/Vevay":"us","America/Indiana/Vincennes":"us","America/Indiana/Winamac":"us","America/Indianapolis":"us","America/Juneau":"us","America/Kentucky/Louisville":"us","America/Kentucky/Monticello":"us","America/Knox_IN":"us","America/Los_Angeles":"us","America/Louisville":"us","America/Menominee":"us","America/Metlakatla":"us","America/New_York":"us","America/Nome":"us","America/North_Dakota/Beulah":"us","America/North_Dakota/Center":"us","America/North_Dakota/New_Salem":"us","America/Phoenix":"us","America/Shiprock":"us","America/Sitka":"us","America/Yakutat":"us","Pacific/Honolulu":"us"},o="tcfcav1",a="tcfeuv2",c=[2],d=[5],u=[7,8,10,12,17,13,18,14,19,20,21,15,22,16,11,9];function h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(e,t){const{gdprApplies:r,gppSectionIDs:i,gdprData:s}=t;if(void 0!==r)return r?"gdpr":"gdpr"===e?null:e;if(void 0!==s&&"gdpr"===e)return"gdpr";if(void 0===i||1===i.length&&0===i[0])return e;if(1===i.length&&-1===i[0])return null;if(i.some((e=>c.includes(e))))return"gdpr";if(i.some((e=>d.includes(e))))return"can";if(i.some((e=>u.includes(e))))return"us";switch(e){case"gdpr":if(!i.some((e=>c.includes(e))))return null;break;case"can":if(!i.some((e=>d.includes(e))))return null;break;case"us":if(!i.some((e=>u.includes(e))))return null}return e}(e,t),s={reg:i,gpp:t.gppString,gppSectionIDs:t.gppSectionIDs,gdpr:t.gdprString,gdprApplies:t.gdprApplies,deviceAccess:!1,createProfilesForAdvertising:!1,useProfilesForAdvertising:!1,measureAdvertisingPerformance:!1};switch(i){case"gdpr":t.gdprData?(s.deviceAccess=l(t.gdprData,1,r.tcfeuVendorID),s.createProfilesForAdvertising=l(t.gdprData,3,r.tcfeuVendorID),s.useProfilesForAdvertising=l(t.gdprData,4,r.tcfeuVendorID),s.measureAdvertisingPerformance=l(t.gdprData,7,r.tcfeuVendorID)):t.gppData&&(s.deviceAccess=f(t.gppData,1,r.tcfeuVendorID),s.createProfilesForAdvertising=f(t.gppData,3,r.tcfeuVendorID),s.useProfilesForAdvertising=f(t.gppData,4,r.tcfeuVendorID),s.measureAdvertisingPerformance=f(t.gppData,7,r.tcfeuVendorID));break;case"can":s.deviceAccess=!0,t.gppData&&(s.createProfilesForAdvertising=g(t.gppData,3,r.tcfcaVendorID),s.useProfilesForAdvertising=g(t.gppData,4,r.tcfcaVendorID),s.measureAdvertisingPerformance=g(t.gppData,7,r.tcfcaVendorID));break;default:s.deviceAccess=!0,s.createProfilesForAdvertising=!0,s.useProfilesForAdvertising=!0,s.measureAdvertisingPerformance=!0}return s}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={};!function(){if("function"==typeof window.__tcfapi)return;let e;const t={};let r=window;for(;r;){try{if(r.frames.__tcfapiLocator){e=r;break}}catch{}if(r===window.top)break;r=r.parent}e&&(window.__tcfapi=function(r,i,s){const n=Math.random()+"";t[n]=s,e.postMessage({__tcfapiCall:{command:r,version:i,callId:n}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch{}const i=r.__tcfapiReturn;i&&"function"==typeof t[i.callId]&&(t[i.callId](i.returnValue,i.success),delete t[i.callId])}),!1))}(),function(){if("function"==typeof window.__gpp)return;let e;const t={};let r=window;for(;r;){try{if(r.frames.__gppLocator){e=r;break}}catch{}if(r===window.top)break;r=r.parent}e&&(window.__gpp=function(r,i){const s=Math.random()+"";t[s]=i,e.postMessage({__gppCall:{command:r,version:"1.1",callId:s}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch{}const i=r.__gppReturn;i&&"function"==typeof t[i.callId]&&(t[i.callId](i.returnValue,i.success),delete t[i.callId])}),!1))}();const i=h(e,r,t);return"function"==typeof window.__tcfapi&&window.__tcfapi?.("addEventListener",2,((s,n)=>{n&&("tcloaded"===s.eventStatus||"useractioncomplete"===s.eventStatus)&&(s=>{r.gdprString=s.tcString,r.gdprApplies=s.gdprApplies,r.gdprData=s,Object.assign(i,h(e,r,t))})(s)})),"function"==typeof window.__gpp&&window.__gpp?.("addEventListener",((s,n)=>{n&&"signalStatus"===s.eventName&&"ready"===s.data&&(s=>{r.gppString=s.gppString,r.gppSectionIDs=s.applicableSections,r.gppData=s,Object.assign(i,h(e,r,t))})(s.pingData)})),i}function l(e,t,r){return r?!!e.purpose?.consents?.[t]&&!!e.vendor?.consents?.[r]:!!e.publisher?.consents?.[t]}function g(e,t,r){const i=t>1,s=e.parsedSections?.[o]||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let n=e.PurposesExpressConsent.includes(t)&&e.VendorExpressConsent.includes(r);return i&&(n||=e.PurposesImpliedConsent.includes(t)&&e.VendorImpliedConsent.includes(r)),n}const n=s.find((e=>"SubsectionType"in e&&3===e.SubsectionType));if(!n)return!1;let a=n.PubPurposesExpressConsent.includes(t);return i&&(a||=n.PubPurposesImpliedConsent.includes(t)),a}function f(e,t,r){const i=t>1,s=e.parsedSections?.[a]||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let n=e.PurposeConsent.includes(t)&&e.VendorConsent.includes(r);return i&&(n||=e.PurposesLITransparency.includes(t)&&e.VendorLegitimateInterest.includes(r)),n}const n=s.find((e=>"SegmentType"in e&&3===e.SegmentType));if(!n)return!1;let o=n.PubPurposesConsent.includes(t);return i&&(o||=n.PubPurposesLITransparency.includes(t)),o}class m{constructor(e){i(this,"consent",void 0),this.consent=e}getItem(e){return this.consent.deviceAccess?window.localStorage.getItem(e):null}setItem(e,t){this.consent.deviceAccess&&window.localStorage.setItem(e,t)}removeItem(e){this.consent.deviceAccess&&window.localStorage.removeItem(e)}}const y="_optable_pairId";function w(e){const t=new Uint16Array(e.length);for(let r=0;r<t.length;r++)t[r]=e.charCodeAt(r);return btoa(String.fromCharCode(...new Uint8Array(t.buffer)))}function v(e){return e.node?w(`${e.host}/${e.node}`):w(`${e.host}`)}class A{constructor(e){this.config=e,i(this,"passportKeys",void 0),i(this,"targetingKeys",void 0),i(this,"siteKeys",void 0),i(this,"pairKeys",void 0),i(this,"storage",void 0),this.passportKeys=function(e){const t=[],r=[],i=`OPTABLE_PASSPORT_${v(e)}`;return t.push(i),r.push(i),e.legacyHostCache?(r.push(`OPTABLE_PASSPORT_${w(`${e.legacyHostCache}`)}`),r.push(`OPTABLE_PASS_${w(`${e.legacyHostCache}/${e.site}`)}`)):r.push(`OPTABLE_PASS_${w(`${e.host}/${e.site}`)}`),{write:t,read:r}}(e),this.targetingKeys=function(e){const t=`OPTABLE_TARGETING_${v(e)}`;return{write:[t,e.optableCacheTargeting],read:[t]}}(e),this.siteKeys=function(e){const t=`OPTABLE_SITE_${v(e)}`;return{write:[t],read:[t]}}(e),this.pairKeys={write:[y],read:[y]},this.storage=new m(this.config.consent)}getPassport(){return this.readStorageKeys(this.passportKeys)}setPassport(e){this.writeToStorageKeys(this.passportKeys,e)}getTargeting(){const e=this.readStorageKeys(this.targetingKeys);return e?JSON.parse(e):null}setTargeting(e){e&&(this.writeToStorageKeys(this.targetingKeys,JSON.stringify(e)),this.setPairIDs(e))}getSite(){const e=this.readStorageKeys(this.siteKeys);return e?JSON.parse(e):null}setSite(e){e&&this.writeToStorageKeys(this.siteKeys,JSON.stringify(e))}setPairIDs(e){const t=e.ortb2?.user?.eids?.filter((e=>"pair-protocol.com"===e.source)),r=t?.flatMap((e=>e.uids));if(!r)return;const i=new Set(r.map((e=>e.id)));this.writeToStorageKeys(this.pairKeys,btoa(JSON.stringify({envelope:[...i]})))}getPairIDs(){const e=this.readStorageKeys(this.pairKeys);return e?JSON.parse(atob(e))?.envelope:null}readStorageKeys(e){for(const t of e.read){const e=this.storage.getItem(t);if(e)return e}return null}writeToStorageKeys(e,t){if(t)for(const r of e.write)this.storage.setItem(r,t)}clearStorageKeys(e){for(const t of[...e.read,...e.write])this.storage.removeItem(t)}clearPassport(){this.clearStorageKeys(this.passportKeys)}clearTargeting(){this.clearStorageKeys(this.targetingKeys)}clearSite(){this.clearStorageKeys(this.siteKeys)}}async function S(t,r,i){const s=await globalThis.fetch(function(t,r,i){const{host:s,cookies:n}=r,o=new URL(t,`https://${s}`);if(o.searchParams.set("osdk",`web-${e.r}`),o.searchParams.set("sid",r.sessionID),r.skipEnrichment&&o.searchParams.set("skip_enrichment",`${r.skipEnrichment}`),r.node&&o.searchParams.set("t",r.node),r.site&&o.searchParams.set("o",r.site),void 0!==r.consent.gpp&&o.searchParams.set("gpp",r.consent.gpp),void 0!==r.consent.gppSectionIDs&&o.searchParams.set("gpp_sid",r.consent.gppSectionIDs.join(",")),void 0!==r.consent.gdpr&&o.searchParams.set("gdpr_consent",r.consent.gdpr),void 0!==r.consent.gdprApplies&&o.searchParams.set("gdpr",Number(r.consent.gdprApplies).toString()),r.readOnly&&o.searchParams.set("ro","true"),r.timeout&&o.searchParams.set("timeout",r.timeout),n)o.searchParams.set("cookies","yes");else{const e=new A(r).getPassport();o.searchParams.set("cookies","no"),o.searchParams.set("passport",e||"")}const a={...i};return a.credentials=r.consent.deviceAccess?"include":"omit",r.mockedIP&&(a.headers=new Headers(a.headers),a.headers.set("X-Forwarded-For",r.mockedIP)),new Request(o.toString(),a)}(t,r,i)),n=s.headers.get("Content-Type"),o=n?.startsWith("application/json")?await s.json():await s.text();if(!s.ok)throw new Error(o.error);return o.passport&&(new A(r).setPassport(o.passport),delete o.passport),o}var b,P,_,I=((P=I||{})[P.Banner=1]="Banner",P[P.Video=2]="Video",P[P.Audio=3]="Audio",P[P.Native=4]="Native",P),E={},T={},k={};(_=b||(b={})).Placement=T,_.Media=k,_.Context=E;const C={cookies:!0,initPassport:!0,readOnly:!1,experiments:[],consent:{reg:null,deviceAccess:!0,createProfilesForAdvertising:!0,useProfilesForAdvertising:!0,measureAdvertisingPerformance:!0}};function D(){const e=new Uint8Array(16);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function O(e){return{user:{data:(e?.audience??[]).map((e=>({name:e.provider,segment:e.ids,ext:{segtax:e.rtb_segtax}}))),ext:{eids:(e?.user??[]).map((e=>({source:e.provider,uids:e.ids.map((e=>{let{id:t}=e;return{id:t,atype:3}}))})))}}}}function x(e){const t={};if(!e)return t;for(const r of e.audience??[])r.keyspace&&(r.keyspace in t||(t[r.keyspace]=[]),t[r.keyspace].push(...r.ids.map((e=>e.id))));return t}function N(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function K(){const e={};let t=0;return{refs:e,process:(r,i)=>{if(!r.refs)return i;for(const s of i.uids)if(N(s.ext?.optable)&&"ref"in s.ext.optable&&"string"==typeof s.ext.optable.ref){const i=r.refs[s.ext.optable.ref];t+=1;const n=t.toString(10);e[n]=i,s.ext.optable.ref=n}return i}}}var B=r(312);class V{constructor(e){i(this,"dcn",void 0),i(this,"init",void 0),this.dcn=function(e){const t={host:e.host,site:e.site,optableCacheTargeting:e.optableCacheTargeting??"optable-cache:targeting",cookies:e.cookies??C.cookies,initPassport:e.initPassport??C.initPassport,consent:C.consent,readOnly:e.readOnly??C.readOnly,node:e.node,legacyHostCache:e.legacyHostCache,experiments:e.experiments??C.experiments,mockedIP:e.mockedIP,sessionID:e.sessionID??D(),skipEnrichment:e.skipEnrichment,initTargeting:e.initTargeting,abTests:e.abTests,additionalTargetingSignals:e.additionalTargetingSignals,timeout:e.timeout};return e.consent?.static?t.consent=e.consent.static:e.consent?.cmpapi&&(t.consent=p(function(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=n[e];return"can"===t?["fr","fr-CA"].some((e=>navigator.languages.includes(e)))?"can":null:t??null}(),e.consent.cmpapi)),t}(e),this.init=this.initialize()}async initialize(){this.dcn.initPassport&&await s(this.dcn).catch((()=>{})),this.dcn.initTargeting&&this.targeting().catch((()=>{}))}async identify(){await this.init;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,t){return S("/identify",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}(this.dcn,t.filter((e=>e)))}async uid2Token(e){return await this.init,function(e,t){return S("/uid2/token",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}(this.dcn,e)}async targeting(){const e=function(e){if("string"==typeof e)return{ids:[e],hids:[]};if(N(e))return{ids:e?.ids??[],hids:e?.hids??[]};throw"Invalid request type for targeting. Expected string or object."}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__passport__");return await this.init,async function(e,t){const r=new URLSearchParams;t.ids.forEach((e=>r.append("id",e))),t.hids.forEach((e=>r.append("hid",e)));const i=function(e){if(!e||0===e.length)return null;if(e.reduce(((e,t)=>e+t.trafficPercentage),0)>100)return console.error("AB Test Config Error: Traffic Percentage Sum Exceeds 100%"),null;const t=Math.floor(100*Math.random());let r=0;for(const i of e)if(r+=i.trafficPercentage,t<r)return i;return null}(e.abTests);i&&(r.append("ab_test_id",i.id),i.matcher_override&&[...i.matcher_override].sort(((e,t)=>e.rank-t.rank)).forEach((e=>{r.append("matcher_override",e.id)})),i.skipMatchers&&r.append("skip_matchers",i.skipMatchers.join(",")));e.additionalTargetingSignals?.ref&&r.append("ref",`${window.location.protocol}//${window.location.host}${window.location.pathname}`);const s="/v2/targeting?"+r.toString(),n=await S(s,e,{method:"GET",headers:{Accept:"application/json"}});return n&&(new A(e).setTargeting(n),function(e,t){const r=t.ortb2?.user?.eids?.map((e=>e.matcher));window.dispatchEvent(new CustomEvent("optable-targeting:change",{detail:{instance:e.node||e.host,resolved:!!t.ortb2?.user?.eids?.length,resolvedIDs:t.resolved_ids??[],abTestID:t.ab_test_id??void 0,ortb2:t.ortb2,provenance:new Set(r)}}))}(e,n)),n}(this.dcn,e)}targetingFromCache(){return e=this.dcn,new A(e).getTargeting();var e}async site(){return s(this.dcn)}siteFromCache(){return e=this.dcn,new A(e).getSite();var e}targetingClearCache(){var e;e=this.dcn,new A(e).clearTargeting()}async prebidORTB2(){return O(await this.targeting())}prebidORTB2FromCache(){return O(this.targetingFromCache())}async targetingKeyValues(){return x(await this.targeting())}targetingKeyValuesFromCache(){return x(this.targetingFromCache())}async witness(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this.init,function(e,t,r){const i={event:t,properties:r};return S("/witness",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,e,t)}async profile(e){return await this.init,function(e,t){const r={traits:t};return S("/profile",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,e)}async tokenize(e){return await this.init,function(e,t){let r={id:t};return S("/v2/tokenize",e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,e)}async resolve(e){return await this.init,async function(e,t){const r=new URLSearchParams;"string"==typeof t&&r.append("id",t);const i="/v1/resolve?"+r.toString();return function(e){const t={clusters:[],lmpid:""};if("object"!=typeof e||null===e)return t;if("lmpid"in e&&"string"==typeof e?.lmpid&&(t.lmpid=e.lmpid),!("clusters"in e)||!Array.isArray(e?.clusters))return t;for(const r of e.clusters){const e={ids:[],traits:[]};if(Array.isArray(r?.ids))for(const t of r.ids)"string"==typeof t&&e.ids.push(t);if(Array.isArray(r?.traits))for(const t of r.traits)"string"==typeof t?.key&&"string"==typeof t?.value&&e.traits.push({key:t.key,value:t.value});(e.ids.length>0||e.traits.length>0)&&t.clusters.push(e)}return t}(await S(i,e,{method:"GET",headers:{Accept:"application/json"}}))}(this.dcn,e)}static eid(e){return e?"e:"+B.sha256.hex(e.toLowerCase().trim()):""}static sha256(e){return e?B.sha256.hex(e):""}static cid(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r="c:";if("string"!=typeof e)throw new Error("Invalid ppid");if("number"!=typeof t||isNaN(t)||t<0||t>19)throw new Error("Invalid variant");return t>0&&(r=`c${t}:`),e?r+e.trim():""}static TargetingKeyValues(e){return x(e)}static PrebidORTB2(e){return O(e)}}i(V,"version",e.r);const j=V;function L(e){return{advertiserId:e.advertiserId?.toString(),campaignId:e.campaignId?.toString(),creativeId:e.creativeId?.toString(),isEmpty:e.isEmpty?.toString(),lineItemId:e.lineItemId?.toString(),serviceName:e.serviceName?.toString(),size:e.size?.toString(),slotElementId:e.slot?.getSlotElementId(),sourceAgnosticCreativeId:e.sourceAgnosticCreativeId?.toString(),sourceAgnosticLineItemId:e.sourceAgnosticLineItemId?.toString()}}j.prototype.installGPTEventListeners=function(){const e=this;e.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};const t=window.googletag;t.cmd.push((function(){t.pubads().addEventListener("slotRenderEnded",(function(t){e.witness("gpt_events_slotRenderEnded",L(t))})),t.pubads().addEventListener("impressionViewable",(function(t){e.witness("gpt_events_impressionViewable",L(t))}))}))},j.prototype.installGPTSecureSignals=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];window.googletag=window.googletag||{cmd:[]};const i=window.googletag;t&&t.length>0&&i.cmd.push((()=>{t.forEach((e=>{let{provider:t,id:r}=e;i.secureSignalProviders.push({id:t,collectorFunction:()=>Promise.resolve(r)})}))}))};const F=/^[a-f0-9]{64}$/i;j.prototype.tryIdentifyFromParams=function(e,t){const r=new RegExp(`^${e||"oeid"}$`,"i"),i=new URLSearchParams(window.location.search);let s="";for(const[e,t]of i)if(r.test(e)){s=t;break}""!=s&&(t||function(e){return F.test(e)}(s))&&this.identify((t||"e")+":"+s.toLowerCase())},window.optable=window.optable||{},window.optable.SDK=j,window.optable.cmd=new class{constructor(e){if(this.cmds=e,Array.isArray(this.cmds))for(const e of this.cmds)"function"==typeof e&&e()}push(e){e()}}(window.optable.cmd||[]),window.optable.utils={resolveMultiNodeTargeting:async function(e){return e?e.some((e=>e.priority))?async function(e){const t=new Set,r=new Set,{refs:i,process:s}=K(),n={user:{data:[],eids:[]}},o=new Map,a=new Map,c=new Map;const d=e.map((e=>{let{targetingFn:t,matcher:r,mm:i,priority:d}=e;return t().then((e=>function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const d=Math.max(0,i),{data:u=[],eids:h=[]}=e.ortb2?.user??{};n.user.data.push(...u),c.set(d,e.resolved_ids??[]),h.filter((e=>e.uids.length)).forEach((i=>{const n=i.matcher??t,c=o.get(d)??[];n&&o.set(d,[...c,n]);const u={...s(e,i),matcher:i.matcher??t,mm:i.mm??r},h=a.get(d)??[];a.set(d,[...h,u])}))}(e,r,i,d)))}));await Promise.allSettled(d);const u=Array.from(a.keys()).sort(((e,t)=>e-t)).filter((e=>a.get(e)?.length)).shift();if(u){const e=o.get(u)||[],i=c.get(u)||[];n.user.eids.push(...a.get(u)||[]),e.forEach((e=>t.add(e))),i.forEach((e=>r.add(e)))}return{ortb2:n,eidSources:t,refs:i,resolvedIds:r}}(e):async function(e){const t=new Set,r=new Set,{refs:i,process:s}=K(),n={user:{data:[],eids:[]}};const o=e.map((e=>{let{targetingFn:i,matcher:o,mm:a}=e;return i().then((e=>function(e,i,o){const{data:a=[],eids:c=[]}=e.ortb2?.user??{};n.user.data.push(...a),e.resolved_ids?.forEach((e=>r.add(e))),c.filter((e=>e.uids.length)).forEach((r=>{const a=r.matcher??i;a&&t.add(a),n.user.eids.push({...s(e,r),mm:r.mm??o,matcher:r.matcher??i})}))}(e,o,a)))}));return await Promise.allSettled(o),{ortb2:n,eidSources:t,refs:i,resolvedIds:r}}(e):Promise.reject("No targeting rules provided")}},window.optable.instance_config&&(window.optable.instance=new j(window.optable.instance_config))})()})();
@@ -27,10 +27,10 @@ OptableSDK.prototype.installGPTEventListeners = function () {
27
27
  const gpt = window.googletag;
28
28
  gpt.cmd.push(function () {
29
29
  gpt.pubads().addEventListener("slotRenderEnded", function (event) {
30
- sdk.witness("googletag.events.slotRenderEnded", toWitnessProperties(event));
30
+ sdk.witness("gpt_events_slotRenderEnded", toWitnessProperties(event));
31
31
  });
32
32
  gpt.pubads().addEventListener("impressionViewable", function (event) {
33
- sdk.witness("googletag.events.impressionViewable", toWitnessProperties(event));
33
+ sdk.witness("gpt_events_impressionViewable", toWitnessProperties(event));
34
34
  });
35
35
  });
36
36
  };
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "v0.44.1"
2
+ "version": "v0.44.3"
3
3
  }
@@ -1,82 +1,82 @@
1
- export function buildRTD(options?: {}): {
2
- enableLogging: any;
3
- log(...args: any[]): void;
4
- eidSources: any;
5
- skipMerge: any;
6
- optableCacheTargeting: any;
7
- matcherFilter: any;
8
- matcherExclude: any;
9
- appendMergeStrategy: typeof appendMergeStrategy;
10
- prependMergeStrategy: typeof prependMergeStrategy;
11
- replaceMergeStrategy: typeof replaceMergeStrategy;
12
- appendNewMergeStrategy: typeof appendNewMergeStrategy;
13
- targetingFromCache: typeof targetingFromCache;
14
- handleRtd(reqBidsConfigObj: any): Promise<void | null>;
15
- };
16
- export function targetingFromCache(config?: {}): any;
17
- export function appendMergeStrategy(existingEids: any, newEids: any): any[];
18
- export function prependMergeStrategy(existingEids: any, newEids: any): any[];
19
- export function replaceMergeStrategy(existingEids: any, newEids: any, key?: (e: any) => any): any[];
20
- export function appendNewMergeStrategy(existingEids: any, newEids: any, key?: (e: any) => any): any[];
21
- export const defaultEIDSources: {
22
- "adnxs.com": {
23
- route: string;
24
- };
25
- "adsrvr.org": {
26
- route: string;
27
- };
28
- "adserver.org": {
29
- route: string;
30
- };
31
- "audigent.com": {
32
- route: string;
33
- };
34
- "bidswitch.net": {
35
- route: string;
36
- };
37
- "bridge.criteo.com": {
38
- route: string;
39
- };
40
- "criteo-hemapi.com": {
41
- route: string;
42
- };
43
- "epsilon.com": {
44
- route: string;
45
- };
46
- "gumgum.com": {
47
- route: string;
48
- };
49
- "indexexchange.com": {
50
- route: string;
51
- };
52
- "kargo.com": {
53
- route: string;
54
- };
55
- "openx.com": {
56
- route: string;
57
- };
58
- "pubmatic.com": {
59
- route: string;
60
- };
61
- "rubiconproject.com": {
62
- route: string;
63
- };
64
- "smartadserver.com": {
65
- route: string;
66
- };
67
- "sovrn.com": {
68
- route: string;
69
- };
70
- "triplelift.com": {
71
- route: string;
72
- };
73
- "uidapi.com": {
74
- route: string;
75
- };
76
- "yahoo.com": {
77
- route: string;
78
- };
79
- "yieldmo.com": {
80
- route: string;
81
- };
1
+ interface EID {
2
+ source: string;
3
+ uids: Array<{
4
+ id?: string;
5
+ atype?: number;
6
+ ext?: {
7
+ provider?: string;
8
+ };
9
+ }>;
10
+ matcher?: string;
11
+ }
12
+ interface EIDSource {
13
+ routes?: string[];
14
+ route?: string;
15
+ mergeStrategy?: MergeStrategy;
16
+ }
17
+ interface ORTB2User {
18
+ eids?: EID[];
19
+ ext?: {
20
+ eids?: EID[];
21
+ };
22
+ }
23
+ interface ORTB2 {
24
+ user?: ORTB2User;
25
+ }
26
+ interface TargetingData {
27
+ ortb2?: {
28
+ user?: {
29
+ eids?: EID[];
30
+ };
31
+ };
32
+ }
33
+ interface ReqBidsConfigObj {
34
+ ortb2Fragments: {
35
+ global: ORTB2;
36
+ bidder: {
37
+ [bidderName: string]: ORTB2;
38
+ };
39
+ };
40
+ }
41
+ type MergeStrategy = (existingEids: EID[], newEids: EID[], key?: (eid: EID) => string) => EID[];
42
+ interface RTDConfig {
43
+ enableLogging: boolean;
44
+ log: (level: string, message: string, ...args: any[]) => void;
45
+ eidSources: {
46
+ [source: string]: EIDSource;
47
+ };
48
+ skipMerge: (targetORTB2: ORTB2, eidSource: string) => boolean;
49
+ optableCacheTargeting: string;
50
+ matcherFilter: string[];
51
+ matcherExclude: string[];
52
+ mergeStrategy?: MergeStrategy;
53
+ appendMergeStrategy: MergeStrategy;
54
+ prependMergeStrategy: MergeStrategy;
55
+ replaceMergeStrategy: MergeStrategy;
56
+ appendNewMergeStrategy: MergeStrategy;
57
+ targetingFromCache: (config?: RTDConfig) => TargetingData | null;
58
+ handleRtd: (reqBidsConfigObj: ReqBidsConfigObj) => Promise<void | null>;
59
+ }
60
+ interface RTDOptions {
61
+ enableLogging?: boolean;
62
+ eidSources?: {
63
+ [source: string]: EIDSource;
64
+ };
65
+ skipMerge?: (targetORTB2: ORTB2, eidSource: string) => boolean;
66
+ optableCacheTargeting?: string;
67
+ matcherFilter?: string[];
68
+ matcherExclude?: string[];
69
+ targetingData?: TargetingData;
70
+ forceGlobalRouting?: boolean;
71
+ mergeStrategy?: MergeStrategy;
72
+ }
73
+ declare function appendMergeStrategy(existingEids: EID[], newEids: EID[]): EID[];
74
+ declare function prependMergeStrategy(existingEids: EID[], newEids: EID[]): EID[];
75
+ declare function replaceMergeStrategy(existingEids: EID[], newEids: EID[], key?: (e: EID) => string): EID[];
76
+ declare function appendNewMergeStrategy(existingEids: EID[], newEids: EID[], key?: (e: EID) => string): EID[];
77
+ declare const defaultEIDSources: {
78
+ [source: string]: EIDSource;
82
79
  };
80
+ declare function targetingFromCache(config?: RTDConfig): TargetingData | null;
81
+ declare function buildRTD(options?: RTDOptions): RTDConfig;
82
+ export { buildRTD, targetingFromCache, appendMergeStrategy, prependMergeStrategy, replaceMergeStrategy, appendNewMergeStrategy, defaultEIDSources, type EID, type EIDSource, type ORTB2, type ORTB2User, type TargetingData, type ReqBidsConfigObj, type RTDConfig, type RTDOptions, type MergeStrategy, };
@@ -1,3 +1,4 @@
1
+ // RTD (Real-Time Data) module for Prebid.js integration
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,8 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
10
- // RTD (Real-Time Data) module for Prebid.js integration
11
- //
12
11
  // Merge strategies for EIDs
13
12
  function appendMergeStrategy(existingEids, newEids) {
14
13
  return [...existingEids, ...newEids];
@@ -49,30 +48,21 @@ function appendNewMergeStrategy(existingEids, newEids, key = (e) => e.source) {
49
48
  return result.flat();
50
49
  }
51
50
  const defaultEIDSources = {
52
- "adnxs.com": { route: "appnexus" },
53
- "adsrvr.org": { route: "global" },
54
- "adserver.org": { route: "global" },
55
- "audigent.com": { route: "global" },
56
- "bidswitch.net": { route: "global" },
57
- "bridge.criteo.com": { route: "global" },
58
- "criteo-hemapi.com": { route: "global" },
59
- "epsilon.com": { route: "global" },
60
- "gumgum.com": { route: "gumgum" },
61
- "indexexchange.com": { route: "ix" },
62
- "kargo.com": { route: "kargo" },
63
- "openx.com": { route: "openx" },
64
- "pubmatic.com": { route: "pubmatic" },
65
- "rubiconproject.com": { route: "rubicon" },
66
- "smartadserver.com": { route: "smartadserver" },
67
- "sovrn.com": { route: "sovrn" },
68
- "triplelift.com": { route: "triplelift" },
69
- "uidapi.com": { route: "global" },
70
- "yahoo.com": { route: "global" },
71
- "yieldmo.com": { route: "yieldmo" },
51
+ "adnxs.com": { routes: ["appnexus", "appnexus_s2s", "appnexus-s2s"] },
52
+ "gumgum.com": { routes: ["gumgum", "gumgum_s2s", "gumgum-s2s"] },
53
+ "indexexchange.com": { routes: ["ix", "ix_s2s", "ix-s2s"] },
54
+ "kargo.com": { routes: ["kargo", "kargo_s2s", "kargo-s2s"] },
55
+ "openx.com": { routes: ["openx", "openx_s2s", "openx-s2s"] },
56
+ "pubmatic.com": { routes: ["pubmatic", "pubmatic_s2s", "pubmatic-s2s"] },
57
+ "rubiconproject.com": { routes: ["rubicon", "rubicon_s2s", "rubicon-s2s"] },
58
+ "smartadserver.com": { routes: ["smartadserver", "smartadserver_s2s", "smartadserver-s2s"] },
59
+ "sovrn.com": { routes: ["sovrn", "sovrn_s2s", "sovrn-s2s"] },
60
+ "triplelift.com": { routes: ["triplelift", "triplelift_s2s", "triplelift-s2s"] },
61
+ "yieldmo.com": { routes: ["yieldmo", "yieldmo_s2s", "yieldmo-s2s"] },
72
62
  };
73
63
  function forceGlobalRouting() {
74
64
  Object.values(defaultEIDSources).forEach((source) => {
75
- source.route = "global";
65
+ source.routes = ["global"];
76
66
  });
77
67
  }
78
68
  // Simple logging utility
@@ -85,7 +75,7 @@ function log(level, message, ...args) {
85
75
  function targetingFromCache(config = {}) {
86
76
  var _a;
87
77
  try {
88
- return JSON.parse(localStorage.getItem((_a = config.optableCacheTargeting) !== null && _a !== void 0 ? _a : "OPTABLE_RESOLVED"));
78
+ return JSON.parse(localStorage.getItem((_a = config.optableCacheTargeting) !== null && _a !== void 0 ? _a : "OPTABLE_RESOLVED") || "null");
89
79
  }
90
80
  catch (error) {
91
81
  config.log("error", "Failed to parse cached targeting data:", error);
@@ -119,19 +109,19 @@ function mergeStrategy(config, eidSource) {
119
109
  return appendMergeStrategy;
120
110
  }
121
111
  function merge(config, targetORTB2, sourceORTB2) {
122
- var _a, _b, _c;
112
+ var _a, _b, _c, _d, _e, _f;
123
113
  /* eslint-disable no-param-reassign */
124
114
  targetORTB2.user = (_a = targetORTB2.user) !== null && _a !== void 0 ? _a : {};
125
115
  targetORTB2.user.ext = (_b = targetORTB2.user.ext) !== null && _b !== void 0 ? _b : {};
126
116
  targetORTB2.user.ext.eids = (_c = targetORTB2.user.ext.eids) !== null && _c !== void 0 ? _c : [];
127
117
  /* eslint-enable no-param-reassign */
128
118
  let skipped = 0;
129
- const eidsBySource = sourceORTB2.user.ext.eids.reduce((acc, eid) => {
119
+ const eidsBySource = ((_f = (_e = (_d = sourceORTB2.user) === null || _d === void 0 ? void 0 : _d.ext) === null || _e === void 0 ? void 0 : _e.eids) === null || _f === void 0 ? void 0 : _f.reduce((acc, eid) => {
130
120
  var _a;
131
121
  acc[eid.source] = (_a = acc[eid.source]) !== null && _a !== void 0 ? _a : [];
132
122
  acc[eid.source].push(eid);
133
123
  return acc;
134
- }, {});
124
+ }, {})) || {};
135
125
  Object.entries(eidsBySource).forEach(([eidSource, eids]) => {
136
126
  if (config.skipMerge(targetORTB2, eidSource)) {
137
127
  skipped += 1;
@@ -153,47 +143,51 @@ function handleRtd(config, reqBidsConfigObj, targetingData) {
153
143
  let skippedEids = 0;
154
144
  config.log("info", "targetingData", targetingData);
155
145
  (_c = (_b = (_a = targetingData === null || targetingData === void 0 ? void 0 : targetingData.ortb2) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.eids) === null || _c === void 0 ? void 0 : _c.forEach((eid, index) => {
156
- var _a, _b;
146
+ var _a;
157
147
  if (!eid || typeof eid !== "object") {
158
148
  config.log("warn", `Skipping invalid EID at index ${index}:`, eid);
159
149
  skippedEids += 1;
160
150
  return;
161
151
  }
162
152
  // Apply matcher filter
163
- if (config.matcherFilter.length > 0 && !config.matcherFilter.includes(eid.matcher)) {
153
+ if (config.matcherFilter.length > 0 && !config.matcherFilter.includes(eid.matcher || "")) {
164
154
  config.log("info", `EID with source ${eid.source} filtered out by matcher filter (matcher: ${eid.matcher})`);
165
155
  skippedEids += 1;
166
156
  return;
167
157
  }
168
158
  // Apply matcher exclusions
169
- if (config.matcherExclude.length > 0 && config.matcherExclude.includes(eid.matcher)) {
159
+ if (config.matcherExclude.length > 0 && config.matcherExclude.includes(eid.matcher || "")) {
170
160
  config.log("info", `EID with source ${eid.source} excluded (matcher: ${eid.matcher})`);
171
161
  skippedEids += 1;
172
162
  return;
173
163
  }
174
- const route = (_a = config.eidSources[eid.source]) === null || _a === void 0 ? void 0 : _a.route;
175
- if (!route) {
176
- config.log("warn", `EID with unsupported source: ${eid.source}`);
164
+ const eidSourceConfig = config.eidSources[eid.source];
165
+ const routes = (_a = eidSourceConfig === null || eidSourceConfig === void 0 ? void 0 : eidSourceConfig.routes) !== null && _a !== void 0 ? _a : ((eidSourceConfig === null || eidSourceConfig === void 0 ? void 0 : eidSourceConfig.route) ? [eidSourceConfig.route] : ["global"]);
166
+ if (!routes || !Array.isArray(routes) || routes.length === 0) {
167
+ config.log("warn", `EID with source ${eid.source} has no supported routes`);
177
168
  skippedEids += 1;
178
169
  return;
179
170
  }
180
- eidsPerRoute[route] = (_b = eidsPerRoute[route]) !== null && _b !== void 0 ? _b : { user: { ext: { eids: [] } } };
181
- eidsPerRoute[route].user.ext.eids.push(eid);
182
- config.log("info", `EID with source ${eid.source} routed to ${route}`);
171
+ routes.forEach((route) => {
172
+ var _a;
173
+ eidsPerRoute[route] = (_a = eidsPerRoute[route]) !== null && _a !== void 0 ? _a : { user: { ext: { eids: [] } } };
174
+ eidsPerRoute[route].user.ext.eids.push(eid);
175
+ config.log("info", `EID with source ${eid.source} routed to ${route}`);
176
+ });
183
177
  processedEids += 1;
184
178
  });
185
179
  let globalEidsCount = 0;
186
180
  let bidderEidsCount = 0;
187
181
  Object.entries(eidsPerRoute).forEach(([route, ortb2]) => {
188
- var _a;
189
- const count = ortb2.user.ext.eids.length;
182
+ var _a, _b, _c, _d;
183
+ const count = ((_c = (_b = (_a = ortb2.user) === null || _a === void 0 ? void 0 : _a.ext) === null || _b === void 0 ? void 0 : _b.eids) === null || _c === void 0 ? void 0 : _c.length) || 0;
190
184
  if (route === "global") {
191
185
  globalEidsCount += count;
192
186
  skippedEids += merge(config, reqBidsConfigObj.ortb2Fragments.global, ortb2);
193
187
  }
194
188
  else {
195
189
  bidderEidsCount += count;
196
- const bidder = (_a = reqBidsConfigObj.ortb2Fragments.bidder[route]) !== null && _a !== void 0 ? _a : {};
190
+ const bidder = (_d = reqBidsConfigObj.ortb2Fragments.bidder[route]) !== null && _d !== void 0 ? _d : {};
197
191
  skippedEids += merge(config, bidder, ortb2);
198
192
  // eslint-disable-next-line no-param-reassign
199
193
  reqBidsConfigObj.ortb2Fragments.bidder[route] = bidder;
@@ -203,9 +197,10 @@ function handleRtd(config, reqBidsConfigObj, targetingData) {
203
197
  config.log("info", `Merged ${globalEidsCount} global EIDs and ${bidderEidsCount} bidder-specific EID sets`);
204
198
  config.log("info", "Successfully completed handleRtd function");
205
199
  }
200
+ // @ts-ignore
206
201
  function liveIntentUID2(ortb2) {
207
202
  var _a, _b, _c;
208
- return (_c = (_b = (_a = ortb2.user) === null || _a === void 0 ? void 0 : _a.ext) === null || _b === void 0 ? void 0 : _b.eids) === null || _c === void 0 ? void 0 : _c.some((eid) => eid.source === "uidapi.com" && eid.uids.some((uid) => { var _a; return ((_a = uid.ext) === null || _a === void 0 ? void 0 : _a.provider) === "liveintent.com"; }));
203
+ return (((_c = (_b = (_a = ortb2.user) === null || _a === void 0 ? void 0 : _a.ext) === null || _b === void 0 ? void 0 : _b.eids) === null || _c === void 0 ? void 0 : _c.some((eid) => eid.source === "uidapi.com" && eid.uids.some((uid) => { var _a; return ((_a = uid.ext) === null || _a === void 0 ? void 0 : _a.provider) === "liveintent.com"; }))) || false);
209
204
  }
210
205
  function buildRTD(options = {}) {
211
206
  var _a, _b, _c, _d, _e, _f;
@@ -214,9 +209,9 @@ function buildRTD(options = {}) {
214
209
  }
215
210
  return {
216
211
  enableLogging: (_b = (_a = sessionStorage.optableDebug) !== null && _a !== void 0 ? _a : options.enableLogging) !== null && _b !== void 0 ? _b : false,
217
- log(...args) {
212
+ log(level, message, ...args) {
218
213
  if (this.enableLogging) {
219
- log(...args);
214
+ log(level, message, ...args);
220
215
  }
221
216
  },
222
217
  eidSources: (_c = options.eidSources) !== null && _c !== void 0 ? _c : Object.assign({}, defaultEIDSources),
@@ -228,6 +223,7 @@ function buildRTD(options = {}) {
228
223
  optableCacheTargeting: (_d = options.optableCacheTargeting) !== null && _d !== void 0 ? _d : "OPTABLE_RESOLVED",
229
224
  matcherFilter: (_e = options.matcherFilter) !== null && _e !== void 0 ? _e : [],
230
225
  matcherExclude: (_f = options.matcherExclude) !== null && _f !== void 0 ? _f : [],
226
+ mergeStrategy: options.mergeStrategy,
231
227
  appendMergeStrategy,
232
228
  prependMergeStrategy,
233
229
  replaceMergeStrategy,
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "homepage": "https://optable.co",
11
11
  "license": "SEE LICENSE IN LICENSE",
12
- "version": "v0.44.1",
12
+ "version": "v0.44.3",
13
13
  "devDependencies": {
14
14
  "@babel/core": "^7.12.3",
15
15
  "@babel/plugin-proposal-class-properties": "^7.12.1",