@botim/nucleus 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BOT={})}(this,function(e){"use strict";const t="[NUCLEUS]",n=function(){window.logDebug&&console.log.apply(console,[t].concat(Array.from(arguments)))},r=function(){window.logDebug&&console.warn.apply(console,[t].concat(Array.from(arguments)))},o=function(){window.logDebug&&console.error.apply(console,[t].concat(Array.from(arguments)))},i={},a={};function c(e,t){a[e]=t}function s(e){if(e in i)return i[e];if(!a[e])throw new Error("Unknown service: "+e);return i[e]=a[e](),i[e]}function u(e,t){i[e]=t}var l,d,f,g,p,h,m,b,v,y,S,w,A,k,O,I,C,N,T,B,L,P,R,J,D,_,x,M,E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j(){if(d)return l;return d=1,l=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},l}function U(){if(h)return p;h=1;var e=(g||(g=1,f=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),c=a.length;c--;){var s=a[e?c:++o];if(!1===n(i[s],s,i))break}return t}}),f),t=e();return p=t}function V(){if(y)return v;y=1;var e="object"==typeof E&&E&&E.Object===Object&&E;return v=e}function z(){if(w)return S;w=1;var e=V(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return S=n}function H(){if(k)return A;k=1;var e=z().Symbol;return A=e}function K(){if(B)return T;B=1;var e=H(),t=function(){if(I)return O;I=1;var e=H(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return O=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(e){}var c=r.call(e);return a&&(t?e[o]=i:delete e[o]),c}}(),n=function(){if(N)return C;N=1;var e=Object.prototype.toString;return C=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return T=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function W(){if(P)return L;return P=1,L=function(e){return null!=e&&"object"==typeof e}}function G(){if(_)return D;_=1;var e=function(){if(J)return R;J=1;var e=K(),t=W();return R=function(n){return t(n)&&"[object Arguments]"==e(n)}}(),t=W(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return t(e)&&r.call(e,"callee")&&!o.call(e,"callee")};return D=i}function $(){if(M)return x;M=1;var e=Array.isArray;return x=e}var q,Y,Z,Q,X,ee,te,ne,re,oe,ie,ae={exports:{}};function ce(){return Z||(Z=1,function(e,t){var n=z(),r=Y?q:(Y=1,q=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||r;e.exports=c}(ae,ae.exports)),ae.exports}function se(){if(X)return Q;X=1;var e=/^(?:0|[1-9]\d*)$/;return Q=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ue(){if(te)return ee;te=1;return ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}function le(){if(ie)return oe;return ie=1,oe=function(e){return function(t){return e(t)}}}var de,fe,ge,pe,he,me,be,ve,ye,Se,we,Ae,ke,Oe,Ie,Ce,Ne,Te,Be,Le,Pe,Re,Je,De,_e,xe,Me,Ee,Fe,je,Ue,Ve,ze,He,Ke,We={exports:{}};function Ge(){return de||(de=1,function(e,t){var n=V(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(We,We.exports)),We.exports}function $e(){if(ge)return fe;ge=1;var e=function(){if(re)return ne;re=1;var e=K(),t=ue(),n=W(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,ne=function(o){return n(o)&&t(o.length)&&!!r[e(o)]}}(),t=le(),n=Ge(),r=n&&n.isTypedArray,o=r?t(r):e;return fe=o}function qe(){if(he)return pe;he=1;var e=(b||(b=1,m=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}),m),t=G(),n=$(),r=ce(),o=se(),i=$e(),a=Object.prototype.hasOwnProperty;return pe=function(c,s){var u=n(c),l=!u&&t(c),d=!u&&!l&&r(c),f=!u&&!l&&!d&&i(c),g=u||l||d||f,p=g?e(c.length,String):[],h=p.length;for(var m in c)!s&&!a.call(c,m)||g&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||o(m,h))||p.push(m);return p}}function Ye(){if(be)return me;be=1;var e=Object.prototype;return me=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}}function Ze(){if(ye)return ve;return ye=1,ve=function(e,t){return function(n){return e(t(n))}}}function Qe(){if(ke)return Ae;ke=1;var e=Ye(),t=function(){if(we)return Se;we=1;var e=Ze()(Object.keys,Object);return Se=e}(),n=Object.prototype.hasOwnProperty;return Ae=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function Xe(){if(Ie)return Oe;return Ie=1,Oe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function et(){if(Ne)return Ce;Ne=1;var e=K(),t=Xe();return Ce=function(n){if(!t(n))return!1;var r=e(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function tt(){if(Be)return Te;Be=1;var e=et(),t=ue();return Te=function(n){return null!=n&&t(n.length)&&!e(n)}}function nt(){if(Pe)return Le;Pe=1;var e=qe(),t=Qe(),n=tt();return Le=function(r){return n(r)?e(r):t(r)}}function rt(){if(Me)return xe;Me=1;var e=function(){if(Je)return Re;Je=1;var e=U(),t=nt();return Re=function(n,r){return n&&e(n,r,t)}}(),t=function(){if(_e)return De;_e=1;var e=tt();return De=function(t,n){return function(r,o){if(null==r)return r;if(!e(r))return t(r,o);for(var i=r.length,a=n?i:-1,c=Object(r);(n?a--:++a<i)&&!1!==o(c[a],a,c););return r}},De}(),n=t(e);return xe=n}function ot(){if(Fe)return Ee;return Fe=1,Ee=function(e){return e}}function it(){if(ze)return Ve;ze=1;var e=j(),t=rt(),n=function(){if(Ue)return je;Ue=1;var e=ot();return je=function(t){return"function"==typeof t?t:e}}(),r=$();return Ve=function(o,i){return(r(o)?e:t)(o,n(i))}}var at,ct,st,ut,lt,dt,ft,gt,pt,ht,mt,bt,vt,yt,St,wt,At=F(Ke?He:(Ke=1,He=it()));function kt(){if(ut)return st;ut=1;var e=function(){if(ct)return at;ct=1;var e=/\s/;return at=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},at}(),t=/^\s+/;return st=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n}}function Ot(){if(dt)return lt;dt=1;var e=K(),t=W();return lt=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}function It(){if(gt)return ft;gt=1;var e=kt(),t=Xe(),n=Ot(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return ft=function(c){if("number"==typeof c)return c;if(n(c))return NaN;if(t(c)){var s="function"==typeof c.valueOf?c.valueOf():c;c=t(s)?s+"":s}if("string"!=typeof c)return 0===c?c:+c;c=e(c);var u=o.test(c);return u||i.test(c)?a(c.slice(2),u?2:8):r.test(c)?NaN:+c}}function Ct(){if(bt)return mt;bt=1;var e=function(){if(ht)return pt;ht=1;var e=It(),t=1/0;return pt=function(n){return n?(n=e(n))===t||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}}();return mt=function(t){var n=e(t),r=n%1;return n==n?r?n-r:n:0}}var Nt,Tt,Bt,Lt,Pt,Rt,Jt,Dt,_t,xt,Mt,Et,Ft,jt,Ut,Vt,zt,Ht,Kt,Wt,Gt,$t,qt,Yt,Zt,Qt,Xt,en,tn,nn,rn,on,an,cn,sn,un,ln,dn,fn,gn,pn,hn,mn,bn,vn,yn,Sn,wn,An,kn,On,In,Cn,Nn,Tn,Bn,Ln,Pn,Rn,Jn,Dn,_n,xn,Mn,En,Fn,jn,Un,Vn,zn,Hn,Kn,Wn,Gn,$n,qn,Yn,Zn,Qn=function(){if(wt)return St;wt=1;var e=function(){if(yt)return vt;yt=1;var e=Ct();return vt=function(t,n){var r;if("function"!=typeof n)throw new TypeError("Expected a function");return t=e(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=void 0),r}},vt}();return St=function(t){return e(2,t)}}(),Xn=F(Qn);function er(){if(Lt)return Bt;return Lt=1,Bt=function(e,t){return e===t||e!=e&&t!=t}}function tr(){if(Rt)return Pt;Rt=1;var e=er();return Pt=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function nr(){if(Vt)return Ut;Vt=1;var e=Tt?Nt:(Tt=1,Nt=function(){this.__data__=[],this.size=0}),t=function(){if(Dt)return Jt;Dt=1;var e=tr(),t=Array.prototype.splice;return Jt=function(n){var r=this.__data__,o=e(r,n);return!(o<0||(o==r.length-1?r.pop():t.call(r,o,1),--this.size,0))},Jt}(),n=function(){if(xt)return _t;xt=1;var e=tr();return _t=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]},_t}(),r=function(){if(Et)return Mt;Et=1;var e=tr();return Mt=function(t){return e(this.__data__,t)>-1}}(),o=function(){if(jt)return Ft;jt=1;var e=tr();return Ft=function(t,n){var r=this.__data__,o=e(r,t);return o<0?(++this.size,r.push([t,n])):r[o][1]=n,this},Ft}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,Ut=i}function rr(){if(en)return Xt;en=1;var e,t=function(){if(Qt)return Zt;Qt=1;var e=z()["__core-js_shared__"];return Zt=e}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return Xt=function(e){return!!n&&n in e}}function or(){if(nn)return tn;nn=1;var e=Function.prototype.toString;return tn=function(t){if(null!=t){try{return e.call(t)}catch(e){}try{return t+""}catch(e){}}return""}}function ir(){if(un)return sn;un=1;var e=function(){if(on)return rn;on=1;var e=et(),t=rr(),n=Xe(),r=or(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,c=i.toString,s=a.hasOwnProperty,u=RegExp("^"+c.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return rn=function(i){return!(!n(i)||t(i))&&(e(i)?u:o).test(r(i))}}(),t=cn?an:(cn=1,an=function(e,t){return null==e?void 0:e[t]});return sn=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function ar(){if(dn)return ln;dn=1;var e=ir()(z(),"Map");return ln=e}function cr(){if(gn)return fn;gn=1;var e=ir()(Object,"create");return fn=e}function sr(){if(In)return On;In=1;var e=function(){if(hn)return pn;hn=1;var e=cr();return pn=function(){this.__data__=e?e(null):{},this.size=0}}(),t=bn?mn:(bn=1,mn=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}),n=function(){if(yn)return vn;yn=1;var e=cr(),t=Object.prototype.hasOwnProperty;return vn=function(n){var r=this.__data__;if(e){var o=r[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(r,n)?r[n]:void 0}}(),r=function(){if(wn)return Sn;wn=1;var e=cr(),t=Object.prototype.hasOwnProperty;return Sn=function(n){var r=this.__data__;return e?void 0!==r[n]:t.call(r,n)}}(),o=function(){if(kn)return An;kn=1;var e=cr();return An=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=e&&void 0===n?"__lodash_hash_undefined__":n,this}}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,On=i}function ur(){if(Pn)return Ln;Pn=1;var e=Bn?Tn:(Bn=1,Tn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e});return Ln=function(t,n){var r=t.__data__;return e(n)?r["string"==typeof n?"string":"hash"]:r.map},Ln}function lr(){if(Un)return jn;Un=1;var e=function(){if(Nn)return Cn;Nn=1;var e=sr(),t=nr(),n=ar();return Cn=function(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}}(),t=function(){if(Jn)return Rn;Jn=1;var e=ur();return Rn=function(t){var n=e(this,t).delete(t);return this.size-=n?1:0,n}}(),n=function(){if(_n)return Dn;_n=1;var e=ur();return Dn=function(t){return e(this,t).get(t)}}(),r=function(){if(Mn)return xn;Mn=1;var e=ur();return xn=function(t){return e(this,t).has(t)}}(),o=function(){if(Fn)return En;Fn=1;var e=ur();return En=function(t,n){var r=e(this,t),o=r.size;return r.set(t,n),this.size+=r.size==o?0:1,this}}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,jn=i}function dr(){if(Kn)return Hn;Kn=1;var e=nr(),t=function(){if(Ht)return zt;Ht=1;var e=nr();return zt=function(){this.__data__=new e,this.size=0}}(),n=Wt?Kt:(Wt=1,Kt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}),r=$t?Gt:($t=1,Gt=function(e){return this.__data__.get(e)}),o=Yt?qt:(Yt=1,qt=function(e){return this.__data__.has(e)}),i=function(){if(zn)return Vn;zn=1;var e=nr(),t=ar(),n=lr();return Vn=function(r,o){var i=this.__data__;if(i instanceof e){var a=i.__data__;if(!t||a.length<199)return a.push([r,o]),this.size=++i.size,this;i=this.__data__=new n(a)}return i.set(r,o),this.size=i.size,this}}();function a(t){var n=this.__data__=new e(t);this.size=n.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=o,a.prototype.set=i,Hn=a}function fr(){if(Gn)return Wn;Gn=1;var e=ir(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();return Wn=t}function gr(){if(qn)return $n;qn=1;var e=fr();return $n=function(t,n,r){"__proto__"==n&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}}function pr(){if(Zn)return Yn;Zn=1;var e=gr(),t=er();return Yn=function(n,r,o){(void 0!==o&&!t(n[r],o)||void 0===o&&!(r in n))&&e(n,r,o)}}var hr,mr,br,vr,yr,Sr,wr,Ar,kr,Or,Ir,Cr,Nr,Tr,Br,Lr,Pr,Rr,Jr,Dr,_r,xr,Mr,Er,Fr,jr,Ur,Vr,zr,Hr,Kr,Wr,Gr,$r,qr,Yr,Zr,Qr,Xr,eo,to,no,ro,oo,io,ao,co,so,uo,lo,fo,go,po,ho,mo,bo,vo,yo={exports:{}};function So(){return hr||(hr=1,function(e,t){var n=z(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(yo,yo.exports)),yo.exports}function wo(){if(br)return mr;br=1;var e=z().Uint8Array;return mr=e}function Ao(){if(yr)return vr;yr=1;var e=wo();return vr=function(t){var n=new t.constructor(t.byteLength);return new e(n).set(new e(t)),n}}function ko(){if(wr)return Sr;wr=1;var e=Ao();return Sr=function(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}}function Oo(){if(kr)return Ar;return kr=1,Ar=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Ar}function Io(){if(Nr)return Cr;Nr=1;var e=Ze()(Object.getPrototypeOf,Object);return Cr=e}function Co(){if(Br)return Tr;Br=1;var e=function(){if(Ir)return Or;Ir=1;var e=Xe(),t=Object.create,n=function(){function n(){}return function(r){if(!e(r))return{};if(t)return t(r);n.prototype=r;var o=new n;return n.prototype=void 0,o}}();return Or=n}(),t=Io(),n=Ye();return Tr=function(r){return"function"!=typeof r.constructor||n(r)?{}:e(t(r))}}function No(){if(_r)return Dr;return _r=1,Dr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}}function To(){if(Mr)return xr;Mr=1;var e=gr(),t=er(),n=Object.prototype.hasOwnProperty;return xr=function(r,o,i){var a=r[o];n.call(r,o)&&t(a,i)&&(void 0!==i||o in r)||e(r,o,i)}}function Bo(){if(Fr)return Er;Fr=1;var e=To(),t=gr();return Er=function(n,r,o,i){var a=!o;o||(o={});for(var c=-1,s=r.length;++c<s;){var u=r[c],l=i?i(o[u],n[u],u,o,n):void 0;void 0===l&&(l=n[u]),a?t(o,u,l):e(o,u,l)}return o},Er}function Lo(){if(zr)return Vr;zr=1;var e=Xe(),t=Ye(),n=Ur?jr:(Ur=1,jr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}),r=Object.prototype.hasOwnProperty;return Vr=function(o){if(!e(o))return n(o);var i=t(o),a=[];for(var c in o)("constructor"!=c||!i&&r.call(o,c))&&a.push(c);return a}}function Po(){if(Kr)return Hr;Kr=1;var e=qe(),t=Lo(),n=tt();return Hr=function(r){return n(r)?e(r,!0):t(r)}}function Ro(){if(qr)return $r;qr=1;var e=pr(),t=So(),n=ko(),r=Oo(),o=Co(),i=G(),a=$(),c=function(){if(Pr)return Lr;Pr=1;var e=tt(),t=W();return Lr=function(n){return t(n)&&e(n)}}(),s=ce(),u=et(),l=Xe(),d=function(){if(Jr)return Rr;Jr=1;var e=K(),t=Io(),n=W(),r=Function.prototype,o=Object.prototype,i=r.toString,a=o.hasOwnProperty,c=i.call(Object);return Rr=function(r){if(!n(r)||"[object Object]"!=e(r))return!1;var o=t(r);if(null===o)return!0;var s=a.call(o,"constructor")&&o.constructor;return"function"==typeof s&&s instanceof s&&i.call(s)==c}}(),f=$e(),g=No(),p=function(){if(Gr)return Wr;Gr=1;var e=Bo(),t=Po();return Wr=function(n){return e(n,t(n))}}();return $r=function(h,m,b,v,y,S,w){var A=g(h,b),k=g(m,b),O=w.get(k);if(O)e(h,b,O);else{var I=S?S(A,k,b+"",h,m,w):void 0,C=void 0===I;if(C){var N=a(k),T=!N&&s(k),B=!N&&!T&&f(k);I=k,N||T||B?a(A)?I=A:c(A)?I=r(A):T?(C=!1,I=t(k,!0)):B?(C=!1,I=n(k,!0)):I=[]:d(k)||i(k)?(I=A,i(A)?I=p(A):l(A)&&!u(A)||(I=o(k))):C=!1}C&&(w.set(k,I),y(I,k,v,S,w),w.delete(k)),e(h,b,I)}}}function Jo(){if(to)return eo;to=1;var e=Xr?Qr:(Xr=1,Qr=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}),t=Math.max;return eo=function(n,r,o){return r=t(void 0===r?n.length-1:r,0),function(){for(var i=arguments,a=-1,c=t(i.length-r,0),s=Array(c);++a<c;)s[a]=i[r+a];a=-1;for(var u=Array(r+1);++a<r;)u[a]=i[a];return u[r]=o(s),e(n,this,u)}},eo}function Do(){if(io)return oo;io=1;var e=ro?no:(ro=1,no=function(e){return function(){return e}}),t=fr(),n=ot();return oo=t?function(n,r){return t(n,"toString",{configurable:!0,enumerable:!1,value:e(r),writable:!0})}:n}function _o(){if(uo)return so;uo=1;var e=Do(),t=function(){if(co)return ao;co=1;var e=Date.now;return ao=function(t){var n=0,r=0;return function(){var o=e(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},ao}(),n=t(e);return so=n}function xo(){if(mo)return ho;mo=1;var e=function(){if(fo)return lo;fo=1;var e=ot(),t=Jo(),n=_o();return lo=function(r,o){return n(t(r,o,e),r+"")}}(),t=function(){if(po)return go;po=1;var e=er(),t=tt(),n=se(),r=Xe();return go=function(o,i,a){if(!r(a))return!1;var c=typeof i;return!!("number"==c?t(a)&&n(i,a.length):"string"==c&&i in a)&&e(a[i],o)},go}();return ho=function(n){return e(function(e,r){var o=-1,i=r.length,a=i>1?r[i-1]:void 0,c=i>2?r[2]:void 0;for(a=n.length>3&&"function"==typeof a?(i--,a):void 0,c&&t(r[0],r[1],c)&&(a=i<3?void 0:a,i=1),e=Object(e);++o<i;){var s=r[o];s&&n(e,s,o,a)}return e})},ho}var Mo,Eo,Fo,jo,Uo,Vo,zo,Ho,Ko,Wo,Go,$o,qo,Yo,Zo,Qo,Xo,ei,ti,ni,ri,oi,ii,ai,ci,si,ui,li,di,fi,gi,pi,hi,mi,bi,vi,yi,Si,wi,Ai,ki,Oi,Ii,Ci,Ni=function(){if(vo)return bo;vo=1;var e=function(){if(Zr)return Yr;Zr=1;var e=dr(),t=pr(),n=U(),r=Ro(),o=Xe(),i=Po(),a=No();return Yr=function c(s,u,l,d,f){s!==u&&n(u,function(n,i){if(f||(f=new e),o(n))r(s,u,i,l,c,d,f);else{var g=d?d(a(s,i),n,i+"",s,u,f):void 0;void 0===g&&(g=n),t(s,i,g)}},i)},Yr}(),t=xo()(function(t,n,r){e(t,n,r)});return bo=t}(),Ti=F(Ni);function Bi(){if(Eo)return Mo;Eo=1;var e=$(),t=Ot(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Mo=function(o,i){if(e(o))return!1;var a=typeof o;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=o&&!t(o))||(r.test(o)||!n.test(o)||null!=i&&o in Object(i))}}function Li(){if(Vo)return Uo;Vo=1;var e=function(){if(jo)return Fo;jo=1;var e=lr();function t(n,r){if("function"!=typeof n||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var e=arguments,t=r?r.apply(this,e):e[0],i=o.cache;if(i.has(t))return i.get(t);var a=n.apply(this,e);return o.cache=i.set(t,a)||i,a};return o.cache=new(t.Cache||e),o}return t.Cache=e,Fo=t}();return Uo=function(t){var n=e(t,function(e){return 500===r.size&&r.clear(),e}),r=n.cache;return n}}function Pi(){if(Wo)return Ko;return Wo=1,Ko=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},Ko}function Ri(){if(Yo)return qo;Yo=1;var e=function(){if($o)return Go;$o=1;var e=H(),t=Pi(),n=$(),r=Ot(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Go=function e(o){if("string"==typeof o)return o;if(n(o))return t(o,e)+"";if(r(o))return i?i.call(o):"";var a=o+"";return"0"==a&&1/o==-1/0?"-0":a},Go}();return qo=function(t){return null==t?"":e(t)}}function Ji(){if(Qo)return Zo;Qo=1;var e=$(),t=Bi(),n=function(){if(Ho)return zo;Ho=1;var e=Li(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(t,function(e,t,o,i){r.push(o?i.replace(n,"$1"):t||e)}),r});return zo=r}(),r=Ri();return Zo=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Di(){if(ei)return Xo;ei=1;var e=Ot();return Xo=function(t){if("string"==typeof t||e(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}function _i(){if(ni)return ti;ni=1;var e=Ji(),t=Di();return ti=function(n,r){for(var o=0,i=(r=e(r,n)).length;null!=n&&o<i;)n=n[t(r[o++])];return o&&o==i?n:void 0},ti}function xi(){if(ai)return ii;ai=1;var e=_i(),t=function(){if(oi)return ri;oi=1;var e=To(),t=Ji(),n=se(),r=Xe(),o=Di();return ri=function(i,a,c,s){if(!r(i))return i;for(var u=-1,l=(a=t(a,i)).length,d=l-1,f=i;null!=f&&++u<l;){var g=o(a[u]),p=c;if("__proto__"===g||"constructor"===g||"prototype"===g)return i;if(u!=d){var h=f[g];void 0===(p=s?s(h,g,f):void 0)&&(p=r(h)?h:n(a[u+1])?[]:{})}e(f,g,p),f=f[g]}return i},ri}(),n=Ji();return ii=function(r,o,i){for(var a=-1,c=o.length,s={};++a<c;){var u=o[a],l=e(r,u);i(l,u)&&t(s,n(u,r),l)}return s},ii}function Mi(){if(fi)return di;fi=1;var e=si?ci:(si=1,ci=function(e,t){return null!=e&&t in Object(e)}),t=function(){if(li)return ui;li=1;var e=Ji(),t=G(),n=$(),r=se(),o=ue(),i=Di();return ui=function(a,c,s){for(var u=-1,l=(c=e(c,a)).length,d=!1;++u<l;){var f=i(c[u]);if(!(d=null!=a&&s(a,f)))break;a=a[f]}return d||++u!=l?d:!!(l=null==a?0:a.length)&&o(l)&&r(f,l)&&(n(a)||t(a))},ui}();return di=function(n,r){return null!=n&&t(n,r,e)}}function Ei(){if(mi)return hi;return mi=1,hi=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},hi}function Fi(){if(Si)return yi;Si=1;var e=Ei(),t=function(){if(vi)return bi;vi=1;var e=H(),t=G(),n=$(),r=e?e.isConcatSpreadable:void 0;return bi=function(e){return n(e)||t(e)||!!(r&&e&&e[r])}}();return yi=function n(r,o,i,a,c){var s=-1,u=r.length;for(i||(i=t),c||(c=[]);++s<u;){var l=r[s];o>0&&i(l)?o>1?n(l,o-1,i,a,c):e(c,l):a||(c[c.length]=l)}return c},yi}function ji(){if(Oi)return ki;Oi=1;var e=function(){if(Ai)return wi;Ai=1;var e=Fi();return wi=function(t){return null!=t&&t.length?e(t,1):[]}}(),t=Jo(),n=_o();return ki=function(r){return n(t(r,void 0,e),r+"")}}var Ui,Vi,zi,Hi,Ki=function(){if(Ci)return Ii;Ci=1;var e=function(){if(pi)return gi;pi=1;var e=xi(),t=Mi();return gi=function(n,r){return e(n,r,function(e,r){return t(n,r)})}}(),t=ji()(function(t,n){return null==t?{}:e(t,n)});return Ii=t}(),Wi=F(Ki);function Gi(){if(Hi)return zi;Hi=1;var e=Xe(),t=function(){if(Vi)return Ui;Vi=1;var e=z();return Ui=function(){return e.Date.now()}}(),n=It(),r=Math.max,o=Math.min;return zi=function(i,a,c){var s,u,l,d,f,g,p=0,h=!1,m=!1,b=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function v(e){var t=s,n=u;return s=u=void 0,p=e,d=i.apply(n,t)}function y(e){var t=e-g;return void 0===g||t>=a||t<0||m&&e-p>=l}function S(){var e=t();if(y(e))return w(e);f=setTimeout(S,function(e){var t=a-(e-g);return m?o(t,l-(e-p)):t}(e))}function w(e){return f=void 0,b&&s?v(e):(s=u=void 0,d)}function A(){var e=t(),n=y(e);if(s=arguments,u=this,g=e,n){if(void 0===f)return function(e){return p=e,f=setTimeout(S,a),h?v(e):d}(g);if(m)return clearTimeout(f),f=setTimeout(S,a),v(g)}return void 0===f&&(f=setTimeout(S,a)),d}return a=n(a)||0,e(c)&&(h=!!c.leading,l=(m="maxWait"in c)?r(n(c.maxWait)||0,a):l,b="trailing"in c?!!c.trailing:b),A.cancel=function(){void 0!==f&&clearTimeout(f),p=0,s=g=u=f=void 0},A.flush=function(){return void 0===f?d:w(t())},A},zi}var $i,qi,Yi=F(Gi());var Zi,Qi,Xi=function(){if(qi)return $i;qi=1;var e=Ct();return $i=function(t,n){if("function"!=typeof n)throw new TypeError("Expected a function");return t=e(t),function(){if(--t<1)return n.apply(this,arguments)}},$i}(),ea=F(Xi);var ta,na,ra,oa,ia,aa,ca,sa,ua,la,da,fa,ga,pa,ha,ma,ba,va,ya,Sa,wa,Aa,ka,Oa,Ia,Ca,Na,Ta,Ba,La,Pa,Ra,Ja,Da,_a,xa,Ma,Ea,Fa,ja,Ua,Va,za,Ha,Ka,Wa,Ga,$a,qa,Ya,Za,Qa,Xa,ec,tc,nc,rc,oc,ic,ac,cc,sc,uc,lc,dc,fc,gc,pc,hc,mc,bc=function(){if(Qi)return Zi;Qi=1;var e=Gi(),t=Xe();return Zi=function(n,r,o){var i=!0,a=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return t(o)&&(i="leading"in o?!!o.leading:i,a="trailing"in o?!!o.trailing:a),e(n,r,{leading:i,maxWait:r,trailing:a})}}(),vc=F(bc);function yc(){if(na)return ta;return na=1,ta=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},ta}function Sc(){if(la)return ua;la=1;var e=lr(),t=aa?ia:(aa=1,ia=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),n=sa?ca:(sa=1,ca=function(e){return this.__data__.has(e)});function r(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new e;++n<r;)this.add(t[n])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,ua=r}function wc(){if(ma)return ha;ma=1;var e=Sc(),t=(fa||(fa=1,da=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}),da),n=pa?ga:(pa=1,ga=function(e,t){return e.has(t)});return ha=function(r,o,i,a,c,s){var u=1&i,l=r.length,d=o.length;if(l!=d&&!(u&&d>l))return!1;var f=s.get(r),g=s.get(o);if(f&&g)return f==o&&g==r;var p=-1,h=!0,m=2&i?new e:void 0;for(s.set(r,o),s.set(o,r);++p<l;){var b=r[p],v=o[p];if(a)var y=u?a(v,b,p,o,r,s):a(b,v,p,r,o,s);if(void 0!==y){if(y)continue;h=!1;break}if(m){if(!t(o,function(e,t){if(!n(m,t)&&(b===e||c(b,e,i,a,s)))return m.push(t)})){h=!1;break}}else if(b!==v&&!c(b,v,i,a,s)){h=!1;break}}return s.delete(r),s.delete(o),h},ha}function Ac(){if(Aa)return wa;Aa=1;var e=H(),t=wo(),n=er(),r=wc(),o=(va||(va=1,ba=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}),ba),i=(Sa||(Sa=1,ya=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}),ya),a=e?e.prototype:void 0,c=a?a.valueOf:void 0;return wa=function(e,a,s,u,l,d,f){switch(s){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!d(new t(e),new t(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var g=o;case"[object Set]":var p=1&u;if(g||(g=i),e.size!=a.size&&!p)return!1;var h=f.get(e);if(h)return h==a;u|=2,f.set(e,a);var m=r(g(e),g(a),u,l,d,f);return f.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(a)}return!1}}function kc(){if(Oa)return ka;Oa=1;var e=Ei(),t=$();return ka=function(n,r,o){var i=r(n);return t(n)?i:e(i,o(n))}}function Oc(){if(Ca)return Ia;return Ca=1,Ia=function(){return[]}}function Ic(){if(Ta)return Na;Ta=1;var e=yc(),t=Oc(),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Na=r?function(t){return null==t?[]:(t=Object(t),e(r(t),function(e){return n.call(t,e)}))}:t}function Cc(){if(La)return Ba;La=1;var e=kc(),t=Ic(),n=nt();return Ba=function(r){return e(r,n,t)}}function Nc(){if(Va)return Ua;Va=1;var e=function(){if(Da)return Ja;Da=1;var e=ir()(z(),"DataView");return Ja=e}(),t=ar(),n=function(){if(xa)return _a;xa=1;var e=ir()(z(),"Promise");return _a=e}(),r=function(){if(Ea)return Ma;Ea=1;var e=ir()(z(),"Set");return Ma=e}(),o=function(){if(ja)return Fa;ja=1;var e=ir()(z(),"WeakMap");return Fa=e}(),i=K(),a=or(),c="[object Map]",s="[object Promise]",u="[object Set]",l="[object WeakMap]",d="[object DataView]",f=a(e),g=a(t),p=a(n),h=a(r),m=a(o),b=i;return(e&&b(new e(new ArrayBuffer(1)))!=d||t&&b(new t)!=c||n&&b(n.resolve())!=s||r&&b(new r)!=u||o&&b(new o)!=l)&&(b=function(e){var t=i(e),n="[object Object]"==t?e.constructor:void 0,r=n?a(n):"";if(r)switch(r){case f:return d;case g:return c;case p:return s;case h:return u;case m:return l}return t}),Ua=b}function Tc(){if(Ha)return za;Ha=1;var e=dr(),t=wc(),n=Ac(),r=function(){if(Ra)return Pa;Ra=1;var e=Cc(),t=Object.prototype.hasOwnProperty;return Pa=function(n,r,o,i,a,c){var s=1&o,u=e(n),l=u.length;if(l!=e(r).length&&!s)return!1;for(var d=l;d--;){var f=u[d];if(!(s?f in r:t.call(r,f)))return!1}var g=c.get(n),p=c.get(r);if(g&&p)return g==r&&p==n;var h=!0;c.set(n,r),c.set(r,n);for(var m=s;++d<l;){var b=n[f=u[d]],v=r[f];if(i)var y=s?i(v,b,f,r,n,c):i(b,v,f,n,r,c);if(!(void 0===y?b===v||a(b,v,o,i,c):y)){h=!1;break}m||(m="constructor"==f)}if(h&&!m){var S=n.constructor,w=r.constructor;S==w||!("constructor"in n)||!("constructor"in r)||"function"==typeof S&&S instanceof S&&"function"==typeof w&&w instanceof w||(h=!1)}return c.delete(n),c.delete(r),h},Pa}(),o=Nc(),i=$(),a=ce(),c=$e(),s="[object Arguments]",u="[object Array]",l="[object Object]",d=Object.prototype.hasOwnProperty;return za=function(f,g,p,h,m,b){var v=i(f),y=i(g),S=v?u:o(f),w=y?u:o(g),A=(S=S==s?l:S)==l,k=(w=w==s?l:w)==l,O=S==w;if(O&&a(f)){if(!a(g))return!1;v=!0,A=!1}if(O&&!A)return b||(b=new e),v||c(f)?t(f,g,p,h,m,b):n(f,g,S,p,h,m,b);if(!(1&p)){var I=A&&d.call(f,"__wrapped__"),C=k&&d.call(g,"__wrapped__");if(I||C){var N=I?f.value():f,T=C?g.value():g;return b||(b=new e),m(N,T,p,h,b)}}return!!O&&(b||(b=new e),r(f,g,p,h,m,b))}}function Bc(){if(Wa)return Ka;Wa=1;var e=Tc(),t=W();return Ka=function n(r,o,i,a,c){return r===o||(null==r||null==o||!t(r)&&!t(o)?r!=r&&o!=o:e(r,o,i,a,n,c))},Ka}function Lc(){if(Ya)return qa;Ya=1;var e=Xe();return qa=function(t){return t==t&&!e(t)}}function Pc(){if(ec)return Xa;return ec=1,Xa=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}}function Rc(){if(nc)return tc;nc=1;var e=function(){if($a)return Ga;$a=1;var e=dr(),t=Bc();return Ga=function(n,r,o,i){var a=o.length,c=a,s=!i;if(null==n)return!c;for(n=Object(n);a--;){var u=o[a];if(s&&u[2]?u[1]!==n[u[0]]:!(u[0]in n))return!1}for(;++a<c;){var l=(u=o[a])[0],d=n[l],f=u[1];if(s&&u[2]){if(void 0===d&&!(l in n))return!1}else{var g=new e;if(i)var p=i(d,f,l,n,r,g);if(!(void 0===p?t(f,d,3,i,g):p))return!1}}return!0},Ga}(),t=function(){if(Qa)return Za;Qa=1;var e=Lc(),t=nt();return Za=function(n){for(var r=t(n),o=r.length;o--;){var i=r[o],a=n[i];r[o]=[i,a,e(a)]}return r}}(),n=Pc();return tc=function(r){var o=t(r);return 1==o.length&&o[0][2]?n(o[0][0],o[0][1]):function(t){return t===r||e(t,r,o)}}}function Jc(){if(ac)return ic;ac=1;var e=Bc(),t=function(){if(oc)return rc;oc=1;var e=_i();return rc=function(t,n,r){var o=null==t?void 0:e(t,n);return void 0===o?r:o}}(),n=Mi(),r=Bi(),o=Lc(),i=Pc(),a=Di();return ic=function(c,s){return r(c)&&o(s)?i(a(c),s):function(r){var o=t(r,c);return void 0===o&&o===s?n(r,c):e(s,o,3)}}}function Dc(){if(fc)return dc;fc=1;var e=sc?cc:(sc=1,cc=function(e){return function(t){return null==t?void 0:t[e]}}),t=function(){if(lc)return uc;lc=1;var e=_i();return uc=function(t){return function(n){return e(n,t)}}}(),n=Bi(),r=Di();return dc=function(o){return n(o)?e(r(o)):t(o)}}function _c(){if(pc)return gc;pc=1;var e=Rc(),t=Jc(),n=ot(),r=$(),o=Dc();return gc=function(i){return"function"==typeof i?i:null==i?n:"object"==typeof i?r(i)?t(i[0],i[1]):e(i):o(i)}}var xc,Mc,Ec,Fc,jc=function(){if(mc)return hc;mc=1;var e=yc(),t=function(){if(oa)return ra;oa=1;var e=rt();return ra=function(t,n){var r=[];return e(t,function(e,t,o){n(e,t,o)&&r.push(e)}),r},ra}(),n=_c(),r=$();return hc=function(o,i){return(r(o)?e:t)(o,n(i,3))}}(),Uc=F(jc),Vc=F(Dc());var zc,Hc,Kc,Wc,Gc,$c,qc,Yc,Zc,Qc,Xc,es,ts,ns,rs,os,is,as,cs,ss,us,ls,ds,fs,gs,ps,hs,ms,bs,vs,ys,Ss,ws,As,ks=function(){if(Fc)return Ec;Fc=1;var e=Pi(),t=_c(),n=function(){if(Mc)return xc;Mc=1;var e=rt(),t=tt();return xc=function(n,r){var o=-1,i=t(n)?Array(n.length):[];return e(n,function(e,t,n){i[++o]=r(e,t,n)}),i},xc}(),r=$();return Ec=function(o,i){return(r(o)?e:n)(o,t(i,3))}}();function Os(){if(Yc)return qc;Yc=1;var e=Ei(),t=Io(),n=Ic(),r=Oc(),o=Object.getOwnPropertySymbols;return qc=o?function(r){for(var o=[];r;)e(o,n(r)),r=t(r);return o}:r}function Is(){if(ls)return us;ls=1;var e=Ao(),t=function(){if(os)return rs;os=1;var e=Ao();return rs=function(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}}(),n=function(){if(as)return is;as=1;var e=/\w*$/;return is=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}}(),r=function(){if(ss)return cs;ss=1;var e=H(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;return cs=function(e){return n?Object(n.call(e)):{}}}(),o=ko();return us=function(i,a,c){var s=i.constructor;switch(a){case"[object ArrayBuffer]":return e(i);case"[object Boolean]":case"[object Date]":return new s(+i);case"[object DataView]":return t(i,c);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,c);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(i);case"[object RegExp]":return n(i);case"[object Symbol]":return r(i)}}}function Cs(){if(ps)return gs;ps=1;var e=function(){if(fs)return ds;fs=1;var e=Nc(),t=W();return ds=function(n){return t(n)&&"[object Map]"==e(n)}}(),t=le(),n=Ge(),r=n&&n.isMap,o=r?t(r):e;return gs=o}function Ns(){if(vs)return bs;vs=1;var e=function(){if(ms)return hs;ms=1;var e=Nc(),t=W();return hs=function(n){return t(n)&&"[object Set]"==e(n)}}(),t=le(),n=Ge(),r=n&&n.isSet,o=r?t(r):e;return bs=o}function Ts(){if(Ss)return ys;Ss=1;var e=dr(),t=j(),n=To(),r=function(){if(Hc)return zc;Hc=1;var e=Bo(),t=nt();return zc=function(n,r){return n&&e(r,t(r),n)}}(),o=function(){if(Wc)return Kc;Wc=1;var e=Bo(),t=Po();return Kc=function(n,r){return n&&e(r,t(r),n)}}(),i=So(),a=Oo(),c=function(){if($c)return Gc;$c=1;var e=Bo(),t=Ic();return Gc=function(n,r){return e(n,t(n),r)}}(),s=function(){if(Qc)return Zc;Qc=1;var e=Bo(),t=Os();return Zc=function(n,r){return e(n,t(n),r)}}(),u=Cc(),l=function(){if(es)return Xc;es=1;var e=kc(),t=Os(),n=Po();return Xc=function(r){return e(r,n,t)}}(),d=Nc(),f=function(){if(ns)return ts;ns=1;var e=Object.prototype.hasOwnProperty;return ts=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}}(),g=Is(),p=Co(),h=$(),m=ce(),b=Cs(),v=Xe(),y=Ns(),S=nt(),w=Po(),A="[object Arguments]",k="[object Function]",O="[object Object]",I={};return I[A]=I["[object Array]"]=I["[object ArrayBuffer]"]=I["[object DataView]"]=I["[object Boolean]"]=I["[object Date]"]=I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Map]"]=I["[object Number]"]=I[O]=I["[object RegExp]"]=I["[object Set]"]=I["[object String]"]=I["[object Symbol]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I["[object Error]"]=I[k]=I["[object WeakMap]"]=!1,ys=function C(N,T,B,L,P,R){var J,D=1&T,_=2&T,x=4&T;if(B&&(J=P?B(N,L,P,R):B(N)),void 0!==J)return J;if(!v(N))return N;var M=h(N);if(M){if(J=f(N),!D)return a(N,J)}else{var E=d(N),F=E==k||"[object GeneratorFunction]"==E;if(m(N))return i(N,D);if(E==O||E==A||F&&!P){if(J=_||F?{}:p(N),!D)return _?s(N,o(J,N)):c(N,r(J,N))}else{if(!I[E])return P?N:{};J=g(N,E,D)}}R||(R=new e);var j=R.get(N);if(j)return j;R.set(N,J),y(N)?N.forEach(function(e){J.add(C(e,T,B,e,N,R))}):b(N)&&N.forEach(function(e,t){J.set(t,C(e,T,B,t,N,R))});var U=M?void 0:(x?_?l:u:_?w:S)(N);return t(U||N,function(e,t){U&&(e=N[t=e]),n(J,t,C(e,T,B,t,N,R))}),J},ys}const Bs={each:At,once:Xn,merge:Ti,pick:Wi,debounce:Yi,after:ea,throttle:vc,filter:Uc,property:Vc,map:F(ks),cloneDeep:F(function(){if(As)return ws;As=1;var e=Ts();return ws=function(t){return e(t,5)}}())};function Ls(e,t){return function(e,t,n){return void 0===n&&(n=console.log),function(){n(`[${e}] ${t}`,Array.prototype.slice.call(arguments))}}(e,t,console.warn)}function Ps(e){const t=Ls("NOT_IMPL",e);return t.NOT_IMPL=!0,t}const Rs={$SHIM_REGISTRY:{},$SHIM_MAP:{}};function Js(e,t,n){void 0===n&&(n=e.exports),void 0===t&&(t={}),Bs.each(n,function(n){let r=t[n];void 0===r&&(r=Ps("function not impl: "+n)),Rs.checkImpl(t,n),e.methods[n]=r}),e.methods["__proxy_"+e.name]=t}function Ds(e,t){const n={name:e,methods:{},exports:t},r="__proxy_"+e;n.methods[r]=void 0,Bs.each(t,function(e){n[e]=function(){const t=n.methods[r];return n.methods[e].apply(t||this,arguments)}}),c(e,function(){return n.methods});return c(Rs.getConfigureOfShim(e),function(){return{wire:function(e,t){Js(n,e,t)},getFnList:function(){return n.exports}}}),Rs.$SHIM_MAP[e]=n,{name:e,exportable:function(t){return Rs.exportable(e,t)}}}Rs.makeShim=function(e,t,n){if(void 0===e.exports)throw"error when make "+t+", shim exports undefined";void 0===n&&(n={}),e.methods=n,e.$get=function(){return e.methods},e.wire=function(t,n){Js(e,t,n)},Rs.$SHIM_REGISTRY[t]||(Rs.$SHIM_REGISTRY[t]=void 0)},Rs.getConfigureOfShim=function(e){return e+"Configure"},Rs.exportable=function(e,t){const n={};return n[e=e.name||e]=t,Rs.$SHIM_REGISTRY[e]=t,n},Rs.checkImpl=function(e,t){return!!e&&(void 0!==e[t]&&(!e[t].NOT_IMPL||!!e[t].LAZY))},Rs.link=function(e){const t={},n=Rs.$SHIM_REGISTRY;return e&&Bs.merge(n,e),Bs.each(n,function(e,n){const r=s(Rs.getConfigureOfShim(n));let o=e?s(e):void 0;o={name:e,...o},r.wire(o);const i=s(n);Bs.merge(t,i)}),t},c("$BRIDGEKIT",function(){return Rs});const _s=Bs.once(function(){return void 0!==window.BOTBridge});function xs(){_s()?(n("setup interface BOTBridge"),u("bridgeAdapterJSInterface",window.BOTBridge)):u("bridgeAdapterJSInterface",void 0)}var Ms=Object.freeze({__proto__:null,checker:_s,name:"bridgeAdapterJSInterface",setup:xs});const Es=window.navigator.userAgent,Fs=/(iOS|Android)MPAdapter\/(\d+(\.?\d*))(\(.*\)|\/.*)?/.exec(Es),js=Fs?Fs[1]:"unknown",Us=Fs?1*Fs[2]:-1,Vs=Fs?Fs[4]:"",zs=!!window.BOTBridge;let Hs=!0;const Ks=function(){return!("iOS"===js&&Us>=1)&&("Android"===js&&Us>=1?Hs:!zs&&"botmpx:"===window.location.protocol)};let Ws=0;const Gs=function(){return n("LazyLoad-BOTBridgeeeee",Ws),Ws++>80&&(Hs=!1),!!window.BOTBridge};function $s(){if(!Ks())return void u("bridgeAdapterLazyJSInterface",void 0);r("setup LAZY interface BOTBridge");const e={};e.isReady=Gs,Bs.each(Rs.$SHIM_REGISTRY,function(t,n){const o="get"+n,i={};i["lazy"+n]=!1;let a=!1;const c=Rs.$SHIM_MAP[n].exports,s=e[o]=function(){if(!window.BOTBridge||a)return i;let e=o;"Storage"===n&&!window.BOTBridge[o]&&window.BOTBridge.getLocalStorage&&(e="getLocalStorage");const t=window.BOTBridge[e];if(!t)return i;const r={},s=t.apply(window.BOTBridge);return Bs.each(c,function(e){const t=s[e];"function"==typeof t?r[e]=function(){return t.apply(s,arguments)}:i[e]&&(i[e].LAZY=!1)}),Bs.merge(i,r),a=!0,i};Bs.each(c,function(e){i[e]=function(){s();const t=i[e];return a&&t&&!t.NOT_IMPL?t.apply(this,arguments):void r("error calling a lazy load method "+n+"."+e+", not "+(i[e].LAZY?"loaded":"impl"))},i[e].NOT_IMPL=!0,i[e].LAZY=!0})}),Bs.each(["wakeup","getAPILevel","getAppJson"],function(t){e[t]=function(){if(window.BOTBridge&&window.BOTBridge[t])return window.BOTBridge[t]()}}),e.overrideMethod=function(e,t){if(!window.BOTBridge)throw"sync override method "+e+" failed, entry is null";void 0!==window.BOTBridge[e]?r("BOTBridge."+e+" occupied, can not override"):window.BOTBridge[e]=t},u("bridgeAdapterLazyJSInterface",e)}var qs=Object.freeze({__proto__:null,checker:Ks,isReady:Gs,name:"bridgeAdapterLazyJSInterface",setup:$s});const Ys=!!window.BOTBridge,Zs=Bs.once(function(){return!Ys&&("iOS"===js&&Us>=1&&/usePrompt/.test(Vs))}),Qs=function(){return Zs()};function Xs(e,t){const r=t||"BOTbridge";return function(){const t=Array.from(arguments),o={type:r,functionName:e,arguments:t};n("proxyCaller prompt "+e,o);let i=prompt(JSON.stringify(o));return i&&(i=JSON.parse(i)),i instanceof Array&&(i=i[0]),i}}function eu(){if(!Zs())return void u("bridgeAdapterPromptIntercept",void 0);r("setup PromptIntercept proxy BOTBridge");const e={};e.isReady=Qs,Bs.each(Rs.$SHIM_REGISTRY,function(t,n){const o="get"+n,i={};i["lazy"+n]=!1;let a=!1;const c=Rs.$SHIM_MAP[n].exports,s=e[o]=function(){if(a)return i;const e={},t={};return Bs.each(c,function(r){const o=Xs(r,n);e[r]=function(){return o.apply(t,arguments)}}),Bs.merge(i,e),a=!0,i};Bs.each(c,function(e){i[e]=function(){s();const t=i[e];return a&&t&&!t.NOT_IMPL?t.apply(this,arguments):void r("error calling a lazy load method "+n+"."+e+", not "+(i[e].LAZY?"loaded":"impl"))},i[e].NOT_IMPL=!0,i[e].LAZY=!0})}),Bs.each(["wakeup","getAPILevel","getAppJson"],function(t){e[t]=Xs(t)}),u("bridgeAdapterPromptIntercept",e)}var tu=Object.freeze({__proto__:null,checker:Zs,isReady:Qs,name:"bridgeAdapterPromptIntercept",setup:eu});const nu=!!window.BOTBridge,ru=Bs.once(function(){return!nu&&!!("iOS"===js&&Us>=1&&/mixPMPrompt|usePostMessage/.test(Vs))}),ou=function(){return ru()&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.BOTbridge};function iu(e,t){const r=t||"BOTbridge";return/mixPMPrompt/.test(Vs)&&function(e){if(/^(is.*|.*Sync)$/.test(e))return!0;switch(e){case"getAppJson":case"getAPILevel":case"getPublicNavigateUrl":case"getClientInfo":return!0}return!1}(e)?function(){const t=Array.from(arguments),o={type:r,functionName:e,arguments:t};n("proxyCaller mix prompt "+e,o);let i=prompt(JSON.stringify(o));return i&&(i=JSON.parse(i)),i instanceof Array&&(i=i[0]),i}:function(){const t=Array.from(arguments),o={functionName:e,arguments:t};n("proxyCaller messageHandlers "+r+"."+e,o),window.webkit.messageHandlers[r].postMessage(o)}}function au(){if(!ru())return void u("bridgeAdapterWebkitPostMessage",void 0);r("setup WebView JavaScript Bridge");const e={};e.isReady=ou,Bs.each(Rs.$SHIM_REGISTRY,function(t,n){const o="get"+n,i={};i["lazy"+n]=!1;let a=!1;const c=Rs.$SHIM_MAP[n].exports,s=e[o]=function(){if(a)return i;const e={},t={};return Bs.each(c,function(r){const o=iu(r,n);e[r]=function(){return o.apply(t,arguments)}}),Bs.merge(i,e),a=!0,i};Bs.each(c,function(e){i[e]=function(){s();const t=i[e];return a&&t&&!t.NOT_IMPL?t.apply(this,arguments):void r("error calling a lazy load method "+n+"."+e+", not "+(i[e].LAZY?"loaded":"impl"))},i[e].NOT_IMPL=!0,i[e].LAZY=!0})}),Bs.each(["wakeup","getAPILevel","getAppJson"],function(t){e[t]=iu(t)}),u("bridgeAdapterWebkitPostMessage",e)}const cu=[Ms,qs,tu,Object.freeze({__proto__:null,checker:ru,isReady:ou,name:"bridgeAdapterWebkitPostMessage",setup:au})];function su(e){if("browser"!==(e||"bridge"))for(let e=0;e<cu.length;e++){const t=cu[e];if(t.checker())return t}}let uu;const lu=new Uint8Array(16);function du(){if(!uu&&(uu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!uu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return uu(lu)}const fu=[];for(let e=0;e<256;++e)fu.push((e+256).toString(16).slice(1));var gu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function pu(e,t,n){if(gu.randomUUID&&!e)return gu.randomUUID();const r=(e=e||{}).random||(e.rng||du)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return fu[e[t+0]]+fu[e[t+1]]+fu[e[t+2]]+fu[e[t+3]]+"-"+fu[e[t+4]]+fu[e[t+5]]+"-"+fu[e[t+6]]+fu[e[t+7]]+"-"+fu[e[t+8]]+fu[e[t+9]]+"-"+fu[e[t+10]]+fu[e[t+11]]+fu[e[t+12]]+fu[e[t+13]]+fu[e[t+14]]+fu[e[t+15]]}(r)}function hu(){c("bridgeCallback",function(){const e=s("BOTBridge"),t={},i="__fn_null";t.emptyCallback=i;const a={},c={};function u(){return"__cb_"+pu().replace(/-/g,"")}function l(e){if(e===i)return!0;const t=a[e];if(!t)return;let n=0;return Bs.each(t,function(e){e&&n++}),!n&&(a[e]=void 0,!0)}t.build=function(e,t){return function({success:e,fail:t,complete:n},r){void 0===r&&(r=u());const o={success:e,fail:t,complete:n||function(){}};return a[r]=o,l(r)?i:r}(e||{},t)},t.buildDataCallback=function(e,n){const{success:r,fail:i,complete:a}=e||{};return t.build({success:function(e){if(r){try{e.data&&(e.data=JSON.parse(e.data))}catch(e){o("e")}return r(e)}},fail:i,complete:function(e){if(a)return e.data&&void 0===e.error&&(e.data=JSON.parse(e.data)),a(e)}},n)},t.hint=function(e){e=function(e){let t="";for(let n=0;n<e.length;n++)e[n]>="A"&&e[n]<="z"&&(t+=e[n]);return t}(e);const t=u();return t.substring(0,5)+e.substring(0,12)+"_"+t.substring(t.length-5-12-1)},t.invoke=function(e,t,o){if(e===i)return;if("publish"===t){if(n("call "+t+" "+e,[o,c[e]]),void 0===c[e])return;return void Bs.each(c[e],function(e){e&&setTimeout(function(){e.apply(void 0,o||[])},0)})}const s=a[e];if(!s)return void r("?? "+t+" "+e,o);const u=s[t];u?(s[t]=void 0,n("call "+t+" "+e,[u,o]),setTimeout(function(){u.apply(void 0,o||[])},0),l(e)):l(e)},t.subscribe=function(e,t){void 0===c[e]&&(c[e]={}),c[e][t]=t};const d=function(e,n,r){t.invoke(e,n,r)};if(void 0!==e()){const t=e();t.overrideMethod?t.overrideMethod("callback",d):t.callback=d}return window.BOTBridgeCallback=d,t})}var mu=Ds("Advertisement",["createFloatingAd","onFloatingAdLoad","onFloatingAdError","onFloatingAdClose","onFloatingAdClick","showFloatingAd","hiddenFloatingAd","createRewardedAd","setRewardedAdListener","loadRewardedAd","showRewardedAd","createNativeAd","setNativeAdListeners","loadNativeAd","showNativeAd","destroyNativeAd","hiddenNativeAds","visibleNativeAds","loadCustomAd","showCustomAd","destroyCustomAd","hiddenCustomAds","visibleCustomAds"]);var bu=Ds("Camera",["scanCode","getOcrResultFromCamera","getOcrResultFromGallery"]);var vu=Ds("Contact",["getContact","chooseContact","getContacts","chooseContacts","chooseGroups"]);var yu=Ds("Device",["vibrateShort","vibrateLong","setClipboardData","getClipboardData","onKeyboardPop","allowContentOffSet","setKeepScreenOn"]);var Su=Ds("File",["chooseImage","uploadImage","onImageProgressUpdate","onImageUpdateStatus","chooseFile","uploadFile","cancelUploadFile","setFileUpdateListener","downloadFile","cancelDownloadFile","setFileDownloadListener","loadResource","openDocument","saveFile"]);var wu=Ds("Location",["getLocation","operateCompass","compassChange","onCompassChange","getMapData","getStaticMap","openNavigationPage"]);var Au=Ds("Media",["playVoice","stopVoice","saveImageToPhotosAlbum"]);var ku=Ds("OfficialAccount",["setSubscription","getSubscription","getMuteStatus","setMuteStatus","getNewsLetterStatus","setNewsLetterStatus"]);var Ou=Ds("Pay",["requestPayment","setUpCashier","applyConsumeDiamond","consumeDiamonds"]);function Iu(){c("bridgeBrowserPay",function(){var e={},t="pay bridge not available on browser";return e.requestPayment=Ps(t),e.setUpCashier=Ps(t),e.applyConsumeDiamond=Ps(t),e}),Ou.exportable("bridgeBrowserPay")}var Cu=Ds("PayBySDK",["paybyOpenUrl","paybyGetDefaultPaymentMethod","paybyGetLatestPaymentMethod","paybyChoosePaymentMethod","paybyToPay"]);var Nu=Ds("RTCSDK",["newRTC","initEngine","isInited","destroyEngine","updateToken","joinRoom","leaveRoom","changeAudioDevice","getAudioDevice","enableLocalAudio","enableLocalVideo","muteLocalAudioStream","muteLocalVideoStream","muteRemoteAudioStream","muteRemoteVideoStream","muteAllRemoteAudioStream","muteAllRemoteVideoStream","switchCamera","setupVideo","sendAppMessage","getSpeakingLevel","getSdkVersion","setBackgroundImage","getNetworkState","getConnectState","showDebugView","getVoipState","updateConfiguration","pauseStream","resumeStream","sendAppSignal","getRoomInfo","getAllPluginTools","callPluginTool","addRtcEventListener"]);var Tu=Ds("Share",["share","shareContent","shareCustomizeCard","disableShare","shareText","shareFile"]);function Bu(){c("bridgeBrowserShare",function(){var e={},t="share bridge not available on browser";return e.share=Ps(t),e.shareContent=Ps(t),e.shareCustomizeCard=Ps(t),e.disableShare=function(){},e.shareText=Ps(t),e.shareFile=Ps(t),e}),Tu.exportable("bridgeBrowserShare")}var Lu=Ds("SolarSDK",["newSolar","solarLoginApp","solarJoinRoom","solarLeaveRoom","solarAudioActive","solarVideoActive","solarSwitchSpeaker","solarLogout","solarMuteRemoteAudioStream","solarChangeRemoteVideoStream","solarVideoHDAvailable","solarVideoHDType","solarSwitchHD","solarSwitchLD","solarSwitchCamera","solarSendAppMessage","addSolarEngineListener","addSolarEventListener","solarMicEnable","getSolarLifeCycle","solarSetupVideo","solarApplyMic","solarCancelMic","solarConfirmApplyMic","solarInviteMic","solarCancelInviting","solarInviteConfirm","solarKickoutMic","solarLayDownMic"]);var Pu=Ds("TitleBar",["setTitleBarBackButton","clearTitleBar","setTitleBarText","setTitleBarTextColor","setTitleBarBgColor","setTitleBarRightTextButton","setTitleBarMoreMenu","setTitleBarStyle","setTitleBar"]);function Ru(){c("bridgeBrowserTitleBar",function(){var e={},t="titlebar bridge not available on browser";return e.setTitleBarBackButton=Ps(t),e.clearTitleBar=Ps(t),e.setTitleBarText=Ps(t),e.setTitleBarTextColor=Ps(t),e.setTitleBarBgColor=Ps(t),e.setTitleBarStyle=Ps(t),e.setTitleBarRightTextButton=Ps(t),e.setTitleBarMoreMenu=Ps(t),e.setTitleBar=Ps(t),e}),Pu.exportable("bridgeBrowserTitleBar")}var Ju=Ds("WebSocket",["connectSocket","socketClose","onSocketClose","onSocketError","onSocketMessage","onSocketOpen","socketSend","checkAllSocket","checkSocket","socketEnable","socketPool","socketPing","onSocketPong"]);var Du=Ds("SocketIO",["socketIoConnect","socketIoSend","socketIoEnable","socketIoClose","socketIoPool","onSocketIoConnect","onSocketIoDisconnect","onSocketIoError","onSocketIoMessage","addSocketIOEventListener"]);var _u=Ds("Navigator",["navigateTo","redirectTo","getPageQuery","getPublicNavigateUrl","getUrlWithPayload","setNavigationBarTitle","closeAll","navigateBack","navigateBackWithResult","closeCurrent","startMiniProgramWithResult","startShare","reLaunch","navigateToPlus"]);function xu(){c("bridgeBrowserNavigator",function(){var e=s("Environment"),t={},n="now browser",r=function(t){var n=e.App();return n.external&&n.external[t]?n.external[t]:t};return t.navigateTo=function(e){var n,r=t.getUrlWithPayload(e);return n=r,void(window.location.href=n)},t.navigateBack=function(){return history.go(-1)},t.navigateBackWithResult=Ps(n),t.redirectTo=function(e){var n,r=t.getUrlWithPayload(e);return n=r,void window.location.replace(n)},t.closeAll=function(){window.close()},t.closeCurrent=function(){window.close()},t.getPageQuery=function(e){var t=new URLSearchParams(window.location.hash.substring(2));return e?t.get(e)?t.get(e):void 0:t},t.getUrlWithPayload=function(e){if("string"==typeof e)return r(e);var{url:n,payload:o}=e;return r(n)+t.buildSearchHash(o)},t.buildSearchHash=function(e){return e?"#!?"+function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(e):""},t.getPublicNavigateUrl=function(e){var n=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),r=window.location.protocol+"//"+window.location.host+n+"/";return"string"==typeof e?r+e:r+t.getUrlWithPayload(e)},t.setNavigationBarTitle=function(e){window.document.title=e},t.startMiniProgramWithResult=Ps(n),t.startShare=Ps(n),t.reLaunch=Ps(n),t}),_u.exportable("bridgeBrowserNavigator")}var Mu=Ds("Network",["request","baseRequest","browserSetDefaultHeader","getNetworkType","onNetworkStatusChange"]);function Eu(){c("bridgeBrowserNetwork",function(){const e=s("Environment"),t={},r={};let o;return t.browserSetDefaultHeader=function(e){e&&Bs.each(e,function(e,t){r[t]!==e&&(r[t]=e)})},t.request=function(t,i){let a=t.url,c=t.data;const s=t.header;let u=t.method,l=t.success,d=t.fail,f=t.complete;i&&(i.success&&(l=i.success),i.fail&&(d=i.fail),i.complete&&(f=i.complete)),function(){if(void 0!==o||!e.App)return;const t=e.App();t.app&&(o={},o["MP-APP"]=t.app,o["MP-VERSION"]=t.version+"/"+t.platform,o["MP-BUILD"]=t.date)}(),u||(u="GET");const g=void 0===e.App?"":e.App().url;let p;n("send request "+u,[a,c]),g&&0!==!a.indexOf(g)&&(a=g+a),/^(GET|OPTIONS|HEAD|PUT|DELETE)$/.test(u)&&(p=c,c=void 0);const h={};r&&Bs.merge(h,r),s&&Bs.merge(h,s),o&&Bs.merge(h,o);let m=a;if(p){const e=[];for(const t in p)p.hasOwnProperty(t)&&null!=p[t]&&e.push(encodeURIComponent(t)+"="+encodeURIComponent(p[t]));e.length&&(m+="?"+e.join("&"))}const b={method:u,headers:h};c&&(h["Content-Type"]="application/json",b.body=JSON.stringify(c)),fetch(m,b).then(function(e){const t=e.status;return e.text().then(function(e){let n=e;try{n=JSON.parse(e)}catch(e){}return{data:n,status:t}})}).then(function(e){e.status>=200&&e.status<300?l&&l(e):d&&d(e),f&&f(e)}).catch(function(e){const t={status:0,data:e.message||"Network Error"};d&&d(t),f&&f(t)})},t.baseRequest=t.request,t.getNetworkType=function(e){const t=e&&e.success,n=e&&e.complete,r={data:{networkType:navigator.onLine?"wifi":"none"}};t&&t(r),n&&n(r)},t}),Mu.exportable("bridgeBrowserNetwork")}var Fu=Ds("LifeCycle",["onLaunch","onShow","onStop","onDestroy","onRestart","onFinish","onPageResult"]);function ju(){c("bridgeBrowserLifeCycle",function(){var e=s("Environment"),t={},n="now browser",r={},o={};return t._lock=function(e){r&&(r[e]=(r[e]||0)+1)},t._unlock=function(e){if(r){for(var t in r[e]=(r[e]||1)-1,r){if(r[t])return}r=void 0,Bs.each(o,function(e){e()}),o=void 0}},t.onLaunch=function(e){if(!r)return e();o[e]=e},t.onShow=function(e){if(!r)return e();o[e]=e},t.onLaunch(function(){e.isAndroid()&&document.documentElement.setAttribute("os","android"),e.isiOS()&&document.documentElement.setAttribute("os","ios")}),t.onStop=Ps(n),t.onDestroy=Ps(n),t.onRestart=Ps(n),t.onFinish=Ps(n),t}),Fu.exportable("bridgeBrowserLifeCycle")}var Uu=Ds("Storage",["setStorage","setStorageSync","getStorage","getStorageSync","clearStorage","clearStorageSync","removeStorage","removeStorageSync","getDataFromDV"]);function Vu(){c("bridgeBrowserStorage",function(){var e,t=s("Environment"),n={},r=function(n){return void 0===e&&(e=t.App()),e.app+"/"+n};return n.setStorage=function(e,t,r){var o=r&&r.success,i=r&&r.fail,a=r&&r.complete;try{n.setStorageSync(e,t),o&&o(),a&&a()}catch(e){var c={error:e};i&&i(c),a&&a(c)}},n.setStorageSync=function(e,t){if(void 0!==t){var n=JSON.stringify(t);window.localStorage.setItem(r(e),n)}else window.localStorage.removeItem(r(e))},n.getStorage=function(e,t){var r=t&&t.success,o=t&&t.fail,i=t&&t.complete;try{var a={data:n.getStorageSync(e)};r&&r(a),i&&i(a)}catch(e){var c={error:e};o&&o(c),i&&i(c)}},n.getStorageSync=function(e){var t=window.localStorage.getItem(r(e));return JSON.parse(t)},n.clearStorage=function(e){var t=e&&e.success,r=e&&e.fail,o=e&&e.complete;try{n.clearStorageSync(),t&&t(),o&&o()}catch(e){var i={error:e};r&&r(i),o&&o(i)}},n.clearStorageSync=function(){for(var e=r(""),t=[],n=0;n<localStorage.length;n++)0===window.localStorage.key(n).indexOf(e)&&t.push(window.localStorage.key(n));for(n=0;n<t.length;n++)window.localStorage.removeItem(t[n])},n.removeStorage=function(e,t){n.setStorage(e,void 0,t)},n.removeStorageSync=function(e){n.setStorageSync(e,void 0)},n.getDataFromDV=Ps("now browser"),n}),Uu.exportable("bridgeBrowserStorage")}var zu=Ds("Environment",["isChrome","isAndroid","isiOS","getDisplayWidth","getDisplayHeight","App","doLogin","forceDoLogin","isLogined","onPageReady","onLazy","onPageFatal","getUserInfo","onFrameworkReady","getAuthcode","checkAPILevel","getClientInfo","isRtl","getLanguageSync","getDisplayInfoSync","getVipStatusSync","getPath","checkAppExistSync","mpTrack","thirdPartyLogin","loginResult","requestUpgrade","onThemeChange","logEvent","nativeCall","setButtonAction","saveToFavorite","hideKeyboard","mpTrackCVR","addAttribution","shareMiniProgramCard","openKYCFlow","checkAccessGuard","getTranslationText","getTranslation","getTranslations","getI18nString"]);function Hu(){c("bridgeBrowserEnvironment",function(){const e=s("bridgeBrowserLifeCycle"),t=s("bridgeBrowserNetwork"),r=s("Network"),i=s("Storage"),a=s("BOTBridge"),c={},u="now browser",l={url:""},d=navigator.userAgent,f=/Chrome/.test(d),g=d.indexOf("Android")>-1||d.indexOf("Adr")>-1,p=!!d.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);c.isChrome=function(){return f},c.isAndroid=function(){return g},c.isiOS=function(){return p},c.getDisplayWidth=function(){return window.innerWidth},c.getDisplayHeight=function(){return window.innerHeight},c.isRtl=function(){return!1},c.App=function(e){return void 0!==e&&Object.assign(l,e),l},c.loadAppJson=function(){const n="browserLoadAppJson";e._lock(n),t.request({url:"app.json",headers:{"Cache-Control":"no-cache"},success:function(t){try{c.App(t.data)}catch(e){alert("browser launch failed, "+e)}e._unlock(n)},fail:function(){}})};const h=function(){const e={uid:"b_"+pu(),token:pu()};try{const n=i.getStorageSync("uid");n&&(n.uid&&(e.uid=n.uid),n.token&&(e.token=n.token),n.appToken&&t.browserSetDefaultHeader({Authorization:n.appToken}))}catch(e){}return e};let m=!1;return c.onLaunchBrowserLogin=function(e){const n=e&&e.success,o=e&&e.fail,a=e&&e.complete;if(m)return n&&n(),void(a&&a());const c=h();r.request({url:"/api/auth/exchange",method:"POST",data:c,header:{Authorization:""},success:function(e){const r=e.data.token;t.browserSetDefaultHeader({Authorization:r}),c.appToken=r,i.setStorage("uid",c),m=!0,n&&n(),a&&a()},fail:function(e){const t={error:"http "+e.status};o&&o(t),a&&a(t)}})},c.doLogin=c.onLaunchBrowserLogin,c.forceDoLogin=c.onLaunchBrowserLogin,c.isLogined=function(){return m},c.onPageReady=function(){},c.onLazy=function(){},c.onPageFatal=function(e){o("PAGE FATAL ERROR",e)},c.getUserInfo=function(e){const t=e&&e.success,n=e&&e.complete,r={data:{firstName:h().uid.replace(/(-|_|[0-9])/g,""),lastName:"BOTIM User"}};t&&t(r),n&&n(r)},c.getAuthcode=function(e,t){const n=t&&t.success;n&&n({code:""})},c.getClientInfo=function(){return{}},c.getLanguageSync=function(){return{}},c.getDisplayInfoSync=function(){return{}},c.getVipStatusSync=function(){return{}},c.checkAppExistSync=function(){return{}},c.onFrameworkReady=function(){c.loadAppJson()},c.mpTrack=function(e){n("[track]",e.message||e)},c.mpTrackCVR=function(e){n("[mpTrackCVR]",e.message||e)},c.checkAPILevel=a.checkAPILevel,c.addAttribution=Ps(u),c.thirdPartyLogin=Ps(u),c.loginResult=Ps(u),c.requestUpgrade=Ps(u),c.getPath=Ps(u),c.onThemeChange=Ps(u),c.logEvent=Ps(u),c.nativeCall=Ps(u),c.setButtonAction=Ps(u),c.saveToFavorite=Ps(u),c.hideKeyboard=Ps(u),c.openKYCFlow=Ps(u),c.checkAccessGuard=Ps(u),c.getTranslationText=Ps(u),c.getTranslation=Ps(u),c.getTranslations=Ps(u),c.getI18nString=Ps(u),c}),zu.exportable("bridgeBrowserEnvironment")}function Ku(){ju(),Eu(),Vu(),Hu(),xu(),c("bridgeBrowserContact",function(){var e={},t="contact bridge not available on browser";return e.chooseContact=Ps(t),e.getContact=Ps(t),e.getContacts=Ps(t),e.chooseContacts=Ps(t),e.chooseGroups=Ps(t),e}),vu.exportable("bridgeBrowserContact"),Iu(),Ru(),Bu(),c("bridgeBrowserOfficialAccount",function(){var e={},t="officialaccount bridge not available on browser";return e.setSubscription=Ps(t),e.getSubscription=Ps(t),e.getMuteStatus=Ps(t),e.setMuteStatus=Ps(t),e.getNewsLetterStatus=Ps(t),e.setNewsLetterStatus=Ps(t),e}),ku.exportable("bridgeBrowserOfficialAccount"),c("bridgeBrowserPayBySDK",function(){var e={},t="paybysdk bridge not available on browser";return e.paybyOpenUrl=Ps(t),e.paybyGetDefaultPaymentMethod=Ps(t),e.paybyChoosePaymentMethod=Ps(t),e.paybyToPay=Ps(t),e.paybyGetLatestPaymentMethod=Ps(t),e}),Cu.exportable("bridgeBrowserPayBySDK"),c("bridgeBrowserDevice",function(){var e={},t="device bridge not available on browser";return e.vibrateShort=Ps(t),e.vibrateLong=Ps(t),e.setClipboardData=Ps(t),e.getClipboardData=Ps(t),e.onKeyboardPop=Ps(t),e.allowContentOffSet=function(){},e.setKeepScreenOn=function(){},e}),yu.exportable("bridgeBrowserDevice"),c("bridgeBrowserCamera",function(){var e={},t="camera bridge not available on browser";return e.scanCode=Ps(t),e.getOcrResultFromCamera=Ps(t),e.getOcrResultFromGallery=Ps(t),e}),bu.exportable("bridgeBrowserCamera"),c("bridgeBrowserFile",function(){var e={},t="file bridge not available on browser";return e.chooseImage=Ps(t),e.uploadImage=Ps(t),e.onImageProgressUpdate=Ps(t),e.onImageUpdateStatus=Ps(t),e.chooseFile=Ps(t),e.uploadFile=Ps(t),e.cancelUploadFile=Ps(t),e.setFileUpdateListener=Ps(t),e.downloadFile=Ps(t),e.cancelDownloadFile=Ps(t),e.setFileDownloadListener=Ps(t),e.loadResource=Ps(t),e.openDocument=Ps(t),e.saveFile=Ps(t),e}),Su.exportable("bridgeBrowserFile"),c("bridgeBrowserLocation",function(){var e={},t="location bridge not available on browser";return e.getLocation=Ps(t),e.operateCompass=Ps(t),e.compassChange=Ps(t),e.onCompassChange=Ps(t),e.getMapData=Ps(t),e.getStaticMap=Ps(t),e.openNavigationPage=Ps(t),e}),wu.exportable("bridgeBrowserLocation"),c("bridgeBrowserAdvertisement",function(){var e={},t="advertisement bridge not available on browser";return e.createFloatingAd=Ps(t),e.onFloatingAdLoad=Ps(t),e.onFloatingAdError=Ps(t),e.onFloatingAdClose=Ps(t),e.onFloatingAdClick=Ps(t),e.showFloatingAd=Ps(t),e.hiddenFloatingAd=Ps(t),e.createRewardedAd=Ps(t),e.setRewardedAdListener=Ps(t),e.loadRewardedAd=Ps(t),e.showRewardedAd=Ps(t),e.createNativeAd=Ps(t),e.setNativeAdListeners=Ps(t),e.loadNativeAd=Ps(t),e.showNativeAd=Ps(t),e.destroyNativeAd=Ps(t),e.hiddenNativeAds=Ps(t),e.visibleNativeAds=Ps(t),e.loadCustomAd=Ps(t),e.showCustomAd=Ps(t),e.destroyCustomAd=Ps(t),e.hiddenCustomAds=Ps(t),e.visibleCustomAds=Ps(t),e}),mu.exportable("bridgeBrowserAdvertisement"),c("bridgeBrowserSolarSdk",function(){var e={},t="solarsdk bridge not available on browser";return e.newSolar=Ps(t),e.solarLoginApp=Ps(t),e.solarJoinRoom=Ps(t),e.solarLeaveRoom=Ps(t),e.solarAudioActive=Ps(t),e.solarSwitchSpeaker=Ps(t),e.solarLogout=Ps(t),e.solarMuteRemoteAudioStream=Ps(t),e.addSolarEngineListener=Ps(t),e.addSolarEventListener=Ps(t),e.getSolarLifeCycle=Ps(t),e.solarMicEnable=Ps(t),e.solarVideoActive=Ps(t),e.solarChangeRemoteVideoStream=Ps(t),e.solarVideoHDAvailable=Ps(t),e.solarVideoHDType=Ps(t),e.solarSwitchHD=Ps(t),e.solarSwitchLD=Ps(t),e.solarSwitchCamera=Ps(t),e.solarSendAppMessage=Ps(t),e.solarSetupVideo=Ps(t),e.solarApplyMic=Ps(t),e.solarCancelMic=Ps(t),e.solarConfirmApplyMic=Ps(t),e.solarInviteMic=Ps(t),e.solarCancelInviting=Ps(t),e.solarInviteConfirm=Ps(t),e.solarKickoutMic=Ps(t),e.solarLayDownMic=Ps(t),e}),Lu.exportable("bridgeBrowserSolarSdk"),c("bridgeBrowserWebsocket",function(){var e={},t="websocket bridge not available on browser";return e.connectSocket=Ps(t),e.onSocketClose=Ps(t),e.onSocketError=Ps(t),e.onSocketMessage=Ps(t),e.onSocketOpen=Ps(t),e.socketClose=Ps(t),e.socketSend=Ps(t),e.socketEnable=Ps(t),e.socketPool=Ps(t),e.onSocketPong=Ps(t),e.socketPing=Ps(t),e.checkAllSocket=Ps(t),e.checkSocket=Ps(t),e}),Ju.exportable("bridgeBrowserWebsocket"),c("bridgeBrowserSocketIO",function(){var e,t,r={},i="now browser",a={};return r.socketIoEnable=Ps(i),r.socketIoPool=Ps(i),r.onSocketIoError=Ps(i),r.addSocketIOEventListener=Ps(i),r.socketIoConnect=function(n){if(null==e&&(e=n.io),!e)throw"socketio-client implementation not found!";var r=JSON.parse(n.header).token,o=JSON.parse(n.query);a.conf=n,(t=e(n.url,{path:n.path,auth:{token:r},query:o})).on("connect",function(){a.onopen&&a.onopen()}),t.on("broadcastMessage",function(e){a.onmessage&&a.onmessage(e)}),t.on("disconnect",function(){a.onclose&&a.onclose()})},r.onSocketIoDisconnect=function(e){n("register onSocketIoDisconnect",arguments),t?t.on("disconnect",function(){n("socketIO onclose"),e()}):a.onclose=e},r.socketIoClose=function(e){if(t){if(e.url&&e.url!=a.conf.url)return void o("socketIoSend url mismatched");t.disconnect(),t=void 0}a={}},r.socketIoSend=function(e,r){n("socketIoSend",arguments);var i=r&&r.success,c=r&&r.fail;if(t){if(e.url&&e.url!=a.conf.url)return o("socketIoSend url mismatched"),void(c&&c());t.emit("socketIoEvent",JSON.stringify(e),function(){i&&i()})}else c&&c()},r.onSocketIoConnect=function(e){n("register onSocketIoConnect",arguments),t?t.on("connect",function(){n("socketIO onopen"),e()}):a.onopen=e},r.onSocketIoMessage=function(e){n("register onSocketIoMessage"),a.onmessage=function(t){e({data:{url:a.conf.url,message:t}})}},r}),Du.exportable("bridgeBrowserSocketIO"),c("bridgeBrowserMedia",function(){var e={},t="media bridge not available on browser";return e.playVoice=Ps(t),e.stopVoice=Ps(t),e.saveImageToPhotosAlbum=Ps(t),e}),Au.exportable("bridgeBrowserMedia"),c("bridgeBrowserRTCSdk",function(){var e={},t="rtc sdk bridge not available on browser";return e.newRTC=Ps(t),e.initEngine=Ps(t),e.isInited=Ps(t),e.destroyEngine=Ps(t),e.updateToken=Ps(t),e.joinRoom=Ps(t),e.leaveRoom=Ps(t),e.changeAudioDevice=Ps(t),e.getAudioDevice=Ps(t),e.enableLocalAudio=Ps(t),e.enableLocalVideo=Ps(t),e.muteLocalAudioStream=Ps(t),e.muteLocalVideoStream=Ps(t),e.muteRemoteAudioStream=Ps(t),e.muteRemoteVideoStream=Ps(t),e.muteAllRemoteAudioStream=Ps(t),e.muteAllRemoteVideoStream=Ps(t),e.switchCamera=Ps(t),e.setupVideo=Ps(t),e.sendAppMessage=Ps(t),e.addRtcEventListener=Ps(t),e.getSpeakingLevel=Ps(t),e.getSdkVersion=Ps(t),e.setBackgroundImage=Ps(t),e.getNetworkState=Ps(t),e.getConnectState=Ps(t),e.showDebugView=Ps(t),e.getVoipState=Ps(t),e.updateConfiguration=Ps(t),e.pauseStream=Ps(t),e.resumeStream=Ps(t),e.sendAppSignal=Ps(t),e.getRoomInfo=Ps(t),e.getAllPluginTools=Ps(t),e.callPluginTool=Ps(t),e}),Nu.exportable("bridgeBrowserRTCSdk")}function Wu(){ju(),Eu(),Vu(),Hu(),xu(),Ru(),Iu(),Bu(),c("bridgeLifecycle",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=s("bridgeBrowserLifeCycle"),o=s("Environment");if(void 0===e()||!e().getEnvironment||!e().getEnvironment())return r("BOTBridge.ENVIRONMENT is null, use bridgeBrowserLifeCycle instead!"),n;const i={};let a={};return t.build({complete:function(){const e=a;a=!1,Bs.each(e,function(e){e()})}},"onLaunch"),i.onLaunch=function(t){if(!a)return t();a[t]=t,e().wakeup()},i.onShow=function(e){t.subscribe("onShow",e)},i.onStop=function(e){t.subscribe("onStop",e)},i.onDestroy=function(e){t.subscribe("onDestroy",e)},i.onRestart=function(e){t.subscribe("onRestart",e)},i.onFinish=function(e){t.subscribe("onFinish",e)},i.onLaunch(function(){o.isAndroid()&&document.documentElement.setAttribute("os","android"),o.isiOS()&&document.documentElement.setAttribute("os","ios")}),i.onPageResult=function(e){t.subscribe("onPageResult",e)},i}),Fu.exportable("bridgeLifecycle"),c("bridgeNetwork",function(){const e=s("BOTBridge"),t=s("bridgeBrowserNetwork"),n=s("$BRIDGEKIT"),o=s("bridgeCallback");let i=0,a=[];const c=!(void 0===e()||!e().getNetwork)&&e().getNetwork();if(!c)return r("NETWORK is null, use bridgeBrowserNetwork instead!"),t;const u={};function l(e,r){if(i++,e.method||(e.method="GET"),!n.checkImpl(c,"baseRequest"))return t.baseRequest(e),void d();const a=o.buildDataCallback({...e,complete:t=>{e.complete&&e.complete(t),d()}},o.hint("baseRequest"));c.baseRequest(JSON.stringify({method:e.method,url:e.url,data:e.data,header:e.header,timeout:e.timeout}),a)}function d(){if(i--,a.length>0){const{requestParams:e,callback:t}=a.shift();l(e)}}return u.browserSetDefaultHeader=t.browserSetDefaultHeader,u.request=function({url:e,data:n,header:r,method:o,timeout:i,success:a,fail:c,complete:s},l){let d={success:a,fail:c,complete:s};return d={...d,...l},o||(o="GET"),"GET"===o||"POST"===o?u.baseRequest({url:e,data:n,header:r,method:o,timeout:i,...d}):t.request({url:e,data:n,header:r,method:o,...d})},u.baseRequest=function({url:e,data:t,header:n,method:r,timeout:o,success:c,fail:s,complete:u},d){let f={success:c,fail:s,complete:u};f={...f,...d};const g={url:e,data:t,header:n,method:r,timeout:o,...f};i<10?l(g):a.push({requestParams:g,callback:d})},u.getNetworkType=function(e){const t=o.build(e,o.hint("getNetworkType"));c.getNetworkType(t)},u.onNetworkStatusChange=function(e){o.subscribe("onNetworkStatusChange",e)},u}),Mu.exportable("bridgeNetwork"),c("bridgeStorage",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=s("bridgeBrowserStorage"),o=s("bridgeEnvironment");let i=!(void 0===e()||!e().getLocalStorage)&&e().getLocalStorage();if(i||(i=!(void 0===e()||!e().getStorage)&&e().getStorage()),!i)return r("STORAGE is null, use bridgeBrowserStorage instead!"),n;const a={},c=function(e,n){return t.hint(e.substring(0,4)+"_"+(n||""))};return a.setStorage=function(e,n,r){const o=t.build(r,c("setStorage",e));try{if(void 0!==n){const t=JSON.stringify(n);i.setStorage(e,t,o)}else i.removeStorage(e,o)}catch(e){const n={error:e};t.invoke(o,"fail",[n]),t.invoke(o,"complete",[n])}},a.setStorageSync=function(n,r){if(void 0===r){if(e.checkImpl(i,"removeStorageSync"))return i.removeStorageSync(n);if(e.checkImpl(i,"removeStorage"))return i.removeStorage(n,t.emptyCallback)}const o=JSON.stringify(r);if(e.checkImpl(i,"setStorageSync"))return i.setStorageSync(n,o);i.setStorage(n,o,null)},a.getStorage=function(e,n){const r=t.buildDataCallback(n,c("getStorage",e));try{return i.getStorage(e,r)}catch(e){const n={error:e};t.invoke(r,"fail",[n]),t.invoke(r,"complete",[n])}},a.getStorageSync=function(t){let n;return n=e.checkImpl(i,"getStorageSync")?i.getStorageSync(t):i.getStorage(t,null),null===n||""===n?n:JSON.parse(n)},a.clearStorage=function(e){const n=t.build(e,c("clearStorage",""));try{i.clearStorage(n)}catch(e){const r={error:e};t.invoke(n,"fail",[r]),t.invoke(n,"complete",[r])}},a.clearStorageSync=function(){if(e.checkImpl(i,"clearStorageSync"))return i.clearStorageSync();i.clearStorage(null)},a.removeStorage=function(n,r){if(e.checkImpl(i,"removeStorage")){const e=t.build(r,c("removeStorage",""));return i.removeStorage(n,e)}return a.setStorage(n,void 0,r)},a.removeStorageSync=function(t){return e.checkImpl(i,"removeStorageSync")?i.removeStorageSync(t):a.setStorageSync(t,void 0)},a.getDataFromDV=function({key:e},n){const{success:r,fail:a,complete:c}=n||{},s=t.build({success:function(e){r&&("string"==typeof e.data&&(e.data=JSON.parse(e.data),e.data.userInfo&&(e.data.value=e.data.userInfo)),r(e))},fail:a,complete:c},t.hint("getDataFromDV"));o.isiOS()?i.getDataFromDV(e,s):i.getDataFromDV(JSON.stringify({key:e}),s)},a}),Uu.exportable("bridgeStorage"),c("bridgeEnvironment",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=s("bridgeBrowserEnvironment"),i=s("Network"),a=s("$BRIDGEKIT"),c=!(void 0===e()||!e().getEnvironment)&&e().getEnvironment();if(!c)return r("BOTBridge is null, use bridgeBrowserEnvironment instead!"),n;const u={};let l;const d=function(e,n,r){if(!n)return r;const o=t.hint(e);return t.subscribe(o,n),o},f=function(e){return"true"===e};u.isChrome=function(){return c.isChrome()},u.isAndroid=function(){return c.isAndroid()},u.isiOS=function(){return c.isiOS()},u.isRtl=function(){return c.isRtl()},u.getDisplayWidth=function(){return window.innerWidth},u.getDisplayHeight=function(){return window.innerHeight},u.App=function(){return void 0===l&&(l=JSON.parse(e().getAppJson())),l};let g=!1;return u.doLogin=function(e){const{success:n,fail:r,complete:a}=e||{},s=t.build({success:function(e){i.browserSetDefaultHeader({Authorization:e.data.token}),g=!0,n&&n(e)},fail:r,complete:a},t.hint("doLogin"));try{c.doLogin(s)}catch(e){o("bridge doLogin failed",e);const n={error:e};t.invoke(s,"fail",[n]),t.invoke(s,"complete",[n])}},u.forceDoLogin=function({key:e},n){const{success:r,fail:o,complete:a}=n||{},s=t.build({success:function(e){i.browserSetDefaultHeader({Authorization:e.data.token}),g=!0,r&&r(e)},fail:o,complete:a},t.hint("forceDoLogin"));try{c.forceDoLogin(JSON.stringify({key:e}),s)}catch(e){const n={error:e};t.invoke(s,"fail",[n]),t.invoke(s,"complete",[n])}},u.isLogined=function(){return g},u.onPageReady=function(){u.onLazy("pageready")},u.onLazy=function(e){if(a.checkImpl(c,"onLazy"))try{c.onLazy(e)}catch(e){o("onLazy error",e)}},u.onPageFatal=function(e){a.checkImpl(c,"onPageFatal")&&c.onPageFatal(JSON.stringify(e))},u.getUserInfo=function(e){const n=t.build(e,t.hint("getUserInfo"));try{c.getUserInfo(n)}catch(e){const r={error:e};t.invoke(n,"fail",[r]),t.invoke(n,"complete",[r])}},u.getAuthcode=function({state:e,scope:n,redirectUri:r},o){const{success:i,fail:a,complete:s}=o||{};e=e||"",n=n||"default",r||(r=`https://botim.me/mp/b/?app=${u.App().app}`);const l=t.build({success:function(e){i&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),i(e))},fail:a,complete:s},t.hint("getAuthcode"));try{c.getAuthcode(JSON.stringify({state:e,scope:n,redirectUri:r}),l)}catch(e){const n={error:e};t.invoke(l,"fail",[n]),t.invoke(l,"complete",[n])}},u.getClientInfo=Bs.once(function(){return c.isAndroid()?JSON.parse(c.getClientInfo()):c.getClientInfo()}),u.getLanguageSync=Bs.once(function(){return c.getLanguageSync()}),u.getDisplayInfoSync=function(){return c.isAndroid()?JSON.parse(c.getDisplayInfoSync()):c.getDisplayInfoSync()},u.getVipStatusSync=function(){return c.getVipStatusSync()},u.onFrameworkReady=function(){},u.checkAppExistSync=function({name:e}){return c.checkAppExistSync(JSON.stringify({name:e}))},u.getPath=function(e){const n=t.build(e,t.hint("getPath"));try{c.getPath(n)}catch(e){const r={error:e};t.invoke(n,"fail",[r]),t.invoke(n,"complete",[r])}},u.mpTrack=function({message:e}){return c.mpTrack(JSON.stringify({message:e}))},u.mpTrackCVR=function({message:e}){return c.mpTrackCVR(JSON.stringify({message:e}))},u.getTranslationText=function(e){return c.getTranslationText(e)},u.getTranslation=function(e){return c.getTranslationText(e)},u.getTranslations=function(e){const t={};for(const n of e)t[n]=u.getTranslationText(n);return t},u.getI18nString=function(e,t){return t&&""!==t?c.getI18nString(e,t):u.getTranslationText(e)},u.checkAccessGuard=function({type:e},n){const r=t.build(n,t.hint("checkAccessGuard"));c.checkAccessGuard(JSON.stringify({type:e}),r)},u.addAttribution=function({type:e,data:n},r){const o=t.build(r,t.hint("addAttribution"));c.addAttribution(JSON.stringify({type:e,data:n}),o)},u.thirdPartyLogin=function({state:e,scope:n,redirectUri:r},o){const i=t.build(o,t.hint("thirdPartyLogin"));c.thirdPartyLogin(JSON.stringify({state:e,scope:n,redirectUri:r}),i)},u.loginResult=function({token:e,uid:n},r){const o=t.build(r,t.hint("loginResult"));c.loginResult(JSON.stringify({token:e,uid:n}),o)},u.requestUpgrade=function({appId:e},n){const r=t.build(n,t.hint("requestUpgrade"));c.requestUpgrade(JSON.stringify({appId:e}),r)},u.onThemeChange=function(e){t.subscribe("onThemeChange",e)},u.checkAPILevel=e.checkAPILevel,u.logEvent=function({message:e,type:t}){return c.logEvent(JSON.stringify({message:e,type:t}))},u.nativeCall=function({method:e,parameters:n,callback:r}){const{success:o,fail:i,complete:a}=r||{},s=t.build({success:function(t){if(o){if(t&&t.data&&""!==t.data&&"string"==typeof t.data&&(t.data=JSON.parse(t.data)),n&&n.length>0&&t&&t.data&&t.data[n[0]])try{"object"==typeof JSON.parse(t.data[n[0]])&&(t.data[n[0]]=JSON.parse(t.data[n[0]]))}catch(e){return void o(t)}if("Page.getPageResult"===e&&c.isiOS()&&t.data&&(t=t.data),"Business.getUserContacts"===e&&(t.data.data=t.data.data.map(e=>({phoneNumber:{fullNumber:e.uid,components:{countryCode:e.countryCode,localNumber:e.phone}},name:e.name,avatarText:e.txt_avatar,profilePhotoUrl:e.profile_photo_url,lastContactedAt:e.last_contacted_at}))),"Payby.openNative"===e&&n&&JSON.parse(n)&&JSON.parse(n).router&&JSON.parse(n).router.includes("startEidKyc"))if(c.isAndroid())try{const e=JSON.parse(JSON.parse(t.data.result).result);t.data={verifyFinished:f(e.verifyFinished),kycType:e.kycType.toLowerCase(),kycStatus:e.kycStatus.toLowerCase()}}catch(e){t.data={verifyFinished:!1}}else try{const e=t.data.result;t.data={verifyFinished:f(e)}}catch(e){t.data={verifyFinished:!1}}o(t)}},fail:function(e){"string"==typeof e&&(e=JSON.parse(e)),i(e)},complete:a},t.hint("nativeCall"));"Diagnosis.addUdpEventListener"===e||"Diagnosis.addBwEventListener"===e?(n[1]&&n[1].onUdpTestReport&&(n[1].onUdpTestReport=d("onUdpTestReport",n[1].onUdpTestReport)),n[1]&&n[1].onUdpTestFinish&&(n[1].onUdpTestFinish=d("onUdpTestFinish",n[1].onUdpTestFinish)),n[1]&&n[1].onBwTestReport&&(n[1].onBwTestReport=d("onBwTestReport",n[1].onBwTestReport)),n[1]&&n[1].onBwTestFinish&&(n[1].onBwTestFinish=d("onBwTestFinish",n[1].onBwTestFinish)),n[1]=JSON.stringify(n[1]),c.nativeCall(JSON.stringify({method:e,parameters:n,fnCallback:s}))):"MixCall.addMixCallListener"===e?(n[1]&&n[1].mixSignalChange&&(n[1].mixSignalChange=d("mixSignalChange",n[1].mixSignalChange)),n[1]&&n[1].mixDebugInfo&&(n[1].mixDebugInfo=d("mixDebugInfo",n[1].mixDebugInfo)),n[1]&&n[1].networkQuality&&(n[1].networkQuality=d("networkQuality",n[1].networkQuality)),n[1]&&n[1].audioDeviceChanged&&(n[1].audioDeviceChanged=d("audioDeviceChanged",n[1].audioDeviceChanged)),n[1]&&n[1].onErrorOccured&&(n[1].onErrorOccured=d("onErrorOccured",n[1].onErrorOccured)),n[1]&&n[1].volumeChanged&&(n[1].volumeChanged=d("volumeChanged",n[1].volumeChanged)),n[1]&&n[1].voiceToText&&(n[1].voiceToText=d("voiceToText",n[1].voiceToText)),n[1]&&n[1].recvFirstAudioFrame&&(n[1].recvFirstAudioFrame=d("recvFirstAudioFrame",n[1].recvFirstAudioFrame)),n[1]&&n[1].notifyAppSignal&&(n[1].notifyAppSignal=d("notifyAppSignal",n[1].notifyAppSignal)),n[1]=JSON.stringify(n[1]),c.nativeCall(JSON.stringify({method:e,parameters:n,fnCallback:s}))):c.nativeCall(JSON.stringify({method:e,parameters:n,fnCallback:s}))},u.shareMiniProgramCard=function({ids:e,cardContent:t},n){const r={channelType:0,ids:e,shareData:{type:42,content:{title:t.title,subTitle:t.content,cover:t.cover,icon:t.appIcon,externalUrl:t.action,cardType:0}}};u.nativeCall({method:"Share.startChannelShare",parameters:[JSON.stringify(r)],callback:n})},u.openKYCFlow=function(e){const t={router:"route://native/kyc/startEidKyc",needCallback:!0};u.nativeCall({method:"Payby.openNative",parameters:[JSON.stringify(t)],callback:e})},u.setButtonAction=function({close:e}){c.setButtonAction(JSON.stringify({close:e}))},u.hideKeyboard=function(){c.hideKeyboard()},u.saveToFavorite=function(t){let n="";n=t?t.appId:u.App().app,n?e().getNavigator().navigateTo(`https://botim.me/mp/b/?app=me.botim.explore.exploremore%2Findex.html%23%2Fcustomize%3Fappid%3D${n}`):r("appid is empty!")},u}),zu.exportable("bridgeEnvironment"),c("bridgeNavigator",function(){const e=s("BOTBridge"),t=s("bridgeBrowserNavigator"),n=s("bridgeCallback"),r=s("bridgeTitleBar"),o=s("bridgeEnvironment"),i=!(void 0===e()||!e().getNavigator)&&e().getNavigator();if(!i)return t;const a={navigateTo:function(e){const n=t.getUrlWithPayload(e);i.navigateTo(n)},redirectTo:function(e){const n=t.getUrlWithPayload(e);i.redirectTo?i.redirectTo(n):i.navigateTo(n)},closeAll:function(){i.closeAll()},closeCurrent:function(){i.closeCurrent()}};return a.getPageQuery=t.getPageQuery,a.getPublicNavigateUrl=function(e){if("string"==typeof e)return i.getPublicNavigateUrl(e);const n=t.getUrlWithPayload(e);return i.getPublicNavigateUrl(n)},a.setNavigationBarTitle=function(n){t.setNavigationBarTitle(n),e.checkImpl(r,"setTitleBarText")&&r.setTitleBarText(n)},a.navigateBack=function(t,n){void 0===t&&void 0===n||!e.checkAPILevel(2)?i.navigateBack():a.navigateBackWithResult(t,n)},a.navigateBackWithResult=function(e,t){t=t||"success",i.navigateBackWithResult(JSON.stringify(e),t)},a.startMiniProgramWithResult=function({url:e,code:t,params:r},o){const{success:a,fail:c,complete:s}=o||{},u=n.build({success:function(e){a&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),a(e))},fail:c,complete:s},n.hint("startMiniProgramWithResult"));i.startMiniProgramWithResult(JSON.stringify({url:e,code:t,params:r}),u)},a.startShare=function({id:e=null,shareData:t={},recentDisabled:n=!1,config:r={},ext:o={}},i){t.content&&(t.content=JSON.stringify(t.content));const c={shareData:t,recentDisabled:n,config:r,ext:o};e&&(c.shareData.shareId=e),e||t.constructor!==Object||0!==Object.keys(t).length||(c.shareData={action:"shareSimple"}),a.startMiniProgramWithResult({url:"https://botim.me/mp/b/?app=me.botim.function.mpsharedialog",code:1e3,params:c},i)},a.reLaunch=function(){i.reLaunch()},a.getUrlWithPayload=t.getUrlWithPayload,a.navigateToPlus=function({url:e},t){const{success:n,fail:r,complete:i}=t||{};if(!e||"string"!=typeof e)return r&&r({errorCode:-1,errorMessage:"url not recognized"}),void(i&&i());try{const t=new URL(e);if("app.payby.com"===t.hostname){const e=t.searchParams.get("ft");if(!e)return r&&r({errorCode:-2,errorMessage:"Payby url missing parameters"}),void(i&&i());const a={token:e};return void o.nativeCall({method:"Payby.openCashDesk",parameters:[JSON.stringify(a)],callback:{success:e=>{let t=e;try{e&&"object"==typeof e&&e.data&&"string"==typeof e.data.result&&(t={result:JSON.parse(e.data.result)})}catch(e){}n&&n({code:200,data:t}),i&&i()},fail:e=>{r&&r(e),i&&i()}}})}e.startsWith("https://botim.me/mp/b/?app=")||e.startsWith("internalbot://botim.me")?a.navigateTo(e):window.location.href=e,n&&n({code:200}),i&&i()}catch(e){r&&r({errorCode:-1,errorMessage:"url not recognized"}),i&&i()}},a}),_u.exportable("bridgeNavigator"),c("bridgeTitleBar",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=s("bridgeBrowserTitleBar"),o=s("bridgeEnvironment"),i=!(void 0===e()||!e().getTitleBar)&&e().getTitleBar();if(!i)return r("TITLEBAR is null, use bridgeBrowserTitleBar instead!"),n;const a={},c=function(e,n){if(!n)return;if("function"!=typeof n)return n+"";const r=t.hint(e);return t.subscribe(r,n),r};return a.setTitleBarBackButton=function(e,t){const n=c("clickTBBack",t);i.setTitleBarBackButton(e,n)},a.clearTitleBar=function(){i.clearTitleBar()},a.setTitleBarText=function(e){i.setTitleBarText(e)},a.setTitleBarTextColor=function(e){i.setTitleBarTextColor(e)},a.setTitleBarBgColor=function(e){i.setTitleBarBgColor(e)},a.setTitleBarRightTextButton=function(e,t){"string"==typeof e&&(e={text:e});const n=c("clickTBTopRight",t);i.setTitleBarRightTextButton(JSON.stringify(e),n)},a.setTitleBarMoreMenu=function(e,t){const n=[];Bs.each(t,function(e){const t=c("clickTBMenu"+n.length,e.fn);n.push({icon:e.icon,title:e.title,fn:t})}),i.setTitleBarMoreMenu(e,JSON.stringify(n))},a.setTitleBarStyle=function(e){const t=Bs.pick(e,["title","titleColor","titlebg"]);e.back&&(t.back=Bs.pick(e.back,["icon","fn"]),t.back.fn=c("clickTBBack",t.back.fn)),e.menu&&e.menu.length&&(t.menu=[],Bs.each(e.menu,function(e){switch(e.type){case"text":{const n=Bs.pick(e,"type","text","fn","color");n.fn=c("clickTBTopRight",n.fn),t.menu.push(n);break}case"more":{let n=[];n=e.fn?["type","moreIcon","fn"]:["type","moreIcon"];const r=Bs.pick(e,...n);r.fn&&(r.fn=c("clickMore",r.fn)),r.list&&(r.list=[],Bs.each(e.list,function(e,t){const n=Bs.pick(e,["icon","title","fn"]);n.fn=c("clickTBMenu"+t,n.fn),r.list.push(n)})),t.menu.push(r);break}}})),i.setTitleBarStyle(JSON.stringify(t))},a.setTitleBar=function({title:e,titleBgColor:t="fff",titleTextColor:n="000000",backIcon:r,isRtl:i,backButtonCallBack:a}){const c=document.getElementById("app"),s=o.getDisplayInfoSync(),u="1"===s.hasNotch?Number(s.notchHeight)/window.devicePixelRatio:(Number(s.notchHeight)+Number(s.statusBarHeight||0))/window.devicePixelRatio,l=o.isAndroid(),d=document.createElement("div"),f=document.createElement("div"),g=u+44/375*(window.screen.width>900?900:window.screen.width),p="height: "+g+"px;z-index:9999;width: 100%;position:fixed;background:#"+t;let h="position: fixed;top:"+u+"px;z-index:9999;height: 1.19rem;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 0.412rem;font-weight: bold;line-height:1.173rem;background:#"+t+";color:#"+n+";";document.getElementById("titleBar")&&document.getElementById("titleBar").remove(),document.getElementById("placeholder")&&document.getElementById("placeholder").remove(),l&&!r&&i&&(h="position: fixed;top:"+u+"px;z-index:9999;height: 1.19rem;right:0.242rem;width:100%;font-size: 0.412rem;font-weight: bold;line-height:1.173rem;background:#"+t+";color:#"+n+";"),d.id="titleBar",d.innerHTML=i&&l?'<div style="'+h+'"> <img id="backBtn" style="width: 0.315rem;height: 0.51rem;transform: rotateY(180deg);margin:0.347rem 0.4rem 0.347rem 0.347rem;" src="'+r+'" alt=""><p style="width:calc(100% - 3.54rem);height: 100%;display: inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">'+e+"</p></div>":i&&!l?'<div style="'+h+'"> <img id="backBtn" style="width: 0.315rem;height: 0.51rem;transform: rotateY(180deg);margin:0.347rem 0.4rem 0.347rem 0.347rem;" src="'+r+'" alt=""><p style="width:calc(100% - 3.54rem);height: 100%;display: inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"> '+e+"</p></div>":l?'<div style="'+h+'"> <img id="backBtn" style="width: 0.315rem;height: 0.51rem; margin: 0.347rem 0.347rem 0.347rem 0.4rem;" src="'+r+'" alt=""><p style="padding-left:15px;max-width:65%;height: 100%;display: inline-block;margin: 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">'+e+"</p></div>":'<div style="'+h+'"> <img id="backBtn" style="width: 0.315rem;height: 0.51rem; margin: 0.347rem 0.347rem 0.347rem 0.4rem;" src="'+r+'" alt=""><p style="max-width:45%;height: 100%;display: inline-block;margin: 0;position: absolute;left: 50%; transform: translateX(-50%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">'+e+"</p></div>",f.id="placeholder",f.innerHTML='<div style="'+p+'"></div>',c.style.paddingTop=g+"px",c.parentElement.append(f,c),c.parentElement.append(d,c);const m=document.getElementById("backBtn");m.style.display=r?"unset":"none",m.onclick=function(){a()}},a}),Pu.exportable("bridgeTitleBar"),c("bridgeContact",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getContact)&&e().getContact();return n?{getContact:function(e,r){const o=t.build(r,t.hint("getContact"));n.getContact(e,o)},chooseContact:function(e){const r=t.build(e,t.hint("chooseContact"));n.chooseContact(r)},getContacts:function(e,r){const o=t.build(r,t.hint("getContacts"));n.getContacts(JSON.stringify(e),o)},chooseContacts:function({count:e,selected:r,title:o,confirmButtonText:i,theme:a,recent:c},s){const{success:u,fail:l,complete:d}=s||{},f=t.build({success:function(e){u&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),u(e))},fail:l,complete:d},t.hint("chooseContacts"));n.chooseContacts(JSON.stringify({count:e,selected:r,title:o,confirmButtonText:i,theme:a,recent:c}),f)},chooseGroups:function({count:e,selected:r,title:o,confirmButtonText:i},a){const{success:c,fail:s,complete:u}=a||{},l=t.build({success:function(e){c&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),c(e))},fail:s,complete:u},t.hint("chooseGroups"));n.chooseGroups(JSON.stringify({count:e,selected:r,title:o,confirmButtonText:i}),l)}}:(r("CONTACT is null"),{})}),vu.exportable("bridgeContact"),c("bridgePay",function(){const e=s("BOTBridge"),t=s("bridgeBrowserPay"),n=s("bridgeCallback"),o=s("bridgeEnvironment"),i=s("bridgeNavigator"),a=s("bridgeLifecycle"),c=!(void 0===e()||!e().getPay)&&e().getPay();return c?{requestPayment:function({tradeId:e,loading:t},r){const{success:i,fail:a,complete:s}=r||{},u=n.build({success:function(t){i&&("string"==typeof t.data&&(t.data=JSON.parse(t.data)),i(t),o.mpTrackCVR({message:{event:"in_app_pch_suc",parameter:{tradeId:e}}}))},fail:function(e){a&&(o.isAndroid()&&"cancel"===e?e={data:{code:-10001}}:o.isAndroid()&&"string"==typeof e&&(e=JSON.parse(e)),a(e))},complete:s},n.hint("requestPayment"));c.requestPayment(JSON.stringify({tradeId:e,loading:t}),u)},setUpCashier:function({tradeId:e,appForIap:t,pidForIAP:r,iapType:o},i){const a=n.build(i,n.hint("setUpCashier"));c.setUpCashier(JSON.stringify({tradeId:e,appForIap:t,pidForIAP:r,iapType:o}),a)},applyConsumeDiamond:function({orderNo:e},t){const{success:n,fail:r}=t||{};i.navigateTo(`https://botim.me/mp/b/?app=me.botim.mix.iapauthorizer%2Findex.html%23%2F%3ForderNo%3D${e}`),a.onShow(()=>{o.nativeCall({method:"Page.getPageResult",parameters:["me.botim.mix.iapauthorizer"],callback:{success:t=>{if(n)try{o.isAndroid()?n(JSON.parse(t.data.value)):n(JSON.parse(t.data.data.value))}catch(t){n({orderNo:e,result:"cancel"})}},fail:e=>{r&&r(e)}}})})},consumeDiamonds:function({orderNo:e},t){const{success:n,fail:r}=t||{};i.navigateTo(`https://botim.me/mp/b/?app=me.botim.game.iapauthorizer%2Findex.html%23%2F%3ForderNo%3D${e}`),a.onShow(()=>{o.nativeCall({method:"Page.getPageResult",parameters:["me.botim.game.iapauthorizer"],callback:{success:t=>{if(n)try{o.isAndroid()?n(JSON.parse(t.data.value)):n(JSON.parse(t.data.data.value))}catch(t){n({orderNo:e,result:"cancel"})}},fail:e=>{r&&r(e)}}})})}}:(r("PAY is null, use bridgeBrowserPay instead!"),t)}),Ou.exportable("bridgePay"),c("bridgeShare",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=s("bridgeBrowserShare"),o=!(void 0===e()||!e().getShare)&&e().getShare();return o?{share:function(e){const n=t.build(e,t.hint("share"));o.share(n)},shareContent:function({title:e,content:n,cover:r,toCurrentSession:i},a){const c=t.build(a,t.hint("shareContent"));o.shareContent(JSON.stringify({title:e,content:n,cover:r,toCurrentSession:i}),c)},shareCustomizeCard:function(e,n){const r=t.build(n,t.hint("shareCustomizeCard"));o.shareCustomizeCard(JSON.stringify(e),r)},shareText:function({text:e},n){const r=t.build(n,t.hint("shareText"));o.shareText(JSON.stringify({text:e}),r)},disableShare:function({disable:e}){o.disableShare(JSON.stringify({disable:e}))},shareFile:function({filePath:e,mimeType:n},r){const i=t.build(r,t.hint("shareFile"));o.shareFile(JSON.stringify({filePath:e,mimeType:n}),i)}}:(r("SHARE is null, use bridgeBrowserShare instead!"),n)}),Tu.exportable("bridgeShare"),c("bridgeOfficialAccount",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getOfficialAccount)&&e().getOfficialAccount();return n?{setSubscription:function(e,r,o){const i=t.build(o,t.hint("setSubscription"));n.setSubscription(e,r,i)},getSubscription:function(e,r){const o=t.build(r,t.hint("getSubscription"));n.getSubscription(e,o)},getMuteStatus:function({sessionId:e},r){const o=t.build(r,t.hint("getMuteStatus"));n.getMuteStatus(JSON.stringify({sessionId:e}),o)},setMuteStatus:function({sessionId:e,on:r},o){const i=t.build(o,t.hint("setMuteStatus"));n.setMuteStatus(JSON.stringify({sessionId:e,on:r}),i)},getNewsLetterStatus:function({oaId:e},r){const o=t.build(r,t.hint("getNewsLetterStatus"));n.getNewsLetterStatus(JSON.stringify({oaId:e}),o)},setNewsLetterStatus:function({oaId:e,on:r},o){const i=t.build(o,t.hint("setNewsLetterStatus"));n.setNewsLetterStatus(JSON.stringify({oaId:e,on:r}),i)}}:(r("OfficialAccount is null"),{})}),ku.exportable("bridgeOfficialAccount"),c("bridgePayBySDK",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getPayBySDK)&&e().getPayBySDK();return n?{paybyOpenUrl:function(e){n.paybyOpenUrl(e)},paybyGetDefaultPaymentMethod:function(e){const{success:r,fail:o,complete:i}=e||{},a=t.build({success:function(e){r&&(e.data&&"string"==typeof e.data&&(e.data=JSON.parse(e.data)),r(e))},fail:o,complete:i},t.hint("paybyGetDefaultPaymentMethod"));n.paybyGetDefaultPaymentMethod(a)},paybyGetLatestPaymentMethod:function({partnerId:e,payScene:r,businessScene:o,payeeId:i,installBlock:a},c){const{success:s,fail:u,complete:l}=c||{},d=t.build({success:function(e){s&&(e.data&&"string"==typeof e.data&&(e.data=JSON.parse(e.data)),s(e))},fail:u,complete:l},t.hint("paybyGetLatestPaymentMethod"));n.paybyGetLatestPaymentMethod(JSON.stringify({partnerId:e,payScene:r,businessScene:o,payeeId:i,installBlock:a}),d)},paybyChoosePaymentMethod:function(e){const{success:r,fail:o,complete:i}=e||{},a=t.build({success:function(e){r&&(e.data&&"string"==typeof e.data&&(e.data=JSON.parse(e.data)),r(e))},fail:o,complete:i},t.hint("paybyChoosePaymentMethod"));n.paybyChoosePaymentMethod(a)},paybyToPay:function({orderToken:e,returnUrl:r,payeeId:o,passData:i},a){const{success:c,fail:s,complete:u}=a||{},l=t.build({success:function(e){c&&(e.data&&"string"==typeof e.data&&(e.data=JSON.parse(e.data)),c(e))},fail:s,complete:u},t.hint("paybyToPay"));n.paybyToPay(JSON.stringify({orderToken:e,returnUrl:r,payeeId:o,passData:i}),l)}}:(r("PayBySDK is null"),{})}),Cu.exportable("bridgePayBySDK"),c("bridgeDevice",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getDevice)&&e().getDevice();return n?{vibrateShort:function({type:e},r){const o=t.build(r,t.hint("vibrateShort"));n.vibrateShort(JSON.stringify({type:e}),o)},vibrateLong:function(e){const r=t.build(e,t.hint("vibrateLong"));n.vibrateLong(r)},setClipboardData:function({data:e,message:r},o){const i=t.build(o,t.hint("setClipboardData"));n.setClipboardData(JSON.stringify({data:e,message:r}),i)},getClipboardData:function(e){const r=t.build(e,t.hint("getClipboardData"));n.getClipboardData(r)},onKeyboardPop:function(e){t.subscribe("onKeyboardPop",e)},allowContentOffSet:function({isNotAllow:e}){n.allowContentOffSet(JSON.stringify({isNotAllow:e}))},setKeepScreenOn:function({keepScreenOn:e},r){const o=t.build(r,t.hint("setKeepScreenOn"));n.setKeepScreenOn(JSON.stringify({keepScreenOn:e}),o)}}:(r("Device is null"),{})}),yu.exportable("bridgeDevice"),c("bridgeCamera",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getCamera)&&e().getCamera();return n?{scanCode:function({onlyFromCamera:e,scanType:r},o){const{success:i,fail:a,complete:c}=o||{},s=t.build({success:function(e){i&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),i(e))},fail:a,complete:c},t.hint("scanCode"));n.scanCode(JSON.stringify({onlyFromCamera:e,scanType:r}),s)},getOcrResultFromCamera:function({ocrType:e},r){const{success:o,fail:i,complete:a}=r||{},c=t.build({success:function(e){o&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),o(e))},fail:i,complete:a},t.hint("getOcrResultFromCamera"));n.getOcrResultFromCamera(JSON.stringify({ocrType:e}),c)},getOcrResultFromGallery:function({ocrType:e,frontPath:r,backPath:o},i){const{success:a,fail:c,complete:s}=i||{},u=t.build({success:function(e){a&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),a(e))},fail:c,complete:s},t.hint("getOcrResultFromGallery"));n.getOcrResultFromGallery(JSON.stringify({ocrType:e,frontPath:r,backPath:o}),u)}}:(r("Camera is null"),{})}),bu.exportable("bridgeCamera"),c("bridgeFile",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getFile)&&e().getFile();if(!n)return r("File is null"),{};const o={},i=function(e,n,r){if(!n)return r;const o=t.hint(e);return t.subscribe(o,n),o};return o.chooseImage=function({count:e,sizeType:r,sourceType:o,crop:i},a){const{success:c,fail:s,complete:u}=a||{},l=t.build({success:function(e){c&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),c(e))},fail:s,complete:u},t.hint("chooseImage"));n.chooseImage(JSON.stringify({count:e,sizeType:r,sourceType:o,crop:i}),l)},o.uploadImage=function({filePath:e,storageMode:t}){n.uploadImage(JSON.stringify({filePath:e,storageMode:t}),JSON.stringify({imageProgress:"onImageProgressUpdate",imageUpdateStatus:"onImageUpdateStatus"}))},o.onImageProgressUpdate=function(e){t.subscribe("onImageProgressUpdate",e)},o.onImageUpdateStatus=function(e){t.subscribe("onImageUpdateStatus",e)},o.chooseFile=function({count:e,select:r,crop:o},i){const{success:a,fail:c,complete:s}=i||{},u=t.build({success:function(e){a&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),e&&e.data&&e.data.file&&e.data.file.forEach(e=>{e.fileSize&&(e.fileSize=Number(e.fileSize))}),a(e))},fail:c,complete:s},t.hint("chooseFile"));n.chooseFile(JSON.stringify({count:e,select:r,crop:o}),u)},o.uploadFile=function({filePath:e,url:r,contentType:o,method:a,timeout:c,formData:s,header:u,name:l,success:d,fail:f,complete:g},p){const h=t.build(p,t.hint("uploadFile"));n.uploadFile(JSON.stringify({filePath:e,url:r,contentType:o,method:a,timeout:c,formData:s,header:u,name:l,success:i("success",d),fail:i("fail",f),complete:i("complete",g)}),h)},o.setFileUpdateListener=function({instanceId:e,listeners:t}){const{onFileProgress:r}=t||{};n.setFileUpdateListener(JSON.stringify({instanceId:e,listeners:{onFileProgress:i("onFileProgress",r)}}))},o.cancelUploadFile=function({instanceId:e},r){const{success:o,fail:i,complete:a}=r||{},c=t.build({success:function(e){o&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),o(e))},fail:i,complete:a},t.hint("cancelUploadFile"));n.cancelUploadFile(JSON.stringify({instanceId:e}),c)},o.downloadFile=function({url:e,header:r,timeout:o,filePath:a,fileName:c,isAcceptRange:s,success:u,fail:l,complete:d},f){const g=t.build(f,t.hint("downloadFile"));n.downloadFile(JSON.stringify({url:e,header:r,timeout:o,filePath:a,fileName:c,isAcceptRange:s,success:i("success",u),fail:i("fail",l),complete:i("complete",d)}),g)},o.cancelDownloadFile=function({instanceId:e},r){const{success:o,fail:i,complete:a}=r||{},c=t.build({success:function(e){o&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),o(e))},fail:i,complete:a},t.hint("cancelDownloadFile"));n.cancelDownloadFile(JSON.stringify({instanceId:e}),c)},o.setFileDownloadListener=function({instanceId:e,listeners:t}){const{onFileProgress:r}=t||{};n.setFileDownloadListener(JSON.stringify({instanceId:e,listeners:{onFileProgress:i("onFileDownloadProgress",r)}}))},o.loadResource=function({file:e},r){const{success:o,fail:i,complete:a}=r||{},c=t.build({success:function(e){o&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),o(e))},fail:i,complete:a},t.hint("loadResource"));n.loadResource(JSON.stringify({file:e}),c)},o.openDocument=function({filePath:e},r){const{success:o,fail:i,complete:a}=r||{},c=t.build({success:function(e){o&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),o(e))},fail:i,complete:a},t.hint("openDocument"));n.openDocument(JSON.stringify({filePath:e}),c)},o.saveFile=function({filePath:e,fileName:r,content:o},i){const{success:a,fail:c,complete:s}=i||{},u=t.build({success:function(e){a&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),a(e))},fail:c,complete:s},t.hint("saveFile"));n.saveFile(JSON.stringify({filePath:e,fileName:r,content:o}),u)},o}),Su.exportable("bridgeFile"),c("bridgeLocation",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getLocation)&&e().getLocation();if(!n)return r("Location is null"),{};const o={getLocation:function({altitude:e,isHighAccuracy:r,expireTime:o},i){const{success:a,fail:c,complete:s}=i||{},u=t.build({success:function(e){a&&("string"==typeof e.data&&(e.data=JSON.parse(e.data)),a(e))},fail:function(e){c&&("string"==typeof e&&(e=JSON.parse(e)),c(e))},complete:s},t.hint("getLocation"));n.getLocation(JSON.stringify({altitude:e,isHighAccuracy:r,expireTime:o}),u)},operateCompass:function({action:e},r){const o=t.build(r,t.hint("operateCompass"));n.operateCompass(JSON.stringify({action:e}),o)},compassChange:function({action:e},r){const o=t.build(r,t.hint("compassChange"));n.compassChange(JSON.stringify({action:e,callback:"onCompassChange"}),o)},onCompassChange:function(e){t.subscribe("onCompassChange",e)},getMapData:function(e){const r=t.build(e,t.hint("getMapData"));n.getMapData(r)},getStaticMap:function({latitude:e,longitude:r,width:o,height:i,language:a,format:c},s){const u=t.build(s,t.hint("getStaticMap"));n.getStaticMap(JSON.stringify({latitude:e,longitude:r,width:o,height:i,format:c}),u)},openNavigationPage:function({latitude:e,longitude:r,name:o,address:i},a){const c=t.build(a,t.hint("openNavigationPage"));n.openNavigationPage(JSON.stringify({latitude:e,longitude:r,name:o,address:i}),c)}};return o}),wu.exportable("bridgeLocation"),c("bridgeAdvertisement",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),o=!(void 0===e()||!e().getAdvertisement)&&e().getAdvertisement();if(!o)return r("Advertisement is null"),{};const i={},a=function(e,n,r){if(!n)return r;const o=t.hint(e);return t.subscribe(o,n),o};return i.createFloatingAd=function({adUnitId:e}){o.createFloatingAd(JSON.stringify({adUnitId:e}),JSON.stringify({onAdLoad:"onFloatingAdLoad",onAdError:"onFloatingAdError",onAdClose:"onFloatingAdClose",onAdClick:"onFloatingAdClick"}))},i.onFloatingAdLoad=function(e){t.subscribe("onFloatingAdLoad",e)},i.onFloatingAdError=function(e){t.subscribe("onFloatingAdError",e)},i.onFloatingAdClose=function(e){t.subscribe("onFloatingAdClose",e)},i.onFloatingAdClick=function(e){t.subscribe("onFloatingAdClick",e)},i.showFloatingAd=function({adUnitId:e},n){const r=t.build(n,t.hint("showFloatingAd"));o.showFloatingAd(JSON.stringify({adUnitId:e}),r)},i.hiddenFloatingAd=function({adUnitId:e},n){const r=t.build(n,t.hint("hiddenFloatingAd"));o.hiddenFloatingAd(JSON.stringify({adUnitId:e}),r)},i.createRewardedAd=function({rewardedAdKey:e},n){const r=t.build(n,t.hint("createRewardedAd"));o.createRewardedAd(JSON.stringify({rewardedAdKey:e}),r)},i.setRewardedAdListener=function({instanceId:e,listeners:n},r){const{onAdLoad:i,onAdShow:c,onAdError:s,onAdClose:u,onAdClick:l}=n||{},d=t.build(r,t.hint("setRewardedAdListener"));o.setRewardedAdListener(JSON.stringify({instanceId:e,listeners:{onAdLoad:a("onAdLoaded",i),onAdShow:a("onAdShow",c),onAdError:a("onAdError",s),onAdClose:a("onAdClose",u),onAdClick:a("onAdClick",l)}}),d)},i.loadRewardedAd=function({instanceId:e},n){const r=t.build(n,t.hint("loadRewardedAd"));o.loadRewardedAd(JSON.stringify({instanceId:e}),r)},i.showRewardedAd=function({instanceId:e,customData:n},r){const i=t.build(r,t.hint("showRewardedAd"));o.showRewardedAd(JSON.stringify({instanceId:e,customData:n}),i)},i.createNativeAd=function({adKey:e,width:n,height:r,adLayoutType:i,source:a},c){0===i&&(n=window.innerWidth,r=104);const s=t.build(c,t.hint("createNativeAd"));o.createNativeAd(JSON.stringify({adKey:e,width:n,height:r,adLayoutType:i,source:a}),s)},i.setNativeAdListeners=function({instanceId:e,listeners:n},r){const{onAdClose:i,onAdClick:c}=n||{},s=t.build(r,t.hint("setNativeAdListeners"));o.setNativeAdListeners(JSON.stringify({instanceId:e,listeners:{onAdClose:a("onAdClose",i),onAdClick:a("onAdClick",c)}}),s)},i.loadNativeAd=function({instanceId:e,listeners:n},r){const{onAdError:i,onAdLoad:c}=n||{},s=t.build(r,t.hint("loadNativeAd"));o.loadNativeAd(JSON.stringify({instanceId:e,listeners:{onAdLoad:a("onAdLoad",c),onAdError:a("onAdError",i)}}),s)},i.showNativeAd=function({instanceId:e,top:n,left:r,scale:i,listeners:a},c){const s=t.build(c,t.hint("showNativeAd"));o.showNativeAd(JSON.stringify({instanceId:e,scale:i,top:n,left:r}),s)},i.showCustomAd=function({instanceId:e,top:t,left:n,listeners:r},o){i.showNativeAd({instanceId:e,top:t,left:n,listeners:r},o)},i.destroyNativeAd=function({instanceId:e},n){const r=t.build(n,t.hint("destroyNativeAd"));o.destroyNativeAd(JSON.stringify({instanceId:e}),r)},i.destroyCustomAd=function({instanceId:e},t){i.destroyNativeAd({instanceId:e},t)},i.hiddenNativeAds=function({instanceIds:e},n){const r=t.build(n,t.hint("hiddenNativeAds"));o.hiddenNativeAds(JSON.stringify({instanceIds:e}),r)},i.hiddenCustomAds=function({instanceIds:e},t){i.hiddenNativeAds({instanceIds:e},t)},i.visibleNativeAds=function({instanceIds:e},n){const r=t.build(n,t.hint("visibleNativeAds"));o.visibleNativeAds(JSON.stringify({instanceIds:e}),r)},i.visibleCustomAds=function({instanceIds:e},t){i.visibleNativeAds({instanceIds:e},t)},i.loadCustomAd=function({adKey:e,width:r,height:i,adLayoutType:c,top:s,left:u,bottom:l,listeners:d,source:f}){const{adLoad:g,adError:p,adClose:h}=d||{};let m="";0!==c&&c||(c=0,r=window.innerWidth,i=104,0===l&&(s=document.documentElement.clientHeight-104),u=0);const b={success:e=>{m=e.data.instanceId;const r=t.build({success:()=>{}},t.hint("setNativeAdListeners"));o.setNativeAdListeners(JSON.stringify({instanceId:m,listeners:{onAdClose:a("onAdClose",function(){const n=t.build({success:()=>{},fail:()=>{}},t.hint("destroyNativeAd"));o.destroyNativeAd(JSON.stringify({instanceId:m}),n),h(e)})}}),r);const i={success:()=>{n("loadNativeAdCallback")},fail:e=>{p(e)}},c=t.build(i,t.hint("loadNativeAd"));o.loadNativeAd(JSON.stringify({instanceId:m,listeners:{onAdLoad:a("onAdLoad",function(){const e={success:()=>{g({data:{instanceId:m}})},fail:e=>{p(e)}},n=t.build(e,t.hint("showNativeAd"));o.showNativeAd(JSON.stringify({instanceId:m,top:s,left:u}),n)}),onAdError:a("onAdError",p)}}),c)},fail:e=>{p(e)}},v=t.build(b,t.hint("createNativeAd"));o.createNativeAd(JSON.stringify({adKey:e,width:r,height:i,adLayoutType:c,source:f}),v)},i}),mu.exportable("bridgeAdvertisement"),c("bridgeSolarSdk",function(){const e=s("BOTBridge"),t=s("bridgeEnvironment"),n=s("bridgeCallback"),o=!(void 0===e()||!e().getSolarSDK)&&e().getSolarSDK();if(!o)return r("SolarSDK is null"),{};const i={},a=new function(){let e;this.setId=function(t){e=t},this.getId=function(){return e}};return i.newSolar=function(){return{solarLoginApp:({appId:e,uid:t,token:r,type:i,rtmToken:a,rtmAppId:c},s)=>{const u=n.build(s,n.hint("solarLoginApp"));o.solarLoginApp(JSON.stringify({appId:e,uid:t,token:r,type:i,rtmToken:a,rtmAppId:c}),u)},loginApp:({appId:e,uid:t,token:r,type:i,rtmToken:a,rtmAppId:c},s)=>{const u=n.build(s,n.hint("solarLoginApp"));o.solarLoginApp(JSON.stringify({appId:e,uid:t,token:r,type:i,rtmToken:a,rtmAppId:c}),u)},solarJoinRoom:({audioOpen:e=!0,role:t=0,roomId:r,roomType:i,videoOpen:c=!1,creator:s},u)=>{const{success:l,fail:d,complete:f}=u,g=n.build({success:e=>{a.setId(r),l&&l(e)},fail:d,complete:f},n.hint("solarJoinRoom"));o.solarJoinRoom(JSON.stringify({audioOpen:e,role:t,roomId:r,roomType:i,videoOpen:c,creator:s}),g)},joinRoom:({audioOpen:e=!0,role:t=0,roomId:r,roomType:i,videoOpen:c=!1,creator:s},u)=>{const{success:l,fail:d,complete:f}=u,g=n.build({success:e=>{a.setId(r),l&&l(e)},fail:d,complete:f},n.hint("solarJoinRoom"));o.solarJoinRoom(JSON.stringify({audioOpen:e,role:t,roomId:r,roomType:i,videoOpen:c,creator:s}),g)},solarLeaveRoom:e=>{const t=n.build(e,n.hint("solarLeaveRoom")),r=a.getId();o.solarLeaveRoom(JSON.stringify({roomId:r}),t)},leaveRoom:e=>{const t=n.build(e,n.hint("solarLeaveRoom")),r=a.getId();o.solarLeaveRoom(JSON.stringify({roomId:r}),t)},solarAudioActive:({active:e},t)=>{const r=n.build(t,n.hint("solarAudioActive")),i=a.getId();o.solarAudioActive(JSON.stringify({active:e,roomId:i}),r)},setMuted:({active:e},t)=>{const r=n.build(t,n.hint("solarAudioActive")),i=a.getId();o.solarAudioActive(JSON.stringify({active:e,roomId:i}),r)},solarVideoActive:({active:e},t)=>{const r=n.build(t,n.hint("solarVideoActive")),i=a.getId();o.solarVideoActive(JSON.stringify({active:e,roomId:i}),r)},solarSwitchSpeaker:({useSpeaker:e},t)=>{const r=n.build(t,n.hint("solarSwitchSpeaker")),i=a.getId();o.solarSwitchSpeaker(JSON.stringify({useSpeaker:e,roomId:i}),r)},switchSpeaker:({useSpeaker:e},t)=>{const r=n.build(t,n.hint("solarSwitchSpeaker")),i=a.getId();o.solarSwitchSpeaker(JSON.stringify({useSpeaker:e,roomId:i}),r)},solarLogout:e=>{const t=n.build(e,n.hint("solarLogout")),r=a.getId();o.solarLogout(JSON.stringify({roomId:r}),t)},logout:e=>{const t=n.build(e,n.hint("solarLogout")),r=a.getId();o.solarLogout(JSON.stringify({roomId:r}),t)},solarMuteRemoteAudioStream:({uid:e,mute:t},r)=>{const i=n.build(r,n.hint("solarMuteRemoteAudioStream")),c=a.getId();o.solarMuteRemoteAudioStream(JSON.stringify({uid:e,roomId:c,mute:t}),i)},muteRemoteAudioStream:({uid:e,mute:t},r)=>{const i=n.build(r,n.hint("solarMuteRemoteAudioStream")),c=a.getId();o.solarMuteRemoteAudioStream(JSON.stringify({uid:e,roomId:c,mute:t}),i)},solarChangeRemoteVideoStream:({subscribe:e,uid:t},r)=>{const i=n.build(r,n.hint("solarChangeRemoteVideoStream")),c=a.getId();o.solarChangeRemoteVideoStream(JSON.stringify({subscribe:e,uid:t,roomId:c}),i)},changeRemoteVideoStream:({subscribe:e,uid:t},r)=>{const i=n.build(r,n.hint("solarChangeRemoteVideoStream")),c=a.getId();o.solarChangeRemoteVideoStream(JSON.stringify({subscribe:e,uid:t,roomId:c}),i)},solarVideoHDAvailable:({uid:e},t)=>{const r=n.build(t,n.hint("solarVideoHDAvailable")),i=a.getId();o.solarVideoHDAvailable(JSON.stringify({uid:e,roomId:i}),r)},solarVideoHDType:({uid:e},t)=>{const r=n.build(t,n.hint("solarVideoHDType")),i=a.getId();o.solarVideoHDType(JSON.stringify({uid:e,roomId:i}),r)},solarSwitchHD:({uid:e},t)=>{const r=n.build(t,n.hint("solarSwitchHD")),i=a.getId();o.solarSwitchHD(JSON.stringify({uid:e,roomId:i}),r)},solarSwitchLD:({uid:e},t)=>{const r=n.build(t,n.hint("solarSwitchLD")),i=a.getId();o.solarSwitchLD(JSON.stringify({uid:e,roomId:i}),r)},solarSwitchCamera:({useFront:e},t)=>{const r=n.build(t,n.hint("solarSwitchCamera")),i=a.getId();o.solarSwitchCamera(JSON.stringify({roomId:i,useFront:e}),r)},solarSendAppMessage:({message:e},t)=>{const r=n.build(t,n.hint("solarSendAppMessage")),i=a.getId();o.solarSendAppMessage(JSON.stringify({roomId:i,message:e}),r)},solarMicEnable:e=>{const t=n.build(e,n.hint("solarMicEnable")),r=a.getId();o.solarMicEnable(JSON.stringify({roomId:r}),t)},solarSetupVideo:({uid:e,type:t,show:r},i)=>{const c=n.build(i,n.hint("solarSetupVideo")),s=a.getId();o.solarSetupVideo(JSON.stringify({uid:e,roomId:s,type:t,show:r}),c)},solarApplyMic:e=>{const t=n.build(e,n.hint("solarApplyMic"));o.solarApplyMic(t)},solarCancelMic:e=>{const t=n.build(e,n.hint("solarCancelMic"));o.solarCancelMic(t)},solarConfirmApplyMic:({refUid:e,confirm:t},r)=>{const i=n.build(r,n.hint("solarConfirmApplyMic"));o.solarConfirmApplyMic(JSON.stringify({refUid:e,confirm:t}),i)},solarInviteMic:({refUid:e},t)=>{const r=n.build(t,n.hint("solarInviteMic"));o.solarInviteMic(JSON.stringify({refUid:e}),r)},solarCancelInviting:({refUid:e},t)=>{const r=n.build(t,n.hint("solarCancelInviting"));o.solarCancelInviting(JSON.stringify({refUid:e}),r)},solarInviteConfirm:({refUid:e,confirm:t},r)=>{const i=n.build(r,n.hint("solarInviteConfirm"));o.solarInviteConfirm(JSON.stringify({refUid:e,confirm:t}),i)},solarKickoutMic:({refUid:e},t)=>{const r=n.build(t,n.hint("solarKickoutMic"));o.solarKickoutMic(JSON.stringify({refUid:e}),r)},solarLayDownMic:e=>{const t=n.build(e,n.hint("solarLayDownMic"));o.solarLayDownMic(t)},addSolarEngineListener:()=>{o.addSolarEngineListener()},getSolarLifeCycle:({appId:e},t)=>{const r=n.build(t,n.hint("getSolarLifeCycle"));o.getSolarLifeCycle(JSON.stringify({appId:e}),r)},addSolarEventListener:e=>{t.isAndroid()&&o.addSolarEngineListener(),n.subscribe("addSolarEventListener",e)},addEventListener:e=>{t.isAndroid()&&o.addSolarEngineListener(),n.subscribe("addSolarEventListener",e)}}},i}),Lu.exportable("bridgeSolarSdk"),c("bridgeWebsocket",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getWebSocket)&&e().getWebSocket();if(!n)return r("WebSocket is null"),{};const o={stack:[]};class i{constructor(e,t,n){this.url=e,this.name=t,this.readyState=n,this.message="",this.errorMessage="",this.errorCode=""}}return o.checkSocket=function({name:e}){if(e)return o.stack.find(t=>t.name===e);r("You should provide at least one param name")},o.checkAllSocket=function(){return o.stack},o.connectSocket=function({url:e,name:a,header:c,protocols:s,tcpNoDelay:u,perMessageDeflate:l,timeout:d,maxCount:f},g){if(!e||!a)return void r("params url and name must be exist!");const{success:p,fail:h,complete:m}=g,b=t.build({success:t=>{const n=new i(e,a,1);o.stack.some(e=>e.name===n.name)||o.stack.push(n),p&&p(t)},fail:h,complete:m},t.hint("connectSocket"));n.connectSocket(JSON.stringify({url:e,name:a,header:c,protocols:s,tcpNoDelay:u,perMessageDeflate:l,timeout:d,maxCount:f}),JSON.stringify({onMessage:"onSocketMessage",onOpen:"onSocketOpen",onClose:"onSocketClose",onError:"onSocketError"}),b)},o.socketEnable=function({actions:e},r){const o=t.build(r,t.hint("socketEnable"));n.socketEnable(JSON.stringify({actions:e}),o)},o.onSocketMessage=function(e,n){let i=null;t.subscribe("onSocketMessage",t=>(e||(i=t),(t.data.name||t.data.url)&&o.stack.forEach(n=>{n.name===t.data.name&&(n.message=t.data.message,n.readyState=1),e&&e===n.name&&(i=n)}),e&&!i&&r("You params name may be not exist"),n(i)))},o.onSocketOpen=function(e){t.subscribe("onSocketOpen",t=>{const{url:n,isOpen:r,name:i}=t;o.stack.forEach(e=>{e.name===i&&(e.readyState=r?1:0)}),e(t)})},o.onSocketClose=function(e){t.subscribe("onSocketClose",t=>(t.data.name&&(o.stack=o.stack.filter(e=>e.name!==t.data.name)),e(t)))},o.onSocketError=function(e){t.subscribe("onSocketError",t=>{t.data.name&&o.stack.forEach(e=>{e.name===t.data.name&&(e.errorMessage=t.data.errorMessage,e.errorCode=t.data.code,e.readyState=0)}),e(t)})},o.socketSend=function({url:e,name:o,data:i},a){if(!o)return void r("params name must be exist");const c=t.build(a,t.hint("socketSend"));n.socketSend(JSON.stringify({url:e,name:o,data:i}),c)},o.socketClose=function(e,i){if(!e.name)return void r("params name must be exist");const{success:a,fail:c,complete:s}=i,u=t.build({success:t=>{e.name&&(o.stack=o.stack.filter(t=>t.name!==e.name)),a(t)},fail:c,complete:s},t.hint("socketSend"));n.socketClose(JSON.stringify(e),u)},o.socketPool=function(e){const r=t.build(e,t.hint("socketPool"));n.socketPool(r)},o.socketPing=function(e,r){const o=t.build(r,t.hint("socketPing"));n.socketSend(JSON.stringify(e),o)},o.onSocketPong=function(e){t.subscribe("onSocketPong",e)},o}),Ju.exportable("bridgeWebsocket"),c("bridgeSocketIo",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getSocketIO)&&e().getSocketIO();return n?{stack:[],socketIoConnect:function(e,r){const o=t.build(r,t.hint("socketIoConnect"));n.socketIoConnect(JSON.stringify(e),JSON.stringify({onConnect:"onSocketIoConnect",onDisconnect:"onSocketIoDisconnect",onError:"onSocketIoError",onMessage:"onSocketIoMessage"}),o)},socketIoEnable:function({actions:e},r){const o=t.build(r,t.hint("socketIoEnable"));n.socketIoEnable(JSON.stringify({actions:e}),o)},onSocketIoMessage:function(e){t.subscribe("onSocketIoMessage",e)},onSocketIoConnect:function(e){t.subscribe("onSocketIoConnect",e)},onSocketIoDisconnect:function(e){t.subscribe("onSocketIoDisconnect",e)},onSocketIoError:function(e){t.subscribe("onSocketIoError",e)},socketIoSend:function({url:e,data:r},o){const i=t.build(o,t.hint("socketIoSend"));n.socketIoSend(JSON.stringify({url:e,data:r}),i)},socketIoClose:function({url:e,code:r,reason:o},i){const a=t.build(i,t.hint("socketIoClose"));n.socketIoClose(JSON.stringify({url:e,code:r,reason:o}),a)},socketIoPool:function(e){const r=t.build(e,t.hint("socketIoPool"));n.socketIoPool(r)},addSocketIOEventListener:function(e){t.subscribe("addSocketIOEventListener",e)}}:(r("socketIO is null"),{})}),Du.exportable("bridgeSocketIo"),c("bridgeMedia",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getMedia)&&e().getMedia();return n?{playVoice:function({path:e,looping:r,mode:o},i){const a=t.build(i,t.hint("playVoice"));n.playVoice(JSON.stringify({path:e,looping:r,mode:o}),a)},stopVoice:function({path:e},r){const o=t.build(r,t.hint("stopVoice"));n.stopVoice(o)},saveImageToPhotosAlbum:function({filePath:e},r){const o=t.build(r,t.hint("saveImageToPhotosAlbum"));n.saveImageToPhotosAlbum(JSON.stringify({filePath:e}),o)}}:(r("Media is null"),{})}),Au.exportable("bridgeMedia"),c("bridgeRTCSDK",function(){const e=s("BOTBridge"),t=s("bridgeCallback"),n=!(void 0===e()||!e().getRTCSDK)&&e().getRTCSDK();return n?{newRTC:function(){return{initEngine:({appId:e,uid:r,roomId:o,token:i},a)=>{const c=t.build(a,t.hint("initEngine"));n.initEngine(JSON.stringify({appId:e,uid:r,roomId:o,token:i}),c)},isInited:e=>{const r=t.build(e,t.hint("isInited"));n.isInited(r)},destroyEngine:()=>{n.destroyEngine()},updateToken:e=>{const r=t.build(e,t.hint("updateToken"));n.updateToken(r)},joinRoom:({audioOpen:e,videoOpen:r,audioDevice:o},i)=>{const a=t.build(i,t.hint("joinRoom"));n.joinRoom(JSON.stringify({audioOpen:e,videoOpen:r,audioDevice:o}),a)},pauseStream:({keepAlive:e},r)=>{const o=t.build(r,t.hint("pauseStream"));n.pauseStream(JSON.stringify({keepAlive:e}),o)},resumeStream:e=>{const r=t.build(e,t.hint("resumeStream"));n.resumeStream(r)},sendAppSignal:({signal:e},r)=>{const o=t.build(r,t.hint("sendAppSignal"));n.sendAppSignal(JSON.stringify({signal:e}),o)},leaveRoom:e=>{const r=t.build(e,t.hint("leaveRoom"));n.leaveRoom(r)},changeAudioDevice:e=>{const r=t.build(e,t.hint("changeAudioDevice"));n.changeAudioDevice(r)},getAudioDevice:e=>{const r=t.build(e,t.hint("getAudioDevice"));n.getAudioDevice(r)},enableLocalAudio:({enabled:e},r)=>{const o=t.build(r,t.hint("enableLocalAudio"));n.enableLocalAudio(JSON.stringify({enabled:e}),o)},enableLocalVideo:({enabled:e},r)=>{const o=t.build(r,t.hint("enableLocalVideo"));n.enableLocalVideo(JSON.stringify({enabled:e}),o)},muteLocalAudioStream:({muted:e},r)=>{const o=t.build(r,t.hint("muteLocalAudioStream"));n.muteLocalAudioStream(JSON.stringify({muted:e}),o)},muteLocalVideoStream:({muted:e},r)=>{const o=t.build(r,t.hint("muteLocalVideoStream"));n.muteLocalVideoStream(JSON.stringify({muted:e}),o)},muteRemoteAudioStream:({uid:e,muted:r},o)=>{const i=t.build(o,t.hint("muteRemoteAudioStream"));n.muteRemoteAudioStream(JSON.stringify({uid:e,muted:r}),i)},muteRemoteVideoStream:({uid:e,muted:r},o)=>{const i=t.build(o,t.hint("muteRemoteVideoStream"));n.muteRemoteVideoStream(JSON.stringify({uid:e,muted:r}),i)},muteAllRemoteAudioStream:({muted:e},r)=>{const o=t.build(r,t.hint("muteAllRemoteAudioStream"));n.muteAllRemoteAudioStream(JSON.stringify({muted:e}),o)},muteAllRemoteVideoStream:({muted:e},r)=>{const o=t.build(r,t.hint("muteAllRemoteVideoStream"));n.muteAllRemoteVideoStream(JSON.stringify({muted:e}),o)},switchCamera:({useFront:e},r)=>{const o=t.build(r,t.hint("switchCamera"));n.switchCamera(JSON.stringify({useFront:e}),o)},setupVideo:({uid:e,type:r,show:o,layout:i,mode:a,corner:c,border:s,background:u},l)=>{const d=t.build(l,t.hint("setupVideo"));n.setupVideo(JSON.stringify({uid:e,type:r,show:o,layout:i,mode:a,corner:c,border:s,background:u}),d)},sendAppMessage:({toUid:e,message:r},o)=>{const i=t.build(o,t.hint("sendAppMessage"));n.sendAppMessage(JSON.stringify({toUid:e,message:r}),i)},getSpeakingLevel:({uid:e},r)=>{const o=t.build(r,t.hint("getSpeakingLevel"));n.getSpeakingLevel(JSON.stringify({uid:e}),o)},getSdkVersion:e=>{const r=t.build(e,t.hint("getSdkVersion"));n.getSdkVersion(r)},setBackgroundImage:({type:e,url:r},o)=>{const i=t.build(o,t.hint("setBackgroundImage"));n.setBackgroundImage(JSON.stringify({type:e,url:r}),i)},getNetworkState:e=>{const r=t.build(e,t.hint("getNetworkState"));n.getNetworkState(r)},getConnectState:({direction:e},r)=>{const o=t.build(r,t.hint("getConnectState"));n.getConnectState(JSON.stringify({direction:e}),o)},showDebugView:({show:e},r)=>{const o=t.build(r,t.hint("showDebugView"));n.showDebugView(JSON.stringify({show:e}),o)},getVoipState:e=>{const r=t.build(e,t.hint("getVoipState"));n.getVoipState(r)},updateConfiguration:({keepAliveOnDestroyed:e,mpName:r,callMode:o},i)=>{const a=t.build(i,t.hint("updateConfiguration"));n.updateConfiguration(JSON.stringify({keepAliveOnDestroyed:e,mpName:r,callMode:o}),a)},getRoomInfo:({mpName:e},r)=>{const o=t.build(r,t.hint("getRoomInfo"));n.getRoomInfo(JSON.stringify({mpName:e}),o)},getAllPluginTools:({tools:e},r)=>{const o=t.build(r,t.hint("getAllPluginTools"));n.getAllPluginTools(JSON.stringify({tools:e}),o)},callPluginTool:({callId:e,functionName:r,args:o},i)=>{const a=t.build(i,t.hint("callPluginTool"));n.callPluginTool(JSON.stringify({callId:e,functionName:r,args:o}),a)},addRtcEventListener:e=>{t.subscribe("addRtcEventListener",e)}}}}:(r("RtcSDK is null"),{})}),Nu.exportable("bridgeRTCSDK")}let Gu=null,$u=!1;function qu(e,t){if(Gu)return e(Gu);if($u||(xs(),$s(),eu(),au(),hu(),c("BOTBridge",function(){const e=s("bridgeAdapterJSInterface"),t=s("bridgeAdapterLazyJSInterface"),n=s("bridgeAdapterPromptIntercept"),r=s("bridgeAdapterWebkitPostMessage"),o=function(){return e||t||n||r||void 0};let i;return o.checkAPILevel=function(e,t){if(void 0===i){if(!o()){if(t)throw"API@"+e+" factory not found";return!1}i=o().getAPILevel()}if(void 0===i){if(t)throw"API@"+e+" undefined";return!1}if(e>i){if(t)throw"require minimal API@"+e+", but "+i;return!1}return!0},o.checkImpl=Rs.checkImpl,o.getCurrentAdapter=su,o}),$u=!0),!t){const e=su("bridge");"bridge"===(t=e?"bridge":"browser")&&n("auto-detected bridge mode")}const o=su(t);o||"browser"===t||(r("all bridge checker failed, force using browser mode"),t="browser"),o&&o.isReady&&!o.isReady()?setTimeout(function(){qu(e,t)},100):(o&&o.isReady&&r("adapter is loaded, continue."),"browser"===t?Ku():Wu(),Gu=Rs.link(),Gu.setTimeout=setTimeout,Gu.setInterval=setInterval,Gu._=Bs,window._=Bs,Gu.checkImpl=Rs.checkImpl,Gu.__nucleus_version__="1.0.0",n("bootstrap ok"),s("Environment").onFrameworkReady(),e(Gu))}function Yu(e,t){t&&(window.logDebug=!0),qu(function(t){try{e.apply({},[{},t]),s("Environment").onPageReady()}catch(e){o("[NUCLEUS] PAGE FATAL ERROR",e),s("Environment").onPageFatal(e)}})}function Zu(e,t){qu(function(r){try{t.apply({},[{},r]),n("[NUCLEUS] "+e+" PAGE LOADED"),s("Environment").onPageReady()}catch(t){o("[NUCLEUS] "+e+" PAGE FATAL ERROR",t),s("Environment").onPageFatal(t)}})}function Qu(){}function Xu(){}function el(){}function tl(){}function nl(){}var rl={Run:Yu,Page:Zu,config:Qu,directive:Xu,factory:el,provider:tl,run:nl};e.Page=Zu,e.Run=Yu,e.config=Qu,e.default=rl,e.directive=Xu,e.factory=el,e.provider=tl,e.run=nl,Object.defineProperty(e,"__esModule",{value:!0})});
2
+ //# sourceMappingURL=nucleus.umd.cjs.map