@pitcher/js-api 1.10.0 → 1.12.0-rc.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/js-api.umd.min.js CHANGED
@@ -1,18 +1,18 @@
1
- (function(_,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(_=typeof globalThis<"u"?globalThis:_||self,Ee(_.pitcher={}))})(this,function(_){"use strict";function Ee(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Pt=typeof global=="object"&&global&&global.Object===Object&&global,Dr=typeof self=="object"&&self&&self.Object===Object&&self,J=Pt||Dr||Function("return this")(),re=J.Symbol,Ot=Object.prototype,Rr=Ot.hasOwnProperty,Mr=Ot.toString,Se=re?re.toStringTag:void 0;function Nr(e){var r=Rr.call(e,Se),a=e[Se];try{e[Se]=void 0;var s=!0}catch{}var h=Mr.call(e);return s&&(r?e[Se]=a:delete e[Se]),h}var Lr=Object.prototype,Ur=Lr.toString;function zr(e){return Ur.call(e)}var Fr="[object Null]",qr="[object Undefined]",xt=re?re.toStringTag:void 0;function ve(e){return e==null?e===void 0?qr:Fr:xt&&xt in Object(e)?Nr(e):zr(e)}function we(e){return e!=null&&typeof e=="object"}var Gr="[object Symbol]";function Hr(e){return typeof e=="symbol"||we(e)&&ve(e)==Gr}function Vr(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var Ue=Array.isArray,Br=1/0,It=re?re.prototype:void 0,Ct=It?It.toString:void 0;function jt(e){if(typeof e=="string")return e;if(Ue(e))return Vr(e,jt)+"";if(Hr(e))return Ct?Ct.call(e):"";var r=e+"";return r=="0"&&1/e==-Br?"-0":r}function Te(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Zr="[object AsyncFunction]",Yr="[object Function]",Jr="[object GeneratorFunction]",Kr="[object Proxy]";function Wt(e){if(!Te(e))return!1;var r=ve(e);return r==Yr||r==Jr||r==Zr||r==Kr}var Qe=J["__core-js_shared__"],$t=function(){var e=/[^.]+$/.exec(Qe&&Qe.keys&&Qe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Qr(e){return!!$t&&$t in e}var Xr=Function.prototype,kr=Xr.toString;function ae(e){if(e!=null){try{return kr.call(e)}catch{}try{return e+""}catch{}}return""}var eo=/[\\^$.*+?()[\]{}|]/g,to=/^\[object .+?Constructor\]$/,no=Function.prototype,ro=Object.prototype,oo=no.toString,io=ro.hasOwnProperty,ao=RegExp("^"+oo.call(io).replace(eo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uo(e){if(!Te(e)||Qr(e))return!1;var r=Wt(e)?ao:to;return r.test(ae(e))}function so(e,r){return e?.[r]}function ue(e,r){var a=so(e,r);return uo(a)?a:void 0}var Xe=ue(J,"WeakMap"),Dt=Object.create,co=function(){function e(){}return function(r){if(!Te(r))return{};if(Dt)return Dt(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function fo(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var Rt=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch{}}();function lo(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var ho=9007199254740991,po=/^(?:0|[1-9]\d*)$/;function go(e,r){var a=typeof e;return r=r??ho,!!r&&(a=="number"||a!="symbol"&&po.test(e))&&e>-1&&e%1==0&&e<r}function Mt(e,r,a){r=="__proto__"&&Rt?Rt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function Nt(e,r){return e===r||e!==e&&r!==r}var vo=Object.prototype,wo=vo.hasOwnProperty;function Lt(e,r,a){var s=e[r];(!(wo.call(e,r)&&Nt(s,a))||a===void 0&&!(r in e))&&Mt(e,r,a)}function ze(e,r,a,s){var h=!a;a||(a={});for(var y=-1,b=r.length;++y<b;){var P=r[y],W=s?s(a[P],e[P],P,a,e):void 0;W===void 0&&(W=e[P]),h?Mt(a,P,W):Lt(a,P,W)}return a}var yo=9007199254740991;function Ut(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yo}function zt(e){return e!=null&&Ut(e.length)&&!Wt(e)}var mo=Object.prototype;function ke(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||mo;return e===a}function bo(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var _o="[object Arguments]";function Ft(e){return we(e)&&ve(e)==_o}var qt=Object.prototype,Ao=qt.hasOwnProperty,Eo=qt.propertyIsEnumerable,So=Ft(function(){return arguments}())?Ft:function(e){return we(e)&&Ao.call(e,"callee")&&!Eo.call(e,"callee")};function To(){return!1}var Gt=typeof _=="object"&&_&&!_.nodeType&&_,Ht=Gt&&typeof module=="object"&&module&&!module.nodeType&&module,Po=Ht&&Ht.exports===Gt,Vt=Po?J.Buffer:void 0,Oo=Vt?Vt.isBuffer:void 0,Bt=Oo||To,xo="[object Arguments]",Io="[object Array]",Co="[object Boolean]",jo="[object Date]",Wo="[object Error]",$o="[object Function]",Do="[object Map]",Ro="[object Number]",Mo="[object Object]",No="[object RegExp]",Lo="[object Set]",Uo="[object String]",zo="[object WeakMap]",Fo="[object ArrayBuffer]",qo="[object DataView]",Go="[object Float32Array]",Ho="[object Float64Array]",Vo="[object Int8Array]",Bo="[object Int16Array]",Zo="[object Int32Array]",Yo="[object Uint8Array]",Jo="[object Uint8ClampedArray]",Ko="[object Uint16Array]",Qo="[object Uint32Array]",j={};j[Go]=j[Ho]=j[Vo]=j[Bo]=j[Zo]=j[Yo]=j[Jo]=j[Ko]=j[Qo]=!0,j[xo]=j[Io]=j[Fo]=j[Co]=j[qo]=j[jo]=j[Wo]=j[$o]=j[Do]=j[Ro]=j[Mo]=j[No]=j[Lo]=j[Uo]=j[zo]=!1;function Xo(e){return we(e)&&Ut(e.length)&&!!j[ve(e)]}function et(e){return function(r){return e(r)}}var Zt=typeof _=="object"&&_&&!_.nodeType&&_,Pe=Zt&&typeof module=="object"&&module&&!module.nodeType&&module,ko=Pe&&Pe.exports===Zt,tt=ko&&Pt.process,ye=function(){try{var e=Pe&&Pe.require&&Pe.require("util").types;return e||tt&&tt.binding&&tt.binding("util")}catch{}}(),Yt=ye&&ye.isTypedArray,ei=Yt?et(Yt):Xo,ti=Object.prototype,ni=ti.hasOwnProperty;function Jt(e,r){var a=Ue(e),s=!a&&So(e),h=!a&&!s&&Bt(e),y=!a&&!s&&!h&&ei(e),b=a||s||h||y,P=b?bo(e.length,String):[],W=P.length;for(var z in e)(r||ni.call(e,z))&&!(b&&(z=="length"||h&&(z=="offset"||z=="parent")||y&&(z=="buffer"||z=="byteLength"||z=="byteOffset")||go(z,W)))&&P.push(z);return P}function Kt(e,r){return function(a){return e(r(a))}}var ri=Kt(Object.keys,Object),oi=Object.prototype,ii=oi.hasOwnProperty;function ai(e){if(!ke(e))return ri(e);var r=[];for(var a in Object(e))ii.call(e,a)&&a!="constructor"&&r.push(a);return r}function nt(e){return zt(e)?Jt(e):ai(e)}function ui(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var si=Object.prototype,ci=si.hasOwnProperty;function fi(e){if(!Te(e))return ui(e);var r=ke(e),a=[];for(var s in e)s=="constructor"&&(r||!ci.call(e,s))||a.push(s);return a}function rt(e){return zt(e)?Jt(e,!0):fi(e)}var Oe=ue(Object,"create");function di(){this.__data__=Oe?Oe(null):{},this.size=0}function li(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var hi="__lodash_hash_undefined__",pi=Object.prototype,gi=pi.hasOwnProperty;function vi(e){var r=this.__data__;if(Oe){var a=r[e];return a===hi?void 0:a}return gi.call(r,e)?r[e]:void 0}var wi=Object.prototype,yi=wi.hasOwnProperty;function mi(e){var r=this.__data__;return Oe?r[e]!==void 0:yi.call(r,e)}var bi="__lodash_hash_undefined__";function _i(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Oe&&r===void 0?bi:r,this}function se(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}se.prototype.clear=di,se.prototype.delete=li,se.prototype.get=vi,se.prototype.has=mi,se.prototype.set=_i;function Ai(){this.__data__=[],this.size=0}function Fe(e,r){for(var a=e.length;a--;)if(Nt(e[a][0],r))return a;return-1}var Ei=Array.prototype,Si=Ei.splice;function Ti(e){var r=this.__data__,a=Fe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Si.call(r,a,1),--this.size,!0}function Pi(e){var r=this.__data__,a=Fe(r,e);return a<0?void 0:r[a][1]}function Oi(e){return Fe(this.__data__,e)>-1}function xi(e,r){var a=this.__data__,s=Fe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function te(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}te.prototype.clear=Ai,te.prototype.delete=Ti,te.prototype.get=Pi,te.prototype.has=Oi,te.prototype.set=xi;var xe=ue(J,"Map");function Ii(){this.size=0,this.__data__={hash:new se,map:new(xe||te),string:new se}}function Ci(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function qe(e,r){var a=e.__data__;return Ci(r)?a[typeof r=="string"?"string":"hash"]:a.map}function ji(e){var r=qe(this,e).delete(e);return this.size-=r?1:0,r}function Wi(e){return qe(this,e).get(e)}function $i(e){return qe(this,e).has(e)}function Di(e,r){var a=qe(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function me(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}me.prototype.clear=Ii,me.prototype.delete=ji,me.prototype.get=Wi,me.prototype.has=$i,me.prototype.set=Di;function Ge(e){return e==null?"":jt(e)}function Qt(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var Ri=Kt(Object.getPrototypeOf,Object);const Xt=Ri;function Mi(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function Ni(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Mi(e,r,a)}var Li="\\ud800-\\udfff",Ui="\\u0300-\\u036f",zi="\\ufe20-\\ufe2f",Fi="\\u20d0-\\u20ff",qi=Ui+zi+Fi,Gi="\\ufe0e\\ufe0f",Hi="\\u200d",Vi=RegExp("["+Hi+Li+qi+Gi+"]");function kt(e){return Vi.test(e)}function Bi(e){return e.split("")}var en="\\ud800-\\udfff",Zi="\\u0300-\\u036f",Yi="\\ufe20-\\ufe2f",Ji="\\u20d0-\\u20ff",Ki=Zi+Yi+Ji,Qi="\\ufe0e\\ufe0f",Xi="["+en+"]",ot="["+Ki+"]",it="\\ud83c[\\udffb-\\udfff]",ki="(?:"+ot+"|"+it+")",tn="[^"+en+"]",nn="(?:\\ud83c[\\udde6-\\uddff]){2}",rn="[\\ud800-\\udbff][\\udc00-\\udfff]",ea="\\u200d",on=ki+"?",an="["+Qi+"]?",ta="(?:"+ea+"(?:"+[tn,nn,rn].join("|")+")"+an+on+")*",na=an+on+ta,ra="(?:"+[tn+ot+"?",ot,nn,rn,Xi].join("|")+")",oa=RegExp(it+"(?="+it+")|"+ra+na,"g");function ia(e){return e.match(oa)||[]}function aa(e){return kt(e)?ia(e):Bi(e)}function ua(e){return function(r){r=Ge(r);var a=kt(r)?aa(r):void 0,s=a?a[0]:r.charAt(0),h=a?Ni(a,1).join(""):r.slice(1);return s[e]()+h}}var sa=ua("toUpperCase");function ca(e){return sa(Ge(e).toLowerCase())}function fa(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function da(e){return function(r){return e?.[r]}}var la={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ha=da(la);const pa=ha;var ga=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,va="\\u0300-\\u036f",wa="\\ufe20-\\ufe2f",ya="\\u20d0-\\u20ff",ma=va+wa+ya,ba="["+ma+"]",_a=RegExp(ba,"g");function Aa(e){return e=Ge(e),e&&e.replace(ga,pa).replace(_a,"")}var Ea=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Sa(e){return e.match(Ea)||[]}var Ta=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Pa(e){return Ta.test(e)}var un="\\ud800-\\udfff",Oa="\\u0300-\\u036f",xa="\\ufe20-\\ufe2f",Ia="\\u20d0-\\u20ff",Ca=Oa+xa+Ia,sn="\\u2700-\\u27bf",cn="a-z\\xdf-\\xf6\\xf8-\\xff",ja="\\xac\\xb1\\xd7\\xf7",Wa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$a="\\u2000-\\u206f",Da=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fn="A-Z\\xc0-\\xd6\\xd8-\\xde",Ra="\\ufe0e\\ufe0f",dn=ja+Wa+$a+Da,ln="['’]",hn="["+dn+"]",Ma="["+Ca+"]",pn="\\d+",Na="["+sn+"]",gn="["+cn+"]",vn="[^"+un+dn+pn+sn+cn+fn+"]",La="\\ud83c[\\udffb-\\udfff]",Ua="(?:"+Ma+"|"+La+")",za="[^"+un+"]",wn="(?:\\ud83c[\\udde6-\\uddff]){2}",yn="[\\ud800-\\udbff][\\udc00-\\udfff]",be="["+fn+"]",Fa="\\u200d",mn="(?:"+gn+"|"+vn+")",qa="(?:"+be+"|"+vn+")",bn="(?:"+ln+"(?:d|ll|m|re|s|t|ve))?",_n="(?:"+ln+"(?:D|LL|M|RE|S|T|VE))?",An=Ua+"?",En="["+Ra+"]?",Ga="(?:"+Fa+"(?:"+[za,wn,yn].join("|")+")"+En+An+")*",Ha="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Va="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ba=En+An+Ga,Za="(?:"+[Na,wn,yn].join("|")+")"+Ba,Ya=RegExp([be+"?"+gn+"+"+bn+"(?="+[hn,be,"$"].join("|")+")",qa+"+"+_n+"(?="+[hn,be+mn,"$"].join("|")+")",be+"?"+mn+"+"+bn,be+"+"+_n,Va,Ha,pn,Za].join("|"),"g");function Ja(e){return e.match(Ya)||[]}function Ka(e,r,a){return e=Ge(e),r=a?void 0:r,r===void 0?Pa(e)?Ja(e):Sa(e):e.match(r)||[]}var Qa="['’]",Xa=RegExp(Qa,"g");function Sn(e){return function(r){return fa(Ka(Aa(r).replace(Xa,"")),e,"")}}var ka=Sn(function(e,r,a){return r=r.toLowerCase(),e+(a?ca(r):r)});const eu=ka;function tu(){this.__data__=new te,this.size=0}function nu(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function ru(e){return this.__data__.get(e)}function ou(e){return this.__data__.has(e)}var iu=200;function au(e,r){var a=this.__data__;if(a instanceof te){var s=a.__data__;if(!xe||s.length<iu-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new me(s)}return a.set(e,r),this.size=a.size,this}function _e(e){var r=this.__data__=new te(e);this.size=r.size}_e.prototype.clear=tu,_e.prototype.delete=nu,_e.prototype.get=ru,_e.prototype.has=ou,_e.prototype.set=au;function uu(e,r){return e&&ze(r,nt(r),e)}function su(e,r){return e&&ze(r,rt(r),e)}var Tn=typeof _=="object"&&_&&!_.nodeType&&_,Pn=Tn&&typeof module=="object"&&module&&!module.nodeType&&module,cu=Pn&&Pn.exports===Tn,On=cu?J.Buffer:void 0,xn=On?On.allocUnsafe:void 0;function fu(e,r){if(r)return e.slice();var a=e.length,s=xn?xn(a):new e.constructor(a);return e.copy(s),s}function du(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var b=e[a];r(b,a,e)&&(y[h++]=b)}return y}function In(){return[]}var lu=Object.prototype,hu=lu.propertyIsEnumerable,Cn=Object.getOwnPropertySymbols,at=Cn?function(e){return e==null?[]:(e=Object(e),du(Cn(e),function(r){return hu.call(e,r)}))}:In;function pu(e,r){return ze(e,at(e),r)}var gu=Object.getOwnPropertySymbols,jn=gu?function(e){for(var r=[];e;)Qt(r,at(e)),e=Xt(e);return r}:In;function vu(e,r){return ze(e,jn(e),r)}function Wn(e,r,a){var s=r(e);return Ue(e)?s:Qt(s,a(e))}function wu(e){return Wn(e,nt,at)}function yu(e){return Wn(e,rt,jn)}var ut=ue(J,"DataView"),st=ue(J,"Promise"),ct=ue(J,"Set"),$n="[object Map]",mu="[object Object]",Dn="[object Promise]",Rn="[object Set]",Mn="[object WeakMap]",Nn="[object DataView]",bu=ae(ut),_u=ae(xe),Au=ae(st),Eu=ae(ct),Su=ae(Xe),ce=ve;(ut&&ce(new ut(new ArrayBuffer(1)))!=Nn||xe&&ce(new xe)!=$n||st&&ce(st.resolve())!=Dn||ct&&ce(new ct)!=Rn||Xe&&ce(new Xe)!=Mn)&&(ce=function(e){var r=ve(e),a=r==mu?e.constructor:void 0,s=a?ae(a):"";if(s)switch(s){case bu:return Nn;case _u:return $n;case Au:return Dn;case Eu:return Rn;case Su:return Mn}return r});const ft=ce;var Tu=Object.prototype,Pu=Tu.hasOwnProperty;function Ou(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&Pu.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Ln=J.Uint8Array;function dt(e){var r=new e.constructor(e.byteLength);return new Ln(r).set(new Ln(e)),r}function xu(e,r){var a=r?dt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var Iu=/\w*$/;function Cu(e){var r=new e.constructor(e.source,Iu.exec(e));return r.lastIndex=e.lastIndex,r}var Un=re?re.prototype:void 0,zn=Un?Un.valueOf:void 0;function ju(e){return zn?Object(zn.call(e)):{}}function Wu(e,r){var a=r?dt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var $u="[object Boolean]",Du="[object Date]",Ru="[object Map]",Mu="[object Number]",Nu="[object RegExp]",Lu="[object Set]",Uu="[object String]",zu="[object Symbol]",Fu="[object ArrayBuffer]",qu="[object DataView]",Gu="[object Float32Array]",Hu="[object Float64Array]",Vu="[object Int8Array]",Bu="[object Int16Array]",Zu="[object Int32Array]",Yu="[object Uint8Array]",Ju="[object Uint8ClampedArray]",Ku="[object Uint16Array]",Qu="[object Uint32Array]";function Xu(e,r,a){var s=e.constructor;switch(r){case Fu:return dt(e);case $u:case Du:return new s(+e);case qu:return xu(e,a);case Gu:case Hu:case Vu:case Bu:case Zu:case Yu:case Ju:case Ku:case Qu:return Wu(e,a);case Ru:return new s;case Mu:case Uu:return new s(e);case Nu:return Cu(e);case Lu:return new s;case zu:return ju(e)}}function ku(e){return typeof e.constructor=="function"&&!ke(e)?co(Xt(e)):{}}var es="[object Map]";function ts(e){return we(e)&&ft(e)==es}var Fn=ye&&ye.isMap,ns=Fn?et(Fn):ts,rs="[object Set]";function os(e){return we(e)&&ft(e)==rs}var qn=ye&&ye.isSet,is=qn?et(qn):os,as=1,us=2,ss=4,Gn="[object Arguments]",cs="[object Array]",fs="[object Boolean]",ds="[object Date]",ls="[object Error]",Hn="[object Function]",hs="[object GeneratorFunction]",ps="[object Map]",gs="[object Number]",Vn="[object Object]",vs="[object RegExp]",ws="[object Set]",ys="[object String]",ms="[object Symbol]",bs="[object WeakMap]",_s="[object ArrayBuffer]",As="[object DataView]",Es="[object Float32Array]",Ss="[object Float64Array]",Ts="[object Int8Array]",Ps="[object Int16Array]",Os="[object Int32Array]",xs="[object Uint8Array]",Is="[object Uint8ClampedArray]",Cs="[object Uint16Array]",js="[object Uint32Array]",x={};x[Gn]=x[cs]=x[_s]=x[As]=x[fs]=x[ds]=x[Es]=x[Ss]=x[Ts]=x[Ps]=x[Os]=x[ps]=x[gs]=x[Vn]=x[vs]=x[ws]=x[ys]=x[ms]=x[xs]=x[Is]=x[Cs]=x[js]=!0,x[ls]=x[Hn]=x[bs]=!1;function He(e,r,a,s,h,y){var b,P=r&as,W=r&us,z=r&ss;if(a&&(b=h?a(e,s,h,y):a(e)),b!==void 0)return b;if(!Te(e))return e;var Q=Ue(e);if(Q){if(b=Ou(e),!P)return fo(e,b)}else{var ne=ft(e),de=ne==Hn||ne==hs;if(Bt(e))return fu(e,P);if(ne==Vn||ne==Gn||de&&!h){if(b=W||de?{}:ku(e),!P)return W?vu(e,su(b,e)):pu(e,uu(b,e))}else{if(!x[ne])return h?e:{};b=Xu(e,ne,P)}}y||(y=new _e);var le=y.get(e);if(le)return le;y.set(e,b),is(e)?e.forEach(function(G){b.add(He(G,r,a,G,e,y))}):ns(e)&&e.forEach(function(G,k){b.set(k,He(G,r,a,k,e,y))});var F=z?W?yu:wu:W?rt:nt,X=Q?void 0:F(e);return lo(X||e,function(G,k){X&&(k=G,G=e[k]),Lt(b,k,He(G,r,a,k,e,y))}),b}var Ws=1,$s=4;function Ds(e){return He(e,Ws|$s)}var lt=Sn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function Rs(e={}){return this.API.request("open",e)}function Ms(){return this.API.request("get_env")}function Ns(e){return this.API.request("update_my_user",e)}function Ls(){return this.API.request("get_languages")}function Us(e){return _.highLevelApi.API.request("get_events",e)}function zs(e){return _.highLevelApi.API.request("create_event",e)}function Fs(e){return _.highLevelApi.API.request("update_event",e)}function qs(e){return _.highLevelApi.API.request("delete_event",e)}function Gs(e){return this.API.request("get_canvases",e)}function Hs(e){return this.API.request("create_canvas",e)}function Vs(e){return this.API.request("delete_canvas",e)}function Bs(e){return this.API.request("update_canvas",e)}function Zs(e){return this.API.request("get_canvas",e)}function Ys(e){return this.API.request("share_canvas",e)}function Js(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function Ks(e){return this.API.request("download_file",e)}function Qs(e){return this.API.request("get_app_config",e)}function Xs(e){return this.API.request("get_file",e)}function ks(e){return this.API.request("delete_file",e)}function ec(e){return this.API.request("create_file",e)}function tc(){return this.API.request("select_device_file")}function nc(e){return this.API.request("search",e)}function rc(e){return this.API.request("get_users",e)}function oc(e){return this.API.request("fetch_document_info",e)}function ic(e){return this.API.request("render_page_as_image",e)}function ac(e){return this.API.request("toast",e)}function uc(e){return _.highLevelApi.API.request("query",e)}function sc(e={id:"root"}){return this.API.request("get_folder",e)}function cc(e){return this.API.request("create_folder",e)}function fc(e){return this.API.request("update_folder",e)}function dc(e){return this.API.request("delete_folder",e)}function lc(e){return this.API.request("move_folder_items",e)}function hc(e){return this.API.request("get_favorites",e)}function pc(e){return this.API.request("create_favorite",e)}function gc(e){return this.API.request("delete_favorite",e)}function vc(e){return e.type||(e.type="native"),_.highLevelApi.API.request("notify",e)}function wc(e){return _.highLevelApi.API.request("track",e)}function yc(e){return this.API.request("get_instance_metadata_templates",e)}function mc(){return this.API.request("trigger_non_files_sync")}const bc=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:Hs,createEvent:zs,createFavorite:pc,createFile:ec,createFolder:cc,deleteCanvas:Vs,deleteEvent:qs,deleteFavorite:gc,deleteFile:ks,deleteFolder:dc,downloadFile:Ks,fetchDocumentInfo:oc,getAppConfig:Qs,getCanvas:Zs,getCanvases:Gs,getEnv:Ms,getEvents:Us,getFavorites:hc,getFile:Xs,getFiles:Js,getFolder:sc,getInstanceMetadataTemplates:yc,getLanguages:Ls,getUsers:rc,moveFolderItems:lc,notify:vc,open:Rs,query:uc,renderPageAsImage:ic,search:nc,selectDeviceFile:tc,shareCanvas:Ys,toast:ac,track:wc,triggerNonFilesSync:mc,updateCanvas:Bs,updateEvent:Fs,updateFolder:fc,updateMyUser:Ns},Symbol.toStringTag,{value:"Module"}));class Bn{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Ve;const _c=new Uint8Array(16);function Ac(){if(!Ve&&(Ve=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ve))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ve(_c)}const U=[];for(let e=0;e<256;++e)U.push((e+256).toString(16).slice(1));function Ec(e,r=0){return U[e[r+0]]+U[e[r+1]]+U[e[r+2]]+U[e[r+3]]+"-"+U[e[r+4]]+U[e[r+5]]+"-"+U[e[r+6]]+U[e[r+7]]+"-"+U[e[r+8]]+U[e[r+9]]+"-"+U[e[r+10]]+U[e[r+11]]+U[e[r+12]]+U[e[r+13]]+U[e[r+14]]+U[e[r+15]]}const Zn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Sc(e,r,a){if(Zn.randomUUID&&!r&&!e)return Zn.randomUUID();e=e||{};const s=e.random||(e.rng||Ac)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return Ec(s)}class Tc extends Error{}function Pc(e,r){if(!e)throw new Tc(r)}const Yn=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],Jn=["context","overrides","filters","metadata","style","hidden"],Ie=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>Ie(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:eu(h),b=a.includes(h)?e[h]:Ie(e[h],r,a);return{...s,[y]:b}},{}):e,ht=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>ht(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:lt(h),b=a.includes(h)?e[h]:ht(e[h],r,a);return{...s,[y]:b}},{}):e;function Oc(e,r=[],a=!1){if(a)return!0;if(!e||!e.origin)return!1;const h=(r.length>0?r:[window.location.origin]).includes(e.origin);return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}class xc extends Bn{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",a=>{Oc(a)&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?(Pc(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Ie(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=Sc(),b=W=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,W),W.response.status==="ok")s(this.options.casing==="camel"?Ie(W.response.body):W.response.body);else if(W.response.status==="error")h(this.options.casing==="camel"?Ie(W.response.body):W.response.body);else throw new Error("unsupported response status")},P=Ds(ht(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:P??{},callback:b},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:P}},"*")})}}function Ic(e){const r=new xc(e),a=new Bn;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...bc,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}const Cc="UI_MESSAGE",pt={UI_SELECT_CONTENT:"ui_select_content",UI_OPEN:"ui_open"},jc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Wc(e={}){return(await(await Promise.resolve().then(()=>K)).send(window.parent,pt.UI_SELECT_CONTENT,e)).data}async function $c(e){await(await Promise.resolve().then(()=>K)).send(window.parent,pt.UI_OPEN,e)}async function Dc(e,r){return(await Promise.resolve().then(()=>K)).on(e,h=>r(h.data)).cancel}const Rc=Object.freeze(Object.defineProperty({__proto__:null,on:Dc,open:$c,ui_select_content:Wc},Symbol.toStringTag,{value:"Module"})),Mc="ADMIN_MESSAGE",Nc={ENV_CHANGED:"admin_env_changed"},Lc={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},fe={CREATE_CANVAS:"admin_create_canvas",GET_ENV:"admin_get_env",GET_CANVAS:"admin_get_canvas",GET_CANVASES:"admin_get_canvases",UPDATE_CANVAS:"admin_update_canvas",GET_INSTANCE_METADATA_TEMPLATES:"admin_get_instance_metadata_templates",GET_APP_CONFIG:"admin_get_app_config"};async function Uc(){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.GET_ENV)).data}async function zc(e){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.CREATE_CANVAS,e)).data}async function Fc(e){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.GET_CANVASES,e)).data}async function qc(e){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.GET_CANVAS,e)).data}async function Gc(e){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.UPDATE_CANVAS,e)).data}async function Hc(e){return(await(await Promise.resolve().then(()=>K)).send(window.parent,fe.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function Vc(e,r){return(await Promise.resolve().then(()=>K)).on(e,h=>r(h.data)).cancel}const Bc=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:zc,getCanvas:qc,getCanvases:Fc,getEnv:Uc,getInstanceMetadataTemplates:Hc,on:Vc,updateCanvas:Gc},Symbol.toStringTag,{value:"Module"})),Zc="PITCHER_EVENT";var Kn=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(Kn||{}),Qn=(e=>(e.OK="ok",e.ERROR="error",e))(Qn||{}),Xn=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e))(Xn||{}),kn=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(kn||{}),er=(e=>(e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(er||{});_.highLevelApi=void 0;function Yc(e){return _.highLevelApi||(_.highLevelApi=Ic(e)),_.highLevelApi}const Jc=Object.entries(Rc).reduce((e,[r,a])=>(e[r]=a,e[lt(r)]=a,e),{});function Kc(){return Jc}const Qc=Object.entries(Bc).reduce((e,[r,a])=>(e[r]=a,e[lt(r)]=a,e),{});function Xc(){return Qc}var kc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ef(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tr={exports:{}},nr={exports:{}};(function(e,r){(function(a,s){e.exports=s()})(typeof self<"u"?self:kc,function(){return function(a){var s={};function h(y){if(s[y])return s[y].exports;var b=s[y]={i:y,l:!1,exports:{}};return a[y].call(b.exports,b,b.exports,h),b.l=!0,b.exports}return h.m=a,h.c=s,h.d=function(y,b,P){h.o(y,b)||Object.defineProperty(y,b,{enumerable:!0,get:P})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,b){if(1&b&&(y=h(y)),8&b||4&b&&typeof y=="object"&&y&&y.__esModule)return y;var P=Object.create(null);if(h.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:y}),2&b&&typeof y!="string")for(var W in y)h.d(P,W,function(z){return y[z]}.bind(null,W));return P},h.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(b,"a",b),b},h.o=function(y,b){return{}.hasOwnProperty.call(y,b)},h.p="",h(h.s=0)}([function(a,s,h){h.r(s),h.d(s,"Promise",function(){return O}),h.d(s,"TYPES",function(){return Sf}),h.d(s,"ProxyWindow",function(){return B}),h.d(s,"setup",function(){return $r}),h.d(s,"destroy",function(){return Ef}),h.d(s,"serializeMessage",function(){return mf}),h.d(s,"deserializeMessage",function(){return bf}),h.d(s,"createProxyWindow",function(){return _f}),h.d(s,"toProxyWindow",function(){return Af}),h.d(s,"on",function(){return oe}),h.d(s,"once",function(){return yf}),h.d(s,"send",function(){return ie}),h.d(s,"markWindowKnown",function(){return _r}),h.d(s,"cleanUpWindow",function(){return Tf}),h.d(s,"bridge",function(){});function y(t){return{}.toString.call(t)==="[object RegExp]"}var b=`Call was rejected by callee.\r
2
- `;function P(t){return t===void 0&&(t=window),t.location.protocol}function W(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return P(t)}function z(t){return t===void 0&&(t=window),W(t)==="about:"}function Q(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function ne(t){if(t===void 0&&(t=window),t&&!Q(t))try{return t.opener}catch{}}function de(t){try{return!0}catch{}return!1}function le(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=P(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=Q(t);return i&&de()?le(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function F(t){t===void 0&&(t=window);var o=le(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function X(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(z(o)&&de())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),W(i)==="mock:"}(o)&&de())return!0}catch{}try{if(le(o)===le(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||z(t)&&de()||F(window)===F(t))return!0}catch{}return!1}function G(t){if(!X(t))throw new Error("Expected window to be same domain");return t}function k(t,o){if(!t||!o)return!1;var n=Q(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function or(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var p=void 0;try{p=n[f]}catch{return o}if(!p)return o;o.push(p)}return o}var nf=[],rf=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==b}if(o&&X(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(nf,t);if(n!==-1){var i=rf[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function ir(t){return t===void 0&&(t=window),ne(t=t||window)||Q(t)||void 0}function Ae(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return Ae(n,o)}))}function Be(t){try{if(t===window)return!0}catch(o){if(o&&o.message===b)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===b)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function ar(t){if(X(t))return G(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function of(t){if(function(n){return n===void 0&&(n=window),!!Q(n)}(t)){var o=ar(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function he(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var ur=[],Ce=[],gt=0,je;function sr(){if(!gt&&je){var t=je;je=null,t.resolve()}}function vt(){gt+=1}function We(){gt-=1,sr()}var O=function(){function t(n){var i=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=[],n){var u,c,f=!1,p=!1,l=!1;vt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(p=!0,c=d)})}catch(d){We(),this.reject(d);return}We(),l=!0,f?this.resolve(u):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(he(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(he(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(ur.indexOf(c)===-1){ur.push(c),setTimeout(function(){throw c},1);for(var p=0;p<Ce.length;p++)Ce[p](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,vt();for(var c=function(m,S){return m.then(function(A){S.resolve(A)},function(A){S.reject(A)})},f=0;f<u.length;f++){var p=u[f],l=p.onSuccess,d=p.onError,w=p.promise,g=void 0;if(n)try{g=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{g=d(this.error)}catch(m){w.reject(m);continue}}if(g instanceof t&&(g.resolved||g.rejected)){var v=g;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else he(g)?g instanceof t&&(g.resolved||g.rejected)?g.resolved?w.resolve(g.value):w.reject(g.error):c(g,w):w.resolve(g)}u.length=0,this.dispatching=!1,We()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},o.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},o.lazy=function(){return this.errorHandled=!0,this},t.resolve=function(n){return n instanceof t?n:he(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,g){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){g.reject(v)})},p=0;p<n.length;p++){var l=n[p];if(l instanceof t){if(l.resolved){c[p]=l.value,u-=1;continue}}else if(!he(l)){c[p]=l,u-=1;continue}f(p,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(p){if(n.hasOwnProperty(p)){var l=n[p];he(l)?u.push(l.then(function(d){i[p]=d})):i[p]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return Ce.push(i),{cancel:function(){Ce.splice(Ce.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;vt();try{c=n.apply(i,u||[])}catch(f){return We(),t.reject(f)}return We(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||he(n)},t.flush=function(){return function(n){var i=je=je||new n;return sr(),i}(t)},t}();function Ze(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var wt=function(){function t(){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 n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Be(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Be(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,d=Ze(p,n);d===-1?(p.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Ze(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Ze(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Ze(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function cr(t){return t.name||t.__name__||t.displayName||"anonymous"}function fr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function ee(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"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 Ye;function dr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(Ye=Ye||new wt,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=Ye.get(i);return u||(u=typeof i+":"+ee(),Ye.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function af(){return{}}var $e=0,lr=0;function De(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,p=$e;$e+=1;var l=function(){for(var d=arguments.length,w=new Array(d),g=0;g<d;g++)w[g]=arguments[g];p<lr&&(c=null,f=null,p=$e,$e+=1);var v;v=i?(f=f||new wt).getOrSet(this,af):c=c||{};var m;try{m=dr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var A=Date.now(),E=t.apply(this,arguments);return v[m]={time:A,value:E},E};return l.reset=function(){c=null,f=null},fr(l,(o.name||cr(t))+"::memoized")}De.clear=function(){lr=$e};function uf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];var l=dr(f);return o.hasOwnProperty(l)||(o[l]=O.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},fr(n,cr(t)+"::promiseMemoized")}function pe(){}function Re(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
3
- `+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "+Re(u,o+1)}}function hr(t){return typeof t=="string"?t:t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}De(function(t){if(Object.values)return Object.values(t);var o=[];for(var n in t)t.hasOwnProperty(n)&&o.push(t[n]);return o});function yt(t){return{}.toString.call(t)==="[object RegExp]"}function Me(t,o,n){if(t.hasOwnProperty(o))return t[o];var i=n();return t[o]=i,i}function pr(){var t=document.body;if(!t)throw new Error("Body element not found");return t}function gr(){return!!document.body&&document.readyState==="complete"}function vr(){return!!document.body&&document.readyState==="interactive"}De(function(){return new O(function(t){if(gr()||vr())return t();var o=setInterval(function(){if(gr()||vr())return clearInterval(o),t()},10)})});var Je=typeof document<"u"?document.currentScript:null,sf=De(function(){if(Je||(Je=function(){try{var t=function(){try{throw new Error("_")}catch(f){return f.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(t),n=o&&o[1];if(!n)return;for(var i=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();i<u.length;i++){var c=u[i];if(c.src&&c.src===n)return c}}catch{}}()))return Je;throw new Error("Can not determine current script")}),cf=ee();De(function(){var t;try{t=sf()}catch{return cf}var o=t.getAttribute("data-uid");if(o&&typeof o=="string"||(o=t.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(t.src){var n=function(i){for(var u="",c=0;c<i.length;c++){var f=i[c].charCodeAt(0)*c;i[c+1]&&(f+=i[c+1].charCodeAt(0)*(c-1)),u+=String.fromCharCode(97+Math.abs(f)%26)}return u}(JSON.stringify({src:t.src,dataset:t.dataset}));o="uid_"+n.slice(n.length-30)}else o=ee();return t.setAttribute("data-uid-auto",o),o});function Ne(t){t===void 0&&(t=window);var o="__post_robot_10_0_46__";return t!==window?t[o]:t[o]=t[o]||{}}var wr=function(){return{}};function N(t,o){return t===void 0&&(t="store"),o===void 0&&(o=wr),Me(Ne(),t,function(){var n=o();return{has:function(i){return n.hasOwnProperty(i)},get:function(i,u){return n.hasOwnProperty(i)?n[i]:u},set:function(i,u){return n[i]=u,u},del:function(i){delete n[i]},getOrSet:function(i,u){return Me(n,i,u)},reset:function(){n=o()},keys:function(){return Object.keys(n)}}})}var ff=function(){};function Ke(){var t=Ne();return t.WINDOW_WILDCARD=t.WINDOW_WILDCARD||new ff,t.WINDOW_WILDCARD}function q(t,o){return t===void 0&&(t="store"),o===void 0&&(o=wr),N("windowStore").getOrSet(t,function(){var n=new wt,i=function(u){return n.getOrSet(u,o)};return{has:function(u){return i(u).hasOwnProperty(t)},get:function(u,c){var f=i(u);return f.hasOwnProperty(t)?f[t]:c},set:function(u,c){return i(u)[t]=c,c},del:function(u){delete i(u)[t]},getOrSet:function(u,c){return Me(i(u),t,c)}}})}function yr(){return N("instance").getOrSet("instanceID",ee)}function mr(t,o){var n=o.domain,i=q("helloPromises"),u=i.get(t);u&&u.resolve({domain:n});var c=O.resolve({domain:n});return i.set(t,c),c}function mt(t,o){return(0,o.send)(t,"postrobot_hello",{instanceID:yr()},{domain:"*",timeout:-1}).then(function(n){var i=n.origin,u=n.data.instanceID;return mr(t,{domain:i}),{win:t,domain:i,instanceID:u}})}function br(t,o){var n=o.send;return q("windowInstanceIDPromises").getOrSet(t,function(){return mt(t,{send:n}).then(function(i){return i.instanceID})})}function _r(t){q("knownWindows").set(t,!0)}function bt(t){return typeof t=="object"&&t!==null&&typeof t.__type__=="string"}function Ar(t){return t===void 0?"undefined":t===null?"null":Array.isArray(t)?"array":typeof t=="function"?"function":typeof t=="object"?t instanceof Error?"error":typeof t.then=="function"?"promise":{}.toString.call(t)==="[object RegExp]"?"regex":{}.toString.call(t)==="[object Date]"?"date":"object":typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":void 0}function ge(t,o){return{__type__:t,__val__:o}}var H,df=((H={}).function=function(){},H.error=function(t){return ge("error",{message:t.message,stack:t.stack,code:t.code,data:t.data})},H.promise=function(){},H.regex=function(t){return ge("regex",t.source)},H.date=function(t){return ge("date",t.toJSON())},H.array=function(t){return t},H.object=function(t){return t},H.string=function(t){return t},H.number=function(t){return t},H.boolean=function(t){return t},H.null=function(t){return t},H[void 0]=function(t){return ge("undefined",t)},H),lf={},V,hf=((V={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},V.error=function(t){var o=t.stack,n=t.code,i=t.data,u=new Error(t.message);return u.code=n,i&&(u.data=i),u.stack=o+`
1
+ (function(b,Ae){typeof exports=="object"&&typeof module<"u"?Ae(exports):typeof define=="function"&&define.amd?define(["exports"],Ae):(b=typeof globalThis<"u"?globalThis:b||self,Ae(b.pitcher={}))})(this,function(b){"use strict";function Ae(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Pt=typeof global=="object"&&global&&global.Object===Object&&global,Mr=typeof self=="object"&&self&&self.Object===Object&&self,K=Pt||Mr||Function("return this")(),re=K.Symbol,Ot=Object.prototype,$r=Ot.hasOwnProperty,Nr=Ot.toString,Se=re?re.toStringTag:void 0;function Lr(e){var r=$r.call(e,Se),a=e[Se];try{e[Se]=void 0;var s=!0}catch{}var h=Nr.call(e);return s&&(r?e[Se]=a:delete e[Se]),h}var Ur=Object.prototype,zr=Ur.toString;function Fr(e){return zr.call(e)}var qr="[object Null]",Gr="[object Undefined]",It=re?re.toStringTag:void 0;function ve(e){return e==null?e===void 0?Gr:qr:It&&It in Object(e)?Lr(e):Fr(e)}function we(e){return e!=null&&typeof e=="object"}var Hr="[object Symbol]";function Vr(e){return typeof e=="symbol"||we(e)&&ve(e)==Hr}function Br(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var Ue=Array.isArray,Yr=1/0,xt=re?re.prototype:void 0,Ct=xt?xt.toString:void 0;function jt(e){if(typeof e=="string")return e;if(Ue(e))return Br(e,jt)+"";if(Vr(e))return Ct?Ct.call(e):"";var r=e+"";return r=="0"&&1/e==-Yr?"-0":r}function Te(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Zr="[object AsyncFunction]",Jr="[object Function]",Kr="[object GeneratorFunction]",Qr="[object Proxy]";function Dt(e){if(!Te(e))return!1;var r=ve(e);return r==Jr||r==Kr||r==Zr||r==Qr}var ke=K["__core-js_shared__"],Rt=function(){var e=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Xr(e){return!!Rt&&Rt in e}var kr=Function.prototype,eo=kr.toString;function ae(e){if(e!=null){try{return eo.call(e)}catch{}try{return e+""}catch{}}return""}var to=/[\\^$.*+?()[\]{}|]/g,no=/^\[object .+?Constructor\]$/,ro=Function.prototype,oo=Object.prototype,io=ro.toString,ao=oo.hasOwnProperty,uo=RegExp("^"+io.call(ao).replace(to,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function so(e){if(!Te(e)||Xr(e))return!1;var r=Dt(e)?uo:no;return r.test(ae(e))}function co(e,r){return e?.[r]}function ue(e,r){var a=co(e,r);return so(a)?a:void 0}var et=ue(K,"WeakMap"),Wt=Object.create,fo=function(){function e(){}return function(r){if(!Te(r))return{};if(Wt)return Wt(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function lo(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var Mt=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ho(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var po=9007199254740991,go=/^(?:0|[1-9]\d*)$/;function vo(e,r){var a=typeof e;return r=r??po,!!r&&(a=="number"||a!="symbol"&&go.test(e))&&e>-1&&e%1==0&&e<r}function $t(e,r,a){r=="__proto__"&&Mt?Mt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function Nt(e,r){return e===r||e!==e&&r!==r}var wo=Object.prototype,yo=wo.hasOwnProperty;function Lt(e,r,a){var s=e[r];(!(yo.call(e,r)&&Nt(s,a))||a===void 0&&!(r in e))&&$t(e,r,a)}function ze(e,r,a,s){var h=!a;a||(a={});for(var y=-1,_=r.length;++y<_;){var P=r[y],D=s?s(a[P],e[P],P,a,e):void 0;D===void 0&&(D=e[P]),h?$t(a,P,D):Lt(a,P,D)}return a}var mo=9007199254740991;function Ut(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=mo}function zt(e){return e!=null&&Ut(e.length)&&!Dt(e)}var _o=Object.prototype;function tt(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||_o;return e===a}function bo(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var Eo="[object Arguments]";function Ft(e){return we(e)&&ve(e)==Eo}var qt=Object.prototype,Ao=qt.hasOwnProperty,So=qt.propertyIsEnumerable,To=Ft(function(){return arguments}())?Ft:function(e){return we(e)&&Ao.call(e,"callee")&&!So.call(e,"callee")};function Po(){return!1}var Gt=typeof b=="object"&&b&&!b.nodeType&&b,Ht=Gt&&typeof module=="object"&&module&&!module.nodeType&&module,Oo=Ht&&Ht.exports===Gt,Vt=Oo?K.Buffer:void 0,Io=Vt?Vt.isBuffer:void 0,Bt=Io||Po,xo="[object Arguments]",Co="[object Array]",jo="[object Boolean]",Do="[object Date]",Ro="[object Error]",Wo="[object Function]",Mo="[object Map]",$o="[object Number]",No="[object Object]",Lo="[object RegExp]",Uo="[object Set]",zo="[object String]",Fo="[object WeakMap]",qo="[object ArrayBuffer]",Go="[object DataView]",Ho="[object Float32Array]",Vo="[object Float64Array]",Bo="[object Int8Array]",Yo="[object Int16Array]",Zo="[object Int32Array]",Jo="[object Uint8Array]",Ko="[object Uint8ClampedArray]",Qo="[object Uint16Array]",Xo="[object Uint32Array]",j={};j[Ho]=j[Vo]=j[Bo]=j[Yo]=j[Zo]=j[Jo]=j[Ko]=j[Qo]=j[Xo]=!0,j[xo]=j[Co]=j[qo]=j[jo]=j[Go]=j[Do]=j[Ro]=j[Wo]=j[Mo]=j[$o]=j[No]=j[Lo]=j[Uo]=j[zo]=j[Fo]=!1;function ko(e){return we(e)&&Ut(e.length)&&!!j[ve(e)]}function nt(e){return function(r){return e(r)}}var Yt=typeof b=="object"&&b&&!b.nodeType&&b,Pe=Yt&&typeof module=="object"&&module&&!module.nodeType&&module,ei=Pe&&Pe.exports===Yt,rt=ei&&Pt.process,ye=function(){try{var e=Pe&&Pe.require&&Pe.require("util").types;return e||rt&&rt.binding&&rt.binding("util")}catch{}}(),Zt=ye&&ye.isTypedArray,ti=Zt?nt(Zt):ko,ni=Object.prototype,ri=ni.hasOwnProperty;function Jt(e,r){var a=Ue(e),s=!a&&To(e),h=!a&&!s&&Bt(e),y=!a&&!s&&!h&&ti(e),_=a||s||h||y,P=_?bo(e.length,String):[],D=P.length;for(var z in e)(r||ri.call(e,z))&&!(_&&(z=="length"||h&&(z=="offset"||z=="parent")||y&&(z=="buffer"||z=="byteLength"||z=="byteOffset")||vo(z,D)))&&P.push(z);return P}function Kt(e,r){return function(a){return e(r(a))}}var oi=Kt(Object.keys,Object),ii=Object.prototype,ai=ii.hasOwnProperty;function ui(e){if(!tt(e))return oi(e);var r=[];for(var a in Object(e))ai.call(e,a)&&a!="constructor"&&r.push(a);return r}function ot(e){return zt(e)?Jt(e):ui(e)}function si(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var ci=Object.prototype,fi=ci.hasOwnProperty;function di(e){if(!Te(e))return si(e);var r=tt(e),a=[];for(var s in e)s=="constructor"&&(r||!fi.call(e,s))||a.push(s);return a}function it(e){return zt(e)?Jt(e,!0):di(e)}var Oe=ue(Object,"create");function li(){this.__data__=Oe?Oe(null):{},this.size=0}function hi(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var pi="__lodash_hash_undefined__",gi=Object.prototype,vi=gi.hasOwnProperty;function wi(e){var r=this.__data__;if(Oe){var a=r[e];return a===pi?void 0:a}return vi.call(r,e)?r[e]:void 0}var yi=Object.prototype,mi=yi.hasOwnProperty;function _i(e){var r=this.__data__;return Oe?r[e]!==void 0:mi.call(r,e)}var bi="__lodash_hash_undefined__";function Ei(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Oe&&r===void 0?bi:r,this}function se(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}se.prototype.clear=li,se.prototype.delete=hi,se.prototype.get=wi,se.prototype.has=_i,se.prototype.set=Ei;function Ai(){this.__data__=[],this.size=0}function Fe(e,r){for(var a=e.length;a--;)if(Nt(e[a][0],r))return a;return-1}var Si=Array.prototype,Ti=Si.splice;function Pi(e){var r=this.__data__,a=Fe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Ti.call(r,a,1),--this.size,!0}function Oi(e){var r=this.__data__,a=Fe(r,e);return a<0?void 0:r[a][1]}function Ii(e){return Fe(this.__data__,e)>-1}function xi(e,r){var a=this.__data__,s=Fe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function te(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}te.prototype.clear=Ai,te.prototype.delete=Pi,te.prototype.get=Oi,te.prototype.has=Ii,te.prototype.set=xi;var Ie=ue(K,"Map");function Ci(){this.size=0,this.__data__={hash:new se,map:new(Ie||te),string:new se}}function ji(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function qe(e,r){var a=e.__data__;return ji(r)?a[typeof r=="string"?"string":"hash"]:a.map}function Di(e){var r=qe(this,e).delete(e);return this.size-=r?1:0,r}function Ri(e){return qe(this,e).get(e)}function Wi(e){return qe(this,e).has(e)}function Mi(e,r){var a=qe(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function me(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}me.prototype.clear=Ci,me.prototype.delete=Di,me.prototype.get=Ri,me.prototype.has=Wi,me.prototype.set=Mi;function Ge(e){return e==null?"":jt(e)}function Qt(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var $i=Kt(Object.getPrototypeOf,Object);const Xt=$i;function Ni(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function Li(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Ni(e,r,a)}var Ui="\\ud800-\\udfff",zi="\\u0300-\\u036f",Fi="\\ufe20-\\ufe2f",qi="\\u20d0-\\u20ff",Gi=zi+Fi+qi,Hi="\\ufe0e\\ufe0f",Vi="\\u200d",Bi=RegExp("["+Vi+Ui+Gi+Hi+"]");function kt(e){return Bi.test(e)}function Yi(e){return e.split("")}var en="\\ud800-\\udfff",Zi="\\u0300-\\u036f",Ji="\\ufe20-\\ufe2f",Ki="\\u20d0-\\u20ff",Qi=Zi+Ji+Ki,Xi="\\ufe0e\\ufe0f",ki="["+en+"]",at="["+Qi+"]",ut="\\ud83c[\\udffb-\\udfff]",ea="(?:"+at+"|"+ut+")",tn="[^"+en+"]",nn="(?:\\ud83c[\\udde6-\\uddff]){2}",rn="[\\ud800-\\udbff][\\udc00-\\udfff]",ta="\\u200d",on=ea+"?",an="["+Xi+"]?",na="(?:"+ta+"(?:"+[tn,nn,rn].join("|")+")"+an+on+")*",ra=an+on+na,oa="(?:"+[tn+at+"?",at,nn,rn,ki].join("|")+")",ia=RegExp(ut+"(?="+ut+")|"+oa+ra,"g");function aa(e){return e.match(ia)||[]}function ua(e){return kt(e)?aa(e):Yi(e)}function sa(e){return function(r){r=Ge(r);var a=kt(r)?ua(r):void 0,s=a?a[0]:r.charAt(0),h=a?Li(a,1).join(""):r.slice(1);return s[e]()+h}}var ca=sa("toUpperCase");function fa(e){return ca(Ge(e).toLowerCase())}function da(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function la(e){return function(r){return e?.[r]}}var ha={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},pa=la(ha);const ga=pa;var va=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wa="\\u0300-\\u036f",ya="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",_a=wa+ya+ma,ba="["+_a+"]",Ea=RegExp(ba,"g");function Aa(e){return e=Ge(e),e&&e.replace(va,ga).replace(Ea,"")}var Sa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ta(e){return e.match(Sa)||[]}var Pa=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Oa(e){return Pa.test(e)}var un="\\ud800-\\udfff",Ia="\\u0300-\\u036f",xa="\\ufe20-\\ufe2f",Ca="\\u20d0-\\u20ff",ja=Ia+xa+Ca,sn="\\u2700-\\u27bf",cn="a-z\\xdf-\\xf6\\xf8-\\xff",Da="\\xac\\xb1\\xd7\\xf7",Ra="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wa="\\u2000-\\u206f",Ma=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fn="A-Z\\xc0-\\xd6\\xd8-\\xde",$a="\\ufe0e\\ufe0f",dn=Da+Ra+Wa+Ma,ln="['’]",hn="["+dn+"]",Na="["+ja+"]",pn="\\d+",La="["+sn+"]",gn="["+cn+"]",vn="[^"+un+dn+pn+sn+cn+fn+"]",Ua="\\ud83c[\\udffb-\\udfff]",za="(?:"+Na+"|"+Ua+")",Fa="[^"+un+"]",wn="(?:\\ud83c[\\udde6-\\uddff]){2}",yn="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="["+fn+"]",qa="\\u200d",mn="(?:"+gn+"|"+vn+")",Ga="(?:"+_e+"|"+vn+")",_n="(?:"+ln+"(?:d|ll|m|re|s|t|ve))?",bn="(?:"+ln+"(?:D|LL|M|RE|S|T|VE))?",En=za+"?",An="["+$a+"]?",Ha="(?:"+qa+"(?:"+[Fa,wn,yn].join("|")+")"+An+En+")*",Va="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ba="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ya=An+En+Ha,Za="(?:"+[La,wn,yn].join("|")+")"+Ya,Ja=RegExp([_e+"?"+gn+"+"+_n+"(?="+[hn,_e,"$"].join("|")+")",Ga+"+"+bn+"(?="+[hn,_e+mn,"$"].join("|")+")",_e+"?"+mn+"+"+_n,_e+"+"+bn,Ba,Va,pn,Za].join("|"),"g");function Ka(e){return e.match(Ja)||[]}function Qa(e,r,a){return e=Ge(e),r=a?void 0:r,r===void 0?Oa(e)?Ka(e):Ta(e):e.match(r)||[]}var Xa="['’]",ka=RegExp(Xa,"g");function Sn(e){return function(r){return da(Qa(Aa(r).replace(ka,"")),e,"")}}var eu=Sn(function(e,r,a){return r=r.toLowerCase(),e+(a?fa(r):r)});const tu=eu;function nu(){this.__data__=new te,this.size=0}function ru(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function ou(e){return this.__data__.get(e)}function iu(e){return this.__data__.has(e)}var au=200;function uu(e,r){var a=this.__data__;if(a instanceof te){var s=a.__data__;if(!Ie||s.length<au-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new me(s)}return a.set(e,r),this.size=a.size,this}function be(e){var r=this.__data__=new te(e);this.size=r.size}be.prototype.clear=nu,be.prototype.delete=ru,be.prototype.get=ou,be.prototype.has=iu,be.prototype.set=uu;function su(e,r){return e&&ze(r,ot(r),e)}function cu(e,r){return e&&ze(r,it(r),e)}var Tn=typeof b=="object"&&b&&!b.nodeType&&b,Pn=Tn&&typeof module=="object"&&module&&!module.nodeType&&module,fu=Pn&&Pn.exports===Tn,On=fu?K.Buffer:void 0,In=On?On.allocUnsafe:void 0;function du(e,r){if(r)return e.slice();var a=e.length,s=In?In(a):new e.constructor(a);return e.copy(s),s}function lu(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var _=e[a];r(_,a,e)&&(y[h++]=_)}return y}function xn(){return[]}var hu=Object.prototype,pu=hu.propertyIsEnumerable,Cn=Object.getOwnPropertySymbols,st=Cn?function(e){return e==null?[]:(e=Object(e),lu(Cn(e),function(r){return pu.call(e,r)}))}:xn;function gu(e,r){return ze(e,st(e),r)}var vu=Object.getOwnPropertySymbols,jn=vu?function(e){for(var r=[];e;)Qt(r,st(e)),e=Xt(e);return r}:xn;function wu(e,r){return ze(e,jn(e),r)}function Dn(e,r,a){var s=r(e);return Ue(e)?s:Qt(s,a(e))}function yu(e){return Dn(e,ot,st)}function mu(e){return Dn(e,it,jn)}var ct=ue(K,"DataView"),ft=ue(K,"Promise"),dt=ue(K,"Set"),Rn="[object Map]",_u="[object Object]",Wn="[object Promise]",Mn="[object Set]",$n="[object WeakMap]",Nn="[object DataView]",bu=ae(ct),Eu=ae(Ie),Au=ae(ft),Su=ae(dt),Tu=ae(et),ce=ve;(ct&&ce(new ct(new ArrayBuffer(1)))!=Nn||Ie&&ce(new Ie)!=Rn||ft&&ce(ft.resolve())!=Wn||dt&&ce(new dt)!=Mn||et&&ce(new et)!=$n)&&(ce=function(e){var r=ve(e),a=r==_u?e.constructor:void 0,s=a?ae(a):"";if(s)switch(s){case bu:return Nn;case Eu:return Rn;case Au:return Wn;case Su:return Mn;case Tu:return $n}return r});const lt=ce;var Pu=Object.prototype,Ou=Pu.hasOwnProperty;function Iu(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&Ou.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Ln=K.Uint8Array;function ht(e){var r=new e.constructor(e.byteLength);return new Ln(r).set(new Ln(e)),r}function xu(e,r){var a=r?ht(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var Cu=/\w*$/;function ju(e){var r=new e.constructor(e.source,Cu.exec(e));return r.lastIndex=e.lastIndex,r}var Un=re?re.prototype:void 0,zn=Un?Un.valueOf:void 0;function Du(e){return zn?Object(zn.call(e)):{}}function Ru(e,r){var a=r?ht(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Wu="[object Boolean]",Mu="[object Date]",$u="[object Map]",Nu="[object Number]",Lu="[object RegExp]",Uu="[object Set]",zu="[object String]",Fu="[object Symbol]",qu="[object ArrayBuffer]",Gu="[object DataView]",Hu="[object Float32Array]",Vu="[object Float64Array]",Bu="[object Int8Array]",Yu="[object Int16Array]",Zu="[object Int32Array]",Ju="[object Uint8Array]",Ku="[object Uint8ClampedArray]",Qu="[object Uint16Array]",Xu="[object Uint32Array]";function ku(e,r,a){var s=e.constructor;switch(r){case qu:return ht(e);case Wu:case Mu:return new s(+e);case Gu:return xu(e,a);case Hu:case Vu:case Bu:case Yu:case Zu:case Ju:case Ku:case Qu:case Xu:return Ru(e,a);case $u:return new s;case Nu:case zu:return new s(e);case Lu:return ju(e);case Uu:return new s;case Fu:return Du(e)}}function es(e){return typeof e.constructor=="function"&&!tt(e)?fo(Xt(e)):{}}var ts="[object Map]";function ns(e){return we(e)&&lt(e)==ts}var Fn=ye&&ye.isMap,rs=Fn?nt(Fn):ns,os="[object Set]";function is(e){return we(e)&&lt(e)==os}var qn=ye&&ye.isSet,as=qn?nt(qn):is,us=1,ss=2,cs=4,Gn="[object Arguments]",fs="[object Array]",ds="[object Boolean]",ls="[object Date]",hs="[object Error]",Hn="[object Function]",ps="[object GeneratorFunction]",gs="[object Map]",vs="[object Number]",Vn="[object Object]",ws="[object RegExp]",ys="[object Set]",ms="[object String]",_s="[object Symbol]",bs="[object WeakMap]",Es="[object ArrayBuffer]",As="[object DataView]",Ss="[object Float32Array]",Ts="[object Float64Array]",Ps="[object Int8Array]",Os="[object Int16Array]",Is="[object Int32Array]",xs="[object Uint8Array]",Cs="[object Uint8ClampedArray]",js="[object Uint16Array]",Ds="[object Uint32Array]",I={};I[Gn]=I[fs]=I[Es]=I[As]=I[ds]=I[ls]=I[Ss]=I[Ts]=I[Ps]=I[Os]=I[Is]=I[gs]=I[vs]=I[Vn]=I[ws]=I[ys]=I[ms]=I[_s]=I[xs]=I[Cs]=I[js]=I[Ds]=!0,I[hs]=I[Hn]=I[bs]=!1;function He(e,r,a,s,h,y){var _,P=r&us,D=r&ss,z=r&cs;if(a&&(_=h?a(e,s,h,y):a(e)),_!==void 0)return _;if(!Te(e))return e;var Q=Ue(e);if(Q){if(_=Iu(e),!P)return lo(e,_)}else{var ne=lt(e),de=ne==Hn||ne==ps;if(Bt(e))return du(e,P);if(ne==Vn||ne==Gn||de&&!h){if(_=D||de?{}:es(e),!P)return D?wu(e,cu(_,e)):gu(e,su(_,e))}else{if(!I[ne])return h?e:{};_=ku(e,ne,P)}}y||(y=new be);var le=y.get(e);if(le)return le;y.set(e,_),as(e)?e.forEach(function(H){_.add(He(H,r,a,H,e,y))}):rs(e)&&e.forEach(function(H,k){_.set(k,He(H,r,a,k,e,y))});var F=z?D?mu:yu:D?it:ot,X=Q?void 0:F(e);return ho(X||e,function(H,k){X&&(k=H,H=e[k]),Lt(_,k,He(H,r,a,k,e,y))}),_}var Rs=1,Ws=4;function Ms(e){return He(e,Rs|Ws)}var Ve=Sn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function $s(e={}){return this.API.request("open",e)}function Ns(){return this.API.request("get_env")}function Ls(e){return this.API.request("update_my_user",e)}function Us(){return this.API.request("get_languages")}function zs(e){return b.highLevelApi.API.request("get_events",e)}function Fs(e){return b.highLevelApi.API.request("create_event",e)}function qs(e){return b.highLevelApi.API.request("update_event",e)}function Gs(e){return b.highLevelApi.API.request("delete_event",e)}function Hs(e){return this.API.request("get_canvases",e)}function Vs(e){return this.API.request("create_canvas",e)}function Bs(e){return this.API.request("delete_canvas",e)}function Ys(e){return this.API.request("update_canvas",e)}function Zs(e){return this.API.request("get_canvas",e)}function Js(e){return this.API.request("share_canvas",e)}function Ks(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function Qs(e){return this.API.request("download_file",e)}function Xs(e){return this.API.request("get_app_config",e)}function ks(e){return this.API.request("get_file",e)}function ec(e){return this.API.request("delete_file",e)}function tc(e){return this.API.request("create_file",e)}function nc(){return this.API.request("select_device_file")}function rc(e){return this.API.request("search",e)}function oc(e){return this.API.request("get_users",e)}function ic(e){return this.API.request("refresh_service_token",e)}function ac(e){return this.API.request("fetch_document_info",e)}function uc(e){return this.API.request("render_page_as_image",e)}function sc(e){return this.API.request("toast",e)}function cc(e){return b.highLevelApi.API.request("query",e)}function fc(e={id:"root"}){return this.API.request("get_folder",e)}function dc(e){return this.API.request("create_folder",e)}function lc(e){return this.API.request("update_folder",e)}function hc(e){return this.API.request("delete_folder",e)}function pc(e){return this.API.request("move_folder_items",e)}function gc(e){return this.API.request("get_favorites",e)}function vc(e){return this.API.request("create_favorite",e)}function wc(e){return this.API.request("delete_favorite",e)}function yc(e){return e.type||(e.type="native"),b.highLevelApi.API.request("notify",e)}function mc(e){return b.highLevelApi.API.request("track",e)}function _c(e){return this.API.request("get_instance_metadata_templates",e)}function bc(){return this.API.request("trigger_non_files_sync")}const Ec=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:Vs,createEvent:Fs,createFavorite:vc,createFile:tc,createFolder:dc,deleteCanvas:Bs,deleteEvent:Gs,deleteFavorite:wc,deleteFile:ec,deleteFolder:hc,downloadFile:Qs,fetchDocumentInfo:ac,getAppConfig:Xs,getCanvas:Zs,getCanvases:Hs,getEnv:Ns,getEvents:zs,getFavorites:gc,getFile:ks,getFiles:Ks,getFolder:fc,getInstanceMetadataTemplates:_c,getLanguages:Us,getUsers:oc,moveFolderItems:pc,notify:yc,open:$s,query:cc,refreshServiceToken:ic,renderPageAsImage:uc,search:rc,selectDeviceFile:nc,shareCanvas:Js,toast:sc,track:mc,triggerNonFilesSync:bc,updateCanvas:Ys,updateEvent:qs,updateFolder:lc,updateMyUser:Ls},Symbol.toStringTag,{value:"Module"}));class Bn{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Be;const Ac=new Uint8Array(16);function Sc(){if(!Be&&(Be=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Be))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Be(Ac)}const U=[];for(let e=0;e<256;++e)U.push((e+256).toString(16).slice(1));function Tc(e,r=0){return U[e[r+0]]+U[e[r+1]]+U[e[r+2]]+U[e[r+3]]+"-"+U[e[r+4]]+U[e[r+5]]+"-"+U[e[r+6]]+U[e[r+7]]+"-"+U[e[r+8]]+U[e[r+9]]+"-"+U[e[r+10]]+U[e[r+11]]+U[e[r+12]]+U[e[r+13]]+U[e[r+14]]+U[e[r+15]]}const Yn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pc(e,r,a){if(Yn.randomUUID&&!r&&!e)return Yn.randomUUID();e=e||{};const s=e.random||(e.rng||Sc)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return Tc(s)}class Oc extends Error{}function Ic(e,r){if(!e)throw new Oc(r)}const Zn=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],Jn=["context","overrides","filters","metadata","style","hidden"],xe=(e,r=Zn,a=Jn)=>Array.isArray(e)?e.map(s=>xe(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:tu(h),_=a.includes(h)?e[h]:xe(e[h],r,a);return{...s,[y]:_}},{}):e,pt=(e,r=Zn,a=Jn)=>Array.isArray(e)?e.map(s=>pt(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:Ve(h),_=a.includes(h)?e[h]:pt(e[h],r,a);return{...s,[y]:_}},{}):e;function xc(e,r=[],a=!1){if(a)return!0;if(!e||!e.origin)return!1;const h=(r.length>0?r:[window.location.origin]).includes(e.origin);return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}class Cc extends Bn{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",a=>{xc(a)&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?(Ic(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?xe(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=Pc(),_=D=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,D),D.response.status==="ok")s(this.options.casing==="camel"?xe(D.response.body):D.response.body);else if(D.response.status==="error")h(this.options.casing==="camel"?xe(D.response.body):D.response.body);else throw new Error("unsupported response status")},P=Ms(pt(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:P??{},callback:_},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:P}},"*")})}}function jc(e){const r=new Cc(e),a=new Bn;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...Ec,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}const Dc="UI_MESSAGE",Ye={UI_SELECT_CONTENT:"ui_select_content",UI_OPEN:"ui_open",UI_EMBEDDABLE_READY:"ui_embeddable_ready"},Rc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Wc(e={}){return(await(await Promise.resolve().then(()=>G)).send(window.parent,Ye.UI_SELECT_CONTENT,e)).data}async function Mc(e){await(await Promise.resolve().then(()=>G)).send(window.parent,Ye.UI_OPEN,e)}async function $c(){await(await Promise.resolve().then(()=>G)).send(window.parent,Ye.UI_EMBEDDABLE_READY)}async function Nc(e,r){return(await Promise.resolve().then(()=>G)).on(e,h=>r(h.data)).cancel}const Lc=Object.freeze(Object.defineProperty({__proto__:null,embeddable_ready:$c,on:Nc,open:Mc,ui_select_content:Wc},Symbol.toStringTag,{value:"Module"})),Uc="ADMIN_MESSAGE",zc={ENV_CHANGED:"admin_env_changed"},Fc={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},fe={CREATE_CANVAS:"admin_create_canvas",GET_ENV:"admin_get_env",GET_CANVAS:"admin_get_canvas",GET_CANVASES:"admin_get_canvases",UPDATE_CANVAS:"admin_update_canvas",GET_INSTANCE_METADATA_TEMPLATES:"admin_get_instance_metadata_templates",GET_APP_CONFIG:"admin_get_app_config"};async function qc(){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.GET_ENV)).data}async function Gc(e){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.CREATE_CANVAS,e)).data}async function Hc(e){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.GET_CANVASES,e)).data}async function Vc(e){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.GET_CANVAS,e)).data}async function Bc(e){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.UPDATE_CANVAS,e)).data}async function Yc(e){return(await(await Promise.resolve().then(()=>G)).send(window.parent,fe.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function Zc(e,r){return(await Promise.resolve().then(()=>G)).on(e,h=>r(h.data)).cancel}const Jc=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:Gc,getCanvas:Vc,getCanvases:Hc,getEnv:qc,getInstanceMetadataTemplates:Yc,on:Zc,updateCanvas:Bc},Symbol.toStringTag,{value:"Module"})),Kc="DSR_MESSAGE",Qc={ENV_CHANGED:"dsr_env_changed"},Xc={DSR_REQUEST:"DSR_REQUEST",DSR_RESPONSE:"DSR_RESPONSE"},Kn={GET_ENV:"dsr_get_env"};async function kc(){return(await(await Promise.resolve().then(()=>G)).send(window.parent,Kn.GET_ENV)).data}async function ef(e,r){return(await Promise.resolve().then(()=>G)).on(e,h=>r(h.data)).cancel}const tf=Object.freeze(Object.defineProperty({__proto__:null,getEnv:kc,on:ef},Symbol.toStringTag,{value:"Module"})),nf="PITCHER_EVENT";var Qn=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(Qn||{}),Xn=(e=>(e.OK="ok",e.ERROR="error",e))(Xn||{}),kn=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e))(kn||{}),er=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(er||{}),tr=(e=>(e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(tr||{});b.highLevelApi=void 0;function rf(e){return b.highLevelApi||(b.highLevelApi=jc(e)),b.highLevelApi}const of=Object.entries(Lc).reduce((e,[r,a])=>(e[r]=a,e[Ve(r)]=a,e),{});function af(){return of}const uf=Object.entries(Jc).reduce((e,[r,a])=>(e[r]=a,e[Ve(r)]=a,e),{});function sf(){return uf}const cf=Object.entries(tf).reduce((e,[r,a])=>(e[r]=a,e[Ve(r)]=a,e),{});function ff(){return cf}var df=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nr={exports:{}},rr={exports:{}};(function(e,r){(function(a,s){e.exports=s()})(typeof self<"u"?self:df,function(){return function(a){var s={};function h(y){if(s[y])return s[y].exports;var _=s[y]={i:y,l:!1,exports:{}};return a[y].call(_.exports,_,_.exports,h),_.l=!0,_.exports}return h.m=a,h.c=s,h.d=function(y,_,P){h.o(y,_)||Object.defineProperty(y,_,{enumerable:!0,get:P})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,_){if(1&_&&(y=h(y)),8&_||4&_&&typeof y=="object"&&y&&y.__esModule)return y;var P=Object.create(null);if(h.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:y}),2&_&&typeof y!="string")for(var D in y)h.d(P,D,function(z){return y[z]}.bind(null,D));return P},h.n=function(y){var _=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(_,"a",_),_},h.o=function(y,_){return{}.hasOwnProperty.call(y,_)},h.p="",h(h.s=0)}([function(a,s,h){h.r(s),h.d(s,"Promise",function(){return O}),h.d(s,"TYPES",function(){return Mf}),h.d(s,"ProxyWindow",function(){return Y}),h.d(s,"setup",function(){return Wr}),h.d(s,"destroy",function(){return Wf}),h.d(s,"serializeMessage",function(){return Cf}),h.d(s,"deserializeMessage",function(){return jf}),h.d(s,"createProxyWindow",function(){return Df}),h.d(s,"toProxyWindow",function(){return Rf}),h.d(s,"on",function(){return oe}),h.d(s,"once",function(){return xf}),h.d(s,"send",function(){return ie}),h.d(s,"markWindowKnown",function(){return Er}),h.d(s,"cleanUpWindow",function(){return $f}),h.d(s,"bridge",function(){});function y(t){return{}.toString.call(t)==="[object RegExp]"}var _=`Call was rejected by callee.\r
2
+ `;function P(t){return t===void 0&&(t=window),t.location.protocol}function D(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return P(t)}function z(t){return t===void 0&&(t=window),D(t)==="about:"}function Q(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function ne(t){if(t===void 0&&(t=window),t&&!Q(t))try{return t.opener}catch{}}function de(t){try{return!0}catch{}return!1}function le(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=P(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=Q(t);return i&&de()?le(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function F(t){t===void 0&&(t=window);var o=le(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function X(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(z(o)&&de())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),D(i)==="mock:"}(o)&&de())return!0}catch{}try{if(le(o)===le(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||z(t)&&de()||F(window)===F(t))return!0}catch{}return!1}function H(t){if(!X(t))throw new Error("Expected window to be same domain");return t}function k(t,o){if(!t||!o)return!1;var n=Q(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function ir(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var p=void 0;try{p=n[f]}catch{return o}if(!p)return o;o.push(p)}return o}var pf=[],gf=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==_}if(o&&X(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(pf,t);if(n!==-1){var i=gf[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function ar(t){return t===void 0&&(t=window),ne(t=t||window)||Q(t)||void 0}function Ee(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return Ee(n,o)}))}function Ze(t){try{if(t===window)return!0}catch(o){if(o&&o.message===_)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===_)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function ur(t){if(X(t))return H(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function vf(t){if(function(n){return n===void 0&&(n=window),!!Q(n)}(t)){var o=ur(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function he(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var sr=[],Ce=[],gt=0,je;function cr(){if(!gt&&je){var t=je;je=null,t.resolve()}}function vt(){gt+=1}function De(){gt-=1,cr()}var O=function(){function t(n){var i=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=[],n){var u,c,f=!1,p=!1,l=!1;vt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(p=!0,c=d)})}catch(d){De(),this.reject(d);return}De(),l=!0,f?this.resolve(u):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(he(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(he(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(sr.indexOf(c)===-1){sr.push(c),setTimeout(function(){throw c},1);for(var p=0;p<Ce.length;p++)Ce[p](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,vt();for(var c=function(m,S){return m.then(function(E){S.resolve(E)},function(E){S.reject(E)})},f=0;f<u.length;f++){var p=u[f],l=p.onSuccess,d=p.onError,w=p.promise,g=void 0;if(n)try{g=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{g=d(this.error)}catch(m){w.reject(m);continue}}if(g instanceof t&&(g.resolved||g.rejected)){var v=g;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else he(g)?g instanceof t&&(g.resolved||g.rejected)?g.resolved?w.resolve(g.value):w.reject(g.error):c(g,w):w.resolve(g)}u.length=0,this.dispatching=!1,De()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},o.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},o.lazy=function(){return this.errorHandled=!0,this},t.resolve=function(n){return n instanceof t?n:he(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,g){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){g.reject(v)})},p=0;p<n.length;p++){var l=n[p];if(l instanceof t){if(l.resolved){c[p]=l.value,u-=1;continue}}else if(!he(l)){c[p]=l,u-=1;continue}f(p,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(p){if(n.hasOwnProperty(p)){var l=n[p];he(l)?u.push(l.then(function(d){i[p]=d})):i[p]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return Ce.push(i),{cancel:function(){Ce.splice(Ce.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;vt();try{c=n.apply(i,u||[])}catch(f){return De(),t.reject(f)}return De(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||he(n)},t.flush=function(){return function(n){var i=je=je||new n;return cr(),i}(t)},t}();function Je(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var wt=function(){function t(){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 n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Ze(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Ze(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,d=Je(p,n);d===-1?(p.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Je(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Je(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Je(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function fr(t){return t.name||t.__name__||t.displayName||"anonymous"}function dr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function ee(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"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 Ke;function lr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(Ke=Ke||new wt,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=Ke.get(i);return u||(u=typeof i+":"+ee(),Ke.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function wf(){return{}}var Re=0,hr=0;function We(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,p=Re;Re+=1;var l=function(){for(var d=arguments.length,w=new Array(d),g=0;g<d;g++)w[g]=arguments[g];p<hr&&(c=null,f=null,p=Re,Re+=1);var v;v=i?(f=f||new wt).getOrSet(this,wf):c=c||{};var m;try{m=lr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var E=Date.now(),A=t.apply(this,arguments);return v[m]={time:E,value:A},A};return l.reset=function(){c=null,f=null},dr(l,(o.name||fr(t))+"::memoized")}We.clear=function(){hr=Re};function yf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];var l=lr(f);return o.hasOwnProperty(l)||(o[l]=O.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},dr(n,fr(t)+"::promiseMemoized")}function pe(){}function Me(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
3
+ `+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "+Me(u,o+1)}}function pr(t){return typeof t=="string"?t:t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}We(function(t){if(Object.values)return Object.values(t);var o=[];for(var n in t)t.hasOwnProperty(n)&&o.push(t[n]);return o});function yt(t){return{}.toString.call(t)==="[object RegExp]"}function $e(t,o,n){if(t.hasOwnProperty(o))return t[o];var i=n();return t[o]=i,i}function gr(){var t=document.body;if(!t)throw new Error("Body element not found");return t}function vr(){return!!document.body&&document.readyState==="complete"}function wr(){return!!document.body&&document.readyState==="interactive"}We(function(){return new O(function(t){if(vr()||wr())return t();var o=setInterval(function(){if(vr()||wr())return clearInterval(o),t()},10)})});var Qe=typeof document<"u"?document.currentScript:null,mf=We(function(){if(Qe||(Qe=function(){try{var t=function(){try{throw new Error("_")}catch(f){return f.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(t),n=o&&o[1];if(!n)return;for(var i=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();i<u.length;i++){var c=u[i];if(c.src&&c.src===n)return c}}catch{}}()))return Qe;throw new Error("Can not determine current script")}),_f=ee();We(function(){var t;try{t=mf()}catch{return _f}var o=t.getAttribute("data-uid");if(o&&typeof o=="string"||(o=t.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(t.src){var n=function(i){for(var u="",c=0;c<i.length;c++){var f=i[c].charCodeAt(0)*c;i[c+1]&&(f+=i[c+1].charCodeAt(0)*(c-1)),u+=String.fromCharCode(97+Math.abs(f)%26)}return u}(JSON.stringify({src:t.src,dataset:t.dataset}));o="uid_"+n.slice(n.length-30)}else o=ee();return t.setAttribute("data-uid-auto",o),o});function Ne(t){t===void 0&&(t=window);var o="__post_robot_10_0_46__";return t!==window?t[o]:t[o]=t[o]||{}}var yr=function(){return{}};function N(t,o){return t===void 0&&(t="store"),o===void 0&&(o=yr),$e(Ne(),t,function(){var n=o();return{has:function(i){return n.hasOwnProperty(i)},get:function(i,u){return n.hasOwnProperty(i)?n[i]:u},set:function(i,u){return n[i]=u,u},del:function(i){delete n[i]},getOrSet:function(i,u){return $e(n,i,u)},reset:function(){n=o()},keys:function(){return Object.keys(n)}}})}var bf=function(){};function Xe(){var t=Ne();return t.WINDOW_WILDCARD=t.WINDOW_WILDCARD||new bf,t.WINDOW_WILDCARD}function q(t,o){return t===void 0&&(t="store"),o===void 0&&(o=yr),N("windowStore").getOrSet(t,function(){var n=new wt,i=function(u){return n.getOrSet(u,o)};return{has:function(u){return i(u).hasOwnProperty(t)},get:function(u,c){var f=i(u);return f.hasOwnProperty(t)?f[t]:c},set:function(u,c){return i(u)[t]=c,c},del:function(u){delete i(u)[t]},getOrSet:function(u,c){return $e(i(u),t,c)}}})}function mr(){return N("instance").getOrSet("instanceID",ee)}function _r(t,o){var n=o.domain,i=q("helloPromises"),u=i.get(t);u&&u.resolve({domain:n});var c=O.resolve({domain:n});return i.set(t,c),c}function mt(t,o){return(0,o.send)(t,"postrobot_hello",{instanceID:mr()},{domain:"*",timeout:-1}).then(function(n){var i=n.origin,u=n.data.instanceID;return _r(t,{domain:i}),{win:t,domain:i,instanceID:u}})}function br(t,o){var n=o.send;return q("windowInstanceIDPromises").getOrSet(t,function(){return mt(t,{send:n}).then(function(i){return i.instanceID})})}function Er(t){q("knownWindows").set(t,!0)}function _t(t){return typeof t=="object"&&t!==null&&typeof t.__type__=="string"}function Ar(t){return t===void 0?"undefined":t===null?"null":Array.isArray(t)?"array":typeof t=="function"?"function":typeof t=="object"?t instanceof Error?"error":typeof t.then=="function"?"promise":{}.toString.call(t)==="[object RegExp]"?"regex":{}.toString.call(t)==="[object Date]"?"date":"object":typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":void 0}function ge(t,o){return{__type__:t,__val__:o}}var V,Ef=((V={}).function=function(){},V.error=function(t){return ge("error",{message:t.message,stack:t.stack,code:t.code,data:t.data})},V.promise=function(){},V.regex=function(t){return ge("regex",t.source)},V.date=function(t){return ge("date",t.toJSON())},V.array=function(t){return t},V.object=function(t){return t},V.string=function(t){return t},V.number=function(t){return t},V.boolean=function(t){return t},V.null=function(t){return t},V[void 0]=function(t){return ge("undefined",t)},V),Af={},B,Sf=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(t){var o=t.stack,n=t.code,i=t.data,u=new Error(t.message);return u.code=n,i&&(u.data=i),u.stack=o+`
4
4
 
5
- `+u.stack,u},V.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},V.regex=function(t){return new RegExp(t)},V.date=function(t){return new Date(t)},V.array=function(t){return t},V.object=function(t){return t},V.string=function(t){return t},V.number=function(t){return t},V.boolean=function(t){return t},V.null=function(t){return t},V[void 0]=function(){},V),pf={};new O(function(t){if(window.document&&window.document.body)return t(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),t(window.document.body)},10)});function _t(){for(var t=N("idToProxyWindow"),o=0,n=t.keys();o<n.length;o++){var i=n[o];t.get(i).shouldClean()&&t.del(i)}}function Er(t,o){var n=o.send,i=o.id,u=i===void 0?ee():i,c=t.then(function(l){if(X(l))return G(l).name}),f=t.then(function(l){if(Z(l))throw new Error("Window is closed, can not determine type");return ne(l)?"popup":"iframe"});c.catch(pe),f.catch(pe);var p=function(){return t.then(function(l){if(!Z(l))return X(l)?G(l).name:c})};return{id:u,getType:function(){return f},getInstanceID:uf(function(){return t.then(function(l){return br(l,{send:n})})}),close:function(){return t.then(of)},getName:p,focus:function(){return t.then(function(l){l.focus()})},isClosed:function(){return t.then(function(l){return Z(l)})},setLocation:function(l,d){return d===void 0&&(d={}),t.then(function(w){var g=window.location.protocol+"//"+window.location.host,v=d.method,m=v===void 0?"get":v,S=d.body;if(l.indexOf("/")===0)l=""+g+l;else if(!l.match(/^https?:\/\//)&&l.indexOf(g)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(l));if(m==="post")return p().then(function(A){if(!A)throw new Error("Can not post to window without target name");(function(E){var I=E.url,M=E.target,$=E.body,C=E.method,L=C===void 0?"post":C,T=document.createElement("form");if(T.setAttribute("target",M),T.setAttribute("method",L),T.setAttribute("action",I),T.style.display="none",$)for(var D=0,Y=Object.keys($);D<Y.length;D++){var R,Le=Y[D],Tt=document.createElement("input");Tt.setAttribute("name",Le),Tt.setAttribute("value",(R=$[Le])==null?void 0:R.toString()),T.appendChild(Tt)}pr().appendChild(T),T.submit(),pr().removeChild(T)})({url:l,target:A,method:m,body:S})});if(m!=="get")throw new Error("Unsupported method: "+m);if(X(w))try{if(w.location&&typeof w.location.replace=="function"){w.location.replace(l);return}}catch{}w.location=l})},setName:function(l){return t.then(function(d){var w=X(d),g=ar(d);if(!w)throw new Error("Can not set name for cross-domain window: "+l);G(d).name=l,g&&g.setAttribute("name",l),c=O.resolve(l)})}}}var B=function(){function t(n){var i=n.send,u=n.win,c=n.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 O,this.serializedWindow=c||Er(this.actualWindowPromise,{send:i}),N("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:i})}var o=t.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(n){return n==="popup"})},o.setLocation=function(n,i){var u=this;return this.serializedWindow.setLocation(n,i).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(n){var i=this;return this.serializedWindow.setName(n).then(function(){return i})},o.close=function(){var n=this;return this.serializedWindow.close().then(function(){return n})},o.focus=function(){var n=this,i=this.isPopup(),u=this.getName(),c=O.hash({isPopup:i,name:u}).then(function(p){var l=p.name;p.isPopup&&l&&window.open("",l,"noopener")}),f=this.serializedWindow.focus();return O.all([c,f]).then(function(){return n})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(n,i){var u=i.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Er(this.actualWindowPromise,{send:u,id:this.getID()}),q("winToProxyWindow").set(n,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(n,i){var u=this,c=i.send;return O.try(function(){return u.actualWindow?n===u.actualWindow:O.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:br(n,{send:c})}).then(function(f){var p=f.proxyInstanceID===f.knownWindowInstanceID;return p&&u.setWindow(n,{send:c}),p})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Z(this.actualWindow))},o.serialize=function(){return this.serializedWindow},t.unwrap=function(n){return t.isProxyWindow(n)?n.unwrap():n},t.serialize=function(n,i){var u=i.send;return _t(),t.toProxyWindow(n,{send:u}).serialize()},t.deserialize=function(n,i){var u=i.send;return _t(),N("idToProxyWindow").get(n.id)||new t({serializedWindow:n,send:u})},t.isProxyWindow=function(n){return!!(n&&!Be(n)&&n.isProxyWindow)},t.toProxyWindow=function(n,i){var u=i.send;if(_t(),t.isProxyWindow(n))return n;var c=n;return q("winToProxyWindow").get(c)||new t({win:c,send:u})},t}();function At(t,o,n,i,u){var c=q("methodStore"),f=N("proxyWindowMethods");B.isProxyWindow(i)?f.set(t,{val:o,name:n,domain:u,source:i}):(f.del(t),c.getOrSet(i,function(){return{}})[t]={domain:u,name:n,val:o,source:i})}function Sr(t,o){var n=q("methodStore"),i=N("proxyWindowMethods");return n.getOrSet(t,function(){return{}})[o]||i.get(o)}function Tr(t,o,n,i,u){f=(c={on:u.on,send:u.send}).on,p=c.send,N("builtinListeners").getOrSet("functionCalls",function(){return f("postrobot_method",{domain:"*"},function(w){var g=w.source,v=w.origin,m=w.data,S=m.id,A=m.name,E=Sr(g,S);if(!E)throw new Error("Could not find method '"+A+"' with id: "+m.id+" in "+F(window));var I=E.source,M=E.domain,$=E.val;return O.try(function(){if(!Ae(M,v))throw new Error("Method '"+m.name+"' domain "+JSON.stringify(yt(E.domain)?E.domain.source:E.domain)+" does not match origin "+v+" in "+F(window));if(B.isProxyWindow(I))return I.matchWindow(g,{send:p}).then(function(C){if(!C)throw new Error("Method call '"+m.name+"' failed - proxy window does not match source in "+F(window))})}).then(function(){return $.apply({source:g,origin:v},m.args)},function(C){return O.try(function(){if($.onError)return $.onError(C)}).then(function(){throw C.stack&&(C.stack="Remote call to "+A+"("+function(L){return L===void 0&&(L=[]),(T=L,[].slice.call(T)).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 T}(m.args)+`) failed
5
+ `+u.stack,u},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(t){return new RegExp(t)},B.date=function(t){return new Date(t)},B.array=function(t){return t},B.object=function(t){return t},B.string=function(t){return t},B.number=function(t){return t},B.boolean=function(t){return t},B.null=function(t){return t},B[void 0]=function(){},B),Tf={};new O(function(t){if(window.document&&window.document.body)return t(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),t(window.document.body)},10)});function bt(){for(var t=N("idToProxyWindow"),o=0,n=t.keys();o<n.length;o++){var i=n[o];t.get(i).shouldClean()&&t.del(i)}}function Sr(t,o){var n=o.send,i=o.id,u=i===void 0?ee():i,c=t.then(function(l){if(X(l))return H(l).name}),f=t.then(function(l){if(Z(l))throw new Error("Window is closed, can not determine type");return ne(l)?"popup":"iframe"});c.catch(pe),f.catch(pe);var p=function(){return t.then(function(l){if(!Z(l))return X(l)?H(l).name:c})};return{id:u,getType:function(){return f},getInstanceID:yf(function(){return t.then(function(l){return br(l,{send:n})})}),close:function(){return t.then(vf)},getName:p,focus:function(){return t.then(function(l){l.focus()})},isClosed:function(){return t.then(function(l){return Z(l)})},setLocation:function(l,d){return d===void 0&&(d={}),t.then(function(w){var g=window.location.protocol+"//"+window.location.host,v=d.method,m=v===void 0?"get":v,S=d.body;if(l.indexOf("/")===0)l=""+g+l;else if(!l.match(/^https?:\/\//)&&l.indexOf(g)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(l));if(m==="post")return p().then(function(E){if(!E)throw new Error("Can not post to window without target name");(function(A){var x=A.url,$=A.target,R=A.body,C=A.method,L=C===void 0?"post":C,T=document.createElement("form");if(T.setAttribute("target",$),T.setAttribute("method",L),T.setAttribute("action",x),T.style.display="none",R)for(var W=0,J=Object.keys(R);W<J.length;W++){var M,Le=J[W],Tt=document.createElement("input");Tt.setAttribute("name",Le),Tt.setAttribute("value",(M=R[Le])==null?void 0:M.toString()),T.appendChild(Tt)}gr().appendChild(T),T.submit(),gr().removeChild(T)})({url:l,target:E,method:m,body:S})});if(m!=="get")throw new Error("Unsupported method: "+m);if(X(w))try{if(w.location&&typeof w.location.replace=="function"){w.location.replace(l);return}}catch{}w.location=l})},setName:function(l){return t.then(function(d){var w=X(d),g=ur(d);if(!w)throw new Error("Can not set name for cross-domain window: "+l);H(d).name=l,g&&g.setAttribute("name",l),c=O.resolve(l)})}}}var Y=function(){function t(n){var i=n.send,u=n.win,c=n.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 O,this.serializedWindow=c||Sr(this.actualWindowPromise,{send:i}),N("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:i})}var o=t.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(n){return n==="popup"})},o.setLocation=function(n,i){var u=this;return this.serializedWindow.setLocation(n,i).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(n){var i=this;return this.serializedWindow.setName(n).then(function(){return i})},o.close=function(){var n=this;return this.serializedWindow.close().then(function(){return n})},o.focus=function(){var n=this,i=this.isPopup(),u=this.getName(),c=O.hash({isPopup:i,name:u}).then(function(p){var l=p.name;p.isPopup&&l&&window.open("",l,"noopener")}),f=this.serializedWindow.focus();return O.all([c,f]).then(function(){return n})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(n,i){var u=i.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Sr(this.actualWindowPromise,{send:u,id:this.getID()}),q("winToProxyWindow").set(n,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(n,i){var u=this,c=i.send;return O.try(function(){return u.actualWindow?n===u.actualWindow:O.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:br(n,{send:c})}).then(function(f){var p=f.proxyInstanceID===f.knownWindowInstanceID;return p&&u.setWindow(n,{send:c}),p})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Z(this.actualWindow))},o.serialize=function(){return this.serializedWindow},t.unwrap=function(n){return t.isProxyWindow(n)?n.unwrap():n},t.serialize=function(n,i){var u=i.send;return bt(),t.toProxyWindow(n,{send:u}).serialize()},t.deserialize=function(n,i){var u=i.send;return bt(),N("idToProxyWindow").get(n.id)||new t({serializedWindow:n,send:u})},t.isProxyWindow=function(n){return!!(n&&!Ze(n)&&n.isProxyWindow)},t.toProxyWindow=function(n,i){var u=i.send;if(bt(),t.isProxyWindow(n))return n;var c=n;return q("winToProxyWindow").get(c)||new t({win:c,send:u})},t}();function Et(t,o,n,i,u){var c=q("methodStore"),f=N("proxyWindowMethods");Y.isProxyWindow(i)?f.set(t,{val:o,name:n,domain:u,source:i}):(f.del(t),c.getOrSet(i,function(){return{}})[t]={domain:u,name:n,val:o,source:i})}function Tr(t,o){var n=q("methodStore"),i=N("proxyWindowMethods");return n.getOrSet(t,function(){return{}})[o]||i.get(o)}function Pr(t,o,n,i,u){f=(c={on:u.on,send:u.send}).on,p=c.send,N("builtinListeners").getOrSet("functionCalls",function(){return f("postrobot_method",{domain:"*"},function(w){var g=w.source,v=w.origin,m=w.data,S=m.id,E=m.name,A=Tr(g,S);if(!A)throw new Error("Could not find method '"+E+"' with id: "+m.id+" in "+F(window));var x=A.source,$=A.domain,R=A.val;return O.try(function(){if(!Ee($,v))throw new Error("Method '"+m.name+"' domain "+JSON.stringify(yt(A.domain)?A.domain.source:A.domain)+" does not match origin "+v+" in "+F(window));if(Y.isProxyWindow(x))return x.matchWindow(g,{send:p}).then(function(C){if(!C)throw new Error("Method call '"+m.name+"' failed - proxy window does not match source in "+F(window))})}).then(function(){return R.apply({source:g,origin:v},m.args)},function(C){return O.try(function(){if(R.onError)return R.onError(C)}).then(function(){throw C.stack&&(C.stack="Remote call to "+E+"("+function(L){return L===void 0&&(L=[]),(T=L,[].slice.call(T)).map(function(W){return typeof W=="string"?"'"+W+"'":W===void 0?"undefined":W===null?"null":typeof W=="boolean"?W.toString():Array.isArray(W)?"[ ... ]":typeof W=="object"?"{ ... }":typeof W=="function"?"() => { ... }":"<"+typeof W+">"}).join(", ");var T}(m.args)+`) failed
6
6
 
7
- `+C.stack),C})}).then(function(C){return{result:C,id:S,name:A}})})});var c,f,p,l=n.__id__||ee();t=B.unwrap(t);var d=n.__name__||n.name||i;return typeof d=="string"&&typeof d.indexOf=="function"&&d.indexOf("anonymous::")===0&&(d=d.replace("anonymous::",i+"::")),B.isProxyWindow(t)?(At(l,n,d,t,o),t.awaitWindow().then(function(w){At(l,n,d,w,o)})):At(l,n,d,t,o),ge("cross_domain_function",{id:l,name:d})}function Pr(t,o,n,i){var u,c=i.on,f=i.send;return function(p,l){l===void 0&&(l=lf);var d=JSON.stringify(p,function(w){var g=this[w];if(bt(this))return g;var v=Ar(g);if(!v)return g;var m=l[v]||df[v];return m?m(g,w):g});return d===void 0?"undefined":d}(n,((u={}).promise=function(p,l){return function(d,w,g,v,m){return ge("cross_domain_zalgo_promise",{then:Tr(d,w,function(S,A){return g.then(S,A)},v,{on:m.on,send:m.send})})}(t,o,p,l,{on:c,send:f})},u.function=function(p,l){return Tr(t,o,p,l,{on:c,send:f})},u.object=function(p){return Be(p)||B.isProxyWindow(p)?ge("cross_domain_window",B.serialize(p,{send:f})):p},u))}function Or(t,o,n,i){var u,c=i.send;return function(f,p){if(p===void 0&&(p=pf),f!=="undefined")return JSON.parse(f,function(l,d){if(bt(this))return d;var w,g;if(bt(d)?(w=d.__type__,g=d.__val__):(w=Ar(d),g=d),!w)return g;var v=p[w]||hf[w];return v?v(g,l):g})}(n,((u={}).cross_domain_zalgo_promise=function(f){return function(p,l,d){return new O(d.then)}(0,0,f)},u.cross_domain_function=function(f){return function(p,l,d,w){var g=d.id,v=d.name,m=w.send,S=function(E){E===void 0&&(E={});function I(){var M=arguments;return B.toProxyWindow(p,{send:m}).awaitWindow().then(function($){var C=Sr($,g);if(C&&C.val!==I)return C.val.apply({source:window,origin:F()},M);var L=[].slice.call(M);return E.fireAndForget?m($,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!0}):m($,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!1}).then(function(T){return T.data.result})}).catch(function($){throw $})}return I.__name__=v,I.__origin__=l,I.__source__=p,I.__id__=g,I.origin=l,I},A=S();return A.fireAndForget=S({fireAndForget:!0}),A}(t,o,f,{send:c})},u.cross_domain_window=function(f){return B.deserialize(f,{send:c})},u))}var Et={};Et.postrobot_post_message=function(t,o,n){n.indexOf("file:")===0&&(n="*"),t.postMessage(o,n)};function St(t,o,n,i){var u=i.on,c=i.send;return O.try(function(){var f=q().getOrSet(t,function(){return{}});return f.buffer=f.buffer||[],f.buffer.push(n),f.flush=f.flush||O.flush().then(function(){if(Z(t))throw new Error("Window is closed");var p=Pr(t,o,((l={}).__post_robot_10_0_46__=f.buffer||[],l),{on:u,send:c}),l;delete f.buffer;for(var d=Object.keys(Et),w=[],g=0;g<d.length;g++){var v=d[g];try{Et[v](t,p,o)}catch(m){w.push(m)}}if(w.length===d.length)throw new Error(`All post-robot messaging strategies failed:
7
+ `+C.stack),C})}).then(function(C){return{result:C,id:S,name:E}})})});var c,f,p,l=n.__id__||ee();t=Y.unwrap(t);var d=n.__name__||n.name||i;return typeof d=="string"&&typeof d.indexOf=="function"&&d.indexOf("anonymous::")===0&&(d=d.replace("anonymous::",i+"::")),Y.isProxyWindow(t)?(Et(l,n,d,t,o),t.awaitWindow().then(function(w){Et(l,n,d,w,o)})):Et(l,n,d,t,o),ge("cross_domain_function",{id:l,name:d})}function Or(t,o,n,i){var u,c=i.on,f=i.send;return function(p,l){l===void 0&&(l=Af);var d=JSON.stringify(p,function(w){var g=this[w];if(_t(this))return g;var v=Ar(g);if(!v)return g;var m=l[v]||Ef[v];return m?m(g,w):g});return d===void 0?"undefined":d}(n,((u={}).promise=function(p,l){return function(d,w,g,v,m){return ge("cross_domain_zalgo_promise",{then:Pr(d,w,function(S,E){return g.then(S,E)},v,{on:m.on,send:m.send})})}(t,o,p,l,{on:c,send:f})},u.function=function(p,l){return Pr(t,o,p,l,{on:c,send:f})},u.object=function(p){return Ze(p)||Y.isProxyWindow(p)?ge("cross_domain_window",Y.serialize(p,{send:f})):p},u))}function Ir(t,o,n,i){var u,c=i.send;return function(f,p){if(p===void 0&&(p=Tf),f!=="undefined")return JSON.parse(f,function(l,d){if(_t(this))return d;var w,g;if(_t(d)?(w=d.__type__,g=d.__val__):(w=Ar(d),g=d),!w)return g;var v=p[w]||Sf[w];return v?v(g,l):g})}(n,((u={}).cross_domain_zalgo_promise=function(f){return function(p,l,d){return new O(d.then)}(0,0,f)},u.cross_domain_function=function(f){return function(p,l,d,w){var g=d.id,v=d.name,m=w.send,S=function(A){A===void 0&&(A={});function x(){var $=arguments;return Y.toProxyWindow(p,{send:m}).awaitWindow().then(function(R){var C=Tr(R,g);if(C&&C.val!==x)return C.val.apply({source:window,origin:F()},$);var L=[].slice.call($);return A.fireAndForget?m(R,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!0}):m(R,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!1}).then(function(T){return T.data.result})}).catch(function(R){throw R})}return x.__name__=v,x.__origin__=l,x.__source__=p,x.__id__=g,x.origin=l,x},E=S();return E.fireAndForget=S({fireAndForget:!0}),E}(t,o,f,{send:c})},u.cross_domain_window=function(f){return Y.deserialize(f,{send:c})},u))}var At={};At.postrobot_post_message=function(t,o,n){n.indexOf("file:")===0&&(n="*"),t.postMessage(o,n)};function St(t,o,n,i){var u=i.on,c=i.send;return O.try(function(){var f=q().getOrSet(t,function(){return{}});return f.buffer=f.buffer||[],f.buffer.push(n),f.flush=f.flush||O.flush().then(function(){if(Z(t))throw new Error("Window is closed");var p=Or(t,o,((l={}).__post_robot_10_0_46__=f.buffer||[],l),{on:u,send:c}),l;delete f.buffer;for(var d=Object.keys(At),w=[],g=0;g<d.length;g++){var v=d[g];try{At[v](t,p,o)}catch(m){w.push(m)}}if(w.length===d.length)throw new Error(`All post-robot messaging strategies failed:
8
8
 
9
- `+w.map(function(m,S){return S+". "+Re(m)}).join(`
9
+ `+w.map(function(m,S){return S+". "+Me(m)}).join(`
10
10
 
11
- `))}),f.flush.then(function(){delete f.flush})}).then(pe)}function xr(t){return N("responseListeners").get(t)}function Ir(t){N("responseListeners").del(t)}function Cr(t){return N("erroredResponseListeners").has(t)}function jr(t){var o=t.name,n=t.win,i=t.domain,u=q("requestListeners");if(n==="*"&&(n=null),i==="*"&&(i=null),!o)throw new Error("Name required to get request listener");for(var c=0,f=[n,Ke()];c<f.length;c++){var p=f[c];if(p){var l=u.get(p);if(l){var d=l[o];if(d){if(i&&typeof i=="string"){if(d[i])return d[i];if(d.__domain_regex__)for(var w=0,g=d.__domain_regex__;w<g.length;w++){var v=g[w],m=v.listener;if(Ae(v.regex,i))return m}}if(d["*"])return d["*"]}}}}}function gf(t,o,n,i){var u=i.on,c=i.send,f=jr({name:n.name,win:t,domain:o}),p=n.name==="postrobot_method"&&n.data&&typeof n.data.name=="string"?n.data.name+"()":n.name;function l(d,w,g){return O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return St(t,o,{id:ee(),origin:F(window),type:"postrobot_message_response",hash:n.hash,name:n.name,ack:d,data:w,error:g},{on:u,send:c})}catch(v){throw new Error("Send response message failed for "+p+" in "+F()+`
11
+ `))}),f.flush.then(function(){delete f.flush})}).then(pe)}function xr(t){return N("responseListeners").get(t)}function Cr(t){N("responseListeners").del(t)}function jr(t){return N("erroredResponseListeners").has(t)}function Dr(t){var o=t.name,n=t.win,i=t.domain,u=q("requestListeners");if(n==="*"&&(n=null),i==="*"&&(i=null),!o)throw new Error("Name required to get request listener");for(var c=0,f=[n,Xe()];c<f.length;c++){var p=f[c];if(p){var l=u.get(p);if(l){var d=l[o];if(d){if(i&&typeof i=="string"){if(d[i])return d[i];if(d.__domain_regex__)for(var w=0,g=d.__domain_regex__;w<g.length;w++){var v=g[w],m=v.listener;if(Ee(v.regex,i))return m}}if(d["*"])return d["*"]}}}}}function Pf(t,o,n,i){var u=i.on,c=i.send,f=Dr({name:n.name,win:t,domain:o}),p=n.name==="postrobot_method"&&n.data&&typeof n.data.name=="string"?n.data.name+"()":n.name;function l(d,w,g){return O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return St(t,o,{id:ee(),origin:F(window),type:"postrobot_message_response",hash:n.hash,name:n.name,ack:d,data:w,error:g},{on:u,send:c})}catch(v){throw new Error("Send response message failed for "+p+" in "+F()+`
12
12
 
13
- `+Re(v))}})}return O.all([O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return St(t,o,{id:ee(),origin:F(window),type:"postrobot_message_ack",hash:n.hash,name:n.name},{on:u,send:c})}catch(d){throw new Error("Send ack message failed for "+p+" in "+F()+`
13
+ `+Me(v))}})}return O.all([O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return St(t,o,{id:ee(),origin:F(window),type:"postrobot_message_ack",hash:n.hash,name:n.name},{on:u,send:c})}catch(d){throw new Error("Send ack message failed for "+p+" in "+F()+`
14
14
 
15
- `+Re(d))}}),O.try(function(){if(!f)throw new Error("No handler found for post message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return f.handler({source:t,origin:o,data:n.data})}).then(function(d){return l("success",d)},function(d){return l("error",null,d)})]).then(pe).catch(function(d){if(f&&f.handleError)return f.handleError(d);throw d})}function vf(t,o,n){if(!Cr(n.hash)){var i=xr(n.hash);if(!i)throw new Error("No handler found for post message ack for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!Ae(i.domain,o))throw new Error("Ack origin "+o+" does not match domain "+i.domain.toString());if(t!==i.win)throw new Error("Ack source does not match registered window")}catch(u){i.promise.reject(u)}i.ack=!0}}function wf(t,o,n){if(!Cr(n.hash)){var i=xr(n.hash);if(!i)throw new Error("No handler found for post message response for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Ae(i.domain,o))throw new Error("Response origin "+o+" does not match domain "+(u=i.domain,Array.isArray(u)?"("+u.join(" | ")+")":y(u)?"RegExp("+u.toString()+")":u.toString()));var u;if(t!==i.win)throw new Error("Response source does not match registered window");Ir(n.hash),n.ack==="error"?i.promise.reject(n.error):n.ack==="success"&&i.promise.resolve({source:t,origin:o,data:n.data})}}function Wr(t,o){var n=o.on,i=o.send,u=N("receivedMessages");try{if(!window||window.closed||!t.source)return}catch{return}var c=t.source,f=t.origin,p=function(w,g,v,m){var S=m.on,A=m.send,E;try{E=Or(g,v,w,{on:S,send:A})}catch{return}if(E&&typeof E=="object"&&E!==null){var I=E.__post_robot_10_0_46__;if(Array.isArray(I))return I}}(t.data,c,f,{on:n,send:i});if(p){_r(c);for(var l=0;l<p.length;l++){var d=p[l];if(u.has(d.id)||(u.set(d.id,!0),Z(c)&&!d.fireAndForget))return;d.origin.indexOf("file:")===0&&(f="file://");try{d.type==="postrobot_message_request"?gf(c,f,d,{on:n,send:i}):d.type==="postrobot_message_response"?wf(c,f,d):d.type==="postrobot_message_ack"&&vf(c,f,d)}catch(w){setTimeout(function(){throw w},0)}}}}function oe(t,o,n){if(!t)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(n=o,o={}),!n)throw new Error("Expected handler");var i=function u(c,f){var p=c.name,l=c.win,d=c.domain,w=q("requestListeners");if(!p||typeof p!="string")throw new Error("Name required to add request listener");if(l&&l!=="*"&&B.isProxyWindow(l)){var g=l.awaitWindow().then(function(R){return u({name:p,win:R,domain:d},f)});return{cancel:function(){g.then(function(R){return R.cancel()},pe)}}}var v=l;if(Array.isArray(v)){for(var m=[],S=0,A=v;S<A.length;S++)m.push(u({name:p,domain:d,win:A[S]},f));return{cancel:function(){for(var R=0;R<m.length;R++)m[R].cancel()}}}if(Array.isArray(d)){for(var E=[],I=0,M=d;I<M.length;I++)E.push(u({name:p,win:v,domain:M[I]},f));return{cancel:function(){for(var R=0;R<E.length;R++)E[R].cancel()}}}var $=jr({name:p,win:v,domain:d});v&&v!=="*"||(v=Ke());var C=(d=d||"*").toString();if($)throw v&&d?new Error("Request listener already exists for "+p+" on domain "+d.toString()+" for "+(v===Ke()?"wildcard":"specified")+" window"):v?new Error("Request listener already exists for "+p+" for "+(v===Ke()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+p+" on domain "+d.toString()):new Error("Request listener already exists for "+p);var L=w.getOrSet(v,function(){return{}}),T=Me(L,p,function(){return{}}),D,Y;return yt(d)?(D=Me(T,"__domain_regex__",function(){return[]})).push(Y={regex:d,listener:f}):T[C]=f,{cancel:function(){delete T[C],Y&&(D.splice(D.indexOf(Y,1)),D.length||delete T.__domain_regex__),Object.keys(T).length||delete L[p],v&&!Object.keys(L).length&&w.del(v)}}}({name:t,win:o.window,domain:o.domain||"*"},{handler:n||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){i.cancel()}}}function yf(t,o,n){typeof(o=o||{})=="function"&&(n=o,o={});var i=new O,u;return o.errorHandler=function(c){u.cancel(),i.reject(c)},u=oe(t,o,function(c){if(u.cancel(),i.resolve(c),n)return n(c)}),i.cancel=u.cancel,i}var ie=function t(o,n,i,u){var c=(u=u||{}).domain||"*",f=u.timeout||-1,p=u.timeout||5e3,l=u.fireAndForget||!1;return B.toProxyWindow(o,{send:t}).awaitWindow().then(function(d){return O.try(function(){if(function(w,g,v){if(!w)throw new Error("Expected name");if(v&&typeof v!="string"&&!Array.isArray(v)&&!yt(v))throw new TypeError("Can not send "+w+". Expected domain "+JSON.stringify(v)+" to be a string, array, or regex");if(Z(g))throw new Error("Can not send "+w+". Target window is closed")}(n,d,c),function(w,g){var v=ir(g);if(v)return v===w;if(g===w||function(A){A===void 0&&(A=window);try{if(A.top)return A.top}catch{}if(Q(A)===A)return A;try{if(k(window,A)&&window.top)return window.top}catch{}try{if(k(A,window)&&window.top)return window.top}catch{}for(var E=0,I=function $(C){for(var L=[],T=0,D=or(C);T<D.length;T++){var Y=D[T];L.push(Y);for(var R=0,Le=$(Y);R<Le.length;R++)L.push(Le[R])}return L}(A);E<I.length;E++){var M=I[E];try{if(M.top)return M.top}catch{}if(Q(M)===M)return M}}(g)===g)return!1;for(var m=0,S=or(w);m<S.length;m++)if(S[m]===g)return!0;return!1}(window,d))return function(w,g,v){g===void 0&&(g=5e3),v===void 0&&(v="Window");var m=function(S){return q("helloPromises").getOrSet(S,function(){return new O})}(w);return g!==-1&&(m=m.timeout(g,new Error(v+" did not load after "+g+"ms"))),m}(d,p)}).then(function(w){return function(g,v,m,S){var A=S.send;return O.try(function(){return typeof v=="string"?v:O.try(function(){return m||mt(g,{send:A}).then(function(E){return E.domain})}).then(function(E){if(!Ae(v,v))throw new Error("Domain "+hr(v)+" does not match "+hr(v));return E})})}(d,c,(w===void 0?{}:w).domain,{send:t})}).then(function(w){var g=w,v=n==="postrobot_method"&&i&&typeof i.name=="string"?i.name+"()":n,m=new O,S=n+"_"+ee();if(!l){var A={name:n,win:d,domain:g,promise:m};(function(T,D){N("responseListeners").set(T,D)})(S,A);var E=q("requestPromises").getOrSet(d,function(){return[]});E.push(m),m.catch(function(){(function(T){N("erroredResponseListeners").set(T,!0)})(S),Ir(S)});var I=function(T){return q("knownWindows").get(T,!1)}(d)?1e4:2e3,M=f,$=I,C=M,L=function(T,D){var Y;return function R(){Y=setTimeout(function(){(function(){if(Z(d))return m.reject(new Error("Window closed for "+n+" before "+(A.ack?"response":"ack")));if(A.cancelled)return m.reject(new Error("Response listener was cancelled for "+n));$=Math.max($-500,0),C!==-1&&(C=Math.max(C-500,0)),A.ack||$!==0?C===0&&m.reject(new Error("No response for postMessage "+v+" in "+F()+" in "+M+"ms")):m.reject(new Error("No ack for postMessage "+v+" in "+F()+" in "+I+"ms"))})(),R()},500)}(),{cancel:function(){clearTimeout(Y)}}}();m.finally(function(){L.cancel(),E.splice(E.indexOf(m,1))}).catch(pe)}return St(d,g,{id:ee(),origin:F(window),type:"postrobot_message_request",hash:S,name:n,data:i,fireAndForget:l},{on:oe,send:t}).then(function(){return l?m.resolve():m},function(T){throw new Error("Send request message failed for "+v+" in "+F()+`
15
+ `+Me(d))}}),O.try(function(){if(!f)throw new Error("No handler found for post message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return f.handler({source:t,origin:o,data:n.data})}).then(function(d){return l("success",d)},function(d){return l("error",null,d)})]).then(pe).catch(function(d){if(f&&f.handleError)return f.handleError(d);throw d})}function Of(t,o,n){if(!jr(n.hash)){var i=xr(n.hash);if(!i)throw new Error("No handler found for post message ack for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!Ee(i.domain,o))throw new Error("Ack origin "+o+" does not match domain "+i.domain.toString());if(t!==i.win)throw new Error("Ack source does not match registered window")}catch(u){i.promise.reject(u)}i.ack=!0}}function If(t,o,n){if(!jr(n.hash)){var i=xr(n.hash);if(!i)throw new Error("No handler found for post message response for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Ee(i.domain,o))throw new Error("Response origin "+o+" does not match domain "+(u=i.domain,Array.isArray(u)?"("+u.join(" | ")+")":y(u)?"RegExp("+u.toString()+")":u.toString()));var u;if(t!==i.win)throw new Error("Response source does not match registered window");Cr(n.hash),n.ack==="error"?i.promise.reject(n.error):n.ack==="success"&&i.promise.resolve({source:t,origin:o,data:n.data})}}function Rr(t,o){var n=o.on,i=o.send,u=N("receivedMessages");try{if(!window||window.closed||!t.source)return}catch{return}var c=t.source,f=t.origin,p=function(w,g,v,m){var S=m.on,E=m.send,A;try{A=Ir(g,v,w,{on:S,send:E})}catch{return}if(A&&typeof A=="object"&&A!==null){var x=A.__post_robot_10_0_46__;if(Array.isArray(x))return x}}(t.data,c,f,{on:n,send:i});if(p){Er(c);for(var l=0;l<p.length;l++){var d=p[l];if(u.has(d.id)||(u.set(d.id,!0),Z(c)&&!d.fireAndForget))return;d.origin.indexOf("file:")===0&&(f="file://");try{d.type==="postrobot_message_request"?Pf(c,f,d,{on:n,send:i}):d.type==="postrobot_message_response"?If(c,f,d):d.type==="postrobot_message_ack"&&Of(c,f,d)}catch(w){setTimeout(function(){throw w},0)}}}}function oe(t,o,n){if(!t)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(n=o,o={}),!n)throw new Error("Expected handler");var i=function u(c,f){var p=c.name,l=c.win,d=c.domain,w=q("requestListeners");if(!p||typeof p!="string")throw new Error("Name required to add request listener");if(l&&l!=="*"&&Y.isProxyWindow(l)){var g=l.awaitWindow().then(function(M){return u({name:p,win:M,domain:d},f)});return{cancel:function(){g.then(function(M){return M.cancel()},pe)}}}var v=l;if(Array.isArray(v)){for(var m=[],S=0,E=v;S<E.length;S++)m.push(u({name:p,domain:d,win:E[S]},f));return{cancel:function(){for(var M=0;M<m.length;M++)m[M].cancel()}}}if(Array.isArray(d)){for(var A=[],x=0,$=d;x<$.length;x++)A.push(u({name:p,win:v,domain:$[x]},f));return{cancel:function(){for(var M=0;M<A.length;M++)A[M].cancel()}}}var R=Dr({name:p,win:v,domain:d});v&&v!=="*"||(v=Xe());var C=(d=d||"*").toString();if(R)throw v&&d?new Error("Request listener already exists for "+p+" on domain "+d.toString()+" for "+(v===Xe()?"wildcard":"specified")+" window"):v?new Error("Request listener already exists for "+p+" for "+(v===Xe()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+p+" on domain "+d.toString()):new Error("Request listener already exists for "+p);var L=w.getOrSet(v,function(){return{}}),T=$e(L,p,function(){return{}}),W,J;return yt(d)?(W=$e(T,"__domain_regex__",function(){return[]})).push(J={regex:d,listener:f}):T[C]=f,{cancel:function(){delete T[C],J&&(W.splice(W.indexOf(J,1)),W.length||delete T.__domain_regex__),Object.keys(T).length||delete L[p],v&&!Object.keys(L).length&&w.del(v)}}}({name:t,win:o.window,domain:o.domain||"*"},{handler:n||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){i.cancel()}}}function xf(t,o,n){typeof(o=o||{})=="function"&&(n=o,o={});var i=new O,u;return o.errorHandler=function(c){u.cancel(),i.reject(c)},u=oe(t,o,function(c){if(u.cancel(),i.resolve(c),n)return n(c)}),i.cancel=u.cancel,i}var ie=function t(o,n,i,u){var c=(u=u||{}).domain||"*",f=u.timeout||-1,p=u.timeout||5e3,l=u.fireAndForget||!1;return Y.toProxyWindow(o,{send:t}).awaitWindow().then(function(d){return O.try(function(){if(function(w,g,v){if(!w)throw new Error("Expected name");if(v&&typeof v!="string"&&!Array.isArray(v)&&!yt(v))throw new TypeError("Can not send "+w+". Expected domain "+JSON.stringify(v)+" to be a string, array, or regex");if(Z(g))throw new Error("Can not send "+w+". Target window is closed")}(n,d,c),function(w,g){var v=ar(g);if(v)return v===w;if(g===w||function(E){E===void 0&&(E=window);try{if(E.top)return E.top}catch{}if(Q(E)===E)return E;try{if(k(window,E)&&window.top)return window.top}catch{}try{if(k(E,window)&&window.top)return window.top}catch{}for(var A=0,x=function R(C){for(var L=[],T=0,W=ir(C);T<W.length;T++){var J=W[T];L.push(J);for(var M=0,Le=R(J);M<Le.length;M++)L.push(Le[M])}return L}(E);A<x.length;A++){var $=x[A];try{if($.top)return $.top}catch{}if(Q($)===$)return $}}(g)===g)return!1;for(var m=0,S=ir(w);m<S.length;m++)if(S[m]===g)return!0;return!1}(window,d))return function(w,g,v){g===void 0&&(g=5e3),v===void 0&&(v="Window");var m=function(S){return q("helloPromises").getOrSet(S,function(){return new O})}(w);return g!==-1&&(m=m.timeout(g,new Error(v+" did not load after "+g+"ms"))),m}(d,p)}).then(function(w){return function(g,v,m,S){var E=S.send;return O.try(function(){return typeof v=="string"?v:O.try(function(){return m||mt(g,{send:E}).then(function(A){return A.domain})}).then(function(A){if(!Ee(v,v))throw new Error("Domain "+pr(v)+" does not match "+pr(v));return A})})}(d,c,(w===void 0?{}:w).domain,{send:t})}).then(function(w){var g=w,v=n==="postrobot_method"&&i&&typeof i.name=="string"?i.name+"()":n,m=new O,S=n+"_"+ee();if(!l){var E={name:n,win:d,domain:g,promise:m};(function(T,W){N("responseListeners").set(T,W)})(S,E);var A=q("requestPromises").getOrSet(d,function(){return[]});A.push(m),m.catch(function(){(function(T){N("erroredResponseListeners").set(T,!0)})(S),Cr(S)});var x=function(T){return q("knownWindows").get(T,!1)}(d)?1e4:2e3,$=f,R=x,C=$,L=function(T,W){var J;return function M(){J=setTimeout(function(){(function(){if(Z(d))return m.reject(new Error("Window closed for "+n+" before "+(E.ack?"response":"ack")));if(E.cancelled)return m.reject(new Error("Response listener was cancelled for "+n));R=Math.max(R-500,0),C!==-1&&(C=Math.max(C-500,0)),E.ack||R!==0?C===0&&m.reject(new Error("No response for postMessage "+v+" in "+F()+" in "+$+"ms")):m.reject(new Error("No ack for postMessage "+v+" in "+F()+" in "+x+"ms"))})(),M()},500)}(),{cancel:function(){clearTimeout(J)}}}();m.finally(function(){L.cancel(),A.splice(A.indexOf(m,1))}).catch(pe)}return St(d,g,{id:ee(),origin:F(window),type:"postrobot_message_request",hash:S,name:n,data:i,fireAndForget:l},{on:oe,send:t}).then(function(){return l?m.resolve():m},function(T){throw new Error("Send request message failed for "+v+" in "+F()+`
16
16
 
17
- `+Re(T))})})})};function mf(t,o,n){return Pr(t,o,n,{on:oe,send:ie})}function bf(t,o,n){return Or(t,o,n,{on:oe,send:ie})}function _f(t){return new B({send:ie,win:t})}function Af(t){return B.toProxyWindow(t,{send:ie})}function $r(){Ne().initialized||(Ne().initialized=!0,o=(t={on:oe,send:ie}).on,n=t.send,(i=Ne()).receiveMessage=i.receiveMessage||function(u){return Wr(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;N().getOrSet("postMessageListener",function(){return function(p,l,d){return p.addEventListener("message",d),{cancel:function(){p.removeEventListener("message",d)}}}(window,0,function(p){(function(l,d){var w=d.on,g=d.send;O.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");Wr({source:v,origin:m,data:S},{on:w,send:g})}})})(p,{on:c,send:f})})})}({on:oe,send:ie}),function(u){var c=u.on,f=u.send;N("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(d){return mr(d.source,{domain:d.origin}),{instanceID:yr()}}),l=ir();return l&&mt(l,{send:f}).catch(function(d){}),p})}({on:oe,send:ie}));var t,o,n,i}function Ef(){(function(){for(var o=N("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=N().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Sf=!0;function Tf(t){for(var o=0,n=q("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(pe)}$r()}])})})(nr);var tf=nr.exports;(function(e){e.exports=tf,e.exports.default=e.exports})(tr);var rr=tr.exports;const K=Ee({__proto__:null,default:ef(rr)},[rr]);_.ADMIN_API_METHOD_TYPES=fe,_.ADMIN_API_TYPES=Lc,_.ADMIN_MESSAGE=Mc,_.ADMIN_MESSAGE_TYPES=Nc,_.PITCHER_EVENT=Zc,_.PitcherBroadcastedEventName=kn,_.PitcherEventName=Xn,_.PitcherExternalEventName=er,_.PitcherMessageType=Kn,_.PitcherResponseStatus=Qn,_.UI_API_METHOD_TYPES=pt,_.UI_MESSAGE=Cc,_.UI_MESSAGE_TYPES=jc,_.useAdmin=Xc,_.usePitcherApi=Yc,_.useUi=Kc,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
17
+ `+Me(T))})})})};function Cf(t,o,n){return Or(t,o,n,{on:oe,send:ie})}function jf(t,o,n){return Ir(t,o,n,{on:oe,send:ie})}function Df(t){return new Y({send:ie,win:t})}function Rf(t){return Y.toProxyWindow(t,{send:ie})}function Wr(){Ne().initialized||(Ne().initialized=!0,o=(t={on:oe,send:ie}).on,n=t.send,(i=Ne()).receiveMessage=i.receiveMessage||function(u){return Rr(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;N().getOrSet("postMessageListener",function(){return function(p,l,d){return p.addEventListener("message",d),{cancel:function(){p.removeEventListener("message",d)}}}(window,0,function(p){(function(l,d){var w=d.on,g=d.send;O.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");Rr({source:v,origin:m,data:S},{on:w,send:g})}})})(p,{on:c,send:f})})})}({on:oe,send:ie}),function(u){var c=u.on,f=u.send;N("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(d){return _r(d.source,{domain:d.origin}),{instanceID:mr()}}),l=ar();return l&&mt(l,{send:f}).catch(function(d){}),p})}({on:oe,send:ie}));var t,o,n,i}function Wf(){(function(){for(var o=N("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=N().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Mf=!0;function $f(t){for(var o=0,n=q("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(pe)}Wr()}])})})(rr);var hf=rr.exports;(function(e){e.exports=hf,e.exports.default=e.exports})(nr);var or=nr.exports;const G=Ae({__proto__:null,default:lf(or)},[or]);b.ADMIN_API_METHOD_TYPES=fe,b.ADMIN_API_TYPES=Fc,b.ADMIN_MESSAGE=Uc,b.ADMIN_MESSAGE_TYPES=zc,b.DSR_API_METHOD_TYPES=Kn,b.DSR_API_TYPES=Xc,b.DSR_MESSAGE=Kc,b.DSR_MESSAGE_TYPES=Qc,b.PITCHER_EVENT=nf,b.PitcherBroadcastedEventName=er,b.PitcherEventName=kn,b.PitcherExternalEventName=tr,b.PitcherMessageType=Qn,b.PitcherResponseStatus=Xn,b.UI_API_METHOD_TYPES=Ye,b.UI_MESSAGE=Dc,b.UI_MESSAGE_TYPES=Rc,b.useAdmin=sf,b.useDsr=ff,b.usePitcherApi=rf,b.useUi=af,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
18
18
  //# sourceMappingURL=js-api.umd.min.js.map