(function(){'use strict';/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var l=this||self;function p(a){var c=q;a=a.split(".");for(var b=l,d;a.length&&(d=a.shift());)a.length||c===void 0?b[d]&&b[d]!==Object.prototype[d]?b=b[d]:b=b[d]={}:b[d]=c};var r=Promise;class t{constructor(a){this.data=a}};class u{}function v(a,c){c&&(a.onmessage=b=>{var d=b.data;v(b.ports[0]);c(new t(d))})};var w=class{constructor(a){this.i=a}};const x=a=>{const c=Object.create(null);(typeof a==="string"?[a]:a).forEach(b=>{if(b==="null")throw Error("Receiving from null origin not allowed without token verification. Please use NullOriginConnector.");c[b]=!0});return b=>c[b]===!0};var z=({destination:a,l:c,origin:b,g:d="ZNWN1d",onMessage:f,h})=>{y({destination:a,j:()=>c.contentWindow,m:b instanceof w?b:typeof b==="function"?new w(b):new w(x(b)),g:d,onMessage:f,h})}; const y=({destination:a,j:c,m:b,o:d,g:f,onMessage:h,h:e})=>{new r((m,n)=>{const k=g=>{g.source&&g.source===c()&&b.i(g.origin)&&(g.data.n||g.data)===f&&(a.removeEventListener("message",k,!1),d&&g.data.t!==d?n(Error(`Token mismatch while establishing channel "${f}". Expected ${d}, but received ${g.data.t}.`)):(v(g.ports[0],h),m(new u),e&&e(g)))};a.addEventListener("message",k,!1)})};/* Copyright Google LLC SPDX-License-Identifier: Apache-2.0 */ var A=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function B(a,c){a.removeAttribute("srcdoc");var b="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-storage-access-by-user-activation".split(" ");a.setAttribute("sandbox","");for(let d=0;d480?a.sideMargin?(a.sideMargin-16).toString()+"px":"20px":a.mobileSideMargin?(a.mobileSideMargin-16).toString()+"px":"0";const h=window.innerHeight<480?"0":f>480?a.bottomMargin?a.bottomMargin.toString()+"px": "20px":a.mobileBottomMargin?a.mobileBottomMargin.toString()+"px":"30px",e=D();f=E(d,h);const m=F(a),n=G(a);let k;a=(k=a.merchant_id)!=null?k:0;c==="LEFT_BOTTOM"?(e.style.setProperty("bottom",h,"important"),e.style.setProperty("left",d,"important"),f.style.bottom="0",f.style.left="0"):(e.style.setProperty("bottom",h,"important"),e.style.setProperty("right",d,"important"),f.style.bottom="0",f.style.right="0");e.appendChild(f);document.body.appendChild(e);b=C(m,b,c,a,n);B(f,b.toString());z({destination:window, l:f,origin:b.origin,g:"merchantverse",onMessage:g=>{g=g.data;g.action==="resize"?(e.hidden=!1,e.style.height=`${g.height}px`,e.style.width=`${g.width}px`):g.action==="close"&&(e.hidden=!0)}})}p("merchantverse.start");p("merchantwidget.start");}).call(this);