@soyio/soyio-widget 2.4.3 → 2.4.4

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
@@ -324,12 +324,134 @@ The `onEvent` follows the following format:
324
324
  }
325
325
  ```
326
326
 
327
+ ### Methods
328
+
329
+ - **`getState()`**: Returns the current state of the consent box. The returned object has the following structure:
330
+
331
+ ```typescript
332
+ {
333
+ isSelected: boolean,
334
+ actionToken: string | null,
335
+ }
336
+
337
+ ```
338
+
327
339
  ### Attribute Descriptions
328
340
 
329
341
  - **`consentTemplateId`**: Identifier of consent template. It must start with `'constpl_'`.
330
342
  - **`isSelected`**: Boolean value indicating whether the consent checkbox is selected or not.
331
343
  - **`actionToken`**: token containing necessary information for creation of the consent commit. [Learn more](https://docs.soyio.id/docs/api/resources/create-consent-request).
332
- - **`appearance`**: Customize the appearance of the iframe. [Learn more](https://docs.soyio.id/docs/api/intro).
344
+ - **`appearance`**: Customize the appearance of the iframe. [Learn more](https://docs.soyio.id/docs/integration-guide/modules/consent).
345
+
346
+ # Appearance
347
+
348
+ Customize the look and feel of Soyio UI components by passing an `appearance` object to the configuration. The appearance object supports themes, CSS variables, and CSS rules for granular control over the styling.
349
+
350
+ ## Structure
351
+
352
+ The appearance object consists of three main sections:
353
+
354
+ ```javascript
355
+ const appearance = {
356
+ theme: string,
357
+ variables: Variables,
358
+ rules: Rules,
359
+ };
360
+ ```
361
+
362
+ ## Themes
363
+
364
+ Currently supported themes:
365
+
366
+ - `"soyio"` (default) - The standard Soyio theme
367
+
368
+ ## Variables
369
+
370
+ Use variables to adjust common visual attributes across all components.
371
+
372
+ ```javascript
373
+ interface Variables {
374
+ fontFamily?: string;
375
+ colorPrimary?: string;
376
+ colorBackground?: string;
377
+ colorText?: string;
378
+ borderRadius?: string;
379
+ borderWidth?: string;
380
+ borderStyle?: string;
381
+ }
382
+ ```
383
+
384
+ ### Available Variables
385
+
386
+ | Variable | Description | Default |
387
+ | ----------------- | -------------------------------------- | ------------------------- |
388
+ | `fontFamily` | The font stack to use for text | `"system-ui, sans-serif"` |
389
+ | `colorPrimary` | Primary color for interactive elements | `"#0570DE"` |
390
+ | `colorBackground` | Background color | `"#FFFFFF"` |
391
+ | `colorText` | Main text color | `"#1A1F36"` |
392
+ | `borderRadius` | Border radius for elements | `"4px"` |
393
+ | `borderWidth` | Border width for elements | `"1px"` |
394
+ | `borderStyle` | Border style for elements | `"solid"` |
395
+
396
+ ## Rules
397
+
398
+ The `rules` object allows you to apply custom CSS to specific elements. Currently, Soyio supports styling for checkbox components.
399
+
400
+ ### Supported Selectors
401
+
402
+ - `.CheckboxInput` - The checkbox input element
403
+ - `.CheckboxInput--checked` - The checked state of the checkbox
404
+ - `.CheckboxInput:hover` - Hover state of the checkbox
405
+ - `.CheckboxInput:focus` - Focus state of the checkbox
406
+ - `.CheckboxInput:focus-visible` - Focus-visible state of the checkbox
407
+
408
+ ![Checkbox Components](assets/checkbox-appearance.webp)
409
+
410
+ ### Example Configuration
411
+
412
+ ```javascript
413
+ const appearance = {
414
+ theme: "soyio",
415
+ variables: {
416
+ fontFamily: "system-ui, sans-serif",
417
+ colorPrimary: "#f54c27",
418
+ colorBackground: "#ffffff",
419
+ colorText: "#1E1B4B",
420
+ borderRadius: "0.5rem",
421
+ borderWidth: "3px",
422
+ borderStyle: "dashed",
423
+ },
424
+ rules: {
425
+ ".CheckboxInput": {
426
+ appearance: "none",
427
+ backgroundColor: "transparent",
428
+ cursor: "pointer",
429
+ width: "1rem",
430
+ height: "1rem",
431
+ borderRadius: "9999px",
432
+ borderWidth: "2px",
433
+ borderStyle: "solid",
434
+ borderColor: "var(--colorPrimary)",
435
+ },
436
+ ".CheckboxInput--checked": {
437
+ borderColor: "var(--colorPrimary)",
438
+ backgroundColor: "var(--colorPrimary)",
439
+ },
440
+ ".CheckboxInput:hover": {
441
+ borderColor: "var(--colorPrimary)",
442
+ boxShadow: "0 0 0 2px var(--colorPrimary)",
443
+ },
444
+ ".CheckboxInput:focus": {
445
+ outline: "none",
446
+ boxShadow: "0 0 0 2px var(--colorPrimary)",
447
+ },
448
+ ".CheckboxInput:focus-visible": {
449
+ outline: "none",
450
+ boxShadow: "0 0 0 2px var(--colorPrimary)",
451
+ },
452
+ },
453
+ };
454
+ ```
333
455
 
334
456
  ## TypeScript
335
457
 
package/dist/index.js CHANGED
@@ -1,45 +1,45 @@
1
- var N = Object.defineProperty;
2
- var D = (n, e, t) => e in n ? N(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var c = (n, e, t) => (D(n, typeof e != "symbol" ? e + "" : e, t), t), P = (n, e, t) => {
4
- if (!e.has(n))
5
- throw TypeError("Cannot " + t);
1
+ var b = Object.defineProperty;
2
+ var D = (t, e, n) => e in t ? b(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var c = (t, e, n) => (D(t, typeof e != "symbol" ? e + "" : e, n), n), A = (t, e, n) => {
4
+ if (!e.has(t))
5
+ throw TypeError("Cannot " + n);
6
6
  };
7
- var I = (n, e, t) => {
8
- if (e.has(n))
7
+ var I = (t, e, n) => {
8
+ if (e.has(t))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
- e instanceof WeakSet ? e.add(n) : e.set(n, t);
10
+ e instanceof WeakSet ? e.add(t) : e.set(t, n);
11
11
  };
12
- var y = (n, e, t) => (P(n, e, "access private method"), t);
13
- async function U(n, e) {
14
- if (!n.contentWindow)
12
+ var y = (t, e, n) => (A(t, e, "access private method"), n);
13
+ async function P(t, e) {
14
+ if (!t.contentWindow)
15
15
  throw new Error("Invalid iframe: contentWindow is null");
16
- const t = await import("./index-yZw-yxuV.js").then((o) => o.i);
16
+ const n = await import("./index-yZw-yxuV.js").then((o) => o.i);
17
17
  try {
18
- await t.send(n.contentWindow, "SET_APPEARANCE", { appearance: e });
18
+ await n.send(t.contentWindow, "SET_APPEARANCE", { appearance: e });
19
19
  } catch (o) {
20
20
  console.error("Failed to send appearance config:", o);
21
21
  }
22
22
  }
23
- const g = "soyio-consent-iframe", v = "https://app.soyio.id", R = "https://sandbox.soyio.id", A = [
23
+ const g = "soyio-consent-iframe", S = "https://app.soyio.id", T = "https://sandbox.soyio.id", U = [
24
24
  "DISCLOSURE_REQUEST_SUCCESSFUL",
25
25
  "IDENTITY_REGISTERED",
26
26
  "IDENTITY_SIGNATURE",
27
27
  "UNEXPECTED_ERROR",
28
28
  "DENIED_CAMERA_PERMISSION",
29
29
  "REJECTED_SIGNATURE"
30
- ], x = "WIDGET_CLOSED", H = 420, L = 720, O = 500;
31
- function $() {
32
- const n = document.getElementById(g);
33
- n && (console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."), n.remove());
30
+ ], H = "WIDGET_CLOSED", O = 420, x = 720, L = 500;
31
+ function G() {
32
+ const t = document.getElementById(g);
33
+ t && (console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."), t.remove());
34
34
  }
35
- function F(n) {
36
- const e = document.querySelector(n);
35
+ function $(t) {
36
+ const e = document.querySelector(t);
37
37
  if (!e)
38
- throw new Error(`Iframe div container with id '${n}' not found`);
38
+ throw new Error(`Iframe div container with id '${t}' not found`);
39
39
  if (e.tagName.toLowerCase() !== "div")
40
- throw new Error(`Iframe container with id '${n}' must be a <div> element`);
41
- const t = e;
42
- return t.style.position = "relative", t.style.cssText += `
40
+ throw new Error(`Iframe container with id '${t}' must be a <div> element`);
41
+ const n = e;
42
+ return n.style.position = "relative", n.style.cssText += `
43
43
  padding: 0 !important;
44
44
  margin: 0 !important;
45
45
  display: flex !important;
@@ -48,11 +48,11 @@ function F(n) {
48
48
  border: none !important;
49
49
  transition: height 0.35s !important;
50
50
  opacity: 1 !important;
51
- `, t;
51
+ `, n;
52
52
  }
53
- function G(n) {
53
+ function W(t) {
54
54
  const e = document.createElement("iframe");
55
- return e.id = g, e.src = n, e.style.cssText += `
55
+ return e.id = g, e.src = t, e.style.cssText += `
56
56
  width: 100% !important;
57
57
  min-width: 25rem !important;
58
58
  max-width: 36rem !important;
@@ -64,112 +64,127 @@ function G(n) {
64
64
  opacity 0.4s 0.1s;
65
65
  `, e;
66
66
  }
67
- function W(n) {
68
- const e = n.isSandbox ?? !1;
69
- return `${n.developmentUrl || (e ? R : v)}/embed/consents/${n.consentTemplateId}`;
67
+ function F(t) {
68
+ const e = t.isSandbox ?? !1;
69
+ return `${t.developmentUrl || (e ? T : S)}/embed/consents/${t.consentTemplateId}`;
70
70
  }
71
- const M = "IFRAME_READY", V = "IFRAME_EVENT", j = "IFRAME_HEIGHT_CHANGE";
71
+ const M = "IFRAME_READY", k = "CONSENT_STATE_CHANGE", j = "IFRAME_HEIGHT_CHANGE";
72
72
  let l = null, d = null, u = null;
73
- function T() {
73
+ function v() {
74
74
  l == null || l.cancel(), l = null, d == null || d.cancel(), d = null, u == null || u.cancel(), u = null;
75
75
  }
76
- async function k(n) {
77
- const { onEvent: e, onHeightChange: t, onIframeReady: o } = n, a = await import("./index-yZw-yxuV.js").then((i) => i.i);
78
- T(), l = a.on(V, async (i) => {
76
+ async function B(t) {
77
+ const { onHeightChange: e, onIframeReady: n, onStateChange: o } = t, r = await import("./index-yZw-yxuV.js").then((i) => i.i);
78
+ v(), l = r.on(j, async (i) => {
79
79
  const s = i.data;
80
- e(s);
81
- }), d = a.on(j, async (i) => {
80
+ e(s.height);
81
+ }), d = r.on(M, async () => {
82
+ n();
83
+ }), u = r.on(k, async (i) => {
82
84
  const s = i.data;
83
- t(s.height);
84
- }), u = a.on(M, async () => {
85
- o();
85
+ o(s);
86
86
  });
87
87
  }
88
- class te {
88
+ class ne {
89
89
  constructor(e) {
90
90
  c(this, "appearance");
91
91
  c(this, "options");
92
92
  c(this, "iframe", null);
93
- this.options = e, this.appearance = e.appearance || null, k({
94
- onEvent: this.options.onEvent.bind(this),
93
+ c(this, "state", {
94
+ isSelected: !1,
95
+ actionToken: null
96
+ });
97
+ this.options = e, this.appearance = e.appearance || null, B({
95
98
  onHeightChange: this.handleHeightChange.bind(this),
96
- onIframeReady: this.handleIframeReady.bind(this)
99
+ onIframeReady: this.handleIframeReady.bind(this),
100
+ onStateChange: this.handleStateChange.bind(this)
97
101
  });
98
102
  }
99
103
  handleHeightChange(e) {
100
104
  this.iframe && (this.iframe.style.height = `${e}px`);
101
105
  }
102
106
  async handleIframeReady() {
103
- !this.iframe || !this.appearance || await U(this.iframe, this.appearance);
107
+ !this.iframe || !this.appearance || await P(this.iframe, this.appearance);
108
+ }
109
+ handleStateChange(e) {
110
+ const { isSelected: n, actionToken: o } = e;
111
+ this.state = { isSelected: n, actionToken: o }, this.options.onEvent({
112
+ eventName: "CONSENT_CHECKBOX_CHANGE",
113
+ isSelected: n,
114
+ actionToken: o
115
+ });
104
116
  }
105
117
  mount(e) {
106
- $();
107
- const t = F(e), o = W(this.options);
108
- return this.iframe = G(o), t.appendChild(this.iframe), this;
118
+ G();
119
+ const n = $(e), o = F(this.options);
120
+ return this.iframe = W(o), n.appendChild(this.iframe), this;
109
121
  }
110
122
  unmount() {
111
- T(), this.iframe && (this.iframe.remove(), this.iframe = null);
123
+ v(), this.iframe && (this.iframe.remove(), this.iframe = null);
124
+ }
125
+ getState() {
126
+ return { ...this.state };
112
127
  }
113
128
  }
114
129
  const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
115
130
  __proto__: null
116
131
  }, Symbol.toStringTag, { value: "Module" }));
117
- function q(n) {
132
+ function q(t) {
118
133
  let e = "widget/";
119
- return "disclosureRequestId" in n.configProps ? e += ["disclosures", n.configProps.disclosureRequestId].join("/") : e += n.request, e;
134
+ return "disclosureRequestId" in t.configProps ? e += ["disclosures", t.configProps.disclosureRequestId].join("/") : e += t.request, e;
120
135
  }
121
- function B(n) {
122
- const e = n.isSandbox ?? !1, t = n.developmentUrl || (e ? R : v), o = Object.entries(n.configProps).filter(([i, s]) => s || i === "disclosureRequestId").map(([i, s]) => `${i}=${encodeURIComponent(s)}`).join("&"), a = q(n);
123
- return `${t}/${a}?sdk=web&${o}`;
136
+ function V(t) {
137
+ const e = t.isSandbox ?? !1, n = t.developmentUrl || (e ? T : S), o = Object.entries(t.configProps).filter(([i, s]) => s || i === "disclosureRequestId").map(([i, s]) => `${i}=${encodeURIComponent(s)}`).join("&"), r = q(t);
138
+ return `${n}/${r}?sdk=web&${o}`;
124
139
  }
125
140
  const Y = !!(typeof window < "u" && window.document && window.document.createElement);
126
- let r = null, p = null;
127
- function E(n = null) {
128
- r && !r.closed && r.focus(), n == null || n.preventDefault();
141
+ let a = null, h = null;
142
+ function p(t = null) {
143
+ a && !a.closed && a.focus(), t == null || t.preventDefault();
129
144
  }
130
- function h() {
131
- document.body.style.filter = "", document.body.removeEventListener("click", E);
145
+ function E() {
146
+ document.body.style.filter = "", document.body.removeEventListener("click", p);
132
147
  }
133
148
  function X() {
134
- p = setInterval(() => {
135
- (!r || r.closed) && (p && clearInterval(p), h());
136
- }, O);
149
+ h = setInterval(() => {
150
+ (!a || a.closed) && (h && clearInterval(h), E());
151
+ }, L);
137
152
  }
138
- function z(n) {
139
- const e = B(n), t = H, o = L, a = window.screenLeft !== void 0 ? window.screenLeft : window.screenX, i = window.screenTop !== void 0 ? window.screenTop : window.screenY, s = window.innerWidth || document.documentElement.clientWidth || window.screen.width, b = window.innerHeight || document.documentElement.clientHeight || window.screen.height, w = s / window.screen.availWidth, S = (s - t) / 2 / w + a, C = (b - o) / 2 / w + i;
140
- document.body.style.filter = "blur(5px)", document.body.addEventListener("click", E), r = window.open(
153
+ function K(t) {
154
+ const e = V(t), n = O, o = x, r = window.screenLeft !== void 0 ? window.screenLeft : window.screenX, i = window.screenTop !== void 0 ? window.screenTop : window.screenY, s = window.innerWidth || document.documentElement.clientWidth || window.screen.width, C = window.innerHeight || document.documentElement.clientHeight || window.screen.height, w = s / window.screen.availWidth, R = (s - n) / 2 / w + r, N = (C - o) / 2 / w + i;
155
+ document.body.style.filter = "blur(5px)", document.body.addEventListener("click", p), a = window.open(
141
156
  e,
142
157
  "Soyio",
143
158
  `scrollbars=yes,
144
- width=${t},
159
+ width=${n},
145
160
  height=${o},
146
- top=${C},
147
- left=${S}`
148
- ), E(), X();
161
+ top=${N},
162
+ left=${R}`
163
+ ), p(), X();
149
164
  }
150
- function J() {
151
- r && (r.close(), r = null), h();
165
+ function z() {
166
+ a && (a.close(), a = null), E();
152
167
  }
153
- const K = "WIDGET_EVENT";
168
+ const J = "WIDGET_EVENT";
154
169
  let m = null;
155
170
  function Q() {
156
171
  m && (m.cancel(), m = null);
157
172
  }
158
- async function Z(n) {
159
- const { onEvent: e } = n, t = await import("./index-yZw-yxuV.js").then((o) => o.i);
160
- m && Q(), m = t.on(K, async (o) => {
161
- e(o.data), A.includes(o.data.eventName) ? J() : o.data.eventName === x && h();
173
+ async function Z(t) {
174
+ const { onEvent: e } = t, n = await import("./index-yZw-yxuV.js").then((o) => o.i);
175
+ m && Q(), m = n.on(J, async (o) => {
176
+ e(o.data), U.includes(o.data.eventName) ? z() : o.data.eventName === H && E();
162
177
  });
163
178
  }
164
- function ee(n) {
165
- Z(n);
179
+ function ee(t) {
180
+ Z(t);
166
181
  }
167
182
  var f, _;
168
183
  class ie {
169
184
  constructor(e) {
170
185
  I(this, f);
171
186
  c(this, "onEvent");
172
- this.onEvent = e.onEvent, Y && (z(e), ee({
187
+ this.onEvent = e.onEvent, Y && (K(e), ee({
173
188
  onEvent: y(this, f, _).bind(this)
174
189
  }));
175
190
  }
@@ -178,7 +193,7 @@ f = new WeakSet(), _ = function(e) {
178
193
  this.onEvent(e);
179
194
  };
180
195
  export {
181
- te as ConsentBox,
196
+ ne as ConsentBox,
182
197
  oe as SoyioTypes,
183
198
  ie as SoyioWidget,
184
199
  ie as default
@@ -1,4 +1,4 @@
1
- (function(D,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(D=typeof globalThis<"u"?globalThis:D||self,N(D["soyio-widget"]={}))})(this,function(D){"use strict";var At=Object.defineProperty;var Rt=(D,N,F)=>N in D?At(D,N,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[N]=F;var pn=(D,N,F)=>(Rt(D,typeof N!="symbol"?N+"":N,F),F),Dt=(D,N,F)=>{if(!N.has(D))throw TypeError("Cannot "+F)};var Ae=(D,N,F)=>{if(N.has(D))throw TypeError("Cannot add the same private member more than once");N instanceof WeakSet?N.add(D):N.set(D,F)};var Re=(D,N,F)=>(Dt(D,N,"access private method"),F);var gn,De;function N(v,E){for(var P=0;P<E.length;P++){const p=E[P];if(typeof p!="string"&&!Array.isArray(p)){for(const m in p)if(m!=="default"&&!(m in v)){const w=Object.getOwnPropertyDescriptor(p,m);w&&Object.defineProperty(v,m,w.get?w:{enumerable:!0,get:()=>p[m]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}async function F(v,E){if(!v.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const P=await Promise.resolve().then(()=>Dn);try{await P.send(v.contentWindow,"SET_APPEARANCE",{appearance:E})}catch(p){console.error("Failed to send appearance config:",p)}}const Gn="soyio-consent-iframe",_n="https://app.soyio.id",Jn="https://sandbox.soyio.id",Ne=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Ce="WIDGET_CLOSED",Te=420,je=720,Me=500;function ze(){const v=document.getElementById(Gn);v&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),v.remove())}function Le(v){const E=document.querySelector(v);if(!E)throw new Error(`Iframe div container with id '${v}' not found`);if(E.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${v}' must be a <div> element`);const P=E;return P.style.position="relative",P.style.cssText+=`
1
+ (function(D,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(D=typeof globalThis<"u"?globalThis:D||self,C(D["soyio-widget"]={}))})(this,function(D){"use strict";var At=Object.defineProperty;var Rt=(D,C,H)=>C in D?At(D,C,{enumerable:!0,configurable:!0,writable:!0,value:H}):D[C]=H;var rn=(D,C,H)=>(Rt(D,typeof C!="symbol"?C+"":C,H),H),Dt=(D,C,H)=>{if(!C.has(D))throw TypeError("Cannot "+H)};var Ae=(D,C,H)=>{if(C.has(D))throw TypeError("Cannot add the same private member more than once");C instanceof WeakSet?C.add(D):C.set(D,H)};var Re=(D,C,H)=>(Dt(D,C,"access private method"),H);var gn,De;function C(v,g){for(var x=0;x<g.length;x++){const m=g[x];if(typeof m!="string"&&!Array.isArray(m)){for(const p in m)if(p!=="default"&&!(p in v)){const w=Object.getOwnPropertyDescriptor(m,p);w&&Object.defineProperty(v,p,w.get?w:{enumerable:!0,get:()=>m[p]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}async function H(v,g){if(!v.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const x=await Promise.resolve().then(()=>Dn);try{await x.send(v.contentWindow,"SET_APPEARANCE",{appearance:g})}catch(m){console.error("Failed to send appearance config:",m)}}const Bn="soyio-consent-iframe",_n="https://app.soyio.id",Jn="https://sandbox.soyio.id",Ce=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Ne="WIDGET_CLOSED",Te=420,je=720,ze=500;function Me(){const v=document.getElementById(Bn);v&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),v.remove())}function Le(v){const g=document.querySelector(v);if(!g)throw new Error(`Iframe div container with id '${v}' not found`);if(g.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${v}' must be a <div> element`);const x=g;return x.style.position="relative",x.style.cssText+=`
2
2
  padding: 0 !important;
3
3
  margin: 0 !important;
4
4
  display: flex !important;
@@ -7,7 +7,7 @@
7
7
  border: none !important;
8
8
  transition: height 0.35s !important;
9
9
  opacity: 1 !important;
10
- `,P}function Fe(v){const E=document.createElement("iframe");return E.id=Gn,E.src=v,E.style.cssText+=`
10
+ `,x}function He(v){const g=document.createElement("iframe");return g.id=Bn,g.src=v,g.style.cssText+=`
11
11
  width: 100% !important;
12
12
  min-width: 25rem !important;
13
13
  max-width: 36rem !important;
@@ -17,24 +17,24 @@
17
17
  opacity: 1;
18
18
  transition: height 0.35s,
19
19
  opacity 0.4s 0.1s;
20
- `,E}function He(v){const E=v.isSandbox??!1;return`${v.developmentUrl||(E?Jn:_n)}/embed/consents/${v.consentTemplateId}`}const Ue="IFRAME_READY",Be="IFRAME_EVENT",Ge="IFRAME_HEIGHT_CHANGE";let rn=null,on=null,an=null;function qn(){rn==null||rn.cancel(),rn=null,on==null||on.cancel(),on=null,an==null||an.cancel(),an=null}async function _e(v){const{onEvent:E,onHeightChange:P,onIframeReady:p}=v,m=await Promise.resolve().then(()=>Dn);qn(),rn=m.on(Be,async w=>{const S=w.data;E(S)}),on=m.on(Ge,async w=>{const S=w.data;P(S.height)}),an=m.on(Ue,async()=>{p()})}class Je{constructor(E){pn(this,"appearance");pn(this,"options");pn(this,"iframe",null);this.options=E,this.appearance=E.appearance||null,_e({onEvent:this.options.onEvent.bind(this),onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this)})}handleHeightChange(E){this.iframe&&(this.iframe.style.height=`${E}px`)}async handleIframeReady(){!this.iframe||!this.appearance||await F(this.iframe,this.appearance)}mount(E){ze();const P=Le(E),p=He(this.options);return this.iframe=Fe(p),P.appendChild(this.iframe),this}unmount(){qn(),this.iframe&&(this.iframe.remove(),this.iframe=null)}}const qe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function $e(v){let E="widget/";return"disclosureRequestId"in v.configProps?E+=["disclosures",v.configProps.disclosureRequestId].join("/"):E+=v.request,E}function Ve(v){const E=v.isSandbox??!1,P=v.developmentUrl||(E?Jn:_n),p=Object.entries(v.configProps).filter(([w,S])=>S||w==="disclosureRequestId").map(([w,S])=>`${w}=${encodeURIComponent(S)}`).join("&"),m=$e(v);return`${P}/${m}?sdk=web&${p}`}const Ze=!!(typeof window<"u"&&window.document&&window.document.createElement);let $=null,On=null;function An(v=null){$&&!$.closed&&$.focus(),v==null||v.preventDefault()}function Rn(){document.body.style.filter="",document.body.removeEventListener("click",An)}function Ye(){On=setInterval(()=>{(!$||$.closed)&&(On&&clearInterval(On),Rn())},Me)}function ke(v){const E=Ve(v),P=Te,p=je,m=window.screenLeft!==void 0?window.screenLeft:window.screenX,w=window.screenTop!==void 0?window.screenTop:window.screenY,S=window.innerWidth||document.documentElement.clientWidth||window.screen.width,J=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Z=S/window.screen.availWidth,en=(S-P)/2/Z+m,V=(J-p)/2/Z+w;document.body.style.filter="blur(5px)",document.body.addEventListener("click",An),$=window.open(E,"Soyio",`scrollbars=yes,
21
- width=${P},
22
- height=${p},
23
- top=${V},
24
- left=${en}`),An(),Ye()}function Xe(){$&&($.close(),$=null),Rn()}const Ke="WIDGET_EVENT";let un=null;function Qe(){un&&(un.cancel(),un=null)}async function nt(v){const{onEvent:E}=v,P=await Promise.resolve().then(()=>Dn);un&&Qe(),un=P.on(Ke,async p=>{E(p.data),Ne.includes(p.data.eventName)?Xe():p.data.eventName===Ce&&Rn()})}function et(v){nt(v)}class $n{constructor(E){Ae(this,gn);pn(this,"onEvent");this.onEvent=E.onEvent,Ze&&(ke(E),et({onEvent:Re(this,gn,De).bind(this)}))}}gn=new WeakSet,De=function(E){this.onEvent(E)};var tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}var Vn={exports:{}},Zn={exports:{}};(function(v,E){(function(P,p){v.exports=p()})(typeof self<"u"?self:tt,function(){return function(P){var p={};function m(w){if(p[w])return p[w].exports;var S=p[w]={i:w,l:!1,exports:{}};return P[w].call(S.exports,S,S.exports,m),S.l=!0,S.exports}return m.m=P,m.c=p,m.d=function(w,S,J){m.o(w,S)||Object.defineProperty(w,S,{enumerable:!0,get:J})},m.r=function(w){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},m.t=function(w,S){if(1&S&&(w=m(w)),8&S||4&S&&typeof w=="object"&&w&&w.__esModule)return w;var J=Object.create(null);if(m.r(J),Object.defineProperty(J,"default",{enumerable:!0,value:w}),2&S&&typeof w!="string")for(var Z in w)m.d(J,Z,(function(en){return w[en]}).bind(null,Z));return J},m.n=function(w){var S=w&&w.__esModule?function(){return w.default}:function(){return w};return m.d(S,"a",S),S},m.o=function(w,S){return{}.hasOwnProperty.call(w,S)},m.p="",m(m.s=0)}([function(P,p,m){m.r(p),m.d(p,"Promise",function(){return x}),m.d(p,"TYPES",function(){return It}),m.d(p,"ProxyWindow",function(){return B}),m.d(p,"setup",function(){return Oe}),m.d(p,"destroy",function(){return Pt}),m.d(p,"serializeMessage",function(){return Wt}),m.d(p,"deserializeMessage",function(){return St}),m.d(p,"createProxyWindow",function(){return bt}),m.d(p,"toProxyWindow",function(){return xt}),m.d(p,"on",function(){return Y}),m.d(p,"once",function(){return Et}),m.d(p,"send",function(){return k}),m.d(p,"markWindowKnown",function(){return we}),m.d(p,"cleanUpWindow",function(){return Ot}),m.d(p,"bridge",function(){});function w(n){return{}.toString.call(n)==="[object RegExp]"}var S=`Call was rejected by callee.\r
25
- `;function J(n){return n===void 0&&(n=window),n.location.protocol}function Z(n){if(n===void 0&&(n=window),n.mockDomain){var t=n.mockDomain.split("//")[0];if(t)return t}return J(n)}function en(n){return n===void 0&&(n=window),Z(n)==="about:"}function V(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function kn(n){if(n===void 0&&(n=window),n&&!V(n))try{return n.opener}catch{}}function yn(n){try{return!0}catch{}return!1}function En(n){n===void 0&&(n=window);var t=n.location;if(!t)throw new Error("Can not read window location");var e=J(n);if(!e)throw new Error("Can not read window protocol");if(e==="file:")return"file://";if(e==="about:"){var r=V(n);return r&&yn()?En(r):"about://"}var o=t.host;if(!o)throw new Error("Can not read window host");return e+"//"+o}function z(n){n===void 0&&(n=window);var t=En(n);return t&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:t}function X(n){if(!function(t){try{if(t===window)return!0}catch{}try{var e=Object.getOwnPropertyDescriptor(t,"location");if(e&&e.enumerable===!1)return!1}catch{}try{if(en(t)&&yn())return!0}catch{}try{if(function(r){return r===void 0&&(r=window),Z(r)==="mock:"}(t)&&yn())return!0}catch{}try{if(En(t)===En(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||en(n)&&yn()||z(window)===z(n))return!0}catch{}return!1}function Wn(n){if(!X(n))throw new Error("Expected window to be same domain");return n}function Xn(n,t){if(!n||!t)return!1;var e=V(t);return e?e===n:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch{}return o}(t).indexOf(n)!==-1}function Kn(n){var t=[],e;try{e=n.frames}catch{e=n}var r;try{r=e.length}catch{}if(r===0)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=e[o]}catch{continue}t.push(i)}return t}for(var a=0;a<100;a++){var s=void 0;try{s=e[a]}catch{return t}if(!s)return t;t.push(s)}return t}var it=[],at=[];function G(n,t){t===void 0&&(t=!0);try{if(n===window)return!1}catch{return!0}try{if(!n)return!0}catch{return!0}try{if(n.closed)return!0}catch(o){return!o||o.message!==S}if(t&&X(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var e=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(it,n);if(e!==-1){var r=at[e];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function Qn(n){return n===void 0&&(n=window),kn(n=n||window)||V(n)||void 0}function tn(n,t){if(typeof n=="string"){if(typeof t=="string")return n==="*"||t===n;if(w(t)||Array.isArray(t))return!1}return w(n)?w(t)?n.toString()===t.toString():!Array.isArray(t)&&!!t.match(n):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!w(t)&&n.some(function(e){return tn(e,t)}))}function Sn(n){try{if(n===window)return!0}catch(t){if(t&&t.message===S)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(t){if(t&&t.message===S)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.self===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.parent===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.top===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch{}return!1}function ne(n){if(X(n))return Wn(n).frameElement;for(var t=0,e=document.querySelectorAll("iframe");t<e.length;t++){var r=e[t];if(r&&r.contentWindow&&r.contentWindow===n)return r}}function ut(n){if(function(e){return e===void 0&&(e=window),!!V(e)}(n)){var t=ne(n);if(t&&t.parentElement){t.parentElement.removeChild(t);return}}try{n.close()}catch{}}function K(n){try{if(!n)return!1;if(typeof Promise<"u"&&n instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&n instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var e=t.call(n);if(e==="[object Window]"||e==="[object global]"||e==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var ee=[],cn=[],Nn=0,sn;function te(){if(!Nn&&sn){var n=sn;sn=null,n.resolve()}}function Cn(){Nn+=1}function dn(){Nn-=1,te()}var x=function(){function n(e){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],e){var o,i,a=!1,s=!1,c=!1;Cn();try{e(function(u){c?r.resolve(u):(a=!0,o=u)},function(u){c?r.reject(u):(s=!0,i=u)})}catch(u){dn(),this.reject(u);return}dn(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var t=n.prototype;return t.resolve=function(e){if(this.resolved||this.rejected)return this;if(K(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},t.reject=function(e){var r=this;if(this.resolved||this.rejected)return this;if(K(e))throw new Error("Can not reject promise with another promise");if(!e){var o=e&&typeof e.toString=="function"?e.toString():{}.toString.call(e);e=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(ee.indexOf(i)===-1){ee.push(i),setTimeout(function(){throw i},1);for(var s=0;s<cn.length;s++)cn[s](i,a)}}(e,r)},1),this.dispatch(),this},t.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},t.dispatch=function(){var e=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(e||r)){this.dispatching=!0,Cn();for(var i=function(h,W){return h.then(function(g){W.resolve(g)},function(g){W.reject(g)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,l=s.promise,d=void 0;if(e)try{d=c?c(this.value):this.value}catch(h){l.reject(h);continue}else if(r){if(!u){l.reject(this.error);continue}try{d=u(this.error)}catch(h){l.reject(h);continue}}if(d instanceof n&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else K(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}o.length=0,this.dispatching=!1,dn()}},t.then=function(e,r){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:e,onError:r}),this.errorHandled=!0,this.dispatch(),o},t.catch=function(e){return this.then(void 0,e)},t.finally=function(e){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return n.try(e).then(function(){return r})},function(r){return n.try(e).then(function(){throw r})})},t.timeout=function(e,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(a){return clearTimeout(i),a})},t.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},t.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(e){return e instanceof n?e:K(e)?new n(function(r,o){return e.then(r,o)}):new n().resolve(e)},n.reject=function(e){return new n().reject(e)},n.asyncReject=function(e){return new n().asyncReject(e)},n.all=function(e){var r=new n,o=e.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(u,l,d){return l.then(function(f){i[u]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},s=0;s<e.length;s++){var c=e[s];if(c instanceof n){if(c.resolved){i[s]=c.value,o-=1;continue}}else if(!K(c)){i[s]=c,o-=1;continue}a(s,n.resolve(c),r)}return o===0&&r.resolve(i),r},n.hash=function(e){var r={},o=[],i=function(s){if(e.hasOwnProperty(s)){var c=e[s];K(c)?o.push(c.then(function(u){r[s]=u})):r[s]=c}};for(var a in e)i(a);return n.all(o).then(function(){return r})},n.map=function(e,r){return n.all(e.map(r))},n.onPossiblyUnhandledException=function(e){return function(r){return cn.push(r),{cancel:function(){cn.splice(cn.indexOf(r),1)}}}(e)},n.try=function(e,r,o){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.try expected a function");var i;Cn();try{i=e.apply(r,o||[])}catch(a){return dn(),n.reject(a)}return dn(),n.resolve(i)},n.delay=function(e){return new n(function(r){setTimeout(r,e)})},n.isPromise=function(e){return!!(e&&e instanceof n)||K(e)},n.flush=function(){return function(e){var r=sn=sn||new e;return te(),r}(n)},n}();function bn(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch{}return-1}var Tn=function(){function n(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var e=new WeakMap,r={};return Object.freeze(r),e.set(r,"__testvalue__"),e.get(r)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var t=n.prototype;return t._cleanupClosedWindows=function(){for(var e=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Sn(i)&&G(i)){if(e)try{e.delete(i)}catch{}r.splice(o,1),this.values.splice(o,1),o-=1}}},t.isSafeToReadWrite=function(e){return!Sn(e)},t.set=function(e,r){if(!e)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(e,r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var i=this.name,a=e[i];a&&a[0]===e?a[1]=r:Object.defineProperty(e,i,{value:[e,r],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=bn(s,e);u===-1?(s.push(e),c.push(r)):c[u]=r},t.get=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return r.get(e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];return o&&o[0]===e?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=bn(this.keys,e);if(i!==-1)return this.values[i]},t.delete=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];o&&o[0]===e&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=bn(i,e);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},t.has=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];return!(!o||o[0]!==e)}catch{}return this._cleanupClosedWindows(),bn(this.keys,e)!==-1},t.getOrSet=function(e,r){if(this.has(e))return this.get(e);var o=r();return this.set(e,o),o},n}();function re(n){return n.name||n.__name__||n.displayName||"anonymous"}function oe(n,t){try{delete n.name,n.name=t}catch{}return n.__name__=n.displayName=t,n}function q(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(t){if(typeof btoa=="function")return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(t,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var xn;function ie(n){try{return JSON.stringify([].slice.call(n),function(t,e){return typeof e=="function"?"memoize["+function(r){if(xn=xn||new Tn,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=xn.get(r);return o||(o=typeof r+":"+q(),xn.set(r,o)),o}(e)+"]":typeof window<"u"&&e instanceof window.Element||e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"?{}:e})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function ct(){return{}}var fn=0,ae=0;function ln(n,t){t===void 0&&(t={});var e=t.thisNamespace,r=e!==void 0&&e,o=t.time,i,a,s=fn;fn+=1;var c=function(){for(var u=arguments.length,l=new Array(u),d=0;d<u;d++)l[d]=arguments[d];s<ae&&(i=null,a=null,s=fn,fn+=1);var f;f=r?(a=a||new Tn).getOrSet(this,ct):i=i||{};var h;try{h=ie(l)}catch{return n.apply(this,arguments)}var W=f[h];if(W&&o&&Date.now()-W.time<o&&(delete f[h],W=null),W)return W.value;var g=Date.now(),y=n.apply(this,arguments);return f[h]={time:g,value:y},y};return c.reset=function(){i=null,a=null},oe(c,(t.name||re(n))+"::memoized")}ln.clear=function(){ae=fn};function st(n){var t={};function e(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=ie(a);return t.hasOwnProperty(c)||(t[c]=x.try(function(){return n.apply(o,r)}).finally(function(){delete t[c]})),t[c]}return e.reset=function(){t={}},oe(e,re(n)+"::promiseMemoized")}function Q(){}function hn(n,t){if(t===void 0&&(t=1),t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if(typeof n=="string")return n;if(n instanceof Error){var e=n&&n.stack,r=n&&n.message;if(e&&r)return e.indexOf(r)!==-1?e:r+`
26
- `+e;if(e)return e;if(r)return r}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+hn(o,t+1)}}function ue(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}ln(function(n){if(Object.values)return Object.values(n);var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(n[e]);return t});function jn(n){return{}.toString.call(n)==="[object RegExp]"}function vn(n,t,e){if(n.hasOwnProperty(t))return n[t];var r=e();return n[t]=r,r}function ce(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function se(){return!!document.body&&document.readyState==="complete"}function de(){return!!document.body&&document.readyState==="interactive"}ln(function(){return new x(function(n){if(se()||de())return n();var t=setInterval(function(){if(se()||de())return clearInterval(t),n()},10)})});var Pn=typeof document<"u"?document.currentScript:null,dt=ln(function(){if(Pn||(Pn=function(){try{var n=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),e=t&&t[1];if(!e)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===e)return i}}catch{}}()))return Pn;throw new Error("Can not determine current script")}),ft=q();ln(function(){var n;try{n=dt()}catch{return ft}var t=n.getAttribute("data-uid");if(t&&typeof t=="string"||(t=n.getAttribute("data-uid-auto"))&&typeof t=="string")return t;if(n.src){var e=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:n.src,dataset:n.dataset}));t="uid_"+e.slice(e.length-30)}else t=q();return n.setAttribute("data-uid-auto",t),t});function wn(n){n===void 0&&(n=window);var t="__post_robot_10_0_46__";return n!==window?n[t]:n[t]=n[t]||{}}var fe=function(){return{}};function j(n,t){return n===void 0&&(n="store"),t===void 0&&(t=fe),vn(wn(),n,function(){var e=t();return{has:function(r){return e.hasOwnProperty(r)},get:function(r,o){return e.hasOwnProperty(r)?e[r]:o},set:function(r,o){return e[r]=o,o},del:function(r){delete e[r]},getOrSet:function(r,o){return vn(e,r,o)},reset:function(){e=t()},keys:function(){return Object.keys(e)}}})}var lt=function(){};function In(){var n=wn();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new lt,n.WINDOW_WILDCARD}function L(n,t){return n===void 0&&(n="store"),t===void 0&&(t=fe),j("windowStore").getOrSet(n,function(){var e=new Tn,r=function(o){return e.getOrSet(o,t)};return{has:function(o){return r(o).hasOwnProperty(n)},get:function(o,i){var a=r(o);return a.hasOwnProperty(n)?a[n]:i},set:function(o,i){return r(o)[n]=i,i},del:function(o){delete r(o)[n]},getOrSet:function(o,i){return vn(r(o),n,i)}}})}function le(){return j("instance").getOrSet("instanceID",q)}function he(n,t){var e=t.domain,r=L("helloPromises"),o=r.get(n);o&&o.resolve({domain:e});var i=x.resolve({domain:e});return r.set(n,i),i}function Mn(n,t){return(0,t.send)(n,"postrobot_hello",{instanceID:le()},{domain:"*",timeout:-1}).then(function(e){var r=e.origin,o=e.data.instanceID;return he(n,{domain:r}),{win:n,domain:r,instanceID:o}})}function ve(n,t){var e=t.send;return L("windowInstanceIDPromises").getOrSet(n,function(){return Mn(n,{send:e}).then(function(r){return r.instanceID})})}function we(n){L("knownWindows").set(n,!0)}function zn(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function me(n){return n===void 0?"undefined":n===null?"null":Array.isArray(n)?"array":typeof n=="function"?"function":typeof n=="object"?n instanceof Error?"error":typeof n.then=="function"?"promise":{}.toString.call(n)==="[object RegExp]"?"regex":{}.toString.call(n)==="[object Date]"?"date":"object":typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":void 0}function nn(n,t){return{__type__:n,__val__:t}}var H,ht=((H={}).function=function(){},H.error=function(n){return nn("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},H.promise=function(){},H.regex=function(n){return nn("regex",n.source)},H.date=function(n){return nn("date",n.toJSON())},H.array=function(n){return n},H.object=function(n){return n},H.string=function(n){return n},H.number=function(n){return n},H.boolean=function(n){return n},H.null=function(n){return n},H[void 0]=function(n){return nn("undefined",n)},H),vt={},U,wt=((U={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},U.error=function(n){var t=n.stack,e=n.code,r=n.data,o=new Error(n.message);return o.code=e,r&&(o.data=r),o.stack=t+`
20
+ `,g}function Fe(v){const g=v.isSandbox??!1;return`${v.developmentUrl||(g?Jn:_n)}/embed/consents/${v.consentTemplateId}`}const Ue="IFRAME_READY",Ge="CONSENT_STATE_CHANGE",Be="IFRAME_HEIGHT_CHANGE";let on=null,an=null,un=null;function $n(){on==null||on.cancel(),on=null,an==null||an.cancel(),an=null,un==null||un.cancel(),un=null}async function _e(v){const{onHeightChange:g,onIframeReady:x,onStateChange:m}=v,p=await Promise.resolve().then(()=>Dn);$n(),on=p.on(Be,async w=>{const S=w.data;g(S.height)}),an=p.on(Ue,async()=>{x()}),un=p.on(Ge,async w=>{const S=w.data;m(S)})}class Je{constructor(g){rn(this,"appearance");rn(this,"options");rn(this,"iframe",null);rn(this,"state",{isSelected:!1,actionToken:null});this.options=g,this.appearance=g.appearance||null,_e({onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onStateChange:this.handleStateChange.bind(this)})}handleHeightChange(g){this.iframe&&(this.iframe.style.height=`${g}px`)}async handleIframeReady(){!this.iframe||!this.appearance||await H(this.iframe,this.appearance)}handleStateChange(g){const{isSelected:x,actionToken:m}=g;this.state={isSelected:x,actionToken:m},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:x,actionToken:m})}mount(g){Me();const x=Le(g),m=Fe(this.options);return this.iframe=He(m),x.appendChild(this.iframe),this}unmount(){$n(),this.iframe&&(this.iframe.remove(),this.iframe=null)}getState(){return{...this.state}}}const $e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function qe(v){let g="widget/";return"disclosureRequestId"in v.configProps?g+=["disclosures",v.configProps.disclosureRequestId].join("/"):g+=v.request,g}function ke(v){const g=v.isSandbox??!1,x=v.developmentUrl||(g?Jn:_n),m=Object.entries(v.configProps).filter(([w,S])=>S||w==="disclosureRequestId").map(([w,S])=>`${w}=${encodeURIComponent(S)}`).join("&"),p=qe(v);return`${x}/${p}?sdk=web&${m}`}const Ze=!!(typeof window<"u"&&window.document&&window.document.createElement);let q=null,On=null;function An(v=null){q&&!q.closed&&q.focus(),v==null||v.preventDefault()}function Rn(){document.body.style.filter="",document.body.removeEventListener("click",An)}function Ye(){On=setInterval(()=>{(!q||q.closed)&&(On&&clearInterval(On),Rn())},ze)}function Ve(v){const g=ke(v),x=Te,m=je,p=window.screenLeft!==void 0?window.screenLeft:window.screenX,w=window.screenTop!==void 0?window.screenTop:window.screenY,S=window.innerWidth||document.documentElement.clientWidth||window.screen.width,J=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Z=S/window.screen.availWidth,en=(S-x)/2/Z+p,k=(J-m)/2/Z+w;document.body.style.filter="blur(5px)",document.body.addEventListener("click",An),q=window.open(g,"Soyio",`scrollbars=yes,
21
+ width=${x},
22
+ height=${m},
23
+ top=${k},
24
+ left=${en}`),An(),Ye()}function Xe(){q&&(q.close(),q=null),Rn()}const Ke="WIDGET_EVENT";let cn=null;function Qe(){cn&&(cn.cancel(),cn=null)}async function nt(v){const{onEvent:g}=v,x=await Promise.resolve().then(()=>Dn);cn&&Qe(),cn=x.on(Ke,async m=>{g(m.data),Ce.includes(m.data.eventName)?Xe():m.data.eventName===Ne&&Rn()})}function et(v){nt(v)}class qn{constructor(g){Ae(this,gn);rn(this,"onEvent");this.onEvent=g.onEvent,Ze&&(Ve(g),et({onEvent:Re(this,gn,De).bind(this)}))}}gn=new WeakSet,De=function(g){this.onEvent(g)};var tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}var kn={exports:{}},Zn={exports:{}};(function(v,g){(function(x,m){v.exports=m()})(typeof self<"u"?self:tt,function(){return function(x){var m={};function p(w){if(m[w])return m[w].exports;var S=m[w]={i:w,l:!1,exports:{}};return x[w].call(S.exports,S,S.exports,p),S.l=!0,S.exports}return p.m=x,p.c=m,p.d=function(w,S,J){p.o(w,S)||Object.defineProperty(w,S,{enumerable:!0,get:J})},p.r=function(w){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},p.t=function(w,S){if(1&S&&(w=p(w)),8&S||4&S&&typeof w=="object"&&w&&w.__esModule)return w;var J=Object.create(null);if(p.r(J),Object.defineProperty(J,"default",{enumerable:!0,value:w}),2&S&&typeof w!="string")for(var Z in w)p.d(J,Z,(function(en){return w[en]}).bind(null,Z));return J},p.n=function(w){var S=w&&w.__esModule?function(){return w.default}:function(){return w};return p.d(S,"a",S),S},p.o=function(w,S){return{}.hasOwnProperty.call(w,S)},p.p="",p(p.s=0)}([function(x,m,p){p.r(m),p.d(m,"Promise",function(){return P}),p.d(m,"TYPES",function(){return It}),p.d(m,"ProxyWindow",function(){return G}),p.d(m,"setup",function(){return Oe}),p.d(m,"destroy",function(){return Pt}),p.d(m,"serializeMessage",function(){return Wt}),p.d(m,"deserializeMessage",function(){return St}),p.d(m,"createProxyWindow",function(){return bt}),p.d(m,"toProxyWindow",function(){return xt}),p.d(m,"on",function(){return Y}),p.d(m,"once",function(){return Et}),p.d(m,"send",function(){return V}),p.d(m,"markWindowKnown",function(){return we}),p.d(m,"cleanUpWindow",function(){return Ot}),p.d(m,"bridge",function(){});function w(n){return{}.toString.call(n)==="[object RegExp]"}var S=`Call was rejected by callee.\r
25
+ `;function J(n){return n===void 0&&(n=window),n.location.protocol}function Z(n){if(n===void 0&&(n=window),n.mockDomain){var t=n.mockDomain.split("//")[0];if(t)return t}return J(n)}function en(n){return n===void 0&&(n=window),Z(n)==="about:"}function k(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function Vn(n){if(n===void 0&&(n=window),n&&!k(n))try{return n.opener}catch{}}function yn(n){try{return!0}catch{}return!1}function En(n){n===void 0&&(n=window);var t=n.location;if(!t)throw new Error("Can not read window location");var e=J(n);if(!e)throw new Error("Can not read window protocol");if(e==="file:")return"file://";if(e==="about:"){var r=k(n);return r&&yn()?En(r):"about://"}var o=t.host;if(!o)throw new Error("Can not read window host");return e+"//"+o}function M(n){n===void 0&&(n=window);var t=En(n);return t&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:t}function X(n){if(!function(t){try{if(t===window)return!0}catch{}try{var e=Object.getOwnPropertyDescriptor(t,"location");if(e&&e.enumerable===!1)return!1}catch{}try{if(en(t)&&yn())return!0}catch{}try{if(function(r){return r===void 0&&(r=window),Z(r)==="mock:"}(t)&&yn())return!0}catch{}try{if(En(t)===En(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||en(n)&&yn()||M(window)===M(n))return!0}catch{}return!1}function Wn(n){if(!X(n))throw new Error("Expected window to be same domain");return n}function Xn(n,t){if(!n||!t)return!1;var e=k(t);return e?e===n:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch{}return o}(t).indexOf(n)!==-1}function Kn(n){var t=[],e;try{e=n.frames}catch{e=n}var r;try{r=e.length}catch{}if(r===0)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=e[o]}catch{continue}t.push(i)}return t}for(var a=0;a<100;a++){var s=void 0;try{s=e[a]}catch{return t}if(!s)return t;t.push(s)}return t}var it=[],at=[];function B(n,t){t===void 0&&(t=!0);try{if(n===window)return!1}catch{return!0}try{if(!n)return!0}catch{return!0}try{if(n.closed)return!0}catch(o){return!o||o.message!==S}if(t&&X(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var e=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(it,n);if(e!==-1){var r=at[e];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function Qn(n){return n===void 0&&(n=window),Vn(n=n||window)||k(n)||void 0}function tn(n,t){if(typeof n=="string"){if(typeof t=="string")return n==="*"||t===n;if(w(t)||Array.isArray(t))return!1}return w(n)?w(t)?n.toString()===t.toString():!Array.isArray(t)&&!!t.match(n):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!w(t)&&n.some(function(e){return tn(e,t)}))}function Sn(n){try{if(n===window)return!0}catch(t){if(t&&t.message===S)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(t){if(t&&t.message===S)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.self===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.parent===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.top===n)return!0}catch(t){if(t&&t.message===S)return!0}try{if(n&&n.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch{}return!1}function ne(n){if(X(n))return Wn(n).frameElement;for(var t=0,e=document.querySelectorAll("iframe");t<e.length;t++){var r=e[t];if(r&&r.contentWindow&&r.contentWindow===n)return r}}function ut(n){if(function(e){return e===void 0&&(e=window),!!k(e)}(n)){var t=ne(n);if(t&&t.parentElement){t.parentElement.removeChild(t);return}}try{n.close()}catch{}}function K(n){try{if(!n)return!1;if(typeof Promise<"u"&&n instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&n instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var e=t.call(n);if(e==="[object Window]"||e==="[object global]"||e==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var ee=[],sn=[],Cn=0,dn;function te(){if(!Cn&&dn){var n=dn;dn=null,n.resolve()}}function Nn(){Cn+=1}function fn(){Cn-=1,te()}var P=function(){function n(e){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],e){var o,i,a=!1,s=!1,c=!1;Nn();try{e(function(u){c?r.resolve(u):(a=!0,o=u)},function(u){c?r.reject(u):(s=!0,i=u)})}catch(u){fn(),this.reject(u);return}fn(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var t=n.prototype;return t.resolve=function(e){if(this.resolved||this.rejected)return this;if(K(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},t.reject=function(e){var r=this;if(this.resolved||this.rejected)return this;if(K(e))throw new Error("Can not reject promise with another promise");if(!e){var o=e&&typeof e.toString=="function"?e.toString():{}.toString.call(e);e=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(ee.indexOf(i)===-1){ee.push(i),setTimeout(function(){throw i},1);for(var s=0;s<sn.length;s++)sn[s](i,a)}}(e,r)},1),this.dispatch(),this},t.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},t.dispatch=function(){var e=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(e||r)){this.dispatching=!0,Nn();for(var i=function(h,W){return h.then(function(y){W.resolve(y)},function(y){W.reject(y)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,l=s.promise,d=void 0;if(e)try{d=c?c(this.value):this.value}catch(h){l.reject(h);continue}else if(r){if(!u){l.reject(this.error);continue}try{d=u(this.error)}catch(h){l.reject(h);continue}}if(d instanceof n&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else K(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}o.length=0,this.dispatching=!1,fn()}},t.then=function(e,r){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:e,onError:r}),this.errorHandled=!0,this.dispatch(),o},t.catch=function(e){return this.then(void 0,e)},t.finally=function(e){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return n.try(e).then(function(){return r})},function(r){return n.try(e).then(function(){throw r})})},t.timeout=function(e,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(a){return clearTimeout(i),a})},t.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},t.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(e){return e instanceof n?e:K(e)?new n(function(r,o){return e.then(r,o)}):new n().resolve(e)},n.reject=function(e){return new n().reject(e)},n.asyncReject=function(e){return new n().asyncReject(e)},n.all=function(e){var r=new n,o=e.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(u,l,d){return l.then(function(f){i[u]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},s=0;s<e.length;s++){var c=e[s];if(c instanceof n){if(c.resolved){i[s]=c.value,o-=1;continue}}else if(!K(c)){i[s]=c,o-=1;continue}a(s,n.resolve(c),r)}return o===0&&r.resolve(i),r},n.hash=function(e){var r={},o=[],i=function(s){if(e.hasOwnProperty(s)){var c=e[s];K(c)?o.push(c.then(function(u){r[s]=u})):r[s]=c}};for(var a in e)i(a);return n.all(o).then(function(){return r})},n.map=function(e,r){return n.all(e.map(r))},n.onPossiblyUnhandledException=function(e){return function(r){return sn.push(r),{cancel:function(){sn.splice(sn.indexOf(r),1)}}}(e)},n.try=function(e,r,o){if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.try expected a function");var i;Nn();try{i=e.apply(r,o||[])}catch(a){return fn(),n.reject(a)}return fn(),n.resolve(i)},n.delay=function(e){return new n(function(r){setTimeout(r,e)})},n.isPromise=function(e){return!!(e&&e instanceof n)||K(e)},n.flush=function(){return function(e){var r=dn=dn||new e;return te(),r}(n)},n}();function bn(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch{}return-1}var Tn=function(){function n(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var e=new WeakMap,r={};return Object.freeze(r),e.set(r,"__testvalue__"),e.get(r)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var t=n.prototype;return t._cleanupClosedWindows=function(){for(var e=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Sn(i)&&B(i)){if(e)try{e.delete(i)}catch{}r.splice(o,1),this.values.splice(o,1),o-=1}}},t.isSafeToReadWrite=function(e){return!Sn(e)},t.set=function(e,r){if(!e)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(e,r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var i=this.name,a=e[i];a&&a[0]===e?a[1]=r:Object.defineProperty(e,i,{value:[e,r],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=bn(s,e);u===-1?(s.push(e),c.push(r)):c[u]=r},t.get=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return r.get(e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];return o&&o[0]===e?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=bn(this.keys,e);if(i!==-1)return this.values[i]},t.delete=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];o&&o[0]===e&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=bn(i,e);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},t.has=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(e))try{var o=e[this.name];return!(!o||o[0]!==e)}catch{}return this._cleanupClosedWindows(),bn(this.keys,e)!==-1},t.getOrSet=function(e,r){if(this.has(e))return this.get(e);var o=r();return this.set(e,o),o},n}();function re(n){return n.name||n.__name__||n.displayName||"anonymous"}function oe(n,t){try{delete n.name,n.name=t}catch{}return n.__name__=n.displayName=t,n}function $(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(t){if(typeof btoa=="function")return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(t,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var xn;function ie(n){try{return JSON.stringify([].slice.call(n),function(t,e){return typeof e=="function"?"memoize["+function(r){if(xn=xn||new Tn,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=xn.get(r);return o||(o=typeof r+":"+$(),xn.set(r,o)),o}(e)+"]":typeof window<"u"&&e instanceof window.Element||e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"?{}:e})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function ct(){return{}}var ln=0,ae=0;function hn(n,t){t===void 0&&(t={});var e=t.thisNamespace,r=e!==void 0&&e,o=t.time,i,a,s=ln;ln+=1;var c=function(){for(var u=arguments.length,l=new Array(u),d=0;d<u;d++)l[d]=arguments[d];s<ae&&(i=null,a=null,s=ln,ln+=1);var f;f=r?(a=a||new Tn).getOrSet(this,ct):i=i||{};var h;try{h=ie(l)}catch{return n.apply(this,arguments)}var W=f[h];if(W&&o&&Date.now()-W.time<o&&(delete f[h],W=null),W)return W.value;var y=Date.now(),E=n.apply(this,arguments);return f[h]={time:y,value:E},E};return c.reset=function(){i=null,a=null},oe(c,(t.name||re(n))+"::memoized")}hn.clear=function(){ae=ln};function st(n){var t={};function e(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=ie(a);return t.hasOwnProperty(c)||(t[c]=P.try(function(){return n.apply(o,r)}).finally(function(){delete t[c]})),t[c]}return e.reset=function(){t={}},oe(e,re(n)+"::promiseMemoized")}function Q(){}function vn(n,t){if(t===void 0&&(t=1),t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if(typeof n=="string")return n;if(n instanceof Error){var e=n&&n.stack,r=n&&n.message;if(e&&r)return e.indexOf(r)!==-1?e:r+`
26
+ `+e;if(e)return e;if(r)return r}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+vn(o,t+1)}}function ue(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}hn(function(n){if(Object.values)return Object.values(n);var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(n[e]);return t});function jn(n){return{}.toString.call(n)==="[object RegExp]"}function wn(n,t,e){if(n.hasOwnProperty(t))return n[t];var r=e();return n[t]=r,r}function ce(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function se(){return!!document.body&&document.readyState==="complete"}function de(){return!!document.body&&document.readyState==="interactive"}hn(function(){return new P(function(n){if(se()||de())return n();var t=setInterval(function(){if(se()||de())return clearInterval(t),n()},10)})});var Pn=typeof document<"u"?document.currentScript:null,dt=hn(function(){if(Pn||(Pn=function(){try{var n=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),e=t&&t[1];if(!e)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===e)return i}}catch{}}()))return Pn;throw new Error("Can not determine current script")}),ft=$();hn(function(){var n;try{n=dt()}catch{return ft}var t=n.getAttribute("data-uid");if(t&&typeof t=="string"||(t=n.getAttribute("data-uid-auto"))&&typeof t=="string")return t;if(n.src){var e=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:n.src,dataset:n.dataset}));t="uid_"+e.slice(e.length-30)}else t=$();return n.setAttribute("data-uid-auto",t),t});function mn(n){n===void 0&&(n=window);var t="__post_robot_10_0_46__";return n!==window?n[t]:n[t]=n[t]||{}}var fe=function(){return{}};function j(n,t){return n===void 0&&(n="store"),t===void 0&&(t=fe),wn(mn(),n,function(){var e=t();return{has:function(r){return e.hasOwnProperty(r)},get:function(r,o){return e.hasOwnProperty(r)?e[r]:o},set:function(r,o){return e[r]=o,o},del:function(r){delete e[r]},getOrSet:function(r,o){return wn(e,r,o)},reset:function(){e=t()},keys:function(){return Object.keys(e)}}})}var lt=function(){};function In(){var n=mn();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new lt,n.WINDOW_WILDCARD}function L(n,t){return n===void 0&&(n="store"),t===void 0&&(t=fe),j("windowStore").getOrSet(n,function(){var e=new Tn,r=function(o){return e.getOrSet(o,t)};return{has:function(o){return r(o).hasOwnProperty(n)},get:function(o,i){var a=r(o);return a.hasOwnProperty(n)?a[n]:i},set:function(o,i){return r(o)[n]=i,i},del:function(o){delete r(o)[n]},getOrSet:function(o,i){return wn(r(o),n,i)}}})}function le(){return j("instance").getOrSet("instanceID",$)}function he(n,t){var e=t.domain,r=L("helloPromises"),o=r.get(n);o&&o.resolve({domain:e});var i=P.resolve({domain:e});return r.set(n,i),i}function zn(n,t){return(0,t.send)(n,"postrobot_hello",{instanceID:le()},{domain:"*",timeout:-1}).then(function(e){var r=e.origin,o=e.data.instanceID;return he(n,{domain:r}),{win:n,domain:r,instanceID:o}})}function ve(n,t){var e=t.send;return L("windowInstanceIDPromises").getOrSet(n,function(){return zn(n,{send:e}).then(function(r){return r.instanceID})})}function we(n){L("knownWindows").set(n,!0)}function Mn(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function me(n){return n===void 0?"undefined":n===null?"null":Array.isArray(n)?"array":typeof n=="function"?"function":typeof n=="object"?n instanceof Error?"error":typeof n.then=="function"?"promise":{}.toString.call(n)==="[object RegExp]"?"regex":{}.toString.call(n)==="[object Date]"?"date":"object":typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":void 0}function nn(n,t){return{__type__:n,__val__:t}}var F,ht=((F={}).function=function(){},F.error=function(n){return nn("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},F.promise=function(){},F.regex=function(n){return nn("regex",n.source)},F.date=function(n){return nn("date",n.toJSON())},F.array=function(n){return n},F.object=function(n){return n},F.string=function(n){return n},F.number=function(n){return n},F.boolean=function(n){return n},F.null=function(n){return n},F[void 0]=function(n){return nn("undefined",n)},F),vt={},U,wt=((U={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},U.error=function(n){var t=n.stack,e=n.code,r=n.data,o=new Error(n.message);return o.code=e,r&&(o.data=r),o.stack=t+`
27
27
 
28
- `+o.stack,o},U.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},U.regex=function(n){return new RegExp(n)},U.date=function(n){return new Date(n)},U.array=function(n){return n},U.object=function(n){return n},U.string=function(n){return n},U.number=function(n){return n},U.boolean=function(n){return n},U.null=function(n){return n},U[void 0]=function(){},U),mt={};new x(function(n){if(window.document&&window.document.body)return n(window.document.body);var t=setInterval(function(){if(window.document&&window.document.body)return clearInterval(t),n(window.document.body)},10)});function Ln(){for(var n=j("idToProxyWindow"),t=0,e=n.keys();t<e.length;t++){var r=e[t];n.get(r).shouldClean()&&n.del(r)}}function pe(n,t){var e=t.send,r=t.id,o=r===void 0?q():r,i=n.then(function(c){if(X(c))return Wn(c).name}),a=n.then(function(c){if(G(c))throw new Error("Window is closed, can not determine type");return kn(c)?"popup":"iframe"});i.catch(Q),a.catch(Q);var s=function(){return n.then(function(c){if(!G(c))return X(c)?Wn(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:st(function(){return n.then(function(c){return ve(c,{send:e})})}),close:function(){return n.then(ut)},getName:s,focus:function(){return n.then(function(c){c.focus()})},isClosed:function(){return n.then(function(c){return G(c)})},setLocation:function(c,u){return u===void 0&&(u={}),n.then(function(l){var d=window.location.protocol+"//"+window.location.host,f=u.method,h=f===void 0?"get":f,W=u.body;if(c.indexOf("/")===0)c=""+d+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(h==="post")return s().then(function(g){if(!g)throw new Error("Can not post to window without target name");(function(y){var I=y.url,T=y.target,A=y.body,O=y.method,M=O===void 0?"post":O,b=document.createElement("form");if(b.setAttribute("target",T),b.setAttribute("method",M),b.setAttribute("action",I),b.style.display="none",A)for(var R=0,_=Object.keys(A);R<_.length;R++){var C,mn=_[R],Bn=document.createElement("input");Bn.setAttribute("name",mn),Bn.setAttribute("value",(C=A[mn])==null?void 0:C.toString()),b.appendChild(Bn)}ce().appendChild(b),b.submit(),ce().removeChild(b)})({url:c,target:g,method:h,body:W})});if(h!=="get")throw new Error("Unsupported method: "+h);if(X(l))try{if(l.location&&typeof l.location.replace=="function"){l.location.replace(c);return}}catch{}l.location=c})},setName:function(c){return n.then(function(u){var l=X(u),d=ne(u);if(!l)throw new Error("Can not set name for cross-domain window: "+c);Wn(u).name=c,d&&d.setAttribute("name",c),i=x.resolve(c)})}}}var B=function(){function n(e){var r=e.send,o=e.win,i=e.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new x,this.serializedWindow=i||pe(this.actualWindowPromise,{send:r}),j("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var t=n.prototype;return t.getID=function(){return this.serializedWindow.id},t.getType=function(){return this.serializedWindow.getType()},t.isPopup=function(){return this.getType().then(function(e){return e==="popup"})},t.setLocation=function(e,r){var o=this;return this.serializedWindow.setLocation(e,r).then(function(){return o})},t.getName=function(){return this.serializedWindow.getName()},t.setName=function(e){var r=this;return this.serializedWindow.setName(e).then(function(){return r})},t.close=function(){var e=this;return this.serializedWindow.close().then(function(){return e})},t.focus=function(){var e=this,r=this.isPopup(),o=this.getName(),i=x.hash({isPopup:r,name:o}).then(function(s){var c=s.name;s.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return x.all([i,a]).then(function(){return e})},t.isClosed=function(){return this.serializedWindow.isClosed()},t.getWindow=function(){return this.actualWindow},t.setWindow=function(e,r){var o=r.send;this.actualWindow=e,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=pe(this.actualWindowPromise,{send:o,id:this.getID()}),L("winToProxyWindow").set(e,this)},t.awaitWindow=function(){return this.actualWindowPromise},t.matchWindow=function(e,r){var o=this,i=r.send;return x.try(function(){return o.actualWindow?e===o.actualWindow:x.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:ve(e,{send:i})}).then(function(a){var s=a.proxyInstanceID===a.knownWindowInstanceID;return s&&o.setWindow(e,{send:i}),s})})},t.unwrap=function(){return this.actualWindow||this},t.getInstanceID=function(){return this.serializedWindow.getInstanceID()},t.shouldClean=function(){return!!(this.actualWindow&&G(this.actualWindow))},t.serialize=function(){return this.serializedWindow},n.unwrap=function(e){return n.isProxyWindow(e)?e.unwrap():e},n.serialize=function(e,r){var o=r.send;return Ln(),n.toProxyWindow(e,{send:o}).serialize()},n.deserialize=function(e,r){var o=r.send;return Ln(),j("idToProxyWindow").get(e.id)||new n({serializedWindow:e,send:o})},n.isProxyWindow=function(e){return!!(e&&!Sn(e)&&e.isProxyWindow)},n.toProxyWindow=function(e,r){var o=r.send;if(Ln(),n.isProxyWindow(e))return e;var i=e;return L("winToProxyWindow").get(i)||new n({win:i,send:o})},n}();function Fn(n,t,e,r,o){var i=L("methodStore"),a=j("proxyWindowMethods");B.isProxyWindow(r)?a.set(n,{val:t,name:e,domain:o,source:r}):(a.del(n),i.getOrSet(r,function(){return{}})[n]={domain:o,name:e,val:t,source:r})}function ge(n,t){var e=L("methodStore"),r=j("proxyWindowMethods");return e.getOrSet(n,function(){return{}})[t]||r.get(t)}function ye(n,t,e,r,o){a=(i={on:o.on,send:o.send}).on,s=i.send,j("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(l){var d=l.source,f=l.origin,h=l.data,W=h.id,g=h.name,y=ge(d,W);if(!y)throw new Error("Could not find method '"+g+"' with id: "+h.id+" in "+z(window));var I=y.source,T=y.domain,A=y.val;return x.try(function(){if(!tn(T,f))throw new Error("Method '"+h.name+"' domain "+JSON.stringify(jn(y.domain)?y.domain.source:y.domain)+" does not match origin "+f+" in "+z(window));if(B.isProxyWindow(I))return I.matchWindow(d,{send:s}).then(function(O){if(!O)throw new Error("Method call '"+h.name+"' failed - proxy window does not match source in "+z(window))})}).then(function(){return A.apply({source:d,origin:f},h.args)},function(O){return x.try(function(){if(A.onError)return A.onError(O)}).then(function(){throw O.stack&&(O.stack="Remote call to "+g+"("+function(M){return M===void 0&&(M=[]),(b=M,[].slice.call(b)).map(function(R){return typeof R=="string"?"'"+R+"'":R===void 0?"undefined":R===null?"null":typeof R=="boolean"?R.toString():Array.isArray(R)?"[ ... ]":typeof R=="object"?"{ ... }":typeof R=="function"?"() => { ... }":"<"+typeof R+">"}).join(", ");var b}(h.args)+`) failed
28
+ `+o.stack,o},U.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},U.regex=function(n){return new RegExp(n)},U.date=function(n){return new Date(n)},U.array=function(n){return n},U.object=function(n){return n},U.string=function(n){return n},U.number=function(n){return n},U.boolean=function(n){return n},U.null=function(n){return n},U[void 0]=function(){},U),mt={};new P(function(n){if(window.document&&window.document.body)return n(window.document.body);var t=setInterval(function(){if(window.document&&window.document.body)return clearInterval(t),n(window.document.body)},10)});function Ln(){for(var n=j("idToProxyWindow"),t=0,e=n.keys();t<e.length;t++){var r=e[t];n.get(r).shouldClean()&&n.del(r)}}function pe(n,t){var e=t.send,r=t.id,o=r===void 0?$():r,i=n.then(function(c){if(X(c))return Wn(c).name}),a=n.then(function(c){if(B(c))throw new Error("Window is closed, can not determine type");return Vn(c)?"popup":"iframe"});i.catch(Q),a.catch(Q);var s=function(){return n.then(function(c){if(!B(c))return X(c)?Wn(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:st(function(){return n.then(function(c){return ve(c,{send:e})})}),close:function(){return n.then(ut)},getName:s,focus:function(){return n.then(function(c){c.focus()})},isClosed:function(){return n.then(function(c){return B(c)})},setLocation:function(c,u){return u===void 0&&(u={}),n.then(function(l){var d=window.location.protocol+"//"+window.location.host,f=u.method,h=f===void 0?"get":f,W=u.body;if(c.indexOf("/")===0)c=""+d+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(h==="post")return s().then(function(y){if(!y)throw new Error("Can not post to window without target name");(function(E){var I=E.url,T=E.target,A=E.body,O=E.method,z=O===void 0?"post":O,b=document.createElement("form");if(b.setAttribute("target",T),b.setAttribute("method",z),b.setAttribute("action",I),b.style.display="none",A)for(var R=0,_=Object.keys(A);R<_.length;R++){var N,pn=_[R],Gn=document.createElement("input");Gn.setAttribute("name",pn),Gn.setAttribute("value",(N=A[pn])==null?void 0:N.toString()),b.appendChild(Gn)}ce().appendChild(b),b.submit(),ce().removeChild(b)})({url:c,target:y,method:h,body:W})});if(h!=="get")throw new Error("Unsupported method: "+h);if(X(l))try{if(l.location&&typeof l.location.replace=="function"){l.location.replace(c);return}}catch{}l.location=c})},setName:function(c){return n.then(function(u){var l=X(u),d=ne(u);if(!l)throw new Error("Can not set name for cross-domain window: "+c);Wn(u).name=c,d&&d.setAttribute("name",c),i=P.resolve(c)})}}}var G=function(){function n(e){var r=e.send,o=e.win,i=e.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new P,this.serializedWindow=i||pe(this.actualWindowPromise,{send:r}),j("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var t=n.prototype;return t.getID=function(){return this.serializedWindow.id},t.getType=function(){return this.serializedWindow.getType()},t.isPopup=function(){return this.getType().then(function(e){return e==="popup"})},t.setLocation=function(e,r){var o=this;return this.serializedWindow.setLocation(e,r).then(function(){return o})},t.getName=function(){return this.serializedWindow.getName()},t.setName=function(e){var r=this;return this.serializedWindow.setName(e).then(function(){return r})},t.close=function(){var e=this;return this.serializedWindow.close().then(function(){return e})},t.focus=function(){var e=this,r=this.isPopup(),o=this.getName(),i=P.hash({isPopup:r,name:o}).then(function(s){var c=s.name;s.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return P.all([i,a]).then(function(){return e})},t.isClosed=function(){return this.serializedWindow.isClosed()},t.getWindow=function(){return this.actualWindow},t.setWindow=function(e,r){var o=r.send;this.actualWindow=e,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=pe(this.actualWindowPromise,{send:o,id:this.getID()}),L("winToProxyWindow").set(e,this)},t.awaitWindow=function(){return this.actualWindowPromise},t.matchWindow=function(e,r){var o=this,i=r.send;return P.try(function(){return o.actualWindow?e===o.actualWindow:P.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:ve(e,{send:i})}).then(function(a){var s=a.proxyInstanceID===a.knownWindowInstanceID;return s&&o.setWindow(e,{send:i}),s})})},t.unwrap=function(){return this.actualWindow||this},t.getInstanceID=function(){return this.serializedWindow.getInstanceID()},t.shouldClean=function(){return!!(this.actualWindow&&B(this.actualWindow))},t.serialize=function(){return this.serializedWindow},n.unwrap=function(e){return n.isProxyWindow(e)?e.unwrap():e},n.serialize=function(e,r){var o=r.send;return Ln(),n.toProxyWindow(e,{send:o}).serialize()},n.deserialize=function(e,r){var o=r.send;return Ln(),j("idToProxyWindow").get(e.id)||new n({serializedWindow:e,send:o})},n.isProxyWindow=function(e){return!!(e&&!Sn(e)&&e.isProxyWindow)},n.toProxyWindow=function(e,r){var o=r.send;if(Ln(),n.isProxyWindow(e))return e;var i=e;return L("winToProxyWindow").get(i)||new n({win:i,send:o})},n}();function Hn(n,t,e,r,o){var i=L("methodStore"),a=j("proxyWindowMethods");G.isProxyWindow(r)?a.set(n,{val:t,name:e,domain:o,source:r}):(a.del(n),i.getOrSet(r,function(){return{}})[n]={domain:o,name:e,val:t,source:r})}function ge(n,t){var e=L("methodStore"),r=j("proxyWindowMethods");return e.getOrSet(n,function(){return{}})[t]||r.get(t)}function ye(n,t,e,r,o){a=(i={on:o.on,send:o.send}).on,s=i.send,j("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(l){var d=l.source,f=l.origin,h=l.data,W=h.id,y=h.name,E=ge(d,W);if(!E)throw new Error("Could not find method '"+y+"' with id: "+h.id+" in "+M(window));var I=E.source,T=E.domain,A=E.val;return P.try(function(){if(!tn(T,f))throw new Error("Method '"+h.name+"' domain "+JSON.stringify(jn(E.domain)?E.domain.source:E.domain)+" does not match origin "+f+" in "+M(window));if(G.isProxyWindow(I))return I.matchWindow(d,{send:s}).then(function(O){if(!O)throw new Error("Method call '"+h.name+"' failed - proxy window does not match source in "+M(window))})}).then(function(){return A.apply({source:d,origin:f},h.args)},function(O){return P.try(function(){if(A.onError)return A.onError(O)}).then(function(){throw O.stack&&(O.stack="Remote call to "+y+"("+function(z){return z===void 0&&(z=[]),(b=z,[].slice.call(b)).map(function(R){return typeof R=="string"?"'"+R+"'":R===void 0?"undefined":R===null?"null":typeof R=="boolean"?R.toString():Array.isArray(R)?"[ ... ]":typeof R=="object"?"{ ... }":typeof R=="function"?"() => { ... }":"<"+typeof R+">"}).join(", ");var b}(h.args)+`) failed
29
29
 
30
- `+O.stack),O})}).then(function(O){return{result:O,id:W,name:g}})})});var i,a,s,c=e.__id__||q();n=B.unwrap(n);var u=e.__name__||e.name||r;return typeof u=="string"&&typeof u.indexOf=="function"&&u.indexOf("anonymous::")===0&&(u=u.replace("anonymous::",r+"::")),B.isProxyWindow(n)?(Fn(c,e,u,n,t),n.awaitWindow().then(function(l){Fn(c,e,u,l,t)})):Fn(c,e,u,n,t),nn("cross_domain_function",{id:c,name:u})}function Ee(n,t,e,r){var o,i=r.on,a=r.send;return function(s,c){c===void 0&&(c=vt);var u=JSON.stringify(s,function(l){var d=this[l];if(zn(this))return d;var f=me(d);if(!f)return d;var h=c[f]||ht[f];return h?h(d,l):d});return u===void 0?"undefined":u}(e,((o={}).promise=function(s,c){return function(u,l,d,f,h){return nn("cross_domain_zalgo_promise",{then:ye(u,l,function(W,g){return d.then(W,g)},f,{on:h.on,send:h.send})})}(n,t,s,c,{on:i,send:a})},o.function=function(s,c){return ye(n,t,s,c,{on:i,send:a})},o.object=function(s){return Sn(s)||B.isProxyWindow(s)?nn("cross_domain_window",B.serialize(s,{send:a})):s},o))}function We(n,t,e,r){var o,i=r.send;return function(a,s){if(s===void 0&&(s=mt),a!=="undefined")return JSON.parse(a,function(c,u){if(zn(this))return u;var l,d;if(zn(u)?(l=u.__type__,d=u.__val__):(l=me(u),d=u),!l)return d;var f=s[l]||wt[l];return f?f(d,c):d})}(e,((o={}).cross_domain_zalgo_promise=function(a){return function(s,c,u){return new x(u.then)}(0,0,a)},o.cross_domain_function=function(a){return function(s,c,u,l){var d=u.id,f=u.name,h=l.send,W=function(y){y===void 0&&(y={});function I(){var T=arguments;return B.toProxyWindow(s,{send:h}).awaitWindow().then(function(A){var O=ge(A,d);if(O&&O.val!==I)return O.val.apply({source:window,origin:z()},T);var M=[].slice.call(T);return y.fireAndForget?h(A,"postrobot_method",{id:d,name:f,args:M},{domain:c,fireAndForget:!0}):h(A,"postrobot_method",{id:d,name:f,args:M},{domain:c,fireAndForget:!1}).then(function(b){return b.data.result})}).catch(function(A){throw A})}return I.__name__=f,I.__origin__=c,I.__source__=s,I.__id__=d,I.origin=c,I},g=W();return g.fireAndForget=W({fireAndForget:!0}),g}(n,t,a,{send:i})},o.cross_domain_window=function(a){return B.deserialize(a,{send:i})},o))}var Hn={};Hn.postrobot_post_message=function(n,t,e){e.indexOf("file:")===0&&(e="*"),n.postMessage(t,e)};function Un(n,t,e,r){var o=r.on,i=r.send;return x.try(function(){var a=L().getOrSet(n,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(e),a.flush=a.flush||x.flush().then(function(){if(G(n))throw new Error("Window is closed");var s=Ee(n,t,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var u=Object.keys(Hn),l=[],d=0;d<u.length;d++){var f=u[d];try{Hn[f](n,s,t)}catch(h){l.push(h)}}if(l.length===u.length)throw new Error(`All post-robot messaging strategies failed:
30
+ `+O.stack),O})}).then(function(O){return{result:O,id:W,name:y}})})});var i,a,s,c=e.__id__||$();n=G.unwrap(n);var u=e.__name__||e.name||r;return typeof u=="string"&&typeof u.indexOf=="function"&&u.indexOf("anonymous::")===0&&(u=u.replace("anonymous::",r+"::")),G.isProxyWindow(n)?(Hn(c,e,u,n,t),n.awaitWindow().then(function(l){Hn(c,e,u,l,t)})):Hn(c,e,u,n,t),nn("cross_domain_function",{id:c,name:u})}function Ee(n,t,e,r){var o,i=r.on,a=r.send;return function(s,c){c===void 0&&(c=vt);var u=JSON.stringify(s,function(l){var d=this[l];if(Mn(this))return d;var f=me(d);if(!f)return d;var h=c[f]||ht[f];return h?h(d,l):d});return u===void 0?"undefined":u}(e,((o={}).promise=function(s,c){return function(u,l,d,f,h){return nn("cross_domain_zalgo_promise",{then:ye(u,l,function(W,y){return d.then(W,y)},f,{on:h.on,send:h.send})})}(n,t,s,c,{on:i,send:a})},o.function=function(s,c){return ye(n,t,s,c,{on:i,send:a})},o.object=function(s){return Sn(s)||G.isProxyWindow(s)?nn("cross_domain_window",G.serialize(s,{send:a})):s},o))}function We(n,t,e,r){var o,i=r.send;return function(a,s){if(s===void 0&&(s=mt),a!=="undefined")return JSON.parse(a,function(c,u){if(Mn(this))return u;var l,d;if(Mn(u)?(l=u.__type__,d=u.__val__):(l=me(u),d=u),!l)return d;var f=s[l]||wt[l];return f?f(d,c):d})}(e,((o={}).cross_domain_zalgo_promise=function(a){return function(s,c,u){return new P(u.then)}(0,0,a)},o.cross_domain_function=function(a){return function(s,c,u,l){var d=u.id,f=u.name,h=l.send,W=function(E){E===void 0&&(E={});function I(){var T=arguments;return G.toProxyWindow(s,{send:h}).awaitWindow().then(function(A){var O=ge(A,d);if(O&&O.val!==I)return O.val.apply({source:window,origin:M()},T);var z=[].slice.call(T);return E.fireAndForget?h(A,"postrobot_method",{id:d,name:f,args:z},{domain:c,fireAndForget:!0}):h(A,"postrobot_method",{id:d,name:f,args:z},{domain:c,fireAndForget:!1}).then(function(b){return b.data.result})}).catch(function(A){throw A})}return I.__name__=f,I.__origin__=c,I.__source__=s,I.__id__=d,I.origin=c,I},y=W();return y.fireAndForget=W({fireAndForget:!0}),y}(n,t,a,{send:i})},o.cross_domain_window=function(a){return G.deserialize(a,{send:i})},o))}var Fn={};Fn.postrobot_post_message=function(n,t,e){e.indexOf("file:")===0&&(e="*"),n.postMessage(t,e)};function Un(n,t,e,r){var o=r.on,i=r.send;return P.try(function(){var a=L().getOrSet(n,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(e),a.flush=a.flush||P.flush().then(function(){if(B(n))throw new Error("Window is closed");var s=Ee(n,t,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var u=Object.keys(Fn),l=[],d=0;d<u.length;d++){var f=u[d];try{Fn[f](n,s,t)}catch(h){l.push(h)}}if(l.length===u.length)throw new Error(`All post-robot messaging strategies failed:
31
31
 
32
- `+l.map(function(h,W){return W+". "+hn(h)}).join(`
32
+ `+l.map(function(h,W){return W+". "+vn(h)}).join(`
33
33
 
34
- `))}),a.flush.then(function(){delete a.flush})}).then(Q)}function Se(n){return j("responseListeners").get(n)}function be(n){j("responseListeners").del(n)}function xe(n){return j("erroredResponseListeners").has(n)}function Pe(n){var t=n.name,e=n.win,r=n.domain,o=L("requestListeners");if(e==="*"&&(e=null),r==="*"&&(r=null),!t)throw new Error("Name required to get request listener");for(var i=0,a=[e,In()];i<a.length;i++){var s=a[i];if(s){var c=o.get(s);if(c){var u=c[t];if(u){if(r&&typeof r=="string"){if(u[r])return u[r];if(u.__domain_regex__)for(var l=0,d=u.__domain_regex__;l<d.length;l++){var f=d[l],h=f.listener;if(tn(f.regex,r))return h}}if(u["*"])return u["*"]}}}}}function pt(n,t,e,r){var o=r.on,i=r.send,a=Pe({name:e.name,win:n,domain:t}),s=e.name==="postrobot_method"&&e.data&&typeof e.data.name=="string"?e.data.name+"()":e.name;function c(u,l,d){return x.flush().then(function(){if(!e.fireAndForget&&!G(n))try{return Un(n,t,{id:q(),origin:z(window),type:"postrobot_message_response",hash:e.hash,name:e.name,ack:u,data:l,error:d},{on:o,send:i})}catch(f){throw new Error("Send response message failed for "+s+" in "+z()+`
34
+ `))}),a.flush.then(function(){delete a.flush})}).then(Q)}function Se(n){return j("responseListeners").get(n)}function be(n){j("responseListeners").del(n)}function xe(n){return j("erroredResponseListeners").has(n)}function Pe(n){var t=n.name,e=n.win,r=n.domain,o=L("requestListeners");if(e==="*"&&(e=null),r==="*"&&(r=null),!t)throw new Error("Name required to get request listener");for(var i=0,a=[e,In()];i<a.length;i++){var s=a[i];if(s){var c=o.get(s);if(c){var u=c[t];if(u){if(r&&typeof r=="string"){if(u[r])return u[r];if(u.__domain_regex__)for(var l=0,d=u.__domain_regex__;l<d.length;l++){var f=d[l],h=f.listener;if(tn(f.regex,r))return h}}if(u["*"])return u["*"]}}}}}function pt(n,t,e,r){var o=r.on,i=r.send,a=Pe({name:e.name,win:n,domain:t}),s=e.name==="postrobot_method"&&e.data&&typeof e.data.name=="string"?e.data.name+"()":e.name;function c(u,l,d){return P.flush().then(function(){if(!e.fireAndForget&&!B(n))try{return Un(n,t,{id:$(),origin:M(window),type:"postrobot_message_response",hash:e.hash,name:e.name,ack:u,data:l,error:d},{on:o,send:i})}catch(f){throw new Error("Send response message failed for "+s+" in "+M()+`
35
35
 
36
- `+hn(f))}})}return x.all([x.flush().then(function(){if(!e.fireAndForget&&!G(n))try{return Un(n,t,{id:q(),origin:z(window),type:"postrobot_message_ack",hash:e.hash,name:e.name},{on:o,send:i})}catch(u){throw new Error("Send ack message failed for "+s+" in "+z()+`
36
+ `+vn(f))}})}return P.all([P.flush().then(function(){if(!e.fireAndForget&&!B(n))try{return Un(n,t,{id:$(),origin:M(window),type:"postrobot_message_ack",hash:e.hash,name:e.name},{on:o,send:i})}catch(u){throw new Error("Send ack message failed for "+s+" in "+M()+`
37
37
 
38
- `+hn(u))}}),x.try(function(){if(!a)throw new Error("No handler found for post message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:n,origin:t,data:e.data})}).then(function(u){return c("success",u)},function(u){return c("error",null,u)})]).then(Q).catch(function(u){if(a&&a.handleError)return a.handleError(u);throw u})}function gt(n,t,e){if(!xe(e.hash)){var r=Se(e.hash);if(!r)throw new Error("No handler found for post message ack for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!tn(r.domain,t))throw new Error("Ack origin "+t+" does not match domain "+r.domain.toString());if(n!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function yt(n,t,e){if(!xe(e.hash)){var r=Se(e.hash);if(!r)throw new Error("No handler found for post message response for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!tn(r.domain,t))throw new Error("Response origin "+t+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":w(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(n!==r.win)throw new Error("Response source does not match registered window");be(e.hash),e.ack==="error"?r.promise.reject(e.error):e.ack==="success"&&r.promise.resolve({source:n,origin:t,data:e.data})}}function Ie(n,t){var e=t.on,r=t.send,o=j("receivedMessages");try{if(!window||window.closed||!n.source)return}catch{return}var i=n.source,a=n.origin,s=function(l,d,f,h){var W=h.on,g=h.send,y;try{y=We(d,f,l,{on:W,send:g})}catch{return}if(y&&typeof y=="object"&&y!==null){var I=y.__post_robot_10_0_46__;if(Array.isArray(I))return I}}(n.data,i,a,{on:e,send:r});if(s){we(i);for(var c=0;c<s.length;c++){var u=s[c];if(o.has(u.id)||(o.set(u.id,!0),G(i)&&!u.fireAndForget))return;u.origin.indexOf("file:")===0&&(a="file://");try{u.type==="postrobot_message_request"?pt(i,a,u,{on:e,send:r}):u.type==="postrobot_message_response"?yt(i,a,u):u.type==="postrobot_message_ack"&&gt(i,a,u)}catch(l){setTimeout(function(){throw l},0)}}}}function Y(n,t,e){if(!n)throw new Error("Expected name");if(typeof(t=t||{})=="function"&&(e=t,t={}),!e)throw new Error("Expected handler");var r=function o(i,a){var s=i.name,c=i.win,u=i.domain,l=L("requestListeners");if(!s||typeof s!="string")throw new Error("Name required to add request listener");if(c&&c!=="*"&&B.isProxyWindow(c)){var d=c.awaitWindow().then(function(C){return o({name:s,win:C,domain:u},a)});return{cancel:function(){d.then(function(C){return C.cancel()},Q)}}}var f=c;if(Array.isArray(f)){for(var h=[],W=0,g=f;W<g.length;W++)h.push(o({name:s,domain:u,win:g[W]},a));return{cancel:function(){for(var C=0;C<h.length;C++)h[C].cancel()}}}if(Array.isArray(u)){for(var y=[],I=0,T=u;I<T.length;I++)y.push(o({name:s,win:f,domain:T[I]},a));return{cancel:function(){for(var C=0;C<y.length;C++)y[C].cancel()}}}var A=Pe({name:s,win:f,domain:u});f&&f!=="*"||(f=In());var O=(u=u||"*").toString();if(A)throw f&&u?new Error("Request listener already exists for "+s+" on domain "+u.toString()+" for "+(f===In()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+s+" for "+(f===In()?"wildcard":"specified")+" window"):u?new Error("Request listener already exists for "+s+" on domain "+u.toString()):new Error("Request listener already exists for "+s);var M=l.getOrSet(f,function(){return{}}),b=vn(M,s,function(){return{}}),R,_;return jn(u)?(R=vn(b,"__domain_regex__",function(){return[]})).push(_={regex:u,listener:a}):b[O]=a,{cancel:function(){delete b[O],_&&(R.splice(R.indexOf(_,1)),R.length||delete b.__domain_regex__),Object.keys(b).length||delete M[s],f&&!Object.keys(M).length&&l.del(f)}}}({name:n,win:t.window,domain:t.domain||"*"},{handler:e||t.handler,handleError:t.errorHandler||function(o){throw o}});return{cancel:function(){r.cancel()}}}function Et(n,t,e){typeof(t=t||{})=="function"&&(e=t,t={});var r=new x,o;return t.errorHandler=function(i){o.cancel(),r.reject(i)},o=Y(n,t,function(i){if(o.cancel(),r.resolve(i),e)return e(i)}),r.cancel=o.cancel,r}var k=function n(t,e,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,s=o.timeout||5e3,c=o.fireAndForget||!1;return B.toProxyWindow(t,{send:n}).awaitWindow().then(function(u){return x.try(function(){if(function(l,d,f){if(!l)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!jn(f))throw new TypeError("Can not send "+l+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if(G(d))throw new Error("Can not send "+l+". Target window is closed")}(e,u,i),function(l,d){var f=Qn(d);if(f)return f===l;if(d===l||function(g){g===void 0&&(g=window);try{if(g.top)return g.top}catch{}if(V(g)===g)return g;try{if(Xn(window,g)&&window.top)return window.top}catch{}try{if(Xn(g,window)&&window.top)return window.top}catch{}for(var y=0,I=function A(O){for(var M=[],b=0,R=Kn(O);b<R.length;b++){var _=R[b];M.push(_);for(var C=0,mn=A(_);C<mn.length;C++)M.push(mn[C])}return M}(g);y<I.length;y++){var T=I[y];try{if(T.top)return T.top}catch{}if(V(T)===T)return T}}(d)===d)return!1;for(var h=0,W=Kn(l);h<W.length;h++)if(W[h]===d)return!0;return!1}(window,u))return function(l,d,f){d===void 0&&(d=5e3),f===void 0&&(f="Window");var h=function(W){return L("helloPromises").getOrSet(W,function(){return new x})}(l);return d!==-1&&(h=h.timeout(d,new Error(f+" did not load after "+d+"ms"))),h}(u,s)}).then(function(l){return function(d,f,h,W){var g=W.send;return x.try(function(){return typeof f=="string"?f:x.try(function(){return h||Mn(d,{send:g}).then(function(y){return y.domain})}).then(function(y){if(!tn(f,f))throw new Error("Domain "+ue(f)+" does not match "+ue(f));return y})})}(u,i,(l===void 0?{}:l).domain,{send:n})}).then(function(l){var d=l,f=e==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":e,h=new x,W=e+"_"+q();if(!c){var g={name:e,win:u,domain:d,promise:h};(function(b,R){j("responseListeners").set(b,R)})(W,g);var y=L("requestPromises").getOrSet(u,function(){return[]});y.push(h),h.catch(function(){(function(b){j("erroredResponseListeners").set(b,!0)})(W),be(W)});var I=function(b){return L("knownWindows").get(b,!1)}(u)?1e4:2e3,T=a,A=I,O=T,M=function(b,R){var _;return function C(){_=setTimeout(function(){(function(){if(G(u))return h.reject(new Error("Window closed for "+e+" before "+(g.ack?"response":"ack")));if(g.cancelled)return h.reject(new Error("Response listener was cancelled for "+e));A=Math.max(A-500,0),O!==-1&&(O=Math.max(O-500,0)),g.ack||A!==0?O===0&&h.reject(new Error("No response for postMessage "+f+" in "+z()+" in "+T+"ms")):h.reject(new Error("No ack for postMessage "+f+" in "+z()+" in "+I+"ms"))})(),C()},500)}(),{cancel:function(){clearTimeout(_)}}}();h.finally(function(){M.cancel(),y.splice(y.indexOf(h,1))}).catch(Q)}return Un(u,d,{id:q(),origin:z(window),type:"postrobot_message_request",hash:W,name:e,data:r,fireAndForget:c},{on:Y,send:n}).then(function(){return c?h.resolve():h},function(b){throw new Error("Send request message failed for "+f+" in "+z()+`
38
+ `+vn(u))}}),P.try(function(){if(!a)throw new Error("No handler found for post message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:n,origin:t,data:e.data})}).then(function(u){return c("success",u)},function(u){return c("error",null,u)})]).then(Q).catch(function(u){if(a&&a.handleError)return a.handleError(u);throw u})}function gt(n,t,e){if(!xe(e.hash)){var r=Se(e.hash);if(!r)throw new Error("No handler found for post message ack for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!tn(r.domain,t))throw new Error("Ack origin "+t+" does not match domain "+r.domain.toString());if(n!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function yt(n,t,e){if(!xe(e.hash)){var r=Se(e.hash);if(!r)throw new Error("No handler found for post message response for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!tn(r.domain,t))throw new Error("Response origin "+t+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":w(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(n!==r.win)throw new Error("Response source does not match registered window");be(e.hash),e.ack==="error"?r.promise.reject(e.error):e.ack==="success"&&r.promise.resolve({source:n,origin:t,data:e.data})}}function Ie(n,t){var e=t.on,r=t.send,o=j("receivedMessages");try{if(!window||window.closed||!n.source)return}catch{return}var i=n.source,a=n.origin,s=function(l,d,f,h){var W=h.on,y=h.send,E;try{E=We(d,f,l,{on:W,send:y})}catch{return}if(E&&typeof E=="object"&&E!==null){var I=E.__post_robot_10_0_46__;if(Array.isArray(I))return I}}(n.data,i,a,{on:e,send:r});if(s){we(i);for(var c=0;c<s.length;c++){var u=s[c];if(o.has(u.id)||(o.set(u.id,!0),B(i)&&!u.fireAndForget))return;u.origin.indexOf("file:")===0&&(a="file://");try{u.type==="postrobot_message_request"?pt(i,a,u,{on:e,send:r}):u.type==="postrobot_message_response"?yt(i,a,u):u.type==="postrobot_message_ack"&&gt(i,a,u)}catch(l){setTimeout(function(){throw l},0)}}}}function Y(n,t,e){if(!n)throw new Error("Expected name");if(typeof(t=t||{})=="function"&&(e=t,t={}),!e)throw new Error("Expected handler");var r=function o(i,a){var s=i.name,c=i.win,u=i.domain,l=L("requestListeners");if(!s||typeof s!="string")throw new Error("Name required to add request listener");if(c&&c!=="*"&&G.isProxyWindow(c)){var d=c.awaitWindow().then(function(N){return o({name:s,win:N,domain:u},a)});return{cancel:function(){d.then(function(N){return N.cancel()},Q)}}}var f=c;if(Array.isArray(f)){for(var h=[],W=0,y=f;W<y.length;W++)h.push(o({name:s,domain:u,win:y[W]},a));return{cancel:function(){for(var N=0;N<h.length;N++)h[N].cancel()}}}if(Array.isArray(u)){for(var E=[],I=0,T=u;I<T.length;I++)E.push(o({name:s,win:f,domain:T[I]},a));return{cancel:function(){for(var N=0;N<E.length;N++)E[N].cancel()}}}var A=Pe({name:s,win:f,domain:u});f&&f!=="*"||(f=In());var O=(u=u||"*").toString();if(A)throw f&&u?new Error("Request listener already exists for "+s+" on domain "+u.toString()+" for "+(f===In()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+s+" for "+(f===In()?"wildcard":"specified")+" window"):u?new Error("Request listener already exists for "+s+" on domain "+u.toString()):new Error("Request listener already exists for "+s);var z=l.getOrSet(f,function(){return{}}),b=wn(z,s,function(){return{}}),R,_;return jn(u)?(R=wn(b,"__domain_regex__",function(){return[]})).push(_={regex:u,listener:a}):b[O]=a,{cancel:function(){delete b[O],_&&(R.splice(R.indexOf(_,1)),R.length||delete b.__domain_regex__),Object.keys(b).length||delete z[s],f&&!Object.keys(z).length&&l.del(f)}}}({name:n,win:t.window,domain:t.domain||"*"},{handler:e||t.handler,handleError:t.errorHandler||function(o){throw o}});return{cancel:function(){r.cancel()}}}function Et(n,t,e){typeof(t=t||{})=="function"&&(e=t,t={});var r=new P,o;return t.errorHandler=function(i){o.cancel(),r.reject(i)},o=Y(n,t,function(i){if(o.cancel(),r.resolve(i),e)return e(i)}),r.cancel=o.cancel,r}var V=function n(t,e,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,s=o.timeout||5e3,c=o.fireAndForget||!1;return G.toProxyWindow(t,{send:n}).awaitWindow().then(function(u){return P.try(function(){if(function(l,d,f){if(!l)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!jn(f))throw new TypeError("Can not send "+l+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if(B(d))throw new Error("Can not send "+l+". Target window is closed")}(e,u,i),function(l,d){var f=Qn(d);if(f)return f===l;if(d===l||function(y){y===void 0&&(y=window);try{if(y.top)return y.top}catch{}if(k(y)===y)return y;try{if(Xn(window,y)&&window.top)return window.top}catch{}try{if(Xn(y,window)&&window.top)return window.top}catch{}for(var E=0,I=function A(O){for(var z=[],b=0,R=Kn(O);b<R.length;b++){var _=R[b];z.push(_);for(var N=0,pn=A(_);N<pn.length;N++)z.push(pn[N])}return z}(y);E<I.length;E++){var T=I[E];try{if(T.top)return T.top}catch{}if(k(T)===T)return T}}(d)===d)return!1;for(var h=0,W=Kn(l);h<W.length;h++)if(W[h]===d)return!0;return!1}(window,u))return function(l,d,f){d===void 0&&(d=5e3),f===void 0&&(f="Window");var h=function(W){return L("helloPromises").getOrSet(W,function(){return new P})}(l);return d!==-1&&(h=h.timeout(d,new Error(f+" did not load after "+d+"ms"))),h}(u,s)}).then(function(l){return function(d,f,h,W){var y=W.send;return P.try(function(){return typeof f=="string"?f:P.try(function(){return h||zn(d,{send:y}).then(function(E){return E.domain})}).then(function(E){if(!tn(f,f))throw new Error("Domain "+ue(f)+" does not match "+ue(f));return E})})}(u,i,(l===void 0?{}:l).domain,{send:n})}).then(function(l){var d=l,f=e==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":e,h=new P,W=e+"_"+$();if(!c){var y={name:e,win:u,domain:d,promise:h};(function(b,R){j("responseListeners").set(b,R)})(W,y);var E=L("requestPromises").getOrSet(u,function(){return[]});E.push(h),h.catch(function(){(function(b){j("erroredResponseListeners").set(b,!0)})(W),be(W)});var I=function(b){return L("knownWindows").get(b,!1)}(u)?1e4:2e3,T=a,A=I,O=T,z=function(b,R){var _;return function N(){_=setTimeout(function(){(function(){if(B(u))return h.reject(new Error("Window closed for "+e+" before "+(y.ack?"response":"ack")));if(y.cancelled)return h.reject(new Error("Response listener was cancelled for "+e));A=Math.max(A-500,0),O!==-1&&(O=Math.max(O-500,0)),y.ack||A!==0?O===0&&h.reject(new Error("No response for postMessage "+f+" in "+M()+" in "+T+"ms")):h.reject(new Error("No ack for postMessage "+f+" in "+M()+" in "+I+"ms"))})(),N()},500)}(),{cancel:function(){clearTimeout(_)}}}();h.finally(function(){z.cancel(),E.splice(E.indexOf(h,1))}).catch(Q)}return Un(u,d,{id:$(),origin:M(window),type:"postrobot_message_request",hash:W,name:e,data:r,fireAndForget:c},{on:Y,send:n}).then(function(){return c?h.resolve():h},function(b){throw new Error("Send request message failed for "+f+" in "+M()+`
39
39
 
40
- `+hn(b))})})})};function Wt(n,t,e){return Ee(n,t,e,{on:Y,send:k})}function St(n,t,e){return We(n,t,e,{on:Y,send:k})}function bt(n){return new B({send:k,win:n})}function xt(n){return B.toProxyWindow(n,{send:k})}function Oe(){wn().initialized||(wn().initialized=!0,t=(n={on:Y,send:k}).on,e=n.send,(r=wn()).receiveMessage=r.receiveMessage||function(o){return Ie(o,{on:t,send:e})},function(o){var i=o.on,a=o.send;j().getOrSet("postMessageListener",function(){return function(s,c,u){return s.addEventListener("message",u),{cancel:function(){s.removeEventListener("message",u)}}}(window,0,function(s){(function(c,u){var l=u.on,d=u.send;x.try(function(){var f=c.source||c.sourceElement,h=c.origin||c.originalEvent&&c.originalEvent.origin,W=c.data;if(h==="null"&&(h="file://"),f){if(!h)throw new Error("Post message did not have origin domain");Ie({source:f,origin:h,data:W},{on:l,send:d})}})})(s,{on:i,send:a})})})}({on:Y,send:k}),function(o){var i=o.on,a=o.send;j("builtinListeners").getOrSet("helloListener",function(){var s=i("postrobot_hello",{domain:"*"},function(u){return he(u.source,{domain:u.origin}),{instanceID:le()}}),c=Qn();return c&&Mn(c,{send:a}).catch(function(u){}),s})}({on:Y,send:k}));var n,t,e,r}function Pt(){(function(){for(var t=j("responseListeners"),e=0,r=t.keys();e<r.length;e++){var o=r[e],i=t.get(o);i&&(i.cancelled=!0),t.del(o)}})(),(n=j().get("postMessageListener"))&&n.cancel();var n;delete window.__post_robot_10_0_46__}var It=!0;function Ot(n){for(var t=0,e=L("requestPromises").get(n,[]);t<e.length;t++)e[t].reject(new Error("Window "+(G(n)?"closed":"cleaned up")+" before response")).catch(Q)}Oe()}])})})(Zn);var ot=Zn.exports;(function(v){v.exports=ot,v.exports.default=v.exports})(Vn);var Yn=Vn.exports;const Dn=N({__proto__:null,default:rt(Yn)},[Yn]);D.ConsentBox=Je,D.SoyioTypes=qe,D.SoyioWidget=$n,D.default=$n,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
40
+ `+vn(b))})})})};function Wt(n,t,e){return Ee(n,t,e,{on:Y,send:V})}function St(n,t,e){return We(n,t,e,{on:Y,send:V})}function bt(n){return new G({send:V,win:n})}function xt(n){return G.toProxyWindow(n,{send:V})}function Oe(){mn().initialized||(mn().initialized=!0,t=(n={on:Y,send:V}).on,e=n.send,(r=mn()).receiveMessage=r.receiveMessage||function(o){return Ie(o,{on:t,send:e})},function(o){var i=o.on,a=o.send;j().getOrSet("postMessageListener",function(){return function(s,c,u){return s.addEventListener("message",u),{cancel:function(){s.removeEventListener("message",u)}}}(window,0,function(s){(function(c,u){var l=u.on,d=u.send;P.try(function(){var f=c.source||c.sourceElement,h=c.origin||c.originalEvent&&c.originalEvent.origin,W=c.data;if(h==="null"&&(h="file://"),f){if(!h)throw new Error("Post message did not have origin domain");Ie({source:f,origin:h,data:W},{on:l,send:d})}})})(s,{on:i,send:a})})})}({on:Y,send:V}),function(o){var i=o.on,a=o.send;j("builtinListeners").getOrSet("helloListener",function(){var s=i("postrobot_hello",{domain:"*"},function(u){return he(u.source,{domain:u.origin}),{instanceID:le()}}),c=Qn();return c&&zn(c,{send:a}).catch(function(u){}),s})}({on:Y,send:V}));var n,t,e,r}function Pt(){(function(){for(var t=j("responseListeners"),e=0,r=t.keys();e<r.length;e++){var o=r[e],i=t.get(o);i&&(i.cancelled=!0),t.del(o)}})(),(n=j().get("postMessageListener"))&&n.cancel();var n;delete window.__post_robot_10_0_46__}var It=!0;function Ot(n){for(var t=0,e=L("requestPromises").get(n,[]);t<e.length;t++)e[t].reject(new Error("Window "+(B(n)?"closed":"cleaned up")+" before response")).catch(Q)}Oe()}])})})(Zn);var ot=Zn.exports;(function(v){v.exports=ot,v.exports.default=v.exports})(kn);var Yn=kn.exports;const Dn=C({__proto__:null,default:rt(Yn)},[Yn]);D.ConsentBox=Je,D.SoyioTypes=$e,D.SoyioWidget=qn,D.default=qn,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",