@optable/web-sdk 0.44.6 → 0.45.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.
- package/README.md +50 -10
- package/browser/dist/sdk.js +1 -1
- package/lib/dist/addons/gpt.js +33 -12
- package/lib/dist/addons/prototypes/analytics.js +4 -1
- package/lib/dist/addons/try-identify.js +1 -1
- package/lib/dist/build.json +1 -1
- package/lib/dist/edge/profile.d.ts +1 -1
- package/lib/dist/edge/profile.js +2 -4
- package/lib/dist/sdk.d.ts +1 -1
- package/lib/dist/sdk.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ If you're building a web application or want to bundle the SDK functionality wit
|
|
|
42
42
|
|
|
43
43
|
```shell
|
|
44
44
|
# latest stable release:
|
|
45
|
-
|
|
45
|
+
npm install @optable/web-sdk
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
And then simply `import` and use the `OptableSDK` class as shown in the _Usage_ section below.
|
|
@@ -92,7 +92,7 @@ const sdk = new OptableSDK({ host: "dcn.customer.com", site: "my-site", cookies:
|
|
|
92
92
|
|
|
93
93
|
Note that the default is `cookies: true` and will be inferred if you do not specify the `cookies` parameter at all.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
## Using the npm module
|
|
96
96
|
|
|
97
97
|
## Initialization Configuration (`InitConfig`)
|
|
98
98
|
|
|
@@ -125,6 +125,7 @@ When creating an instance of `OptableSDK`, you can pass an `InitConfig` object t
|
|
|
125
125
|
|
|
126
126
|
- **`readOnly` (boolean, default: `false`)**
|
|
127
127
|
When set to `true`, puts the SDK in a read-only mode, preventing any data modifications while still allowing API queries.
|
|
128
|
+
|
|
128
129
|
- **`optableCacheTargeting` (string, defaults: `optable-cache:targeting`)**
|
|
129
130
|
Local storage cache key used to store latest targeting response.
|
|
130
131
|
|
|
@@ -201,6 +202,28 @@ type ProfileTraits = {
|
|
|
201
202
|
};
|
|
202
203
|
```
|
|
203
204
|
|
|
205
|
+
You can also override the main identifier (replacing the Optable Visitor ID) as the second argument of the function.
|
|
206
|
+
The third argument is to provide additional identifier(s) that you want to associate to that profile.
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
const onSuccess = () => console.log("Profile API success!");
|
|
210
|
+
const onFailure = (err) => console.warn("Profile API error: ${err.message}");
|
|
211
|
+
|
|
212
|
+
const visitorTraits = {
|
|
213
|
+
gender: "M",
|
|
214
|
+
age: 44,
|
|
215
|
+
favColor: "blue",
|
|
216
|
+
hasAccount: true,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const emailID = OptableSDK.eid("some.email@address.com");
|
|
220
|
+
const additionalIDs = [];
|
|
221
|
+
additionalIDs.push(OptableSDK.cid("id1"));
|
|
222
|
+
additionalIDs.push(OptableSDK.cid("id2", "c2"));
|
|
223
|
+
|
|
224
|
+
sdk.profile(visitorTraits, emailID, additionalIDs).then(onSuccess).catch(onFailure);
|
|
225
|
+
```
|
|
226
|
+
|
|
204
227
|
### Targeting API
|
|
205
228
|
|
|
206
229
|
To get the targeting information associated by the configured DCN with the user's browser in real-time, you can call the targeting API as follows:
|
|
@@ -519,7 +542,24 @@ To automatically capture GPT [SlotRenderEndedEvent](https://developers.google.co
|
|
|
519
542
|
</script>
|
|
520
543
|
```
|
|
521
544
|
|
|
522
|
-
|
|
545
|
+
Advanced usage:
|
|
546
|
+
You can customize which GPT events are registered and which event properties to include, per event type, by passing an options object:
|
|
547
|
+
|
|
548
|
+
```js
|
|
549
|
+
// Only listen to impressionViewable and emit only `slot_element_id`
|
|
550
|
+
optable.instance.installGPTEventListeners({ impressionViewable: ["slot_element_id"] });
|
|
551
|
+
|
|
552
|
+
// For slotRenderEnded, emit all properties. For impressionViewable, emit only the listed properties.
|
|
553
|
+
optable.instance.installGPTEventListeners({
|
|
554
|
+
slotRenderEnded: "all",
|
|
555
|
+
impressionViewable: ["slot_element_id", "is_empty"],
|
|
556
|
+
});
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
The value for each event key can be "all" (to include all witness properties) or an array of property names from the set below (as mapped by the SDK):
|
|
560
|
+
|
|
561
|
+
`advertiser_id`, `campaign_id`, `creative_id`, `is_empty`, `line_item_id`, `service_name`, `size`, `slot_element_id`, `source_agnostic_creative_id`, `source_agnostic_line_item_id`.
|
|
562
|
+
If no argument is provided, the default behavior is unchanged and both slotRenderEnded and impressionViewable are captured with all properties.
|
|
523
563
|
|
|
524
564
|
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.
|
|
525
565
|
|
|
@@ -774,7 +814,7 @@ If you send Email newsletters that contain links to your website, then you may w
|
|
|
774
814
|
|
|
775
815
|
To enable automatic identification of visitors originating from your Email newsletter, you first need to include an **oeid** parameter in the query string of all links to your website in your Email newsletter template. The value of the **oeid** parameter should be set to the SHA256 hash of the lowercased Email address of the recipient. For example, if you are using [Braze](https://www.braze.com/) to send your newsletters, you can easily encode the SHA256 hash value of the recipient's Email address by setting the **oeid** parameter in the query string of any links to your website as follows:
|
|
776
816
|
|
|
777
|
-
```
|
|
817
|
+
```javascript
|
|
778
818
|
oeid={{${email_address} | downcase | sha2}}
|
|
779
819
|
```
|
|
780
820
|
|
|
@@ -833,16 +873,16 @@ It is recommended to call this method before making ad calls to ensure that the
|
|
|
833
873
|
|
|
834
874
|
The demo pages are working examples of both `identify` and `targeting` APIs, as well as an integration with the [Google Ad Manager 360](https://admanager.google.com/home/) ad server, enabling the targeting of ads served by GAM360 to audiences activated in the [Optable](https://optable.co/) DCN.
|
|
835
875
|
|
|
836
|
-
You can browse a recent (but not necessarily the latest) released version of the demo pages at [https://demo.optable.co/](https://demo.optable.co/). The source code to the demos can be found [
|
|
876
|
+
You can browse a recent (but not necessarily the latest) released version of the demo pages at [https://demo.optable.co/](https://demo.optable.co/). The source code to the demos can be found in the [demos directory](https://github.com/Optable/optable-web-sdk/tree/master/demos). The demo pages will connect to the [Optable](https://optable.co/) demo DCN at `sandbox.optable.co` and reference the web site slug `web-sdk-demo`. The GAM360 targeting demo loads ads from a GAM360 account operated by [Optable](https://optable.co/).
|
|
837
877
|
|
|
838
|
-
Note that the demo pages at [https://demo.optable.co/](https://demo.optable.co/) will by default rely on secure HTTP first-party cookies as described [
|
|
878
|
+
Note that the demo pages at [https://demo.optable.co/](https://demo.optable.co/) will by default rely on secure HTTP first-party cookies as described in [this section](https://github.com/Optable/optable-web-sdk#domains-and-cookies). To see an example based on [LocalStorage](https://github.com/Optable/optable-web-sdk#localstorage), see the [index-nocookies variant here](https://demo.optable.co/index-nocookies.html).
|
|
839
879
|
|
|
840
880
|
To build and run the demos locally, you will need [Docker](https://www.docker.com/), `docker-compose` and `make`:
|
|
841
881
|
|
|
842
|
-
```
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
882
|
+
```shell
|
|
883
|
+
cd path/to/optable-web-sdk
|
|
884
|
+
make
|
|
885
|
+
docker-compose up
|
|
846
886
|
```
|
|
847
887
|
|
|
848
888
|
Then head to [https://localhost:8180/](localhost:8180) to see the demo pages. You can modify the code in each demo, then run `make build` and finally refresh the demo pages to see your changes take effect. If you want to test the demos with your own DCN, make sure to update the configuration (hostname and site slug) given to the OptableSDK (see `webpack.config.js` for the react example).
|
package/browser/dist/sdk.js
CHANGED
|
@@ -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",n="object"==typeof window,s=n?window:{};s.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self,a=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?s=r.g:o&&(s=self);var c=!s.JS_SHA256_NO_COMMON_JS&&e.exports,d=r.amdO,u=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],h=[24,16,8,0],f=[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],g=["hex","array","digest","arrayBuffer"],v=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!s.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 S(t,!0).update(r)[e]()}},m=function(e){var t=y("hex",e);a&&(t=w(t,e)),t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<g.length;++r){var i=g[r];t[i]=y(i,e)}return t},w=function(e,i){var n,o=r(394),a=r(903).Buffer,c=i?"sha224":"sha256";return n=a.from&&!s.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(n(r)).digest("hex"):e(r)}},b=function(e,t){return function(r,i){return new _(r,t,!0).update(i)[e]()}},A=function(e){var t=b("hex",e);t.create=function(t){return new _(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<g.length;++r){var i=g[r];t[i]=b(i,e)}return t};function S(e,t){t?(v[0]=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0,this.blocks=v):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 _(e,r,i){var n,s=typeof e;if("string"===s){var o,a=[],c=e.length,d=0;for(n=0;n<c;++n)(o=e.charCodeAt(n))<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(++n)),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"!==s)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 S(r,!0).update(e).array());var l=[],p=[];for(n=0;n<64;++n){var h=e[n]||0;l[n]=92^h,p[n]=54^h}S.call(this,r,i),this.update(p),this.oKeyPad=l,this.inner=!0,this.sharedMemory=i}S.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 n,s,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(s=this.start;o<a&&s<64;++o)c[s>>>2]|=e[o]<<h[3&s++];else for(s=this.start;o<a&&s<64;++o)(n=e.charCodeAt(o))<128?c[s>>>2]|=n<<h[3&s++]:n<2048?(c[s>>>2]|=(192|n>>>6)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]):n<55296||n>=57344?(c[s>>>2]|=(224|n>>>12)<<h[3&s++],c[s>>>2]|=(128|n>>>6&63)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),c[s>>>2]|=(240|n>>>18)<<h[3&s++],c[s>>>2]|=(128|n>>>12&63)<<h[3&s++],c[s>>>2]|=(128|n>>>6&63)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=c[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},S.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()}},S.prototype.hash=function(){var e,t,r,i,n,s,o,a,c,d=this.h0,u=this.h1,l=this.h2,p=this.h3,h=this.h4,g=this.h5,v=this.h6,y=this.h7,m=this.blocks;for(e=16;e<64;++e)t=((n=m[e-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,r=((n=m[e-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,m[e]=m[e-16]+t+m[e-7]+r|0;for(c=u&l,e=0;e<64;e+=4)this.first?(this.is224?(s=300032,y=(n=m[0]-1413257819)-150054599|0,p=n+24177077|0):(s=704751109,y=(n=m[0]-210244248)-1521486534|0,p=n+143694565|0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(s=d&u)^d&l^c,y=p+(n=y+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&g^~h&v)+f[e]+m[e])|0,p=n+(t+i)|0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(o=p&d)^p&u^s,v=l+(n=v+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&g)+f[e+1]+m[e+1])|0,t=((l=n+(t+i)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(a=l&p)^l&d^o,g=u+(n=g+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&y^~v&h)+f[e+2]+m[e+2])|0,t=((u=n+(t+i)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(c=u&l)^u&p^a,h=d+(n=h+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&v^~g&y)+f[e+3]+m[e+3])|0,d=n+(t+i)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+d|0,this.h1=this.h1+u|0,this.h2=this.h2+l|0,this.h3=this.h3+p|0,this.h4=this.h4+h|0,this.h5=this.h5+g|0,this.h6=this.h6+v|0,this.h7=this.h7+y|0},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,c=l[e>>>28&15]+l[e>>>24&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>4&15]+l[15&e]+l[t>>>28&15]+l[t>>>24&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>4&15]+l[15&t]+l[r>>>28&15]+l[r>>>24&15]+l[r>>>20&15]+l[r>>>16&15]+l[r>>>12&15]+l[r>>>8&15]+l[r>>>4&15]+l[15&r]+l[i>>>28&15]+l[i>>>24&15]+l[i>>>20&15]+l[i>>>16&15]+l[i>>>12&15]+l[i>>>8&15]+l[i>>>4&15]+l[15&i]+l[n>>>28&15]+l[n>>>24&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>4&15]+l[15&n]+l[s>>>28&15]+l[s>>>24&15]+l[s>>>20&15]+l[s>>>16&15]+l[s>>>12&15]+l[s>>>8&15]+l[s>>>4&15]+l[15&s]+l[o>>>28&15]+l[o>>>24&15]+l[o>>>20&15]+l[o>>>16&15]+l[o>>>12&15]+l[o>>>8&15]+l[o>>>4&15]+l[15&o];return this.is224||(c+=l[a>>>28&15]+l[a>>>24&15]+l[a>>>20&15]+l[a>>>16&15]+l[a>>>12&15]+l[a>>>8&15]+l[a>>>4&15]+l[15&a]),c},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,s=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,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},S.prototype.array=S.prototype.digest,S.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},_.prototype=new S,_.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var P=m();P.sha256=P,P.sha224=m(!0),P.sha256.hmac=A(),P.sha224.hmac=A(!0),c?e.exports=P:(s.sha256=P.sha256,s.sha224=P.sha224,d&&(void 0===(i=function(){return P}.call(P,r,P,e))||(e.exports=i)))}()},903:()=>{},394:()=>{}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.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";function e(t){return e="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},e(t)}function t(t,r,i){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}const i={r:"v0.44.6"};async function n(e){const t=await S("/config",e,{method:"GET",headers:{Accept:"application/json"}});return new b(e).setSite(t),t}const s={"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 l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(e,t){const{gdprApplies:r,gppSectionIDs:i,gdprData:n}=t;if(void 0!==r)return r?"gdpr":"gdpr"===e?null:e;if(void 0!==n&&"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),n={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?(n.deviceAccess=h(t.gdprData,1,r.tcfeuVendorID),n.createProfilesForAdvertising=h(t.gdprData,3,r.tcfeuVendorID),n.useProfilesForAdvertising=h(t.gdprData,4,r.tcfeuVendorID),n.measureAdvertisingPerformance=h(t.gdprData,7,r.tcfeuVendorID)):t.gppData&&(n.deviceAccess=g(t.gppData,1,r.tcfeuVendorID),n.createProfilesForAdvertising=g(t.gppData,3,r.tcfeuVendorID),n.useProfilesForAdvertising=g(t.gppData,4,r.tcfeuVendorID),n.measureAdvertisingPerformance=g(t.gppData,7,r.tcfeuVendorID));break;case"can":n.deviceAccess=!0,t.gppData&&(n.createProfilesForAdvertising=f(t.gppData,3,r.tcfcaVendorID),n.useProfilesForAdvertising=f(t.gppData,4,r.tcfcaVendorID),n.measureAdvertisingPerformance=f(t.gppData,7,r.tcfcaVendorID));break;default:n.deviceAccess=!0,n.createProfilesForAdvertising=!0,n.useProfilesForAdvertising=!0,n.measureAdvertisingPerformance=!0}return n}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(e){}if(r===window.top)break;r=r.parent}e&&(window.__tcfapi=function(r,i,n){const s=Math.random()+"";t[s]=n,e.postMessage({__tcfapiCall:{command:r,version:i,callId:s}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}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(e){}if(r===window.top)break;r=r.parent}e&&(window.__gpp=function(r,i){const n=Math.random()+"";t[n]=i,e.postMessage({__gppCall:{command:r,version:"1.1",callId:n}},"*")},window.addEventListener("message",(e=>{let r={};try{r="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}const i=r.__gppReturn;i&&"function"==typeof t[i.callId]&&(t[i.callId](i.returnValue,i.success),delete t[i.callId])}),!1))}();const i=l(e,r,t);return"function"==typeof window.__tcfapi&&(null===(o=(a=window).__tcfapi)||void 0===o||o.call(a,"addEventListener",2,((n,s)=>{s&&("tcloaded"===n.eventStatus||"useractioncomplete"===n.eventStatus)&&(n=>{r.gdprString=n.tcString,r.gdprApplies=n.gdprApplies,r.gdprData=n,Object.assign(i,l(e,r,t))})(n)}))),"function"==typeof window.__gpp&&(null===(n=(s=window).__gpp)||void 0===n||n.call(s,"addEventListener",((n,s)=>{s&&"signalStatus"===n.eventName&&"ready"===n.data&&(n=>{r.gppString=n.gppString,r.gppSectionIDs=n.applicableSections,r.gppData=n,Object.assign(i,l(e,r,t))})(n.pingData)}))),i;var n,s,o,a}function h(e,t,r){var i,n,s,o,a,c;return r?!!(null===(s=e.purpose)||void 0===s||null===(o=s.consents)||void 0===o?void 0:o[t])&&!!(null===(a=e.vendor)||void 0===a||null===(c=a.consents)||void 0===c?void 0:c[r]):!!(null===(i=e.publisher)||void 0===i||null===(n=i.consents)||void 0===n?void 0:n[t])}function f(e,t,r){var i;const n=t>1,s=(null===(i=e.parsedSections)||void 0===i?void 0:i[o])||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let i=e.PurposesExpressConsent.includes(t)&&e.VendorExpressConsent.includes(r);return n&&(i||(i=e.PurposesImpliedConsent.includes(t)&&e.VendorImpliedConsent.includes(r))),i}const a=s.find((e=>"SubsectionType"in e&&3===e.SubsectionType));if(!a)return!1;let c=a.PubPurposesExpressConsent.includes(t);return n&&(c||(c=a.PubPurposesImpliedConsent.includes(t))),c}function g(e,t,r){var i;const n=t>1,s=(null===(i=e.parsedSections)||void 0===i?void 0:i[a])||[];if("number"==typeof r){const e=s.find((e=>"Version"in e));if(!e)return!1;let i=e.PurposeConsent.includes(t)&&e.VendorConsent.includes(r);return n&&(i||(i=e.PurposesLITransparency.includes(t)&&e.VendorLegitimateInterest.includes(r))),i}const o=s.find((e=>"SegmentType"in e&&3===e.SegmentType));if(!o)return!1;let c=o.PubPurposesConsent.includes(t);return n&&(c||(c=o.PubPurposesLITransparency.includes(t))),c}class v{constructor(e){t(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 m(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 w(e){return e.node?m("".concat(e.host,"/").concat(e.node)):m("".concat(e.host))}class b{constructor(e){this.config=e,t(this,"passportKeys",void 0),t(this,"targetingKeys",void 0),t(this,"siteKeys",void 0),t(this,"pairKeys",void 0),t(this,"storage",void 0),this.passportKeys=function(e){const t=[],r=[],i="OPTABLE_PASSPORT_".concat(w(e));return t.push(i),r.push(i),e.legacyHostCache?(r.push("OPTABLE_PASSPORT_".concat(m("".concat(e.legacyHostCache)))),r.push("OPTABLE_PASS_".concat(m("".concat(e.legacyHostCache,"/").concat(e.site))))):r.push("OPTABLE_PASS_".concat(m("".concat(e.host,"/").concat(e.site)))),{write:t,read:r}}(e),this.targetingKeys=function(e){const t="OPTABLE_TARGETING_".concat(w(e));return{write:[t,e.optableCacheTargeting],read:[t]}}(e),this.siteKeys=function(e){const t="OPTABLE_SITE_".concat(w(e));return{write:[t],read:[t]}}(e),this.pairKeys={write:[y],read:[y]},this.storage=new v(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){var t,r,i;const n=null===(t=e.ortb2)||void 0===t||null===(r=t.user)||void 0===r||null===(i=r.eids)||void 0===i?void 0:i.filter((e=>"pair-protocol.com"===e.source)),s=null==n?void 0:n.flatMap((e=>e.uids));if(!s)return;const o=new Set(s.map((e=>e.id)));this.writeToStorageKeys(this.pairKeys,btoa(JSON.stringify({envelope:[...o]})))}getPairIDs(){var e;const t=this.readStorageKeys(this.pairKeys);return t?null===(e=JSON.parse(atob(t)))||void 0===e?void 0: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)}}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}async function S(e,r,n){const s=await globalThis.fetch(function(e,r,n){const{host:s,cookies:o}=r,a=new URL(e,"https://".concat(s));if(a.searchParams.set("osdk","web-".concat(i.r)),a.searchParams.set("sid",r.sessionID),r.skipEnrichment&&a.searchParams.set("skip_enrichment","".concat(r.skipEnrichment)),r.node&&a.searchParams.set("t",r.node),r.site&&a.searchParams.set("o",r.site),void 0!==r.consent.gpp&&a.searchParams.set("gpp",r.consent.gpp),void 0!==r.consent.gppSectionIDs&&a.searchParams.set("gpp_sid",r.consent.gppSectionIDs.join(",")),void 0!==r.consent.gdpr&&a.searchParams.set("gdpr_consent",r.consent.gdpr),void 0!==r.consent.gdprApplies&&a.searchParams.set("gdpr",Number(r.consent.gdprApplies).toString()),r.readOnly&&a.searchParams.set("ro","true"),r.timeout&&a.searchParams.set("timeout",r.timeout),o)a.searchParams.set("cookies","yes");else{const e=new b(r).getPassport();a.searchParams.set("cookies","no"),a.searchParams.set("passport",e||"")}const c=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?A(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},n);return c.credentials=r.consent.deviceAccess?"include":"omit",r.mockedIP&&(c.headers=new Headers(c.headers),c.headers.set("X-Forwarded-For",r.mockedIP)),new Request(a.toString(),c)}(e,r,n)),o=s.headers.get("Content-Type"),a=(null==o?void 0:o.startsWith("application/json"))?await s.json():await s.text();if(!s.ok)throw new Error(a.error);return a.passport&&(new b(r).setPassport(a.passport),delete a.passport),a}var _,P,E,I=((P=I||{})[P.Banner=1]="Banner",P[P.Video=2]="Video",P[P.Audio=3]="Audio",P[P.Native=4]="Native",P),O={},k={},T={};(E=_||(_={})).Placement=k,E.Media=T,E.Context=O;const D={cookies:!0,initPassport:!0,readOnly:!1,experiments:[],consent:{reg:null,deviceAccess:!0,createProfilesForAdvertising:!0,useProfilesForAdvertising:!0,measureAdvertisingPerformance:!0}};function j(){const e=new Uint8Array(16);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function C(e){var t,r;return{user:{data:(null!==(t=null==e?void 0:e.audience)&&void 0!==t?t:[]).map((e=>({name:e.provider,segment:e.ids,ext:{segtax:e.rtb_segtax}}))),ext:{eids:(null!==(r=null==e?void 0:e.user)&&void 0!==r?r:[]).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 i of null!==(r=e.audience)&&void 0!==r?r:[]){var r;i.keyspace&&(i.keyspace in t||(t[i.keyspace]=[]),t[i.keyspace].push(...i.ids.map((e=>e.id))))}return t}function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function B(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?N(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):N(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function V(){const e={};let t=0;return{refs:e,process:(r,i)=>{if(!r.refs)return i;for(const s of i.uids){var n;if(K(null===(n=s.ext)||void 0===n?void 0:n.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 F=r(312);class L{constructor(e){t(this,"dcn",void 0),t(this,"init",void 0),this.dcn=function(e){var t,r,i,n,o,a,c,d;const u={host:e.host,site:e.site,optableCacheTargeting:null!==(t=e.optableCacheTargeting)&&void 0!==t?t:"optable-cache:targeting",cookies:null!==(r=e.cookies)&&void 0!==r?r:D.cookies,initPassport:null!==(i=e.initPassport)&&void 0!==i?i:D.initPassport,consent:D.consent,readOnly:null!==(n=e.readOnly)&&void 0!==n?n:D.readOnly,node:e.node,legacyHostCache:e.legacyHostCache,experiments:null!==(o=e.experiments)&&void 0!==o?o:D.experiments,mockedIP:e.mockedIP,sessionID:null!==(a=e.sessionID)&&void 0!==a?a:j(),skipEnrichment:e.skipEnrichment,initTargeting:e.initTargeting,abTests:e.abTests,additionalTargetingSignals:e.additionalTargetingSignals,timeout:e.timeout};return(null===(c=e.consent)||void 0===c?void 0:c.static)?u.consent=e.consent.static:(null===(d=e.consent)||void 0===d?void 0:d.cmpapi)&&(u.consent=p(function(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=s[e];return"can"===t?["fr","fr-CA"].some((e=>navigator.languages.includes(e)))?"can":null:null!=t?t:null}(),e.consent.cmpapi)),u}(e),this.init=this.initialize()}async initialize(){this.dcn.initPassport&&await n(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:[]};var t,r;if(K(e))return{ids:null!==(t=null==e?void 0:e.ids)&&void 0!==t?t:[],hids:null!==(r=null==e?void 0:e.hids)&&void 0!==r?r:[]};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){var r;const i=new URLSearchParams;t.ids.forEach((e=>i.append("id",e))),t.hids.forEach((e=>i.append("hid",e)));const n=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);n&&(i.append("ab_test_id",n.id),n.matcher_override&&[...n.matcher_override].sort(((e,t)=>e.rank-t.rank)).forEach((e=>{i.append("matcher_override",e.id)})),n.skipMatchers&&i.append("skip_matchers",n.skipMatchers.join(",")));(null===(r=e.additionalTargetingSignals)||void 0===r?void 0:r.ref)&&i.append("ref","".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname));const s="/v2/targeting?"+i.toString(),o=await S(s,e,{method:"GET",headers:{Accept:"application/json"}});return o&&(new b(e).setTargeting(o),function(e,t){var r,i,n,s,o,a,c,d;const u=null===(r=t.ortb2)||void 0===r||null===(i=r.user)||void 0===i||null===(n=i.eids)||void 0===n?void 0:n.map((e=>e.matcher));window.dispatchEvent(new CustomEvent("optable-targeting:change",{detail:{instance:e.node||e.host,resolved:!!(null===(s=t.ortb2)||void 0===s||null===(o=s.user)||void 0===o||null===(a=o.eids)||void 0===a?void 0:a.length),resolvedIDs:null!==(c=t.resolved_ids)&&void 0!==c?c:[],abTestID:null!==(d=t.ab_test_id)&&void 0!==d?d:void 0,ortb2:t.ortb2,provenance:new Set(u)}}))}(e,o)),o}(this.dcn,e)}targetingFromCache(){return e=this.dcn,new b(e).getTargeting();var e}async site(){return n(this.dcn)}siteFromCache(){return e=this.dcn,new b(e).getSite();var e}targetingClearCache(){var e;e=this.dcn,new b(e).clearTargeting()}async prebidORTB2(){return C(await this.targeting())}prebidORTB2FromCache(){return C(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(null==e?void 0:e.lmpid)&&(t.lmpid=e.lmpid),!("clusters"in e)||!Array.isArray(null==e?void 0:e.clusters))return t;for(const r of e.clusters){const e={ids:[],traits:[]};if(Array.isArray(null==r?void 0:r.ids))for(const t of r.ids)"string"==typeof t&&e.ids.push(t);if(Array.isArray(null==r?void 0:r.traits))for(const t of r.traits)"string"==typeof(null==t?void 0:t.key)&&"string"==typeof(null==t?void 0: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:"+F.sha256.hex(e.toLowerCase().trim()):""}static sha256(e){return e?F.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".concat(t,":")),e?r+e.trim():""}static TargetingKeyValues(e){return x(e)}static PrebidORTB2(e){return C(e)}}t(L,"version",i.r);const M=L;function R(e){var t,r,i,n,s,o,a,c,d,u;return{advertiser_id:null===(t=e.advertiserId)||void 0===t?void 0:t.toString(),campaign_id:null===(r=e.campaignId)||void 0===r?void 0:r.toString(),creative_id:null===(i=e.creativeId)||void 0===i?void 0:i.toString(),is_empty:null===(n=e.isEmpty)||void 0===n?void 0:n.toString(),line_item_id:null===(s=e.lineItemId)||void 0===s?void 0:s.toString(),service_name:null===(o=e.serviceName)||void 0===o?void 0:o.toString(),size:null===(a=e.size)||void 0===a?void 0:a.toString(),slot_element_id:null===(c=e.slot)||void 0===c?void 0:c.getSlotElementId(),source_agnostic_creative_id:null===(d=e.sourceAgnosticCreativeId)||void 0===d?void 0:d.toString(),source_agnostic_line_item_id:null===(u=e.sourceAgnosticLineItemId)||void 0===u?void 0:u.toString()}}M.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_slot_render_ended",R(t))})),t.pubads().addEventListener("impressionViewable",(function(t){e.witness("gpt_events_impression_viewable",R(t))}))}))},M.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 J=/^[a-f0-9]{64}$/i;M.prototype.tryIdentifyFromParams=function(e,t){const r=new RegExp("^".concat(e||"oeid","$"),"i"),i=new URLSearchParams(window.location.search);let n="";for(const[e,t]of i)if(r.test(e)){n=t;break}""!=n&&(t||function(e){return J.test(e)}(n))&&this.identify((t||"e")+":"+n.toLowerCase())},window.optable=window.optable||{},window.optable.SDK=M,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:n}=V(),s={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){var i,d,u;let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const p=Math.max(0,l),{data:h=[],eids:f=[]}=null!==(i=null===(d=e.ortb2)||void 0===d?void 0:d.user)&&void 0!==i?i:{};s.user.data.push(...h),c.set(p,null!==(u=e.resolved_ids)&&void 0!==u?u:[]),f.filter((e=>e.uids.length)).forEach((i=>{var s,c,d,u,l;const h=null!==(s=i.matcher)&&void 0!==s?s:t,f=null!==(c=o.get(p))&&void 0!==c?c:[];h&&o.set(p,[...f,h]);const g=B(B({},n(e,i)),{},{matcher:null!==(d=i.matcher)&&void 0!==d?d:t,mm:null!==(u=i.mm)&&void 0!==u?u:r}),v=null!==(l=a.get(p))&&void 0!==l?l:[];a.set(p,[...v,g])}))}(e,r,i,d)))}));await Promise.allSettled(d);const u=Array.from(a.keys()).sort(((e,t)=>e-t)).filter((e=>{var t;return null===(t=a.get(e))||void 0===t?void 0:t.length})).shift();if(u){const e=o.get(u)||[],i=c.get(u)||[];s.user.eids.push(...a.get(u)||[]),e.forEach((e=>t.add(e))),i.forEach((e=>r.add(e)))}return{ortb2:s,eidSources:t,refs:i,resolvedIds:r}}(e):async function(e){const t=new Set,r=new Set,{refs:i,process:n}=V(),s={user:{data:[],eids:[]}};const o=e.map((e=>{let{targetingFn:i,matcher:o,mm:a}=e;return i().then((e=>function(e,i,o){var a,c,d;const{data:u=[],eids:l=[]}=null!==(a=null===(c=e.ortb2)||void 0===c?void 0:c.user)&&void 0!==a?a:{};s.user.data.push(...u),null===(d=e.resolved_ids)||void 0===d||d.forEach((e=>r.add(e))),l.filter((e=>e.uids.length)).forEach((r=>{var a,c,d;const u=null!==(a=r.matcher)&&void 0!==a?a:i;u&&t.add(u),s.user.eids.push(B(B({},n(e,r)),{},{mm:null!==(c=r.mm)&&void 0!==c?c:o,matcher:null!==(d=r.matcher)&&void 0!==d?d:i}))}))}(e,o,a)))}));return await Promise.allSettled(o),{ortb2:s,eidSources:t,refs:i,resolvedIds:r}}(e):Promise.reject("No targeting rules provided")}},window.optable.instance_config&&(window.optable.instance=new M(window.optable.instance_config))})()})();
|
|
2
|
+
(()=>{var t={312:(t,e,r)=>{var i;!function(){"use strict";var e="input is invalid type",n="object"==typeof window,s=n?window:{};s.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self,a=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?s=r.g:o&&(s=self);var c=!s.JS_SHA256_NO_COMMON_JS&&t.exports,d=r.amdO,u=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],h=[24,16,8,0],f=[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],g=["hex","array","digest","arrayBuffer"],v=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var y=function(t,e){return function(r){return new S(e,!0).update(r)[t]()}},m=function(t){var e=y("hex",t);a&&(e=w(e,t)),e.create=function(){return new S(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<g.length;++r){var i=g[r];e[i]=y(i,t)}return e},w=function(t,i){var n,o=r(394),a=r(903).Buffer,c=i?"sha224":"sha256";return n=a.from&&!s.JS_SHA256_NO_BUFFER_FROM?a.from:function(t){return new a(t)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(n(r)).digest("hex"):t(r)}},b=function(t,e){return function(r,i){return new P(r,e,!0).update(i)[t]()}},A=function(t){var e=b("hex",t);e.create=function(e){return new P(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<g.length;++r){var i=g[r];e[i]=b(i,t)}return e};function S(t,e){e?(v[0]=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0,this.blocks=v):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(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=t}function P(t,r,i){var n,s=typeof t;if("string"===s){var o,a=[],c=t.length,d=0;for(n=0;n<c;++n)(o=t.charCodeAt(n))<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&t.charCodeAt(++n)),a[d++]=240|o>>>18,a[d++]=128|o>>>12&63,a[d++]=128|o>>>6&63,a[d++]=128|63&o);t=a}else{if("object"!==s)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new S(r,!0).update(t).array());var l=[],p=[];for(n=0;n<64;++n){var h=t[n]||0;l[n]=92^h,p[n]=54^h}S.call(this,r,i),this.update(p),this.oKeyPad=l,this.inner=!0,this.sharedMemory=i}S.prototype.update=function(t){if(!this.finalized){var r,i=typeof t;if("string"!==i){if("object"!==i)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var n,s,o=0,a=t.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(s=this.start;o<a&&s<64;++o)c[s>>>2]|=t[o]<<h[3&s++];else for(s=this.start;o<a&&s<64;++o)(n=t.charCodeAt(o))<128?c[s>>>2]|=n<<h[3&s++]:n<2048?(c[s>>>2]|=(192|n>>>6)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]):n<55296||n>=57344?(c[s>>>2]|=(224|n>>>12)<<h[3&s++],c[s>>>2]|=(128|n>>>6&63)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++o)),c[s>>>2]|=(240|n>>>18)<<h[3&s++],c[s>>>2]|=(128|n>>>12&63)<<h[3&s++],c[s>>>2]|=(128|n>>>6&63)<<h[3&s++],c[s>>>2]|=(128|63&n)<<h[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=c[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>>2]|=p[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var t,e,r,i,n,s,o,a,c,d=this.h0,u=this.h1,l=this.h2,p=this.h3,h=this.h4,g=this.h5,v=this.h6,y=this.h7,m=this.blocks;for(t=16;t<64;++t)e=((n=m[t-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,r=((n=m[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,m[t]=m[t-16]+e+m[t-7]+r|0;for(c=u&l,t=0;t<64;t+=4)this.first?(this.is224?(s=300032,y=(n=m[0]-1413257819)-150054599|0,p=n+24177077|0):(s=704751109,y=(n=m[0]-210244248)-1521486534|0,p=n+143694565|0),this.first=!1):(e=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(s=d&u)^d&l^c,y=p+(n=y+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&g^~h&v)+f[t]+m[t])|0,p=n+(e+i)|0),e=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(o=p&d)^p&u^s,v=l+(n=v+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&g)+f[t+1]+m[t+1])|0,e=((l=n+(e+i)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(a=l&p)^l&d^o,g=u+(n=g+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&y^~v&h)+f[t+2]+m[t+2])|0,e=((u=n+(e+i)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(c=u&l)^u&p^a,h=d+(n=h+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&v^~g&y)+f[t+3]+m[t+3])|0,d=n+(e+i)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+d|0,this.h1=this.h1+u|0,this.h2=this.h2+l|0,this.h3=this.h3+p|0,this.h4=this.h4+h|0,this.h5=this.h5+g|0,this.h6=this.h6+v|0,this.h7=this.h7+y|0},S.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,c=l[t>>>28&15]+l[t>>>24&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>4&15]+l[15&t]+l[e>>>28&15]+l[e>>>24&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>4&15]+l[15&e]+l[r>>>28&15]+l[r>>>24&15]+l[r>>>20&15]+l[r>>>16&15]+l[r>>>12&15]+l[r>>>8&15]+l[r>>>4&15]+l[15&r]+l[i>>>28&15]+l[i>>>24&15]+l[i>>>20&15]+l[i>>>16&15]+l[i>>>12&15]+l[i>>>8&15]+l[i>>>4&15]+l[15&i]+l[n>>>28&15]+l[n>>>24&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>4&15]+l[15&n]+l[s>>>28&15]+l[s>>>24&15]+l[s>>>20&15]+l[s>>>16&15]+l[s>>>12&15]+l[s>>>8&15]+l[s>>>4&15]+l[15&s]+l[o>>>28&15]+l[o>>>24&15]+l[o>>>20&15]+l[o>>>16&15]+l[o>>>12&15]+l[o>>>8&15]+l[o>>>4&15]+l[15&o];return this.is224||(c+=l[a>>>28&15]+l[a>>>24&15]+l[a>>>20&15]+l[a>>>16&15]+l[a>>>12&15]+l[a>>>8&15]+l[a>>>4&15]+l[15&a]),c},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,c=[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,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},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},P.prototype=new S,P.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),S.prototype.finalize.call(this)}};var _=m();_.sha256=_,_.sha224=m(!0),_.sha256.hmac=A(),_.sha224.hmac=A(!0),c?t.exports=_:(s.sha256=_.sha256,s.sha224=_.sha224,d&&(void 0===(i=function(){return _}.call(_,r,_,t))||(t.exports=i)))}()},903:()=>{},394:()=>{}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.amdO={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(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}const i={r:"v0.45.0"};async function n(t){const e=await S("/config",t,{method:"GET",headers:{Accept:"application/json"}});return new b(t).setSite(e),e}const s={"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 l(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(t,e){const{gdprApplies:r,gppSectionIDs:i,gdprData:n}=e;if(void 0!==r)return r?"gdpr":"gdpr"===t?null:t;if(void 0!==n&&"gdpr"===t)return"gdpr";if(void 0===i||1===i.length&&0===i[0])return t;if(1===i.length&&-1===i[0])return null;if(i.some((t=>c.includes(t))))return"gdpr";if(i.some((t=>d.includes(t))))return"can";if(i.some((t=>u.includes(t))))return"us";switch(t){case"gdpr":if(!i.some((t=>c.includes(t))))return null;break;case"can":if(!i.some((t=>d.includes(t))))return null;break;case"us":if(!i.some((t=>u.includes(t))))return null}return t}(t,e),n={reg:i,gpp:e.gppString,gppSectionIDs:e.gppSectionIDs,gdpr:e.gdprString,gdprApplies:e.gdprApplies,deviceAccess:!1,createProfilesForAdvertising:!1,useProfilesForAdvertising:!1,measureAdvertisingPerformance:!1};switch(i){case"gdpr":e.gdprData?(n.deviceAccess=h(e.gdprData,1,r.tcfeuVendorID),n.createProfilesForAdvertising=h(e.gdprData,3,r.tcfeuVendorID),n.useProfilesForAdvertising=h(e.gdprData,4,r.tcfeuVendorID),n.measureAdvertisingPerformance=h(e.gdprData,7,r.tcfeuVendorID)):e.gppData&&(n.deviceAccess=g(e.gppData,1,r.tcfeuVendorID),n.createProfilesForAdvertising=g(e.gppData,3,r.tcfeuVendorID),n.useProfilesForAdvertising=g(e.gppData,4,r.tcfeuVendorID),n.measureAdvertisingPerformance=g(e.gppData,7,r.tcfeuVendorID));break;case"can":n.deviceAccess=!0,e.gppData&&(n.createProfilesForAdvertising=f(e.gppData,3,r.tcfcaVendorID),n.useProfilesForAdvertising=f(e.gppData,4,r.tcfcaVendorID),n.measureAdvertisingPerformance=f(e.gppData,7,r.tcfcaVendorID));break;default:n.deviceAccess=!0,n.createProfilesForAdvertising=!0,n.useProfilesForAdvertising=!0,n.measureAdvertisingPerformance=!0}return n}function p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={};!function(){if("function"==typeof window.__tcfapi)return;let t;const e={};let r=window;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===window.top)break;r=r.parent}t&&(window.__tcfapi=function(r,i,n){const s=Math.random()+"";e[s]=n,t.postMessage({__tcfapiCall:{command:r,version:i,callId:s}},"*")},window.addEventListener("message",(t=>{let r={};try{r="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}const i=r.__tcfapiReturn;i&&"function"==typeof e[i.callId]&&(e[i.callId](i.returnValue,i.success),delete e[i.callId])}),!1))}(),function(){if("function"==typeof window.__gpp)return;let t;const e={};let r=window;for(;r;){try{if(r.frames.__gppLocator){t=r;break}}catch(t){}if(r===window.top)break;r=r.parent}t&&(window.__gpp=function(r,i){const n=Math.random()+"";e[n]=i,t.postMessage({__gppCall:{command:r,version:"1.1",callId:n}},"*")},window.addEventListener("message",(t=>{let r={};try{r="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}const i=r.__gppReturn;i&&"function"==typeof e[i.callId]&&(e[i.callId](i.returnValue,i.success),delete e[i.callId])}),!1))}();const i=l(t,r,e);return"function"==typeof window.__tcfapi&&(null===(o=(a=window).__tcfapi)||void 0===o||o.call(a,"addEventListener",2,((n,s)=>{s&&("tcloaded"===n.eventStatus||"useractioncomplete"===n.eventStatus)&&(n=>{r.gdprString=n.tcString,r.gdprApplies=n.gdprApplies,r.gdprData=n,Object.assign(i,l(t,r,e))})(n)}))),"function"==typeof window.__gpp&&(null===(n=(s=window).__gpp)||void 0===n||n.call(s,"addEventListener",((n,s)=>{s&&"signalStatus"===n.eventName&&"ready"===n.data&&(n=>{r.gppString=n.gppString,r.gppSectionIDs=n.applicableSections,r.gppData=n,Object.assign(i,l(t,r,e))})(n.pingData)}))),i;var n,s,o,a}function h(t,e,r){var i,n,s,o,a,c;return r?!!(null===(s=t.purpose)||void 0===s||null===(o=s.consents)||void 0===o?void 0:o[e])&&!!(null===(a=t.vendor)||void 0===a||null===(c=a.consents)||void 0===c?void 0:c[r]):!!(null===(i=t.publisher)||void 0===i||null===(n=i.consents)||void 0===n?void 0:n[e])}function f(t,e,r){var i;const n=e>1,s=(null===(i=t.parsedSections)||void 0===i?void 0:i[o])||[];if("number"==typeof r){const t=s.find((t=>"Version"in t));if(!t)return!1;let i=t.PurposesExpressConsent.includes(e)&&t.VendorExpressConsent.includes(r);return n&&(i||(i=t.PurposesImpliedConsent.includes(e)&&t.VendorImpliedConsent.includes(r))),i}const a=s.find((t=>"SubsectionType"in t&&3===t.SubsectionType));if(!a)return!1;let c=a.PubPurposesExpressConsent.includes(e);return n&&(c||(c=a.PubPurposesImpliedConsent.includes(e))),c}function g(t,e,r){var i;const n=e>1,s=(null===(i=t.parsedSections)||void 0===i?void 0:i[a])||[];if("number"==typeof r){const t=s.find((t=>"Version"in t));if(!t)return!1;let i=t.PurposeConsent.includes(e)&&t.VendorConsent.includes(r);return n&&(i||(i=t.PurposesLITransparency.includes(e)&&t.VendorLegitimateInterest.includes(r))),i}const o=s.find((t=>"SegmentType"in t&&3===t.SegmentType));if(!o)return!1;let c=o.PubPurposesConsent.includes(e);return n&&(c||(c=o.PubPurposesLITransparency.includes(e))),c}class v{constructor(t){e(this,"consent",void 0),this.consent=t}getItem(t){return this.consent.deviceAccess?window.localStorage.getItem(t):null}setItem(t,e){this.consent.deviceAccess&&window.localStorage.setItem(t,e)}removeItem(t){this.consent.deviceAccess&&window.localStorage.removeItem(t)}}const y="_optable_pairId";function m(t){const e=new Uint16Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return btoa(String.fromCharCode(...new Uint8Array(e.buffer)))}function w(t){return t.node?m("".concat(t.host,"/").concat(t.node)):m("".concat(t.host))}class b{constructor(t){this.config=t,e(this,"passportKeys",void 0),e(this,"targetingKeys",void 0),e(this,"siteKeys",void 0),e(this,"pairKeys",void 0),e(this,"storage",void 0),this.passportKeys=function(t){const e=[],r=[],i="OPTABLE_PASSPORT_".concat(w(t));return e.push(i),r.push(i),t.legacyHostCache?(r.push("OPTABLE_PASSPORT_".concat(m("".concat(t.legacyHostCache)))),r.push("OPTABLE_PASS_".concat(m("".concat(t.legacyHostCache,"/").concat(t.site))))):r.push("OPTABLE_PASS_".concat(m("".concat(t.host,"/").concat(t.site)))),{write:e,read:r}}(t),this.targetingKeys=function(t){const e="OPTABLE_TARGETING_".concat(w(t));return{write:[e,t.optableCacheTargeting],read:[e]}}(t),this.siteKeys=function(t){const e="OPTABLE_SITE_".concat(w(t));return{write:[e],read:[e]}}(t),this.pairKeys={write:[y],read:[y]},this.storage=new v(this.config.consent)}getPassport(){return this.readStorageKeys(this.passportKeys)}setPassport(t){this.writeToStorageKeys(this.passportKeys,t)}getTargeting(){const t=this.readStorageKeys(this.targetingKeys);return t?JSON.parse(t):null}setTargeting(t){t&&(this.writeToStorageKeys(this.targetingKeys,JSON.stringify(t)),this.setPairIDs(t))}getSite(){const t=this.readStorageKeys(this.siteKeys);return t?JSON.parse(t):null}setSite(t){t&&this.writeToStorageKeys(this.siteKeys,JSON.stringify(t))}setPairIDs(t){var e,r,i;const n=null===(e=t.ortb2)||void 0===e||null===(r=e.user)||void 0===r||null===(i=r.eids)||void 0===i?void 0:i.filter((t=>"pair-protocol.com"===t.source)),s=null==n?void 0:n.flatMap((t=>t.uids));if(!s)return;const o=new Set(s.map((t=>t.id)));this.writeToStorageKeys(this.pairKeys,btoa(JSON.stringify({envelope:[...o]})))}getPairIDs(){var t;const e=this.readStorageKeys(this.pairKeys);return e?null===(t=JSON.parse(atob(e)))||void 0===t?void 0:t.envelope:null}readStorageKeys(t){for(const e of t.read){const t=this.storage.getItem(e);if(t)return t}return null}writeToStorageKeys(t,e){if(e)for(const r of t.write)this.storage.setItem(r,e)}clearStorageKeys(t){for(const e of[...t.read,...t.write])this.storage.removeItem(e)}clearPassport(){this.clearStorageKeys(this.passportKeys)}clearTargeting(){this.clearStorageKeys(this.targetingKeys)}clearSite(){this.clearStorageKeys(this.siteKeys)}}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}async function S(t,r,n){const s=await globalThis.fetch(function(t,r,n){const{host:s,cookies:o}=r,a=new URL(t,"https://".concat(s));if(a.searchParams.set("osdk","web-".concat(i.r)),a.searchParams.set("sid",r.sessionID),r.skipEnrichment&&a.searchParams.set("skip_enrichment","".concat(r.skipEnrichment)),r.node&&a.searchParams.set("t",r.node),r.site&&a.searchParams.set("o",r.site),void 0!==r.consent.gpp&&a.searchParams.set("gpp",r.consent.gpp),void 0!==r.consent.gppSectionIDs&&a.searchParams.set("gpp_sid",r.consent.gppSectionIDs.join(",")),void 0!==r.consent.gdpr&&a.searchParams.set("gdpr_consent",r.consent.gdpr),void 0!==r.consent.gdprApplies&&a.searchParams.set("gdpr",Number(r.consent.gdprApplies).toString()),r.readOnly&&a.searchParams.set("ro","true"),r.timeout&&a.searchParams.set("timeout",r.timeout),o)a.searchParams.set("cookies","yes");else{const t=new b(r).getPassport();a.searchParams.set("cookies","no"),a.searchParams.set("passport",t||"")}const c=function(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?A(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},n);return c.credentials=r.consent.deviceAccess?"include":"omit",r.mockedIP&&(c.headers=new Headers(c.headers),c.headers.set("X-Forwarded-For",r.mockedIP)),new Request(a.toString(),c)}(t,r,n)),o=s.headers.get("Content-Type"),a=(null==o?void 0:o.startsWith("application/json"))?await s.json():await s.text();if(!s.ok)throw new Error(a.error);return a.passport&&(new b(r).setPassport(a.passport),delete a.passport),a}var P,_,O,E=((_=E||{})[_.Banner=1]="Banner",_[_.Video=2]="Video",_[_.Audio=3]="Audio",_[_.Native=4]="Native",_),I={},k={},T={};(O=P||(P={})).Placement=k,O.Media=T,O.Context=I;const j={cookies:!0,initPassport:!0,readOnly:!1,experiments:[],consent:{reg:null,deviceAccess:!0,createProfilesForAdvertising:!0,useProfilesForAdvertising:!0,measureAdvertisingPerformance:!0}};function D(){const t=new Uint8Array(16);return crypto.getRandomValues(t),btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function C(t){var e,r;return{user:{data:(null!==(e=null==t?void 0:t.audience)&&void 0!==e?e:[]).map((t=>({name:t.provider,segment:t.ids,ext:{segtax:t.rtb_segtax}}))),ext:{eids:(null!==(r=null==t?void 0:t.user)&&void 0!==r?r:[]).map((t=>({source:t.provider,uids:t.ids.map((t=>{let{id:e}=t;return{id:e,atype:3}}))})))}}}}function x(t){const e={};if(!t)return e;for(const i of null!==(r=t.audience)&&void 0!==r?r:[]){var r;i.keyspace&&(i.keyspace in e||(e[i.keyspace]=[]),e[i.keyspace].push(...i.ids.map((t=>t.id))))}return e}function K(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function B(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?N(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):N(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function V(){const t={};let e=0;return{refs:t,process:(r,i)=>{if(!r.refs)return i;for(const s of i.uids){var n;if(K(null===(n=s.ext)||void 0===n?void 0:n.optable)&&"ref"in s.ext.optable&&"string"==typeof s.ext.optable.ref){const i=r.refs[s.ext.optable.ref];e+=1;const n=e.toString(10);t[n]=i,s.ext.optable.ref=n}}return i}}}function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function L(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?F(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var M=r(312);class R{constructor(t){e(this,"dcn",void 0),e(this,"init",void 0),this.dcn=function(t){var e,r,i,n,o,a,c,d;const u={host:t.host,site:t.site,optableCacheTargeting:null!==(e=t.optableCacheTargeting)&&void 0!==e?e:"optable-cache:targeting",cookies:null!==(r=t.cookies)&&void 0!==r?r:j.cookies,initPassport:null!==(i=t.initPassport)&&void 0!==i?i:j.initPassport,consent:j.consent,readOnly:null!==(n=t.readOnly)&&void 0!==n?n:j.readOnly,node:t.node,legacyHostCache:t.legacyHostCache,experiments:null!==(o=t.experiments)&&void 0!==o?o:j.experiments,mockedIP:t.mockedIP,sessionID:null!==(a=t.sessionID)&&void 0!==a?a:D(),skipEnrichment:t.skipEnrichment,initTargeting:t.initTargeting,abTests:t.abTests,additionalTargetingSignals:t.additionalTargetingSignals,timeout:t.timeout};return(null===(c=t.consent)||void 0===c?void 0:c.static)?u.consent=t.consent.static:(null===(d=t.consent)||void 0===d?void 0:d.cmpapi)&&(u.consent=p(function(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,e=s[t];return"can"===e?["fr","fr-CA"].some((t=>navigator.languages.includes(t)))?"can":null:null!=e?e:null}(),t.consent.cmpapi)),u}(t),this.init=this.initialize()}async initialize(){this.dcn.initPassport&&await n(this.dcn).catch((()=>{})),this.dcn.initTargeting&&this.targeting().catch((()=>{}))}async identify(){await this.init;for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t,e){return S("/identify",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,e.filter((t=>t)))}async uid2Token(t){return await this.init,function(t,e){return S("/uid2/token",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,t)}async targeting(){const t=function(t){if("string"==typeof t)return{ids:[t],hids:[]};var e,r;if(K(t))return{ids:null!==(e=null==t?void 0:t.ids)&&void 0!==e?e:[],hids:null!==(r=null==t?void 0:t.hids)&&void 0!==r?r:[]};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(t,e){var r;const i=new URLSearchParams;e.ids.forEach((t=>i.append("id",t))),e.hids.forEach((t=>i.append("hid",t)));const n=function(t){if(!t||0===t.length)return null;if(t.reduce(((t,e)=>t+e.trafficPercentage),0)>100)return console.error("AB Test Config Error: Traffic Percentage Sum Exceeds 100%"),null;const e=Math.floor(100*Math.random());let r=0;for(const i of t)if(r+=i.trafficPercentage,e<r)return i;return null}(t.abTests);n&&(i.append("ab_test_id",n.id),n.matcher_override&&[...n.matcher_override].sort(((t,e)=>t.rank-e.rank)).forEach((t=>{i.append("matcher_override",t.id)})),n.skipMatchers&&i.append("skip_matchers",n.skipMatchers.join(",")));(null===(r=t.additionalTargetingSignals)||void 0===r?void 0:r.ref)&&i.append("ref","".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname));const s="/v2/targeting?"+i.toString(),o=await S(s,t,{method:"GET",headers:{Accept:"application/json"}});return o&&(new b(t).setTargeting(o),function(t,e){var r,i,n,s,o,a,c,d;const u=null===(r=e.ortb2)||void 0===r||null===(i=r.user)||void 0===i||null===(n=i.eids)||void 0===n?void 0:n.map((t=>t.matcher));window.dispatchEvent(new CustomEvent("optable-targeting:change",{detail:{instance:t.node||t.host,resolved:!!(null===(s=e.ortb2)||void 0===s||null===(o=s.user)||void 0===o||null===(a=o.eids)||void 0===a?void 0:a.length),resolvedIDs:null!==(c=e.resolved_ids)&&void 0!==c?c:[],abTestID:null!==(d=e.ab_test_id)&&void 0!==d?d:void 0,ortb2:e.ortb2,provenance:new Set(u)}}))}(t,o)),o}(this.dcn,t)}targetingFromCache(){return t=this.dcn,new b(t).getTargeting();var t}async site(){return n(this.dcn)}siteFromCache(){return t=this.dcn,new b(t).getSite();var t}targetingClearCache(){var t;t=this.dcn,new b(t).clearTargeting()}async prebidORTB2(){return C(await this.targeting())}prebidORTB2FromCache(){return C(this.targetingFromCache())}async targetingKeyValues(){return x(await this.targeting())}targetingKeyValuesFromCache(){return x(this.targetingFromCache())}async witness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this.init,function(t,e,r){const i={event:e,properties:r};return S("/witness",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,t,e)}async profile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return await this.init,function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const n=L(L({traits:e},r&&{id:r}),i&&{neighbors:i});return S("/profile",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}(this.dcn,t,e,r)}async tokenize(t){return await this.init,function(t,e){let r={id:e};return S("/v2/tokenize",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,t)}async resolve(t){return await this.init,async function(t,e){const r=new URLSearchParams;"string"==typeof e&&r.append("id",e);const i="/v1/resolve?"+r.toString();return function(t){const e={clusters:[],lmpid:""};if("object"!=typeof t||null===t)return e;if("lmpid"in t&&"string"==typeof(null==t?void 0:t.lmpid)&&(e.lmpid=t.lmpid),!("clusters"in t)||!Array.isArray(null==t?void 0:t.clusters))return e;for(const r of t.clusters){const t={ids:[],traits:[]};if(Array.isArray(null==r?void 0:r.ids))for(const e of r.ids)"string"==typeof e&&t.ids.push(e);if(Array.isArray(null==r?void 0:r.traits))for(const e of r.traits)"string"==typeof(null==e?void 0:e.key)&&"string"==typeof(null==e?void 0:e.value)&&t.traits.push({key:e.key,value:e.value});(t.ids.length>0||t.traits.length>0)&&e.clusters.push(t)}return e}(await S(i,t,{method:"GET",headers:{Accept:"application/json"}}))}(this.dcn,t)}static eid(t){return t?"e:"+M.sha256.hex(t.toLowerCase().trim()):""}static sha256(t){return t?M.sha256.hex(t):""}static cid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r="c:";if("string"!=typeof t)throw new Error("Invalid ppid");if("number"!=typeof e||isNaN(e)||e<0||e>19)throw new Error("Invalid variant");return e>0&&(r="c".concat(e,":")),t?r+t.trim():""}static TargetingKeyValues(t){return x(t)}static PrebidORTB2(t){return C(t)}}e(R,"version",i.r);const J=R;function U(t){var e,r,i,n,s,o,a,c,d,u;return{advertiser_id:null===(e=t.advertiserId)||void 0===e?void 0:e.toString(),campaign_id:null===(r=t.campaignId)||void 0===r?void 0:r.toString(),creative_id:null===(i=t.creativeId)||void 0===i?void 0:i.toString(),is_empty:null===(n=t.isEmpty)||void 0===n?void 0:n.toString(),line_item_id:null===(s=t.lineItemId)||void 0===s?void 0:s.toString(),service_name:null===(o=t.serviceName)||void 0===o?void 0:o.toString(),size:null===(a=t.size)||void 0===a?void 0:a.toString(),slot_element_id:null===(c=t.slot)||void 0===c?void 0:c.getSlotElementId(),source_agnostic_creative_id:null===(d=t.sourceAgnosticCreativeId)||void 0===d?void 0:d.toString(),source_agnostic_line_item_id:null===(u=t.sourceAgnosticLineItemId)||void 0===u?void 0:u.toString()}}J.prototype.installGPTEventListeners=function(t){const e=this;e.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};const r=window.googletag,i=["slotRenderEnded","impressionViewable"];function n(t,e){if(!t||!e||!e.length)return{};const r={};for(const i of e)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r}r.cmd.push((function(){try{const s=r.pubads&&r.pubads();if(!s||"function"!=typeof s.addEventListener)return;const o=t?Object.keys(t):i;for(const r of o){const i=t?t[r]:"all";s.addEventListener(r,(function(t){const s=U(t),o=Array.isArray(i)&&i.length?n(s,i):s;e.witness("gpt_events_"+r.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase())),o)}))}}catch(t){}}))},J.prototype.installGPTSecureSignals=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];window.googletag=window.googletag||{cmd:[]};const i=window.googletag;e&&e.length>0&&i.cmd.push((()=>{e.forEach((t=>{let{provider:e,id:r}=t;i.secureSignalProviders.push({id:e,collectorFunction:()=>Promise.resolve(r)})}))}))};const z=/^[a-f0-9]{64}$/i;J.prototype.tryIdentifyFromParams=function(t,e){const r=new RegExp("^".concat(t||"oeid","$"),"i"),i=new URLSearchParams(window.location.search);let n="";for(const[t,e]of i)if(r.test(t)){n=e;break}""!=n&&(e||function(t){return z.test(t)}(n))&&this.identify((e||"e")+":"+n)},window.optable=window.optable||{},window.optable.SDK=J,window.optable.cmd=new class{constructor(t){if(this.cmds=t,Array.isArray(this.cmds))for(const t of this.cmds)"function"==typeof t&&t()}push(t){t()}}(window.optable.cmd||[]),window.optable.utils={resolveMultiNodeTargeting:async function(t){return t?t.some((t=>t.priority))?async function(t){const e=new Set,r=new Set,{refs:i,process:n}=V(),s={user:{data:[],eids:[]}},o=new Map,a=new Map,c=new Map;const d=t.map((t=>{let{targetingFn:e,matcher:r,mm:i,priority:d}=t;return e().then((t=>function(t,e,r){var i,d,u;let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const p=Math.max(0,l),{data:h=[],eids:f=[]}=null!==(i=null===(d=t.ortb2)||void 0===d?void 0:d.user)&&void 0!==i?i:{};s.user.data.push(...h),c.set(p,null!==(u=t.resolved_ids)&&void 0!==u?u:[]),f.filter((t=>t.uids.length)).forEach((i=>{var s,c,d,u,l;const h=null!==(s=i.matcher)&&void 0!==s?s:e,f=null!==(c=o.get(p))&&void 0!==c?c:[];h&&o.set(p,[...f,h]);const g=B(B({},n(t,i)),{},{matcher:null!==(d=i.matcher)&&void 0!==d?d:e,mm:null!==(u=i.mm)&&void 0!==u?u:r}),v=null!==(l=a.get(p))&&void 0!==l?l:[];a.set(p,[...v,g])}))}(t,r,i,d)))}));await Promise.allSettled(d);const u=Array.from(a.keys()).sort(((t,e)=>t-e)).filter((t=>{var e;return null===(e=a.get(t))||void 0===e?void 0:e.length})).shift();if(u){const t=o.get(u)||[],i=c.get(u)||[];s.user.eids.push(...a.get(u)||[]),t.forEach((t=>e.add(t))),i.forEach((t=>r.add(t)))}return{ortb2:s,eidSources:e,refs:i,resolvedIds:r}}(t):async function(t){const e=new Set,r=new Set,{refs:i,process:n}=V(),s={user:{data:[],eids:[]}};const o=t.map((t=>{let{targetingFn:i,matcher:o,mm:a}=t;return i().then((t=>function(t,i,o){var a,c,d;const{data:u=[],eids:l=[]}=null!==(a=null===(c=t.ortb2)||void 0===c?void 0:c.user)&&void 0!==a?a:{};s.user.data.push(...u),null===(d=t.resolved_ids)||void 0===d||d.forEach((t=>r.add(t))),l.filter((t=>t.uids.length)).forEach((r=>{var a,c,d;const u=null!==(a=r.matcher)&&void 0!==a?a:i;u&&e.add(u),s.user.eids.push(B(B({},n(t,r)),{},{mm:null!==(c=r.mm)&&void 0!==c?c:o,matcher:null!==(d=r.matcher)&&void 0!==d?d:i}))}))}(t,o,a)))}));return await Promise.allSettled(o),{ortb2:s,eidSources:e,refs:i,resolvedIds:r}}(t):Promise.reject("No targeting rules provided")}},window.optable.instance_config&&(window.optable.instance=new J(window.optable.instance_config))})()})();
|
package/lib/dist/addons/gpt.js
CHANGED
|
@@ -14,24 +14,45 @@ function toWitnessProperties(event) {
|
|
|
14
14
|
source_agnostic_line_item_id: (_k = event.sourceAgnosticLineItemId) === null || _k === void 0 ? void 0 : _k.toString(),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
* installGPTEventListeners() sets up event listeners on the Google Publisher Tag
|
|
19
|
-
* "slotRenderEnded" and "impressionViewable" page events, and calls witness()
|
|
20
|
-
* on the OptableSDK instance to send log data to a DCN.
|
|
21
|
-
*/
|
|
22
|
-
OptableSDK.prototype.installGPTEventListeners = function () {
|
|
17
|
+
OptableSDK.prototype.installGPTEventListeners = function (eventSpec) {
|
|
23
18
|
// Next time we get called is a no-op:
|
|
24
19
|
const sdk = this;
|
|
25
20
|
sdk.installGPTEventListeners = function () { };
|
|
26
21
|
window.googletag = window.googletag || { cmd: [] };
|
|
27
22
|
const gpt = window.googletag;
|
|
23
|
+
const DEFAULT_EVENTS = ["slotRenderEnded", "impressionViewable"];
|
|
24
|
+
function snakeCase(name) {
|
|
25
|
+
return name.replace(/[A-Z]/g, (m) => "_" + m.toLowerCase());
|
|
26
|
+
}
|
|
27
|
+
function filterProps(obj, keys) {
|
|
28
|
+
if (!obj || !keys || !keys.length)
|
|
29
|
+
return {};
|
|
30
|
+
const out = {};
|
|
31
|
+
for (const k of keys) {
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(obj, k)) {
|
|
33
|
+
out[k] = obj[k];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
28
38
|
gpt.cmd.push(function () {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
try {
|
|
40
|
+
const pubads = gpt.pubads && gpt.pubads();
|
|
41
|
+
if (!pubads || typeof pubads.addEventListener !== "function")
|
|
42
|
+
return;
|
|
43
|
+
const eventsToRegister = eventSpec ? Object.keys(eventSpec) : DEFAULT_EVENTS;
|
|
44
|
+
for (const eventName of eventsToRegister) {
|
|
45
|
+
const keysOrAll = eventSpec ? eventSpec[eventName] : "all";
|
|
46
|
+
pubads.addEventListener(eventName, function (event) {
|
|
47
|
+
const fullProps = toWitnessProperties(event);
|
|
48
|
+
const propsToSend = Array.isArray(keysOrAll) && keysOrAll.length ? filterProps(fullProps, keysOrAll) : fullProps;
|
|
49
|
+
sdk.witness("gpt_events_" + snakeCase(eventName), propsToSend);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
// fail silently to avoid breaking host page
|
|
55
|
+
}
|
|
35
56
|
});
|
|
36
57
|
};
|
|
37
58
|
/*
|
|
@@ -106,7 +106,10 @@ class OptablePrebidAnalytics {
|
|
|
106
106
|
auctionId,
|
|
107
107
|
timeout,
|
|
108
108
|
bidderRequests: bidderRequests.map((br) => {
|
|
109
|
-
|
|
109
|
+
var _a, _b, _c;
|
|
110
|
+
const { bidderCode, bidderRequestId, ortb2, bids = [] } = br;
|
|
111
|
+
const domain = (_a = ortb2 === null || ortb2 === void 0 ? void 0 : ortb2.site) === null || _a === void 0 ? void 0 : _a.domain;
|
|
112
|
+
const eids = (_c = (_b = ortb2 === null || ortb2 === void 0 ? void 0 : ortb2.user) === null || _b === void 0 ? void 0 : _b.ext) === null || _c === void 0 ? void 0 : _c.eids;
|
|
110
113
|
// Optable EIDs
|
|
111
114
|
const optableEIDS = eids.filter((e) => e.inserter === "optable.co");
|
|
112
115
|
const optableMatchers = [...new Set(optableEIDS.map((e) => e.matcher).filter(Boolean))];
|
package/lib/dist/build.json
CHANGED
|
@@ -2,6 +2,6 @@ import type { ResolvedConfig } from "../config";
|
|
|
2
2
|
type ProfileTraits = {
|
|
3
3
|
[key: string]: string | number | boolean;
|
|
4
4
|
};
|
|
5
|
-
declare function Profile(config: ResolvedConfig, traits: ProfileTraits): Promise<void>;
|
|
5
|
+
declare function Profile(config: ResolvedConfig, traits: ProfileTraits, id?: string | null, neighbors?: string[] | null): Promise<void>;
|
|
6
6
|
export { Profile, ProfileTraits };
|
|
7
7
|
export default Profile;
|
package/lib/dist/edge/profile.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { fetch } from "../core/network";
|
|
2
|
-
function Profile(config, traits) {
|
|
3
|
-
const profile = {
|
|
4
|
-
traits: traits,
|
|
5
|
-
};
|
|
2
|
+
function Profile(config, traits, id = null, neighbors = null) {
|
|
3
|
+
const profile = Object.assign(Object.assign({ traits: traits }, (id && { id: id })), (neighbors && { neighbors: neighbors }));
|
|
6
4
|
return fetch("/profile", config, {
|
|
7
5
|
method: "POST",
|
|
8
6
|
headers: {
|
package/lib/dist/sdk.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare class OptableSDK {
|
|
|
24
24
|
targetingKeyValues(): Promise<TargetingKeyValues>;
|
|
25
25
|
targetingKeyValuesFromCache(): TargetingKeyValues;
|
|
26
26
|
witness(event: string, properties?: WitnessProperties): Promise<void>;
|
|
27
|
-
profile(traits: ProfileTraits): Promise<void>;
|
|
27
|
+
profile(traits: ProfileTraits, id?: string | null, neighbors?: string[] | null): Promise<void>;
|
|
28
28
|
tokenize(id: string): Promise<TokenizeResponse>;
|
|
29
29
|
resolve(id?: string): Promise<ResolveResponse>;
|
|
30
30
|
static eid(email: string): string;
|
package/lib/dist/sdk.js
CHANGED
|
@@ -91,10 +91,10 @@ class OptableSDK {
|
|
|
91
91
|
return Witness(this.dcn, event, properties);
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
profile(
|
|
95
|
-
return __awaiter(this,
|
|
94
|
+
profile(traits_1) {
|
|
95
|
+
return __awaiter(this, arguments, void 0, function* (traits, id = null, neighbors = null) {
|
|
96
96
|
yield this.init;
|
|
97
|
-
return Profile(this.dcn, traits);
|
|
97
|
+
return Profile(this.dcn, traits, id, neighbors);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
tokenize(id) {
|
package/package.json
CHANGED