@soyio/soyio-widget 0.0.2 → 0.0.5

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
@@ -1,32 +1,31 @@
1
1
  # soy-io-widget
2
2
  This is the library for include a soyio widget.
3
3
 
4
- This library contemplate that an iframe with the ID: soyio-widget-iframe should be created before instantiate the widget.
4
+ This library contemplate that a div element with ID: `soyio-widget-iframe-container` should be created before instantiate the widget.
5
5
 
6
6
  ## How to work
7
7
 
8
8
  For frontend frameworks, this should be imported as follows.
9
9
 
10
- ``` VUE
10
+ ``` html
11
11
  <script>
12
- import Widget from '@soyio/soyio-widget'
13
-
14
- // Vue syntax
15
- onMounted(() => {
16
- const widget = new Widget()
17
- })
12
+ // insert setup of your framework here!!
13
+ document.addEventListener('DOMContentLoaded', function() {
14
+ new Widget({ userEmail: 'example@email.com', companyName: 'Company name'})
15
+ });
18
16
  </script>
19
- <template>
20
- <iframe id="soyio-widget-iframe"></iframe>
21
- </template>
17
+ <body>
18
+ <div id="soyio-widget-iframe-container"></div>
19
+ </body>
22
20
 
23
21
  ```
24
22
 
25
- The widget class receive the following object:
23
+ The widget class receive the following object when is initialized:
26
24
 
27
25
  ```JS
28
26
  {
29
27
  userEmail?: string
28
+ companyName?: string
30
29
  }
31
30
  ```
32
31
 
@@ -1,2 +1,2 @@
1
- export declare const IFRAME_ID = "soyio-widget-iframe";
1
+ export declare const CONTAINER_ID = "soyio-widget-iframe-container";
2
2
  export declare const DEVELOPMENT_WIDGET_URL = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";
package/dist/events.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { WidgetProps } from './index';
1
2
  declare function setReady(iframe: HTMLIFrameElement): void;
2
- declare function configUser(iframe: HTMLIFrameElement, userEmail: string): void;
3
- export { setReady, configUser };
3
+ declare function setConfig(iframe: HTMLIFrameElement, config: WidgetProps): void;
4
+ export { setReady, setConfig };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- interface WidgetProps {
1
+ export interface WidgetProps {
2
2
  userEmail?: string;
3
+ companyName?: string;
3
4
  }
4
5
  declare class Widget {
5
6
  private iframe;
6
7
  userEmail?: string;
7
- constructor({ userEmail }: WidgetProps);
8
+ companyName?: string;
9
+ constructor({ userEmail, companyName }: WidgetProps);
8
10
  initialize(): void;
9
11
  }
10
12
  export default Widget;
package/dist/index.js CHANGED
@@ -1,26 +1,27 @@
1
- var Mr = Object.defineProperty;
2
- var Nr = (E, L, H) => L in E ? Mr(E, L, { enumerable: !0, configurable: !0, writable: !0, value: H }) : E[L] = H;
3
- var In = (E, L, H) => (Nr(E, typeof L != "symbol" ? L + "" : L, H), H);
4
- const Cr = "soyio-widget-iframe", Tr = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget", Lr = Tr;
1
+ var jr = Object.defineProperty;
2
+ var Cr = (E, N, F) => N in E ? jr(E, N, { enumerable: !0, configurable: !0, writable: !0, value: F }) : E[N] = F;
3
+ var pn = (E, N, F) => (Cr(E, typeof N != "symbol" ? N + "" : N, F), F);
4
+ const Mr = "soyio-widget-iframe-container", Tr = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget", Lr = Tr;
5
5
  function Fr() {
6
- return document.getElementById(Cr);
6
+ return document.getElementById(Mr);
7
7
  }
8
8
  function Br() {
9
9
  const E = Fr();
10
10
  if (!E)
11
- throw new Error("Iframe does not exist");
12
- return E.src = Lr, E;
11
+ throw new Error("Iframe container does not exist");
12
+ const N = document.createElement("iframe");
13
+ return N.src = Lr, E.appendChild(N), N;
13
14
  }
14
15
  var Hr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
15
16
  function Jr(E) {
16
17
  return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
17
18
  }
18
19
  var cr = { exports: {} }, sr = { exports: {} };
19
- (function(E, L) {
20
- (function(H, A) {
20
+ (function(E, N) {
21
+ (function(F, A) {
21
22
  E.exports = A();
22
23
  })(typeof self < "u" ? self : Hr, function() {
23
- return function(H) {
24
+ return function(F) {
24
25
  var A = {};
25
26
  function g(p) {
26
27
  if (A[p])
@@ -30,9 +31,9 @@ var cr = { exports: {} }, sr = { exports: {} };
30
31
  l: !1,
31
32
  exports: {}
32
33
  };
33
- return H[p].call(W.exports, W, W.exports, g), W.l = !0, W.exports;
34
+ return F[p].call(W.exports, W, W.exports, g), W.l = !0, W.exports;
34
35
  }
35
- return g.m = H, g.c = A, g.d = function(p, W, U) {
36
+ return g.m = F, g.c = A, g.d = function(p, W, U) {
36
37
  g.o(p, W) || Object.defineProperty(p, W, {
37
38
  enumerable: !0,
38
39
  get: U
@@ -66,13 +67,13 @@ var cr = { exports: {} }, sr = { exports: {} };
66
67
  }, g.o = function(p, W) {
67
68
  return {}.hasOwnProperty.call(p, W);
68
69
  }, g.p = "", g(g.s = 0);
69
- }([function(H, A, g) {
70
+ }([function(F, A, g) {
70
71
  g.r(A), g.d(A, "Promise", function() {
71
72
  return x;
72
73
  }), g.d(A, "TYPES", function() {
73
74
  return Rr;
74
75
  }), g.d(A, "ProxyWindow", function() {
75
- return T;
76
+ return L;
76
77
  }), g.d(A, "setup", function() {
77
78
  return ur;
78
79
  }), g.d(A, "destroy", function() {
@@ -94,7 +95,7 @@ var cr = { exports: {} }, sr = { exports: {} };
94
95
  }), g.d(A, "markWindowKnown", function() {
95
96
  return Kn;
96
97
  }), g.d(A, "cleanUpWindow", function() {
97
- return jr;
98
+ return Nr;
98
99
  }), g.d(A, "bridge", function() {
99
100
  });
100
101
  function p(n) {
@@ -221,7 +222,7 @@ var cr = { exports: {} }, sr = { exports: {} };
221
222
  return o;
222
223
  }(t).indexOf(n) !== -1;
223
224
  }
224
- function jn(n) {
225
+ function Nn(n) {
225
226
  var t = [], r;
226
227
  try {
227
228
  r = n.frames;
@@ -261,7 +262,7 @@ var cr = { exports: {} }, sr = { exports: {} };
261
262
  return t;
262
263
  }
263
264
  var fr = [], dr = [];
264
- function F(n, t) {
265
+ function B(n, t) {
265
266
  t === void 0 && (t = !0);
266
267
  try {
267
268
  if (n === window)
@@ -319,7 +320,7 @@ var cr = { exports: {} }, sr = { exports: {} };
319
320
  }
320
321
  return !1;
321
322
  }
322
- function Mn(n) {
323
+ function jn(n) {
323
324
  return n === void 0 && (n = window), zn(n = n || window) || q(n) || void 0;
324
325
  }
325
326
  function X(n, t) {
@@ -389,7 +390,7 @@ var cr = { exports: {} }, sr = { exports: {} };
389
390
  }
390
391
  return !1;
391
392
  }
392
- function Nn(n) {
393
+ function Cn(n) {
393
394
  if (V(n))
394
395
  return dn(n).frameElement;
395
396
  for (var t = 0, r = document.querySelectorAll("iframe"); t < r.length; t++) {
@@ -402,7 +403,7 @@ var cr = { exports: {} }, sr = { exports: {} };
402
403
  if (function(r) {
403
404
  return r === void 0 && (r = window), !!q(r);
404
405
  }(n)) {
405
- var t = Nn(n);
406
+ var t = Cn(n);
406
407
  if (t && t.parentElement) {
407
408
  t.parentElement.removeChild(t);
408
409
  return;
@@ -434,25 +435,25 @@ var cr = { exports: {} }, sr = { exports: {} };
434
435
  }
435
436
  return !1;
436
437
  }
437
- var Cn = [], $ = [], pn = 0, _;
438
+ var Mn = [], $ = [], gn = 0, _;
438
439
  function Tn() {
439
- if (!pn && _) {
440
+ if (!gn && _) {
440
441
  var n = _;
441
442
  _ = null, n.resolve();
442
443
  }
443
444
  }
444
- function gn() {
445
- pn += 1;
445
+ function yn() {
446
+ gn += 1;
446
447
  }
447
448
  function nn() {
448
- pn -= 1, Tn();
449
+ gn -= 1, Tn();
449
450
  }
450
451
  var x = function() {
451
452
  function n(r) {
452
453
  var e = this;
453
454
  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 = [], r) {
454
455
  var o, i, a = !1, s = !1, c = !1;
455
- gn();
456
+ yn();
456
457
  try {
457
458
  r(function(u) {
458
459
  c ? e.resolve(u) : (a = !0, o = u);
@@ -485,8 +486,8 @@ var cr = { exports: {} }, sr = { exports: {} };
485
486
  }
486
487
  return this.rejected = !0, this.error = r, this.errorHandled || setTimeout(function() {
487
488
  e.errorHandled || function(i, a) {
488
- if (Cn.indexOf(i) === -1) {
489
- Cn.push(i), setTimeout(function() {
489
+ if (Mn.indexOf(i) === -1) {
490
+ Mn.push(i), setTimeout(function() {
490
491
  throw i;
491
492
  }, 1);
492
493
  for (var s = 0; s < $.length; s++)
@@ -499,7 +500,7 @@ var cr = { exports: {} }, sr = { exports: {} };
499
500
  }, t.dispatch = function() {
500
501
  var r = this.resolved, e = this.rejected, o = this.handlers;
501
502
  if (!this.dispatching && (r || e)) {
502
- this.dispatching = !0, gn();
503
+ this.dispatching = !0, yn();
503
504
  for (var i = function(l, m) {
504
505
  return l.then(function(v) {
505
506
  m.resolve(v);
@@ -636,7 +637,7 @@ var cr = { exports: {} }, sr = { exports: {} };
636
637
  if (r && typeof r != "function" && !r.call)
637
638
  throw new Error("Promise.try expected a function");
638
639
  var i;
639
- gn();
640
+ yn();
640
641
  try {
641
642
  i = r.apply(e, o || []);
642
643
  } catch (a) {
@@ -665,7 +666,7 @@ var cr = { exports: {} }, sr = { exports: {} };
665
666
  }
666
667
  return -1;
667
668
  }
668
- var yn = function() {
669
+ var En = function() {
669
670
  function n() {
670
671
  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() {
671
672
  if (typeof WeakMap > "u" || Object.freeze === void 0)
@@ -687,7 +688,7 @@ var cr = { exports: {} }, sr = { exports: {} };
687
688
  return t._cleanupClosedWindows = function() {
688
689
  for (var r = this.weakmap, e = this.keys, o = 0; o < e.length; o++) {
689
690
  var i = e[o];
690
- if (hn(i) && F(i)) {
691
+ if (hn(i) && B(i)) {
691
692
  if (r)
692
693
  try {
693
694
  r.delete(i);
@@ -815,7 +816,7 @@ var cr = { exports: {} }, sr = { exports: {} };
815
816
  try {
816
817
  return JSON.stringify([].slice.call(n), function(t, r) {
817
818
  return typeof r == "function" ? "memoize[" + function(e) {
818
- if (vn = vn || new yn(), e == null || typeof e != "object" && typeof e != "function")
819
+ if (vn = vn || new En(), e == null || typeof e != "object" && typeof e != "function")
819
820
  throw new Error("Invalid object");
820
821
  var o = vn.get(e);
821
822
  return o || (o = typeof e + ":" + J(), vn.set(e, o)), o;
@@ -838,7 +839,7 @@ var cr = { exports: {} }, sr = { exports: {} };
838
839
  h[f] = arguments[f];
839
840
  s < Hn && (i = null, a = null, s = rn, rn += 1);
840
841
  var d;
841
- d = e ? (a = a || new yn()).getOrSet(this, lr) : i = i || {};
842
+ d = e ? (a = a || new En()).getOrSet(this, lr) : i = i || {};
842
843
  var l;
843
844
  try {
844
845
  l = Bn(h);
@@ -913,7 +914,7 @@ var cr = { exports: {} }, sr = { exports: {} };
913
914
  n.hasOwnProperty(r) && t.push(n[r]);
914
915
  return t;
915
916
  });
916
- function En(n) {
917
+ function Wn(n) {
917
918
  return {}.toString.call(n) === "[object RegExp]";
918
919
  }
919
920
  function on(n, t, r) {
@@ -1035,9 +1036,9 @@ var cr = { exports: {} }, sr = { exports: {} };
1035
1036
  var n = an();
1036
1037
  return n.WINDOW_WILDCARD = n.WINDOW_WILDCARD || new pr(), n.WINDOW_WILDCARD;
1037
1038
  }
1038
- function M(n, t) {
1039
+ function C(n, t) {
1039
1040
  return n === void 0 && (n = "store"), t === void 0 && (t = qn), z("windowStore").getOrSet(n, function() {
1040
- var r = new yn(), e = function(o) {
1041
+ var r = new En(), e = function(o) {
1041
1042
  return r.getOrSet(o, t);
1042
1043
  };
1043
1044
  return {
@@ -1064,7 +1065,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1064
1065
  return z("instance").getOrSet("instanceID", J);
1065
1066
  }
1066
1067
  function Yn(n, t) {
1067
- var r = t.domain, e = M("helloPromises"), o = e.get(n);
1068
+ var r = t.domain, e = C("helloPromises"), o = e.get(n);
1068
1069
  o && o.resolve({
1069
1070
  domain: r
1070
1071
  });
@@ -1073,7 +1074,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1073
1074
  });
1074
1075
  return e.set(n, i), i;
1075
1076
  }
1076
- function Wn(n, t) {
1077
+ function xn(n, t) {
1077
1078
  return (0, t.send)(n, "postrobot_hello", {
1078
1079
  instanceID: Vn()
1079
1080
  }, {
@@ -1092,8 +1093,8 @@ var cr = { exports: {} }, sr = { exports: {} };
1092
1093
  }
1093
1094
  function kn(n, t) {
1094
1095
  var r = t.send;
1095
- return M("windowInstanceIDPromises").getOrSet(n, function() {
1096
- return Wn(n, {
1096
+ return C("windowInstanceIDPromises").getOrSet(n, function() {
1097
+ return xn(n, {
1097
1098
  send: r
1098
1099
  }).then(function(e) {
1099
1100
  return e.instanceID;
@@ -1101,9 +1102,9 @@ var cr = { exports: {} }, sr = { exports: {} };
1101
1102
  });
1102
1103
  }
1103
1104
  function Kn(n) {
1104
- M("knownWindows").set(n, !0);
1105
+ C("knownWindows").set(n, !0);
1105
1106
  }
1106
- function xn(n) {
1107
+ function Sn(n) {
1107
1108
  return typeof n == "object" && n !== null && typeof n.__type__ == "string";
1108
1109
  }
1109
1110
  function Xn(n) {
@@ -1115,60 +1116,60 @@ var cr = { exports: {} }, sr = { exports: {} };
1115
1116
  __val__: t
1116
1117
  };
1117
1118
  }
1118
- var N, gr = ((N = {}).function = function() {
1119
- }, N.error = function(n) {
1119
+ var M, gr = ((M = {}).function = function() {
1120
+ }, M.error = function(n) {
1120
1121
  return K("error", {
1121
1122
  message: n.message,
1122
1123
  stack: n.stack,
1123
1124
  code: n.code,
1124
1125
  data: n.data
1125
1126
  });
1126
- }, N.promise = function() {
1127
- }, N.regex = function(n) {
1127
+ }, M.promise = function() {
1128
+ }, M.regex = function(n) {
1128
1129
  return K("regex", n.source);
1129
- }, N.date = function(n) {
1130
+ }, M.date = function(n) {
1130
1131
  return K("date", n.toJSON());
1131
- }, N.array = function(n) {
1132
+ }, M.array = function(n) {
1132
1133
  return n;
1133
- }, N.object = function(n) {
1134
+ }, M.object = function(n) {
1134
1135
  return n;
1135
- }, N.string = function(n) {
1136
+ }, M.string = function(n) {
1136
1137
  return n;
1137
- }, N.number = function(n) {
1138
+ }, M.number = function(n) {
1138
1139
  return n;
1139
- }, N.boolean = function(n) {
1140
+ }, M.boolean = function(n) {
1140
1141
  return n;
1141
- }, N.null = function(n) {
1142
+ }, M.null = function(n) {
1142
1143
  return n;
1143
- }, N[void 0] = function(n) {
1144
+ }, M[void 0] = function(n) {
1144
1145
  return K("undefined", n);
1145
- }, N), yr = {}, C, Er = ((C = {}).function = function() {
1146
+ }, M), yr = {}, T, Er = ((T = {}).function = function() {
1146
1147
  throw new Error("Function serialization is not implemented; nothing to deserialize");
1147
- }, C.error = function(n) {
1148
+ }, T.error = function(n) {
1148
1149
  var t = n.stack, r = n.code, e = n.data, o = new Error(n.message);
1149
1150
  return o.code = r, e && (o.data = e), o.stack = t + `
1150
1151
 
1151
1152
  ` + o.stack, o;
1152
- }, C.promise = function() {
1153
+ }, T.promise = function() {
1153
1154
  throw new Error("Promise serialization is not implemented; nothing to deserialize");
1154
- }, C.regex = function(n) {
1155
+ }, T.regex = function(n) {
1155
1156
  return new RegExp(n);
1156
- }, C.date = function(n) {
1157
+ }, T.date = function(n) {
1157
1158
  return new Date(n);
1158
- }, C.array = function(n) {
1159
+ }, T.array = function(n) {
1159
1160
  return n;
1160
- }, C.object = function(n) {
1161
+ }, T.object = function(n) {
1161
1162
  return n;
1162
- }, C.string = function(n) {
1163
+ }, T.string = function(n) {
1163
1164
  return n;
1164
- }, C.number = function(n) {
1165
+ }, T.number = function(n) {
1165
1166
  return n;
1166
- }, C.boolean = function(n) {
1167
+ }, T.boolean = function(n) {
1167
1168
  return n;
1168
- }, C.null = function(n) {
1169
+ }, T.null = function(n) {
1169
1170
  return n;
1170
- }, C[void 0] = function() {
1171
- }, C), Wr = {};
1171
+ }, T[void 0] = function() {
1172
+ }, T), Wr = {};
1172
1173
  new x(function(n) {
1173
1174
  if (window.document && window.document.body)
1174
1175
  return n(window.document.body);
@@ -1177,7 +1178,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1177
1178
  return clearInterval(t), n(window.document.body);
1178
1179
  }, 10);
1179
1180
  });
1180
- function Sn() {
1181
+ function bn() {
1181
1182
  for (var n = z("idToProxyWindow"), t = 0, r = n.keys(); t < r.length; t++) {
1182
1183
  var e = r[t];
1183
1184
  n.get(e).shouldClean() && n.del(e);
@@ -1188,14 +1189,14 @@ var cr = { exports: {} }, sr = { exports: {} };
1188
1189
  if (V(c))
1189
1190
  return dn(c).name;
1190
1191
  }), a = n.then(function(c) {
1191
- if (F(c))
1192
+ if (B(c))
1192
1193
  throw new Error("Window is closed, can not determine type");
1193
1194
  return zn(c) ? "popup" : "iframe";
1194
1195
  });
1195
1196
  i.catch(k), a.catch(k);
1196
1197
  var s = function() {
1197
1198
  return n.then(function(c) {
1198
- if (!F(c))
1199
+ if (!B(c))
1199
1200
  return V(c) ? dn(c).name : i;
1200
1201
  });
1201
1202
  };
@@ -1222,7 +1223,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1222
1223
  },
1223
1224
  isClosed: function() {
1224
1225
  return n.then(function(c) {
1225
- return F(c);
1226
+ return B(c);
1226
1227
  });
1227
1228
  },
1228
1229
  setLocation: function(c, u) {
@@ -1239,9 +1240,9 @@ var cr = { exports: {} }, sr = { exports: {} };
1239
1240
  (function(w) {
1240
1241
  var S = w.url, D = w.target, P = w.body, b = w.method, R = b === void 0 ? "post" : b, y = document.createElement("form");
1241
1242
  if (y.setAttribute("target", D), y.setAttribute("method", R), y.setAttribute("action", S), y.style.display = "none", P)
1242
- for (var O = 0, B = Object.keys(P); O < B.length; O++) {
1243
- var I, un = B[O], An = document.createElement("input");
1244
- An.setAttribute("name", un), An.setAttribute("value", (I = P[un]) == null ? void 0 : I.toString()), y.appendChild(An);
1243
+ for (var O = 0, H = Object.keys(P); O < H.length; O++) {
1244
+ var I, un = H[O], In = document.createElement("input");
1245
+ In.setAttribute("name", un), In.setAttribute("value", (I = P[un]) == null ? void 0 : I.toString()), y.appendChild(In);
1245
1246
  }
1246
1247
  Un().appendChild(y), y.submit(), Un().removeChild(y);
1247
1248
  })({
@@ -1266,7 +1267,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1266
1267
  },
1267
1268
  setName: function(c) {
1268
1269
  return n.then(function(u) {
1269
- var h = V(u), f = Nn(u);
1270
+ var h = V(u), f = Cn(u);
1270
1271
  if (!h)
1271
1272
  throw new Error("Can not set name for cross-domain window: " + c);
1272
1273
  dn(u).name = c, f && f.setAttribute("name", c), i = x.resolve(c);
@@ -1274,7 +1275,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1274
1275
  }
1275
1276
  };
1276
1277
  }
1277
- var T = function() {
1278
+ var L = function() {
1278
1279
  function n(r) {
1279
1280
  var e = r.send, o = r.win, i = r.serializedWindow;
1280
1281
  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 || Qn(this.actualWindowPromise, {
@@ -1329,7 +1330,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1329
1330
  this.actualWindow = r, this.actualWindowPromise.resolve(this.actualWindow), this.serializedWindow = Qn(this.actualWindowPromise, {
1330
1331
  send: o,
1331
1332
  id: this.getID()
1332
- }), M("winToProxyWindow").set(r, this);
1333
+ }), C("winToProxyWindow").set(r, this);
1333
1334
  }, t.awaitWindow = function() {
1334
1335
  return this.actualWindowPromise;
1335
1336
  }, t.matchWindow = function(r, e) {
@@ -1352,19 +1353,19 @@ var cr = { exports: {} }, sr = { exports: {} };
1352
1353
  }, t.getInstanceID = function() {
1353
1354
  return this.serializedWindow.getInstanceID();
1354
1355
  }, t.shouldClean = function() {
1355
- return !!(this.actualWindow && F(this.actualWindow));
1356
+ return !!(this.actualWindow && B(this.actualWindow));
1356
1357
  }, t.serialize = function() {
1357
1358
  return this.serializedWindow;
1358
1359
  }, n.unwrap = function(r) {
1359
1360
  return n.isProxyWindow(r) ? r.unwrap() : r;
1360
1361
  }, n.serialize = function(r, e) {
1361
1362
  var o = e.send;
1362
- return Sn(), n.toProxyWindow(r, {
1363
+ return bn(), n.toProxyWindow(r, {
1363
1364
  send: o
1364
1365
  }).serialize();
1365
1366
  }, n.deserialize = function(r, e) {
1366
1367
  var o = e.send;
1367
- return Sn(), z("idToProxyWindow").get(r.id) || new n({
1368
+ return bn(), z("idToProxyWindow").get(r.id) || new n({
1368
1369
  serializedWindow: r,
1369
1370
  send: o
1370
1371
  });
@@ -1372,18 +1373,18 @@ var cr = { exports: {} }, sr = { exports: {} };
1372
1373
  return !!(r && !hn(r) && r.isProxyWindow);
1373
1374
  }, n.toProxyWindow = function(r, e) {
1374
1375
  var o = e.send;
1375
- if (Sn(), n.isProxyWindow(r))
1376
+ if (bn(), n.isProxyWindow(r))
1376
1377
  return r;
1377
1378
  var i = r;
1378
- return M("winToProxyWindow").get(i) || new n({
1379
+ return C("winToProxyWindow").get(i) || new n({
1379
1380
  win: i,
1380
1381
  send: o
1381
1382
  });
1382
1383
  }, n;
1383
1384
  }();
1384
- function bn(n, t, r, e, o) {
1385
- var i = M("methodStore"), a = z("proxyWindowMethods");
1386
- T.isProxyWindow(e) ? a.set(n, {
1385
+ function Pn(n, t, r, e, o) {
1386
+ var i = C("methodStore"), a = z("proxyWindowMethods");
1387
+ L.isProxyWindow(e) ? a.set(n, {
1387
1388
  val: t,
1388
1389
  name: r,
1389
1390
  domain: o,
@@ -1398,7 +1399,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1398
1399
  });
1399
1400
  }
1400
1401
  function $n(n, t) {
1401
- var r = M("methodStore"), e = z("proxyWindowMethods");
1402
+ var r = C("methodStore"), e = z("proxyWindowMethods");
1402
1403
  return r.getOrSet(n, function() {
1403
1404
  return {};
1404
1405
  })[t] || e.get(t);
@@ -1417,8 +1418,8 @@ var cr = { exports: {} }, sr = { exports: {} };
1417
1418
  var S = w.source, D = w.domain, P = w.val;
1418
1419
  return x.try(function() {
1419
1420
  if (!X(D, d))
1420
- throw new Error("Method '" + l.name + "' domain " + JSON.stringify(En(w.domain) ? w.domain.source : w.domain) + " does not match origin " + d + " in " + j(window));
1421
- if (T.isProxyWindow(S))
1421
+ throw new Error("Method '" + l.name + "' domain " + JSON.stringify(Wn(w.domain) ? w.domain.source : w.domain) + " does not match origin " + d + " in " + j(window));
1422
+ if (L.isProxyWindow(S))
1422
1423
  return S.matchWindow(f, {
1423
1424
  send: s
1424
1425
  }).then(function(b) {
@@ -1454,11 +1455,11 @@ var cr = { exports: {} }, sr = { exports: {} };
1454
1455
  });
1455
1456
  });
1456
1457
  var i, a, s, c = r.__id__ || J();
1457
- n = T.unwrap(n);
1458
+ n = L.unwrap(n);
1458
1459
  var u = r.__name__ || r.name || e;
1459
- return typeof u == "string" && typeof u.indexOf == "function" && u.indexOf("anonymous::") === 0 && (u = u.replace("anonymous::", e + "::")), T.isProxyWindow(n) ? (bn(c, r, u, n, t), n.awaitWindow().then(function(h) {
1460
- bn(c, r, u, h, t);
1461
- })) : bn(c, r, u, n, t), K("cross_domain_function", {
1460
+ return typeof u == "string" && typeof u.indexOf == "function" && u.indexOf("anonymous::") === 0 && (u = u.replace("anonymous::", e + "::")), L.isProxyWindow(n) ? (Pn(c, r, u, n, t), n.awaitWindow().then(function(h) {
1461
+ Pn(c, r, u, h, t);
1462
+ })) : Pn(c, r, u, n, t), K("cross_domain_function", {
1462
1463
  id: c,
1463
1464
  name: u
1464
1465
  });
@@ -1469,7 +1470,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1469
1470
  c === void 0 && (c = yr);
1470
1471
  var u = JSON.stringify(s, function(h) {
1471
1472
  var f = this[h];
1472
- if (xn(this))
1473
+ if (Sn(this))
1473
1474
  return f;
1474
1475
  var d = Xn(f);
1475
1476
  if (!d)
@@ -1498,7 +1499,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1498
1499
  send: a
1499
1500
  });
1500
1501
  }, o.object = function(s) {
1501
- return hn(s) || T.isProxyWindow(s) ? K("cross_domain_window", T.serialize(s, {
1502
+ return hn(s) || L.isProxyWindow(s) ? K("cross_domain_window", L.serialize(s, {
1502
1503
  send: a
1503
1504
  })) : s;
1504
1505
  }, o));
@@ -1508,10 +1509,10 @@ var cr = { exports: {} }, sr = { exports: {} };
1508
1509
  return function(a, s) {
1509
1510
  if (s === void 0 && (s = Wr), a !== "undefined")
1510
1511
  return JSON.parse(a, function(c, u) {
1511
- if (xn(this))
1512
+ if (Sn(this))
1512
1513
  return u;
1513
1514
  var h, f;
1514
- if (xn(u) ? (h = u.__type__, f = u.__val__) : (h = Xn(u), f = u), !h)
1515
+ if (Sn(u) ? (h = u.__type__, f = u.__val__) : (h = Xn(u), f = u), !h)
1515
1516
  return f;
1516
1517
  var d = s[h] || Er[h];
1517
1518
  return d ? d(f, c) : f;
@@ -1526,7 +1527,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1526
1527
  w === void 0 && (w = {});
1527
1528
  function S() {
1528
1529
  var D = arguments;
1529
- return T.toProxyWindow(s, {
1530
+ return L.toProxyWindow(s, {
1530
1531
  send: l
1531
1532
  }).awaitWindow().then(function(P) {
1532
1533
  var b = $n(P, f);
@@ -1566,33 +1567,33 @@ var cr = { exports: {} }, sr = { exports: {} };
1566
1567
  send: i
1567
1568
  });
1568
1569
  }, o.cross_domain_window = function(a) {
1569
- return T.deserialize(a, {
1570
+ return L.deserialize(a, {
1570
1571
  send: i
1571
1572
  });
1572
1573
  }, o));
1573
1574
  }
1574
- var Pn = {};
1575
- Pn.postrobot_post_message = function(n, t, r) {
1575
+ var On = {};
1576
+ On.postrobot_post_message = function(n, t, r) {
1576
1577
  r.indexOf("file:") === 0 && (r = "*"), n.postMessage(t, r);
1577
1578
  };
1578
- function On(n, t, r, e) {
1579
+ function An(n, t, r, e) {
1579
1580
  var o = e.on, i = e.send;
1580
1581
  return x.try(function() {
1581
- var a = M().getOrSet(n, function() {
1582
+ var a = C().getOrSet(n, function() {
1582
1583
  return {};
1583
1584
  });
1584
1585
  return a.buffer = a.buffer || [], a.buffer.push(r), a.flush = a.flush || x.flush().then(function() {
1585
- if (F(n))
1586
+ if (B(n))
1586
1587
  throw new Error("Window is closed");
1587
1588
  var s = nr(n, t, ((c = {}).__post_robot_10_0_46__ = a.buffer || [], c), {
1588
1589
  on: o,
1589
1590
  send: i
1590
1591
  }), c;
1591
1592
  delete a.buffer;
1592
- for (var u = Object.keys(Pn), h = [], f = 0; f < u.length; f++) {
1593
+ for (var u = Object.keys(On), h = [], f = 0; f < u.length; f++) {
1593
1594
  var d = u[f];
1594
1595
  try {
1595
- Pn[d](n, s, t);
1596
+ On[d](n, s, t);
1596
1597
  } catch (l) {
1597
1598
  h.push(l);
1598
1599
  }
@@ -1620,7 +1621,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1620
1621
  return z("erroredResponseListeners").has(n);
1621
1622
  }
1622
1623
  function ir(n) {
1623
- var t = n.name, r = n.win, e = n.domain, o = M("requestListeners");
1624
+ var t = n.name, r = n.win, e = n.domain, o = C("requestListeners");
1624
1625
  if (r === "*" && (r = null), e === "*" && (e = null), !t)
1625
1626
  throw new Error("Name required to get request listener");
1626
1627
  for (var i = 0, a = [r, mn()]; i < a.length; i++) {
@@ -1655,9 +1656,9 @@ var cr = { exports: {} }, sr = { exports: {} };
1655
1656
  }), s = r.name === "postrobot_method" && r.data && typeof r.data.name == "string" ? r.data.name + "()" : r.name;
1656
1657
  function c(u, h, f) {
1657
1658
  return x.flush().then(function() {
1658
- if (!r.fireAndForget && !F(n))
1659
+ if (!r.fireAndForget && !B(n))
1659
1660
  try {
1660
- return On(n, t, {
1661
+ return An(n, t, {
1661
1662
  id: J(),
1662
1663
  origin: j(window),
1663
1664
  type: "postrobot_message_response",
@@ -1678,9 +1679,9 @@ var cr = { exports: {} }, sr = { exports: {} };
1678
1679
  });
1679
1680
  }
1680
1681
  return x.all([x.flush().then(function() {
1681
- if (!r.fireAndForget && !F(n))
1682
+ if (!r.fireAndForget && !B(n))
1682
1683
  try {
1683
- return On(n, t, {
1684
+ return An(n, t, {
1684
1685
  id: J(),
1685
1686
  origin: j(window),
1686
1687
  type: "postrobot_message_ack",
@@ -1777,7 +1778,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1777
1778
  Kn(i);
1778
1779
  for (var c = 0; c < s.length; c++) {
1779
1780
  var u = s[c];
1780
- if (o.has(u.id) || (o.set(u.id, !0), F(i) && !u.fireAndForget))
1781
+ if (o.has(u.id) || (o.set(u.id, !0), B(i) && !u.fireAndForget))
1781
1782
  return;
1782
1783
  u.origin.indexOf("file:") === 0 && (a = "file://");
1783
1784
  try {
@@ -1799,10 +1800,10 @@ var cr = { exports: {} }, sr = { exports: {} };
1799
1800
  if (typeof (t = t || {}) == "function" && (r = t, t = {}), !r)
1800
1801
  throw new Error("Expected handler");
1801
1802
  var e = function o(i, a) {
1802
- var s = i.name, c = i.win, u = i.domain, h = M("requestListeners");
1803
+ var s = i.name, c = i.win, u = i.domain, h = C("requestListeners");
1803
1804
  if (!s || typeof s != "string")
1804
1805
  throw new Error("Name required to add request listener");
1805
- if (c && c !== "*" && T.isProxyWindow(c)) {
1806
+ if (c && c !== "*" && L.isProxyWindow(c)) {
1806
1807
  var f = c.awaitWindow().then(function(I) {
1807
1808
  return o({
1808
1809
  name: s,
@@ -1860,15 +1861,15 @@ var cr = { exports: {} }, sr = { exports: {} };
1860
1861
  return {};
1861
1862
  }), y = on(R, s, function() {
1862
1863
  return {};
1863
- }), O, B;
1864
- return En(u) ? (O = on(y, "__domain_regex__", function() {
1864
+ }), O, H;
1865
+ return Wn(u) ? (O = on(y, "__domain_regex__", function() {
1865
1866
  return [];
1866
- })).push(B = {
1867
+ })).push(H = {
1867
1868
  regex: u,
1868
1869
  listener: a
1869
1870
  }) : y[b] = a, {
1870
1871
  cancel: function() {
1871
- delete y[b], B && (O.splice(O.indexOf(B, 1)), O.length || delete y.__domain_regex__), Object.keys(y).length || delete R[s], d && !Object.keys(R).length && h.del(d);
1872
+ delete y[b], H && (O.splice(O.indexOf(H, 1)), O.length || delete y.__domain_regex__), Object.keys(y).length || delete R[s], d && !Object.keys(R).length && h.del(d);
1872
1873
  }
1873
1874
  };
1874
1875
  }({
@@ -1899,19 +1900,19 @@ var cr = { exports: {} }, sr = { exports: {} };
1899
1900
  }
1900
1901
  var Z = function n(t, r, e, o) {
1901
1902
  var i = (o = o || {}).domain || "*", a = o.timeout || -1, s = o.timeout || 5e3, c = o.fireAndForget || !1;
1902
- return T.toProxyWindow(t, {
1903
+ return L.toProxyWindow(t, {
1903
1904
  send: n
1904
1905
  }).awaitWindow().then(function(u) {
1905
1906
  return x.try(function() {
1906
1907
  if (function(h, f, d) {
1907
1908
  if (!h)
1908
1909
  throw new Error("Expected name");
1909
- if (d && typeof d != "string" && !Array.isArray(d) && !En(d))
1910
+ if (d && typeof d != "string" && !Array.isArray(d) && !Wn(d))
1910
1911
  throw new TypeError("Can not send " + h + ". Expected domain " + JSON.stringify(d) + " to be a string, array, or regex");
1911
- if (F(f))
1912
+ if (B(f))
1912
1913
  throw new Error("Can not send " + h + ". Target window is closed");
1913
1914
  }(r, u, i), function(h, f) {
1914
- var d = Mn(f);
1915
+ var d = jn(f);
1915
1916
  if (d)
1916
1917
  return d === h;
1917
1918
  if (f === h || function(v) {
@@ -1934,10 +1935,10 @@ var cr = { exports: {} }, sr = { exports: {} };
1934
1935
  } catch {
1935
1936
  }
1936
1937
  for (var w = 0, S = function P(b) {
1937
- for (var R = [], y = 0, O = jn(b); y < O.length; y++) {
1938
- var B = O[y];
1939
- R.push(B);
1940
- for (var I = 0, un = P(B); I < un.length; I++)
1938
+ for (var R = [], y = 0, O = Nn(b); y < O.length; y++) {
1939
+ var H = O[y];
1940
+ R.push(H);
1941
+ for (var I = 0, un = P(H); I < un.length; I++)
1941
1942
  R.push(un[I]);
1942
1943
  }
1943
1944
  return R;
@@ -1953,7 +1954,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1953
1954
  }
1954
1955
  }(f) === f)
1955
1956
  return !1;
1956
- for (var l = 0, m = jn(h); l < m.length; l++)
1957
+ for (var l = 0, m = Nn(h); l < m.length; l++)
1957
1958
  if (m[l] === f)
1958
1959
  return !0;
1959
1960
  return !1;
@@ -1961,7 +1962,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1961
1962
  return function(h, f, d) {
1962
1963
  f === void 0 && (f = 5e3), d === void 0 && (d = "Window");
1963
1964
  var l = function(m) {
1964
- return M("helloPromises").getOrSet(m, function() {
1965
+ return C("helloPromises").getOrSet(m, function() {
1965
1966
  return new x();
1966
1967
  });
1967
1968
  }(h);
@@ -1972,7 +1973,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1972
1973
  var v = m.send;
1973
1974
  return x.try(function() {
1974
1975
  return typeof d == "string" ? d : x.try(function() {
1975
- return l || Wn(f, {
1976
+ return l || xn(f, {
1976
1977
  send: v
1977
1978
  }).then(function(w) {
1978
1979
  return w.domain;
@@ -1998,7 +1999,7 @@ var cr = { exports: {} }, sr = { exports: {} };
1998
1999
  (function(y, O) {
1999
2000
  z("responseListeners").set(y, O);
2000
2001
  })(m, v);
2001
- var w = M("requestPromises").getOrSet(u, function() {
2002
+ var w = C("requestPromises").getOrSet(u, function() {
2002
2003
  return [];
2003
2004
  });
2004
2005
  w.push(l), l.catch(function() {
@@ -2007,13 +2008,13 @@ var cr = { exports: {} }, sr = { exports: {} };
2007
2008
  })(m), er(m);
2008
2009
  });
2009
2010
  var S = function(y) {
2010
- return M("knownWindows").get(y, !1);
2011
+ return C("knownWindows").get(y, !1);
2011
2012
  }(u) ? 1e4 : 2e3, D = a, P = S, b = D, R = function(y, O) {
2012
- var B;
2013
+ var H;
2013
2014
  return function I() {
2014
- B = setTimeout(function() {
2015
+ H = setTimeout(function() {
2015
2016
  (function() {
2016
- if (F(u))
2017
+ if (B(u))
2017
2018
  return l.reject(new Error("Window closed for " + r + " before " + (v.ack ? "response" : "ack")));
2018
2019
  if (v.cancelled)
2019
2020
  return l.reject(new Error("Response listener was cancelled for " + r));
@@ -2022,7 +2023,7 @@ var cr = { exports: {} }, sr = { exports: {} };
2022
2023
  }, 500);
2023
2024
  }(), {
2024
2025
  cancel: function() {
2025
- clearTimeout(B);
2026
+ clearTimeout(H);
2026
2027
  }
2027
2028
  };
2028
2029
  }();
@@ -2030,7 +2031,7 @@ var cr = { exports: {} }, sr = { exports: {} };
2030
2031
  R.cancel(), w.splice(w.indexOf(l, 1));
2031
2032
  }).catch(k);
2032
2033
  }
2033
- return On(u, f, {
2034
+ return An(u, f, {
2034
2035
  id: J(),
2035
2036
  origin: j(window),
2036
2037
  type: "postrobot_message_request",
@@ -2064,13 +2065,13 @@ var cr = { exports: {} }, sr = { exports: {} };
2064
2065
  });
2065
2066
  }
2066
2067
  function Ir(n) {
2067
- return new T({
2068
+ return new L({
2068
2069
  send: Z,
2069
2070
  win: n
2070
2071
  });
2071
2072
  }
2072
2073
  function Dr(n) {
2073
- return T.toProxyWindow(n, {
2074
+ return L.toProxyWindow(n, {
2074
2075
  send: Z
2075
2076
  });
2076
2077
  }
@@ -2130,8 +2131,8 @@ var cr = { exports: {} }, sr = { exports: {} };
2130
2131
  }), {
2131
2132
  instanceID: Vn()
2132
2133
  };
2133
- }), c = Mn();
2134
- return c && Wn(c, {
2134
+ }), c = jn();
2135
+ return c && xn(c, {
2135
2136
  send: a
2136
2137
  }).catch(function(u) {
2137
2138
  }), s;
@@ -2153,9 +2154,9 @@ var cr = { exports: {} }, sr = { exports: {} };
2153
2154
  delete window.__post_robot_10_0_46__;
2154
2155
  }
2155
2156
  var Rr = !0;
2156
- function jr(n) {
2157
- for (var t = 0, r = M("requestPromises").get(n, []); t < r.length; t++)
2158
- r[t].reject(new Error("Window " + (F(n) ? "closed" : "cleaned up") + " before response")).catch(k);
2157
+ function Nr(n) {
2158
+ for (var t = 0, r = C("requestPromises").get(n, []); t < r.length; t++)
2159
+ r[t].reject(new Error("Window " + (B(n) ? "closed" : "cleaned up") + " before response")).catch(k);
2159
2160
  }
2160
2161
  ur();
2161
2162
  }]);
@@ -2175,17 +2176,18 @@ function Zr(E) {
2175
2176
  function qr(E) {
2176
2177
  Dn.send(E.contentWindow, "ready");
2177
2178
  }
2178
- function Vr(E, L) {
2179
- Dn.send(E.contentWindow, "userEmail", L);
2179
+ function Vr(E, N) {
2180
+ Dn.send(E.contentWindow, "config", N);
2180
2181
  }
2181
2182
  class kr {
2182
- constructor({ userEmail: L }) {
2183
- In(this, "iframe");
2184
- In(this, "userEmail");
2185
- this.iframe = Br(), this.userEmail = L, Zr(this.initialize.bind(this));
2183
+ constructor({ userEmail: N = void 0, companyName: F = void 0 }) {
2184
+ pn(this, "iframe");
2185
+ pn(this, "userEmail");
2186
+ pn(this, "companyName");
2187
+ this.iframe = Br(), this.userEmail = N, this.companyName = F, Zr(this.initialize.bind(this));
2186
2188
  }
2187
2189
  initialize() {
2188
- this.userEmail && Vr(this.iframe, this.userEmail), qr(this.iframe);
2190
+ Vr(this.iframe, { userEmail: this.userEmail, companyName: this.companyName }), qr(this.iframe);
2189
2191
  }
2190
2192
  }
2191
2193
  export {
@@ -1,17 +1,17 @@
1
- (function(H,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(H=typeof globalThis<"u"?globalThis:H||self,H["soyio-widget"]=L())})(this,function(){"use strict";var Vr=Object.defineProperty;var Yr=(H,L,q)=>L in H?Vr(H,L,{enumerable:!0,configurable:!0,writable:!0,value:q}):H[L]=q;var jn=(H,L,q)=>(Yr(H,typeof L!="symbol"?L+"":L,q),q);const H="soyio-widget-iframe",q="https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";function lr(){return document.getElementById(H)}function vr(){const I=lr();if(!I)throw new Error("Iframe does not exist");return I.src=q,I}var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mr(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var Mn={exports:{}},Nn={exports:{}};(function(I,sn){(function(fn,O){I.exports=O()})(typeof self<"u"?self:wr,function(){return function(fn){var O={};function g(p){if(O[p])return O[p].exports;var E=O[p]={i:p,l:!1,exports:{}};return fn[p].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=fn,g.c=O,g.d=function(p,E,J){g.o(p,E)||Object.defineProperty(p,E,{enumerable:!0,get:J})},g.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},g.t=function(p,E){if(1&E&&(p=g(p)),8&E||4&E&&typeof p=="object"&&p&&p.__esModule)return p;var J=Object.create(null);if(g.r(J),Object.defineProperty(J,"default",{enumerable:!0,value:p}),2&E&&typeof p!="string")for(var $ in p)g.d(J,$,(function(dn){return p[dn]}).bind(null,$));return J},g.n=function(p){var E=p&&p.__esModule?function(){return p.default}:function(){return p};return g.d(E,"a",E),E},g.o=function(p,E){return{}.hasOwnProperty.call(p,E)},g.p="",g(g.s=0)}([function(fn,O,g){g.r(O),g.d(O,"Promise",function(){return W}),g.d(O,"TYPES",function(){return Zr}),g.d(O,"ProxyWindow",function(){return T}),g.d(O,"setup",function(){return hr}),g.d(O,"destroy",function(){return Gr}),g.d(O,"serializeMessage",function(){return Br}),g.d(O,"deserializeMessage",function(){return Hr}),g.d(O,"createProxyWindow",function(){return Ur}),g.d(O,"toProxyWindow",function(){return Jr}),g.d(O,"on",function(){return G}),g.d(O,"once",function(){return Fr}),g.d(O,"send",function(){return Z}),g.d(O,"markWindowKnown",function(){return nr}),g.d(O,"cleanUpWindow",function(){return qr}),g.d(O,"bridge",function(){});function p(n){return{}.toString.call(n)==="[object RegExp]"}var E=`Call was rejected by callee.\r
2
- `;function J(n){return n===void 0&&(n=window),n.location.protocol}function $(n){if(n===void 0&&(n=window),n.mockDomain){var t=n.mockDomain.split("//")[0];if(t)return t}return J(n)}function dn(n){return n===void 0&&(n=window),$(n)==="about:"}function V(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function Cn(n){if(n===void 0&&(n=window),n&&!V(n))try{return n.opener}catch{}}function hn(n){try{return!0}catch{}return!1}function ln(n){n===void 0&&(n=window);var t=n.location;if(!t)throw new Error("Can not read window location");var r=J(n);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var e=V(n);return e&&hn()?ln(e):"about://"}var o=t.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function j(n){n===void 0&&(n=window);var t=ln(n);return t&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:t}function Y(n){if(!function(t){try{if(t===window)return!0}catch{}try{var r=Object.getOwnPropertyDescriptor(t,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(dn(t)&&hn())return!0}catch{}try{if(function(e){return e===void 0&&(e=window),$(e)==="mock:"}(t)&&hn())return!0}catch{}try{if(ln(t)===ln(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||dn(n)&&hn()||j(window)===j(n))return!0}catch{}return!1}function vn(n){if(!Y(n))throw new Error("Expected window to be same domain");return n}function Tn(n,t){if(!n||!t)return!1;var r=V(t);return r?r===n:function(e){var o=[];try{for(;e.parent!==e;)o.push(e.parent),e=e.parent}catch{}return o}(t).indexOf(n)!==-1}function Ln(n){var t=[],r;try{r=n.frames}catch{r=n}var e;try{e=r.length}catch{}if(e===0)return t;if(e){for(var o=0;o<e;o++){var i=void 0;try{i=r[o]}catch{continue}t.push(i)}return t}for(var a=0;a<100;a++){var s=void 0;try{s=r[a]}catch{return t}if(!s)return t;t.push(s)}return t}var Sr=[],br=[];function F(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!==E}if(t&&Y(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var r=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(Sr,n);if(r!==-1){var e=br[r];if(e&&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}(e))return!0}return!1}function Fn(n){return n===void 0&&(n=window),Cn(n=n||window)||V(n)||void 0}function Q(n,t){if(typeof n=="string"){if(typeof t=="string")return n==="*"||t===n;if(p(t)||Array.isArray(t))return!1}return p(n)?p(t)?n.toString()===t.toString():!Array.isArray(t)&&!!t.match(n):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!p(t)&&n.some(function(r){return Q(r,t)}))}function wn(n){try{if(n===window)return!0}catch(t){if(t&&t.message===E)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(t){if(t&&t.message===E)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.self===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.parent===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.top===n)return!0}catch(t){if(t&&t.message===E)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 Bn(n){if(Y(n))return vn(n).frameElement;for(var t=0,r=document.querySelectorAll("iframe");t<r.length;t++){var e=r[t];if(e&&e.contentWindow&&e.contentWindow===n)return e}}function Pr(n){if(function(r){return r===void 0&&(r=window),!!V(r)}(n)){var t=Bn(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 r=t.call(n);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var Hn=[],_=[],Wn=0,nn;function Un(){if(!Wn&&nn){var n=nn;nn=null,n.resolve()}}function xn(){Wn+=1}function rn(){Wn-=1,Un()}var W=function(){function n(r){var e=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=[],r){var o,i,a=!1,s=!1,c=!1;xn();try{r(function(u){c?e.resolve(u):(a=!0,o=u)},function(u){c?e.reject(u):(s=!0,i=u)})}catch(u){rn(),this.reject(u);return}rn(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var t=n.prototype;return t.resolve=function(r){if(this.resolved||this.rejected)return this;if(k(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},t.reject=function(r){var e=this;if(this.resolved||this.rejected)return this;if(k(r))throw new Error("Can not reject promise with another promise");if(!r){var o=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){e.errorHandled||function(i,a){if(Hn.indexOf(i)===-1){Hn.push(i),setTimeout(function(){throw i},1);for(var s=0;s<_.length;s++)_[s](i,a)}}(r,e)},1),this.dispatch(),this},t.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},t.dispatch=function(){var r=this.resolved,e=this.rejected,o=this.handlers;if(!this.dispatching&&(r||e)){this.dispatching=!0,xn();for(var i=function(l,m){return l.then(function(v){m.resolve(v)},function(v){m.reject(v)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,h=s.promise,f=void 0;if(r)try{f=c?c(this.value):this.value}catch(l){h.reject(l);continue}else if(e){if(!u){h.reject(this.error);continue}try{f=u(this.error)}catch(l){h.reject(l);continue}}if(f instanceof n&&(f.resolved||f.rejected)){var d=f;d.resolved?h.resolve(d.value):h.reject(d.error),d.errorHandled=!0}else k(f)?f instanceof n&&(f.resolved||f.rejected)?f.resolved?h.resolve(f.value):h.reject(f.error):i(f,h):h.resolve(f)}o.length=0,this.dispatching=!1,rn()}},t.then=function(r,e){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:r,onError:e}),this.errorHandled=!0,this.dispatch(),o},t.catch=function(r){return this.then(void 0,r)},t.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(e){return n.try(r).then(function(){return e})},function(e){return n.try(r).then(function(){throw e})})},t.timeout=function(r,e){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(e||new Error("Promise timed out after "+r+"ms"))},r);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(r){return r instanceof n?r:k(r)?new n(function(e,o){return r.then(e,o)}):new n().resolve(r)},n.reject=function(r){return new n().reject(r)},n.asyncReject=function(r){return new n().asyncReject(r)},n.all=function(r){var e=new n,o=r.length,i=[].slice();if(!o)return e.resolve(i),e;for(var a=function(u,h,f){return h.then(function(d){i[u]=d,(o-=1)==0&&e.resolve(i)},function(d){f.reject(d)})},s=0;s<r.length;s++){var c=r[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),e)}return o===0&&e.resolve(i),e},n.hash=function(r){var e={},o=[],i=function(s){if(r.hasOwnProperty(s)){var c=r[s];k(c)?o.push(c.then(function(u){e[s]=u})):e[s]=c}};for(var a in r)i(a);return n.all(o).then(function(){return e})},n.map=function(r,e){return n.all(r.map(e))},n.onPossiblyUnhandledException=function(r){return function(e){return _.push(e),{cancel:function(){_.splice(_.indexOf(e),1)}}}(r)},n.try=function(r,e,o){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var i;xn();try{i=r.apply(e,o||[])}catch(a){return rn(),n.reject(a)}return rn(),n.resolve(i)},n.delay=function(r){return new n(function(e){setTimeout(e,r)})},n.isPromise=function(r){return!!(r&&r instanceof n)||k(r)},n.flush=function(){return function(r){var e=nn=nn||new r;return Un(),e}(n)},n}();function mn(n,t){for(var r=0;r<n.length;r++)try{if(n[r]===t)return r}catch{}return-1}var Sn=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 r=new WeakMap,e={};return Object.freeze(e),r.set(e,"__testvalue__"),r.get(e)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var t=n.prototype;return t._cleanupClosedWindows=function(){for(var r=this.weakmap,e=this.keys,o=0;o<e.length;o++){var i=e[o];if(wn(i)&&F(i)){if(r)try{r.delete(i)}catch{}e.splice(o,1),this.values.splice(o,1),o-=1}}},t.isSafeToReadWrite=function(r){return!wn(r)},t.set=function(r,e){if(!r)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(r,e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var i=this.name,a=r[i];a&&a[0]===r?a[1]=e:Object.defineProperty(r,i,{value:[r,e],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=mn(s,r);u===-1?(s.push(r),c.push(e)):c[u]=e},t.get=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return e.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return o&&o[0]===r?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=mn(this.keys,r);if(i!==-1)return this.values[i]},t.delete=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];o&&o[0]===r&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=mn(i,r);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},t.has=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return!(!o||o[0]!==r)}catch{}return this._cleanupClosedWindows(),mn(this.keys,r)!==-1},t.getOrSet=function(r,e){if(this.has(r))return this.get(r);var o=e();return this.set(r,o),o},n}();function Jn(n){return n.name||n.__name__||n.displayName||"anonymous"}function Gn(n,t){try{delete n.name,n.name=t}catch{}return n.__name__=n.displayName=t,n}function U(){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(r,e){return String.fromCharCode(parseInt(e,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 pn;function Zn(n){try{return JSON.stringify([].slice.call(n),function(t,r){return typeof r=="function"?"memoize["+function(e){if(pn=pn||new Sn,e==null||typeof e!="object"&&typeof e!="function")throw new Error("Invalid object");var o=pn.get(e);return o||(o=typeof e+":"+U(),pn.set(e,o)),o}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Or(){return{}}var tn=0,qn=0;function en(n,t){t===void 0&&(t={});var r=t.thisNamespace,e=r!==void 0&&r,o=t.time,i,a,s=tn;tn+=1;var c=function(){for(var u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];s<qn&&(i=null,a=null,s=tn,tn+=1);var d;d=e?(a=a||new Sn).getOrSet(this,Or):i=i||{};var l;try{l=Zn(h)}catch{return n.apply(this,arguments)}var m=d[l];if(m&&o&&Date.now()-m.time<o&&(delete d[l],m=null),m)return m.value;var v=Date.now(),w=n.apply(this,arguments);return d[l]={time:v,value:w},w};return c.reset=function(){i=null,a=null},Gn(c,(t.name||Jn(n))+"::memoized")}en.clear=function(){qn=tn};function Ir(n){var t={};function r(){for(var e=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Zn(a);return t.hasOwnProperty(c)||(t[c]=W.try(function(){return n.apply(o,e)}).finally(function(){delete t[c]})),t[c]}return r.reset=function(){t={}},Gn(r,Jn(n)+"::promiseMemoized")}function K(){}function on(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 r=n&&n.stack,e=n&&n.message;if(r&&e)return r.indexOf(e)!==-1?r:e+`
3
- `+r;if(r)return r;if(e)return e}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+on(o,t+1)}}function Vn(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}en(function(n){if(Object.values)return Object.values(n);var t=[];for(var r in n)n.hasOwnProperty(r)&&t.push(n[r]);return t});function bn(n){return{}.toString.call(n)==="[object RegExp]"}function an(n,t,r){if(n.hasOwnProperty(t))return n[t];var e=r();return n[t]=e,e}function Yn(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function kn(){return!!document.body&&document.readyState==="complete"}function Kn(){return!!document.body&&document.readyState==="interactive"}en(function(){return new W(function(n){if(kn()||Kn())return n();var t=setInterval(function(){if(kn()||Kn())return clearInterval(t),n()},10)})});var gn=typeof document<"u"?document.currentScript:null,Ar=en(function(){if(gn||(gn=function(){try{var n=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),r=t&&t[1];if(!r)return;for(var e=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();e<o.length;e++){var i=o[e];if(i.src&&i.src===r)return i}}catch{}}()))return gn;throw new Error("Can not determine current script")}),Dr=U();en(function(){var n;try{n=Ar()}catch{return Dr}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 r=function(e){for(var o="",i=0;i<e.length;i++){var a=e[i].charCodeAt(0)*i;e[i+1]&&(a+=e[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_"+r.slice(r.length-30)}else t=U();return n.setAttribute("data-uid-auto",t),t});function un(n){n===void 0&&(n=window);var t="__post_robot_10_0_46__";return n!==window?n[t]:n[t]=n[t]||{}}var Xn=function(){return{}};function z(n,t){return n===void 0&&(n="store"),t===void 0&&(t=Xn),an(un(),n,function(){var r=t();return{has:function(e){return r.hasOwnProperty(e)},get:function(e,o){return r.hasOwnProperty(e)?r[e]:o},set:function(e,o){return r[e]=o,o},del:function(e){delete r[e]},getOrSet:function(e,o){return an(r,e,o)},reset:function(){r=t()},keys:function(){return Object.keys(r)}}})}var zr=function(){};function yn(){var n=un();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new zr,n.WINDOW_WILDCARD}function M(n,t){return n===void 0&&(n="store"),t===void 0&&(t=Xn),z("windowStore").getOrSet(n,function(){var r=new Sn,e=function(o){return r.getOrSet(o,t)};return{has:function(o){return e(o).hasOwnProperty(n)},get:function(o,i){var a=e(o);return a.hasOwnProperty(n)?a[n]:i},set:function(o,i){return e(o)[n]=i,i},del:function(o){delete e(o)[n]},getOrSet:function(o,i){return an(e(o),n,i)}}})}function Qn(){return z("instance").getOrSet("instanceID",U)}function $n(n,t){var r=t.domain,e=M("helloPromises"),o=e.get(n);o&&o.resolve({domain:r});var i=W.resolve({domain:r});return e.set(n,i),i}function Pn(n,t){return(0,t.send)(n,"postrobot_hello",{instanceID:Qn()},{domain:"*",timeout:-1}).then(function(r){var e=r.origin,o=r.data.instanceID;return $n(n,{domain:e}),{win:n,domain:e,instanceID:o}})}function _n(n,t){var r=t.send;return M("windowInstanceIDPromises").getOrSet(n,function(){return Pn(n,{send:r}).then(function(e){return e.instanceID})})}function nr(n){M("knownWindows").set(n,!0)}function On(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function rr(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 X(n,t){return{__type__:n,__val__:t}}var N,Rr=((N={}).function=function(){},N.error=function(n){return X("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},N.promise=function(){},N.regex=function(n){return X("regex",n.source)},N.date=function(n){return X("date",n.toJSON())},N.array=function(n){return n},N.object=function(n){return n},N.string=function(n){return n},N.number=function(n){return n},N.boolean=function(n){return n},N.null=function(n){return n},N[void 0]=function(n){return X("undefined",n)},N),jr={},C,Mr=((C={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},C.error=function(n){var t=n.stack,r=n.code,e=n.data,o=new Error(n.message);return o.code=r,e&&(o.data=e),o.stack=t+`
1
+ (function(H,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(H=typeof globalThis<"u"?globalThis:H||self,H["soyio-widget"]=L())})(this,function(){"use strict";var Vr=Object.defineProperty;var Yr=(H,L,V)=>L in H?Vr(H,L,{enumerable:!0,configurable:!0,writable:!0,value:V}):H[L]=V;var En=(H,L,V)=>(Yr(H,typeof L!="symbol"?L+"":L,V),V);const H="soyio-widget-iframe-container",V="https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";function lr(){return document.getElementById(H)}function vr(){const I=lr();if(!I)throw new Error("Iframe container does not exist");const G=document.createElement("iframe");return G.src=V,I.appendChild(G),G}var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mr(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var jn={exports:{}},Mn={exports:{}};(function(I,G){(function($,O){I.exports=O()})(typeof self<"u"?self:wr,function(){return function($){var O={};function g(p){if(O[p])return O[p].exports;var E=O[p]={i:p,l:!1,exports:{}};return $[p].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=$,g.c=O,g.d=function(p,E,U){g.o(p,E)||Object.defineProperty(p,E,{enumerable:!0,get:U})},g.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},g.t=function(p,E){if(1&E&&(p=g(p)),8&E||4&E&&typeof p=="object"&&p&&p.__esModule)return p;var U=Object.create(null);if(g.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:p}),2&E&&typeof p!="string")for(var nn in p)g.d(U,nn,(function(dn){return p[dn]}).bind(null,nn));return U},g.n=function(p){var E=p&&p.__esModule?function(){return p.default}:function(){return p};return g.d(E,"a",E),E},g.o=function(p,E){return{}.hasOwnProperty.call(p,E)},g.p="",g(g.s=0)}([function($,O,g){g.r(O),g.d(O,"Promise",function(){return W}),g.d(O,"TYPES",function(){return Zr}),g.d(O,"ProxyWindow",function(){return T}),g.d(O,"setup",function(){return hr}),g.d(O,"destroy",function(){return Gr}),g.d(O,"serializeMessage",function(){return Br}),g.d(O,"deserializeMessage",function(){return Hr}),g.d(O,"createProxyWindow",function(){return Jr}),g.d(O,"toProxyWindow",function(){return Ur}),g.d(O,"on",function(){return Z}),g.d(O,"once",function(){return Fr}),g.d(O,"send",function(){return q}),g.d(O,"markWindowKnown",function(){return nr}),g.d(O,"cleanUpWindow",function(){return qr}),g.d(O,"bridge",function(){});function p(n){return{}.toString.call(n)==="[object RegExp]"}var E=`Call was rejected by callee.\r
2
+ `;function U(n){return n===void 0&&(n=window),n.location.protocol}function nn(n){if(n===void 0&&(n=window),n.mockDomain){var e=n.mockDomain.split("//")[0];if(e)return e}return U(n)}function dn(n){return n===void 0&&(n=window),nn(n)==="about:"}function Y(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function Cn(n){if(n===void 0&&(n=window),n&&!Y(n))try{return n.opener}catch{}}function hn(n){try{return!0}catch{}return!1}function ln(n){n===void 0&&(n=window);var e=n.location;if(!e)throw new Error("Can not read window location");var r=U(n);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var t=Y(n);return t&&hn()?ln(t):"about://"}var o=e.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function N(n){n===void 0&&(n=window);var e=ln(n);return e&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:e}function k(n){if(!function(e){try{if(e===window)return!0}catch{}try{var r=Object.getOwnPropertyDescriptor(e,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(dn(e)&&hn())return!0}catch{}try{if(function(t){return t===void 0&&(t=window),nn(t)==="mock:"}(e)&&hn())return!0}catch{}try{if(ln(e)===ln(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||dn(n)&&hn()||N(window)===N(n))return!0}catch{}return!1}function vn(n){if(!k(n))throw new Error("Expected window to be same domain");return n}function Tn(n,e){if(!n||!e)return!1;var r=Y(e);return r?r===n:function(t){var o=[];try{for(;t.parent!==t;)o.push(t.parent),t=t.parent}catch{}return o}(e).indexOf(n)!==-1}function Ln(n){var e=[],r;try{r=n.frames}catch{r=n}var t;try{t=r.length}catch{}if(t===0)return e;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=r[o]}catch{continue}e.push(i)}return e}for(var a=0;a<100;a++){var s=void 0;try{s=r[a]}catch{return e}if(!s)return e;e.push(s)}return e}var Sr=[],br=[];function F(n,e){e===void 0&&(e=!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!==E}if(e&&k(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var r=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(Sr,n);if(r!==-1){var t=br[r];if(t&&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}(t))return!0}return!1}function Fn(n){return n===void 0&&(n=window),Cn(n=n||window)||Y(n)||void 0}function _(n,e){if(typeof n=="string"){if(typeof e=="string")return n==="*"||e===n;if(p(e)||Array.isArray(e))return!1}return p(n)?p(e)?n.toString()===e.toString():!Array.isArray(e)&&!!e.match(n):!!Array.isArray(n)&&(Array.isArray(e)?JSON.stringify(n)===JSON.stringify(e):!p(e)&&n.some(function(r){return _(r,e)}))}function wn(n){try{if(n===window)return!0}catch(e){if(e&&e.message===E)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(e){if(e&&e.message===E)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(e){if(e&&e.message===E)return!0}try{if(n&&n.self===n)return!0}catch(e){if(e&&e.message===E)return!0}try{if(n&&n.parent===n)return!0}catch(e){if(e&&e.message===E)return!0}try{if(n&&n.top===n)return!0}catch(e){if(e&&e.message===E)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 Bn(n){if(k(n))return vn(n).frameElement;for(var e=0,r=document.querySelectorAll("iframe");e<r.length;e++){var t=r[e];if(t&&t.contentWindow&&t.contentWindow===n)return t}}function Pr(n){if(function(r){return r===void 0&&(r=window),!!Y(r)}(n)){var e=Bn(n);if(e&&e.parentElement){e.parentElement.removeChild(e);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 e={}.toString;if(e){var r=e.call(n);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var Hn=[],rn=[],xn=0,en;function Jn(){if(!xn&&en){var n=en;en=null,n.resolve()}}function Sn(){xn+=1}function tn(){xn-=1,Jn()}var W=function(){function n(r){var t=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=[],r){var o,i,a=!1,s=!1,c=!1;Sn();try{r(function(u){c?t.resolve(u):(a=!0,o=u)},function(u){c?t.reject(u):(s=!0,i=u)})}catch(u){tn(),this.reject(u);return}tn(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var e=n.prototype;return e.resolve=function(r){if(this.resolved||this.rejected)return this;if(K(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},e.reject=function(r){var t=this;if(this.resolved||this.rejected)return this;if(K(r))throw new Error("Can not reject promise with another promise");if(!r){var o=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){t.errorHandled||function(i,a){if(Hn.indexOf(i)===-1){Hn.push(i),setTimeout(function(){throw i},1);for(var s=0;s<rn.length;s++)rn[s](i,a)}}(r,t)},1),this.dispatch(),this},e.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},e.dispatch=function(){var r=this.resolved,t=this.rejected,o=this.handlers;if(!this.dispatching&&(r||t)){this.dispatching=!0,Sn();for(var i=function(l,m){return l.then(function(v){m.resolve(v)},function(v){m.reject(v)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,h=s.promise,f=void 0;if(r)try{f=c?c(this.value):this.value}catch(l){h.reject(l);continue}else if(t){if(!u){h.reject(this.error);continue}try{f=u(this.error)}catch(l){h.reject(l);continue}}if(f instanceof n&&(f.resolved||f.rejected)){var d=f;d.resolved?h.resolve(d.value):h.reject(d.error),d.errorHandled=!0}else K(f)?f instanceof n&&(f.resolved||f.rejected)?f.resolved?h.resolve(f.value):h.reject(f.error):i(f,h):h.resolve(f)}o.length=0,this.dispatching=!1,tn()}},e.then=function(r,t){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:r,onError:t}),this.errorHandled=!0,this.dispatch(),o},e.catch=function(r){return this.then(void 0,r)},e.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(t){return n.try(r).then(function(){return t})},function(t){return n.try(r).then(function(){throw t})})},e.timeout=function(r,t){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(t||new Error("Promise timed out after "+r+"ms"))},r);return this.then(function(a){return clearTimeout(i),a})},e.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(r){return r instanceof n?r:K(r)?new n(function(t,o){return r.then(t,o)}):new n().resolve(r)},n.reject=function(r){return new n().reject(r)},n.asyncReject=function(r){return new n().asyncReject(r)},n.all=function(r){var t=new n,o=r.length,i=[].slice();if(!o)return t.resolve(i),t;for(var a=function(u,h,f){return h.then(function(d){i[u]=d,(o-=1)==0&&t.resolve(i)},function(d){f.reject(d)})},s=0;s<r.length;s++){var c=r[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),t)}return o===0&&t.resolve(i),t},n.hash=function(r){var t={},o=[],i=function(s){if(r.hasOwnProperty(s)){var c=r[s];K(c)?o.push(c.then(function(u){t[s]=u})):t[s]=c}};for(var a in r)i(a);return n.all(o).then(function(){return t})},n.map=function(r,t){return n.all(r.map(t))},n.onPossiblyUnhandledException=function(r){return function(t){return rn.push(t),{cancel:function(){rn.splice(rn.indexOf(t),1)}}}(r)},n.try=function(r,t,o){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var i;Sn();try{i=r.apply(t,o||[])}catch(a){return tn(),n.reject(a)}return tn(),n.resolve(i)},n.delay=function(r){return new n(function(t){setTimeout(t,r)})},n.isPromise=function(r){return!!(r&&r instanceof n)||K(r)},n.flush=function(){return function(r){var t=en=en||new r;return Jn(),t}(n)},n}();function mn(n,e){for(var r=0;r<n.length;r++)try{if(n[r]===e)return r}catch{}return-1}var bn=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 r=new WeakMap,t={};return Object.freeze(t),r.set(t,"__testvalue__"),r.get(t)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var e=n.prototype;return e._cleanupClosedWindows=function(){for(var r=this.weakmap,t=this.keys,o=0;o<t.length;o++){var i=t[o];if(wn(i)&&F(i)){if(r)try{r.delete(i)}catch{}t.splice(o,1),this.values.splice(o,1),o-=1}}},e.isSafeToReadWrite=function(r){return!wn(r)},e.set=function(r,t){if(!r)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(r,t)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var i=this.name,a=r[i];a&&a[0]===r?a[1]=t:Object.defineProperty(r,i,{value:[r,t],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=mn(s,r);u===-1?(s.push(r),c.push(t)):c[u]=t},e.get=function(r){if(!r)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(r))return t.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return o&&o[0]===r?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=mn(this.keys,r);if(i!==-1)return this.values[i]},e.delete=function(r){if(!r)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];o&&o[0]===r&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=mn(i,r);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},e.has=function(r){if(!r)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return!(!o||o[0]!==r)}catch{}return this._cleanupClosedWindows(),mn(this.keys,r)!==-1},e.getOrSet=function(r,t){if(this.has(r))return this.get(r);var o=t();return this.set(r,o),o},n}();function Un(n){return n.name||n.__name__||n.displayName||"anonymous"}function Gn(n,e){try{delete n.name,n.name=e}catch{}return n.__name__=n.displayName=e,n}function J(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(e){if(typeof btoa=="function")return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(r,t){return String.fromCharCode(parseInt(t,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(e,"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 pn;function Zn(n){try{return JSON.stringify([].slice.call(n),function(e,r){return typeof r=="function"?"memoize["+function(t){if(pn=pn||new bn,t==null||typeof t!="object"&&typeof t!="function")throw new Error("Invalid object");var o=pn.get(t);return o||(o=typeof t+":"+J(),pn.set(t,o)),o}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Or(){return{}}var on=0,qn=0;function an(n,e){e===void 0&&(e={});var r=e.thisNamespace,t=r!==void 0&&r,o=e.time,i,a,s=on;on+=1;var c=function(){for(var u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];s<qn&&(i=null,a=null,s=on,on+=1);var d;d=t?(a=a||new bn).getOrSet(this,Or):i=i||{};var l;try{l=Zn(h)}catch{return n.apply(this,arguments)}var m=d[l];if(m&&o&&Date.now()-m.time<o&&(delete d[l],m=null),m)return m.value;var v=Date.now(),w=n.apply(this,arguments);return d[l]={time:v,value:w},w};return c.reset=function(){i=null,a=null},Gn(c,(e.name||Un(n))+"::memoized")}an.clear=function(){qn=on};function Ir(n){var e={};function r(){for(var t=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Zn(a);return e.hasOwnProperty(c)||(e[c]=W.try(function(){return n.apply(o,t)}).finally(function(){delete e[c]})),e[c]}return r.reset=function(){e={}},Gn(r,Un(n)+"::promiseMemoized")}function X(){}function un(n,e){if(e===void 0&&(e=1),e>=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 r=n&&n.stack,t=n&&n.message;if(r&&t)return r.indexOf(t)!==-1?r:t+`
3
+ `+r;if(r)return r;if(t)return t}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+un(o,e+1)}}function Vn(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}an(function(n){if(Object.values)return Object.values(n);var e=[];for(var r in n)n.hasOwnProperty(r)&&e.push(n[r]);return e});function Pn(n){return{}.toString.call(n)==="[object RegExp]"}function cn(n,e,r){if(n.hasOwnProperty(e))return n[e];var t=r();return n[e]=t,t}function Yn(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function kn(){return!!document.body&&document.readyState==="complete"}function Kn(){return!!document.body&&document.readyState==="interactive"}an(function(){return new W(function(n){if(kn()||Kn())return n();var e=setInterval(function(){if(kn()||Kn())return clearInterval(e),n()},10)})});var gn=typeof document<"u"?document.currentScript:null,Ar=an(function(){if(gn||(gn=function(){try{var n=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),e=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),r=e&&e[1];if(!r)return;for(var t=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();t<o.length;t++){var i=o[t];if(i.src&&i.src===r)return i}}catch{}}()))return gn;throw new Error("Can not determine current script")}),Dr=J();an(function(){var n;try{n=Ar()}catch{return Dr}var e=n.getAttribute("data-uid");if(e&&typeof e=="string"||(e=n.getAttribute("data-uid-auto"))&&typeof e=="string")return e;if(n.src){var r=function(t){for(var o="",i=0;i<t.length;i++){var a=t[i].charCodeAt(0)*i;t[i+1]&&(a+=t[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:n.src,dataset:n.dataset}));e="uid_"+r.slice(r.length-30)}else e=J();return n.setAttribute("data-uid-auto",e),e});function sn(n){n===void 0&&(n=window);var e="__post_robot_10_0_46__";return n!==window?n[e]:n[e]=n[e]||{}}var Xn=function(){return{}};function z(n,e){return n===void 0&&(n="store"),e===void 0&&(e=Xn),cn(sn(),n,function(){var r=e();return{has:function(t){return r.hasOwnProperty(t)},get:function(t,o){return r.hasOwnProperty(t)?r[t]:o},set:function(t,o){return r[t]=o,o},del:function(t){delete r[t]},getOrSet:function(t,o){return cn(r,t,o)},reset:function(){r=e()},keys:function(){return Object.keys(r)}}})}var zr=function(){};function yn(){var n=sn();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new zr,n.WINDOW_WILDCARD}function j(n,e){return n===void 0&&(n="store"),e===void 0&&(e=Xn),z("windowStore").getOrSet(n,function(){var r=new bn,t=function(o){return r.getOrSet(o,e)};return{has:function(o){return t(o).hasOwnProperty(n)},get:function(o,i){var a=t(o);return a.hasOwnProperty(n)?a[n]:i},set:function(o,i){return t(o)[n]=i,i},del:function(o){delete t(o)[n]},getOrSet:function(o,i){return cn(t(o),n,i)}}})}function Qn(){return z("instance").getOrSet("instanceID",J)}function $n(n,e){var r=e.domain,t=j("helloPromises"),o=t.get(n);o&&o.resolve({domain:r});var i=W.resolve({domain:r});return t.set(n,i),i}function On(n,e){return(0,e.send)(n,"postrobot_hello",{instanceID:Qn()},{domain:"*",timeout:-1}).then(function(r){var t=r.origin,o=r.data.instanceID;return $n(n,{domain:t}),{win:n,domain:t,instanceID:o}})}function _n(n,e){var r=e.send;return j("windowInstanceIDPromises").getOrSet(n,function(){return On(n,{send:r}).then(function(t){return t.instanceID})})}function nr(n){j("knownWindows").set(n,!0)}function In(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function rr(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 Q(n,e){return{__type__:n,__val__:e}}var M,Rr=((M={}).function=function(){},M.error=function(n){return Q("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},M.promise=function(){},M.regex=function(n){return Q("regex",n.source)},M.date=function(n){return Q("date",n.toJSON())},M.array=function(n){return n},M.object=function(n){return n},M.string=function(n){return n},M.number=function(n){return n},M.boolean=function(n){return n},M.null=function(n){return n},M[void 0]=function(n){return Q("undefined",n)},M),Nr={},C,jr=((C={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},C.error=function(n){var e=n.stack,r=n.code,t=n.data,o=new Error(n.message);return o.code=r,t&&(o.data=t),o.stack=e+`
4
4
 
5
- `+o.stack,o},C.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},C.regex=function(n){return new RegExp(n)},C.date=function(n){return new Date(n)},C.array=function(n){return n},C.object=function(n){return n},C.string=function(n){return n},C.number=function(n){return n},C.boolean=function(n){return n},C.null=function(n){return n},C[void 0]=function(){},C),Nr={};new W(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 In(){for(var n=z("idToProxyWindow"),t=0,r=n.keys();t<r.length;t++){var e=r[t];n.get(e).shouldClean()&&n.del(e)}}function tr(n,t){var r=t.send,e=t.id,o=e===void 0?U():e,i=n.then(function(c){if(Y(c))return vn(c).name}),a=n.then(function(c){if(F(c))throw new Error("Window is closed, can not determine type");return Cn(c)?"popup":"iframe"});i.catch(K),a.catch(K);var s=function(){return n.then(function(c){if(!F(c))return Y(c)?vn(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:Ir(function(){return n.then(function(c){return _n(c,{send:r})})}),close:function(){return n.then(Pr)},getName:s,focus:function(){return n.then(function(c){c.focus()})},isClosed:function(){return n.then(function(c){return F(c)})},setLocation:function(c,u){return u===void 0&&(u={}),n.then(function(h){var f=window.location.protocol+"//"+window.location.host,d=u.method,l=d===void 0?"get":d,m=u.body;if(c.indexOf("/")===0)c=""+f+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(f)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(l==="post")return s().then(function(v){if(!v)throw new Error("Can not post to window without target name");(function(w){var x=w.url,D=w.target,b=w.body,S=w.method,R=S===void 0?"post":S,y=document.createElement("form");if(y.setAttribute("target",D),y.setAttribute("method",R),y.setAttribute("action",x),y.style.display="none",b)for(var P=0,B=Object.keys(b);P<B.length;P++){var A,cn=B[P],Rn=document.createElement("input");Rn.setAttribute("name",cn),Rn.setAttribute("value",(A=b[cn])==null?void 0:A.toString()),y.appendChild(Rn)}Yn().appendChild(y),y.submit(),Yn().removeChild(y)})({url:c,target:v,method:l,body:m})});if(l!=="get")throw new Error("Unsupported method: "+l);if(Y(h))try{if(h.location&&typeof h.location.replace=="function"){h.location.replace(c);return}}catch{}h.location=c})},setName:function(c){return n.then(function(u){var h=Y(u),f=Bn(u);if(!h)throw new Error("Can not set name for cross-domain window: "+c);vn(u).name=c,f&&f.setAttribute("name",c),i=W.resolve(c)})}}}var T=function(){function n(r){var e=r.send,o=r.win,i=r.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 W,this.serializedWindow=i||tr(this.actualWindowPromise,{send:e}),z("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:e})}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(r){return r==="popup"})},t.setLocation=function(r,e){var o=this;return this.serializedWindow.setLocation(r,e).then(function(){return o})},t.getName=function(){return this.serializedWindow.getName()},t.setName=function(r){var e=this;return this.serializedWindow.setName(r).then(function(){return e})},t.close=function(){var r=this;return this.serializedWindow.close().then(function(){return r})},t.focus=function(){var r=this,e=this.isPopup(),o=this.getName(),i=W.hash({isPopup:e,name:o}).then(function(s){var c=s.name;s.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return W.all([i,a]).then(function(){return r})},t.isClosed=function(){return this.serializedWindow.isClosed()},t.getWindow=function(){return this.actualWindow},t.setWindow=function(r,e){var o=e.send;this.actualWindow=r,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=tr(this.actualWindowPromise,{send:o,id:this.getID()}),M("winToProxyWindow").set(r,this)},t.awaitWindow=function(){return this.actualWindowPromise},t.matchWindow=function(r,e){var o=this,i=e.send;return W.try(function(){return o.actualWindow?r===o.actualWindow:W.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:_n(r,{send:i})}).then(function(a){var s=a.proxyInstanceID===a.knownWindowInstanceID;return s&&o.setWindow(r,{send:i}),s})})},t.unwrap=function(){return this.actualWindow||this},t.getInstanceID=function(){return this.serializedWindow.getInstanceID()},t.shouldClean=function(){return!!(this.actualWindow&&F(this.actualWindow))},t.serialize=function(){return this.serializedWindow},n.unwrap=function(r){return n.isProxyWindow(r)?r.unwrap():r},n.serialize=function(r,e){var o=e.send;return In(),n.toProxyWindow(r,{send:o}).serialize()},n.deserialize=function(r,e){var o=e.send;return In(),z("idToProxyWindow").get(r.id)||new n({serializedWindow:r,send:o})},n.isProxyWindow=function(r){return!!(r&&!wn(r)&&r.isProxyWindow)},n.toProxyWindow=function(r,e){var o=e.send;if(In(),n.isProxyWindow(r))return r;var i=r;return M("winToProxyWindow").get(i)||new n({win:i,send:o})},n}();function An(n,t,r,e,o){var i=M("methodStore"),a=z("proxyWindowMethods");T.isProxyWindow(e)?a.set(n,{val:t,name:r,domain:o,source:e}):(a.del(n),i.getOrSet(e,function(){return{}})[n]={domain:o,name:r,val:t,source:e})}function er(n,t){var r=M("methodStore"),e=z("proxyWindowMethods");return r.getOrSet(n,function(){return{}})[t]||e.get(t)}function or(n,t,r,e,o){a=(i={on:o.on,send:o.send}).on,s=i.send,z("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(h){var f=h.source,d=h.origin,l=h.data,m=l.id,v=l.name,w=er(f,m);if(!w)throw new Error("Could not find method '"+v+"' with id: "+l.id+" in "+j(window));var x=w.source,D=w.domain,b=w.val;return W.try(function(){if(!Q(D,d))throw new Error("Method '"+l.name+"' domain "+JSON.stringify(bn(w.domain)?w.domain.source:w.domain)+" does not match origin "+d+" in "+j(window));if(T.isProxyWindow(x))return x.matchWindow(f,{send:s}).then(function(S){if(!S)throw new Error("Method call '"+l.name+"' failed - proxy window does not match source in "+j(window))})}).then(function(){return b.apply({source:f,origin:d},l.args)},function(S){return W.try(function(){if(b.onError)return b.onError(S)}).then(function(){throw S.stack&&(S.stack="Remote call to "+v+"("+function(R){return R===void 0&&(R=[]),(y=R,[].slice.call(y)).map(function(P){return typeof P=="string"?"'"+P+"'":P===void 0?"undefined":P===null?"null":typeof P=="boolean"?P.toString():Array.isArray(P)?"[ ... ]":typeof P=="object"?"{ ... }":typeof P=="function"?"() => { ... }":"<"+typeof P+">"}).join(", ");var y}(l.args)+`) failed
5
+ `+o.stack,o},C.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},C.regex=function(n){return new RegExp(n)},C.date=function(n){return new Date(n)},C.array=function(n){return n},C.object=function(n){return n},C.string=function(n){return n},C.number=function(n){return n},C.boolean=function(n){return n},C.null=function(n){return n},C[void 0]=function(){},C),Mr={};new W(function(n){if(window.document&&window.document.body)return n(window.document.body);var e=setInterval(function(){if(window.document&&window.document.body)return clearInterval(e),n(window.document.body)},10)});function An(){for(var n=z("idToProxyWindow"),e=0,r=n.keys();e<r.length;e++){var t=r[e];n.get(t).shouldClean()&&n.del(t)}}function er(n,e){var r=e.send,t=e.id,o=t===void 0?J():t,i=n.then(function(c){if(k(c))return vn(c).name}),a=n.then(function(c){if(F(c))throw new Error("Window is closed, can not determine type");return Cn(c)?"popup":"iframe"});i.catch(X),a.catch(X);var s=function(){return n.then(function(c){if(!F(c))return k(c)?vn(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:Ir(function(){return n.then(function(c){return _n(c,{send:r})})}),close:function(){return n.then(Pr)},getName:s,focus:function(){return n.then(function(c){c.focus()})},isClosed:function(){return n.then(function(c){return F(c)})},setLocation:function(c,u){return u===void 0&&(u={}),n.then(function(h){var f=window.location.protocol+"//"+window.location.host,d=u.method,l=d===void 0?"get":d,m=u.body;if(c.indexOf("/")===0)c=""+f+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(f)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(l==="post")return s().then(function(v){if(!v)throw new Error("Can not post to window without target name");(function(w){var x=w.url,D=w.target,b=w.body,S=w.method,R=S===void 0?"post":S,y=document.createElement("form");if(y.setAttribute("target",D),y.setAttribute("method",R),y.setAttribute("action",x),y.style.display="none",b)for(var P=0,B=Object.keys(b);P<B.length;P++){var A,fn=B[P],Nn=document.createElement("input");Nn.setAttribute("name",fn),Nn.setAttribute("value",(A=b[fn])==null?void 0:A.toString()),y.appendChild(Nn)}Yn().appendChild(y),y.submit(),Yn().removeChild(y)})({url:c,target:v,method:l,body:m})});if(l!=="get")throw new Error("Unsupported method: "+l);if(k(h))try{if(h.location&&typeof h.location.replace=="function"){h.location.replace(c);return}}catch{}h.location=c})},setName:function(c){return n.then(function(u){var h=k(u),f=Bn(u);if(!h)throw new Error("Can not set name for cross-domain window: "+c);vn(u).name=c,f&&f.setAttribute("name",c),i=W.resolve(c)})}}}var T=function(){function n(r){var t=r.send,o=r.win,i=r.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 W,this.serializedWindow=i||er(this.actualWindowPromise,{send:t}),z("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:t})}var e=n.prototype;return e.getID=function(){return this.serializedWindow.id},e.getType=function(){return this.serializedWindow.getType()},e.isPopup=function(){return this.getType().then(function(r){return r==="popup"})},e.setLocation=function(r,t){var o=this;return this.serializedWindow.setLocation(r,t).then(function(){return o})},e.getName=function(){return this.serializedWindow.getName()},e.setName=function(r){var t=this;return this.serializedWindow.setName(r).then(function(){return t})},e.close=function(){var r=this;return this.serializedWindow.close().then(function(){return r})},e.focus=function(){var r=this,t=this.isPopup(),o=this.getName(),i=W.hash({isPopup:t,name:o}).then(function(s){var c=s.name;s.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return W.all([i,a]).then(function(){return r})},e.isClosed=function(){return this.serializedWindow.isClosed()},e.getWindow=function(){return this.actualWindow},e.setWindow=function(r,t){var o=t.send;this.actualWindow=r,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=er(this.actualWindowPromise,{send:o,id:this.getID()}),j("winToProxyWindow").set(r,this)},e.awaitWindow=function(){return this.actualWindowPromise},e.matchWindow=function(r,t){var o=this,i=t.send;return W.try(function(){return o.actualWindow?r===o.actualWindow:W.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:_n(r,{send:i})}).then(function(a){var s=a.proxyInstanceID===a.knownWindowInstanceID;return s&&o.setWindow(r,{send:i}),s})})},e.unwrap=function(){return this.actualWindow||this},e.getInstanceID=function(){return this.serializedWindow.getInstanceID()},e.shouldClean=function(){return!!(this.actualWindow&&F(this.actualWindow))},e.serialize=function(){return this.serializedWindow},n.unwrap=function(r){return n.isProxyWindow(r)?r.unwrap():r},n.serialize=function(r,t){var o=t.send;return An(),n.toProxyWindow(r,{send:o}).serialize()},n.deserialize=function(r,t){var o=t.send;return An(),z("idToProxyWindow").get(r.id)||new n({serializedWindow:r,send:o})},n.isProxyWindow=function(r){return!!(r&&!wn(r)&&r.isProxyWindow)},n.toProxyWindow=function(r,t){var o=t.send;if(An(),n.isProxyWindow(r))return r;var i=r;return j("winToProxyWindow").get(i)||new n({win:i,send:o})},n}();function Dn(n,e,r,t,o){var i=j("methodStore"),a=z("proxyWindowMethods");T.isProxyWindow(t)?a.set(n,{val:e,name:r,domain:o,source:t}):(a.del(n),i.getOrSet(t,function(){return{}})[n]={domain:o,name:r,val:e,source:t})}function tr(n,e){var r=j("methodStore"),t=z("proxyWindowMethods");return r.getOrSet(n,function(){return{}})[e]||t.get(e)}function or(n,e,r,t,o){a=(i={on:o.on,send:o.send}).on,s=i.send,z("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(h){var f=h.source,d=h.origin,l=h.data,m=l.id,v=l.name,w=tr(f,m);if(!w)throw new Error("Could not find method '"+v+"' with id: "+l.id+" in "+N(window));var x=w.source,D=w.domain,b=w.val;return W.try(function(){if(!_(D,d))throw new Error("Method '"+l.name+"' domain "+JSON.stringify(Pn(w.domain)?w.domain.source:w.domain)+" does not match origin "+d+" in "+N(window));if(T.isProxyWindow(x))return x.matchWindow(f,{send:s}).then(function(S){if(!S)throw new Error("Method call '"+l.name+"' failed - proxy window does not match source in "+N(window))})}).then(function(){return b.apply({source:f,origin:d},l.args)},function(S){return W.try(function(){if(b.onError)return b.onError(S)}).then(function(){throw S.stack&&(S.stack="Remote call to "+v+"("+function(R){return R===void 0&&(R=[]),(y=R,[].slice.call(y)).map(function(P){return typeof P=="string"?"'"+P+"'":P===void 0?"undefined":P===null?"null":typeof P=="boolean"?P.toString():Array.isArray(P)?"[ ... ]":typeof P=="object"?"{ ... }":typeof P=="function"?"() => { ... }":"<"+typeof P+">"}).join(", ");var y}(l.args)+`) failed
6
6
 
7
- `+S.stack),S})}).then(function(S){return{result:S,id:m,name:v}})})});var i,a,s,c=r.__id__||U();n=T.unwrap(n);var u=r.__name__||r.name||e;return typeof u=="string"&&typeof u.indexOf=="function"&&u.indexOf("anonymous::")===0&&(u=u.replace("anonymous::",e+"::")),T.isProxyWindow(n)?(An(c,r,u,n,t),n.awaitWindow().then(function(h){An(c,r,u,h,t)})):An(c,r,u,n,t),X("cross_domain_function",{id:c,name:u})}function ir(n,t,r,e){var o,i=e.on,a=e.send;return function(s,c){c===void 0&&(c=jr);var u=JSON.stringify(s,function(h){var f=this[h];if(On(this))return f;var d=rr(f);if(!d)return f;var l=c[d]||Rr[d];return l?l(f,h):f});return u===void 0?"undefined":u}(r,((o={}).promise=function(s,c){return function(u,h,f,d,l){return X("cross_domain_zalgo_promise",{then:or(u,h,function(m,v){return f.then(m,v)},d,{on:l.on,send:l.send})})}(n,t,s,c,{on:i,send:a})},o.function=function(s,c){return or(n,t,s,c,{on:i,send:a})},o.object=function(s){return wn(s)||T.isProxyWindow(s)?X("cross_domain_window",T.serialize(s,{send:a})):s},o))}function ar(n,t,r,e){var o,i=e.send;return function(a,s){if(s===void 0&&(s=Nr),a!=="undefined")return JSON.parse(a,function(c,u){if(On(this))return u;var h,f;if(On(u)?(h=u.__type__,f=u.__val__):(h=rr(u),f=u),!h)return f;var d=s[h]||Mr[h];return d?d(f,c):f})}(r,((o={}).cross_domain_zalgo_promise=function(a){return function(s,c,u){return new W(u.then)}(0,0,a)},o.cross_domain_function=function(a){return function(s,c,u,h){var f=u.id,d=u.name,l=h.send,m=function(w){w===void 0&&(w={});function x(){var D=arguments;return T.toProxyWindow(s,{send:l}).awaitWindow().then(function(b){var S=er(b,f);if(S&&S.val!==x)return S.val.apply({source:window,origin:j()},D);var R=[].slice.call(D);return w.fireAndForget?l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!0}):l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!1}).then(function(y){return y.data.result})}).catch(function(b){throw b})}return x.__name__=d,x.__origin__=c,x.__source__=s,x.__id__=f,x.origin=c,x},v=m();return v.fireAndForget=m({fireAndForget:!0}),v}(n,t,a,{send:i})},o.cross_domain_window=function(a){return T.deserialize(a,{send:i})},o))}var Dn={};Dn.postrobot_post_message=function(n,t,r){r.indexOf("file:")===0&&(r="*"),n.postMessage(t,r)};function zn(n,t,r,e){var o=e.on,i=e.send;return W.try(function(){var a=M().getOrSet(n,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(r),a.flush=a.flush||W.flush().then(function(){if(F(n))throw new Error("Window is closed");var s=ir(n,t,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var u=Object.keys(Dn),h=[],f=0;f<u.length;f++){var d=u[f];try{Dn[d](n,s,t)}catch(l){h.push(l)}}if(h.length===u.length)throw new Error(`All post-robot messaging strategies failed:
7
+ `+S.stack),S})}).then(function(S){return{result:S,id:m,name:v}})})});var i,a,s,c=r.__id__||J();n=T.unwrap(n);var u=r.__name__||r.name||t;return typeof u=="string"&&typeof u.indexOf=="function"&&u.indexOf("anonymous::")===0&&(u=u.replace("anonymous::",t+"::")),T.isProxyWindow(n)?(Dn(c,r,u,n,e),n.awaitWindow().then(function(h){Dn(c,r,u,h,e)})):Dn(c,r,u,n,e),Q("cross_domain_function",{id:c,name:u})}function ir(n,e,r,t){var o,i=t.on,a=t.send;return function(s,c){c===void 0&&(c=Nr);var u=JSON.stringify(s,function(h){var f=this[h];if(In(this))return f;var d=rr(f);if(!d)return f;var l=c[d]||Rr[d];return l?l(f,h):f});return u===void 0?"undefined":u}(r,((o={}).promise=function(s,c){return function(u,h,f,d,l){return Q("cross_domain_zalgo_promise",{then:or(u,h,function(m,v){return f.then(m,v)},d,{on:l.on,send:l.send})})}(n,e,s,c,{on:i,send:a})},o.function=function(s,c){return or(n,e,s,c,{on:i,send:a})},o.object=function(s){return wn(s)||T.isProxyWindow(s)?Q("cross_domain_window",T.serialize(s,{send:a})):s},o))}function ar(n,e,r,t){var o,i=t.send;return function(a,s){if(s===void 0&&(s=Mr),a!=="undefined")return JSON.parse(a,function(c,u){if(In(this))return u;var h,f;if(In(u)?(h=u.__type__,f=u.__val__):(h=rr(u),f=u),!h)return f;var d=s[h]||jr[h];return d?d(f,c):f})}(r,((o={}).cross_domain_zalgo_promise=function(a){return function(s,c,u){return new W(u.then)}(0,0,a)},o.cross_domain_function=function(a){return function(s,c,u,h){var f=u.id,d=u.name,l=h.send,m=function(w){w===void 0&&(w={});function x(){var D=arguments;return T.toProxyWindow(s,{send:l}).awaitWindow().then(function(b){var S=tr(b,f);if(S&&S.val!==x)return S.val.apply({source:window,origin:N()},D);var R=[].slice.call(D);return w.fireAndForget?l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!0}):l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!1}).then(function(y){return y.data.result})}).catch(function(b){throw b})}return x.__name__=d,x.__origin__=c,x.__source__=s,x.__id__=f,x.origin=c,x},v=m();return v.fireAndForget=m({fireAndForget:!0}),v}(n,e,a,{send:i})},o.cross_domain_window=function(a){return T.deserialize(a,{send:i})},o))}var zn={};zn.postrobot_post_message=function(n,e,r){r.indexOf("file:")===0&&(r="*"),n.postMessage(e,r)};function Rn(n,e,r,t){var o=t.on,i=t.send;return W.try(function(){var a=j().getOrSet(n,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(r),a.flush=a.flush||W.flush().then(function(){if(F(n))throw new Error("Window is closed");var s=ir(n,e,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var u=Object.keys(zn),h=[],f=0;f<u.length;f++){var d=u[f];try{zn[d](n,s,e)}catch(l){h.push(l)}}if(h.length===u.length)throw new Error(`All post-robot messaging strategies failed:
8
8
 
9
- `+h.map(function(l,m){return m+". "+on(l)}).join(`
9
+ `+h.map(function(l,m){return m+". "+un(l)}).join(`
10
10
 
11
- `))}),a.flush.then(function(){delete a.flush})}).then(K)}function ur(n){return z("responseListeners").get(n)}function cr(n){z("responseListeners").del(n)}function sr(n){return z("erroredResponseListeners").has(n)}function fr(n){var t=n.name,r=n.win,e=n.domain,o=M("requestListeners");if(r==="*"&&(r=null),e==="*"&&(e=null),!t)throw new Error("Name required to get request listener");for(var i=0,a=[r,yn()];i<a.length;i++){var s=a[i];if(s){var c=o.get(s);if(c){var u=c[t];if(u){if(e&&typeof e=="string"){if(u[e])return u[e];if(u.__domain_regex__)for(var h=0,f=u.__domain_regex__;h<f.length;h++){var d=f[h],l=d.listener;if(Q(d.regex,e))return l}}if(u["*"])return u["*"]}}}}}function Cr(n,t,r,e){var o=e.on,i=e.send,a=fr({name:r.name,win:n,domain:t}),s=r.name==="postrobot_method"&&r.data&&typeof r.data.name=="string"?r.data.name+"()":r.name;function c(u,h,f){return W.flush().then(function(){if(!r.fireAndForget&&!F(n))try{return zn(n,t,{id:U(),origin:j(window),type:"postrobot_message_response",hash:r.hash,name:r.name,ack:u,data:h,error:f},{on:o,send:i})}catch(d){throw new Error("Send response message failed for "+s+" in "+j()+`
11
+ `))}),a.flush.then(function(){delete a.flush})}).then(X)}function ur(n){return z("responseListeners").get(n)}function cr(n){z("responseListeners").del(n)}function sr(n){return z("erroredResponseListeners").has(n)}function fr(n){var e=n.name,r=n.win,t=n.domain,o=j("requestListeners");if(r==="*"&&(r=null),t==="*"&&(t=null),!e)throw new Error("Name required to get request listener");for(var i=0,a=[r,yn()];i<a.length;i++){var s=a[i];if(s){var c=o.get(s);if(c){var u=c[e];if(u){if(t&&typeof t=="string"){if(u[t])return u[t];if(u.__domain_regex__)for(var h=0,f=u.__domain_regex__;h<f.length;h++){var d=f[h],l=d.listener;if(_(d.regex,t))return l}}if(u["*"])return u["*"]}}}}}function Cr(n,e,r,t){var o=t.on,i=t.send,a=fr({name:r.name,win:n,domain:e}),s=r.name==="postrobot_method"&&r.data&&typeof r.data.name=="string"?r.data.name+"()":r.name;function c(u,h,f){return W.flush().then(function(){if(!r.fireAndForget&&!F(n))try{return Rn(n,e,{id:J(),origin:N(window),type:"postrobot_message_response",hash:r.hash,name:r.name,ack:u,data:h,error:f},{on:o,send:i})}catch(d){throw new Error("Send response message failed for "+s+" in "+N()+`
12
12
 
13
- `+on(d))}})}return W.all([W.flush().then(function(){if(!r.fireAndForget&&!F(n))try{return zn(n,t,{id:U(),origin:j(window),type:"postrobot_message_ack",hash:r.hash,name:r.name},{on:o,send:i})}catch(u){throw new Error("Send ack message failed for "+s+" in "+j()+`
13
+ `+un(d))}})}return W.all([W.flush().then(function(){if(!r.fireAndForget&&!F(n))try{return Rn(n,e,{id:J(),origin:N(window),type:"postrobot_message_ack",hash:r.hash,name:r.name},{on:o,send:i})}catch(u){throw new Error("Send ack message failed for "+s+" in "+N()+`
14
14
 
15
- `+on(u))}}),W.try(function(){if(!a)throw new Error("No handler found for post message: "+r.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:n,origin:t,data:r.data})}).then(function(u){return c("success",u)},function(u){return c("error",null,u)})]).then(K).catch(function(u){if(a&&a.handleError)return a.handleError(u);throw u})}function Tr(n,t,r){if(!sr(r.hash)){var e=ur(r.hash);if(!e)throw new Error("No handler found for post message ack for message: "+r.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!Q(e.domain,t))throw new Error("Ack origin "+t+" does not match domain "+e.domain.toString());if(n!==e.win)throw new Error("Ack source does not match registered window")}catch(o){e.promise.reject(o)}e.ack=!0}}function Lr(n,t,r){if(!sr(r.hash)){var e=ur(r.hash);if(!e)throw new Error("No handler found for post message response for message: "+r.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Q(e.domain,t))throw new Error("Response origin "+t+" does not match domain "+(o=e.domain,Array.isArray(o)?"("+o.join(" | ")+")":p(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(n!==e.win)throw new Error("Response source does not match registered window");cr(r.hash),r.ack==="error"?e.promise.reject(r.error):r.ack==="success"&&e.promise.resolve({source:n,origin:t,data:r.data})}}function dr(n,t){var r=t.on,e=t.send,o=z("receivedMessages");try{if(!window||window.closed||!n.source)return}catch{return}var i=n.source,a=n.origin,s=function(h,f,d,l){var m=l.on,v=l.send,w;try{w=ar(f,d,h,{on:m,send:v})}catch{return}if(w&&typeof w=="object"&&w!==null){var x=w.__post_robot_10_0_46__;if(Array.isArray(x))return x}}(n.data,i,a,{on:r,send:e});if(s){nr(i);for(var c=0;c<s.length;c++){var u=s[c];if(o.has(u.id)||(o.set(u.id,!0),F(i)&&!u.fireAndForget))return;u.origin.indexOf("file:")===0&&(a="file://");try{u.type==="postrobot_message_request"?Cr(i,a,u,{on:r,send:e}):u.type==="postrobot_message_response"?Lr(i,a,u):u.type==="postrobot_message_ack"&&Tr(i,a,u)}catch(h){setTimeout(function(){throw h},0)}}}}function G(n,t,r){if(!n)throw new Error("Expected name");if(typeof(t=t||{})=="function"&&(r=t,t={}),!r)throw new Error("Expected handler");var e=function o(i,a){var s=i.name,c=i.win,u=i.domain,h=M("requestListeners");if(!s||typeof s!="string")throw new Error("Name required to add request listener");if(c&&c!=="*"&&T.isProxyWindow(c)){var f=c.awaitWindow().then(function(A){return o({name:s,win:A,domain:u},a)});return{cancel:function(){f.then(function(A){return A.cancel()},K)}}}var d=c;if(Array.isArray(d)){for(var l=[],m=0,v=d;m<v.length;m++)l.push(o({name:s,domain:u,win:v[m]},a));return{cancel:function(){for(var A=0;A<l.length;A++)l[A].cancel()}}}if(Array.isArray(u)){for(var w=[],x=0,D=u;x<D.length;x++)w.push(o({name:s,win:d,domain:D[x]},a));return{cancel:function(){for(var A=0;A<w.length;A++)w[A].cancel()}}}var b=fr({name:s,win:d,domain:u});d&&d!=="*"||(d=yn());var S=(u=u||"*").toString();if(b)throw d&&u?new Error("Request listener already exists for "+s+" on domain "+u.toString()+" for "+(d===yn()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+s+" for "+(d===yn()?"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 R=h.getOrSet(d,function(){return{}}),y=an(R,s,function(){return{}}),P,B;return bn(u)?(P=an(y,"__domain_regex__",function(){return[]})).push(B={regex:u,listener:a}):y[S]=a,{cancel:function(){delete y[S],B&&(P.splice(P.indexOf(B,1)),P.length||delete y.__domain_regex__),Object.keys(y).length||delete R[s],d&&!Object.keys(R).length&&h.del(d)}}}({name:n,win:t.window,domain:t.domain||"*"},{handler:r||t.handler,handleError:t.errorHandler||function(o){throw o}});return{cancel:function(){e.cancel()}}}function Fr(n,t,r){typeof(t=t||{})=="function"&&(r=t,t={});var e=new W,o;return t.errorHandler=function(i){o.cancel(),e.reject(i)},o=G(n,t,function(i){if(o.cancel(),e.resolve(i),r)return r(i)}),e.cancel=o.cancel,e}var Z=function n(t,r,e,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,s=o.timeout||5e3,c=o.fireAndForget||!1;return T.toProxyWindow(t,{send:n}).awaitWindow().then(function(u){return W.try(function(){if(function(h,f,d){if(!h)throw new Error("Expected name");if(d&&typeof d!="string"&&!Array.isArray(d)&&!bn(d))throw new TypeError("Can not send "+h+". Expected domain "+JSON.stringify(d)+" to be a string, array, or regex");if(F(f))throw new Error("Can not send "+h+". Target window is closed")}(r,u,i),function(h,f){var d=Fn(f);if(d)return d===h;if(f===h||function(v){v===void 0&&(v=window);try{if(v.top)return v.top}catch{}if(V(v)===v)return v;try{if(Tn(window,v)&&window.top)return window.top}catch{}try{if(Tn(v,window)&&window.top)return window.top}catch{}for(var w=0,x=function b(S){for(var R=[],y=0,P=Ln(S);y<P.length;y++){var B=P[y];R.push(B);for(var A=0,cn=b(B);A<cn.length;A++)R.push(cn[A])}return R}(v);w<x.length;w++){var D=x[w];try{if(D.top)return D.top}catch{}if(V(D)===D)return D}}(f)===f)return!1;for(var l=0,m=Ln(h);l<m.length;l++)if(m[l]===f)return!0;return!1}(window,u))return function(h,f,d){f===void 0&&(f=5e3),d===void 0&&(d="Window");var l=function(m){return M("helloPromises").getOrSet(m,function(){return new W})}(h);return f!==-1&&(l=l.timeout(f,new Error(d+" did not load after "+f+"ms"))),l}(u,s)}).then(function(h){return function(f,d,l,m){var v=m.send;return W.try(function(){return typeof d=="string"?d:W.try(function(){return l||Pn(f,{send:v}).then(function(w){return w.domain})}).then(function(w){if(!Q(d,d))throw new Error("Domain "+Vn(d)+" does not match "+Vn(d));return w})})}(u,i,(h===void 0?{}:h).domain,{send:n})}).then(function(h){var f=h,d=r==="postrobot_method"&&e&&typeof e.name=="string"?e.name+"()":r,l=new W,m=r+"_"+U();if(!c){var v={name:r,win:u,domain:f,promise:l};(function(y,P){z("responseListeners").set(y,P)})(m,v);var w=M("requestPromises").getOrSet(u,function(){return[]});w.push(l),l.catch(function(){(function(y){z("erroredResponseListeners").set(y,!0)})(m),cr(m)});var x=function(y){return M("knownWindows").get(y,!1)}(u)?1e4:2e3,D=a,b=x,S=D,R=function(y,P){var B;return function A(){B=setTimeout(function(){(function(){if(F(u))return l.reject(new Error("Window closed for "+r+" before "+(v.ack?"response":"ack")));if(v.cancelled)return l.reject(new Error("Response listener was cancelled for "+r));b=Math.max(b-500,0),S!==-1&&(S=Math.max(S-500,0)),v.ack||b!==0?S===0&&l.reject(new Error("No response for postMessage "+d+" in "+j()+" in "+D+"ms")):l.reject(new Error("No ack for postMessage "+d+" in "+j()+" in "+x+"ms"))})(),A()},500)}(),{cancel:function(){clearTimeout(B)}}}();l.finally(function(){R.cancel(),w.splice(w.indexOf(l,1))}).catch(K)}return zn(u,f,{id:U(),origin:j(window),type:"postrobot_message_request",hash:m,name:r,data:e,fireAndForget:c},{on:G,send:n}).then(function(){return c?l.resolve():l},function(y){throw new Error("Send request message failed for "+d+" in "+j()+`
15
+ `+un(u))}}),W.try(function(){if(!a)throw new Error("No handler found for post message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:n,origin:e,data:r.data})}).then(function(u){return c("success",u)},function(u){return c("error",null,u)})]).then(X).catch(function(u){if(a&&a.handleError)return a.handleError(u);throw u})}function Tr(n,e,r){if(!sr(r.hash)){var t=ur(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!_(t.domain,e))throw new Error("Ack origin "+e+" does not match domain "+t.domain.toString());if(n!==t.win)throw new Error("Ack source does not match registered window")}catch(o){t.promise.reject(o)}t.ack=!0}}function Lr(n,e,r){if(!sr(r.hash)){var t=ur(r.hash);if(!t)throw new Error("No handler found for post message response for message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!_(t.domain,e))throw new Error("Response origin "+e+" does not match domain "+(o=t.domain,Array.isArray(o)?"("+o.join(" | ")+")":p(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(n!==t.win)throw new Error("Response source does not match registered window");cr(r.hash),r.ack==="error"?t.promise.reject(r.error):r.ack==="success"&&t.promise.resolve({source:n,origin:e,data:r.data})}}function dr(n,e){var r=e.on,t=e.send,o=z("receivedMessages");try{if(!window||window.closed||!n.source)return}catch{return}var i=n.source,a=n.origin,s=function(h,f,d,l){var m=l.on,v=l.send,w;try{w=ar(f,d,h,{on:m,send:v})}catch{return}if(w&&typeof w=="object"&&w!==null){var x=w.__post_robot_10_0_46__;if(Array.isArray(x))return x}}(n.data,i,a,{on:r,send:t});if(s){nr(i);for(var c=0;c<s.length;c++){var u=s[c];if(o.has(u.id)||(o.set(u.id,!0),F(i)&&!u.fireAndForget))return;u.origin.indexOf("file:")===0&&(a="file://");try{u.type==="postrobot_message_request"?Cr(i,a,u,{on:r,send:t}):u.type==="postrobot_message_response"?Lr(i,a,u):u.type==="postrobot_message_ack"&&Tr(i,a,u)}catch(h){setTimeout(function(){throw h},0)}}}}function Z(n,e,r){if(!n)throw new Error("Expected name");if(typeof(e=e||{})=="function"&&(r=e,e={}),!r)throw new Error("Expected handler");var t=function o(i,a){var s=i.name,c=i.win,u=i.domain,h=j("requestListeners");if(!s||typeof s!="string")throw new Error("Name required to add request listener");if(c&&c!=="*"&&T.isProxyWindow(c)){var f=c.awaitWindow().then(function(A){return o({name:s,win:A,domain:u},a)});return{cancel:function(){f.then(function(A){return A.cancel()},X)}}}var d=c;if(Array.isArray(d)){for(var l=[],m=0,v=d;m<v.length;m++)l.push(o({name:s,domain:u,win:v[m]},a));return{cancel:function(){for(var A=0;A<l.length;A++)l[A].cancel()}}}if(Array.isArray(u)){for(var w=[],x=0,D=u;x<D.length;x++)w.push(o({name:s,win:d,domain:D[x]},a));return{cancel:function(){for(var A=0;A<w.length;A++)w[A].cancel()}}}var b=fr({name:s,win:d,domain:u});d&&d!=="*"||(d=yn());var S=(u=u||"*").toString();if(b)throw d&&u?new Error("Request listener already exists for "+s+" on domain "+u.toString()+" for "+(d===yn()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+s+" for "+(d===yn()?"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 R=h.getOrSet(d,function(){return{}}),y=cn(R,s,function(){return{}}),P,B;return Pn(u)?(P=cn(y,"__domain_regex__",function(){return[]})).push(B={regex:u,listener:a}):y[S]=a,{cancel:function(){delete y[S],B&&(P.splice(P.indexOf(B,1)),P.length||delete y.__domain_regex__),Object.keys(y).length||delete R[s],d&&!Object.keys(R).length&&h.del(d)}}}({name:n,win:e.window,domain:e.domain||"*"},{handler:r||e.handler,handleError:e.errorHandler||function(o){throw o}});return{cancel:function(){t.cancel()}}}function Fr(n,e,r){typeof(e=e||{})=="function"&&(r=e,e={});var t=new W,o;return e.errorHandler=function(i){o.cancel(),t.reject(i)},o=Z(n,e,function(i){if(o.cancel(),t.resolve(i),r)return r(i)}),t.cancel=o.cancel,t}var q=function n(e,r,t,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,s=o.timeout||5e3,c=o.fireAndForget||!1;return T.toProxyWindow(e,{send:n}).awaitWindow().then(function(u){return W.try(function(){if(function(h,f,d){if(!h)throw new Error("Expected name");if(d&&typeof d!="string"&&!Array.isArray(d)&&!Pn(d))throw new TypeError("Can not send "+h+". Expected domain "+JSON.stringify(d)+" to be a string, array, or regex");if(F(f))throw new Error("Can not send "+h+". Target window is closed")}(r,u,i),function(h,f){var d=Fn(f);if(d)return d===h;if(f===h||function(v){v===void 0&&(v=window);try{if(v.top)return v.top}catch{}if(Y(v)===v)return v;try{if(Tn(window,v)&&window.top)return window.top}catch{}try{if(Tn(v,window)&&window.top)return window.top}catch{}for(var w=0,x=function b(S){for(var R=[],y=0,P=Ln(S);y<P.length;y++){var B=P[y];R.push(B);for(var A=0,fn=b(B);A<fn.length;A++)R.push(fn[A])}return R}(v);w<x.length;w++){var D=x[w];try{if(D.top)return D.top}catch{}if(Y(D)===D)return D}}(f)===f)return!1;for(var l=0,m=Ln(h);l<m.length;l++)if(m[l]===f)return!0;return!1}(window,u))return function(h,f,d){f===void 0&&(f=5e3),d===void 0&&(d="Window");var l=function(m){return j("helloPromises").getOrSet(m,function(){return new W})}(h);return f!==-1&&(l=l.timeout(f,new Error(d+" did not load after "+f+"ms"))),l}(u,s)}).then(function(h){return function(f,d,l,m){var v=m.send;return W.try(function(){return typeof d=="string"?d:W.try(function(){return l||On(f,{send:v}).then(function(w){return w.domain})}).then(function(w){if(!_(d,d))throw new Error("Domain "+Vn(d)+" does not match "+Vn(d));return w})})}(u,i,(h===void 0?{}:h).domain,{send:n})}).then(function(h){var f=h,d=r==="postrobot_method"&&t&&typeof t.name=="string"?t.name+"()":r,l=new W,m=r+"_"+J();if(!c){var v={name:r,win:u,domain:f,promise:l};(function(y,P){z("responseListeners").set(y,P)})(m,v);var w=j("requestPromises").getOrSet(u,function(){return[]});w.push(l),l.catch(function(){(function(y){z("erroredResponseListeners").set(y,!0)})(m),cr(m)});var x=function(y){return j("knownWindows").get(y,!1)}(u)?1e4:2e3,D=a,b=x,S=D,R=function(y,P){var B;return function A(){B=setTimeout(function(){(function(){if(F(u))return l.reject(new Error("Window closed for "+r+" before "+(v.ack?"response":"ack")));if(v.cancelled)return l.reject(new Error("Response listener was cancelled for "+r));b=Math.max(b-500,0),S!==-1&&(S=Math.max(S-500,0)),v.ack||b!==0?S===0&&l.reject(new Error("No response for postMessage "+d+" in "+N()+" in "+D+"ms")):l.reject(new Error("No ack for postMessage "+d+" in "+N()+" in "+x+"ms"))})(),A()},500)}(),{cancel:function(){clearTimeout(B)}}}();l.finally(function(){R.cancel(),w.splice(w.indexOf(l,1))}).catch(X)}return Rn(u,f,{id:J(),origin:N(window),type:"postrobot_message_request",hash:m,name:r,data:t,fireAndForget:c},{on:Z,send:n}).then(function(){return c?l.resolve():l},function(y){throw new Error("Send request message failed for "+d+" in "+N()+`
16
16
 
17
- `+on(y))})})})};function Br(n,t,r){return ir(n,t,r,{on:G,send:Z})}function Hr(n,t,r){return ar(n,t,r,{on:G,send:Z})}function Ur(n){return new T({send:Z,win:n})}function Jr(n){return T.toProxyWindow(n,{send:Z})}function hr(){un().initialized||(un().initialized=!0,t=(n={on:G,send:Z}).on,r=n.send,(e=un()).receiveMessage=e.receiveMessage||function(o){return dr(o,{on:t,send:r})},function(o){var i=o.on,a=o.send;z().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 h=u.on,f=u.send;W.try(function(){var d=c.source||c.sourceElement,l=c.origin||c.originalEvent&&c.originalEvent.origin,m=c.data;if(l==="null"&&(l="file://"),d){if(!l)throw new Error("Post message did not have origin domain");dr({source:d,origin:l,data:m},{on:h,send:f})}})})(s,{on:i,send:a})})})}({on:G,send:Z}),function(o){var i=o.on,a=o.send;z("builtinListeners").getOrSet("helloListener",function(){var s=i("postrobot_hello",{domain:"*"},function(u){return $n(u.source,{domain:u.origin}),{instanceID:Qn()}}),c=Fn();return c&&Pn(c,{send:a}).catch(function(u){}),s})}({on:G,send:Z}));var n,t,r,e}function Gr(){(function(){for(var t=z("responseListeners"),r=0,e=t.keys();r<e.length;r++){var o=e[r],i=t.get(o);i&&(i.cancelled=!0),t.del(o)}})(),(n=z().get("postMessageListener"))&&n.cancel();var n;delete window.__post_robot_10_0_46__}var Zr=!0;function qr(n){for(var t=0,r=M("requestPromises").get(n,[]);t<r.length;t++)r[t].reject(new Error("Window "+(F(n)?"closed":"cleaned up")+" before response")).catch(K)}hr()}])})})(Nn);var pr=Nn.exports;(function(I){I.exports=pr,I.exports.default=I.exports})(Mn);var gr=Mn.exports;const En=mr(gr);function yr(I){En.on("mounted",()=>{I()})}function Er(I){En.send(I.contentWindow,"ready")}function Wr(I,sn){En.send(I.contentWindow,"userEmail",sn)}class xr{constructor({userEmail:sn}){jn(this,"iframe");jn(this,"userEmail");this.iframe=vr(),this.userEmail=sn,yr(this.initialize.bind(this))}initialize(){this.userEmail&&Wr(this.iframe,this.userEmail),Er(this.iframe)}}return xr});
17
+ `+un(y))})})})};function Br(n,e,r){return ir(n,e,r,{on:Z,send:q})}function Hr(n,e,r){return ar(n,e,r,{on:Z,send:q})}function Jr(n){return new T({send:q,win:n})}function Ur(n){return T.toProxyWindow(n,{send:q})}function hr(){sn().initialized||(sn().initialized=!0,e=(n={on:Z,send:q}).on,r=n.send,(t=sn()).receiveMessage=t.receiveMessage||function(o){return dr(o,{on:e,send:r})},function(o){var i=o.on,a=o.send;z().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 h=u.on,f=u.send;W.try(function(){var d=c.source||c.sourceElement,l=c.origin||c.originalEvent&&c.originalEvent.origin,m=c.data;if(l==="null"&&(l="file://"),d){if(!l)throw new Error("Post message did not have origin domain");dr({source:d,origin:l,data:m},{on:h,send:f})}})})(s,{on:i,send:a})})})}({on:Z,send:q}),function(o){var i=o.on,a=o.send;z("builtinListeners").getOrSet("helloListener",function(){var s=i("postrobot_hello",{domain:"*"},function(u){return $n(u.source,{domain:u.origin}),{instanceID:Qn()}}),c=Fn();return c&&On(c,{send:a}).catch(function(u){}),s})}({on:Z,send:q}));var n,e,r,t}function Gr(){(function(){for(var e=z("responseListeners"),r=0,t=e.keys();r<t.length;r++){var o=t[r],i=e.get(o);i&&(i.cancelled=!0),e.del(o)}})(),(n=z().get("postMessageListener"))&&n.cancel();var n;delete window.__post_robot_10_0_46__}var Zr=!0;function qr(n){for(var e=0,r=j("requestPromises").get(n,[]);e<r.length;e++)r[e].reject(new Error("Window "+(F(n)?"closed":"cleaned up")+" before response")).catch(X)}hr()}])})})(Mn);var pr=Mn.exports;(function(I){I.exports=pr,I.exports.default=I.exports})(jn);var gr=jn.exports;const Wn=mr(gr);function yr(I){Wn.on("mounted",()=>{I()})}function Er(I){Wn.send(I.contentWindow,"ready")}function Wr(I,G){Wn.send(I.contentWindow,"config",G)}class xr{constructor({userEmail:G=void 0,companyName:$=void 0}){En(this,"iframe");En(this,"userEmail");En(this,"companyName");this.iframe=vr(),this.userEmail=G,this.companyName=$,yr(this.initialize.bind(this))}initialize(){Wr(this.iframe,{userEmail:this.userEmail,companyName:this.companyName}),Er(this.iframe)}}return xr});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",