@wppconnect-team/wppconnect 1.9.0 → 1.9.4

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.
@@ -1 +1 @@
1
- (()=>{var e={877:e=>{self,e.exports=(()=>{"use strict";var e={447:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultOptions=void 0,t.defaultOptions={refreshModules:!0,startObserver:!0,chunkNames:["webpackChunkbuild","webpackChunkwhatsapp_web_client"]},t.default=class{constructor(e={}){this._modules=new Map,this.mutationObserver=null,this._events=new Map,this._options=Object.assign({},t.defaultOptions,e),this._options.refreshModules&&this.refreshModules(),this._options.startObserver&&this.initObserver()}on(e,t){const n=this._events.get(e);return this._events.has(e)&&this._events.set(e,[...n,t]),this._events.set(e,[t]),!0}off(e,t){if(!t)return this._events.delete(e);const n=this._events.get(e);if(Array.isArray(n)&&n.length){const r=n.filter((e=>e!==t));return this._events.set(e,r),!0}return!1}emit(e,...t){const n=this._events.get(e);Array.isArray(n)&&n.length&&n.forEach((e=>{try{e.apply(this,t)}catch(e){}}))}initObserver(){this.mutationObserver||(this.mutationObserver=new MutationObserver((async e=>{const t=[];for(const n of e){const e=Array.from(n.addedNodes);for(const n of e)"SCRIPT"===n.nodeName&&t.push(new Promise((e=>{n.addEventListener("load",e),n.addEventListener("error",e)})))}await Promise.all(t),t.length&&await this.refreshModules()})),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))}refreshModules(){const e=this._options.chunkNames||["webpackChunkbuild"],t=[];for(const n of e){const e=window[n];Array.isArray(e)&&e.length&&t.push(e)}if(!t.length)return Promise.resolve(!1);const n=this._modules.size;return new Promise((e=>{for(const r of t){const t=Date.now();r.push([[t],{},t=>{for(const e in t.m){const n=t(e);this._modules.set(e+"",n)}const r=n!==this._modules.size;this.emit("refresh",r),e(r)}])}}))}searchModuleId(e,t=!1){let n=Array.from(this._modules.keys());t&&(n=n.reverse());for(const t of n)try{if(e(this._modules.get(t),t))return t}catch(e){continue}return null}searchModule(e,t=!1){const n=this.searchModuleId(e,t);return n?this._modules.get(n):null}async waitForModule(e,t=!1,n=!1){return await this.searchModule(e,t)||(this.initObserver(),new Promise(((r,o)=>{const i=async n=>{if(!n)return;const o=await this.searchModule(e,t);o&&(this.off("refresh",i),r(o))};this.on("refresh",i),n&&setTimeout((()=>{o(new Error("Timeout"))}),n)})))}get(e){return this._modules.get(e+"")}forEach(e){return this._modules.forEach(e,this)}get size(){return this._modules.size}dispose(){this.mutationObserver.disconnect(),this._modules.clear(),this._events.clear()}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(447);e.default=t.default})(),r})()},276:function(e,t,n){"use strict";var r;!function(o){function i(e,t,n){var r,o,i,a,u,w,v,y,g,m=0,P=[],A=0,b=!1,S=[],I=[],W=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(g=n.numRounds||1)!==parseInt(g,10)||1>g)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)u=512,w=G,v=B,a=160,y=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return D(t,n,e)},v=function(t,n,r,o){var i,a;if("SHA-224"===e||"SHA-256"===e)i=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");i=31+(n+129>>>10<<5),a=32}for(;t.length<=i;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[i]=4294967295&n,t[i-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=a)o=D(t.slice(n,n+a),o,e);if("SHA-224"===e)t=[o[0],o[1],o[2],o[3],o[4],o[5],o[6]];else if("SHA-256"===e)t=o;else if("SHA-384"===e)t=[o[0].a,o[0].b,o[1].a,o[1].b,o[2].a,o[2].b,o[3].a,o[3].b,o[4].a,o[4].b,o[5].a,o[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[o[0].a,o[0].b,o[1].a,o[1].b,o[2].a,o[2].b,o[3].a,o[3].b,o[4].a,o[4].b,o[5].a,o[5].b,o[6].a,o[6].b,o[7].a,o[7].b]}return t},y=function(e){return e.slice()},"SHA-224"===e)u=512,a=224;else if("SHA-256"===e)u=512,a=256;else if("SHA-384"===e)u=1024,a=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");u=1024,a=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var _=6;if(w=z,y=function(e){var t,n=[];for(t=0;5>t;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)u=1152,a=224;else if("SHA3-256"===e)u=1088,a=256;else if("SHA3-384"===e)u=832,a=384;else if("SHA3-512"===e)u=576,a=512;else if("SHAKE128"===e)u=1344,a=-1,_=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");u=1088,a=-1,_=31,M=!0}v=function(e,t,n,r,o){var i,a=_,s=[],c=(n=u)>>>5,d=0,l=t>>>5;for(i=0;i<l&&t>=n;i+=c)r=z(e.slice(i,i+c),r),t-=n;for(e=e.slice(i),t%=n;e.length<c;)e.push(0);for(e[(i=t>>>3)>>2]^=a<<i%4*8,e[c-1]^=2147483648,r=z(e,r);32*s.length<o&&(e=r[d%5][d/5|0],s.push(e.b),!(32*s.length>=o));)s.push(e.a),0==64*(d+=1)%n&&z(null,r);return s}}i=h(t,r,C),o=R(e),this.setHMACKey=function(t,n,i){var s;if(!0===b)throw Error("HMAC key already set");if(!0===W)throw Error("Cannot set HMAC key after calling update");if(!0===M)throw Error("SHAKE is not supported for HMAC");if(t=(n=h(n,r=(i||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,i=(s=u>>>3)/4-1,s<t/8){for(n=v(n,t,0,R(e),a);n.length<=i;)n.push(0);n[i]&=4294967040}else if(s>t/8){for(;n.length<=i;)n.push(0);n[i]&=4294967040}for(t=0;t<=i;t+=1)S[t]=909522486^n[t],I[t]=1549556828^n[t];o=w(S,o),m=u,b=!0},this.update=function(e){var t,n,r,a=0,s=u>>>5;for(e=(t=i(e,P,A)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=s)a+u<=e&&(o=w(n.slice(r,r+s),o),a+=u);m+=a,P=n.slice(a>>>5),A=e%u,W=!0},this.getHash=function(t,n){var r,i,u,h;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(u=p(n),!0===M){if(-1===u.shakeLen)throw Error("shakeLen must be specified in options");a=u.shakeLen}switch(t){case"HEX":r=function(e){return s(e,a,C,u)};break;case"B64":r=function(e){return c(e,a,C,u)};break;case"BYTES":r=function(e){return d(e,a,C)};break;case"ARRAYBUFFER":try{i=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{i=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return f(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(h=v(P.slice(),A,m,y(o),a),i=1;i<g;i+=1)!0===M&&0!=a%32&&(h[h.length-1]&=16777215>>>24-a%32),h=v(h,a,0,R(e),a);return r(h)},this.getHMAC=function(t,n){var r,i,h,g;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=p(n),t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return c(e,a,C,h)};break;case"BYTES":r=function(e){return d(e,a,C)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return f(e,a,C)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return i=v(P.slice(),A,m,y(o),a),g=w(I,R(e)),r(g=v(i,a,u,g,a))}}function a(e,t){this.a=e,this.b=t}function u(e,t,n,r){var o,i,a,u,s;for(t=t||[0],i=(n=n||0)>>>3,s=-1===r?3:0,o=0;o<e.length;o+=1)a=(u=o+i)>>>2,t.length<=a&&t.push(0),t[a]|=e[o]<<8*(s+u%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var o,i,a,u="";for(t/=8,a=-1===n?3:0,o=0;o<t;o+=1)i=e[o>>>2]>>>8*(a+o%4*n),u+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return r.outputUpper?u.toUpperCase():u}function c(e,t,n,r){var o,i,a,u,s="",c=t/8;for(u=-1===n?3:0,o=0;o<c;o+=3)for(i=o+1<c?e[o+1>>>2]:0,a=o+2<c?e[o+2>>>2]:0,a=(e[o>>>2]>>>8*(u+o%4*n)&255)<<16|(i>>>8*(u+(o+1)%4*n)&255)<<8|a>>>8*(u+(o+2)%4*n)&255,i=0;4>i;i+=1)s+=8*o+6*i<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-i)&63):r.b64Pad;return s}function d(e,t,n){var r,o,i,a="";for(t/=8,i=-1===n?3:0,r=0;r<t;r+=1)o=e[r>>>2]>>>8*(i+r%4*n)&255,a+=String.fromCharCode(o);return a}function l(e,t,n){t/=8;var r,o,i,a=new ArrayBuffer(t);for(i=new Uint8Array(a),o=-1===n?3:0,r=0;r<t;r+=1)i[r]=e[r>>>2]>>>8*(o+r%4*n)&255;return a}function f(e,t,n){t/=8;var r,o,i=new Uint8Array(t);for(o=-1===n?3:0,r=0;r<t;r+=1)i[r]=e[r>>>2]>>>8*(o+r%4*n)&255;return i}function p(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function h(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var o,i,a,u,s,c,d=e.length;if(0!=d%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],s=(r=r||0)>>>3,c=-1===n?3:0,o=0;o<d;o+=2){if(i=parseInt(e.substr(o,2),16),isNaN(i))throw Error("String of HEX type contains invalid characters");for(a=(u=(o>>>1)+s)>>>2;t.length<=a;)t.push(0);t[a]|=i<<8*(c+u%4*n)}return{value:t,binLen:4*d+r}};break;case"TEXT":e=function(e,r,o){var i,a,u,s,c,d,l,f,p=0;if(r=r||[0],c=(o=o||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,u=0;u<e.length;u+=1)for(a=[],128>(i=e.charCodeAt(u))?a.push(i):2048>i?(a.push(192|i>>>6),a.push(128|63&i)):55296>i||57344<=i?a.push(224|i>>>12,128|i>>>6&63,128|63&i):(u+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(u)),a.push(240|i>>>18,128|i>>>12&63,128|i>>>6&63,128|63&i)),s=0;s<a.length;s+=1){for(d=(l=p+c)>>>2;r.length<=d;)r.push(0);r[d]|=a[s]<<8*(f+l%4*n),p+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(f=-1===n?2:0,a="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,u=0;u<e.length;u+=1){for(i=e.charCodeAt(u),!0===a&&(i=(s=255&i)<<8|i>>>8),d=(l=p+c)>>>2;r.length<=d;)r.push(0);r[d]|=i<<8*(f+l%4*n),p+=2}return{value:r,binLen:8*p+o}};break;case"B64":e=function(e,t,r){var o,i,a,u,s,c,d,l,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=e.indexOf("="),e=e.replace(/\=/g,""),-1!==i&&i<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(r=r||0)>>>3,l=-1===n?3:0,i=0;i<e.length;i+=4){for(s=e.substr(i,4),a=u=0;a<s.length;a+=1)u|=(o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(s.charAt(a)))<<18-6*a;for(a=0;a<s.length-1;a+=1){for(o=(d=f+c)>>>2;t.length<=o;)t.push(0);t[o]|=(u>>>16-8*a&255)<<8*(l+d%4*n),f+=1}}return{value:t,binLen:8*f+r}};break;case"BYTES":e=function(e,t,r){var o,i,a,u,s,c;for(t=t||[0],a=(r=r||0)>>>3,c=-1===n?3:0,i=0;i<e.length;i+=1)o=e.charCodeAt(i),u=(s=i+a)>>>2,t.length<=u&&t.push(0),t[u]|=o<<8*(c+s%4*n);return{value:t,binLen:8*e.length+r}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}e=function(e,t,r){return u(new Uint8Array(e),t,r,n)};break;case"UINT8ARRAY":try{e=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}e=function(e,t,r){return u(e,t,r,n)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return e}function w(e,t){return e<<t|e>>>32-t}function v(e,t){return 32<t?(t-=32,new a(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0!==t?new a(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t):e}function y(e,t){return e>>>t|e<<32-t}function g(e,t){var n;return n=new a(e.a,e.b),32>=t?new a(n.a>>>t|n.b<<32-t&4294967295,n.b>>>t|n.a<<32-t&4294967295):new a(n.b>>>t-32|n.a<<64-t&4294967295,n.a>>>t-32|n.b<<64-t&4294967295)}function m(e,t){return 32>=t?new a(e.a>>>t,e.b>>>t|e.a<<32-t&4294967295):new a(0,e.a>>>t-32)}function P(e,t,n){return e&t^~e&n}function A(e,t,n){return new a(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function b(e,t,n){return e&t^e&n^t&n}function S(e,t,n){return new a(e.a&t.a^e.a&n.a^t.a&n.a,e.b&t.b^e.b&n.b^t.b&n.b)}function I(e){return y(e,2)^y(e,13)^y(e,22)}function W(e){var t=g(e,28),n=g(e,34);return e=g(e,39),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function M(e){return y(e,6)^y(e,11)^y(e,25)}function C(e){var t=g(e,14),n=g(e,18);return e=g(e,41),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function _(e){return y(e,7)^y(e,18)^e>>>3}function O(e){var t=g(e,1),n=g(e,8);return e=m(e,7),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function x(e){return y(e,17)^y(e,19)^e>>>10}function E(e){var t=g(e,19),n=g(e,61);return e=m(e,6),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function j(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function k(e,t,n,r){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(o>>>16)&65535)<<16|65535&o}function T(e,t,n,r,o){var i=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&o);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(o>>>16)+(i>>>16)&65535)<<16|65535&i}function U(e,t){var n,r,o;return n=(65535&e.b)+(65535&t.b),o=(65535&(r=(e.b>>>16)+(t.b>>>16)+(n>>>16)))<<16|65535&n,n=(65535&e.a)+(65535&t.a)+(r>>>16),new a((65535&(r=(e.a>>>16)+(t.a>>>16)+(n>>>16)))<<16|65535&n,o)}function L(e,t,n,r){var o,i,u;return o=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),u=(65535&(i=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(o>>>16)))<<16|65535&o,o=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(i>>>16),new a((65535&(i=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(o>>>16)))<<16|65535&o,u)}function N(e,t,n,r,o){var i,u,s;return i=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&o.b),s=(65535&(u=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(o.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&o.a)+(u>>>16),new a((65535&(u=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(o.a>>>16)+(i>>>16)))<<16|65535&i,s)}function F(e,t){return new a(e.a^t.a,e.b^t.b)}function R(e){var t,n=[];if("SHA-1"===e)n=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf("SHA-",0))switch(n=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case"SHA-224":break;case"SHA-256":n=t;break;case"SHA-384":n=[new a(3418070365,n[0]),new a(1654270250,n[1]),new a(2438529370,n[2]),new a(355462360,n[3]),new a(1731405415,n[4]),new a(41048885895,n[5]),new a(3675008525,n[6]),new a(1203062813,n[7])];break;case"SHA-512":n=[new a(t[0],4089235720),new a(t[1],2227873595),new a(t[2],4271175723),new a(t[3],1595750129),new a(t[4],2917565137),new a(t[5],725511199),new a(t[6],4215389547),new a(t[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(e=0;5>e;e+=1)n[e]=[new a(0,0),new a(0,0),new a(0,0),new a(0,0),new a(0,0)]}return n}function G(e,t){var n,r,o,i,a,u,s,c=[];for(n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=0;80>s;s+=1)c[s]=16>s?e[s]:w(c[s-3]^c[s-8]^c[s-14]^c[s-16],1),u=20>s?T(w(n,5),r&o^~r&i,a,1518500249,c[s]):40>s?T(w(n,5),r^o^i,a,1859775393,c[s]):60>s?T(w(n,5),b(r,o,i),a,2400959708,c[s]):T(w(n,5),r^o^i,a,3395469782,c[s]),a=i,i=o,o=w(r,30),r=n,n=u;return t[0]=j(n,t[0]),t[1]=j(r,t[1]),t[2]=j(o,t[2]),t[3]=j(i,t[3]),t[4]=j(a,t[4]),t}function B(e,t,n,r){var o;for(o=15+(t+65>>>9<<4);e.length<=o;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[o]=4294967295&t,e[o-1]=t/4294967296|0,t=e.length,o=0;o<t;o+=16)r=G(e.slice(o,o+16),r);return r}function D(e,t,n){var r,o,i,u,s,c,d,l,f,p,h,w,v,y,g,m,F,R,G,B,D,z,V,K=[];if("SHA-224"===n||"SHA-256"===n)p=64,w=1,z=Number,v=j,y=k,g=T,m=_,F=x,R=I,G=M,D=b,B=P,V=H;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");p=80,w=2,z=a,v=U,y=L,g=N,m=O,F=E,R=W,G=C,D=S,B=A,V=q}for(n=t[0],r=t[1],o=t[2],i=t[3],u=t[4],s=t[5],c=t[6],d=t[7],h=0;h<p;h+=1)16>h?(f=h*w,l=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],K[h]=new z(l,f)):K[h]=y(F(K[h-2]),K[h-7],m(K[h-15]),K[h-16]),l=g(d,G(u),B(u,s,c),V[h],K[h]),f=v(R(n),D(n,r,o)),d=c,c=s,s=u,u=v(i,l),i=o,o=r,r=n,n=v(l,f);return t[0]=v(n,t[0]),t[1]=v(r,t[1]),t[2]=v(o,t[2]),t[3]=v(i,t[3]),t[4]=v(u,t[4]),t[5]=v(s,t[5]),t[6]=v(c,t[6]),t[7]=v(d,t[7]),t}function z(e,t){var n,r,o,i,u=[],s=[];if(null!==e)for(r=0;r<e.length;r+=2)t[(r>>>1)%5][(r>>>1)/5|0]=F(t[(r>>>1)%5][(r>>>1)/5|0],new a(e[r+1],e[r]));for(n=0;24>n;n+=1){for(i=R("SHA3-"),r=0;5>r;r+=1){o=t[r][0];var c=t[r][1],d=t[r][2],l=t[r][3],f=t[r][4];u[r]=new a(o.a^c.a^d.a^l.a^f.a,o.b^c.b^d.b^l.b^f.b)}for(r=0;5>r;r+=1)s[r]=F(u[(r+4)%5],v(u[(r+1)%5],1));for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)t[r][o]=F(t[r][o],s[r]);for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)i[o][(2*r+3*o)%5]=v(t[r][o],V[r][o]);for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)t[r][o]=F(i[r][o],new a(~i[(r+1)%5][o].a&i[(r+2)%5][o].a,~i[(r+1)%5][o].b&i[(r+2)%5][o].b));t[0][0]=F(t[0][0],K[n])}return t}var H,q,V,K;q=[new a((H=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new a(H[1],602891725),new a(H[2],3964484399),new a(H[3],2173295548),new a(H[4],4081628472),new a(H[5],3053834265),new a(H[6],2937671579),new a(H[7],3664609560),new a(H[8],2734883394),new a(H[9],1164996542),new a(H[10],1323610764),new a(H[11],3590304994),new a(H[12],4068182383),new a(H[13],991336113),new a(H[14],633803317),new a(H[15],3479774868),new a(H[16],2666613458),new a(H[17],944711139),new a(H[18],2341262773),new a(H[19],2007800933),new a(H[20],1495990901),new a(H[21],1856431235),new a(H[22],3175218132),new a(H[23],2198950837),new a(H[24],3999719339),new a(H[25],766784016),new a(H[26],2566594879),new a(H[27],3203337956),new a(H[28],1034457026),new a(H[29],2466948901),new a(H[30],3758326383),new a(H[31],168717936),new a(H[32],1188179964),new a(H[33],1546045734),new a(H[34],1522805485),new a(H[35],2643833823),new a(H[36],2343527390),new a(H[37],1014477480),new a(H[38],1206759142),new a(H[39],344077627),new a(H[40],1290863460),new a(H[41],3158454273),new a(H[42],3505952657),new a(H[43],106217008),new a(H[44],3606008344),new a(H[45],1432725776),new a(H[46],1467031594),new a(H[47],851169720),new a(H[48],3100823752),new a(H[49],1363258195),new a(H[50],3750685593),new a(H[51],3785050280),new a(H[52],3318307427),new a(H[53],3812723403),new a(H[54],2003034995),new a(H[55],3602036899),new a(H[56],1575990012),new a(H[57],1125592928),new a(H[58],2716904306),new a(H[59],442776044),new a(H[60],593698344),new a(H[61],3733110249),new a(H[62],2999351573),new a(H[63],3815920427),new a(3391569614,3928383900),new a(3515267271,566280711),new a(3940187606,3454069534),new a(4118630271,4000239992),new a(116418474,1914138554),new a(174292421,2731055270),new a(289380356,3203993006),new a(460393269,320620315),new a(685471733,587496836),new a(852142971,1086792851),new a(1017036298,365543100),new a(1126000580,2618297676),new a(1288033470,3409855158),new a(1501505948,4234509866),new a(1607167915,987167468),new a(1816402316,1246189591)],K=[new a(0,1),new a(0,32898),new a(2147483648,32906),new a(2147483648,2147516416),new a(0,32907),new a(0,2147483649),new a(2147483648,2147516545),new a(2147483648,32777),new a(0,138),new a(0,136),new a(0,2147516425),new a(0,2147483658),new a(0,2147516555),new a(2147483648,139),new a(2147483648,32905),new a(2147483648,32771),new a(2147483648,32770),new a(2147483648,128),new a(0,32778),new a(2147483648,2147483658),new a(2147483648,2147516545),new a(2147483648,32896),new a(0,2147483649),new a(2147483648,2147516424)],V=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},731:(e,t,n)=>{"use strict";var r=n(877),o=n.n(r);function i(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,s,"next",e)}function s(e){i(a,r,o,u,s,"throw",e)}u(void 0)}))}}function u(){return(u=a((function*(e,t){return void 0===t&&(t=!0),yield Store.ChatUtil.sendClear(Store.Chat.get(e),t)}))).apply(this,arguments)}function s(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"throw",e)}a(void 0)}))}}function d(){return(d=c((function*(e,t){return Array.isArray(t)||(t=[t]),!!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>e.id))).length&&(yield window.Store.sendCreateGroup(e,t))}))).apply(this,arguments)}function l(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,u,"next",e)}function u(e){l(i,r,o,a,u,"throw",e)}a(void 0)}))}}function p(e,t){return h.apply(this,arguments)}function h(){return h=f((function*(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("object"==typeof e&&e._serialized&&(e=e._serialized),"string"!=typeof e)return!1;var r=window.Store.MsgKey.fromString(e);if(!r)return!1;var o=window.Store.Msg.get(r);if(!o){var i=window.Store.Chat.get(r.remote);if(!i)return!1;if(yield i.loadEarlierMsgs(),!(o=window.Store.Msg.get(r))){var a=i.getSearchContext(r);a&&a.collection&&a.collection.loadAroundPromise&&(yield a.collection.loadAroundPromise),o=window.Store.Msg.get(r)}}if(!o)return!1;var u=!1;if(n)try{u=WAPI.processMessageObj(o,!0,!0)}catch(e){}else u=o;if("function"!=typeof t)return u;t(u)})),h.apply(this,arguments)}function w(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){w(i,r,o,a,u,"next",e)}function u(e){w(i,r,o,a,u,"throw",e)}a(void 0)}))}}function y(){return y=v((function*(e,t,n,r){var o=new Store.WidFactory.createWid(e),i=WAPI.getChat(o);if(!i)return void 0!==r&&r(!1),!1;Array.isArray(t)||(t=[t]);var a=(yield Promise.all(t.map(function(){var e=v((function*(e){return"string"==typeof e?yield p(e,null,!1):e}));return function(t){return e.apply(this,arguments)}}()))).filter((e=>e));if(0==a.length)return!0;var u=n?[i.sendDeleteMsgs(a,i)]:[i.sendRevokeMsgs(a.filter((e=>e.isSentByMe)),i),i.sendDeleteMsgs(a.filter((e=>!e.isSentByMe)),i)];return Promise.all(u).then((e=>(void 0!==r&&r(!0),!0)))})),y.apply(this,arguments)}function g(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){g(i,r,o,a,u,"next",e)}function u(e){g(i,r,o,a,u,"throw",e)}a(void 0)}))}}function P(){return(P=m((function*(e){return yield new Promise(((t,n)=>{var r=new XMLHttpRequest;r.onload=function(){if(4==r.readyState)if(200==r.status){var e=new FileReader;e.readAsDataURL(r.response),e.onload=function(n){t(e.result.substr(e.result.indexOf(",")+1))}}else console.error(r.statusText);else t(!1)},r.open("GET",e,!0),r.responseType="blob",r.send(null)}))}))).apply(this,arguments)}function A(e,t){var n=e.split(","),r=n[0].match(/(?:data:)?(.*?)(?:;base64)?$/i)[1];r=r.split(/\s+;\s+/).join("; ");for(var o=window.Base64?window.Base64.atob(n[1]):atob(n[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],t,{type:r})}var b=n(276);function S(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function I(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,u,"next",e)}function u(e){S(i,r,o,a,u,"throw",e)}a(void 0)}))}}function W(e){return M.apply(this,arguments)}function M(){return(M=I((function*(e){var t=yield e.arrayBuffer(),n=new b("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")}))).apply(this,arguments)}function C(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function j(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(void 0)}))}}function k(){return(k=j((function*(e,t){var n=yield W(t),r=C(32),o=(new AbortController).signal,i=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:o,mediaKey:r});return O(O({},i),{},{clientUrl:i.url,filehash:n,id:n,uploadhash:i.encFilehash,mediaBlob:t})}))).apply(this,arguments)}function T(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function U(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,u,"next",e)}function u(e){T(i,r,o,a,u,"throw",e)}a(void 0)}))}}function L(){return(L=U((function*(e){var t=[];e?t.push(WAPI.getAllChatsWithNewMsg().map((e=>WAPI.getChat(e.id._serialized)))):t.push(WAPI.getAllChatIds().map((e=>WAPI.getChat(e))));var n=(yield Promise.all(t)).flatMap((e=>e)),r=JSON.stringify(n);return JSON.parse(r)}))).apply(this,arguments)}function N(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function F(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,u,"next",e)}function u(e){N(i,r,o,a,u,"throw",e)}a(void 0)}))}}var R=function(){var e=F((function*(){var e=yield Promise.all(window.Store.Contact.map(function(){var e=F((function*(e){return yield WAPI._serializeContactObj(e)}));return function(t){return e.apply(this,arguments)}}()));return e}));return function(){return e.apply(this,arguments)}}();function G(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){G(i,r,o,a,u,"next",e)}function u(e){G(i,r,o,a,u,"throw",e)}a(void 0)}))}}function D(){return(D=B((function*(e,t,n,r){var o=yield WAPI.sendExist(e),i=[];if(!o.erro){var a=o.msgs.models;for(var u in a)if("remove"!==u){var s=a[u],c=WAPI.processMessageObj(s,t,n);c&&i.push(c)}}return void 0!==r&&r(i),i}))).apply(this,arguments)}var z=function(e){return e.unreadCount>0},H=function(e){var t=window.Store.Chat.filter(z).map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t};function q(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var V=function(){var e,t=(e=function*(){var e=H().map((e=>Store.Msg.findQuery({remote:e.id,count:e.unreadCount-1})));return(yield Promise.all(e)).flat().map(WAPI._serializeMessageObj)},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){q(i,r,o,a,u,"next",e)}function u(e){q(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();function K(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){K(i,r,o,a,u,"next",e)}function u(e){K(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Q(){return(Q=Y((function*(e,t){var n=yield WAPI.getChat(e);return n=!!n&&WAPI._serializeChatObj(n),void 0!==t&&t(n),n}))).apply(this,arguments)}function J(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){J(i,r,o,a,u,"next",e)}function u(e){J(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $(){return($=X((function*(e,t){var n=[],r=window.WAPI.getAllGroups();for(var o in r)try{(yield window.WAPI.getGroupParticipantIDs(r[o].id)).filter((t=>t==e)).length&&n.push(r[o])}catch(e){console.log("Error in group:"),console.log(r[o]),console.log(e)}return void 0!==t&&t(n),n}))).apply(this,arguments)}function Z(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,u,"next",e)}function u(e){Z(i,r,o,a,u,"throw",e)}a(void 0)}))}}function te(e){return ne.apply(this,arguments)}function ne(){return(ne=ee((function*(e){return(yield WAPI.getGroupMetadata(e)).participants}))).apply(this,arguments)}function re(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){re(i,r,o,a,u,"next",e)}function u(e){re(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ie(){return(ie=oe((function*(e,t){var n=(yield te(e)).filter((e=>e.isAdmin)).map((e=>e.id));return void 0!==t&&t(n),n}))).apply(this,arguments)}function ae(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ue(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ae(i,r,o,a,u,"next",e)}function u(e){ae(i,r,o,a,u,"throw",e)}a(void 0)}))}}function se(){return(se=ue((function*(e){var t=Store.Chat.get(e);if(!t)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!t.isGroup)return"";var n;return n=t.groupMetadata&&t.groupMetadata.inviteCode?t.groupMetadata.inviteCode:yield Store.GroupInvite.sendQueryGroupInviteCode(t.id),"https://chat.whatsapp.com/".concat(n)}))).apply(this,arguments)}function ce(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ce(i,r,o,a,u,"next",e)}function u(e){ce(i,r,o,a,u,"throw",e)}a(void 0)}))}}function le(){return(le=de((function*(e){return yield Store.WapQuery.groupInviteInfo(e)}))).apply(this,arguments)}function fe(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fe(i,r,o,a,u,"next",e)}function u(e){fe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function he(){return(he=pe((function*(e,t){var n=window.Store.GroupMetadata.default.find(e);return void 0!==t&&t(n),n}))).apply(this,arguments)}function we(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){we(i,r,o,a,u,"next",e)}function u(e){we(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ye(){return(ye=ve((function*(e,t){var n=(yield te(e)).map((e=>e.id));return void 0!==t&&t(n),n}))).apply(this,arguments)}function ge(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function me(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ge(i,r,o,a,u,"next",e)}function u(e){ge(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Pe(){return(Pe=me((function*(e,t){try{var n=yield window.Store.WapQuery.queryExist(e);if(void 0===n.jid)throw 404;var r=window.WAPI._serializeNumberStatusObj(n);return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r}catch(n){return void 0!==t&&t(window.WAPI._serializeNumberStatusObj({status:n,jid:e})),n}}))).apply(this,arguments)}function Ae(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function be(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ae(i,r,o,a,u,"next",e)}function u(e){Ae(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Se(){return(Se=be((function*(e){return yield Store.MyStatus.getStatus(e)}))).apply(this,arguments)}function Ie(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function We(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ie(i,r,o,a,u,"next",e)}function u(e){Ie(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Me(){return(Me=We((function*(e){e="string"==typeof e?e:e._serialized;var t=WAPI.getChat(e);return Store.GroupActions.sendExitGroup(t)}))).apply(this,arguments)}function Ce(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ce(i,r,o,a,u,"next",e)}function u(e){Ce(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Oe(e,t){return xe.apply(this,arguments)}function xe(){return(xe=_e((function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield Store.Msg.findQuery({remote:n.id,count:-1})}catch(e){}for(;!n.msgs.msgLoadState.noEarlierMsgs;)yield n.loadEarlierMsgs();return t&&t(!0),!0}))).apply(this,arguments)}function Ee(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function je(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ee(i,r,o,a,u,"next",e)}function u(e){Ee(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ke(){return(ke=je((function*(e,t,n,r){return WAPI.loadAllEarlierMessages(e).then((o=>{var i=WAPI.getChat(e);if(!i)throw{error:!0,code:"chat_not_found",message:"Chat not found"};var a=[],u=i.msgs.models;for(var s in u)if("remove"!==s){var c=u[s],d=WAPI.processMessageObj(c,t,n);d&&a.push(d)}return void 0!==r&&r(a),a}))}))).apply(this,arguments)}function Te(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Ue(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Te(i,r,o,a,u,"next",e)}function u(e){Te(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Le(){return(Le=Ue((function*(e){var t=WAPI.getChat(e);if(t){var n=yield t.loadEarlierMsgs();if(n)return n.map(WAPI._serializeMessageObj)}return!1}))).apply(this,arguments)}function Ne(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Fe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ne(i,r,o,a,u,"next",e)}function u(e){Ne(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Re(e,t){return Ge.apply(this,arguments)}function Ge(){return(Ge=Fe((function*(e,t){Array.isArray(t)||(t=[t]);var n=new Store.MediaCollection({chatParticipantCount:e.getParticipantCount()});return yield n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,1),n}))).apply(this,arguments)}function Be(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function De(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Be(i,r,o,a,u,"next",e)}function u(e){Be(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ze(){return(ze=De((function*(e){var t=Store.Chat.get(e);if(!t)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!t.isGroup)return!1;var n=yield Store.GroupInvite.sendRevokeGroupInviteCode(t.id);return"https://chat.whatsapp.com/".concat(n)}))).apply(this,arguments)}function He(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){He(i,r,o,a,u,"next",e)}function u(e){He(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ve(){return(Ve=qe((function*(e,t){e=parseInt(e,10);var n=window.Store.Chat.get(t);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};switch(e){case 0:window.Store.ChatStates.sendChatStateComposing(n.id);break;case 1:window.Store.ChatStates.sendChatStateRecording(n.id);break;case 2:window.Store.ChatStates.sendChatStatePaused(n.id);break;default:return!1}return!0}))).apply(this,arguments)}function Ke(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ke(i,r,o,a,u,"next",e)}function u(e){Ke(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qe(e,t,n,r,o){return Je.apply(this,arguments)}function Je(){return Je=Ye((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(o=o||"sendFile","string"!=typeof n&&null!=n||"string"!=typeof r&&null!=r){var u="incorrect parameter, insert an string.";return WAPI.scope(t,!0,null,u)}var s=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);s&&s.length&&(s=s[1]);var c=yield WAPI.sendExist(t);if(c.erro)return c;var d=null;if("string"==typeof i&&i){var l=yield p(i,null,!1);l&&l.canReply()&&(d=l)}var f=A(e,n),h=yield Re(c,f),w=h.models[0],v=(yield w.sendToChat(c,{caption:r,quotedMsg:d,isViewOnce:a}))||"",y={type:o,filename:n,text:r,mimeType:s},g=yield WAPI.getchatId(c.id);if("success"===v||"OK"===v){var m=WAPI.scope(g,!1,v,null);return Object.assign(m,y),m}return m=WAPI.scope(g,!0,v,null),Object.assign(m,y),m})),Je.apply(this,arguments)}function Xe(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xe(i,r,o,a,u,"next",e)}function u(e){Xe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ze(){return Ze=$e((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=yield WAPI.sendExist(t);if(a.erro)return a;var u=null;if("string"==typeof i&&i){var s=yield p(i,null,!1);s&&s.canReply()&&(u=s)}var c=A(e,n),d=yield Re(a,c),l=d.models[0];l.mediaPrep._mediaData.type="ptt";var f=(yield l.sendToChat(a,{caption:r,quotedMsg:u}))||"";void 0!==o&&o(!0);var h={type:"ptt",filename:n,text:r},w=yield WAPI.getchatId(a.id);if("success"===f||"OK"===f){var v=WAPI.scope(w,!1,f,null);return Object.assign(v,h),v}return v=WAPI.scope(w,!0,f,null),Object.assign(v,h),v})),Ze.apply(this,arguments)}function et(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function tt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){et(i,r,o,a,u,"next",e)}function u(e){et(i,r,o,a,u,"throw",e)}a(void 0)}))}}function nt(e,t,n,r){return rt.apply(this,arguments)}function rt(){return(rt=tt((function*(e,t,n,r){var o=yield WAPI.sendExist(t);if(o.erro)return o;var i=new window.Store.Sticker.default.modelClass;i.__x_clientUrl=e.clientUrl,i.__x_filehash=e.filehash,i.__x_id=e.filehash,i.__x_uploadhash=e.uploadhash,i.__x_mediaKey=e.mediaKey,i.__x_initialized=!1,i.__x_mediaData.mediaStage="INIT",i.mimetype="image/webp",i.height=n&&n.height?n.height:512,i.width=n&&n.width?n.width:512,yield i.initialize();var a,u=(yield i.sendToChat(o,{stickerIsFirstParty:!1,stickerSendOrigin:6}))||"",s={type:r},c=yield WAPI.getchatId(o.id);return"OK"===u?(a=WAPI.scope(c,!1,u,null),Object.assign(a,s),a):(a=WAPI.scope(c,!0,u,null),Object.assign(a,s),a)}))).apply(this,arguments)}function ot(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function it(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ot(i,r,o,a,u,"next",e)}function u(e){ot(i,r,o,a,u,"throw",e)}a(void 0)}))}}function at(e,t,n,r){return ut.apply(this,arguments)}function ut(){return(ut=it((function*(e,t,n,r){var o=A("data:image/webp;base64,"+e,"file.webp"),i=yield window.WAPI.encryptAndUploadFile("sticker",o);return yield nt(i,t,n,r)}))).apply(this,arguments)}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ct(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function dt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ct(i,r,o,a,u,"next",e)}function u(e){ct(i,r,o,a,u,"throw",e)}a(void 0)}))}}function lt(){return lt=dt((function*(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=yield WAPI.sendExist(e);if(o.erro)return o;var i,a=yield window.WAPI.getNewMessageId(o.id),u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:Store.UserPrefs.getMaybeMeUser(),to:o.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},s=(yield Promise.all(Store.addAndSendMsgToChat(o,u)))[1]||"",c={latitude:t,longitude:n,title:r,type:"location"},d=yield WAPI.getchatId(o.id);return"success"==s||"OK"==s?(i=WAPI.scope(d,!1,s,null),Object.assign(i,c),i):(i=WAPI.scope(d,!0,s,null),Object.assign(i,c),i)})),lt.apply(this,arguments)}function ft(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function pt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ft(i,r,o,a,u,"next",e)}function u(e){ft(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ht(){return(ht=pt((function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=yield window.WAPI.getNewMessageId(n.id),o={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:Store.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},i=(yield Promise.all(Store.addAndSendMsgToChat(n,o)))[1]||"";if("success"===i||"OK"===i)return null==r?void 0:r._serialized;var a={type:"sendtext",text:o},u=yield WAPI.getchatId(n.id),s=WAPI.scope(u,!0,i,null);return Object.assign(s,a),s}))).apply(this,arguments)}function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach((function(t){yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function mt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){gt(i,r,o,a,u,"next",e)}function u(e){gt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Pt(){return Pt=mt((function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Store.Chat.get(e),o={};n.attachment&&(t=(o=yield WWebJS.processMediaData(n.attachment,n.sendAudioAsVoice)).preview,delete n.attachment);var i={};if(n.quotedMessageId){var a=yield p(n.quotedMessageId,null,!1);a&&a.canReply()&&(i=a.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map((e=>window.Store.Contact.get(e).id)));var u={};n.location&&(u={type:"location",loc:n.location.description,lat:n.location.latitude,lng:n.location.longitude},delete n.location);var s={};if(n.contactCard){var c=window.Store.Contact.get(n.contactCard);s={body:window.Store.VCard.vcardFromContactModel(c).vcard,type:"vcard",vcardFormattedName:c.formattedName},delete n.contactCard}else if(n.contactCardList){var d=n.contactCardList.map((e=>window.Store.Contact.get(e))),l=d.map((e=>window.Store.VCard.vcardFromContactModel(e)));s={type:"multi_vcard",vcardList:l,body:void 0},delete n.contactCardList}else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var f=yield window.Store.VCard.parseVcard(t);f&&(s={type:"vcard",vcardFormattedName:yield window.Store.VCard.vcardGetNameFromParsed(f)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var h=yield window.Store.Validators.findLink(t);if(h){var w=yield window.Store.Wap2.default.queryLinkPreview(h.url);w.preview=!0,w.subtype="url",n=vt(vt({},n),w)}}var v=yield window.WAPI.getNewMessageId(r.id),y=yield Store.UserPrefs.getMaybeMeUser(),g=vt(vt(vt(vt(vt({id:v,ack:0,body:t,from:y,to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),u),o),i),s);return yield window.Store.addAndSendMsgToChat(r,g),v._serialized})),Pt.apply(this,arguments)}function At(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function bt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){At(i,r,o,a,u,"next",e)}function u(e){At(i,r,o,a,u,"throw",e)}a(void 0)}))}}function St(){return(St=bt((function*(e,t){var n=e.id?e:Store.Chat.get(e),r=n.id._serialized,o=n.msgs.filter((e=>e.__x_isSentByMe))[0];if(!o)return n.sendMessage(t);var i=Object.create(o),a=window.WAPI.getNewMessageId(r),u=t.match(/@(\d*)/g).map((e=>new Store.WidFactory.createUserWid(e.replace("@",""))))||void 0,s={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new Store.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:u};return Object.assign(i,s),yield Store.addAndSendMsgToChat(n,i),a._serialized}))).apply(this,arguments)}function It(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Wt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){It(i,r,o,a,u,"next",e)}function u(e){It(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Mt(){return(Mt=Wt((function*(e,t){if(!e)return!1;var n=window.WAPI.getChat(e);return void 0!==n?(yield Store.ReadSeen.sendSeen(n,!1),t&&t(!0),!0):(t&&t(!1),!1)}))).apply(this,arguments)}function Ct(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ct(i,r,o,a,u,"next",e)}function u(e){Ct(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ot(){return(Ot=_t((function*(e,t,n,r,o){var i=yield WAPI.sendExist(t);if(i.erro)return i;var a=A(e,n),u=(yield Re(i,a)).models[0];u.mediaPrep._mediaData.isGif=!0,u.mediaPrep._mediaData.gifAttribution=1;var s=(yield u.sendToChat(i,{caption:r}))||"",c={filename:n,text:r},d=yield WAPI.getchatId(i.id);if("success"===s||"OK"===s){void 0!==o&&o(!1);var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return void 0!==o&&o(!0),l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l}))).apply(this,arguments)}function xt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Et(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xt(i,r,o,a,u,"next",e)}function u(e){xt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function jt(){return(jt=Et((function*(e){yield window.Store.Perfil.setPushname(e)}))).apply(this,arguments)}function kt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ut(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Lt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ut(i,r,o,a,u,"next",e)}function u(e){Ut(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Nt(){return Nt=Lt((function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=window.Store.Chat.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var o,i=[],a=kt(t);try{for(a.s();!(o=a.n()).done;){var u=o.value,s="string"==typeof u?u:u.id,c=yield p(s,null,!1);if(!c)throw{error:!0,code:"message_not_found",message:"Message not Found",messageId:s};i.push(c)}}catch(e){a.e(e)}finally{a.f()}var d=i.filter((e=>!n||!e.isSentByMe));return yield r.forwardMessages(d),yield new Promise((e=>setTimeout(e,100))),r.msgs.models.slice(-1*t.length).map((e=>e.id._serialized))})),Nt.apply(this,arguments)}function Ft(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Rt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ft(i,r,o,a,u,"next",e)}function u(e){Ft(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Gt(){return(Gt=Rt((function*(e,t,n){var r=yield WAPI.sendExist(e),o=yield WAPI.sendExist(t);if(r.id&&o.id){var i=window.WAPI.getNewMessageId(r.id),a=new Store.Contact.modelClass(o.contact);n&&(a.name=n,Object.defineProperty(a,"formattedName",{value:n}));var u={ack:0,body:(yield window.Store.Vcard.vcardFromContactModel(a)).vcard,from:Store.UserPrefs.getMaybeMeUser(),local:!0,self:"out",id:i,vcardFormattedName:a.formattedName,t:parseInt((new Date).getTime()/1e3),to:r.id,type:"vcard",isNewMsg:!0},s=(yield Promise.all(Store.addAndSendMsgToChat(r,u)))[1]||"",c={from:t,type:"vcard"},d=yield WAPI.getchatId(r.id);if("success"===s||"OK"===s){var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l}return r}))).apply(this,arguments)}function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){zt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ht(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ht(i,r,o,a,u,"next",e)}function u(e){Ht(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Vt(){return(Vt=qt((function*(e,t,n){var r=Store.Chat.get(e),o={};if(n){var i=yield p(n,null,!1);i&&i.canReply()&&(o=i.msgContextInfo(r))}var a=yield window.WAPI.getNewMessageId(r.id),u=Dt({id:a,ack:0,body:t,from:yield Store.UserPrefs.getMaybeMeUser(),to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},o);return yield window.Store.addAndSendMsgToChat(r,u),a._serialized}))).apply(this,arguments)}function Kt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Yt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Kt(i,r,o,a,u,"next",e)}function u(e){Kt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qt(){return(Qt=Yt((function*(e){var t=window.Store.Chat.get(e);if(!t)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};yield Store.ChatPresence.markComposing(t)}))).apply(this,arguments)}function Jt(){return(Jt=Yt((function*(e){var t=window.Store.Chat.get(e);if(!t)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};yield Store.ChatPresence.markPaused(t)}))).apply(this,arguments)}function Xt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xt(i,r,o,a,u,"next",e)}function u(e){Xt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Zt(){return Zt=$t((function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=yield WPP.chat.getMessages(e,t);if(!Array.isArray(n)){var r=new Error("Failed to fetch messages for ".concat(e));throw Object.assign(r,n),r}var o=n.map((e=>new Store.Msg.modelClass(e))).map((e=>WAPI.processMessageObj(e,!0,!0)));return o})),Zt.apply(this,arguments)}function en(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function tn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){en(i,r,o,a,u,"next",e)}function u(e){en(i,r,o,a,u,"throw",e)}a(void 0)}))}}function nn(){return(nn=tn((function*(e){if(!e)return!1;var t=window.Store.Contact.get(e);return void 0!==t&&(yield Store.Block.blockContact(t),!0)}))).apply(this,arguments)}function rn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function on(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rn(i,r,o,a,u,"next",e)}function u(e){rn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function an(){return(an=on((function*(e){if(!e)return!1;var t=window.Store.Contact.get(e);return void 0!==t&&(yield Store.Block.unblockContact(t),!0)}))).apply(this,arguments)}function un(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function sn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){un(i,r,o,a,u,"next",e)}function u(e){un(i,r,o,a,u,"throw",e)}a(void 0)}))}}function cn(){return(cn=sn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.removeParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.removeParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function dn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ln(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){dn(i,r,o,a,u,"next",e)}function u(e){dn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function fn(){return(fn=ln((function*(e,t){var n=Store.Chat.get(e);return Array.isArray(t)||(t=[t]),!!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>e.id))).length&&(yield window.Store.WapQuery.addParticipants(n.id,t),t.map((e=>n.groupMetadata.participants.get(e))),yield window.Store.Participants.addParticipants(n,t),!0)}))).apply(this,arguments)}function pn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function hn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pn(i,r,o,a,u,"next",e)}function u(e){pn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function wn(){return(wn=hn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.promoteParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.promoteParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function vn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vn(i,r,o,a,u,"next",e)}function u(e){vn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function gn(){return(gn=yn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.demoteParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.demoteParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function mn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Pn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mn(i,r,o,a,u,"next",e)}function u(e){mn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function An(){return(An=Pn((function*(e){var t=Store.Chat.get(e);return Store.Cmd.default.openChatBottom(t)}))).apply(this,arguments)}function bn(){return(bn=Pn((function*(e,t){var n=Store.Chat.get(e),r=n.msgs.models.find((e=>e.id.id===t)),o={collection:n.msgs,msg:r,isUnreadDivider:!1};return yield Store.Cmd.default._openChat(n,o)}))).apply(this,arguments)}function Sn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Sn(i,r,o,a,u,"next",e)}function u(e){Sn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Wn(){return(Wn=In((function*(e){return yield Store.WapQuery.acceptGroupInvite(e)}))).apply(this,arguments)}function Mn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Cn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Mn(i,r,o,a,u,"next",e)}function u(e){Mn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function _n(){return(_n=Cn((function*(e){if(!e)return!1;var t=window.WAPI.getChat(e);return void 0!==t&&(yield Store.ReadSeen.markUnread(t,!0),!0)}))).apply(this,arguments)}function On(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function xn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){On(i,r,o,a,u,"next",e)}function u(e){On(i,r,o,a,u,"throw",e)}a(void 0)}))}}function En(){return(En=xn((function*(){var e=yield Store.Blocklist,t=[];if(void 0!==e&&void 0!==e._index){for(var n in e._index)t.push(n);return t}return!1}))).apply(this,arguments)}function jn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function kn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jn(i,r,o,a,u,"next",e)}function u(e){jn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Tn(){return(Tn=kn((function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")}))).apply(this,arguments)}function Un(){return(Un=kn((function*(){return yield Store.Theme.getTheme()}))).apply(this,arguments)}function Ln(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Nn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ln(i,r,o,a,u,"next",e)}function u(e){Ln(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Fn(){return(Fn=Nn((function*(){return yield Store.ServiceWorker.default.restart(),!0}))).apply(this,arguments)}function Rn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Gn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Rn(i,r,o,a,u,"next",e)}function u(e){Rn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Bn(){return(Bn=Gn((function*(){return yield Store.ServiceWorker.default.killServiceWorker(),!0}))).apply(this,arguments)}function Dn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function zn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Dn(i,r,o,a,u,"next",e)}function u(e){Dn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Hn(){return(Hn=zn((function*(e,t,n){n=n||"";var r={Protocol:"^(https?:\\/\\/)?",Domain:"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|",IP:"((\\d{1,3}\\.){3}\\d{1,3}))",Port:"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*",Query:"(\\?[;&a-z\\d%_.~+=-]*)?",End:"(\\#[-a-z\\d_]*)?$",Reg:()=>new RegExp(r.Protocol+r.Domain+r.IP+r.Port+r.Query+r.End,"i")};if(!r.Reg().test(t))return n="Use a valid HTTP protocol. Example: https://www.youtube.com/watch?v=V1bFr2SWP1",WAPI.scope(e,!0,null,n);var o=yield WAPI.sendExist(e);if(o.erro)return o;var i=yield Store.WapQuery.queryLinkPreview(t),a=(yield o.sendMessage(n.includes(t)?n:"".concat(t,"\n").concat(n),{linkPreview:i}))||"",u={type:"LinkPreview",url:t,text:n},s=yield WAPI.getchatId(o.id);if("success"===a||"OK"===a){var c=WAPI.scope(s,!1,a,null);return Object.assign(c,u),c}return c=WAPI.scope(s,!0,a,null),Object.assign(c,u),c}))).apply(this,arguments)}function qn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Vn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){qn(i,r,o,a,u,"next",e)}function u(e){qn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Kn(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o={me:Store.Me.attributes,to:e,erro:t,text:r,status:n};return o}function Yn(){return(Yn=Vn((function*(e){var t=yield WAPI.getChatById(e),n=t.lastReceivedKey||{},r={formattedName:t.contact.formattedName,isBusiness:t.contact.isBusiness,isMyContact:t.contact.isMyContact,verifiedName:t.contact.verifiedName,pushname:t.contact.pushname};return Object.assign(n,r),n}))).apply(this,arguments)}function Qn(){return Qn=Vn((function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return Kn(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new Store.Chat.modelClass({id:Store.WidFactory.createWid("status@broadcast")}),Store.Chat.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var o=yield window.WAPI.checkNumberStatus(e);if(!o.numberExists)return Kn(e,!0,o.status,"The number does not exist");yield WPP.chat.find(o.id),e=o.id._serialized,r=yield window.WAPI.getChat(e)}return r?(n&&(yield window.Store.SendSeen(r,!1)),t?r:Kn(e,!1,200)):Kn(e,!0,404)})),Qn.apply(this,arguments)}function Jn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jn(i,r,o,a,u,"next",e)}function u(e){Jn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $n(){return $n=Xn((function*(e,t){if("string"!=typeof e){var n="incorrect parameter, insert an string. Example: '222222222222@c.us'";return WAPI.scope(e,!0,null,n)}if(!Array.isArray(t))return n="incorrect parameter, insert an array. Example: ['222222222222@c.us', '333333333333@c.us, ... ]",WAPI.scope(e,!0,null,n);if(1===t.length)return n="Enter more than one number to send. Example: ['222222222222@c.us', '333333333333@c.us, ... ]",WAPI.scope(e,!0,null,n);var r=yield WAPI.sendExist(e);if(r.erro)return r;var o=t.map(function(){var e=Xn((function*(e){var t=e,n=null;"object"==typeof e&&(t=e.id,n=e.name);var r=yield WAPI.sendExist(t),o=new Store.Contact.modelClass(r.contact);return n&&(o.name=n,Object.defineProperty(o,"formattedName",{value:n})),yield window.Store.Vcard.vcardFromContactModel(o)}));return function(t){return e.apply(this,arguments)}}()),i=window.WAPI.getNewMessageId(r.id),a=yield Promise.all(o),u={ack:0,from:Store.UserPrefs.getMaybeMeUser(),local:!0,self:"out",id:i,t:parseInt((new Date).getTime()/1e3),to:r.id,type:"multi_vcard",vcardList:a,isNewMsg:!0},s=(yield Promise.all(Store.addAndSendMsgToChat(r,u)))[1]||"",c={from:t,type:"multi_vcard"},d=yield WAPI.getchatId(r.id);if("success"===s||"OK"===s){var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l})),$n.apply(this,arguments)}function Zn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function er(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function tr(){return(tr=er((function*(e,t){t||(t=Store.UserPrefs.getMaybeMeUser());var n=Store.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield Store.Profile.sendSetPicture(n,r+e.b,r+e.a)}))).apply(this,arguments)}function nr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nr(i,r,o,a,u,"next",e)}function u(e){nr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function or(){return or=rr((function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("boolean"!=typeof t||"boolean"!=typeof n){var r="incorrect parameter, insert a boolean true or false";return WAPI.scope(e,!0,null,r)}var o=t?"pin":"unpin",i=void 0,a=yield WAPI.sendExist(e,!0,n);if(a.erro)return a;var u={type:"pinChat",typefix:o},s=yield WAPI.getchatId(a.id);return yield Store.pinChat.setPin(a,t).then((e=>{var t=WAPI.scope(s,!1,"OK",null);Object.assign(t,u),i=t})).catch((e=>{var t=WAPI.scope(s,!0,e,"Pin Chat first");Object.assign(t,u),i=t})),i})),or.apply(this,arguments)}function ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ar(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ir(i,r,o,a,u,"next",e)}function u(e){ir(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ur(){return(ur=ar((function*(){if(window.localStorage){var e=yield JSON.parse(JSON.stringify(window.localStorage));return{WABrowserId:e.WABrowserId,WASecretBundle:e.WASecretBundle,WAToken1:e.WAToken1,WAToken2:e.WAToken2}}}))).apply(this,arguments)}function sr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function cr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sr(i,r,o,a,u,"next",e)}function u(e){sr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function dr(){return(dr=cr((function*(e,t,n){var r=yield WAPI.sendExist(e);if(r.erro)return r;var o,i=null,a=null,u=null,s=yield WAPI.getchatId(r.id),c=yield window.Store.Mute.get(r.id),d={type:"sendMute",time:t,timeType:n};if("number"==typeof t&&"string"==typeof n){switch(n){case"hours":i=parseInt(new Date((new Date).setHours((new Date).getHours()+t)).getTime()/1e3);break;case"minutes":i=parseInt(new Date((new Date).setMinutes((new Date).getMinutes()+t)).getTime()/1e3);break;case"year":i=parseInt(new Date((new Date).setDate((new Date).getDate()+t)).getTime()/1e3)}yield window.Store.SendMute.sendConversationMute(r.id,i,0).then((e=>{a=e})).catch((e=>{a=e}))}else u=!0,yield window.Store.SendMute.sendConversationMute(r.id,0,c.__x_expiration).then((e=>{a=e})).catch((e=>{a=e}));if(200===a.status){u?(c.__x_expiration=0,c.__x_isMuted=!1):(c.__x_expiration=i,c.__x_isMuted=!0);var l=WAPI.scope(s,!1,a.status,null);return Object.assign(l,d),l}return o=u?"is not mute to remove":"This chat is already mute",l=WAPI.scope(s,!0,a.status,o),Object.assign(l,d),l}))).apply(this,arguments)}function lr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function fr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lr(i,r,o,a,u,"next",e)}function u(e){lr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function pr(){return pr=fr((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=(yield window.Store.Mute)._models,n=new Array,r=new Array;for(var o in t)t[o].__x_isMuted?r.push(WAPI.interfaceMute(t[o])):n.push(WAPI.interfaceMute(t[o]));var i=null;switch(console.log(0,e),e){case"all":i=[{total:r.length+n.length,amountToMute:r.length,amountnoMute:n.length},r,n];break;case"toMute":i=[{total:r.length},r];break;case"noMute":i=[{total:n.length},n]}return i})),pr.apply(this,arguments)}function hr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){hr(i,r,o,a,u,"next",e)}function u(e){hr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function vr(e){return yr.apply(this,arguments)}function yr(){return(yr=wr((function*(e){var t=yield p(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if(!t.mediaData)throw{error:!0,code:"message_not_contains_media",message:"Message not contains media"};yield t.downloadMedia({downloadEvenIfExpensive:!0,rmrReason:1,isUserInitiated:!0});var n=null;if(t.mediaData.mediaBlob?n=t.mediaData.mediaBlob.forceToBlob():t.mediaData.filehash&&(n=Store.BlobCache.get(t.mediaData.filehash)),!n&&t.mediaObject.type&&"VIDEO"===t.mediaObject.type)return delete t.mediaObject.type,t.type="document",vr(e);if(!n)throw{error:!0,code:"media_not_found",message:"Media not found"};return yield new Promise(((e,t)=>{var r=new FileReader;r.onloadend=function(t){e(r.result)},r.onabort=t,r.onerror=t,r.readAsDataURL(n)}))}))).apply(this,arguments)}function gr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function mr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){gr(i,r,o,a,u,"next",e)}function u(e){gr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var Pr=null,Ar=!0;function br(){return Sr.apply(this,arguments)}function Sr(){return(Sr=mr((function*(){return window.WAPI.waitForStore(["State","Stream"],(()=>{if("MAIN"===window.Store.Stream.mode&&"TIMEOUT"!==window.Store.State.default.state)return Ar?(Ar=!1,window.Store.State.default.sendBasic({tag:window.Store.State.default.tag("ping"),data:["admin","test"]}).then((()=>{Ar=!0}))):(window.Store.State.default.phoneWatchdog.activate(),void window.Store.State.default.phoneWatchdog.poke(250))}))}))).apply(this,arguments)}function Ir(){Pr&&clearInterval(Pr),Pr=null}function Wr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cr(i,r,o,a,u,"next",e)}function u(e){Cr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Or(){return Or=_r((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Wr(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new Store.WidFactory.createWid(o);Store.Presence.get(i)||(yield Store.Presence.find(i),n++)}}catch(e){r.e(e)}finally{r.f()}return n})),Or.apply(this,arguments)}function xr(){return(xr=_r((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Wr(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new Store.WidFactory.createWid(o),a=Store.Presence.get(i);a&&(a.delete(),n++)}}catch(e){r.e(e)}finally{r.f()}return n}))).apply(this,arguments)}function Er(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function jr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Tr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){kr(i,r,o,a,u,"next",e)}function u(e){kr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ur(e){return Lr.apply(this,arguments)}function Lr(){return(Lr=Tr((function*(e){var t=yield Store.Call.get(e);if(!t)throw{error:!0,code:"call_not_found",message:"Call not found"};if("INCOMING_RING"!==t.getState())throw{error:!0,code:"call_is_not_incoming_ring",message:"Call is not incoming ring"};return yield Store.sendCallSignalingMsg({common:{peer_jid:t.peerJid},payload:["reject",{"call-id":t.id,"call-creator":t.peerJid.toString({legacy:!0}),count:"0"},null]})}))).apply(this,arguments)}function Nr(){return Nr=Tr((function*(e){if(e)return yield Ur(e),1;var t,n=Store.Call.models.filter((e=>"INCOMING_RING"===e.getState())),r=Er(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;yield Ur(o.id).catch((e=>null))}}catch(e){r.e(e)}finally{r.f()}return n.lenth})),Nr.apply(this,arguments)}function Fr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Fr(i,r,o,a,u,"next",e)}function u(e){Fr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Gr(){return(Gr=Rr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!n.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};if(n.groupMetadata.desc==t)throw{error:!0,code:"redundant_change",message:"You can not change group description to same name"};var r=Store.randomMessageId(),o=n.groupMetadata.descId,i=yield Store.sendSetGroupDescription(n.id,t,r,o).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}));return n.groupMetadata.desc=t,i}))).apply(this,arguments)}function Br(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Dr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Br(i,r,o,a,u,"next",e)}function u(e){Br(i,r,o,a,u,"throw",e)}a(void 0)}))}}function zr(){return(zr=Dr((function*(e,t,n){var r=Store.Chat.get(e);if(!r)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!r.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};var o=["announcement","restrict","no_frequently_forwarded","ephemeral"];if(!o.includes(t))throw{error:!0,code:"invalid_property",message:"Invalid property, none of ("+o.join(", ")+")"};return"ephemeral"===t&&(n=n?604800:0),yield Store.sendSetGroupProperty(r.id,t,n).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}))}))).apply(this,arguments)}function Hr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hr(i,r,o,a,u,"next",e)}function u(e){Hr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Vr(){return(Vr=qr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!n.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};if(n.name==t)throw{error:!0,code:"redundant_change",message:"You can not change group subject to same name"};var r=yield Store.sendSetGroupSubject(n.id,t).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}));return n.name=t,r}))).apply(this,arguments)}function Kr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Yr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Kr(i,r,o,a,u,"next",e)}function u(e){Kr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qr(){return(Qr=Yr((function*(e){void 0===e&&(e=!0),e?yield Store.ChatPresence.sendPresenceAvailable():yield Store.ChatPresence.sendPresenceUnavailable()}))).apply(this,arguments)}function Jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jr(i,r,o,a,u,"next",e)}function u(e){Jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $r(){return($r=Xr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};return n.isGroup?yield WAPI.setGroupProperty(n.id,"ephemeral",t):(t=t?604800:0,yield Store.changeEphemeralDuration(n,t).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}})),!0)}))).apply(this,arguments)}function Zr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function eo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zr(i,r,o,a,u,"next",e)}function u(e){Zr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function to(){return to=eo((function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=eo((function*(e){return yield p(e,null,!1)}));return function(t){return e.apply(this,arguments)}}())),r=(n=n.filter((e=>e&&e.star!==t))).reduce((function(e,t){var n=t.id.remote._serialized;return e[n]=e[n]||[],e[n].push(t),e}),Object.create(null)),o=0,i=function*(e){var n=Store.Chat.get(e),i=r[e];o+=(yield n.sendStarMsgs(i,t).then((()=>i.length)).catch((()=>0)))};for(var a in r)yield*i(a);return o})),to.apply(this,arguments)}function no(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ro(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){no(i,r,o,a,u,"next",e)}function u(e){no(i,r,o,a,u,"throw",e)}a(void 0)}))}}function oo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return io(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?io(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function io(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ao(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var uo={};function so(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var co=function(){var e,t=(e=function*(e){var t=Store.WidFactory.createDeviceWid(e),n=Store.ProfilePicThumb.get(t);return n||(n=yield Store.ProfilePicThumb.find(t)),n?WAPI._serializeProfilePicThumb(n):null},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){so(i,r,o,a,u,"next",e)}function u(e){so(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function lo(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function fo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lo(i,r,o,a,u,"next",e)}function u(e){lo(i,r,o,a,u,"throw",e)}a(void 0)}))}}function po(){return(po=fo((function*(e){var t=window.Store.Catalog.get(e);if(t||(t=yield window.Store.Catalog.find(Store.WidFactory.createWid(e))),!t)throw{error:!0,code:"catalog_not_found",message:"Catalog not found"};return t.productCollection?t.productCollection.serialize():[]}))).apply(this,arguments)}function ho(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ho(i,r,o,a,u,"next",e)}function u(e){ho(i,r,o,a,u,"throw",e)}a(void 0)}))}}function vo(){return(vo=wo((function*(e){var t=yield p(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if("order"!==t.type)throw{error:!0,code:"message_is_not_an_order",message:"Message is not an order"};var n=window.Store.Order.get(t.orderId);if(n||(n=yield window.Store.Order.findOrder(t.orderId,t.sellerJid,t.token)),!n)throw{error:!0,code:"order_not_found",message:"Order not found"};return n.products}))).apply(this,arguments)}var yo,go;function mo(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Po(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mo(i,r,o,a,u,"next",e)}function u(e){mo(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}if(window.webpackJsonp=window.webpackJsonp||[],window.webpackChunkbuild=window.webpackChunkbuild||[],void 0===window.Store){window.Store={},window.Store.promises={};var bo=new(o());window.Store.loader=bo;var So,Io=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ao(e,t):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}([{id:"Store",conditions:e=>e.default&&e.default.Chat&&e.default.Msg?e.default:null},{id:"MediaCollection",conditions:e=>e.default&&e.default.prototype&&void 0!==e.default.prototype.processAttachments?e.default:null},{id:"MediaProcess",conditions:e=>e.BLOB?e:null},{id:"ChatUtil",conditions:e=>e.sendClear&&e.clearChat?e:null},{id:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"Wap",conditions:e=>e.createGroup?e:null},{id:"ServiceWorker",conditions:e=>e.default&&e.default.killServiceWorker?e:null},{id:"State",conditions:e=>e.STATE&&e.STREAM?e:null},{id:"WapDelete",conditions:e=>e.sendConversationDelete&&2==e.sendConversationDelete.length?e:null},{id:"Conn",conditions:e=>e.default&&e.Conn?e.default:null},{id:"WapQuery",conditions:e=>e.default&&e.default.queryExist&&e.default.getCapabilities?e.default:null},{id:"CryptoLib",conditions:e=>e.decryptE2EMedia?e:null},{id:"OpenChat",conditions:e=>e.default&&e.default.prototype&&e.default.prototype.openChat?e.default:null},{id:"UserConstructor",conditions:e=>e.default&&e.default.prototype&&e.default.prototype.isServer&&e.default.prototype.isUser?e.default:null},{id:"SendTextMsgToChat",conditions:e=>e.sendTextMsgToChat?e.sendTextMsgToChat:null},{id:"SendSeen",conditions:e=>e.sendSeen?e.sendSeen:null},{id:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"sendDelete",conditions:e=>e.sendDelete?e.sendDelete:null},{id:"addAndSendMsgToChat",conditions:e=>e.addAndSendMsgToChat?e.addAndSendMsgToChat:null},{id:"sendMsgToChat",conditions:e=>e.sendMsgToChat?e.sendMsgToChat:null},{id:"Catalog",conditions:e=>e.Catalog?e.Catalog:null},{id:"Perfil",conditions:e=>!0===e.__esModule&&e.setPushname&&!e.getComposeContents?e:null},{id:"MsgKey",conditions:e=>e.default&&"function"==typeof e.default.toString&&e.default.toString().includes("MsgKey error: obj is null/undefined")?e.default:null},{id:"Parser",conditions:e=>e.convertToTextWithoutSpecialEmojis?e.default:null},{id:"Builders",conditions:e=>e.TemplateMessage&&e.HydratedFourRowTemplate?e:null},{id:"Me",conditions:e=>e.PLATFORMS&&e.Conn?e.default:null},{id:"CallUtils",conditions:e=>e.sendCallEnd&&e.parseCall?e:null},{id:"Identity",conditions:e=>e.queryIdentity&&e.updateIdentity?e:null},{id:"MyStatus",conditions:e=>e.getStatus&&e.setMyStatus?e:null},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?e:null},{id:"ChatPresence",conditions:e=>e.markComposing&&e.markPaused&&e.markRecording?e:null},{id:"GroupActions",conditions:e=>e.sendExitGroup&&e.localExitGroup?e:null},{id:"Features",conditions:e=>e.FEATURE_CHANGE_EVENT&&e.features?e:null},{id:"MessageUtils",conditions:e=>e.storeMessages&&e.appendMessage?e:null},{id:"WebMessageInfo",conditions:e=>e.WebMessageInfo&&e.WebFeatures?e.WebMessageInfo:null},{id:"createMessageKey",conditions:e=>e.createMessageKey&&e.createDeviceSentMessage?e.createMessageKey:null},{id:"Participants",conditions:e=>e.addParticipants&&e.removeParticipants&&e.promoteParticipants&&e.demoteParticipants?e:null},{id:"WidFactory",conditions:e=>e.isWidlike&&e.createWid&&e.createWidFromWidLike?e:null},{id:"Base",conditions:e=>e.setSubProtocol&&e.binSend&&e.actionNode?e:null},{id:"Base2",conditions:e=>e.supportsFeatureFlags&&e.parseMsgStubProto&&e.binSend&&e.subscribeLiveLocation?e:null},{id:"Versions",conditions:e=>e.loadProtoVersions&&e.default[15]&&e.default[16]&&e.default[17]?e:null},{id:"Sticker",conditions:e=>e.StickerCollection&&e.default?e:null},{id:"MediaObject",conditions:e=>e.getOrCreateMediaObject&&e.disassociateMediaFromStickerPack?e:null},{id:"MediaUpload",conditions:e=>e.default&&e.default.mediaUpload?e.default:null},{id:"UploadUtils",conditions:e=>e.default&&e.default.encryptAndUpload?e.default:null},{id:"Cmd",conditions:e=>e.default&&e.default.openChatFromUnread?e:null},{id:"ReadSeen",conditions:e=>e.sendSeen?e:null},{id:"Block",conditions:e=>e.blockContact&&e.unblockContact?e:null},{id:"BlockList",conditions:e=>e.BlocklistCollection?e:null},{id:"Theme",conditions:e=>e.getTheme&&e.setTheme?e:null},{id:"Vcard",conditions:e=>e.vcardFromContactModel?e:null},{id:"Profile",conditions:e=>e.sendSetPicture&&e.requestDeletePicture?e:null},{id:"SendMute",conditions:e=>e.sendConversationMute?e:null},{id:"Validators",conditions:e=>e.findLinks?e:null},{id:"Wap2",conditions:e=>e.Wap?e:null},{id:"genId",conditions:e=>e.default&&"function"==typeof e.default&&"function"==typeof e.default.toString&&e.default.toString().match(/crypto/)?e:null},{id:"GroupMetadata",conditions:e=>e.default&&e.default.handlePendingInvite?e:null},{id:"i10n",conditions:e=>e.default&&e.default.downloadAppLocale?e.default:null},{id:"NetworkStatus",conditions:e=>e.default&&e.default._logOnlineOffline?e.default:null},{id:"Stream",conditions:e=>e.default&&e.default.unobscure?e.default:null},{id:"ws2",conditions:e=>e.default&&e.default.destroyStorage?e.default:null},{id:"BlobCache",conditions:e=>e.default&&e.default.getOrCreateURL?e.default:null},{id:"UserPrefs",conditions:e=>e.getMaybeMeUser?e:null},{id:"randomMessageId",conditions:e=>e.randomId&&e.default?e.default:null},{id:"randomId",conditions:e=>e.randomId&&e.default?e.randomId:null},{id:"sendSetGroupSubject",conditions:e=>e.sendSetGroupSubject},{id:"sendSetGroupProperty",conditions:e=>e.sendSetGroupProperty},{id:"sendSetGroupDescription",conditions:e=>e.sendSetGroupDescription},{id:"changeEphemeralDuration",conditions:e=>e.changeEphemeralDuration},{id:"sendCallSignalingMsg",conditions:e=>e.sendCallSignalingMsg},{id:"checkNumberInfo",conditions:e=>e.default.toString().includes("Should not reach queryExists MD")?e.default:null},{id:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"msgFindQuery",conditions:e=>e.msgFindQuery&&e.msgFindByIds?e.msgFindQuery:null}]);try{var Wo=function(){var e=So.value;window.Store.promises[e.id]=bo.waitForModule((t=>!!e.conditions(t))).then(e.conditions).then((t=>{"Store"===e.id?window.Store=Object.assign({},window.Store,t):window.Store[e.id]=t}))};for(Io.s();!(So=Io.n()).done;)Wo()}catch(e){Io.e(e)}finally{Io.f()}window.Store.sendMessage=function(e){return window.Store.SendTextMsgToChat(this,...arguments)},window.Store.sendAddMessage=function(e){return window.Store.addAndSendMsgToChat(this,...arguments)}}void 0===window.WAPI&&(window.WAPI={lastRead:{}},window.WAPI.interfaceMute=function(e){return{attributes:e.attributes,expiration:e.expiration,id:e.id,isMuted:e.isMuted,isState:e.isState,promises:e.promises,stale:e.stale}},window.WAPI.setProfilePic=function(e,t){return tr.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return ur.apply(this,arguments)},window.WAPI.scope=Kn,window.WAPI.getchatId=function(e){return Yn.apply(this,arguments)},window.WAPI.sendExist=function(e){return Qn.apply(this,arguments)},window.WAPI.pinChat=function(e){return or.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return $r.apply(this,arguments)},window.WAPI.setTheme=function(e){return Tn.apply(this,arguments)},window.WAPI.getTheme=function(){return Un.apply(this,arguments)},window.WAPI._serializeRawObj=e=>e&&e.toJSON?e.toJSON():{},window.WAPI._serializeChatObj=e=>null==e?null:Object.assign(window.WAPI._serializeRawObj(e),{kind:e.kind,isBroadcast:e.isBroadcast,isGroup:e.isGroup,isUser:e.isUser,contact:e.contact?window.WAPI._serializeContactObj(e.contact):null,groupMetadata:e.groupMetadata?window.WAPI._serializeRawObj(e.groupMetadata):null,presence:e.presence?window.WAPI._serializeRawObj(e.presence):null,msgs:null}),window.WAPI._serializeContactObj=e=>{if(null==e)return null;var t=null;if(!e.profilePicThumb&&e.id&&window.Store.ProfilePicThumb){var n=window.Store.ProfilePicThumb.get(e.id);t=n?WAPI._serializeProfilePicThumb(n):{}}return Object.assign(window.WAPI._serializeRawObj(e),{formattedName:e.formattedName,isHighLevelVerified:e.isHighLevelVerified,isMe:e.isMe,isMyContact:e.isMyContact,isPSA:e.isPSA,isUser:e.isUser,isVerified:e.isVerified,isWAContact:e.isWAContact,profilePicThumbObj:t,statusMute:e.statusMute,msgs:null})},window.WAPI._serializeMessageObj=e=>null==e?null:(e.quotedMsg&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:e.quotedParticipant&&e.quotedParticipant._serialized?e.quotedParticipant._serialized:void 0,author:e.author&&e.author._serialized?e.author._serialized:void 0,chatId:e.id&&e.id.remote?e.id.remote:e.chatId&&e.chatId._serialized?e.chatId._serialized:void 0,to:e.to&&e.to._serialized?e.to._serialized:void 0,fromMe:e.id.fromMe,sender:e.senderObj?WAPI._serializeContactObj(e.senderObj):null,timestamp:e.t,content:e.body,isGroupMsg:e.isGroupMsg,isLink:e.isLink,isMMS:e.isMMS,isMedia:e.isMedia,isNotification:e.isNotification,isPSA:e.isPSA,type:e.type,quotedMsgId:e._quotedMsgObj?(e._quotedMsgObj.id,e._quotedMsgObj.id._serialized):void 0,mediaData:window.WAPI._serializeRawObj(e.mediaData)})),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI._serializeProfilePicThumb=e=>null==e?null:Object.assign({},{eurl:e.eurl,id:e.id,img:e.img,imgFull:e.imgFull,raw:e.raw,tag:e.tag}),window.WAPI._profilePicfunc=co,window.WAPI.createGroup=function(e,t){return d.apply(this,arguments)},window.WAPI.leaveGroup=function(e){return Me.apply(this,arguments)},window.WAPI.revokeGroupInviteLink=function(e){return ze.apply(this,arguments)},window.WAPI.getGroupInviteLink=function(e){return se.apply(this,arguments)},window.WAPI.getGroupInfoFromInviteLink=function(e){return le.apply(this,arguments)},window.WAPI.getGroupAdmins=function(e,t){return ie.apply(this,arguments)},window.WAPI.removeParticipant=function(e,t,n){return cn.apply(this,arguments)},window.WAPI.addParticipant=function(e,t){return fn.apply(this,arguments)},window.WAPI.promoteParticipant=function(e,t,n){return wn.apply(this,arguments)},window.WAPI.demoteParticipant=function(e,t,n){return gn.apply(this,arguments)},window.WAPI.joinGroup=function(e){return Wn.apply(this,arguments)},window.WAPI.setGroupDescription=function(e,t){return Gr.apply(this,arguments)},window.WAPI.setGroupProperty=function(e,t,n){return zr.apply(this,arguments)},window.WAPI.setGroupSubject=function(e,t){return Vr.apply(this,arguments)},window.WAPI.sendChatstate=function(e,t){return Ve.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,o,i){var a=WAPI.getChat(o);if(void 0===a)return void 0!==i&&i(!1),!1;var u={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:u,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==i&&i(!0),!0},window.WAPI.processMessageObj=function(e,t,n){return e.isNotification?n?WAPI._serializeMessageObj(e):void 0:!1===e.id.fromMe||t?WAPI._serializeMessageObj(e):void 0},window.WAPI.sendMessageWithTags=function(e,t){return St.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return ht.apply(this,arguments)},window.WAPI.sendMessage2=function(e,t,n){var r=WAPI.getChat(e);if(void 0!==r)try{return void 0!==n?r.sendMessage(t).then((function(){n(!0)})):r.sendMessage(t),!0}catch(e){return void 0!==n&&n(!1),!1}return void 0!==n&&n(!1),!1},window.WAPI.sendSeen=function(e,t){return Mt.apply(this,arguments)},window.WAPI.deleteConversation=function(e,t){var n=new window.Store.UserConstructor(e,{intentionallyUsePrivateConstructor:!0}),r=WAPI.getChat(n);return r?(window.Store.sendDelete(r,!1).then((()=>{void 0!==t&&t(!0)})).catch((()=>{void 0!==t&&t(!1)})),!0):(void 0!==t&&t(!1),!1)},window.WAPI.deleteMessages=function(e,t,n,r){return y.apply(this,arguments)},window.WAPI.clearChat=function(e,t){return u.apply(this,arguments)},window.WAPI.sendImage=function(e,t,n,r,o,i){return Qe(e,t,n,r,"sendImage",o,i)},window.WAPI.sendPtt=function(e,t,n,r,o){return Ze.apply(this,arguments)},window.WAPI.sendFile=Qe,window.WAPI.setMyName=function(e){return jt.apply(this,arguments)},window.WAPI.setMyStatus=function(e){return Store.MyStatus.setMyStatus(e)},window.WAPI.sendVideoAsGif=function(e,t,n,r,o){return Ot.apply(this,arguments)},window.WAPI.processFiles=Re,window.WAPI.sendImageWithProduct=function(e,t,n,r,o,i){Store.Catalog.findCarouselCatalog(r).then((r=>{if(r&&r[0]){var a=r[0].productCollection.get(o),u={productMsgOptions:{businessOwnerJid:a.catalogWid.toString({legacy:!0}),productId:a.id.toString(),url:a.url,productImageCount:a.productImageCollection.length,title:a.name,description:a.description,currencyCode:a.currency,priceAmount1000:a.priceAmount1000,type:"product"},caption:n},s=new Store.WidFactory.createWid(t);return WPP.chat.find(s).then((t=>{var n=A(e,a.name);Re(t,n).then((e=>{var n=e.models[0];Object.entries(u.productMsgOptions).map((e=>{var t,r,o=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1];return n.mediaPrep._mediaData[i]=a})),n.mediaPrep.sendToChat(t,u),void 0!==i&&i(!0)}))}))}}))},window.WAPI.sendContactVcard=function(e,t,n){return Gt.apply(this,arguments)},window.WAPI.sendContactVcardList=function(e,t){return $n.apply(this,arguments)},window.WAPI.forwardMessages=function(e,t,n){return Nt.apply(this,arguments)},window.WAPI.reply=function(e,t,n){return Vt.apply(this,arguments)},window.WAPI._sendSticker=nt,window.WAPI.encryptAndUploadFile=function(e,t){return k.apply(this,arguments)},window.WAPI.sendImageAsSticker=at,window.WAPI.sendImageAsStickerGif=at,window.WAPI.startTyping=function(e){return Qt.apply(this,arguments)},window.WAPI.stopTyping=function(e){return Jt.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return Qr.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return lt.apply(this,arguments)},window.WAPI.openChat=function(e){return An.apply(this,arguments)},window.WAPI.openChatAt=function(e,t){return bn.apply(this,arguments)},window.WAPI.markUnseenMessage=function(e){return _n.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Hn.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return Pt.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return to.apply(this,arguments)},window.WAPI.blockContact=function(e){return nn.apply(this,arguments)},window.WAPI.unblockContact=function(e){return an.apply(this,arguments)},window.WAPI.getBlockList=function(){return En.apply(this,arguments)},window.WAPI.getAllContacts=R,window.WAPI.getMyContacts=function(e){var t=window.Store.Contact.filter((e=>!0===e.isMyContact)).map((e=>WAPI._serializeContactObj(e)));return void 0!==e&&e(t),t},window.WAPI.getContact=function(e,t){var n=window.Store.Contact.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=window.Store.Chat.map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=z,window.WAPI.getAllChatsWithNewMsg=H,window.WAPI.getAllChatIds=function(e){var t=window.Store.Chat.map((e=>e.id._serialized||e.id));return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return H().map((e=>WAPI.getChat(e.id))).flatMap((e=>e.msgs.filter((e=>e.isNewMsg)))).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=V,window.WAPI.getAllChatsWithMessages=function(e){return L.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=window.Store.Chat.filter((e=>e.isGroup));return void 0!==e&&e(t),t},window.WAPI.getChat=function(e){if(!e)return!1;e="string"==typeof e?e:e._serialized;var t=Store.Chat.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return window.Store.sendMessage.apply(this,arguments)}),t},window.WAPI.getStatus=function(e){return Se.apply(this,arguments)},window.WAPI.getChatByName=function(e,t){var n=window.Store.Chat.find((t=>t.name===e));return void 0!==t&&t(n),n},window.WAPI.getNewId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},window.WAPI.getChatById=function(e,t){return Q.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var o=WAPI.getChat(e).msgs._models,i=[],a=o.length-1;a>=0;a--)if("remove"!==a){var u=o[a];if("boolean"==typeof u.isNewMsg&&!1!==u.isNewMsg){u.isNewMsg=!1;var s=WAPI.processMessageObj(u,t,n);s&&i.push(s)}}return void 0!==r&&r(i),i},window.WAPI.loadEarlierMessages=function(e){return Le.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=Oe,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){Oe(e),t()},window.WAPI.areAllMessagesLoaded=function(e,t){return WAPI.getChat(e).msgs.msgLoadState.noEarlierMsgs?(t&&t(!0),!0):(t&&t(!1),!1)},window.WAPI.loadEarlierMessagesTillDate=function(e,t,n){var r=WAPI.getChat(e);!function e(){r.msgs.models[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(e):n()}()},window.WAPI.getAllGroupMetadata=function(e){var t=window.Store.GroupMetadata.default.map((e=>e.attributes));return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return he.apply(this,arguments)},window.WAPI._getGroupParticipants=te,window.WAPI.getGroupParticipantIDs=function(e,t){return ye.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return D.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return ke.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var o=window.Store.Chat.models,i=[];for(var a in o)if(!isNaN(a)){var u=o[a],s=WAPI._serializeChatObj(u);s.messages=[];for(var c=u.msgs._models,d=c.length-1;d>=0;d--){var l=c[d];if("boolean"==typeof l.isNewMsg&&!1!==l.isNewMsg){l.isNewMsg=!1;var f=WAPI.processMessageObj(l,e,t);f&&s.messages.push(f)}}if(s.messages.length>0)i.push(s);else if(n){for(var p=u.unreadCount,h=c.length-1;h>=0;h--){var w=c[h];if(p>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);s.messages.unshift(v),p-=1}}else{if(-1!==p)break;if(!w.isSentByMe){var y=WAPI.processMessageObj(w,e,t);s.messages.unshift(y);break}}}s.messages.length>0&&(u.unreadCount=0,i.push(s))}}return void 0!==r&&r(i),i},window.WAPI.getCommonGroups=function(e,t){return $.apply(this,arguments)},window.WAPI.downloadFile=function(e){return P.apply(this,arguments)},window.WAPI.downloadMedia=vr,window.WAPI.getNumberProfile=function(e,t){return Pe.apply(this,arguments)},window.WAPI.getMessageById=p,window.WAPI.getMessages=function(e){return Zt.apply(this,arguments)},window.WAPI.getNewMessageId=function(e){return new Store.MsgKey({from:Store.UserPrefs.getMaybeMeUser(),to:new Store.WidFactory.createWid(e),id:Store.randomMessageId(),participant:void 0,selfDir:"out"})},window.WAPI.getFileHash=W,window.WAPI.generateMediaKey=C,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(e),i=o.byteLength,a=i%3,u=i-a,s=0;s<u;s+=3)n+=r[(16515072&(t=o[s]<<16|o[s+1]<<8|o[s+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=o[u]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=o[u]<<8|o[u+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return pr.apply(this,arguments)},window.WAPI.getHost=function(){return Store.Me.attributes},window.WAPI.getWid=function(){var e;return null===(e=Store.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=window.Store.Contact.get(window.Store.Conn.me);return void 0!==e&&e(t.all),t.all},window.WAPI.isConnected=function(e){var t=null==document.querySelector('[data-testid="alert-phone"]')&&null==document.querySelector('[data-testid="alert-computer"]');return void 0!==e&&e(t),t},window.WAPI.isLoggedIn=function(e){var t=window.Store.Contact&&void 0!==window.Store.Contact.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return Store.Me.attributes.battery},window.WAPI.base64ImageToFile=A,window.WAPI.base64ToFile=A,window.WAPI.restartService=function(){return Fn.apply(this,arguments)},window.WAPI.killServiceWorker=function(){return Bn.apply(this,arguments)},window.WAPI.sendMute=function(e,t,n){return dr.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;Ir(),Pr=setInterval(br,e)},window.WAPI.stopPhoneWatchdog=Ir,window.WAPI.subscribePresence=function(e){return Or.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return xr.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return po.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return vo.apply(this,arguments)},window.WAPI.rejectCall=function(e){return Nr.apply(this,arguments)},window.WAPI._newMessagesQueue=[],window.WAPI._newMessagesBuffer=null!=sessionStorage.getItem("saved_msgs")?JSON.parse(sessionStorage.getItem("saved_msgs")):[],window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesCallbacks=[],window.addEventListener("unload",window.WAPI._unloadInform,!1),window.addEventListener("beforeunload",window.WAPI._unloadInform,!1),window.addEventListener("pageunload",window.WAPI._unloadInform,!1),window.WAPI.sendMessageMentioned=function(){var e=Po((function*(e,t,n){Array.isArray(n)||(n=[n]);var r=WAPI.getChat(e),o=yield Store.Contact.serialize().filter((e=>n.includes(e.id.user)));r.sendMessage(t,{linkPreview:null,mentionedJidList:o.map((e=>e.id)),quotedMsg:null,quotedMsgAdminGroupJid:null})}));return function(t,n,r){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicSmallFromId=function(){var e=Po((function*(e){return yield window.Store.ProfilePicThumb.find(e).then(function(){var e=Po((function*(e){return void 0!==e.img&&(yield window.WAPI.downloadFileWithCredentials(e.img))}));return function(t){return e.apply(this,arguments)}}(),(function(e){return!1}))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicFromId=function(){var e=Po((function*(e){return yield window.Store.ProfilePicThumb.find(e).then(function(){var e=Po((function*(e){return void 0!==e.imgFull&&(yield window.WAPI.downloadFileWithCredentials(e.imgFull))}));return function(t){return e.apply(this,arguments)}}(),(function(e){return!1}))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.downloadFileWithCredentials=function(){var e=Po((function*(e){if(!axios||!e)return!1;var t=(yield axios.get(e,{responseType:"arraybuffer"})).data;return btoa(new Uint8Array(t).reduce(((e,t)=>e+String.fromCharCode(t)),""))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI.checkNumberStatus=function(){var e=Po((function*(e){var t=Store.WidFactory.createWid(e),n=yield Store.checkNumberInfo(t);return n?{id:n.wid,isBusiness:n.biz,canReceiveMessage:!0,numberExists:!0,status:200}:{id:e,isBusiness:!1,canReceiveMessage:!1,numberExists:!1,status:404}}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getChatIsOnline=function(){var e=Po((function*(e){var t=Store.Chat.get(e);return!!t&&(yield t.presence.subscribe(),t.presence.attributes.isOnline)}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getLastSeen=function(){var e=Po((function*(e){var t=Store.Chat.get(e);return!!t&&(t.presence.hasData||(yield t.presence.subscribe(),yield new Promise((e=>setTimeout(e,100)))),t.presence.chatstate.t||!1)}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getWAVersion=function(){return window.Debug.VERSION},window.WAPI.archiveChat=function(){var e=Po((function*(e,t){var n=Store.Archive.setArchive(Store.Chat.get(e),t).then((e=>!0)).catch((e=>!1));return yield Promise.resolve(n)}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.takeOver=Po((function*(){return yield Store.State.default.takeover(),!0})),window.WAPI.onIncomingCall=function(e){return window.WAPI.waitForStore(["Call"],(()=>{window.Store.Call.on("add",e)})),!0},window.WAPI.onInterfaceChange=function(e){return window.WAPI.waitForStore("Stream",(()=>{var t=()=>({displayInfo:window.Store.Stream.displayInfo,mode:window.Store.Stream.mode,info:window.Store.Stream.info});e(t()),window.Store.Stream.on("change:info change:displayInfo change:mode",(()=>{e(t())}))})),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=Po((function*(e,t){return yield Store.WapQuery.setGroupProperty(e,"announcement",t),!0}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=Po((function*(){return yield window.WAPI.waitForStore(["ws2"],(()=>(window.Store.ws2.logout(),!0)))})),window.WAPI.storePromises={},window.WAPI.waitForStore=function(){var e=Po((function*(e,t){Array.isArray(e)||(e=[e]);var n=e.filter((e=>void 0===window.Store[e])).map((e=>(window.WAPI.storePromises[e]||(window.WAPI.storePromises[e]=new Promise((t=>{(window.Store.promises[e]||window.Store.promises.Store).then((()=>{t(!0)}))}))),window.WAPI.storePromises[e]))),r=Promise.all(n);return"function"==typeof t&&r.then(t),yield r}));return function(t,n){return e.apply(this,arguments)}}(),yo=!1,go=()=>window.Store.State.default.stream,window.WAPI.onStreamChange=function(e){return window.WAPI.waitForStore("State",(()=>{window.Store.State.default.on("change:stream",(()=>e(go()))),yo||(yo=!0,e(go()))})),!0},function(){var e=!1,t=()=>window.Store.State.default.state;window.WAPI.onStateChange=function(n){return window.WAPI.waitForStore("State",(()=>{window.Store.State.default.on("change:state",(()=>n(t()))),e||(e=!0,n(t()))})),!0}}(),window.WAPI.waitForStore(["Chat","Msg"],(()=>{window.WAPI._newMessagesListener=window.Store.Msg.on("add",(e=>{if(e&&e.isNewMsg&&!e.isSentByMe){var t=window.WAPI.processMessageObj(e,!1,!1);t&&(window.WAPI._newMessagesQueue.push(t),window.WAPI._newMessagesBuffer.push(t)),!window.WAPI._newMessagesDebouncer&&window.WAPI._newMessagesQueue.length>0&&(window.WAPI._newMessagesDebouncer=setTimeout((()=>{var e=window.WAPI._newMessagesQueue;window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesQueue=[];var t=[];window.WAPI._newMessagesCallbacks.forEach((function(n){void 0!==n.callback&&n.callback(e),!0===n.rmAfterUse&&t.push(n)})),t.forEach((function(e){var t=window.WAPI._newMessagesCallbacks.indexOf(e);window.WAPI._newMessagesCallbacks.splice(t,1)}))}),1e3))}}))})),window.WAPI._unloadInform=e=>{window.WAPI._newMessagesBuffer.forEach((e=>{Object.keys(e).forEach((t=>void 0===e[t]?delete e[t]:""))})),sessionStorage.setItem("saved_msgs",JSON.stringify(window.WAPI._newMessagesBuffer)),window.WAPI._newMessagesCallbacks.forEach((function(e){void 0!==e.callback&&e.callback({status:-1,message:"page will be reloaded, wait and register callback again."})}))},window.WAPI.waitNewMessages=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return window.WAPI._newMessagesCallbacks.push({callback:t,rmAfterUse:e}),!0},window.WAPI.allNewMessagesListener=e=>window.WAPI.waitForStore(["Chat","Msg"],(()=>{window.Store.Msg.on("add",(t=>{if(t&&t.isNewMsg){var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)}}))})),window.WAPI.waitNewAcknowledgements=function(e){return window.WAPI.waitForStore(["Chat","Msg"],(()=>{Store.Msg.on("change:ack",e)})),!0},window.WAPI.onAddedToGroup=function(e){return window.WAPI.waitForStore("Msg",(()=>{window.Store.Msg.on("add",(t=>{if(t.isNewMsg&&t.isNotification&&"gp2"===t.type&&"add"===t.subtype)try{var n=WAPI._serializeChatObj(t.chat);e(n)}catch(e){console.error(e)}}))})),!0},function(){var e=[];function t(t){var n=Object.assign({},t);n.jid&&(n.id=n.jid.toString()),delete n.jid,delete n.body,delete n.isLive,delete n.sequence;var r,o=oo(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i(n)}catch(e){}}}catch(e){o.e(e)}finally{o.f()}}window.WAPI.waitForStore(["LiveLocation"],ro((function*(){var e=Store.LiveLocation.handle;Store.LiveLocation.handle=function(n){e.apply(this,arguments);var r,o=oo(n);try{for(o.s();!(r=o.n()).done;)t(r.value)}catch(e){o.e(e)}finally{o.f()}},Store.LiveLocation.on("add",(()=>{setTimeout((()=>{Store.LiveLocation.forEach((e=>{e.startViewingMap(),setTimeout((()=>{try{e._startKeepAlive()}catch(e){}}),1e3)}))}),100)})),Store.Chat.map((e=>Store.LiveLocation.find(e.id)))}))),WAPI.waitNewMessages(!1,(e=>{var n,r=oo(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.isLive&&t({type:"enable",isLive:o.isLive,id:o.sender.id,lat:o.lat,lng:o.lng,accuracy:o.accuracy,speed:o.speed,degrees:o.degrees,sequence:o.sequence,shareDuration:o.shareDuration})}}catch(e){r.e(e)}finally{r.f()}})),window.WAPI.onLiveLocation=function(){var t=ro((function*(t){e.push(t)}));return function(e){return t.apply(this,arguments)}}()}(),window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){return yield window.WAPI.waitForStore(["Chat","Msg"],(()=>{var n=["invite","add","remove","leave","promote","demote"],r=window.Store.Chat.get(e),o=window.Store.GroupMetadata.default.get(e);uo[e]||(uo[e]={},o.participants.forEach((t=>{uo[e][t.id.toString()]={subtype:"add",from:o.owner}})));var i=0;return r.on("change:groupMetadata.participants",(o=>r.on("all",((o,a)=>{var u=a.isGroup,s=a.previewMessage;if(u&&"change"===o&&s&&"gp2"===s.type&&n.includes(s.subtype)){var c=s.subtype,d=s.from,l=s.recipients,f=l[0].toString();uo[e][f]&&uo[e][l[0]].subtype==c||(0==i?i++:(uo[e][f]={subtype:c,from:d},t({by:d.toString(),action:c,who:l}),r.off("all",this),i=0))}})))),!0}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ao(i,r,o,a,u,"next",e)}function u(e){ao(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}(),window.WAPI.onNotificationMessage=function(e){return window.WAPI.waitForStore("Msg",(()=>{window.Store.Msg.on("add",(t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}}))})),!0},window.WAPI.onPresenceChanged=function(e){return window.WAPI.waitForStore("Presence",(()=>{window.Store.Presence.on("change:chatstate.type",(t=>{try{var n=window.Store.Presence.models.find((e=>e.chatstate===t));if(!n||!n.hasData||!n.chatstate.type)return;var r=window.Store.Contact.get(n.id),o={id:n.id,isOnline:n.isOnline,isGroup:n.isGroup,isUser:n.isUser,shortName:r?r.formattedShortName:"",state:n.chatstate.type,t:Date.now()};n.isUser&&(o.isContact=!n.chatstate.deny),n.isGroup&&(o.participants=n.chatstates.models.filter((e=>!!e.type)).map((e=>{var t=window.Store.Contact.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}}))),e(o)}catch(e){console.log(e)}}))})),!0})},602:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=W(a,n);if(u){if(u===w)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=d(e,t,n);if("normal"===s.type){if(r=n.done?h:f,s.arg===w)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",f="suspendedYield",p="executing",h="completed",w={};function v(){}function y(){}function g(){}var m={};s(m,i,(function(){return this}));var P=Object.getPrototypeOf,A=P&&P(P(O([])));A&&A!==n&&r.call(A,i)&&(m=A);var b=g.prototype=v.prototype=Object.create(m);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,u){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function W(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,W(e,n),"throw"===n.method))return w;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var o=d(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,w;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function O(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:x}}function x(){return{value:t,done:!0}}return y.prototype=g,s(b,"constructor",g),s(g,"constructor",y),y.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},S(I.prototype),s(I.prototype,a,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new I(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(b),s(b,u,"Generator"),s(b,i,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,w):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(602),n(731)})();
1
+ (()=>{var e={877:e=>{self,e.exports=(()=>{"use strict";var e={447:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultOptions=void 0,t.defaultOptions={refreshModules:!0,startObserver:!0,chunkNames:["webpackChunkbuild","webpackChunkwhatsapp_web_client"]},t.default=class{constructor(e={}){this._modules=new Map,this.mutationObserver=null,this._events=new Map,this._options=Object.assign({},t.defaultOptions,e),this._options.refreshModules&&this.refreshModules(),this._options.startObserver&&this.initObserver()}on(e,t){const n=this._events.get(e);return this._events.has(e)&&this._events.set(e,[...n,t]),this._events.set(e,[t]),!0}off(e,t){if(!t)return this._events.delete(e);const n=this._events.get(e);if(Array.isArray(n)&&n.length){const r=n.filter((e=>e!==t));return this._events.set(e,r),!0}return!1}emit(e,...t){const n=this._events.get(e);Array.isArray(n)&&n.length&&n.forEach((e=>{try{e.apply(this,t)}catch(e){}}))}initObserver(){this.mutationObserver||(this.mutationObserver=new MutationObserver((async e=>{const t=[];for(const n of e){const e=Array.from(n.addedNodes);for(const n of e)"SCRIPT"===n.nodeName&&t.push(new Promise((e=>{n.addEventListener("load",e),n.addEventListener("error",e)})))}await Promise.all(t),t.length&&await this.refreshModules()})),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))}refreshModules(){const e=this._options.chunkNames||["webpackChunkbuild"],t=[];for(const n of e){const e=window[n];Array.isArray(e)&&e.length&&t.push(e)}if(!t.length)return Promise.resolve(!1);const n=this._modules.size;return new Promise((e=>{for(const r of t){const t=Date.now();r.push([[t],{},t=>{for(const e in t.m){const n=t(e);this._modules.set(e+"",n)}const r=n!==this._modules.size;this.emit("refresh",r),e(r)}])}}))}searchModuleId(e,t=!1){let n=Array.from(this._modules.keys());t&&(n=n.reverse());for(const t of n)try{if(e(this._modules.get(t),t))return t}catch(e){continue}return null}searchModule(e,t=!1){const n=this.searchModuleId(e,t);return n?this._modules.get(n):null}async waitForModule(e,t=!1,n=!1){return await this.searchModule(e,t)||(this.initObserver(),new Promise(((r,o)=>{const i=async n=>{if(!n)return;const o=await this.searchModule(e,t);o&&(this.off("refresh",i),r(o))};this.on("refresh",i),n&&setTimeout((()=>{o(new Error("Timeout"))}),n)})))}get(e){return this._modules.get(e+"")}forEach(e){return this._modules.forEach(e,this)}get size(){return this._modules.size}dispose(){this.mutationObserver.disconnect(),this._modules.clear(),this._events.clear()}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(447);e.default=t.default})(),r})()},276:function(e,t,n){"use strict";var r;!function(o){function i(e,t,n){var r,o,i,a,u,w,v,y,g,m=0,P=[],A=0,b=!1,I=[],S=[],W=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(g=n.numRounds||1)!==parseInt(g,10)||1>g)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)u=512,w=G,v=D,a=160,y=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return B(t,n,e)},v=function(t,n,r,o){var i,a;if("SHA-224"===e||"SHA-256"===e)i=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");i=31+(n+129>>>10<<5),a=32}for(;t.length<=i;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[i]=4294967295&n,t[i-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=a)o=B(t.slice(n,n+a),o,e);if("SHA-224"===e)t=[o[0],o[1],o[2],o[3],o[4],o[5],o[6]];else if("SHA-256"===e)t=o;else if("SHA-384"===e)t=[o[0].a,o[0].b,o[1].a,o[1].b,o[2].a,o[2].b,o[3].a,o[3].b,o[4].a,o[4].b,o[5].a,o[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[o[0].a,o[0].b,o[1].a,o[1].b,o[2].a,o[2].b,o[3].a,o[3].b,o[4].a,o[4].b,o[5].a,o[5].b,o[6].a,o[6].b,o[7].a,o[7].b]}return t},y=function(e){return e.slice()},"SHA-224"===e)u=512,a=224;else if("SHA-256"===e)u=512,a=256;else if("SHA-384"===e)u=1024,a=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");u=1024,a=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var _=6;if(w=z,y=function(e){var t,n=[];for(t=0;5>t;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)u=1152,a=224;else if("SHA3-256"===e)u=1088,a=256;else if("SHA3-384"===e)u=832,a=384;else if("SHA3-512"===e)u=576,a=512;else if("SHAKE128"===e)u=1344,a=-1,_=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");u=1088,a=-1,_=31,M=!0}v=function(e,t,n,r,o){var i,a=_,s=[],c=(n=u)>>>5,d=0,l=t>>>5;for(i=0;i<l&&t>=n;i+=c)r=z(e.slice(i,i+c),r),t-=n;for(e=e.slice(i),t%=n;e.length<c;)e.push(0);for(e[(i=t>>>3)>>2]^=a<<i%4*8,e[c-1]^=2147483648,r=z(e,r);32*s.length<o&&(e=r[d%5][d/5|0],s.push(e.b),!(32*s.length>=o));)s.push(e.a),0==64*(d+=1)%n&&z(null,r);return s}}i=h(t,r,C),o=R(e),this.setHMACKey=function(t,n,i){var s;if(!0===b)throw Error("HMAC key already set");if(!0===W)throw Error("Cannot set HMAC key after calling update");if(!0===M)throw Error("SHAKE is not supported for HMAC");if(t=(n=h(n,r=(i||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,i=(s=u>>>3)/4-1,s<t/8){for(n=v(n,t,0,R(e),a);n.length<=i;)n.push(0);n[i]&=4294967040}else if(s>t/8){for(;n.length<=i;)n.push(0);n[i]&=4294967040}for(t=0;t<=i;t+=1)I[t]=909522486^n[t],S[t]=1549556828^n[t];o=w(I,o),m=u,b=!0},this.update=function(e){var t,n,r,a=0,s=u>>>5;for(e=(t=i(e,P,A)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=s)a+u<=e&&(o=w(n.slice(r,r+s),o),a+=u);m+=a,P=n.slice(a>>>5),A=e%u,W=!0},this.getHash=function(t,n){var r,i,u,h;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(u=p(n),!0===M){if(-1===u.shakeLen)throw Error("shakeLen must be specified in options");a=u.shakeLen}switch(t){case"HEX":r=function(e){return s(e,a,C,u)};break;case"B64":r=function(e){return c(e,a,C,u)};break;case"BYTES":r=function(e){return d(e,a,C)};break;case"ARRAYBUFFER":try{i=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{i=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return f(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(h=v(P.slice(),A,m,y(o),a),i=1;i<g;i+=1)!0===M&&0!=a%32&&(h[h.length-1]&=16777215>>>24-a%32),h=v(h,a,0,R(e),a);return r(h)},this.getHMAC=function(t,n){var r,i,h,g;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=p(n),t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return c(e,a,C,h)};break;case"BYTES":r=function(e){return d(e,a,C)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return f(e,a,C)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return i=v(P.slice(),A,m,y(o),a),g=w(S,R(e)),r(g=v(i,a,u,g,a))}}function a(e,t){this.a=e,this.b=t}function u(e,t,n,r){var o,i,a,u,s;for(t=t||[0],i=(n=n||0)>>>3,s=-1===r?3:0,o=0;o<e.length;o+=1)a=(u=o+i)>>>2,t.length<=a&&t.push(0),t[a]|=e[o]<<8*(s+u%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var o,i,a,u="";for(t/=8,a=-1===n?3:0,o=0;o<t;o+=1)i=e[o>>>2]>>>8*(a+o%4*n),u+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return r.outputUpper?u.toUpperCase():u}function c(e,t,n,r){var o,i,a,u,s="",c=t/8;for(u=-1===n?3:0,o=0;o<c;o+=3)for(i=o+1<c?e[o+1>>>2]:0,a=o+2<c?e[o+2>>>2]:0,a=(e[o>>>2]>>>8*(u+o%4*n)&255)<<16|(i>>>8*(u+(o+1)%4*n)&255)<<8|a>>>8*(u+(o+2)%4*n)&255,i=0;4>i;i+=1)s+=8*o+6*i<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-i)&63):r.b64Pad;return s}function d(e,t,n){var r,o,i,a="";for(t/=8,i=-1===n?3:0,r=0;r<t;r+=1)o=e[r>>>2]>>>8*(i+r%4*n)&255,a+=String.fromCharCode(o);return a}function l(e,t,n){t/=8;var r,o,i,a=new ArrayBuffer(t);for(i=new Uint8Array(a),o=-1===n?3:0,r=0;r<t;r+=1)i[r]=e[r>>>2]>>>8*(o+r%4*n)&255;return a}function f(e,t,n){t/=8;var r,o,i=new Uint8Array(t);for(o=-1===n?3:0,r=0;r<t;r+=1)i[r]=e[r>>>2]>>>8*(o+r%4*n)&255;return i}function p(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function h(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var o,i,a,u,s,c,d=e.length;if(0!=d%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],s=(r=r||0)>>>3,c=-1===n?3:0,o=0;o<d;o+=2){if(i=parseInt(e.substr(o,2),16),isNaN(i))throw Error("String of HEX type contains invalid characters");for(a=(u=(o>>>1)+s)>>>2;t.length<=a;)t.push(0);t[a]|=i<<8*(c+u%4*n)}return{value:t,binLen:4*d+r}};break;case"TEXT":e=function(e,r,o){var i,a,u,s,c,d,l,f,p=0;if(r=r||[0],c=(o=o||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,u=0;u<e.length;u+=1)for(a=[],128>(i=e.charCodeAt(u))?a.push(i):2048>i?(a.push(192|i>>>6),a.push(128|63&i)):55296>i||57344<=i?a.push(224|i>>>12,128|i>>>6&63,128|63&i):(u+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(u)),a.push(240|i>>>18,128|i>>>12&63,128|i>>>6&63,128|63&i)),s=0;s<a.length;s+=1){for(d=(l=p+c)>>>2;r.length<=d;)r.push(0);r[d]|=a[s]<<8*(f+l%4*n),p+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(f=-1===n?2:0,a="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,u=0;u<e.length;u+=1){for(i=e.charCodeAt(u),!0===a&&(i=(s=255&i)<<8|i>>>8),d=(l=p+c)>>>2;r.length<=d;)r.push(0);r[d]|=i<<8*(f+l%4*n),p+=2}return{value:r,binLen:8*p+o}};break;case"B64":e=function(e,t,r){var o,i,a,u,s,c,d,l,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=e.indexOf("="),e=e.replace(/\=/g,""),-1!==i&&i<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(r=r||0)>>>3,l=-1===n?3:0,i=0;i<e.length;i+=4){for(s=e.substr(i,4),a=u=0;a<s.length;a+=1)u|=(o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(s.charAt(a)))<<18-6*a;for(a=0;a<s.length-1;a+=1){for(o=(d=f+c)>>>2;t.length<=o;)t.push(0);t[o]|=(u>>>16-8*a&255)<<8*(l+d%4*n),f+=1}}return{value:t,binLen:8*f+r}};break;case"BYTES":e=function(e,t,r){var o,i,a,u,s,c;for(t=t||[0],a=(r=r||0)>>>3,c=-1===n?3:0,i=0;i<e.length;i+=1)o=e.charCodeAt(i),u=(s=i+a)>>>2,t.length<=u&&t.push(0),t[u]|=o<<8*(c+s%4*n);return{value:t,binLen:8*e.length+r}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}e=function(e,t,r){return u(new Uint8Array(e),t,r,n)};break;case"UINT8ARRAY":try{e=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}e=function(e,t,r){return u(e,t,r,n)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return e}function w(e,t){return e<<t|e>>>32-t}function v(e,t){return 32<t?(t-=32,new a(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0!==t?new a(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t):e}function y(e,t){return e>>>t|e<<32-t}function g(e,t){var n;return n=new a(e.a,e.b),32>=t?new a(n.a>>>t|n.b<<32-t&4294967295,n.b>>>t|n.a<<32-t&4294967295):new a(n.b>>>t-32|n.a<<64-t&4294967295,n.a>>>t-32|n.b<<64-t&4294967295)}function m(e,t){return 32>=t?new a(e.a>>>t,e.b>>>t|e.a<<32-t&4294967295):new a(0,e.a>>>t-32)}function P(e,t,n){return e&t^~e&n}function A(e,t,n){return new a(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function b(e,t,n){return e&t^e&n^t&n}function I(e,t,n){return new a(e.a&t.a^e.a&n.a^t.a&n.a,e.b&t.b^e.b&n.b^t.b&n.b)}function S(e){return y(e,2)^y(e,13)^y(e,22)}function W(e){var t=g(e,28),n=g(e,34);return e=g(e,39),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function M(e){return y(e,6)^y(e,11)^y(e,25)}function C(e){var t=g(e,14),n=g(e,18);return e=g(e,41),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function _(e){return y(e,7)^y(e,18)^e>>>3}function O(e){var t=g(e,1),n=g(e,8);return e=m(e,7),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function x(e){return y(e,17)^y(e,19)^e>>>10}function E(e){var t=g(e,19),n=g(e,61);return e=m(e,6),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function j(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function k(e,t,n,r){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(o>>>16)&65535)<<16|65535&o}function T(e,t,n,r,o){var i=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&o);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(o>>>16)+(i>>>16)&65535)<<16|65535&i}function U(e,t){var n,r,o;return n=(65535&e.b)+(65535&t.b),o=(65535&(r=(e.b>>>16)+(t.b>>>16)+(n>>>16)))<<16|65535&n,n=(65535&e.a)+(65535&t.a)+(r>>>16),new a((65535&(r=(e.a>>>16)+(t.a>>>16)+(n>>>16)))<<16|65535&n,o)}function L(e,t,n,r){var o,i,u;return o=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),u=(65535&(i=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(o>>>16)))<<16|65535&o,o=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(i>>>16),new a((65535&(i=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(o>>>16)))<<16|65535&o,u)}function N(e,t,n,r,o){var i,u,s;return i=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&o.b),s=(65535&(u=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(o.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&o.a)+(u>>>16),new a((65535&(u=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(o.a>>>16)+(i>>>16)))<<16|65535&i,s)}function F(e,t){return new a(e.a^t.a,e.b^t.b)}function R(e){var t,n=[];if("SHA-1"===e)n=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf("SHA-",0))switch(n=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case"SHA-224":break;case"SHA-256":n=t;break;case"SHA-384":n=[new a(3418070365,n[0]),new a(1654270250,n[1]),new a(2438529370,n[2]),new a(355462360,n[3]),new a(1731405415,n[4]),new a(41048885895,n[5]),new a(3675008525,n[6]),new a(1203062813,n[7])];break;case"SHA-512":n=[new a(t[0],4089235720),new a(t[1],2227873595),new a(t[2],4271175723),new a(t[3],1595750129),new a(t[4],2917565137),new a(t[5],725511199),new a(t[6],4215389547),new a(t[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(e=0;5>e;e+=1)n[e]=[new a(0,0),new a(0,0),new a(0,0),new a(0,0),new a(0,0)]}return n}function G(e,t){var n,r,o,i,a,u,s,c=[];for(n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=0;80>s;s+=1)c[s]=16>s?e[s]:w(c[s-3]^c[s-8]^c[s-14]^c[s-16],1),u=20>s?T(w(n,5),r&o^~r&i,a,1518500249,c[s]):40>s?T(w(n,5),r^o^i,a,1859775393,c[s]):60>s?T(w(n,5),b(r,o,i),a,2400959708,c[s]):T(w(n,5),r^o^i,a,3395469782,c[s]),a=i,i=o,o=w(r,30),r=n,n=u;return t[0]=j(n,t[0]),t[1]=j(r,t[1]),t[2]=j(o,t[2]),t[3]=j(i,t[3]),t[4]=j(a,t[4]),t}function D(e,t,n,r){var o;for(o=15+(t+65>>>9<<4);e.length<=o;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[o]=4294967295&t,e[o-1]=t/4294967296|0,t=e.length,o=0;o<t;o+=16)r=G(e.slice(o,o+16),r);return r}function B(e,t,n){var r,o,i,u,s,c,d,l,f,p,h,w,v,y,g,m,F,R,G,D,B,z,V,K=[];if("SHA-224"===n||"SHA-256"===n)p=64,w=1,z=Number,v=j,y=k,g=T,m=_,F=x,R=S,G=M,B=b,D=P,V=H;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");p=80,w=2,z=a,v=U,y=L,g=N,m=O,F=E,R=W,G=C,B=I,D=A,V=q}for(n=t[0],r=t[1],o=t[2],i=t[3],u=t[4],s=t[5],c=t[6],d=t[7],h=0;h<p;h+=1)16>h?(f=h*w,l=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],K[h]=new z(l,f)):K[h]=y(F(K[h-2]),K[h-7],m(K[h-15]),K[h-16]),l=g(d,G(u),D(u,s,c),V[h],K[h]),f=v(R(n),B(n,r,o)),d=c,c=s,s=u,u=v(i,l),i=o,o=r,r=n,n=v(l,f);return t[0]=v(n,t[0]),t[1]=v(r,t[1]),t[2]=v(o,t[2]),t[3]=v(i,t[3]),t[4]=v(u,t[4]),t[5]=v(s,t[5]),t[6]=v(c,t[6]),t[7]=v(d,t[7]),t}function z(e,t){var n,r,o,i,u=[],s=[];if(null!==e)for(r=0;r<e.length;r+=2)t[(r>>>1)%5][(r>>>1)/5|0]=F(t[(r>>>1)%5][(r>>>1)/5|0],new a(e[r+1],e[r]));for(n=0;24>n;n+=1){for(i=R("SHA3-"),r=0;5>r;r+=1){o=t[r][0];var c=t[r][1],d=t[r][2],l=t[r][3],f=t[r][4];u[r]=new a(o.a^c.a^d.a^l.a^f.a,o.b^c.b^d.b^l.b^f.b)}for(r=0;5>r;r+=1)s[r]=F(u[(r+4)%5],v(u[(r+1)%5],1));for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)t[r][o]=F(t[r][o],s[r]);for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)i[o][(2*r+3*o)%5]=v(t[r][o],V[r][o]);for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)t[r][o]=F(i[r][o],new a(~i[(r+1)%5][o].a&i[(r+2)%5][o].a,~i[(r+1)%5][o].b&i[(r+2)%5][o].b));t[0][0]=F(t[0][0],K[n])}return t}var H,q,V,K;q=[new a((H=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new a(H[1],602891725),new a(H[2],3964484399),new a(H[3],2173295548),new a(H[4],4081628472),new a(H[5],3053834265),new a(H[6],2937671579),new a(H[7],3664609560),new a(H[8],2734883394),new a(H[9],1164996542),new a(H[10],1323610764),new a(H[11],3590304994),new a(H[12],4068182383),new a(H[13],991336113),new a(H[14],633803317),new a(H[15],3479774868),new a(H[16],2666613458),new a(H[17],944711139),new a(H[18],2341262773),new a(H[19],2007800933),new a(H[20],1495990901),new a(H[21],1856431235),new a(H[22],3175218132),new a(H[23],2198950837),new a(H[24],3999719339),new a(H[25],766784016),new a(H[26],2566594879),new a(H[27],3203337956),new a(H[28],1034457026),new a(H[29],2466948901),new a(H[30],3758326383),new a(H[31],168717936),new a(H[32],1188179964),new a(H[33],1546045734),new a(H[34],1522805485),new a(H[35],2643833823),new a(H[36],2343527390),new a(H[37],1014477480),new a(H[38],1206759142),new a(H[39],344077627),new a(H[40],1290863460),new a(H[41],3158454273),new a(H[42],3505952657),new a(H[43],106217008),new a(H[44],3606008344),new a(H[45],1432725776),new a(H[46],1467031594),new a(H[47],851169720),new a(H[48],3100823752),new a(H[49],1363258195),new a(H[50],3750685593),new a(H[51],3785050280),new a(H[52],3318307427),new a(H[53],3812723403),new a(H[54],2003034995),new a(H[55],3602036899),new a(H[56],1575990012),new a(H[57],1125592928),new a(H[58],2716904306),new a(H[59],442776044),new a(H[60],593698344),new a(H[61],3733110249),new a(H[62],2999351573),new a(H[63],3815920427),new a(3391569614,3928383900),new a(3515267271,566280711),new a(3940187606,3454069534),new a(4118630271,4000239992),new a(116418474,1914138554),new a(174292421,2731055270),new a(289380356,3203993006),new a(460393269,320620315),new a(685471733,587496836),new a(852142971,1086792851),new a(1017036298,365543100),new a(1126000580,2618297676),new a(1288033470,3409855158),new a(1501505948,4234509866),new a(1607167915,987167468),new a(1816402316,1246189591)],K=[new a(0,1),new a(0,32898),new a(2147483648,32906),new a(2147483648,2147516416),new a(0,32907),new a(0,2147483649),new a(2147483648,2147516545),new a(2147483648,32777),new a(0,138),new a(0,136),new a(0,2147516425),new a(0,2147483658),new a(0,2147516555),new a(2147483648,139),new a(2147483648,32905),new a(2147483648,32771),new a(2147483648,32770),new a(2147483648,128),new a(0,32778),new a(2147483648,2147483658),new a(2147483648,2147516545),new a(2147483648,32896),new a(0,2147483649),new a(2147483648,2147516424)],V=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},731:(e,t,n)=>{"use strict";var r=n(877),o=n.n(r);function i(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,s,"next",e)}function s(e){i(a,r,o,u,s,"throw",e)}u(void 0)}))}}function u(){return(u=a((function*(e,t){return void 0===t&&(t=!0),200===(yield WPP.chat.clear(e,t)).status}))).apply(this,arguments)}function s(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"throw",e)}a(void 0)}))}}function d(){return(d=c((function*(e,t){return Array.isArray(t)||(t=[t]),!!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>e.id))).length&&(yield window.Store.sendCreateGroup(e,t))}))).apply(this,arguments)}function l(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,u,"next",e)}function u(e){l(i,r,o,a,u,"throw",e)}a(void 0)}))}}function p(e,t){return h.apply(this,arguments)}function h(){return h=f((function*(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("object"==typeof e&&e._serialized&&(e=e._serialized),"string"!=typeof e)return!1;var r=window.Store.MsgKey.fromString(e);if(!r)return!1;var o=window.Store.Msg.get(r);if(!o){var i=window.Store.Chat.get(r.remote);if(!i)return!1;if(yield i.loadEarlierMsgs(),!(o=window.Store.Msg.get(r))){var a=i.getSearchContext(r);a&&a.collection&&a.collection.loadAroundPromise&&(yield a.collection.loadAroundPromise),o=window.Store.Msg.get(r)}}if(!o)return!1;var u=!1;if(n)try{u=WAPI.processMessageObj(o,!0,!0)}catch(e){}else u=o;if("function"!=typeof t)return u;t(u)})),h.apply(this,arguments)}function w(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){w(i,r,o,a,u,"next",e)}function u(e){w(i,r,o,a,u,"throw",e)}a(void 0)}))}}function y(){return y=v((function*(e,t,n,r){var o=new Store.WidFactory.createWid(e),i=WAPI.getChat(o);if(!i)return void 0!==r&&r(!1),!1;Array.isArray(t)||(t=[t]);var a=(yield Promise.all(t.map(function(){var e=v((function*(e){return"string"==typeof e?yield p(e,null,!1):e}));return function(t){return e.apply(this,arguments)}}()))).filter((e=>e));if(0==a.length)return!0;var u=n?[i.sendDeleteMsgs(a,i)]:[i.sendRevokeMsgs(a.filter((e=>e.isSentByMe)),i),i.sendDeleteMsgs(a.filter((e=>!e.isSentByMe)),i)];return Promise.all(u).then((e=>(void 0!==r&&r(!0),!0)))})),y.apply(this,arguments)}function g(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){g(i,r,o,a,u,"next",e)}function u(e){g(i,r,o,a,u,"throw",e)}a(void 0)}))}}function P(){return(P=m((function*(e){return yield new Promise(((t,n)=>{var r=new XMLHttpRequest;r.onload=function(){if(4==r.readyState)if(200==r.status){var e=new FileReader;e.readAsDataURL(r.response),e.onload=function(n){t(e.result.substr(e.result.indexOf(",")+1))}}else console.error(r.statusText);else t(!1)},r.open("GET",e,!0),r.responseType="blob",r.send(null)}))}))).apply(this,arguments)}function A(e,t){var n=e.split(","),r=n[0].match(/(?:data:)?(.*?)(?:;base64)?$/i)[1];r=r.split(/\s+;\s+/).join("; ");for(var o=window.Base64?window.Base64.atob(n[1]):atob(n[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],t,{type:r})}var b=n(276);function I(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function S(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){I(i,r,o,a,u,"next",e)}function u(e){I(i,r,o,a,u,"throw",e)}a(void 0)}))}}function W(e){return M.apply(this,arguments)}function M(){return(M=S((function*(e){var t=yield e.arrayBuffer(),n=new b("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")}))).apply(this,arguments)}function C(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function j(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(void 0)}))}}function k(){return(k=j((function*(e,t){var n=yield W(t),r=C(32),o=(new AbortController).signal,i=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:o,mediaKey:r});return O(O({},i),{},{clientUrl:i.url,filehash:n,id:n,uploadhash:i.encFilehash,mediaBlob:t})}))).apply(this,arguments)}function T(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function U(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,u,"next",e)}function u(e){T(i,r,o,a,u,"throw",e)}a(void 0)}))}}function L(){return(L=U((function*(e){var t=[];e?t.push(WAPI.getAllChatsWithNewMsg().map((e=>WAPI.getChat(e.id._serialized)))):t.push(WAPI.getAllChatIds().map((e=>WAPI.getChat(e))));var n=(yield Promise.all(t)).flatMap((e=>e)),r=JSON.stringify(n);return JSON.parse(r)}))).apply(this,arguments)}function N(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function F(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,u,"next",e)}function u(e){N(i,r,o,a,u,"throw",e)}a(void 0)}))}}var R=function(){var e=F((function*(){var e=yield Promise.all(window.Store.Contact.map(function(){var e=F((function*(e){return yield WAPI._serializeContactObj(e)}));return function(t){return e.apply(this,arguments)}}()));return e}));return function(){return e.apply(this,arguments)}}();function G(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function D(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){G(i,r,o,a,u,"next",e)}function u(e){G(i,r,o,a,u,"throw",e)}a(void 0)}))}}function B(){return(B=D((function*(e,t,n,r){var o=yield WAPI.sendExist(e),i=[];if(!o.erro){var a=o.msgs.models;for(var u in a)if("remove"!==u){var s=a[u],c=WAPI.processMessageObj(s,t,n);c&&i.push(c)}}return void 0!==r&&r(i),i}))).apply(this,arguments)}var z=function(e){return e.unreadCount>0},H=function(e){var t=window.Store.Chat.filter(z).map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t};function q(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var V=function(){var e,t=(e=function*(){var e=H().map((e=>Store.Msg.findQuery({remote:e.id,count:e.unreadCount-1})));return(yield Promise.all(e)).flat().map(WAPI._serializeMessageObj)},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){q(i,r,o,a,u,"next",e)}function u(e){q(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();function K(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){K(i,r,o,a,u,"next",e)}function u(e){K(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Q(){return(Q=Y((function*(e,t){var n=yield WAPI.getChat(e);return n=!!n&&WAPI._serializeChatObj(n),void 0!==t&&t(n),n}))).apply(this,arguments)}function J(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){J(i,r,o,a,u,"next",e)}function u(e){J(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $(){return($=X((function*(e,t){var n=[],r=window.WAPI.getAllGroups();for(var o in r)try{(yield window.WAPI.getGroupParticipantIDs(r[o].id)).filter((t=>t==e)).length&&n.push(r[o])}catch(e){console.log("Error in group:"),console.log(r[o]),console.log(e)}return void 0!==t&&t(n),n}))).apply(this,arguments)}function Z(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,u,"next",e)}function u(e){Z(i,r,o,a,u,"throw",e)}a(void 0)}))}}function te(e){return ne.apply(this,arguments)}function ne(){return(ne=ee((function*(e){return(yield WAPI.getGroupMetadata(e)).participants}))).apply(this,arguments)}function re(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){re(i,r,o,a,u,"next",e)}function u(e){re(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ie(){return(ie=oe((function*(e,t){var n=(yield te(e)).filter((e=>e.isAdmin)).map((e=>e.id));return void 0!==t&&t(n),n}))).apply(this,arguments)}function ae(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ue(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ae(i,r,o,a,u,"next",e)}function u(e){ae(i,r,o,a,u,"throw",e)}a(void 0)}))}}function se(){return(se=ue((function*(e){var t=Store.Chat.get(e);if(!t)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!t.isGroup)return"";var n;return n=t.groupMetadata&&t.groupMetadata.inviteCode?t.groupMetadata.inviteCode:yield Store.GroupInvite.sendQueryGroupInviteCode(t.id),"https://chat.whatsapp.com/".concat(n)}))).apply(this,arguments)}function ce(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ce(i,r,o,a,u,"next",e)}function u(e){ce(i,r,o,a,u,"throw",e)}a(void 0)}))}}function le(){return(le=de((function*(e){return yield Store.WapQuery.groupInviteInfo(e)}))).apply(this,arguments)}function fe(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){fe(i,r,o,a,u,"next",e)}function u(e){fe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function he(){return(he=pe((function*(e,t){var n=window.Store.GroupMetadata.default.find(e);return void 0!==t&&t(n),n}))).apply(this,arguments)}function we(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){we(i,r,o,a,u,"next",e)}function u(e){we(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ye(){return(ye=ve((function*(e,t){var n=(yield te(e)).map((e=>e.id));return void 0!==t&&t(n),n}))).apply(this,arguments)}function ge(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function me(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ge(i,r,o,a,u,"next",e)}function u(e){ge(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Pe(){return(Pe=me((function*(e,t){try{var n=yield window.Store.WapQuery.queryExist(e);if(void 0===n.jid)throw 404;var r=window.WAPI._serializeNumberStatusObj(n);return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r}catch(n){return void 0!==t&&t(window.WAPI._serializeNumberStatusObj({status:n,jid:e})),n}}))).apply(this,arguments)}function Ae(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function be(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ae(i,r,o,a,u,"next",e)}function u(e){Ae(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ie(){return(Ie=be((function*(e){return yield Store.MyStatus.getStatus(e)}))).apply(this,arguments)}function Se(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function We(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Se(i,r,o,a,u,"next",e)}function u(e){Se(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Me(){return(Me=We((function*(e){e="string"==typeof e?e:e._serialized;var t=WAPI.getChat(e);return Store.GroupActions.sendExitGroup(t)}))).apply(this,arguments)}function Ce(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ce(i,r,o,a,u,"next",e)}function u(e){Ce(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Oe(e,t){return xe.apply(this,arguments)}function xe(){return(xe=_e((function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield Store.Msg.findQuery({remote:n.id,count:-1})}catch(e){}for(;!n.msgs.msgLoadState.noEarlierMsgs;)yield n.loadEarlierMsgs();return t&&t(!0),!0}))).apply(this,arguments)}function Ee(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function je(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ee(i,r,o,a,u,"next",e)}function u(e){Ee(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ke(){return(ke=je((function*(e,t,n,r){return WAPI.loadAllEarlierMessages(e).then((o=>{var i=WAPI.getChat(e);if(!i)throw{error:!0,code:"chat_not_found",message:"Chat not found"};var a=[],u=i.msgs.models;for(var s in u)if("remove"!==s){var c=u[s],d=WAPI.processMessageObj(c,t,n);d&&a.push(d)}return void 0!==r&&r(a),a}))}))).apply(this,arguments)}function Te(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Ue(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Te(i,r,o,a,u,"next",e)}function u(e){Te(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Le(){return(Le=Ue((function*(e){var t=WAPI.getChat(e);if(t){var n=yield t.loadEarlierMsgs();if(n)return n.map(WAPI._serializeMessageObj)}return!1}))).apply(this,arguments)}function Ne(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Fe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ne(i,r,o,a,u,"next",e)}function u(e){Ne(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Re(e,t){return Ge.apply(this,arguments)}function Ge(){return(Ge=Fe((function*(e,t){Array.isArray(t)||(t=[t]);var n=new Store.MediaCollection({chatParticipantCount:e.getParticipantCount()});return yield n.processAttachments("0.4.613"===Debug.VERSION?t:t.map((e=>({file:e}))),e,1),n}))).apply(this,arguments)}function De(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Be(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){De(i,r,o,a,u,"next",e)}function u(e){De(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ze(){return(ze=Be((function*(e){var t=Store.Chat.get(e);if(!t)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!t.isGroup)return!1;var n=yield Store.GroupInvite.sendRevokeGroupInviteCode(t.id);return"https://chat.whatsapp.com/".concat(n)}))).apply(this,arguments)}function He(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){He(i,r,o,a,u,"next",e)}function u(e){He(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ve(){return(Ve=qe((function*(e,t){e=parseInt(e,10);var n=window.Store.Chat.get(t);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};switch(e){case 0:window.Store.ChatStates.sendChatStateComposing(n.id);break;case 1:window.Store.ChatStates.sendChatStateRecording(n.id);break;case 2:window.Store.ChatStates.sendChatStatePaused(n.id);break;default:return!1}return!0}))).apply(this,arguments)}function Ke(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ke(i,r,o,a,u,"next",e)}function u(e){Ke(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qe(e,t,n,r,o){return Je.apply(this,arguments)}function Je(){return Je=Ye((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(o=o||"sendFile","string"!=typeof n&&null!=n||"string"!=typeof r&&null!=r){var u="incorrect parameter, insert an string.";return WAPI.scope(t,!0,null,u)}var s=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);s&&s.length&&(s=s[1]);var c=yield WAPI.sendExist(t);if(c.erro)return c;var d=null;if("string"==typeof i&&i){var l=yield p(i,null,!1);l&&l.canReply()&&(d=l)}var f=A(e,n),h=yield Re(c,f),w=h.models[0],v=(yield w.sendToChat(c,{caption:r,quotedMsg:d,isViewOnce:a}))||"",y={type:o,filename:n,text:r,mimeType:s},g=yield WAPI.getchatId(c.id);if("success"===v||"OK"===v){var m=WAPI.scope(g,!1,v,null);return Object.assign(m,y),m}return m=WAPI.scope(g,!0,v,null),Object.assign(m,y),m})),Je.apply(this,arguments)}function Xe(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xe(i,r,o,a,u,"next",e)}function u(e){Xe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ze(){return Ze=$e((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=yield WAPI.sendExist(t);if(a.erro)return a;var u=null;if("string"==typeof i&&i){var s=yield p(i,null,!1);s&&s.canReply()&&(u=s)}var c=A(e,n),d=yield Re(a,c),l=d.models[0];l.mediaPrep._mediaData.type="ptt";var f=(yield l.sendToChat(a,{caption:r,quotedMsg:u}))||"";void 0!==o&&o(!0);var h={type:"ptt",filename:n,text:r},w=yield WAPI.getchatId(a.id);if("success"===f||"OK"===f){var v=WAPI.scope(w,!1,f,null);return Object.assign(v,h),v}return v=WAPI.scope(w,!0,f,null),Object.assign(v,h),v})),Ze.apply(this,arguments)}function et(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function tt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){et(i,r,o,a,u,"next",e)}function u(e){et(i,r,o,a,u,"throw",e)}a(void 0)}))}}function nt(e,t,n,r){return rt.apply(this,arguments)}function rt(){return(rt=tt((function*(e,t,n,r){var o=yield WAPI.sendExist(t);if(o.erro)return o;var i=new window.Store.Sticker.default.modelClass;i.__x_clientUrl=e.clientUrl,i.__x_filehash=e.filehash,i.__x_id=e.filehash,i.__x_uploadhash=e.uploadhash,i.__x_mediaKey=e.mediaKey,i.__x_initialized=!1,i.__x_mediaData.mediaStage="INIT",i.mimetype="image/webp",i.height=n&&n.height?n.height:512,i.width=n&&n.width?n.width:512,yield i.initialize();var a,u=(yield i.sendToChat(o,{stickerIsFirstParty:!1,stickerSendOrigin:6}))||"",s={type:r},c=yield WAPI.getchatId(o.id);return"OK"===u?(a=WAPI.scope(c,!1,u,null),Object.assign(a,s),a):(a=WAPI.scope(c,!0,u,null),Object.assign(a,s),a)}))).apply(this,arguments)}function ot(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function it(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ot(i,r,o,a,u,"next",e)}function u(e){ot(i,r,o,a,u,"throw",e)}a(void 0)}))}}function at(e,t,n,r){return ut.apply(this,arguments)}function ut(){return(ut=it((function*(e,t,n,r){var o=A("data:image/webp;base64,"+e,"file.webp"),i=yield window.WAPI.encryptAndUploadFile("sticker",o);return yield nt(i,t,n,r)}))).apply(this,arguments)}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ct(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function dt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ct(i,r,o,a,u,"next",e)}function u(e){ct(i,r,o,a,u,"throw",e)}a(void 0)}))}}function lt(){return lt=dt((function*(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=yield WAPI.sendExist(e);if(o.erro)return o;var i,a=yield window.WAPI.getNewMessageId(o.id),u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:Store.UserPrefs.getMaybeMeUser(),to:o.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},s=(yield Promise.all(Store.addAndSendMsgToChat(o,u)))[1]||"",c={latitude:t,longitude:n,title:r,type:"location"},d=yield WAPI.getchatId(o.id);return"success"==s||"OK"==s?(i=WAPI.scope(d,!1,s,null),Object.assign(i,c),i):(i=WAPI.scope(d,!0,s,null),Object.assign(i,c),i)})),lt.apply(this,arguments)}function ft(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function pt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ft(i,r,o,a,u,"next",e)}function u(e){ft(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ht(){return(ht=pt((function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=yield window.WAPI.getNewMessageId(n.id),o={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:Store.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},i=(yield Promise.all(Store.addAndSendMsgToChat(n,o)))[1]||"";if("success"===i||"OK"===i)return null==r?void 0:r._serialized;var a={type:"sendtext",text:o},u=yield WAPI.getchatId(n.id),s=WAPI.scope(u,!0,i,null);return Object.assign(s,a),s}))).apply(this,arguments)}function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach((function(t){yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function mt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){gt(i,r,o,a,u,"next",e)}function u(e){gt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Pt(){return Pt=mt((function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Store.Chat.get(e),o={};n.attachment&&(t=(o=yield WWebJS.processMediaData(n.attachment,n.sendAudioAsVoice)).preview,delete n.attachment);var i={};if(n.quotedMessageId){var a=yield p(n.quotedMessageId,null,!1);a&&a.canReply()&&(i=a.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map((e=>window.Store.Contact.get(e).id)));var u={};n.location&&(u={type:"location",loc:n.location.description,lat:n.location.latitude,lng:n.location.longitude},delete n.location);var s={};if(n.contactCard){var c=window.Store.Contact.get(n.contactCard);s={body:window.Store.VCard.vcardFromContactModel(c).vcard,type:"vcard",vcardFormattedName:c.formattedName},delete n.contactCard}else if(n.contactCardList){var d=n.contactCardList.map((e=>window.Store.Contact.get(e))),l=d.map((e=>window.Store.VCard.vcardFromContactModel(e)));s={type:"multi_vcard",vcardList:l,body:void 0},delete n.contactCardList}else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var f=yield window.Store.VCard.parseVcard(t);f&&(s={type:"vcard",vcardFormattedName:yield window.Store.VCard.vcardGetNameFromParsed(f)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var h=yield window.Store.Validators.findLink(t);if(h){var w=yield window.Store.Wap2.default.queryLinkPreview(h.url);w.preview=!0,w.subtype="url",n=vt(vt({},n),w)}}var v=yield window.WAPI.getNewMessageId(r.id),y=yield Store.UserPrefs.getMaybeMeUser(),g=vt(vt(vt(vt(vt({id:v,ack:0,body:t,from:y,to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),u),o),i),s);return yield window.Store.addAndSendMsgToChat(r,g),v._serialized})),Pt.apply(this,arguments)}function At(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function bt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){At(i,r,o,a,u,"next",e)}function u(e){At(i,r,o,a,u,"throw",e)}a(void 0)}))}}function It(){return(It=bt((function*(e,t){var n=e.id?e:Store.Chat.get(e),r=n.id._serialized,o=n.msgs.filter((e=>e.__x_isSentByMe))[0];if(!o)return n.sendMessage(t);var i=Object.create(o),a=window.WAPI.getNewMessageId(r),u=t.match(/@(\d*)/g).map((e=>new Store.WidFactory.createUserWid(e.replace("@",""))))||void 0,s={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new Store.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:u};return Object.assign(i,s),yield Store.addAndSendMsgToChat(n,i),a._serialized}))).apply(this,arguments)}function St(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Wt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){St(i,r,o,a,u,"next",e)}function u(e){St(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Mt(){return(Mt=Wt((function*(e,t){if(!e)return!1;var n=window.WAPI.getChat(e);return void 0!==n?(yield Store.ReadSeen.sendSeen(n,!1),t&&t(!0),!0):(t&&t(!1),!1)}))).apply(this,arguments)}function Ct(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ct(i,r,o,a,u,"next",e)}function u(e){Ct(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ot(){return(Ot=_t((function*(e,t,n,r,o){var i=yield WAPI.sendExist(t);if(i.erro)return i;var a=A(e,n),u=(yield Re(i,a)).models[0];u.mediaPrep._mediaData.isGif=!0,u.mediaPrep._mediaData.gifAttribution=1;var s=(yield u.sendToChat(i,{caption:r}))||"",c={filename:n,text:r},d=yield WAPI.getchatId(i.id);if("success"===s||"OK"===s){void 0!==o&&o(!1);var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return void 0!==o&&o(!0),l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l}))).apply(this,arguments)}function xt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Et(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xt(i,r,o,a,u,"next",e)}function u(e){xt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function jt(){return(jt=Et((function*(e){yield window.Store.Perfil.setPushname(e)}))).apply(this,arguments)}function kt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ut(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Lt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ut(i,r,o,a,u,"next",e)}function u(e){Ut(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Nt(){return Nt=Lt((function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=window.Store.Chat.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var o,i=[],a=kt(t);try{for(a.s();!(o=a.n()).done;){var u=o.value,s="string"==typeof u?u:u.id,c=yield p(s,null,!1);if(!c)throw{error:!0,code:"message_not_found",message:"Message not Found",messageId:s};i.push(c)}}catch(e){a.e(e)}finally{a.f()}var d=i.filter((e=>!n||!e.isSentByMe));return yield r.forwardMessages(d),yield new Promise((e=>setTimeout(e,100))),r.msgs.models.slice(-1*t.length).map((e=>e.id._serialized))})),Nt.apply(this,arguments)}function Ft(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Rt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ft(i,r,o,a,u,"next",e)}function u(e){Ft(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Gt(){return(Gt=Rt((function*(e,t,n){var r=yield WAPI.sendExist(e),o=yield WAPI.sendExist(t);if(r.id&&o.id){var i=window.WAPI.getNewMessageId(r.id),a=new Store.Contact.modelClass(o.contact);n&&(a.name=n,Object.defineProperty(a,"formattedName",{value:n}));var u={ack:0,body:(yield window.Store.Vcard.vcardFromContactModel(a)).vcard,from:Store.UserPrefs.getMaybeMeUser(),local:!0,self:"out",id:i,vcardFormattedName:a.formattedName,t:parseInt((new Date).getTime()/1e3),to:r.id,type:"vcard",isNewMsg:!0},s=(yield Promise.all(Store.addAndSendMsgToChat(r,u)))[1]||"",c={from:t,type:"vcard"},d=yield WAPI.getchatId(r.id);if("success"===s||"OK"===s){var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l}return r}))).apply(this,arguments)}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){zt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ht(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ht(i,r,o,a,u,"next",e)}function u(e){Ht(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Vt(){return(Vt=qt((function*(e,t,n){var r=Store.Chat.get(e),o={};if(n){var i=yield p(n,null,!1);i&&i.canReply()&&(o=i.msgContextInfo(r))}var a=yield window.WAPI.getNewMessageId(r.id),u=Bt({id:a,ack:0,body:t,from:yield Store.UserPrefs.getMaybeMeUser(),to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},o);return yield window.Store.addAndSendMsgToChat(r,u),a._serialized}))).apply(this,arguments)}function Kt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Yt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Kt(i,r,o,a,u,"next",e)}function u(e){Kt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qt(){return(Qt=Yt((function*(e){var t=window.Store.Chat.get(e);if(!t)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};yield Store.ChatPresence.markComposing(t)}))).apply(this,arguments)}function Jt(){return(Jt=Yt((function*(e){var t=window.Store.Chat.get(e);if(!t)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};yield Store.ChatPresence.markPaused(t)}))).apply(this,arguments)}function Xt(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xt(i,r,o,a,u,"next",e)}function u(e){Xt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Zt(){return Zt=$t((function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=yield WPP.chat.getMessages(e,t);if(!Array.isArray(n)){var r=new Error("Failed to fetch messages for ".concat(e));throw Object.assign(r,n),r}var o=n.map((e=>new Store.Msg.modelClass(e))).map((e=>WAPI.processMessageObj(e,!0,!0)));return o})),Zt.apply(this,arguments)}function en(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function tn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){en(i,r,o,a,u,"next",e)}function u(e){en(i,r,o,a,u,"throw",e)}a(void 0)}))}}function nn(){return(nn=tn((function*(e){return yield WPP.blocklist.blockContact(e),!0}))).apply(this,arguments)}function rn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function on(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){rn(i,r,o,a,u,"next",e)}function u(e){rn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function an(){return(an=on((function*(e){return yield WPP.blocklist.unblockContact(e),!0}))).apply(this,arguments)}function un(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function sn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){un(i,r,o,a,u,"next",e)}function u(e){un(i,r,o,a,u,"throw",e)}a(void 0)}))}}function cn(){return(cn=sn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.removeParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.removeParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function dn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ln(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){dn(i,r,o,a,u,"next",e)}function u(e){dn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function fn(){return(fn=ln((function*(e,t){var n=Store.Chat.get(e);return Array.isArray(t)||(t=[t]),!!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>e.id))).length&&(yield window.Store.WapQuery.addParticipants(n.id,t),t.map((e=>n.groupMetadata.participants.get(e))),yield window.Store.Participants.addParticipants(n,t),!0)}))).apply(this,arguments)}function pn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function hn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pn(i,r,o,a,u,"next",e)}function u(e){pn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function wn(){return(wn=hn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.promoteParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.promoteParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function vn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vn(i,r,o,a,u,"next",e)}function u(e){vn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function gn(){return(gn=yn((function*(e,t,n){var r=Store.Chat.get(e);if(Array.isArray(t)||(t=[t]),!(t=(t=yield Promise.all(t.map((e=>WAPI.sendExist(e))))).filter((e=>!e.erro&&e.isUser)).map((e=>r.groupMetadata.participants.get(e.id))).filter((e=>void 0!==e)).map((e=>e.id))).length)return"function"==typeof n&&n(!1),!1;yield window.Store.WapQuery.demoteParticipants(r.id,t);var o=t.map((e=>r.groupMetadata.participants.get(e)));return yield window.Store.Participants.demoteParticipants(r,o),"function"==typeof n&&n(!0),!0}))).apply(this,arguments)}function mn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Pn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mn(i,r,o,a,u,"next",e)}function u(e){mn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function An(){return(An=Pn((function*(e){var t=Store.Chat.get(e);return Store.Cmd.default.openChatBottom(t)}))).apply(this,arguments)}function bn(){return(bn=Pn((function*(e,t){var n=Store.Chat.get(e),r=n.msgs.models.find((e=>e.id.id===t)),o={collection:n.msgs,msg:r,isUnreadDivider:!1};return yield Store.Cmd.default._openChat(n,o)}))).apply(this,arguments)}function In(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Sn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){In(i,r,o,a,u,"next",e)}function u(e){In(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Wn(){return(Wn=Sn((function*(e){return yield Store.WapQuery.acceptGroupInvite(e)}))).apply(this,arguments)}function Mn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Cn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Mn(i,r,o,a,u,"next",e)}function u(e){Mn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function _n(){return(_n=Cn((function*(e){if(!e)return!1;var t=window.WAPI.getChat(e);return void 0!==t&&(yield Store.ReadSeen.markUnread(t,!0),!0)}))).apply(this,arguments)}function On(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function xn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){On(i,r,o,a,u,"next",e)}function u(e){On(i,r,o,a,u,"throw",e)}a(void 0)}))}}function En(){return(En=xn((function*(){var e=yield Store.Blocklist,t=[];if(void 0!==e&&void 0!==e._index){for(var n in e._index)t.push(n);return t}return!1}))).apply(this,arguments)}function jn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function kn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jn(i,r,o,a,u,"next",e)}function u(e){jn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Tn(){return(Tn=kn((function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")}))).apply(this,arguments)}function Un(){return(Un=kn((function*(){return yield Store.Theme.getTheme()}))).apply(this,arguments)}function Ln(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Nn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ln(i,r,o,a,u,"next",e)}function u(e){Ln(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Fn(){return(Fn=Nn((function*(){return yield Store.ServiceWorker.default.restart(),!0}))).apply(this,arguments)}function Rn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Gn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Rn(i,r,o,a,u,"next",e)}function u(e){Rn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Dn(){return(Dn=Gn((function*(){return yield Store.ServiceWorker.default.killServiceWorker(),!0}))).apply(this,arguments)}function Bn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function zn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bn(i,r,o,a,u,"next",e)}function u(e){Bn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Hn(){return(Hn=zn((function*(e,t,n){n=n||"";var r={Protocol:"^(https?:\\/\\/)?",Domain:"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|",IP:"((\\d{1,3}\\.){3}\\d{1,3}))",Port:"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*",Query:"(\\?[;&a-z\\d%_.~+=-]*)?",End:"(\\#[-a-z\\d_]*)?$",Reg:()=>new RegExp(r.Protocol+r.Domain+r.IP+r.Port+r.Query+r.End,"i")};if(!r.Reg().test(t))return n="Use a valid HTTP protocol. Example: https://www.youtube.com/watch?v=V1bFr2SWP1",WAPI.scope(e,!0,null,n);var o=yield WAPI.sendExist(e);if(o.erro)return o;var i=yield Store.WapQuery.queryLinkPreview(t),a=(yield o.sendMessage(n.includes(t)?n:"".concat(t,"\n").concat(n),{linkPreview:i}))||"",u={type:"LinkPreview",url:t,text:n},s=yield WAPI.getchatId(o.id);if("success"===a||"OK"===a){var c=WAPI.scope(s,!1,a,null);return Object.assign(c,u),c}return c=WAPI.scope(s,!0,a,null),Object.assign(c,u),c}))).apply(this,arguments)}function qn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Vn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){qn(i,r,o,a,u,"next",e)}function u(e){qn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Kn(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o={me:Store.Me.attributes,to:e,erro:t,text:r,status:n};return o}function Yn(){return(Yn=Vn((function*(e){var t=yield WAPI.getChatById(e),n=t.lastReceivedKey||{},r={formattedName:t.contact.formattedName,isBusiness:t.contact.isBusiness,isMyContact:t.contact.isMyContact,verifiedName:t.contact.verifiedName,pushname:t.contact.pushname};return Object.assign(n,r),n}))).apply(this,arguments)}function Qn(){return Qn=Vn((function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return Kn(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new Store.Chat.modelClass({id:Store.WidFactory.createWid("status@broadcast")}),Store.Chat.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var o=yield window.WAPI.checkNumberStatus(e);if(!o.numberExists)return Kn(e,!0,o.status,"The number does not exist");yield WPP.chat.find(o.id),e=o.id._serialized,r=yield window.WAPI.getChat(e)}return r?(n&&(yield window.Store.SendSeen(r,!1)),t?r:Kn(e,!1,200)):Kn(e,!0,404)})),Qn.apply(this,arguments)}function Jn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jn(i,r,o,a,u,"next",e)}function u(e){Jn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $n(){return $n=Xn((function*(e,t){if("string"!=typeof e){var n="incorrect parameter, insert an string. Example: '222222222222@c.us'";return WAPI.scope(e,!0,null,n)}if(!Array.isArray(t))return n="incorrect parameter, insert an array. Example: ['222222222222@c.us', '333333333333@c.us, ... ]",WAPI.scope(e,!0,null,n);if(1===t.length)return n="Enter more than one number to send. Example: ['222222222222@c.us', '333333333333@c.us, ... ]",WAPI.scope(e,!0,null,n);var r=yield WAPI.sendExist(e);if(r.erro)return r;var o=t.map(function(){var e=Xn((function*(e){var t=e,n=null;"object"==typeof e&&(t=e.id,n=e.name);var r=yield WAPI.sendExist(t),o=new Store.Contact.modelClass(r.contact);return n&&(o.name=n,Object.defineProperty(o,"formattedName",{value:n})),yield window.Store.Vcard.vcardFromContactModel(o)}));return function(t){return e.apply(this,arguments)}}()),i=window.WAPI.getNewMessageId(r.id),a=yield Promise.all(o),u={ack:0,from:Store.UserPrefs.getMaybeMeUser(),local:!0,self:"out",id:i,t:parseInt((new Date).getTime()/1e3),to:r.id,type:"multi_vcard",vcardList:a,isNewMsg:!0},s=(yield Promise.all(Store.addAndSendMsgToChat(r,u)))[1]||"",c={from:t,type:"multi_vcard"},d=yield WAPI.getchatId(r.id);if("success"===s||"OK"===s){var l=WAPI.scope(d,!1,s,null);return Object.assign(l,c),l}return l=WAPI.scope(d,!0,s,null),Object.assign(l,c),l})),$n.apply(this,arguments)}function Zn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function er(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function tr(){return(tr=er((function*(e,t){t||(t=Store.UserPrefs.getMaybeMeUser());var n=Store.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield Store.Profile.sendSetPicture(n,r+e.b,r+e.a)}))).apply(this,arguments)}function nr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nr(i,r,o,a,u,"next",e)}function u(e){nr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function or(){return or=rr((function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("boolean"!=typeof t||"boolean"!=typeof n){var r="incorrect parameter, insert a boolean true or false";return WAPI.scope(e,!0,null,r)}var o=t?"pin":"unpin",i=void 0,a=yield WAPI.sendExist(e,!0,n);if(a.erro)return a;var u={type:"pinChat",typefix:o},s=yield WAPI.getchatId(a.id);return yield Store.pinChat.setPin(a,t).then((e=>{var t=WAPI.scope(s,!1,"OK",null);Object.assign(t,u),i=t})).catch((e=>{var t=WAPI.scope(s,!0,e,"Pin Chat first");Object.assign(t,u),i=t})),i})),or.apply(this,arguments)}function ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ar(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ir(i,r,o,a,u,"next",e)}function u(e){ir(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ur(){return(ur=ar((function*(){if(window.localStorage){var e=yield JSON.parse(JSON.stringify(window.localStorage));return{WABrowserId:e.WABrowserId,WASecretBundle:e.WASecretBundle,WAToken1:e.WAToken1,WAToken2:e.WAToken2}}}))).apply(this,arguments)}function sr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function cr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sr(i,r,o,a,u,"next",e)}function u(e){sr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function dr(){return(dr=cr((function*(e,t,n){var r=yield WAPI.sendExist(e);if(r.erro)return r;var o,i=null,a=null,u=null,s=yield WAPI.getchatId(r.id),c=yield window.Store.Mute.get(r.id),d={type:"sendMute",time:t,timeType:n};if("number"==typeof t&&"string"==typeof n){switch(n){case"hours":i=parseInt(new Date((new Date).setHours((new Date).getHours()+t)).getTime()/1e3);break;case"minutes":i=parseInt(new Date((new Date).setMinutes((new Date).getMinutes()+t)).getTime()/1e3);break;case"year":i=parseInt(new Date((new Date).setDate((new Date).getDate()+t)).getTime()/1e3)}yield window.Store.SendMute.sendConversationMute(r.id,i,0).then((e=>{a=e})).catch((e=>{a=e}))}else u=!0,yield window.Store.SendMute.sendConversationMute(r.id,0,c.__x_expiration).then((e=>{a=e})).catch((e=>{a=e}));if(200===a.status){u?(c.__x_expiration=0,c.__x_isMuted=!1):(c.__x_expiration=i,c.__x_isMuted=!0);var l=WAPI.scope(s,!1,a.status,null);return Object.assign(l,d),l}return o=u?"is not mute to remove":"This chat is already mute",l=WAPI.scope(s,!0,a.status,o),Object.assign(l,d),l}))).apply(this,arguments)}function lr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function fr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lr(i,r,o,a,u,"next",e)}function u(e){lr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function pr(){return pr=fr((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=(yield window.Store.Mute)._models,n=new Array,r=new Array;for(var o in t)t[o].__x_isMuted?r.push(WAPI.interfaceMute(t[o])):n.push(WAPI.interfaceMute(t[o]));var i=null;switch(console.log(0,e),e){case"all":i=[{total:r.length+n.length,amountToMute:r.length,amountnoMute:n.length},r,n];break;case"toMute":i=[{total:r.length},r];break;case"noMute":i=[{total:n.length},n]}return i})),pr.apply(this,arguments)}function hr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){hr(i,r,o,a,u,"next",e)}function u(e){hr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function vr(e){return yr.apply(this,arguments)}function yr(){return(yr=wr((function*(e){var t=yield p(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if(!t.mediaData)throw{error:!0,code:"message_not_contains_media",message:"Message not contains media"};yield t.downloadMedia({downloadEvenIfExpensive:!0,rmrReason:1,isUserInitiated:!0});var n=null;if(t.mediaData.mediaBlob?n=t.mediaData.mediaBlob.forceToBlob():t.mediaData.filehash&&(n=Store.BlobCache.get(t.mediaData.filehash)),!n&&t.mediaObject.type&&"VIDEO"===t.mediaObject.type)return delete t.mediaObject.type,t.type="document",vr(e);if(!n)throw{error:!0,code:"media_not_found",message:"Media not found"};return yield new Promise(((e,t)=>{var r=new FileReader;r.onloadend=function(t){e(r.result)},r.onabort=t,r.onerror=t,r.readAsDataURL(n)}))}))).apply(this,arguments)}function gr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function mr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){gr(i,r,o,a,u,"next",e)}function u(e){gr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var Pr=null,Ar=!0;function br(){return Ir.apply(this,arguments)}function Ir(){return(Ir=mr((function*(){return window.WAPI.waitForStore(["State","Stream"],(()=>{if("MAIN"===window.Store.Stream.mode&&"TIMEOUT"!==window.Store.State.default.state)return Ar?(Ar=!1,window.Store.State.default.sendBasic({tag:window.Store.State.default.tag("ping"),data:["admin","test"]}).then((()=>{Ar=!0}))):(window.Store.State.default.phoneWatchdog.activate(),void window.Store.State.default.phoneWatchdog.poke(250))}))}))).apply(this,arguments)}function Sr(){Pr&&clearInterval(Pr),Pr=null}function Wr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function _r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cr(i,r,o,a,u,"next",e)}function u(e){Cr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Or(){return Or=_r((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Wr(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new Store.WidFactory.createWid(o);Store.Presence.get(i)||(yield Store.Presence.find(i),n++)}}catch(e){r.e(e)}finally{r.f()}return n})),Or.apply(this,arguments)}function xr(){return(xr=_r((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Wr(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new Store.WidFactory.createWid(o),a=Store.Presence.get(i);a&&(a.delete(),n++)}}catch(e){r.e(e)}finally{r.f()}return n}))).apply(this,arguments)}function Er(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function jr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Tr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){kr(i,r,o,a,u,"next",e)}function u(e){kr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ur(e){return Lr.apply(this,arguments)}function Lr(){return(Lr=Tr((function*(e){var t=yield Store.Call.get(e);if(!t)throw{error:!0,code:"call_not_found",message:"Call not found"};if("INCOMING_RING"!==t.getState())throw{error:!0,code:"call_is_not_incoming_ring",message:"Call is not incoming ring"};return yield Store.sendCallSignalingMsg({common:{peer_jid:t.peerJid},payload:["reject",{"call-id":t.id,"call-creator":t.peerJid.toString({legacy:!0}),count:"0"},null]})}))).apply(this,arguments)}function Nr(){return Nr=Tr((function*(e){if(e)return yield Ur(e),1;var t,n=Store.Call.models.filter((e=>"INCOMING_RING"===e.getState())),r=Er(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;yield Ur(o.id).catch((e=>null))}}catch(e){r.e(e)}finally{r.f()}return n.lenth})),Nr.apply(this,arguments)}function Fr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Fr(i,r,o,a,u,"next",e)}function u(e){Fr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Gr(){return(Gr=Rr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!n.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};if(n.groupMetadata.desc==t)throw{error:!0,code:"redundant_change",message:"You can not change group description to same name"};var r=Store.randomMessageId(),o=n.groupMetadata.descId,i=yield Store.sendSetGroupDescription(n.id,t,r,o).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}));return n.groupMetadata.desc=t,i}))).apply(this,arguments)}function Dr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Br(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Dr(i,r,o,a,u,"next",e)}function u(e){Dr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function zr(){return(zr=Br((function*(e,t,n){var r=Store.Chat.get(e);if(!r)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!r.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};var o=["announcement","restrict","no_frequently_forwarded","ephemeral"];if(!o.includes(t))throw{error:!0,code:"invalid_property",message:"Invalid property, none of ("+o.join(", ")+")"};return"ephemeral"===t&&(n=n?604800:0),yield Store.sendSetGroupProperty(r.id,t,n).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}))}))).apply(this,arguments)}function Hr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function qr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hr(i,r,o,a,u,"next",e)}function u(e){Hr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Vr(){return(Vr=qr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"group_not_found",message:"Group not found"};if(!n.isGroup)throw{error:!0,code:"not_a_group",message:"Chat is not a group"};if(n.name==t)throw{error:!0,code:"redundant_change",message:"You can not change group subject to same name"};var r=yield Store.sendSetGroupSubject(n.id,t).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}));return n.name=t,r}))).apply(this,arguments)}function Kr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Yr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Kr(i,r,o,a,u,"next",e)}function u(e){Kr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Qr(){return(Qr=Yr((function*(e){void 0===e&&(e=!0),e?yield Store.ChatPresence.sendPresenceAvailable():yield Store.ChatPresence.sendPresenceUnavailable()}))).apply(this,arguments)}function Jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jr(i,r,o,a,u,"next",e)}function u(e){Jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $r(){return($r=Xr((function*(e,t){var n=Store.Chat.get(e);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};return n.isGroup?yield WAPI.setGroupProperty(n.id,"ephemeral",t):(t=t?604800:0,yield Store.changeEphemeralDuration(n,t).catch((e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}})),!0)}))).apply(this,arguments)}function Zr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function eo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zr(i,r,o,a,u,"next",e)}function u(e){Zr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function to(){return to=eo((function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=eo((function*(e){return yield p(e,null,!1)}));return function(t){return e.apply(this,arguments)}}())),r=(n=n.filter((e=>e&&e.star!==t))).reduce((function(e,t){var n=t.id.remote._serialized;return e[n]=e[n]||[],e[n].push(t),e}),Object.create(null)),o=0,i=function*(e){var n=Store.Chat.get(e),i=r[e];o+=(yield n.sendStarMsgs(i,t).then((()=>i.length)).catch((()=>0)))};for(var a in r)yield*i(a);return o})),to.apply(this,arguments)}function no(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function ro(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){no(i,r,o,a,u,"next",e)}function u(e){no(i,r,o,a,u,"throw",e)}a(void 0)}))}}function oo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return io(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?io(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function io(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ao(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var uo={};function so(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var co=function(){var e,t=(e=function*(e){var t=Store.WidFactory.createDeviceWid(e),n=Store.ProfilePicThumb.get(t);return n||(n=yield Store.ProfilePicThumb.find(t)),n?WAPI._serializeProfilePicThumb(n):null},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){so(i,r,o,a,u,"next",e)}function u(e){so(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function lo(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function fo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lo(i,r,o,a,u,"next",e)}function u(e){lo(i,r,o,a,u,"throw",e)}a(void 0)}))}}function po(){return(po=fo((function*(e){var t=window.Store.Catalog.get(e);if(t||(t=yield window.Store.Catalog.find(Store.WidFactory.createWid(e))),!t)throw{error:!0,code:"catalog_not_found",message:"Catalog not found"};return t.productCollection?t.productCollection.serialize():[]}))).apply(this,arguments)}function ho(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ho(i,r,o,a,u,"next",e)}function u(e){ho(i,r,o,a,u,"throw",e)}a(void 0)}))}}function vo(){return(vo=wo((function*(e){var t=yield p(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if("order"!==t.type)throw{error:!0,code:"message_is_not_an_order",message:"Message is not an order"};var n=window.Store.Order.get(t.orderId);if(n||(n=yield window.Store.Order.findOrder(t.orderId,t.sellerJid,t.token)),!n)throw{error:!0,code:"order_not_found",message:"Order not found"};return n.products}))).apply(this,arguments)}var yo,go;function mo(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Po(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mo(i,r,o,a,u,"next",e)}function u(e){mo(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}if(window.webpackJsonp=window.webpackJsonp||[],window.webpackChunkbuild=window.webpackChunkbuild||[],void 0===window.Store){window.Store={},window.Store.promises={};var bo=new(o());window.Store.loader=bo;var Io,So=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ao(e,t):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}([{id:"Store",conditions:e=>e.default&&e.default.Chat&&e.default.Msg?e.default:null},{id:"MediaCollection",conditions:e=>e.default&&e.default.prototype&&void 0!==e.default.prototype.processAttachments?e.default:null},{id:"MediaProcess",conditions:e=>e.BLOB?e:null},{id:"ChatUtil",conditions:e=>e.sendClear&&e.clearChat?e:null},{id:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"Wap",conditions:e=>e.createGroup?e:null},{id:"ServiceWorker",conditions:e=>e.default&&e.default.killServiceWorker?e:null},{id:"State",conditions:e=>e.STATE&&e.STREAM?e:null},{id:"WapDelete",conditions:e=>e.sendConversationDelete&&2==e.sendConversationDelete.length?e:null},{id:"Conn",conditions:e=>e.default&&e.Conn?e.default:null},{id:"WapQuery",conditions:e=>e.default&&e.default.queryExist&&e.default.getCapabilities?e.default:null},{id:"CryptoLib",conditions:e=>e.decryptE2EMedia?e:null},{id:"OpenChat",conditions:e=>e.default&&e.default.prototype&&e.default.prototype.openChat?e.default:null},{id:"UserConstructor",conditions:e=>e.default&&e.default.prototype&&e.default.prototype.isServer&&e.default.prototype.isUser?e.default:null},{id:"SendTextMsgToChat",conditions:e=>e.sendTextMsgToChat?e.sendTextMsgToChat:null},{id:"SendSeen",conditions:e=>e.sendSeen?e.sendSeen:null},{id:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"sendDelete",conditions:e=>e.sendDelete?e.sendDelete:null},{id:"addAndSendMsgToChat",conditions:e=>e.addAndSendMsgToChat?e.addAndSendMsgToChat:null},{id:"sendMsgToChat",conditions:e=>e.sendMsgToChat?e.sendMsgToChat:null},{id:"Catalog",conditions:e=>e.Catalog?e.Catalog:null},{id:"Perfil",conditions:e=>!0===e.__esModule&&e.setPushname&&!e.getComposeContents?e:null},{id:"MsgKey",conditions:e=>e.default&&"function"==typeof e.default.toString&&e.default.toString().includes("MsgKey error: obj is null/undefined")?e.default:null},{id:"Parser",conditions:e=>e.convertToTextWithoutSpecialEmojis?e.default:null},{id:"Builders",conditions:e=>e.TemplateMessage&&e.HydratedFourRowTemplate?e:null},{id:"Me",conditions:e=>e.PLATFORMS&&e.Conn?e.default:null},{id:"CallUtils",conditions:e=>e.sendCallEnd&&e.parseCall?e:null},{id:"Identity",conditions:e=>e.queryIdentity&&e.updateIdentity?e:null},{id:"MyStatus",conditions:e=>e.getStatus&&e.setMyStatus?e:null},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?e:null},{id:"ChatPresence",conditions:e=>e.markComposing&&e.markPaused&&e.markRecording?e:null},{id:"GroupActions",conditions:e=>e.sendExitGroup&&e.localExitGroup?e:null},{id:"Features",conditions:e=>e.FEATURE_CHANGE_EVENT&&e.features?e:null},{id:"MessageUtils",conditions:e=>e.storeMessages&&e.appendMessage?e:null},{id:"WebMessageInfo",conditions:e=>e.WebMessageInfo&&e.WebFeatures?e.WebMessageInfo:null},{id:"createMessageKey",conditions:e=>e.createMessageKey&&e.createDeviceSentMessage?e.createMessageKey:null},{id:"Participants",conditions:e=>e.addParticipants&&e.removeParticipants&&e.promoteParticipants&&e.demoteParticipants?e:null},{id:"WidFactory",conditions:e=>e.isWidlike&&e.createWid&&e.createWidFromWidLike?e:null},{id:"Base",conditions:e=>e.setSubProtocol&&e.binSend&&e.actionNode?e:null},{id:"Base2",conditions:e=>e.supportsFeatureFlags&&e.parseMsgStubProto&&e.binSend&&e.subscribeLiveLocation?e:null},{id:"Versions",conditions:e=>e.loadProtoVersions&&e.default[15]&&e.default[16]&&e.default[17]?e:null},{id:"Sticker",conditions:e=>e.StickerCollection&&e.default?e:null},{id:"MediaObject",conditions:e=>e.getOrCreateMediaObject&&e.disassociateMediaFromStickerPack?e:null},{id:"MediaUpload",conditions:e=>e.default&&e.default.mediaUpload?e.default:null},{id:"UploadUtils",conditions:e=>e.default&&e.default.encryptAndUpload?e.default:null},{id:"Cmd",conditions:e=>e.default&&e.default.openChatFromUnread?e:null},{id:"ReadSeen",conditions:e=>e.sendSeen?e:null},{id:"Block",conditions:e=>e.blockContact&&e.unblockContact?e:null},{id:"BlockList",conditions:e=>e.BlocklistCollection?e:null},{id:"Theme",conditions:e=>e.getTheme&&e.setTheme?e:null},{id:"Vcard",conditions:e=>e.vcardFromContactModel?e:null},{id:"Profile",conditions:e=>e.sendSetPicture&&e.requestDeletePicture?e:null},{id:"SendMute",conditions:e=>e.sendConversationMute?e:null},{id:"Validators",conditions:e=>e.findLinks?e:null},{id:"Wap2",conditions:e=>e.Wap?e:null},{id:"genId",conditions:e=>e.default&&"function"==typeof e.default&&"function"==typeof e.default.toString&&e.default.toString().match(/crypto/)?e:null},{id:"GroupMetadata",conditions:e=>e.default&&e.default.handlePendingInvite?e:null},{id:"i10n",conditions:e=>e.default&&e.default.downloadAppLocale?e.default:null},{id:"NetworkStatus",conditions:e=>e.default&&e.default._logOnlineOffline?e.default:null},{id:"Stream",conditions:e=>e.default&&e.default.unobscure?e.default:null},{id:"ws2",conditions:e=>e.default&&e.default.destroyStorage?e.default:null},{id:"BlobCache",conditions:e=>e.default&&e.default.getOrCreateURL?e.default:null},{id:"UserPrefs",conditions:e=>e.getMaybeMeUser?e:null},{id:"randomMessageId",conditions:e=>e.randomId&&e.default?e.default:null},{id:"randomId",conditions:e=>e.randomId&&e.default?e.randomId:null},{id:"sendSetGroupSubject",conditions:e=>e.sendSetGroupSubject},{id:"sendSetGroupProperty",conditions:e=>e.sendSetGroupProperty},{id:"sendSetGroupDescription",conditions:e=>e.sendSetGroupDescription},{id:"changeEphemeralDuration",conditions:e=>e.changeEphemeralDuration},{id:"sendCallSignalingMsg",conditions:e=>e.sendCallSignalingMsg},{id:"checkNumberInfo",conditions:e=>e.default.toString().includes("Should not reach queryExists MD")?e.default:null},{id:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"msgFindQuery",conditions:e=>e.msgFindQuery&&e.msgFindByIds?e.msgFindQuery:null}]);try{var Wo=function(){var e=Io.value;window.Store.promises[e.id]=bo.waitForModule((t=>!!e.conditions(t))).then(e.conditions).then((t=>{"Store"===e.id?window.Store=Object.assign({},window.Store,t):window.Store[e.id]=t}))};for(So.s();!(Io=So.n()).done;)Wo()}catch(e){So.e(e)}finally{So.f()}window.Store.sendMessage=function(e){return window.Store.SendTextMsgToChat(this,...arguments)},window.Store.sendAddMessage=function(e){return window.Store.addAndSendMsgToChat(this,...arguments)}}void 0===window.WAPI&&(window.WAPI={lastRead:{}},window.WAPI.interfaceMute=function(e){return{attributes:e.attributes,expiration:e.expiration,id:e.id,isMuted:e.isMuted,isState:e.isState,promises:e.promises,stale:e.stale}},window.WAPI.setProfilePic=function(e,t){return tr.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return ur.apply(this,arguments)},window.WAPI.scope=Kn,window.WAPI.getchatId=function(e){return Yn.apply(this,arguments)},window.WAPI.sendExist=function(e){return Qn.apply(this,arguments)},window.WAPI.pinChat=function(e){return or.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return $r.apply(this,arguments)},window.WAPI.setTheme=function(e){return Tn.apply(this,arguments)},window.WAPI.getTheme=function(){return Un.apply(this,arguments)},window.WAPI._serializeRawObj=e=>e&&e.toJSON?e.toJSON():{},window.WAPI._serializeChatObj=e=>null==e?null:Object.assign(window.WAPI._serializeRawObj(e),{kind:e.kind,isBroadcast:e.isBroadcast,isGroup:e.isGroup,isUser:e.isUser,contact:e.contact?window.WAPI._serializeContactObj(e.contact):null,groupMetadata:e.groupMetadata?window.WAPI._serializeRawObj(e.groupMetadata):null,presence:e.presence?window.WAPI._serializeRawObj(e.presence):null,msgs:null}),window.WAPI._serializeContactObj=e=>{if(null==e)return null;var t=null;if(!e.profilePicThumb&&e.id&&window.Store.ProfilePicThumb){var n=window.Store.ProfilePicThumb.get(e.id);t=n?WAPI._serializeProfilePicThumb(n):{}}return Object.assign(window.WAPI._serializeRawObj(e),{formattedName:e.formattedName,isHighLevelVerified:e.isHighLevelVerified,isMe:e.isMe,isMyContact:e.isMyContact,isPSA:e.isPSA,isUser:e.isUser,isVerified:e.isVerified,isWAContact:e.isWAContact,profilePicThumbObj:t,statusMute:e.statusMute,msgs:null})},window.WAPI._serializeMessageObj=e=>null==e?null:(e.quotedMsg&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:e.quotedParticipant&&e.quotedParticipant._serialized?e.quotedParticipant._serialized:void 0,author:e.author&&e.author._serialized?e.author._serialized:void 0,chatId:e.id&&e.id.remote?e.id.remote:e.chatId&&e.chatId._serialized?e.chatId._serialized:void 0,to:e.to&&e.to._serialized?e.to._serialized:void 0,fromMe:e.id.fromMe,sender:e.senderObj?WAPI._serializeContactObj(e.senderObj):null,timestamp:e.t,content:e.body,isGroupMsg:e.isGroupMsg,isLink:e.isLink,isMMS:e.isMMS,isMedia:e.isMedia,isNotification:e.isNotification,isPSA:e.isPSA,type:e.type,quotedMsgId:e._quotedMsgObj?(e._quotedMsgObj.id,e._quotedMsgObj.id._serialized):void 0,mediaData:window.WAPI._serializeRawObj(e.mediaData)})),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI._serializeProfilePicThumb=e=>null==e?null:Object.assign({},{eurl:e.eurl,id:e.id,img:e.img,imgFull:e.imgFull,raw:e.raw,tag:e.tag}),window.WAPI._profilePicfunc=co,window.WAPI.createGroup=function(e,t){return d.apply(this,arguments)},window.WAPI.leaveGroup=function(e){return Me.apply(this,arguments)},window.WAPI.revokeGroupInviteLink=function(e){return ze.apply(this,arguments)},window.WAPI.getGroupInviteLink=function(e){return se.apply(this,arguments)},window.WAPI.getGroupInfoFromInviteLink=function(e){return le.apply(this,arguments)},window.WAPI.getGroupAdmins=function(e,t){return ie.apply(this,arguments)},window.WAPI.removeParticipant=function(e,t,n){return cn.apply(this,arguments)},window.WAPI.addParticipant=function(e,t){return fn.apply(this,arguments)},window.WAPI.promoteParticipant=function(e,t,n){return wn.apply(this,arguments)},window.WAPI.demoteParticipant=function(e,t,n){return gn.apply(this,arguments)},window.WAPI.joinGroup=function(e){return Wn.apply(this,arguments)},window.WAPI.setGroupDescription=function(e,t){return Gr.apply(this,arguments)},window.WAPI.setGroupProperty=function(e,t,n){return zr.apply(this,arguments)},window.WAPI.setGroupSubject=function(e,t){return Vr.apply(this,arguments)},window.WAPI.sendChatstate=function(e,t){return Ve.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,o,i){var a=WAPI.getChat(o);if(void 0===a)return void 0!==i&&i(!1),!1;var u={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:u,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==i&&i(!0),!0},window.WAPI.processMessageObj=function(e,t,n){return e.isNotification?n?WAPI._serializeMessageObj(e):void 0:!1===e.id.fromMe||t?WAPI._serializeMessageObj(e):void 0},window.WAPI.sendMessageWithTags=function(e,t){return It.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return ht.apply(this,arguments)},window.WAPI.sendMessage2=function(e,t,n){var r=WAPI.getChat(e);if(void 0!==r)try{return void 0!==n?r.sendMessage(t).then((function(){n(!0)})):r.sendMessage(t),!0}catch(e){return void 0!==n&&n(!1),!1}return void 0!==n&&n(!1),!1},window.WAPI.sendSeen=function(e,t){return Mt.apply(this,arguments)},window.WAPI.deleteConversation=function(e){return WPP.chat.delete(e),!0},window.WAPI.deleteMessages=function(e,t,n,r){return y.apply(this,arguments)},window.WAPI.clearChat=function(e,t){return u.apply(this,arguments)},window.WAPI.sendImage=function(e,t,n,r,o,i){return Qe(e,t,n,r,"sendImage",o,i)},window.WAPI.sendPtt=function(e,t,n,r,o){return Ze.apply(this,arguments)},window.WAPI.sendFile=Qe,window.WAPI.setMyName=function(e){return jt.apply(this,arguments)},window.WAPI.setMyStatus=function(e){return Store.MyStatus.setMyStatus(e)},window.WAPI.sendVideoAsGif=function(e,t,n,r,o){return Ot.apply(this,arguments)},window.WAPI.processFiles=Re,window.WAPI.sendImageWithProduct=function(e,t,n,r,o,i){Store.Catalog.findCarouselCatalog(r).then((r=>{if(r&&r[0]){var a=r[0].productCollection.get(o),u={productMsgOptions:{businessOwnerJid:a.catalogWid.toString({legacy:!0}),productId:a.id.toString(),url:a.url,productImageCount:a.productImageCollection.length,title:a.name,description:a.description,currencyCode:a.currency,priceAmount1000:a.priceAmount1000,type:"product"},caption:n},s=new Store.WidFactory.createWid(t);return WPP.chat.find(s).then((t=>{var n=A(e,a.name);Re(t,n).then((e=>{var n=e.models[0];Object.entries(u.productMsgOptions).map((e=>{var t,r,o=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1];return n.mediaPrep._mediaData[i]=a})),n.mediaPrep.sendToChat(t,u),void 0!==i&&i(!0)}))}))}}))},window.WAPI.sendContactVcard=function(e,t,n){return Gt.apply(this,arguments)},window.WAPI.sendContactVcardList=function(e,t){return $n.apply(this,arguments)},window.WAPI.forwardMessages=function(e,t,n){return Nt.apply(this,arguments)},window.WAPI.reply=function(e,t,n){return Vt.apply(this,arguments)},window.WAPI._sendSticker=nt,window.WAPI.encryptAndUploadFile=function(e,t){return k.apply(this,arguments)},window.WAPI.sendImageAsSticker=at,window.WAPI.sendImageAsStickerGif=at,window.WAPI.startTyping=function(e){return Qt.apply(this,arguments)},window.WAPI.stopTyping=function(e){return Jt.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return Qr.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return lt.apply(this,arguments)},window.WAPI.openChat=function(e){return An.apply(this,arguments)},window.WAPI.openChatAt=function(e,t){return bn.apply(this,arguments)},window.WAPI.markUnseenMessage=function(e){return _n.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Hn.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return Pt.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return to.apply(this,arguments)},window.WAPI.blockContact=function(e){return nn.apply(this,arguments)},window.WAPI.unblockContact=function(e){return an.apply(this,arguments)},window.WAPI.getBlockList=function(){return En.apply(this,arguments)},window.WAPI.getAllContacts=R,window.WAPI.getMyContacts=function(e){var t=window.Store.Contact.filter((e=>!0===e.isMyContact)).map((e=>WAPI._serializeContactObj(e)));return void 0!==e&&e(t),t},window.WAPI.getContact=function(e,t){var n=window.Store.Contact.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=window.Store.Chat.map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=z,window.WAPI.getAllChatsWithNewMsg=H,window.WAPI.getAllChatIds=function(e){var t=window.Store.Chat.map((e=>e.id._serialized||e.id));return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return H().map((e=>WAPI.getChat(e.id))).flatMap((e=>e.msgs.filter((e=>e.isNewMsg)))).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=V,window.WAPI.getAllChatsWithMessages=function(e){return L.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=window.Store.Chat.filter((e=>e.isGroup));return void 0!==e&&e(t),t},window.WAPI.getChat=function(e){if(!e)return!1;e="string"==typeof e?e:e._serialized;var t=Store.Chat.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return window.Store.sendMessage.apply(this,arguments)}),t},window.WAPI.getStatus=function(e){return Ie.apply(this,arguments)},window.WAPI.getChatByName=function(e,t){var n=window.Store.Chat.find((t=>t.name===e));return void 0!==t&&t(n),n},window.WAPI.getNewId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},window.WAPI.getChatById=function(e,t){return Q.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var o=WAPI.getChat(e).msgs._models,i=[],a=o.length-1;a>=0;a--)if("remove"!==a){var u=o[a];if("boolean"==typeof u.isNewMsg&&!1!==u.isNewMsg){u.isNewMsg=!1;var s=WAPI.processMessageObj(u,t,n);s&&i.push(s)}}return void 0!==r&&r(i),i},window.WAPI.loadEarlierMessages=function(e){return Le.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=Oe,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){Oe(e),t()},window.WAPI.areAllMessagesLoaded=function(e,t){return WAPI.getChat(e).msgs.msgLoadState.noEarlierMsgs?(t&&t(!0),!0):(t&&t(!1),!1)},window.WAPI.loadEarlierMessagesTillDate=function(e,t,n){var r=WAPI.getChat(e);!function e(){r.msgs.models[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(e):n()}()},window.WAPI.getAllGroupMetadata=function(e){var t=window.Store.GroupMetadata.default.map((e=>e.attributes));return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return he.apply(this,arguments)},window.WAPI._getGroupParticipants=te,window.WAPI.getGroupParticipantIDs=function(e,t){return ye.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return B.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return ke.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var o=window.Store.Chat.models,i=[];for(var a in o)if(!isNaN(a)){var u=o[a],s=WAPI._serializeChatObj(u);s.messages=[];for(var c=u.msgs._models,d=c.length-1;d>=0;d--){var l=c[d];if("boolean"==typeof l.isNewMsg&&!1!==l.isNewMsg){l.isNewMsg=!1;var f=WAPI.processMessageObj(l,e,t);f&&s.messages.push(f)}}if(s.messages.length>0)i.push(s);else if(n){for(var p=u.unreadCount,h=c.length-1;h>=0;h--){var w=c[h];if(p>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);s.messages.unshift(v),p-=1}}else{if(-1!==p)break;if(!w.isSentByMe){var y=WAPI.processMessageObj(w,e,t);s.messages.unshift(y);break}}}s.messages.length>0&&(u.unreadCount=0,i.push(s))}}return void 0!==r&&r(i),i},window.WAPI.getCommonGroups=function(e,t){return $.apply(this,arguments)},window.WAPI.downloadFile=function(e){return P.apply(this,arguments)},window.WAPI.downloadMedia=vr,window.WAPI.getNumberProfile=function(e,t){return Pe.apply(this,arguments)},window.WAPI.getMessageById=p,window.WAPI.getMessages=function(e){return Zt.apply(this,arguments)},window.WAPI.getNewMessageId=function(e){return new Store.MsgKey({from:Store.UserPrefs.getMaybeMeUser(),to:new Store.WidFactory.createWid(e),id:Store.randomMessageId(),participant:void 0,selfDir:"out"})},window.WAPI.getFileHash=W,window.WAPI.generateMediaKey=C,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(e),i=o.byteLength,a=i%3,u=i-a,s=0;s<u;s+=3)n+=r[(16515072&(t=o[s]<<16|o[s+1]<<8|o[s+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=o[u]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=o[u]<<8|o[u+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return pr.apply(this,arguments)},window.WAPI.getHost=function(){return Store.Me.attributes},window.WAPI.getWid=function(){var e;return null===(e=Store.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=window.Store.Contact.get(window.Store.Conn.me);return void 0!==e&&e(t.all),t.all},window.WAPI.isConnected=function(e){var t=null==document.querySelector('[data-testid="alert-phone"]')&&null==document.querySelector('[data-testid="alert-computer"]');return void 0!==e&&e(t),t},window.WAPI.isLoggedIn=function(e){var t=window.Store.Contact&&void 0!==window.Store.Contact.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return Store.Me.attributes.battery},window.WAPI.base64ImageToFile=A,window.WAPI.base64ToFile=A,window.WAPI.restartService=function(){return Fn.apply(this,arguments)},window.WAPI.killServiceWorker=function(){return Dn.apply(this,arguments)},window.WAPI.sendMute=function(e,t,n){return dr.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;Sr(),Pr=setInterval(br,e)},window.WAPI.stopPhoneWatchdog=Sr,window.WAPI.subscribePresence=function(e){return Or.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return xr.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return po.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return vo.apply(this,arguments)},window.WAPI.rejectCall=function(e){return Nr.apply(this,arguments)},window.WAPI._newMessagesQueue=[],window.WAPI._newMessagesBuffer=null!=sessionStorage.getItem("saved_msgs")?JSON.parse(sessionStorage.getItem("saved_msgs")):[],window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesCallbacks=[],window.addEventListener("unload",window.WAPI._unloadInform,!1),window.addEventListener("beforeunload",window.WAPI._unloadInform,!1),window.addEventListener("pageunload",window.WAPI._unloadInform,!1),window.WAPI.sendMessageMentioned=function(){var e=Po((function*(e,t,n){Array.isArray(n)||(n=[n]);var r=WAPI.getChat(e),o=yield Store.Contact.serialize().filter((e=>n.includes(e.id.user)));r.sendMessage(t,{linkPreview:null,mentionedJidList:o.map((e=>e.id)),quotedMsg:null,quotedMsgAdminGroupJid:null})}));return function(t,n,r){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicSmallFromId=function(){var e=Po((function*(e){return yield window.Store.ProfilePicThumb.find(e).then(function(){var e=Po((function*(e){return void 0!==e.img&&(yield window.WAPI.downloadFileWithCredentials(e.img))}));return function(t){return e.apply(this,arguments)}}(),(function(e){return!1}))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicFromId=function(){var e=Po((function*(e){return yield window.Store.ProfilePicThumb.find(e).then(function(){var e=Po((function*(e){return void 0!==e.imgFull&&(yield window.WAPI.downloadFileWithCredentials(e.imgFull))}));return function(t){return e.apply(this,arguments)}}(),(function(e){return!1}))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.downloadFileWithCredentials=function(){var e=Po((function*(e){if(!axios||!e)return!1;var t=(yield axios.get(e,{responseType:"arraybuffer"})).data;return btoa(new Uint8Array(t).reduce(((e,t)=>e+String.fromCharCode(t)),""))}));return function(t){return e.apply(this,arguments)}}(),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI.checkNumberStatus=function(){var e=Po((function*(e){var t=Store.WidFactory.createWid(e),n=yield Store.checkNumberInfo(t);return n?{id:n.wid,isBusiness:n.biz,canReceiveMessage:!0,numberExists:!0,status:200}:{id:e,isBusiness:!1,canReceiveMessage:!1,numberExists:!1,status:404}}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getChatIsOnline=function(){var e=Po((function*(e){var t=Store.Chat.get(e);return!!t&&(yield t.presence.subscribe(),t.presence.attributes.isOnline)}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getLastSeen=function(){var e=Po((function*(e){var t=Store.Chat.get(e);return!!t&&(t.presence.hasData||(yield t.presence.subscribe(),yield new Promise((e=>setTimeout(e,100)))),t.presence.chatstate.t||!1)}));return function(t){return e.apply(this,arguments)}}(),window.WAPI.getWAVersion=function(){return window.Debug.VERSION},window.WAPI.archiveChat=function(){var e=Po((function*(e,t){var n=Store.Archive.setArchive(Store.Chat.get(e),t).then((e=>!0)).catch((e=>!1));return yield Promise.resolve(n)}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.takeOver=Po((function*(){return yield Store.State.default.takeover(),!0})),window.WAPI.onIncomingCall=function(e){return window.WAPI.waitForStore(["Call"],(()=>{window.Store.Call.on("add",e)})),!0},window.WAPI.onInterfaceChange=function(e){return window.WAPI.waitForStore("Stream",(()=>{var t=()=>({displayInfo:window.Store.Stream.displayInfo,mode:window.Store.Stream.mode,info:window.Store.Stream.info});e(t()),window.Store.Stream.on("change:info change:displayInfo change:mode",(()=>{e(t())}))})),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=Po((function*(e,t){return yield Store.WapQuery.setGroupProperty(e,"announcement",t),!0}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=Po((function*(){return yield WPP.auth.logout()})),window.WAPI.storePromises={},window.WAPI.waitForStore=function(){var e=Po((function*(e,t){Array.isArray(e)||(e=[e]);var n=e.filter((e=>void 0===window.Store[e])).map((e=>(window.WAPI.storePromises[e]||(window.WAPI.storePromises[e]=new Promise((t=>{(window.Store.promises[e]||window.Store.promises.Store).then((()=>{t(!0)}))}))),window.WAPI.storePromises[e]))),r=Promise.all(n);return"function"==typeof t&&r.then(t),yield r}));return function(t,n){return e.apply(this,arguments)}}(),yo=!1,go=()=>window.Store.State.default.stream,window.WAPI.onStreamChange=function(e){return window.WAPI.waitForStore("State",(()=>{window.Store.State.default.on("change:stream",(()=>e(go()))),yo||(yo=!0,e(go()))})),!0},function(){var e=!1,t=()=>window.Store.State.default.state;window.WAPI.onStateChange=function(n){return window.WAPI.waitForStore("State",(()=>{window.Store.State.default.on("change:state",(()=>n(t()))),e||(e=!0,n(t()))})),!0}}(),window.WAPI.waitForStore(["Chat","Msg"],(()=>{window.WAPI._newMessagesListener=window.Store.Msg.on("add",(e=>{if(e&&e.isNewMsg&&!e.isSentByMe){var t=window.WAPI.processMessageObj(e,!1,!1);t&&(window.WAPI._newMessagesQueue.push(t),window.WAPI._newMessagesBuffer.push(t)),!window.WAPI._newMessagesDebouncer&&window.WAPI._newMessagesQueue.length>0&&(window.WAPI._newMessagesDebouncer=setTimeout((()=>{var e=window.WAPI._newMessagesQueue;window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesQueue=[];var t=[];window.WAPI._newMessagesCallbacks.forEach((function(n){void 0!==n.callback&&n.callback(e),!0===n.rmAfterUse&&t.push(n)})),t.forEach((function(e){var t=window.WAPI._newMessagesCallbacks.indexOf(e);window.WAPI._newMessagesCallbacks.splice(t,1)}))}),1e3))}}))})),window.WAPI._unloadInform=e=>{window.WAPI._newMessagesBuffer.forEach((e=>{Object.keys(e).forEach((t=>void 0===e[t]?delete e[t]:""))})),sessionStorage.setItem("saved_msgs",JSON.stringify(window.WAPI._newMessagesBuffer)),window.WAPI._newMessagesCallbacks.forEach((function(e){void 0!==e.callback&&e.callback({status:-1,message:"page will be reloaded, wait and register callback again."})}))},window.WAPI.waitNewMessages=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return window.WAPI._newMessagesCallbacks.push({callback:t,rmAfterUse:e}),!0},window.WAPI.allNewMessagesListener=e=>window.WAPI.waitForStore(["Chat","Msg"],(()=>{window.Store.Msg.on("add",(t=>{if(t&&t.isNewMsg){var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)}}))})),window.WAPI.waitNewAcknowledgements=function(e){return window.WAPI.waitForStore(["Chat","Msg"],(()=>{Store.Msg.on("change:ack",e)})),!0},window.WAPI.onAddedToGroup=function(e){return window.WAPI.waitForStore("Msg",(()=>{window.Store.Msg.on("add",(t=>{if(t.isNewMsg&&t.isNotification&&"gp2"===t.type&&"add"===t.subtype)try{var n=WAPI._serializeChatObj(t.chat);e(n)}catch(e){console.error(e)}}))})),!0},function(){var e=[];function t(t){var n=Object.assign({},t);n.jid&&(n.id=n.jid.toString()),delete n.jid,delete n.body,delete n.isLive,delete n.sequence;var r,o=oo(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i(n)}catch(e){}}}catch(e){o.e(e)}finally{o.f()}}window.WAPI.waitForStore(["LiveLocation"],ro((function*(){var e=Store.LiveLocation.handle;Store.LiveLocation.handle=function(n){e.apply(this,arguments);var r,o=oo(n);try{for(o.s();!(r=o.n()).done;)t(r.value)}catch(e){o.e(e)}finally{o.f()}},Store.LiveLocation.on("add",(()=>{setTimeout((()=>{Store.LiveLocation.forEach((e=>{e.startViewingMap(),setTimeout((()=>{try{e._startKeepAlive()}catch(e){}}),1e3)}))}),100)})),Store.Chat.map((e=>Store.LiveLocation.find(e.id)))}))),WAPI.waitNewMessages(!1,(e=>{var n,r=oo(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.isLive&&t({type:"enable",isLive:o.isLive,id:o.sender.id,lat:o.lat,lng:o.lng,accuracy:o.accuracy,speed:o.speed,degrees:o.degrees,sequence:o.sequence,shareDuration:o.shareDuration})}}catch(e){r.e(e)}finally{r.f()}})),window.WAPI.onLiveLocation=function(){var t=ro((function*(t){e.push(t)}));return function(e){return t.apply(this,arguments)}}()}(),window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){return yield window.WAPI.waitForStore(["Chat","Msg"],(()=>{var n=["invite","add","remove","leave","promote","demote"],r=window.Store.Chat.get(e),o=window.Store.GroupMetadata.default.get(e);uo[e]||(uo[e]={},o.participants.forEach((t=>{uo[e][t.id.toString()]={subtype:"add",from:o.owner}})));var i=0;return r.on("change:groupMetadata.participants",(o=>r.on("all",((o,a)=>{var u=a.isGroup,s=a.previewMessage;if(u&&"change"===o&&s&&"gp2"===s.type&&n.includes(s.subtype)){var c=s.subtype,d=s.from,l=s.recipients,f=l[0].toString();uo[e][f]&&uo[e][l[0]].subtype==c||(0==i?i++:(uo[e][f]={subtype:c,from:d},t({by:d.toString(),action:c,who:l}),r.off("all",this),i=0))}})))),!0}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ao(i,r,o,a,u,"next",e)}function u(e){ao(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}(),window.WAPI.onNotificationMessage=function(e){return window.WAPI.waitForStore("Msg",(()=>{window.Store.Msg.on("add",(t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}}))})),!0},window.WAPI.onPresenceChanged=function(e){return window.WAPI.waitForStore("Presence",(()=>{window.Store.Presence.on("change:chatstate.type",(t=>{try{var n=window.Store.Presence.models.find((e=>e.chatstate===t));if(!n||!n.hasData||!n.chatstate.type)return;var r=window.Store.Contact.get(n.id),o={id:n.id,isOnline:n.isOnline,isGroup:n.isGroup,isUser:n.isUser,shortName:r?r.formattedShortName:"",state:n.chatstate.type,t:Date.now()};n.isUser&&(o.isContact=!n.chatstate.deny),n.isGroup&&(o.participants=n.chatstates.models.filter((e=>!!e.type)).map((e=>{var t=window.Store.Contact.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}}))),e(o)}catch(e){console.log(e)}}))})),!0})},602:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=W(a,n);if(u){if(u===w)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=d(e,t,n);if("normal"===s.type){if(r=n.done?h:f,s.arg===w)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",f="suspendedYield",p="executing",h="completed",w={};function v(){}function y(){}function g(){}var m={};s(m,i,(function(){return this}));var P=Object.getPrototypeOf,A=P&&P(P(O([])));A&&A!==n&&r.call(A,i)&&(m=A);var b=g.prototype=v.prototype=Object.create(m);function I(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,a,u){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function W(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,W(e,n),"throw"===n.method))return w;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var o=d(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,w;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function O(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:x}}function x(){return{value:t,done:!0}}return y.prototype=g,s(b,"constructor",g),s(g,"constructor",y),y.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},I(S.prototype),s(S.prototype,a,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},I(b),s(b,u,"Generator"),s(b,i,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,w):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(602),n(731)})();