@soyio/soyio-widget 2.10.2 → 2.11.1
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/dist/index.js +530 -527
- package/dist/index.umd.cjs +26 -35
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(I,P){typeof exports=="object"&&typeof module!="undefined"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(I=typeof globalThis!="undefined"?globalThis:I||self,P(I["soyio-widget"]={}))})(this,function(I){"use strict";var Yn=Object.defineProperty;var jt=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Kn=Reflect.get;var Qn=(I,P,O)=>P in I?Yn(I,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):I[P]=O;var kt=(I,P)=>{var O={};for(var F in I)Zn.call(I,F)&&P.indexOf(F)<0&&(O[F]=I[F]);if(I!=null&&jt)for(var F of jt(I))P.indexOf(F)<0&&Xn.call(I,F)&&(O[F]=I[F]);return O};var L=(I,P,O)=>(Qn(I,typeof P!="symbol"?P+"":P,O),O),er=(I,P,O)=>{if(!P.has(I))throw TypeError("Cannot "+O)};var Ut=(I,P,O)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,O)};var Ft=(I,P,O)=>(er(I,P,"access private method"),O),Ht=(I,P,O)=>Kn(Jn(I),O,P);var $=(I,P,O)=>new Promise((F,ce)=>{var Ne=Q=>{try{de(O.next(Q))}catch(fe){ce(fe)}},De=Q=>{try{de(O.throw(Q))}catch(fe){ce(fe)}},de=Q=>Q.done?F(Q.value):Promise.resolve(Q.value).then(Ne,De);de((O=O.apply(I,P)).next())});var Ie,_t;function P(h,p){for(var g=0;g<p.length;g++){const l=p[g];if(typeof l!="string"&&!Array.isArray(l)){for(const w in l)if(w!=="default"&&!(w in h)){const y=Object.getOwnPropertyDescriptor(l,w);y&&Object.defineProperty(h,w,y.get?y:{enumerable:!0,get:()=>l[w]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}class O{constructor(){L(this,"tooltipElement",null);L(this,"tooltipContent",null);L(this,"tooltipClass","soyio-tooltip");L(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const p=document.querySelector(`.${this.tooltipClass}`);p==null||p.remove(),this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
|
|
2
2
|
position: fixed;
|
|
3
3
|
z-index: 99999;
|
|
4
4
|
background: white;
|
|
@@ -14,16 +14,7 @@
|
|
|
14
14
|
transition: opacity 0.2s ease-in-out;
|
|
15
15
|
transform: translateX(-50%) translateY(-100%);
|
|
16
16
|
margin-top: -8px;
|
|
17
|
-
`,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",this.tooltipElement.appendChild(this.tooltipContent);const w=document.
|
|
18
|
-
position: absolute;
|
|
19
|
-
bottom: -4px;
|
|
20
|
-
left: 50%;
|
|
21
|
-
transform: translateX(-50%) rotate(45deg);
|
|
22
|
-
width: 8px;
|
|
23
|
-
height: 8px;
|
|
24
|
-
background: white;
|
|
25
|
-
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
26
|
-
`,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,w,l){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=p,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${l}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var p;(p=this.tooltipElement)==null||p.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}const Se="https://app.soyio.id",ue="https://sandbox.soyio.id",De="https://privacy.soyio.id",Ne="https://privacy-sandbox.soyio.id",ce=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],K="WIDGET_CLOSED",de=420,Ft=720,Ht=500,_t={minWidth:"375px",maxWidth:"50rem"},qt={minWidth:"375px",maxWidth:"36rem"},Bt={minWidth:"375px",maxWidth:"50rem"};function Gt(m,p,w){return J(this,null,function*(){if(!m.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const l=yield Promise.resolve().then(()=>ke);try{yield l.send(m.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:w})}catch(g){console.error("Failed to send appearance config:",g)}})}const $t="IFRAME_READY",Yt="IFRAME_HEIGHT_CHANGE",Jt="TOOLTIP_STATE_CHANGE",Vt="CONSENT_STATE_CHANGE",B={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onStateChange:{}};let Xe,Ze,Ke,Qe;function Xt(){return J(this,null,function*(){const m=yield Promise.resolve().then(()=>ke);Xe||Ze||Ke||Qe||(Xe=m.on(Yt,p=>J(this,null,function*(){const w=p.data,l=B.onHeightChange[w.identifier];l&&l(w.height)})),Ze=m.on($t,p=>J(this,null,function*(){const w=p.data,l=B.onIframeReady[w.identifier];l&&l()})),Ke=m.on(Jt,p=>J(this,null,function*(){const w=p.data,l=B.onTooltipChange[w.identifier];l&&l(w)})),Qe=m.on(Vt,p=>J(this,null,function*(){const w=p.data,l=B.onStateChange[w.identifier];l&&l(w)})))})}function et(m,p){const{onHeightChange:w,onIframeReady:l,onTooltipChange:g,onStateChange:y}=p;w&&(B.onHeightChange[m]=w),l&&(B.onIframeReady[m]=l),g&&(B.onTooltipChange[m]=g),y&&(B.onStateChange[m]=y)}function Zt(m){delete B.onHeightChange[m],delete B.onIframeReady[m],delete B.onTooltipChange[m],delete B.onStateChange[m]}function Kt(m){const p=document.getElementById(m);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function Qt(m){const p=document.querySelector(m);if(!p)throw new Error(`Iframe div container with id '${m}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${m}' must be a <div> element`);const w=p;return w.style.position="relative",w.style.cssText+=`
|
|
17
|
+
`,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,g,l){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=p,this.tooltipElement.style.left=`${g}px`,this.tooltipElement.style.top=`${l}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var p;(p=this.tooltipElement)==null||p.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}const F="https://app.soyio.id",ce="https://sandbox.soyio.id",Ne="https://privacy.soyio.id",De="https://privacy-sandbox.soyio.id",de=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Q="WIDGET_CLOSED",fe=420,qt=720,Bt=500,Gt={minWidth:"375px",maxWidth:"50rem"},$t={minWidth:"375px",maxWidth:"36rem"},Vt={minWidth:"375px",maxWidth:"50rem"};function Yt(h,p,g){return $(this,null,function*(){if(!h.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const l=yield Promise.resolve().then(()=>ke);try{yield l.send(h.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:g})}catch(w){console.error("Failed to send appearance config:",w)}})}const Jt="IFRAME_READY",Zt="IFRAME_HEIGHT_CHANGE",Xt="TOOLTIP_STATE_CHANGE",Kt="INFO_EVENT",Qt="CONSENT_STATE_CHANGE",U={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Ze,Xe,Ke,Qe,et;function en(){return $(this,null,function*(){const h=yield Promise.resolve().then(()=>ke);Ze||Xe||Ke||Qe||et||(Ze=h.on(Zt,p=>$(this,null,function*(){const g=p.data,l=U.onHeightChange[g.identifier];l&&l(g.height)})),Xe=h.on(Jt,p=>$(this,null,function*(){const g=p.data,l=U.onIframeReady[g.identifier];l&&l()})),Ke=h.on(Xt,p=>$(this,null,function*(){const g=p.data,l=U.onTooltipChange[g.identifier];l&&l(g)})),Qe=h.on(Qt,p=>$(this,null,function*(){const g=p.data,l=U.onStateChange[g.identifier];l&&l(g)})),et=h.on(Kt,g=>$(this,[g],function*({data:p}){const E=p,{identifier:l}=E,w=kt(E,["identifier"]),y=U.onInfo[l];y&&y(w)})))})}function tt(h,p){const{onHeightChange:g,onIframeReady:l,onTooltipChange:w,onStateChange:y,onInfo:E}=p;g&&(U.onHeightChange[h]=g),l&&(U.onIframeReady[h]=l),w&&(U.onTooltipChange[h]=w),y&&(U.onStateChange[h]=y),E&&(U.onInfo[h]=E)}function tn(h){delete U.onHeightChange[h],delete U.onIframeReady[h],delete U.onTooltipChange[h],delete U.onStateChange[h],delete U.onInfo[h]}function nn(h){const p=document.getElementById(h);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function rn(h){const p=document.querySelector(h);if(!p)throw new Error(`Iframe div container with id '${h}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${h}' must be a <div> element`);const g=p;return g.style.position="relative",g.style.cssText+=`
|
|
27
18
|
padding: 0 !important;
|
|
28
19
|
margin: 0 !important;
|
|
29
20
|
display: flex !important;
|
|
@@ -32,16 +23,16 @@
|
|
|
32
23
|
border: none !important;
|
|
33
24
|
transition: height 0.35s !important;
|
|
34
25
|
opacity: 1 !important;
|
|
35
|
-
`,
|
|
26
|
+
`,g}function on(h,p,g){const l=document.createElement("iframe");return l.id=p,l.src=h,l.style.cssText+=`
|
|
36
27
|
width: 100% !important;
|
|
37
|
-
min-width: ${
|
|
38
|
-
max-width: ${
|
|
28
|
+
min-width: ${g.minWidth} !important;
|
|
29
|
+
max-width: ${g.maxWidth} !important;
|
|
39
30
|
border: none !important;
|
|
40
31
|
overflow: hidden !important;
|
|
41
32
|
opacity: 1;
|
|
42
33
|
transition: height 0.35s,
|
|
43
34
|
opacity 0.4s 0.1s;
|
|
44
|
-
`,l}function
|
|
35
|
+
`,l}function an(){return Math.random().toString(36).substring(2,10)}class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",Gt);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new O,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return an()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){this.iframe&&(this.options.onReady&&this.options.onReady(),Yt(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:l,coordinates:w,isVisible:y}=p,E=w.x+g.left,C=w.y+g.top;y?this.tooltipManager.show(l,E,C):this.tooltipManager.hide()}setupListeners(){return $(this,null,function*(){yield en();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};tt(this.uniqueIdentifier,p)})}mount(p){return $(this,null,function*(){yield this.setupListeners(),nn(this.iframeIdentifier);const g=rn(p),l=this.iframeUrl();return this.iframe=on(l,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){tn(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null)}}class sn{constructor(p){L(this,"element");L(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
|
|
45
36
|
position: absolute;
|
|
46
37
|
left: 50%;
|
|
47
38
|
top: 50%;
|
|
@@ -58,7 +49,7 @@
|
|
|
58
49
|
display: flex;
|
|
59
50
|
flex-direction: column;
|
|
60
51
|
gap: 1rem;
|
|
61
|
-
`;const
|
|
52
|
+
`;const g=document.createElement("div");g.style.cssText=`
|
|
62
53
|
padding: 1rem;
|
|
63
54
|
height: 100%;
|
|
64
55
|
max-width: 100%;
|
|
@@ -69,7 +60,7 @@
|
|
|
69
60
|
display: flex;
|
|
70
61
|
align-items: center;
|
|
71
62
|
gap: 0.75rem;
|
|
72
|
-
`;const
|
|
63
|
+
`;const w=document.createElement("div");w.style.cssText=`
|
|
73
64
|
width: 2rem;
|
|
74
65
|
height: 2rem;
|
|
75
66
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -93,11 +84,11 @@
|
|
|
93
84
|
border-radius: 50%;
|
|
94
85
|
margin-left: auto;
|
|
95
86
|
margin-right: 3px;
|
|
96
|
-
`;const
|
|
87
|
+
`;const C=document.createElement("div");C.style.cssText=`
|
|
97
88
|
display: flex;
|
|
98
89
|
align-items: center;
|
|
99
90
|
gap: 1rem;
|
|
100
|
-
`;const
|
|
91
|
+
`;const Z=document.createElement("div");Z.style.cssText=`
|
|
101
92
|
width: 1rem;
|
|
102
93
|
height: 1rem;
|
|
103
94
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -111,43 +102,43 @@
|
|
|
111
102
|
display: flex;
|
|
112
103
|
flex-direction: column;
|
|
113
104
|
gap: 0.5rem;
|
|
114
|
-
`;const
|
|
105
|
+
`;const V=document.createElement("div");V.style.cssText=`
|
|
115
106
|
height: 0.875rem;
|
|
116
107
|
width: 80%;
|
|
117
108
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
118
109
|
background-size: 200% 100%;
|
|
119
110
|
animation: shimmer 1.5s infinite;
|
|
120
111
|
border-radius: 0.125rem;
|
|
121
|
-
`;const
|
|
112
|
+
`;const he=document.createElement("div");if(he.style.cssText=`
|
|
122
113
|
height: 0.875rem;
|
|
123
114
|
width: 60%;
|
|
124
115
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
125
116
|
background-size: 200% 100%;
|
|
126
117
|
animation: shimmer 1.5s infinite;
|
|
127
118
|
border-radius: 0.125rem;
|
|
128
|
-
`,!document.getElementById("skeleton-animation")){const
|
|
119
|
+
`,!document.getElementById("skeleton-animation")){const te=document.createElement("style");te.id="skeleton-animation",te.textContent=`
|
|
129
120
|
@keyframes shimmer {
|
|
130
121
|
0% { background-position: 200% 0; }
|
|
131
122
|
100% { background-position: -200% 0; }
|
|
132
123
|
}
|
|
133
|
-
`,document.head.appendChild(
|
|
134
|
-
width=${
|
|
124
|
+
`,document.head.appendChild(te)}l.appendChild(w),l.appendChild(y),l.appendChild(E),X.appendChild(V),X.appendChild(he),C.appendChild(Z),C.appendChild(X),g.appendChild(l),g.appendChild(C),this.element.appendChild(g)}cleanupExistingSkeleton(){const p=document.getElementById(this.identifier);p&&p.remove()}mount(p){this.cleanupExistingSkeleton(),p.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}function un(h){var E;const p=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(g?ce:F),w=new URLSearchParams;p.forEach(C=>{h[C]&&w.set(C,h[C])});const y=w.toString();return`${l}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class Le extends be{constructor(g){super(g);L(this,"defaultIframePrefix","consent-box");L(this,"defaultIframeCSSConfig",$t);L(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=sn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return un(this.options)}handleStateChange(g){const{isSelected:l,actionToken:w}=g;this.state={isSelected:l,actionToken:w},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:l,actionToken:w})}setupListeners(){return $(this,null,function*(){yield Ht(Le.prototype,this,"setupListeners").call(this),tt(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function cn(h){var E;const p=["subjectId","companyId"],g=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(g?De:Ne),w=new URLSearchParams;p.forEach(C=>{h[C]&&w.set(C,h[C])});const y=w.toString();return`${l}/${y?`?${y}`:""}`}class dn extends be{constructor(){super(...arguments);L(this,"defaultIframePrefix","privacy-center");L(this,"_uniqueIdentifier","privacy-center");L(this,"defaultIframeCSSConfig",Vt)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return cn(this.options)}}const fn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function ln(h){let p="widget/";return"disclosureRequestId"in h.configProps?p+=["disclosures",h.configProps.disclosureRequestId].join("/"):p+=h.request,p}function hn(h){var y;const p=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(p?ce:F),l=Object.entries(h.configProps).filter(([E,C])=>C||E==="disclosureRequestId").map(([E,C])=>`${E}=${encodeURIComponent(C)}`).join("&"),w=ln(h);return`${g}/${w}?sdk=web&${l}`}const mn=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let ee=null,ze=null;function Me(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function je(){document.body.style.filter="",document.body.removeEventListener("click",Me)}function pn(){ze=setInterval(()=>{(!ee||ee.closed)&&(ze&&clearInterval(ze),je())},Bt)}function vn(h){const p=hn(h),g=fe,l=qt,w=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,C=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Z=E/window.screen.availWidth,X=(E-g)/2/Z+w,V=(C-l)/2/Z+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",Me),ee=window.open(p,"Soyio",`scrollbars=yes,
|
|
125
|
+
width=${g},
|
|
135
126
|
height=${l},
|
|
136
|
-
top=${
|
|
137
|
-
left=${X}`),Me(),
|
|
138
|
-
`;function W(e){return e===void 0&&(e=window),e.location.protocol}function V(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return W(e)}function X(e){return e===void 0&&(e=window),V(e)==="about:"}function G(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function le(e){if(e===void 0&&(e=window),e&&!G(e))try{return e.opener}catch(n){}}function ee(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=W(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=G(e);return r&&ee()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function U(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function re(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(X(n)&&ee())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),V(r)==="mock:"}(n)&&ee())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||X(e)&&ee()||U(window)===U(e))return!0}catch(n){}return!1}function Ce(e){if(!re(e))throw new Error("Expected window to be same domain");return e}function it(e,n){if(!e||!n)return!1;var t=G(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function at(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var xn=[],Sn=[];function $(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&re(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(xn,e);if(t!==-1){var r=Sn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function st(e){return e===void 0&&(e=window),le(e=e||window)||G(e)||void 0}function se(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return se(t,n)}))}function Pe(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function ut(e){if(re(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function bn(e){if(function(t){return t===void 0&&(t=window),!!G(t)}(e)){var n=ut(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function oe(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var ct=[],he=[],Ue=0,me;function dt(){if(!Ue&&me){var e=me;me=null,e.resolve()}}function Fe(){Ue+=1}function pe(){Ue-=1,dt()}var P=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;Fe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){pe(),this.reject(s);return}pe(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(ct.indexOf(i)===-1){ct.push(i),setTimeout(function(){throw i},1);for(var c=0;c<he.length;c++)he[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,Fe();for(var i=function(v,b){return v.then(function(x){b.resolve(x)},function(x){b.reject(x)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,h=c.promise,d=void 0;if(t)try{d=u?u(this.value):this.value}catch(v){h.reject(v);continue}else if(r){if(!s){h.reject(this.error);continue}try{d=s(this.error)}catch(v){h.reject(v);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?h.resolve(f.value):h.reject(f.error),f.errorHandled=!0}else oe(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?h.resolve(d.value):h.reject(d.error):i(d,h):h.resolve(d)}o.length=0,this.dispatching=!1,pe()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:oe(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,h,d){return h.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!oe(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];oe(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return he.push(r),{cancel:function(){he.splice(he.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;Fe();try{i=t.apply(r,o||[])}catch(a){return pe(),e.reject(a)}return pe(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||oe(t)},e.flush=function(){return function(t){var r=me=me||new t;return dt(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){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=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Pe(i)&&$(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Pe(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(h){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(h){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Te(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function ft(e){return e.name||e.__name__||e.displayName||"anonymous"}function lt(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function Z(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"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 Re;function ht(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Re=Re||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Re.get(r);return o||(o=typeof r+":"+Z(),Re.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function In(){return{}}var ve=0,mt=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=ve;ve+=1;var u=function(){for(var s=arguments.length,h=new Array(s),d=0;d<s;d++)h[d]=arguments[d];c<mt&&(i=null,a=null,c=ve,ve+=1);var f;f=r?(a=a||new He).getOrSet(this,In):i=i||{};var v;try{v=ht(h)}catch(R){return e.apply(this,arguments)}var b=f[v];if(b&&o&&Date.now()-b.time<o&&(delete f[v],b=null),b)return b.value;var x=Date.now(),S=e.apply(this,arguments);return f[v]={time:x,value:S},S};return u.reset=function(){i=null,a=null},lt(u,(n.name||ft(e))+"::memoized")}we.clear=function(){mt=ve};function Wn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=ht(a);return n.hasOwnProperty(u)||(n[u]=P.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},lt(t,ft(e)+"::promiseMemoized")}function ie(){}function ge(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
|
|
139
|
-
`+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+
|
|
127
|
+
top=${V},
|
|
128
|
+
left=${X}`),Me(),pn()}function wn(){ee&&(ee.close(),ee=null),je()}const gn="WIDGET_EVENT";let le=null;function yn(){le&&(le.cancel(),le=null)}function En(h){return $(this,null,function*(){const{onEvent:p}=h,g=yield Promise.resolve().then(()=>ke);le&&yn(),le=g.on(gn,l=>$(this,null,function*(){p(l.data),de.includes(l.data.eventName)?wn():l.data.eventName===Q&&je()}))})}function xn(h){En(h)}class nt{constructor(p){Ut(this,Ie);L(this,"onEvent");this.onEvent=p.onEvent,mn&&(vn(p),xn({onEvent:Ft(this,Ie,_t).bind(this)}))}}Ie=new WeakSet,_t=function(p){this.onEvent(p)};var Sn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var rt={exports:{}},ot={exports:{}};(function(h,p){(function(g,l){h.exports=l()})(typeof self!="undefined"?self:Sn,function(){return function(g){var l={};function w(y){if(l[y])return l[y].exports;var E=l[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,w),E.l=!0,E.exports}return w.m=g,w.c=l,w.d=function(y,E,C){w.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:C})},w.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},w.t=function(y,E){if(1&E&&(y=w(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var C=Object.create(null);if(w.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var Z in y)w.d(C,Z,function(X){return y[X]}.bind(null,Z));return C},w.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(E,"a",E),E},w.o=function(y,E){return{}.hasOwnProperty.call(y,E)},w.p="",w(w.s=0)}([function(g,l,w){w.r(l),w.d(l,"Promise",function(){return T}),w.d(l,"TYPES",function(){return $n}),w.d(l,"ProxyWindow",function(){return G}),w.d(l,"setup",function(){return Mt}),w.d(l,"destroy",function(){return Gn}),w.d(l,"serializeMessage",function(){return Hn}),w.d(l,"deserializeMessage",function(){return _n}),w.d(l,"createProxyWindow",function(){return qn}),w.d(l,"toProxyWindow",function(){return Bn}),w.d(l,"on",function(){return ne}),w.d(l,"once",function(){return Fn}),w.d(l,"send",function(){return re}),w.d(l,"markWindowKnown",function(){return It}),w.d(l,"cleanUpWindow",function(){return Vn}),w.d(l,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
129
|
+
`;function C(e){return e===void 0&&(e=window),e.location.protocol}function Z(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return C(e)}function X(e){return e===void 0&&(e=window),Z(e)==="about:"}function V(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function he(e){if(e===void 0&&(e=window),e&&!V(e))try{return e.opener}catch(n){}}function te(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=C(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=V(e);return r&&te()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function H(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function oe(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(X(n)&&te())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Z(r)==="mock:"}(n)&&te())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||X(e)&&te()||H(window)===H(e))return!0}catch(n){}return!1}function Ce(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function at(e,n){if(!e||!n)return!1;var t=V(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function st(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var Wn=[],Cn=[];function Y(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&oe(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(Wn,e);if(t!==-1){var r=Cn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function ut(e){return e===void 0&&(e=window),he(e=e||window)||V(e)||void 0}function ue(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return ue(t,n)}))}function Pe(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function ct(e){if(oe(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Pn(e){if(function(t){return t===void 0&&(t=window),!!V(t)}(e)){var n=ct(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ie(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var dt=[],me=[],Ue=0,pe;function ft(){if(!Ue&&pe){var e=pe;pe=null,e.resolve()}}function Fe(){Ue+=1}function ve(){Ue-=1,ft()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;Fe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(dt.indexOf(i)===-1){dt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<me.length;c++)me[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,Fe();for(var i=function(v,b){return v.then(function(x){b.resolve(x)},function(x){b.reject(x)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,m=c.promise,d=void 0;if(t)try{d=u?u(this.value):this.value}catch(v){m.reject(v);continue}else if(r){if(!s){m.reject(this.error);continue}try{d=s(this.error)}catch(v){m.reject(v);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?m.resolve(f.value):m.reject(f.error),f.errorHandled=!0}else ie(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?m.resolve(d.value):m.reject(d.error):i(d,m):m.resolve(d)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ie(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,m,d){return m.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ie(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ie(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;Fe();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ie(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return ft(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){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=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Pe(i)&&Y(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Pe(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(m){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(m){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Te(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function lt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ht(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function K(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"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 Re;function mt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Re=Re||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Re.get(r);return o||(o=typeof r+":"+K(),Re.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function Tn(){return{}}var we=0,pt=0;function ge(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=we;we+=1;var u=function(){for(var s=arguments.length,m=new Array(s),d=0;d<s;d++)m[d]=arguments[d];c<pt&&(i=null,a=null,c=we,we+=1);var f;f=r?(a=a||new He).getOrSet(this,Tn):i=i||{};var v;try{v=mt(m)}catch(R){return e.apply(this,arguments)}var b=f[v];if(b&&o&&Date.now()-b.time<o&&(delete f[v],b=null),b)return b.value;var x=Date.now(),S=e.apply(this,arguments);return f[v]={time:x,value:S},S};return u.reset=function(){i=null,a=null},ht(u,(n.name||lt(e))+"::memoized")}ge.clear=function(){pt=we};function Rn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=mt(a);return n.hasOwnProperty(u)||(n[u]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},ht(t,lt(e)+"::promiseMemoized")}function ae(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
|
|
130
|
+
`+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function vt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}ge(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function _e(e){return{}.toString.call(e)==="[object RegExp]"}function Ee(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function wt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function gt(){return!!document.body&&document.readyState==="complete"}function yt(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new T(function(e){if(gt()||yt())return e();var n=setInterval(function(){if(gt()||yt())return clearInterval(n),e()},10)})});var Ae=typeof document!="undefined"?document.currentScript:null,An=ge(function(){if(Ae||(Ae=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ae;throw new Error("Can not determine current script")}),On=K();ge(function(){var e;try{e=An()}catch(r){return On}var n=e.getAttribute("data-uid");if(n&&typeof n=="string"||(n=e.getAttribute("data-uid-auto"))&&typeof n=="string")return n;if(e.src){var t=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+t.slice(t.length-30)}else n=K();return e.setAttribute("data-uid-auto",n),n});function xe(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Et=function(){return{}};function j(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Et),Ee(xe(),e,function(){var t=n();return{has:function(r){return t.hasOwnProperty(r)},get:function(r,o){return t.hasOwnProperty(r)?t[r]:o},set:function(r,o){return t[r]=o,o},del:function(r){delete t[r]},getOrSet:function(r,o){return Ee(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var Nn=function(){};function Oe(){var e=xe();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new Nn,e.WINDOW_WILDCARD}function _(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Et),j("windowStore").getOrSet(e,function(){var t=new He,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function xt(){return j("instance").getOrSet("instanceID",K)}function St(e,n){var t=n.domain,r=_("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=T.resolve({domain:t});return r.set(e,i),i}function qe(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:xt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return St(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function bt(e,n){var t=n.send;return _("windowInstanceIDPromises").getOrSet(e,function(){return qe(e,{send:t}).then(function(r){return r.instanceID})})}function It(e){_("knownWindows").set(e,!0)}function Be(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Wt(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function se(e,n){return{__type__:e,__val__:n}}var q,Dn=((q={}).function=function(){},q.error=function(e){return se("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},q.promise=function(){},q.regex=function(e){return se("regex",e.source)},q.date=function(e){return se("date",e.toJSON())},q.array=function(e){return e},q.object=function(e){return e},q.string=function(e){return e},q.number=function(e){return e},q.boolean=function(e){return e},q.null=function(e){return e},q[void 0]=function(e){return se("undefined",e)},q),Ln={},B,zn=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
|
|
140
131
|
|
|
141
|
-
`+o.stack,o},
|
|
132
|
+
`+o.stack,o},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(e){return new RegExp(e)},B.date=function(e){return new Date(e)},B.array=function(e){return e},B.object=function(e){return e},B.string=function(e){return e},B.number=function(e){return e},B.boolean=function(e){return e},B.null=function(e){return e},B[void 0]=function(){},B),Mn={};new T(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function Ge(){for(var e=j("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Ct(e,n){var t=n.send,r=n.id,o=r===void 0?K():r,i=e.then(function(u){if(oe(u))return Ce(u).name}),a=e.then(function(u){if(Y(u))throw new Error("Window is closed, can not determine type");return he(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Y(u))return oe(u)?Ce(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:Rn(function(){return e.then(function(u){return bt(u,{send:t})})}),close:function(){return e.then(Pn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return Y(u)})},setLocation:function(u,s){return s===void 0&&(s={}),e.then(function(m){var d=window.location.protocol+"//"+window.location.host,f=s.method,v=f===void 0?"get":f,b=s.body;if(u.indexOf("/")===0)u=""+d+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(v==="post")return c().then(function(x){if(!x)throw new Error("Can not post to window without target name");(function(S){var R=S.url,M=S.target,N=S.body,A=S.method,k=A===void 0?"post":A,W=document.createElement("form");if(W.setAttribute("target",M),W.setAttribute("method",k),W.setAttribute("action",R),W.style.display="none",N)for(var D=0,J=Object.keys(N);D<J.length;D++){var z,Se=J[D],Je=document.createElement("input");Je.setAttribute("name",Se),Je.setAttribute("value",(z=N[Se])==null?void 0:z.toString()),W.appendChild(Je)}wt().appendChild(W),W.submit(),wt().removeChild(W)})({url:u,target:x,method:v,body:b})});if(v!=="get")throw new Error("Unsupported method: "+v);if(oe(m))try{if(m.location&&typeof m.location.replace=="function"){m.location.replace(u);return}}catch(x){}m.location=u})},setName:function(u){return e.then(function(s){var m=oe(s),d=ct(s);if(!m)throw new Error("Can not set name for cross-domain window: "+u);Ce(s).name=u,d&&d.setAttribute("name",u),i=T.resolve(u)})}}}var G=function(){function e(t){var r=t.send,o=t.win,i=t.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 T,this.serializedWindow=i||Ct(this.actualWindowPromise,{send:r}),j("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then(function(t){return t==="popup"})},n.setLocation=function(t,r){var o=this;return this.serializedWindow.setLocation(t,r).then(function(){return o})},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(t){var r=this;return this.serializedWindow.setName(t).then(function(){return r})},n.close=function(){var t=this;return this.serializedWindow.close().then(function(){return t})},n.focus=function(){var t=this,r=this.isPopup(),o=this.getName(),i=T.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return T.all([i,a]).then(function(){return t})},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(t,r){var o=r.send;this.actualWindow=t,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Ct(this.actualWindowPromise,{send:o,id:this.getID()}),_("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return T.try(function(){return o.actualWindow?t===o.actualWindow:T.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:bt(t,{send:i})}).then(function(a){var c=a.proxyInstanceID===a.knownWindowInstanceID;return c&&o.setWindow(t,{send:i}),c})})},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return!!(this.actualWindow&&Y(this.actualWindow))},n.serialize=function(){return this.serializedWindow},e.unwrap=function(t){return e.isProxyWindow(t)?t.unwrap():t},e.serialize=function(t,r){var o=r.send;return Ge(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return Ge(),j("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Pe(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(Ge(),e.isProxyWindow(t))return t;var i=t;return _("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function $e(e,n,t,r,o){var i=_("methodStore"),a=j("proxyWindowMethods");G.isProxyWindow(r)?a.set(e,{val:n,name:t,domain:o,source:r}):(a.del(e),i.getOrSet(r,function(){return{}})[e]={domain:o,name:t,val:n,source:r})}function Pt(e,n){var t=_("methodStore"),r=j("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Tt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,j("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(m){var d=m.source,f=m.origin,v=m.data,b=v.id,x=v.name,S=Pt(d,b);if(!S)throw new Error("Could not find method '"+x+"' with id: "+v.id+" in "+H(window));var R=S.source,M=S.domain,N=S.val;return T.try(function(){if(!ue(M,f))throw new Error("Method '"+v.name+"' domain "+JSON.stringify(_e(S.domain)?S.domain.source:S.domain)+" does not match origin "+f+" in "+H(window));if(G.isProxyWindow(R))return R.matchWindow(d,{send:c}).then(function(A){if(!A)throw new Error("Method call '"+v.name+"' failed - proxy window does not match source in "+H(window))})}).then(function(){return N.apply({source:d,origin:f},v.args)},function(A){return T.try(function(){if(N.onError)return N.onError(A)}).then(function(){throw A.stack&&(A.stack="Remote call to "+x+"("+function(k){return k===void 0&&(k=[]),(W=k,[].slice.call(W)).map(function(D){return typeof D=="string"?"'"+D+"'":D===void 0?"undefined":D===null?"null":typeof D=="boolean"?D.toString():Array.isArray(D)?"[ ... ]":typeof D=="object"?"{ ... }":typeof D=="function"?"() => { ... }":"<"+typeof D+">"}).join(", ");var W}(v.args)+`) failed
|
|
142
133
|
|
|
143
|
-
`+A.stack),A})}).then(function(A){return{result:A,id:b,name:x}})})});var i,a,c,u=t.__id__||
|
|
134
|
+
`+A.stack),A})}).then(function(A){return{result:A,id:b,name:x}})})});var i,a,c,u=t.__id__||K();e=G.unwrap(e);var s=t.__name__||t.name||r;return typeof s=="string"&&typeof s.indexOf=="function"&&s.indexOf("anonymous::")===0&&(s=s.replace("anonymous::",r+"::")),G.isProxyWindow(e)?($e(u,t,s,e,n),e.awaitWindow().then(function(m){$e(u,t,s,m,n)})):$e(u,t,s,e,n),se("cross_domain_function",{id:u,name:s})}function Rt(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=Ln);var s=JSON.stringify(c,function(m){var d=this[m];if(Be(this))return d;var f=Wt(d);if(!f)return d;var v=u[f]||Dn[f];return v?v(d,m):d});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,m,d,f,v){return se("cross_domain_zalgo_promise",{then:Tt(s,m,function(b,x){return d.then(b,x)},f,{on:v.on,send:v.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return Tt(e,n,c,u,{on:i,send:a})},o.object=function(c){return Pe(c)||G.isProxyWindow(c)?se("cross_domain_window",G.serialize(c,{send:a})):c},o))}function At(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=Mn),a!=="undefined")return JSON.parse(a,function(u,s){if(Be(this))return s;var m,d;if(Be(s)?(m=s.__type__,d=s.__val__):(m=Wt(s),d=s),!m)return d;var f=c[m]||zn[m];return f?f(d,u):d})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new T(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,m){var d=s.id,f=s.name,v=m.send,b=function(S){S===void 0&&(S={});function R(){var M=arguments;return G.toProxyWindow(c,{send:v}).awaitWindow().then(function(N){var A=Pt(N,d);if(A&&A.val!==R)return A.val.apply({source:window,origin:H()},M);var k=[].slice.call(M);return S.fireAndForget?v(N,"postrobot_method",{id:d,name:f,args:k},{domain:u,fireAndForget:!0}):v(N,"postrobot_method",{id:d,name:f,args:k},{domain:u,fireAndForget:!1}).then(function(W){return W.data.result})}).catch(function(N){throw N})}return R.__name__=f,R.__origin__=u,R.__source__=c,R.__id__=d,R.origin=u,R},x=b();return x.fireAndForget=b({fireAndForget:!0}),x}(e,n,a,{send:i})},o.cross_domain_window=function(a){return G.deserialize(a,{send:i})},o))}var Ve={};Ve.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Ye(e,n,t,r){var o=r.on,i=r.send;return T.try(function(){var a=_().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||T.flush().then(function(){if(Y(e))throw new Error("Window is closed");var c=Rt(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(Ve),m=[],d=0;d<s.length;d++){var f=s[d];try{Ve[f](e,c,n)}catch(v){m.push(v)}}if(m.length===s.length)throw new Error(`All post-robot messaging strategies failed:
|
|
144
135
|
|
|
145
|
-
`+
|
|
136
|
+
`+m.map(function(v,b){return b+". "+ye(v)}).join(`
|
|
146
137
|
|
|
147
|
-
`))}),a.flush.then(function(){delete a.flush})}).then(
|
|
138
|
+
`))}),a.flush.then(function(){delete a.flush})}).then(ae)}function Ot(e){return j("responseListeners").get(e)}function Nt(e){j("responseListeners").del(e)}function Dt(e){return j("erroredResponseListeners").has(e)}function Lt(e){var n=e.name,t=e.win,r=e.domain,o=_("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,Oe()];i<a.length;i++){var c=a[i];if(c){var u=o.get(c);if(u){var s=u[n];if(s){if(r&&typeof r=="string"){if(s[r])return s[r];if(s.__domain_regex__)for(var m=0,d=s.__domain_regex__;m<d.length;m++){var f=d[m],v=f.listener;if(ue(f.regex,r))return v}}if(s["*"])return s["*"]}}}}}function jn(e,n,t,r){var o=r.on,i=r.send,a=Lt({name:t.name,win:e,domain:n}),c=t.name==="postrobot_method"&&t.data&&typeof t.data.name=="string"?t.data.name+"()":t.name;function u(s,m,d){return T.flush().then(function(){if(!t.fireAndForget&&!Y(e))try{return Ye(e,n,{id:K(),origin:H(window),type:"postrobot_message_response",hash:t.hash,name:t.name,ack:s,data:m,error:d},{on:o,send:i})}catch(f){throw new Error("Send response message failed for "+c+" in "+H()+`
|
|
148
139
|
|
|
149
|
-
`+
|
|
140
|
+
`+ye(f))}})}return T.all([T.flush().then(function(){if(!t.fireAndForget&&!Y(e))try{return Ye(e,n,{id:K(),origin:H(window),type:"postrobot_message_ack",hash:t.hash,name:t.name},{on:o,send:i})}catch(s){throw new Error("Send ack message failed for "+c+" in "+H()+`
|
|
150
141
|
|
|
151
|
-
`+
|
|
142
|
+
`+ye(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return u("success",s)},function(s){return u("error",null,s)})]).then(ae).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function kn(e,n,t){if(!Dt(t.hash)){var r=Ot(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!ue(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());if(e!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function Un(e,n,t){if(!Dt(t.hash)){var r=Ot(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!ue(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Nt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function zt(e,n){var t=n.on,r=n.send,o=j("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(m){return}var i=e.source,a=e.origin,c=function(m,d,f,v){var b=v.on,x=v.send,S;try{S=At(d,f,m,{on:b,send:x})}catch(M){return}if(S&&typeof S=="object"&&S!==null){var R=S.__post_robot_10_0_46__;if(Array.isArray(R))return R}}(e.data,i,a,{on:t,send:r});if(c){It(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),Y(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?jn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?Un(i,a,s):s.type==="postrobot_message_ack"&&kn(i,a,s)}catch(m){setTimeout(function(){throw m},0)}}}}function ne(e,n,t){if(!e)throw new Error("Expected name");if(typeof(n=n||{})=="function"&&(t=n,n={}),!t)throw new Error("Expected handler");var r=function o(i,a){var c=i.name,u=i.win,s=i.domain,m=_("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&G.isProxyWindow(u)){var d=u.awaitWindow().then(function(z){return o({name:c,win:z,domain:s},a)});return{cancel:function(){d.then(function(z){return z.cancel()},ae)}}}var f=u;if(Array.isArray(f)){for(var v=[],b=0,x=f;b<x.length;b++)v.push(o({name:c,domain:s,win:x[b]},a));return{cancel:function(){for(var z=0;z<v.length;z++)v[z].cancel()}}}if(Array.isArray(s)){for(var S=[],R=0,M=s;R<M.length;R++)S.push(o({name:c,win:f,domain:M[R]},a));return{cancel:function(){for(var z=0;z<S.length;z++)S[z].cancel()}}}var N=Lt({name:c,win:f,domain:s});f&&f!=="*"||(f=Oe());var A=(s=s||"*").toString();if(N)throw f&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(f===Oe()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+c+" for "+(f===Oe()?"wildcard":"specified")+" window"):s?new Error("Request listener already exists for "+c+" on domain "+s.toString()):new Error("Request listener already exists for "+c);var k=m.getOrSet(f,function(){return{}}),W=Ee(k,c,function(){return{}}),D,J;return _e(s)?(D=Ee(W,"__domain_regex__",function(){return[]})).push(J={regex:s,listener:a}):W[A]=a,{cancel:function(){delete W[A],J&&(D.splice(D.indexOf(J,1)),D.length||delete W.__domain_regex__),Object.keys(W).length||delete k[c],f&&!Object.keys(k).length&&m.del(f)}}}({name:e,win:n.window,domain:n.domain||"*"},{handler:t||n.handler,handleError:n.errorHandler||function(o){throw o}});return{cancel:function(){r.cancel()}}}function Fn(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new T,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=ne(e,n,function(i){if(o.cancel(),r.resolve(i),t)return t(i)}),r.cancel=o.cancel,r}var re=function e(n,t,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,c=o.timeout||5e3,u=o.fireAndForget||!1;return G.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return T.try(function(){if(function(m,d,f){if(!m)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!_e(f))throw new TypeError("Can not send "+m+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if(Y(d))throw new Error("Can not send "+m+". Target window is closed")}(t,s,i),function(m,d){var f=ut(d);if(f)return f===m;if(d===m||function(x){x===void 0&&(x=window);try{if(x.top)return x.top}catch(N){}if(V(x)===x)return x;try{if(at(window,x)&&window.top)return window.top}catch(N){}try{if(at(x,window)&&window.top)return window.top}catch(N){}for(var S=0,R=function N(A){for(var k=[],W=0,D=st(A);W<D.length;W++){var J=D[W];k.push(J);for(var z=0,Se=N(J);z<Se.length;z++)k.push(Se[z])}return k}(x);S<R.length;S++){var M=R[S];try{if(M.top)return M.top}catch(N){}if(V(M)===M)return M}}(d)===d)return!1;for(var v=0,b=st(m);v<b.length;v++)if(b[v]===d)return!0;return!1}(window,s))return function(m,d,f){d===void 0&&(d=5e3),f===void 0&&(f="Window");var v=function(b){return _("helloPromises").getOrSet(b,function(){return new T})}(m);return d!==-1&&(v=v.timeout(d,new Error(f+" did not load after "+d+"ms"))),v}(s,c)}).then(function(m){return function(d,f,v,b){var x=b.send;return T.try(function(){return typeof f=="string"?f:T.try(function(){return v||qe(d,{send:x}).then(function(S){return S.domain})}).then(function(S){if(!ue(f,f))throw new Error("Domain "+vt(f)+" does not match "+vt(f));return S})})}(s,i,(m===void 0?{}:m).domain,{send:e})}).then(function(m){var d=m,f=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,v=new T,b=t+"_"+K();if(!u){var x={name:t,win:s,domain:d,promise:v};(function(W,D){j("responseListeners").set(W,D)})(b,x);var S=_("requestPromises").getOrSet(s,function(){return[]});S.push(v),v.catch(function(){(function(W){j("erroredResponseListeners").set(W,!0)})(b),Nt(b)});var R=function(W){return _("knownWindows").get(W,!1)}(s)?1e4:2e3,M=a,N=R,A=M,k=function(W,D){var J;return function z(){J=setTimeout(function(){(function(){if(Y(s))return v.reject(new Error("Window closed for "+t+" before "+(x.ack?"response":"ack")));if(x.cancelled)return v.reject(new Error("Response listener was cancelled for "+t));N=Math.max(N-500,0),A!==-1&&(A=Math.max(A-500,0)),x.ack||N!==0?A===0&&v.reject(new Error("No response for postMessage "+f+" in "+H()+" in "+M+"ms")):v.reject(new Error("No ack for postMessage "+f+" in "+H()+" in "+R+"ms"))})(),z()},500)}(),{cancel:function(){clearTimeout(J)}}}();v.finally(function(){k.cancel(),S.splice(S.indexOf(v,1))}).catch(ae)}return Ye(s,d,{id:K(),origin:H(window),type:"postrobot_message_request",hash:b,name:t,data:r,fireAndForget:u},{on:ne,send:e}).then(function(){return u?v.resolve():v},function(W){throw new Error("Send request message failed for "+f+" in "+H()+`
|
|
152
143
|
|
|
153
|
-
`+
|
|
144
|
+
`+ye(W))})})})};function Hn(e,n,t){return Rt(e,n,t,{on:ne,send:re})}function _n(e,n,t){return At(e,n,t,{on:ne,send:re})}function qn(e){return new G({send:re,win:e})}function Bn(e){return G.toProxyWindow(e,{send:re})}function Mt(){xe().initialized||(xe().initialized=!0,n=(e={on:ne,send:re}).on,t=e.send,(r=xe()).receiveMessage=r.receiveMessage||function(o){return zt(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;j().getOrSet("postMessageListener",function(){return function(c,u,s){return c.addEventListener("message",s),{cancel:function(){c.removeEventListener("message",s)}}}(window,0,function(c){(function(u,s){var m=s.on,d=s.send;T.try(function(){var f=u.source||u.sourceElement,v=u.origin||u.originalEvent&&u.originalEvent.origin,b=u.data;if(v==="null"&&(v="file://"),f){if(!v)throw new Error("Post message did not have origin domain");zt({source:f,origin:v,data:b},{on:m,send:d})}})})(c,{on:i,send:a})})})}({on:ne,send:re}),function(o){var i=o.on,a=o.send;j("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return St(s.source,{domain:s.origin}),{instanceID:xt()}}),u=ut();return u&&qe(u,{send:a}).catch(function(s){}),c})}({on:ne,send:re}));var e,n,t,r}function Gn(){(function(){for(var n=j("responseListeners"),t=0,r=n.keys();t<r.length;t++){var o=r[t],i=n.get(o);i&&(i.cancelled=!0),n.del(o)}})(),(e=j().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var $n=!0;function Vn(e){for(var n=0,t=_("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+(Y(e)?"closed":"cleaned up")+" before response")).catch(ae)}Mt()}])})})(ot);var In=ot.exports;(function(h){h.exports=In,h.exports.default=h.exports})(rt);var it=rt.exports;const ke=P({__proto__:null,default:bn(it)},[it]);I.ConsentBox=Le,I.PrivacyCenterBox=dn,I.SoyioTypes=fn,I.SoyioWidget=nt,I._TooltipManager=O,I.default=nt,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|