@wppconnect-team/wppconnect 1.12.3 → 1.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 1.12.6 (2022-02-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fixed getGroupMembersIds and getGroupMembers for large chats (fix [#892](https://github.com/wppconnect-team/wppconnect/issues/892)) ([9cc34a5](https://github.com/wppconnect-team/wppconnect/commit/9cc34a5fddef52b01feba6194fff31aa19b388f0))
7
+
8
+
9
+
10
+ ## 1.12.5 (2022-02-06)
11
+
12
+
13
+
14
+ ## 1.12.4 (2022-01-22)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * Fixed getMessageById where the message is from status (fix [#823](https://github.com/wppconnect-team/wppconnect/issues/823)) ([ed57b97](https://github.com/wppconnect-team/wppconnect/commit/ed57b9700efd72f3de7c0c8d658d24b41f4da5d9))
20
+
21
+
22
+
1
23
  ## 1.12.3 (2022-01-21)
2
24
 
3
25
 
@@ -11,7 +11,7 @@ export declare class GroupLayer extends RetrieverLayer {
11
11
  * @category Group
12
12
  * @param groupId group id
13
13
  */
14
- leaveGroup(groupId: string): Promise<any>;
14
+ leaveGroup(groupId: string): Promise<void>;
15
15
  /**
16
16
  * Retrieves group members as [Id] objects
17
17
  * @category Group
@@ -44,7 +44,37 @@ export declare class GroupLayer extends RetrieverLayer {
44
44
  * @param inviteCode
45
45
  * @returns Invite code from group link. Example: CMJYfPFqRyE2GxrnkldYED
46
46
  */
47
- getGroupInfoFromInviteLink(inviteCode: string): Promise<string | boolean>;
47
+ getGroupInfoFromInviteLink(inviteCode: string): Promise<{
48
+ descOwner: string;
49
+ id: string;
50
+ owner: string;
51
+ participants: {
52
+ id: string;
53
+ isAdmin: boolean;
54
+ isSuperAdmin: boolean;
55
+ }[];
56
+ subjectOwner: string;
57
+ announce: boolean;
58
+ creation: number;
59
+ desc: string;
60
+ descId: string;
61
+ descTime: number;
62
+ /**
63
+ * Removes the host device from the group
64
+ * @category Group
65
+ * @param groupId group id
66
+ */
67
+ noFrequentlyForwarded: boolean;
68
+ parent: boolean;
69
+ pvId?: string;
70
+ restrict: boolean;
71
+ size: number;
72
+ status: number;
73
+ subject: string;
74
+ subjectTime: number;
75
+ support: boolean;
76
+ suspended: boolean;
77
+ }>;
48
78
  /**
49
79
  * Creates a new chat group
50
80
  * @category Group
@@ -93,13 +123,15 @@ export declare class GroupLayer extends RetrieverLayer {
93
123
  * @category Group
94
124
  * @param chatId Group/Chat id ('0000000000-00000000@g.us')
95
125
  */
96
- getGroupAdmins(chatId: string): Promise<import("../model").Contact[]>;
126
+ getGroupAdmins(chatId: string): Promise<import("@wppconnect/wa-js/dist/whatsapp").Wid[]>;
97
127
  /**
98
128
  * Join a group with invite code
99
129
  * @category Group
100
130
  * @param inviteCode
101
131
  */
102
- joinGroup(inviteCode: string): Promise<string | boolean>;
132
+ joinGroup(inviteCode: string): Promise<{
133
+ id: string;
134
+ }>;
103
135
  /**
104
136
  * Set group description (if allowed)
105
137
  * @category Group
@@ -107,7 +139,7 @@ export declare class GroupLayer extends RetrieverLayer {
107
139
  * @param description New group description
108
140
  * @returns empty object
109
141
  */
110
- setGroupDescription(groupId: string, description: string): Promise<object>;
142
+ setGroupDescription(groupId: string, description: string): Promise<boolean>;
111
143
  /**
112
144
  * Set group subject (if allowed)
113
145
  * @category Group
@@ -115,7 +147,7 @@ export declare class GroupLayer extends RetrieverLayer {
115
147
  * @param title New group subject
116
148
  * @returns empty object
117
149
  */
118
- setGroupSubject(groupId: string, title: string): Promise<object>;
150
+ setGroupSubject(groupId: string, title: string): Promise<boolean>;
119
151
  /**
120
152
  * Enable or disable group properties, see {@link GroupProperty for details}
121
153
  * @category Group
@@ -124,5 +156,5 @@ export declare class GroupLayer extends RetrieverLayer {
124
156
  * @param value true or false
125
157
  * @returns empty object
126
158
  */
127
- setGroupProperty(groupId: string, property: GroupProperty, value: boolean): Promise<object>;
159
+ setGroupProperty(groupId: string, property: GroupProperty, value: boolean): Promise<boolean>;
128
160
  }
@@ -85,7 +85,7 @@ var GroupLayer = /** @class */ (function (_super) {
85
85
  GroupLayer.prototype.leaveGroup = function (groupId) {
86
86
  return __awaiter(this, void 0, void 0, function () {
87
87
  return __generator(this, function (_a) {
88
- return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (groupId) { return WAPI.leaveGroup(groupId); }, groupId)];
88
+ return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (groupId) { return WPP.group.leave(groupId); }, groupId)];
89
89
  });
90
90
  });
91
91
  };
@@ -97,7 +97,9 @@ var GroupLayer = /** @class */ (function (_super) {
97
97
  GroupLayer.prototype.getGroupMembersIds = function (groupId) {
98
98
  return __awaiter(this, void 0, void 0, function () {
99
99
  return __generator(this, function (_a) {
100
- return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (groupId) { return WAPI.getGroupParticipantIDs(groupId); }, groupId)];
100
+ return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (groupId) {
101
+ return Promise.resolve(WPP.group.getParticipants(groupId)).then(function (participants) { return participants.map(function (p) { return p.id; }); });
102
+ }, groupId)];
101
103
  });
102
104
  });
103
105
  };
@@ -131,10 +133,13 @@ var GroupLayer = /** @class */ (function (_super) {
131
133
  */
132
134
  GroupLayer.prototype.getGroupInviteLink = function (chatId) {
133
135
  return __awaiter(this, void 0, void 0, function () {
136
+ var code;
134
137
  return __generator(this, function (_a) {
135
138
  switch (_a.label) {
136
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WAPI.getGroupInviteLink(chatId); }, chatId)];
137
- case 1: return [2 /*return*/, _a.sent()];
139
+ case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.group.getInviteCode(chatId); }, chatId)];
140
+ case 1:
141
+ code = _a.sent();
142
+ return [2 /*return*/, "https://chat.whatsapp.com/".concat(code)];
138
143
  }
139
144
  });
140
145
  });
@@ -147,10 +152,13 @@ var GroupLayer = /** @class */ (function (_super) {
147
152
  */
148
153
  GroupLayer.prototype.revokeGroupInviteLink = function (chatId) {
149
154
  return __awaiter(this, void 0, void 0, function () {
155
+ var code;
150
156
  return __generator(this, function (_a) {
151
157
  switch (_a.label) {
152
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WAPI.revokeGroupInviteLink(chatId); }, chatId)];
153
- case 1: return [2 /*return*/, _a.sent()];
158
+ case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.group.revokeInviteCode(chatId); }, chatId)];
159
+ case 1:
160
+ code = _a.sent();
161
+ return [2 /*return*/, "https://chat.whatsapp.com/".concat(code)];
154
162
  }
155
163
  });
156
164
  });
@@ -170,7 +178,7 @@ var GroupLayer = /** @class */ (function (_super) {
170
178
  inviteCode = inviteCode.replace('invite/', '');
171
179
  inviteCode = inviteCode.replace('https://', '');
172
180
  inviteCode = inviteCode.replace('http://', '');
173
- return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (inviteCode) { return WAPI.getGroupInfoFromInviteLink(inviteCode); }, inviteCode)];
181
+ return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (inviteCode) { return WPP.group.getGroupInfoFromInviteCode(inviteCode); }, inviteCode)];
174
182
  case 1: return [2 /*return*/, _a.sent()];
175
183
  }
176
184
  });
@@ -284,10 +292,15 @@ var GroupLayer = /** @class */ (function (_super) {
284
292
  */
285
293
  GroupLayer.prototype.getGroupAdmins = function (chatId) {
286
294
  return __awaiter(this, void 0, void 0, function () {
295
+ var participants;
287
296
  return __generator(this, function (_a) {
288
297
  switch (_a.label) {
289
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WAPI.getGroupAdmins(chatId); }, chatId)];
290
- case 1: return [2 /*return*/, _a.sent()];
298
+ case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) {
299
+ return Promise.resolve(WPP.group.getParticipants(chatId)).then(function (participants) { return participants.map(function (p) { return p.toJSON(); }); });
300
+ }, chatId)];
301
+ case 1:
302
+ participants = _a.sent();
303
+ return [2 /*return*/, participants.filter(function (p) { return p.isAdmin; }).map(function (p) { return p.id; })];
291
304
  }
292
305
  });
293
306
  });
@@ -306,7 +319,7 @@ var GroupLayer = /** @class */ (function (_super) {
306
319
  inviteCode = inviteCode.replace('invite/', '');
307
320
  inviteCode = inviteCode.replace('https://', '');
308
321
  inviteCode = inviteCode.replace('http://', '');
309
- return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (inviteCode) { return WAPI.joinGroup(inviteCode); }, inviteCode)];
322
+ return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (inviteCode) { return WPP.group.join(inviteCode); }, inviteCode)];
310
323
  case 1: return [2 /*return*/, _a.sent()];
311
324
  }
312
325
  });
@@ -325,7 +338,7 @@ var GroupLayer = /** @class */ (function (_super) {
325
338
  switch (_a.label) {
326
339
  case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
327
340
  var groupId = _a.groupId, description = _a.description;
328
- return WAPI.setGroupDescription(groupId, description);
341
+ return WPP.group.setDescription(groupId, description);
329
342
  }, { groupId: groupId, description: description })];
330
343
  case 1: return [2 /*return*/, _a.sent()];
331
344
  }
@@ -345,7 +358,7 @@ var GroupLayer = /** @class */ (function (_super) {
345
358
  switch (_a.label) {
346
359
  case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
347
360
  var groupId = _a.groupId, title = _a.title;
348
- return WAPI.setGroupSubject(groupId, title);
361
+ return WPP.group.setSubject(groupId, title);
349
362
  }, { groupId: groupId, title: title })];
350
363
  case 1: return [2 /*return*/, _a.sent()];
351
364
  }
@@ -366,7 +379,7 @@ var GroupLayer = /** @class */ (function (_super) {
366
379
  switch (_a.label) {
367
380
  case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
368
381
  var groupId = _a.groupId, property = _a.property, value = _a.value;
369
- return WAPI.setGroupProperty(groupId, property, value);
382
+ return WPP.group.setProperty(groupId, property, value);
370
383
  }, { groupId: groupId, property: property, value: value })];
371
384
  case 1: return [2 /*return*/, _a.sent()];
372
385
  }
@@ -27,16 +27,6 @@ export declare class HostLayer {
27
27
  waitForInChat(): Promise<true>;
28
28
  waitForPageLoad(): Promise<void>;
29
29
  waitForLogin(catchQR?: CatchQRCallback, statusFind?: StatusFindCallback): Promise<boolean>;
30
- /**
31
- * Delete the Service Workers
32
- * @category Host
33
- */
34
- killServiceWorker(): Promise<boolean>;
35
- /**
36
- * Load the service again
37
- * @category Host
38
- */
39
- restartService(): Promise<boolean>;
40
30
  /**
41
31
  * @category Host
42
32
  * @returns Current host device details
@@ -430,34 +430,6 @@ var HostLayer = /** @class */ (function () {
430
430
  });
431
431
  });
432
432
  };
433
- /**
434
- * Delete the Service Workers
435
- * @category Host
436
- */
437
- HostLayer.prototype.killServiceWorker = function () {
438
- return __awaiter(this, void 0, void 0, function () {
439
- return __generator(this, function (_a) {
440
- switch (_a.label) {
441
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WAPI.killServiceWorker(); })];
442
- case 1: return [2 /*return*/, _a.sent()];
443
- }
444
- });
445
- });
446
- };
447
- /**
448
- * Load the service again
449
- * @category Host
450
- */
451
- HostLayer.prototype.restartService = function () {
452
- return __awaiter(this, void 0, void 0, function () {
453
- return __generator(this, function (_a) {
454
- switch (_a.label) {
455
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WAPI.restartService(); })];
456
- case 1: return [2 /*return*/, _a.sent()];
457
- }
458
- });
459
- });
460
- };
461
433
  /**
462
434
  * @category Host
463
435
  * @returns Current host device details
@@ -1,7 +1,7 @@
1
1
  import { Page } from 'puppeteer';
2
2
  import { CreateConfig } from '../../config/create-config';
3
3
  import { SessionToken } from '../../token-store';
4
- import { Chat, ProfilePicThumbObj, WhatsappProfile } from '../model';
4
+ import { Chat, ContactStatus, ProfilePicThumbObj, WhatsappProfile } from '../model';
5
5
  import { SenderLayer } from './sender.layer';
6
6
  export declare class RetrieverLayer extends SenderLayer {
7
7
  page: Page;
@@ -112,7 +112,7 @@ export declare class RetrieverLayer extends SenderLayer {
112
112
  * @category Contact
113
113
  * @param contactId
114
114
  */
115
- getStatus(contactId: string): Promise<import("@wppconnect/wa-js/dist/whatsapp").StatusModel>;
115
+ getStatus(contactId: string): Promise<ContactStatus>;
116
116
  /**
117
117
  * Checks if a number is a valid whatsapp number
118
118
  *
@@ -363,8 +363,25 @@ var RetrieverLayer = /** @class */ (function (_super) {
363
363
  */
364
364
  RetrieverLayer.prototype.getStatus = function (contactId) {
365
365
  return __awaiter(this, void 0, void 0, function () {
366
+ var _this = this;
366
367
  return __generator(this, function (_a) {
367
- return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (contactId) { return WPP.contact.getStatus(contactId); }, contactId)];
368
+ switch (_a.label) {
369
+ case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (contactId) { return __awaiter(_this, void 0, void 0, function () {
370
+ var status;
371
+ return __generator(this, function (_a) {
372
+ switch (_a.label) {
373
+ case 0: return [4 /*yield*/, WPP.contact.getStatus(contactId)];
374
+ case 1:
375
+ status = _a.sent();
376
+ return [2 /*return*/, {
377
+ id: status.id.toString(),
378
+ status: status.status,
379
+ }];
380
+ }
381
+ });
382
+ }); }, contactId)];
383
+ case 1: return [2 /*return*/, _a.sent()];
384
+ }
368
385
  });
369
386
  });
370
387
  };
@@ -17,8 +17,5 @@ export declare class UILayer extends GroupLayer {
17
17
  * @param chatId Chat id
18
18
  * @param messageId Message id (For example: '06D3AB3D0EEB9D077A3F9A3EFF4DD030')
19
19
  */
20
- openChatAt(chatId: string, messageId: string): Promise<{
21
- wasVisible: boolean;
22
- alignAt: string;
23
- }>;
20
+ openChatAt(chatId: string, messageId: string): Promise<boolean>;
24
21
  }
@@ -86,7 +86,7 @@ var UILayer = /** @class */ (function (_super) {
86
86
  UILayer.prototype.openChat = function (chatId) {
87
87
  return __awaiter(this, void 0, void 0, function () {
88
88
  return __generator(this, function (_a) {
89
- return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WAPI.openChat(chatId); }, chatId)];
89
+ return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.chat.openChatBottom(chatId); }, chatId)];
90
90
  });
91
91
  });
92
92
  };
@@ -99,7 +99,7 @@ var UILayer = /** @class */ (function (_super) {
99
99
  UILayer.prototype.openChatAt = function (chatId, messageId) {
100
100
  return __awaiter(this, void 0, void 0, function () {
101
101
  return __generator(this, function (_a) {
102
- return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WAPI.openChatAt(chatId, messageId); }, chatId)];
102
+ return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.chat.openChatAt(chatId, messageId); }, chatId)];
103
103
  });
104
104
  });
105
105
  };
@@ -19,6 +19,6 @@ exports.defaultOptions = {
19
19
  waitForLogin: true,
20
20
  logger: logger_1.defaultLogger,
21
21
  tokenStore: 'file',
22
- whatsappVersion: '2.2144.x',
22
+ whatsappVersion: '2.2204.x',
23
23
  deviceName: false,
24
24
  };
@@ -239,6 +239,7 @@ function injectSessionToken(page, token, clear) {
239
239
  Object.keys(session).forEach(function (key) {
240
240
  localStorage.setItem(key, session[key]);
241
241
  });
242
+ localStorage.setItem('remember-me', 'true');
242
243
  }, token)];
243
244
  case 5:
244
245
  _a.sent();
@@ -216,7 +216,6 @@ function injectApi(page) {
216
216
  case 0: return [4 /*yield*/, page
217
217
  .evaluate(function () {
218
218
  // @ts-ignore
219
- localStorage.setItem('md-opted-in', 'false');
220
219
  return (typeof window.WAPI !== 'undefined' &&
221
220
  typeof window.Store !== 'undefined');
222
221
  })
@@ -1 +1 @@
1
- (()=>{var e={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,P,g=0,m=[],A=0,b=!1,W=[],I=[],S=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(P=n.numRounds||1)!==parseInt(P,10)||1>P)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)u=512,w=R,v=H,a=160,y=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return z(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=z(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=B,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,l=0,d=t>>>5;for(i=0;i<d&&t>=n;i+=c)r=B(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=B(e,r);32*s.length<o&&(e=r[l%5][l/5|0],s.push(e.b),!(32*s.length>=o));)s.push(e.a),0==64*(l+=1)%n&&B(null,r);return s}}i=h(t,r,C),o=F(e),this.setHMACKey=function(t,n,i){var s;if(!0===b)throw Error("HMAC key already set");if(!0===S)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,F(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)W[t]=909522486^n[t],I[t]=1549556828^n[t];o=w(W,o),g=u,b=!0},this.update=function(e){var t,n,r,a=0,s=u>>>5;for(e=(t=i(e,m,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);g+=a,m=n.slice(a>>>5),A=e%u,S=!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 l(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 d(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(m.slice(),A,g,y(o),a),i=1;i<P;i+=1)!0===M&&0!=a%32&&(h[h.length-1]&=16777215>>>24-a%32),h=v(h,a,0,F(e),a);return r(h)},this.getHMAC=function(t,n){var r,i,h,P;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 l(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 d(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(m.slice(),A,g,y(o),a),P=w(I,F(e)),r(P=v(i,a,u,P,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 l(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 d(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,l=e.length;if(0!=l%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<l;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*l+r}};break;case"TEXT":e=function(e,r,o){var i,a,u,s,c,l,d,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(l=(d=p+c)>>>2;r.length<=l;)r.push(0);r[l]|=a[s]<<8*(f+d%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),l=(d=p+c)>>>2;r.length<=l;)r.push(0);r[l]|=i<<8*(f+d%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,l,d,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,d=-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=(l=f+c)>>>2;t.length<=o;)t.push(0);t[o]|=(u>>>16-8*a&255)<<8*(d+l%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 P(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 g(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 m(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 W(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 S(e){var t=P(e,28),n=P(e,34);return e=P(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=P(e,14),n=P(e,18);return e=P(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=P(e,1),n=P(e,8);return e=g(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=P(e,19),n=P(e,61);return e=g(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 N(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 L(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 G(e,t){return new a(e.a^t.a,e.b^t.b)}function F(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 R(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 H(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=R(e.slice(o,o+16),r);return r}function z(e,t,n){var r,o,i,u,s,c,l,d,f,p,h,w,v,y,P,g,G,F,R,H,z,B,q,K=[];if("SHA-224"===n||"SHA-256"===n)p=64,w=1,B=Number,v=j,y=k,P=T,g=_,G=x,F=I,R=M,z=b,H=m,q=D;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");p=80,w=2,B=a,v=U,y=N,P=L,g=O,G=E,F=S,R=C,z=W,H=A,q=Y}for(n=t[0],r=t[1],o=t[2],i=t[3],u=t[4],s=t[5],c=t[6],l=t[7],h=0;h<p;h+=1)16>h?(f=h*w,d=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],K[h]=new B(d,f)):K[h]=y(G(K[h-2]),K[h-7],g(K[h-15]),K[h-16]),d=P(l,R(u),H(u,s,c),q[h],K[h]),f=v(F(n),z(n,r,o)),l=c,c=s,s=u,u=v(i,d),i=o,o=r,r=n,n=v(d,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(l,t[7]),t}function B(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]=G(t[(r>>>1)%5][(r>>>1)/5|0],new a(e[r+1],e[r]));for(n=0;24>n;n+=1){for(i=F("SHA3-"),r=0;5>r;r+=1){o=t[r][0];var c=t[r][1],l=t[r][2],d=t[r][3],f=t[r][4];u[r]=new a(o.a^c.a^l.a^d.a^f.a,o.b^c.b^l.b^d.b^f.b)}for(r=0;5>r;r+=1)s[r]=G(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]=G(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],q[r][o]);for(r=0;5>r;r+=1)for(o=0;5>o;o+=1)t[r][o]=G(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]=G(t[0][0],K[n])}return t}var D,Y,q,K;Y=[new a((D=[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(D[1],602891725),new a(D[2],3964484399),new a(D[3],2173295548),new a(D[4],4081628472),new a(D[5],3053834265),new a(D[6],2937671579),new a(D[7],3664609560),new a(D[8],2734883394),new a(D[9],1164996542),new a(D[10],1323610764),new a(D[11],3590304994),new a(D[12],4068182383),new a(D[13],991336113),new a(D[14],633803317),new a(D[15],3479774868),new a(D[16],2666613458),new a(D[17],944711139),new a(D[18],2341262773),new a(D[19],2007800933),new a(D[20],1495990901),new a(D[21],1856431235),new a(D[22],3175218132),new a(D[23],2198950837),new a(D[24],3999719339),new a(D[25],766784016),new a(D[26],2566594879),new a(D[27],3203337956),new a(D[28],1034457026),new a(D[29],2466948901),new a(D[30],3758326383),new a(D[31],168717936),new a(D[32],1188179964),new a(D[33],1546045734),new a(D[34],1522805485),new a(D[35],2643833823),new a(D[36],2343527390),new a(D[37],1014477480),new a(D[38],1206759142),new a(D[39],344077627),new a(D[40],1290863460),new a(D[41],3158454273),new a(D[42],3505952657),new a(D[43],106217008),new a(D[44],3606008344),new a(D[45],1432725776),new a(D[46],1467031594),new a(D[47],851169720),new a(D[48],3100823752),new a(D[49],1363258195),new a(D[50],3750685593),new a(D[51],3785050280),new a(D[52],3318307427),new a(D[53],3812723403),new a(D[54],2003034995),new a(D[55],3602036899),new a(D[56],1575990012),new a(D[57],1125592928),new a(D[58],2716904306),new a(D[59],442776044),new a(D[60],593698344),new a(D[61],3733110249),new a(D[62],2999351573),new a(D[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)],q=[[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)}()},202:(e,t,n)=>{"use strict";function r(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 o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function u(e){r(a,o,i,u,s,"next",e)}function s(e){r(a,o,i,u,s,"throw",e)}u(void 0)}))}}function i(){return(i=o((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 u=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 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 l(e){return d.apply(this,arguments)}function d(){return(d=c((function*(e){var t=yield e.arrayBuffer(),n=new u("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")}))).apply(this,arguments)}function f(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function p(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(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){v(i,r,o,a,u,"next",e)}function u(e){v(i,r,o,a,u,"throw",e)}a(void 0)}))}}function P(){return(P=y((function*(e,t){var n=yield l(t),r=f(32),o=(new AbortController).signal,i=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:o,mediaKey:r});return h(h({},i),{},{clientUrl:i.url,filehash:n,id:n,uploadhash:i.encFilehash,mediaBlob:t})}))).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 A(){return(A=m((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 b(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 W(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){b(i,r,o,a,u,"next",e)}function u(e){b(i,r,o,a,u,"throw",e)}a(void 0)}))}}var I=function(){var e=W((function*(){var e=yield Promise.all(WPP.whatsapp.ContactStore.map(function(){var e=W((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 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 M(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 C(){return(C=M((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 _=function(e){return e.unreadCount>0},O=function(e){var t=WPP.whatsapp.ChatStore.filter(_).map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t};function x(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 E=function(){var e,t=(e=function*(){var e=O().map((e=>WPP.chat.getMessages(e.id,{count:e.unreadCount})));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){x(i,r,o,a,u,"next",e)}function u(e){x(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.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 k(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 T(){return(T=k((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 U(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 N(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){U(i,r,o,a,u,"next",e)}function u(e){U(i,r,o,a,u,"throw",e)}a(void 0)}))}}function L(){return(L=N((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 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 F(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 R(e){return H.apply(this,arguments)}function H(){return(H=F((function*(e){return(yield WAPI.getGroupMetadata(e)).participants}))).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 B(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 D(){return(D=B((function*(e,t){var n=(yield R(e)).filter((e=>e.isAdmin)).map((e=>e.id));return void 0!==t&&t(n),n}))).apply(this,arguments)}function Y(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 q(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Y(i,r,o,a,u,"next",e)}function u(e){Y(i,r,o,a,u,"throw",e)}a(void 0)}))}}function K(){return(K=q((function*(e){var t=WPP.whatsapp.ChatStore.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 V(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){V(i,r,o,a,u,"next",e)}function u(e){V(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Q(){return(Q=J((function*(e){return e=(e=(e=(e=e.replace("chat.whatsapp.com/","")).replace("invite/","")).replace("https://","")).replace("http://",""),yield Store.sendQueryGroupInvite(e)}))).apply(this,arguments)}function X(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){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){X(i,r,o,a,u,"next",e)}function u(e){X(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Z(){return(Z=$((function*(e,t){var n=WPP.whatsapp.GroupMetadataStore.find(e);return void 0!==t&&t(n),n}))).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 te(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 ne(){return(ne=te((function*(e,t){var n=(yield R(e)).map((e=>e.id));return void 0!==t&&t(n),n}))).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 WPP.contact.queryExists(e);if(!n||void 0===n.wid)throw 404;var r=window.WAPI._serializeNumberStatusObj({jid:n.wid,status:200,isBusiness:n.biz});return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r}))).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){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 le(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 de(e,t){return fe.apply(this,arguments)}function fe(){return(fe=le((function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield WPP.whatsapp.MsgStore.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 pe(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 he(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pe(i,r,o,a,u,"next",e)}function u(e){pe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function we(){return(we=he((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],l=WAPI.processMessageObj(c,t,n);l&&a.push(l)}return void 0!==r&&r(a),a}))}))).apply(this,arguments)}function ve(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){ve(i,r,o,a,u,"next",e)}function u(e){ve(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Pe(){return(Pe=ye((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 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 Ae(e,t){return be.apply(this,arguments)}function be(){return(be=me((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 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 Ie(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 Se(){return(Se=Ie((function*(e){var t=WPP.whatsapp.ChatStore.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 Me(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 Ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Me(i,r,o,a,u,"next",e)}function u(e){Me(i,r,o,a,u,"throw",e)}a(void 0)}))}}function _e(){return(_e=Ce((function*(e,t){e=parseInt(e,10);var n=WPP.whatsapp.ChatStore.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 Oe(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 xe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Oe(i,r,o,a,u,"next",e)}function u(e){Oe(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ee(e,t){return je.apply(this,arguments)}function je(){return je=xe((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=WPP.whatsapp.MsgKey.fromString(e);if(!r)return!1;var o=yield WPP.chat.getMessageById(r.remote,r.toString());if(!o)return!1;var i=!1;if(n)try{i=WAPI.processMessageObj(o,!0,!0)}catch(e){}else i=o;if("function"!=typeof t)return i;t(i)})),je.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 Te(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 Ue(e,t,n,r,o){return Ne.apply(this,arguments)}function Ne(){return Ne=Te((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(o=o||"sendFile","string"!=typeof n&&null!=n||"string"!=typeof r&&null!=r){var s="incorrect parameter, insert an string.";return WAPI.scope(t,!0,null,s)}var c=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);c&&c.length&&(c=c[1]);var l=yield WAPI.sendExist(t);if(l.erro)return l;var d=null;if("string"==typeof i&&i){var f=yield Ee(i,null,!1);f&&f.canReply()&&(d=f)}var p=a(e,n),h=yield Ae(l,p),w=h.models[0],v=(yield w.sendToChat(l,{caption:r,quotedMsg:d,isViewOnce:u}))||"",y={type:o,filename:n,text:r,mimeType:c},P=yield WAPI.getchatId(l.id);if("success"===v||"OK"===v){var g=WAPI.scope(P,!1,v,null);return Object.assign(g,y),g}return g=WAPI.scope(P,!0,v,null),Object.assign(g,y),g})),Ne.apply(this,arguments)}function Le(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 Ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Le(i,r,o,a,u,"next",e)}function u(e){Le(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Fe(){return Fe=Ge((function*(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=yield WAPI.sendExist(t);if(u.erro)return u;var s=null;if("string"==typeof i&&i){var c=yield Ee(i,null,!1);c&&c.canReply()&&(s=c)}var l=a(e,n),d=yield Ae(u,l),f=d.models[0];f.mediaPrep._mediaData.type="ptt";var p=(yield f.sendToChat(u,{caption:r,quotedMsg:s}))||"";void 0!==o&&o(!0);var h={type:"ptt",filename:n,text:r},w=yield WAPI.getchatId(u.id);if("success"===p||"OK"===p){var v=WAPI.scope(w,!1,p,null);return Object.assign(v,h),v}return v=WAPI.scope(w,!0,p,null),Object.assign(v,h),v})),Fe.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 He(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 ze(e,t,n,r){return Be.apply(this,arguments)}function Be(){return(Be=He((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 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 Ye(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 qe(e,t,n,r){return Ke.apply(this,arguments)}function Ke(){return(Ke=Ye((function*(e,t,n,r){var o=a("data:image/webp;base64,"+e,"file.webp"),i=yield window.WAPI.encryptAndUploadFile("sticker",o);return yield ze(i,t,n,r)}))).apply(this,arguments)}function Ve(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 Je(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){Je(i,r,o,a,u,"next",e)}function u(e){Je(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Xe(){return Xe=Qe((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=WPP.chat.generateMessageID(o.id),u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:o.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},s=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(o,u)))[1]||"",c={latitude:t,longitude:n,title:r,type:"location"},l=yield WAPI.getchatId(o.id);return"success"==s||"OK"==s?(i=WAPI.scope(l,!1,s,null),Object.assign(i,c),i):(i=WAPI.scope(l,!0,s,null),Object.assign(i,c),i)})),Xe.apply(this,arguments)}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 Ze(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 et(){return(et=Ze((function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=WPP.chat.generateMessageID(n.id),o={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},i=(yield Promise.all(WPP.whatsapp.functions.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 tt(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 nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(n),!0).forEach((function(t){rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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(){return at=it((function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=WPP.chat.get(e)||(yield WPP.chat.find(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 Ee(n.quotedMessageId,null,!1);a&&a.canReply()&&(i=a.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map((e=>WPP.whatsapp.ContactStore.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=WPP.whatsapp.ContactStore.get(n.contactCard);s={body:WPP.whatsapp.VCard.vcardFromContactModel(c).vcard,type:"vcard",vcardFormattedName:c.formattedName},delete n.contactCard}else if(n.contactCardList){var l=n.contactCardList.map((e=>WPP.whatsapp.ContactStore.get(e))),d=l.map((e=>WPP.whatsapp.VCard.vcardFromContactModel(e)));s={type:"multi_vcard",vcardList:d,body:void 0},delete n.contactCardList}else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var f=yield WPP.whatsapp.VCard.parseVcard(t);f&&(s={type:"vcard",vcardFormattedName:yield WPP.whatsapp.VCard.vcardGetNameFromParsed(f)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var p=yield window.Store.Validators.findLink(t);if(p&&!WPP.auth.isMultiDevice()){var h=yield window.Store.Wap2.default.queryLinkPreview(p.url);h.preview=!0,h.subtype="url",n=nt(nt({},n),h)}}var w=WPP.chat.generateMessageID(r.id),v=WPP.whatsapp.UserPrefs.getMaybeMeUser(),y=nt(nt(nt(nt(nt({id:w,ack:0,body:t,from:v,to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),u),o),i),s);return yield WPP.whatsapp.functions.addAndSendMsgToChat(r,y),w._serialized})),at.apply(this,arguments)}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 st(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 ct(){return(ct=st((function*(e,t){var n=e.id?e:WPP.whatsapp.ChatStore.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=WPP.chat.generateMessageID(r),u=t.match(/@(\d*)/g).map((e=>new WPP.whatsapp.WidFactory.createUserWid(e.replace("@",""))))||void 0,s={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new WPP.whatsapp.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:u};return Object.assign(i,s),yield WPP.whatsapp.functions.addAndSendMsgToChat(n,i),a._serialized}))).apply(this,arguments)}function lt(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){lt(i,r,o,a,u,"next",e)}function u(e){lt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ft(){return(ft=dt((function*(e,t,n,r,o){var i=yield WAPI.sendExist(t);if(i.erro)return i;var u=a(e,n),s=(yield Ae(i,u)).models[0];s.mediaPrep._mediaData.isGif=!0,s.mediaPrep._mediaData.gifAttribution=1;var c=(yield s.sendToChat(i,{caption:r}))||"",l={filename:n,text:r},d=yield WAPI.getchatId(i.id);if("success"===c||"OK"===c){void 0!==o&&o(!1);var f=WAPI.scope(d,!1,c,null);return Object.assign(f,l),f}return void 0!==o&&o(!0),f=WAPI.scope(d,!0,c,null),Object.assign(f,l),f}))).apply(this,arguments)}function pt(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 ht(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pt(i,r,o,a,u,"next",e)}function u(e){pt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function wt(){return(wt=ht((function*(e){yield window.Store.Perfil.setPushname(e)}))).apply(this,arguments)}function vt(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 yt(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)?yt(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 yt(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 Pt(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 gt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pt(i,r,o,a,u,"next",e)}function u(e){Pt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function mt(){return mt=gt((function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=WPP.whatsapp.ChatStore.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var o,i=[],a=vt(t);try{for(a.s();!(o=a.n()).done;){var u=o.value,s="string"==typeof u?u:u.id,c=yield Ee(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 l=i.filter((e=>!n||!e.isSentByMe));return yield r.forwardMessages(l),yield new Promise((e=>setTimeout(e,100))),r.msgs.models.slice(-1*t.length).map((e=>e.id._serialized))})),mt.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 Wt(){return Wt=bt((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 WPP.whatsapp.MsgStore.modelClass(e))).map((e=>WAPI.processMessageObj(e,!0,!0)));return o})),Wt.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 St(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=St((function*(e){var t=WPP.whatsapp.ChatStore.get(e);return WPP.whatsapp.Cmd.openChatBottom(t)}))).apply(this,arguments)}function Ct(){return(Ct=St((function*(e,t){var n=WPP.whatsapp.ChatStore.get(e),r=n.msgs.models.find((e=>e.id.id===t)),o={collection:n.msgs,msg:r,isUnreadDivider:!1};return yield WPP.whatsapp.Cmd._openChat(n,o)}))).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 Ot(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 xt(){return(xt=Ot((function*(e){return yield Store.WapQuery.acceptGroupInvite(e)}))).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 jt(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 kt(){return(kt=jt((function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")}))).apply(this,arguments)}function Tt(){return(Tt=jt((function*(){return yield Store.Theme.getTheme()}))).apply(this,arguments)}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 Nt(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 Lt(){return(Lt=Nt((function*(){return yield Store.ServiceWorker.default.restart(),!0}))).apply(this,arguments)}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 Ft(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 Rt(){return(Rt=Ft((function*(){return yield Store.ServiceWorker.default.killServiceWorker(),!0}))).apply(this,arguments)}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 zt(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 Bt(){return(Bt=zt((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=WPP.auth.isMultiDevice()?void 0: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 Dt(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){Dt(i,r,o,a,u,"next",e)}function u(e){Dt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function qt(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o={me:WPP.whatsapp.Conn.attributes,to:e,erro:t,text:r,status:n};return o}function Kt(){return(Kt=Yt((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 Vt(){return Vt=Yt((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 qt(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new WPP.whatsapp.ChatStore.modelClass({id:WPP.whatsapp.WidFactory.createWid("status@broadcast")}),WPP.whatsapp.ChatStore.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var o=yield window.WAPI.checkNumberStatus(e);if(!o.numberExists)return qt(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 WPP.chat.markIsRead(r.id).catch((()=>null))),t?r:qt(e,!1,200)):qt(e,!0,404)})),Vt.apply(this,arguments)}function Jt(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){Jt(i,r,o,a,u,"next",e)}function u(e){Jt(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Xt(){return(Xt=Qt((function*(e,t){t||(t=WPP.whatsapp.UserPrefs.getMaybeMeUser());var n=WPP.whatsapp.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield WPP.whatsapp.sendSetPicture(n,r+e.b,r+e.a)}))).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 Zt(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 en(){return en=Zt((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})),en.apply(this,arguments)}function tn(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){tn(i,r,o,a,u,"next",e)}function u(e){tn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function rn(){return(rn=nn((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 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 an(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 un(){return(un=an((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),l={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 d=WAPI.scope(s,!1,a.status,null);return Object.assign(d,l),d}return o=u?"is not mute to remove":"This chat is already mute",d=WAPI.scope(s,!0,a.status,o),Object.assign(d,l),d}))).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 cn(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 ln(){return ln=cn((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})),ln.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 fn(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)}))}}var pn=null,hn=!0;function wn(){return vn.apply(this,arguments)}function vn(){return(vn=fn((function*(){if("MAIN"===window.Store.Stream.mode&&"TIMEOUT"!==WPP.whatsapp.State.state)return hn?(hn=!1,WPP.whatsapp.State.sendBasic({tag:WPP.whatsapp.State.tag("ping"),data:["admin","test"]}).then((()=>{hn=!0}))):(WPP.whatsapp.State.phoneWatchdog.activate(),void WPP.whatsapp.State.phoneWatchdog.poke(250))}))).apply(this,arguments)}function yn(){pn&&clearInterval(pn),pn=null}function Pn(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 gn(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)?gn(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 gn(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 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 An(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 bn(){return bn=An((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Pn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new WPP.whatsapp.WidFactory.createWid(o);Store.Presence.get(i)||(yield Store.Presence.find(i),n++)}}catch(e){r.e(e)}finally{r.f()}return n})),bn.apply(this,arguments)}function Wn(){return(Wn=An((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Pn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=new WPP.whatsapp.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 In(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 Sn(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)?Sn(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 Sn(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 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(e){return On.apply(this,arguments)}function On(){return(On=Cn((function*(e){var t=WPP.whatsapp.CallStore.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 xn(){return xn=Cn((function*(e){if(e)return yield _n(e),1;var t,n=WPP.whatsapp.CallStore.models.filter((e=>"INCOMING_RING"===e.getState())),r=In(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;yield _n(o.id).catch((e=>null))}}catch(e){r.e(e)}finally{r.f()}return n.lenth})),xn.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 jn(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 kn(){return(kn=jn((function*(e,t){var n=WPP.whatsapp.ChatStore.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=WPP.whatsapp.functions.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 Tn(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 Un(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Tn(i,r,o,a,u,"next",e)}function u(e){Tn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Nn(){return(Nn=Un((function*(e,t,n){var r=WPP.whatsapp.ChatStore.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 n="ephemeral"===t?n?604800:0:n?1: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 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 Gn(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=Gn((function*(e,t){var n=WPP.whatsapp.ChatStore.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 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 Hn(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 zn(){return(zn=Hn((function*(e){void 0===e&&(e=!0),e?yield WPP.whatsapp.ChatPresence.sendPresenceAvailable():yield WPP.whatsapp.ChatPresence.sendPresenceUnavailable()}))).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 Dn(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 Yn(){return(Yn=Dn((function*(e,t){var n=WPP.whatsapp.ChatStore.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 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 Kn(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 Vn(){return Vn=Kn((function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=Kn((function*(e){return yield Ee(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=WPP.whatsapp.ChatStore.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})),Vn.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 Qn(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 Xn(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 $n={};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)}var er=function(){var e,t=(e=function*(e){var t=WPP.whatsapp.WidFactory.createDeviceWid(e),n=WPP.whatsapp.ProfilePicThumbStore.get(t);return n||(n=yield WPP.whatsapp.ProfilePicThumbStore.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){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function tr(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 nr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){tr(i,r,o,a,u,"next",e)}function u(e){tr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function rr(){return(rr=nr((function*(e){var t=WPP.whatsapp.CatalogStore.get(e);if(t||(t=yield WPP.whatsapp.CatalogStore.find(WPP.whatsapp.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 or(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 ir(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){or(i,r,o,a,u,"next",e)}function u(e){or(i,r,o,a,u,"throw",e)}a(void 0)}))}}function ar(){return(ar=ir((function*(e){var t=yield Ee(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=WPP.whatsapp.OrderStore.get(t.orderId);if(n||(n=yield WPP.whatsapp.OrderStore.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 ur,sr;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 lr(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 dr(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 fr,pr=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 dr(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)?dr(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:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"ServiceWorker",conditions:e=>e.default&&e.default.killServiceWorker?e: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:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"Perfil",conditions:e=>!0===e.__esModule&&e.setPushname&&!e.getComposeContents?e:null},{id:"Parser",conditions:e=>e.convertToTextWithoutSpecialEmojis?e.default:null},{id:"Builders",conditions:e=>e.TemplateMessage&&e.HydratedFourRowTemplate?e:null},{id:"CallUtils",conditions:e=>e.sendCallEnd&&e.parseCall?e:null},{id:"Identity",conditions:e=>e.queryIdentity&&e.updateIdentity?e:null},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?e:null},{id:"GroupActions",conditions:e=>e.sendExitGroup&&e.localExitGroup?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:"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:"Theme",conditions:e=>e.getTheme&&e.setTheme?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:"Stream",conditions:e=>e.default&&e.default.unobscure?e.default:null},{id:"ws2",conditions:e=>e.default&&e.default.destroyStorage?e.default: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:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"sendQueryGroupInvite",conditions:e=>e.sendQueryGroupInvite?e.sendQueryGroupInvite:null}]);try{var hr=function(){var e=fr.value;window.Store.promises[e.id]=Promise.resolve(WPP.webpack.search(e.conditions)).then(e.conditions).then((t=>{"Store"===e.id?window.Store=Object.assign({},window.Store,t):window.Store[e.id]=t}))};for(pr.s();!(fr=pr.n()).done;)hr()}catch(e){pr.e(e)}finally{pr.f()}}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 Xt.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return rn.apply(this,arguments)},window.WAPI.scope=qt,window.WAPI.getchatId=function(e){return Kt.apply(this,arguments)},window.WAPI.sendExist=function(e){return Vt.apply(this,arguments)},window.WAPI.pinChat=function(e){return en.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return Yn.apply(this,arguments)},window.WAPI.setTheme=function(e){return kt.apply(this,arguments)},window.WAPI.getTheme=function(){return Tt.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&&WPP.whatsapp.ProfilePicThumbStore){var n=WPP.whatsapp.ProfilePicThumbStore.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=>{var t,n,r,o,i,a,u,s;return null==e?null:(e.quotedMsg&&e.quotedMsgObj&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:null==e||null===(t=e.quotedParticipant)||void 0===t?void 0:t._serialized,author:null==e||null===(n=e.author)||void 0===n?void 0:n._serialized,chatId:(null==e||null===(r=e.id)||void 0===r?void 0:r.remote)||(null==e||null===(o=e.chatId)||void 0===o?void 0:o._serialized),to:null==e||null===(i=e.to)||void 0===i?void 0:i._serialized,fromMe:null==e||null===(a=e.id)||void 0===a?void 0:a.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:null==e||null===(u=e._quotedMsgObj)||void 0===u||null===(s=u.id)||void 0===s?void 0:s._serialized,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=er,window.WAPI.leaveGroup=function(e){return se.apply(this,arguments)},window.WAPI.revokeGroupInviteLink=function(e){return Se.apply(this,arguments)},window.WAPI.getGroupInviteLink=function(e){return K.apply(this,arguments)},window.WAPI.getGroupInfoFromInviteLink=function(e){return Q.apply(this,arguments)},window.WAPI.getGroupAdmins=function(e,t){return D.apply(this,arguments)},window.WAPI.joinGroup=function(e){return xt.apply(this,arguments)},window.WAPI.setGroupDescription=function(e,t){return kn.apply(this,arguments)},window.WAPI.setGroupProperty=function(e,t,n){return Nn.apply(this,arguments)},window.WAPI.setGroupSubject=function(e,t){return Fn.apply(this,arguments)},window.WAPI.sendChatstate=function(e,t){return _e.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 ct.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return et.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.sendImage=function(e,t,n,r,o,i){return Ue(e,t,n,r,"sendImage",o,i)},window.WAPI.sendPtt=function(e,t,n,r,o){return Fe.apply(this,arguments)},window.WAPI.sendFile=Ue,window.WAPI.setMyName=function(e){return wt.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,o){return ft.apply(this,arguments)},window.WAPI.processFiles=Ae,window.WAPI.sendImageWithProduct=function(e,t,n,r,o,i){WPP.whatsapp.CatalogStore.findCarouselCatalog(r).then((r=>{if(r&&r[0]){var u=r[0].productCollection.get(o),s={productMsgOptions:{businessOwnerJid:u.catalogWid.toString({legacy:!0}),productId:u.id.toString(),url:u.url,productImageCount:u.productImageCollection.length,title:u.name,description:u.description,currencyCode:u.currency,priceAmount1000:u.priceAmount1000,type:"product"},caption:n},c=new WPP.whatsapp.WidFactory.createWid(t);return WPP.chat.find(c).then((t=>{var n=a(e,u.name);Ae(t,n).then((e=>{var n=e.models[0];Object.entries(s.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 Ve(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)?Ve(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,s),void 0!==i&&i(!0)}))}))}}))},window.WAPI.forwardMessages=function(e,t,n){return mt.apply(this,arguments)},window.WAPI._sendSticker=ze,window.WAPI.encryptAndUploadFile=function(e,t){return P.apply(this,arguments)},window.WAPI.sendImageAsSticker=qe,window.WAPI.sendImageAsStickerGif=qe,window.WAPI.setOnlinePresence=function(e){return zn.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return Xe.apply(this,arguments)},window.WAPI.openChat=function(e){return Mt.apply(this,arguments)},window.WAPI.openChatAt=function(e,t){return Ct.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Bt.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return at.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return Vn.apply(this,arguments)},window.WAPI.getAllContacts=I,window.WAPI.getMyContacts=function(e){var t=WPP.whatsapp.ContactStore.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=WPP.whatsapp.ContactStore.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=WPP.whatsapp.ChatStore.map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=_,window.WAPI.getAllChatsWithNewMsg=O,window.WAPI.getAllChatIds=function(e){var t=WPP.whatsapp.ChatStore.map((e=>e.id._serialized||e.id));return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return O().map((e=>WAPI.getChat(e.id))).flatMap((e=>e.msgs.filter((e=>e.isNewMsg)))).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=E,window.WAPI.getAllChatsWithMessages=function(e){return A.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=WPP.whatsapp.ChatStore.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=WPP.whatsapp.ChatStore.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return WPP.whatsapp.functions.sendTextMsgToChat(this,...arguments)}),t},window.WAPI.getChatByName=function(e,t){var n=WPP.whatsapp.ChatStore.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 T.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 Pe.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=de,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){de(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=WPP.whatsapp.GroupMetadataStore.map((e=>e.attributes));return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return Z.apply(this,arguments)},window.WAPI._getGroupParticipants=R,window.WAPI.getGroupParticipantIDs=function(e,t){return ne.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return C.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return we.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var o=WPP.whatsapp.ChatStore.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,l=c.length-1;l>=0;l--){var d=c[l];if("boolean"==typeof d.isNewMsg&&!1!==d.isNewMsg){d.isNewMsg=!1;var f=WAPI.processMessageObj(d,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 L.apply(this,arguments)},window.WAPI.downloadFile=function(e){return i.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return ie.apply(this,arguments)},window.WAPI.getMessageById=Ee,window.WAPI.getMessages=function(e){return Wt.apply(this,arguments)},window.WAPI.getFileHash=l,window.WAPI.generateMediaKey=f,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 ln.apply(this,arguments)},window.WAPI.getHost=function(){return WPP.whatsapp.Conn.attributes},window.WAPI.getWid=function(){var e;return null===(e=WPP.whatsapp.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=WPP.whatsapp.ContactStore.get(WPP.whatsapp.UserPrefs.getMaybeMeUser());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=WPP.whatsapp.ContactStore&&void 0!==WPP.whatsapp.ContactStore.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return WPP.whatsapp.Conn.attributes.battery},window.WAPI.base64ImageToFile=a,window.WAPI.base64ToFile=a,window.WAPI.restartService=function(){return Lt.apply(this,arguments)},window.WAPI.killServiceWorker=function(){return Rt.apply(this,arguments)},window.WAPI.sendMute=function(e,t,n){return un.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;yn(),pn=setInterval(wn,e)},window.WAPI.stopPhoneWatchdog=yn,window.WAPI.subscribePresence=function(e){return bn.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return Wn.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return rr.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return ar.apply(this,arguments)},window.WAPI.rejectCall=function(e){return xn.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.getProfilePicSmallFromId=function(){var e=lr((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=lr((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=lr((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=lr((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=lr((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=lr((function*(e){var t=yield WPP.contact.queryExists(e);return t?{id:t.wid,isBusiness:t.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=lr((function*(e){var t=WPP.whatsapp.ChatStore.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=lr((function*(e){var t=WPP.whatsapp.ChatStore.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=lr((function*(e,t){var n=Store.Archive.setArchive(WPP.whatsapp.ChatStore.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=lr((function*(){return yield WPP.whatsapp.State.takeover(),!0})),window.WAPI.onIncomingCall=function(e){return WPP.whatsapp.CallStore.on("add",e),!0},window.WAPI.onInterfaceChange=function(e){var t=()=>({displayInfo:window.Store.Stream.displayInfo,mode:window.Store.Stream.mode,info:window.Store.Stream.info});return e(t()),window.Store.Stream.on("change:info change:displayInfo change:mode",(()=>{e(t())})),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=lr((function*(e,t){return yield Store.WapQuery.setGroupProperty(e,"announcement",t),!0}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=lr((function*(){return yield WPP.auth.logout()})),ur=!1,sr=()=>WPP.whatsapp.State.stream,window.WAPI.onStreamChange=function(e){return WPP.whatsapp.State.on("change:stream",(()=>e(sr()))),ur||(ur=!0,e(sr())),!0},function(){var e=!1,t=()=>WPP.whatsapp.State.state;window.WAPI.onStateChange=function(n){return WPP.whatsapp.State.on("change:state",(()=>n(t()))),e||(e=!0,n(t())),!0}}(),window.WAPI._newMessagesListener=WPP.whatsapp.MsgStore.on("add",(e=>{e&&e.isNewMsg&&!e.isSentByMe&&setTimeout((()=>{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))}),e.body?0:2e3)})),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=>WPP.whatsapp.MsgStore.on("add",(t=>{t&&t.isNewMsg&&setTimeout((()=>{var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)}),t.body?0:2e3)})),window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0},window.WAPI.onAddedToGroup=function(e){return WPP.whatsapp.MsgStore.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());var r,o=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 Qn(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)?Qn(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}}}}(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()}}WPP.chat.on("live_location_start",(e=>{t({type:"enable",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,shareDuration:e.shareDuration})})),WPP.chat.on("live_location_update",(e=>{t({type:"update",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,elapsed:e.elapsed,lastUpdated:e.lastUpdated})})),WPP.chat.on("live_location_end",(e=>{t({type:"disablle",id:e.id.toString(),chat:e.chat.toString()})})),window.WAPI.onLiveLocation=function(){var t,n=(t=function*(t){e.push(t)},function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,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)}))});return function(e){return n.apply(this,arguments)}}()}(),window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){var n=["invite","add","remove","leave","promote","demote"],r=WPP.whatsapp.ChatStore.get(e),o=WPP.whatsapp.GroupMetadataStore.get(e);$n[e]||($n[e]={},o.participants.forEach((t=>{$n[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,l=s.from,d=s.recipients,f=d[0].toString();$n[e][f]&&$n[e][d[0]].subtype==c||(0==i?i++:($n[e][f]={subtype:c,from:l},t({by:l.toString(),action:c,who:d}),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){Xn(i,r,o,a,u,"next",e)}function u(e){Xn(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 WPP.whatsapp.MsgStore.on("add",(t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}})),!0},window.WAPI.onPresenceChanged=function(e){return setTimeout((()=>{WPP.whatsapp.ChatStore.map((e=>e.presence.subscribe()))}),1e3),WPP.whatsapp.PresenceStore.on("change:chatstate.type",(t=>{try{var n=WPP.whatsapp.PresenceStore.models.find((e=>e.chatstate===t));if(!n||!n.hasData||!n.chatstate.type)return;var r=WPP.whatsapp.ContactStore.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=WPP.whatsapp.ContactStore.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=d;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=S(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===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(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 l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",w={};function v(){}function y(){}function P(){}var g={};s(g,i,(function(){return this}));var m=Object.getPrototypeOf,A=m&&m(m(O([])));A&&A!==n&&r.call(A,i)&&(g=A);var b=P.prototype=v.prototype=Object.create(g);function W(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=l(e[o],e,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(d).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 S(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,S(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=l(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=P,s(b,"constructor",P),s(P,"constructor",y),y.displayName=s(P,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,P):(e.__proto__=P,s(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},W(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()}))},W(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(602),n(202)})();
1
+ (()=>{var e={276:function(e,t,n){"use strict";var r;!function(i){function o(e,t,n){var r,i,o,a,s,w,v,y,P,g=0,m=[],b=0,A=!1,W=[],I=[],S=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(P=n.numRounds||1)!==parseInt(P,10)||1>P)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)s=512,w=H,v=z,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,i){var o,a;if("SHA-224"===e||"SHA-256"===e)o=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");o=31+(n+129>>>10<<5),a=32}for(;t.length<=o;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[o]=4294967295&n,t[o-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=a)i=B(t.slice(n,n+a),i,e);if("SHA-224"===e)t=[i[0],i[1],i[2],i[3],i[4],i[5],i[6]];else if("SHA-256"===e)t=i;else if("SHA-384"===e)t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b,i[6].a,i[6].b,i[7].a,i[7].b]}return t},y=function(e){return e.slice()},"SHA-224"===e)s=512,a=224;else if("SHA-256"===e)s=512,a=256;else if("SHA-384"===e)s=1024,a=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");s=1024,a=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var O=6;if(w=D,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)s=1152,a=224;else if("SHA3-256"===e)s=1088,a=256;else if("SHA3-384"===e)s=832,a=384;else if("SHA3-512"===e)s=576,a=512;else if("SHAKE128"===e)s=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");s=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,u=[],c=(n=s)>>>5,l=0,d=t>>>5;for(o=0;o<d&&t>=n;o+=c)r=D(e.slice(o,o+c),r),t-=n;for(e=e.slice(o),t%=n;e.length<c;)e.push(0);for(e[(o=t>>>3)>>2]^=a<<o%4*8,e[c-1]^=2147483648,r=D(e,r);32*u.length<i&&(e=r[l%5][l/5|0],u.push(e.b),!(32*u.length>=i));)u.push(e.a),0==64*(l+=1)%n&&D(null,r);return u}}o=h(t,r,C),i=R(e),this.setHMACKey=function(t,n,o){var u;if(!0===A)throw Error("HMAC key already set");if(!0===S)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=(o||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,o=(u=s>>>3)/4-1,u<t/8){for(n=v(n,t,0,R(e),a);n.length<=o;)n.push(0);n[o]&=4294967040}else if(u>t/8){for(;n.length<=o;)n.push(0);n[o]&=4294967040}for(t=0;t<=o;t+=1)W[t]=909522486^n[t],I[t]=1549556828^n[t];i=w(W,i),g=s,A=!0},this.update=function(e){var t,n,r,a=0,u=s>>>5;for(e=(t=o(e,m,b)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=u)a+s<=e&&(i=w(n.slice(r,r+u),i),a+=s);g+=a,m=n.slice(a>>>5),b=e%s,S=!0},this.getHash=function(t,n){var r,o,s,h;if(!0===A)throw Error("Cannot call getHash after setting HMAC key");if(s=p(n),!0===M){if(-1===s.shakeLen)throw Error("shakeLen must be specified in options");a=s.shakeLen}switch(t){case"HEX":r=function(e){return u(e,a,C,s)};break;case"B64":r=function(e){return c(e,a,C,s)};break;case"BYTES":r=function(e){return l(e,a,C)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return d(e,a,C)};break;case"UINT8ARRAY":try{o=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(m.slice(),b,g,y(i),a),o=1;o<P;o+=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,o,h,P;if(!1===A)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=p(n),t){case"HEX":r=function(e){return u(e,a,C,h)};break;case"B64":r=function(e){return c(e,a,C,h)};break;case"BYTES":r=function(e){return l(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 d(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 o=v(m.slice(),b,g,y(i),a),P=w(I,R(e)),r(P=v(o,a,s,P,a))}}function a(e,t){this.a=e,this.b=t}function s(e,t,n,r){var i,o,a,s,u;for(t=t||[0],o=(n=n||0)>>>3,u=-1===r?3:0,i=0;i<e.length;i+=1)a=(s=i+o)>>>2,t.length<=a&&t.push(0),t[a]|=e[i]<<8*(u+s%4*r);return{value:t,binLen:8*e.length+n}}function u(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i<t;i+=1)o=e[i>>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function c(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i<c;i+=3)for(o=i+1<c?e[i+1>>>2]:0,a=i+2<c?e[i+2>>>2]:0,a=(e[i>>>2]>>>8*(s+i%4*n)&255)<<16|(o>>>8*(s+(i+1)%4*n)&255)<<8|a>>>8*(s+(i+2)%4*n)&255,o=0;4>o;o+=1)u+=8*i+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):r.b64Pad;return u}function l(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r<t;r+=1)i=e[r>>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function d(e,t,n){t/=8;var r,i,o,a=new ArrayBuffer(t);for(o=new Uint8Array(a),i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return a}function f(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return o}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 i,o,a,s,u,c,l=e.length;if(0!=l%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],u=(r=r||0)>>>3,c=-1===n?3:0,i=0;i<l;i+=2){if(o=parseInt(e.substr(i,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(a=(s=(i>>>1)+u)>>>2;t.length<=a;)t.push(0);t[a]|=o<<8*(c+s%4*n)}return{value:t,binLen:4*l+r}};break;case"TEXT":e=function(e,r,i){var o,a,s,u,c,l,d,f,p=0;if(r=r||[0],c=(i=i||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,s=0;s<e.length;s+=1)for(a=[],128>(o=e.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u<a.length;u+=1){for(l=(d=p+c)>>>2;r.length<=l;)r.push(0);r[l]|=a[u]<<8*(f+d%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,s=0;s<e.length;s+=1){for(o=e.charCodeAt(s),!0===a&&(o=(u=255&o)<<8|o>>>8),l=(d=p+c)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(f+d%4*n),p+=2}return{value:r,binLen:8*p+i}};break;case"B64":e=function(e,t,r){var i,o,a,s,u,c,l,d,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=e.indexOf("="),e=e.replace(/\=/g,""),-1!==o&&o<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(r=r||0)>>>3,d=-1===n?3:0,o=0;o<e.length;o+=4){for(u=e.substr(o,4),a=s=0;a<u.length;a+=1)s|=(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(u.charAt(a)))<<18-6*a;for(a=0;a<u.length-1;a+=1){for(i=(l=f+c)>>>2;t.length<=i;)t.push(0);t[i]|=(s>>>16-8*a&255)<<8*(d+l%4*n),f+=1}}return{value:t,binLen:8*f+r}};break;case"BYTES":e=function(e,t,r){var i,o,a,s,u,c;for(t=t||[0],a=(r=r||0)>>>3,c=-1===n?3:0,o=0;o<e.length;o+=1)i=e.charCodeAt(o),s=(u=o+a)>>>2,t.length<=s&&t.push(0),t[s]|=i<<8*(c+u%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 s(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 s(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 P(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 g(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 m(e,t,n){return e&t^~e&n}function b(e,t,n){return new a(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function A(e,t,n){return e&t^e&n^t&n}function W(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 S(e){var t=P(e,28),n=P(e,34);return e=P(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=P(e,14),n=P(e,18);return e=P(e,41),new a(t.a^n.a^e.a,t.b^n.b^e.b)}function O(e){return y(e,7)^y(e,18)^e>>>3}function _(e){var t=P(e,1),n=P(e,8);return e=g(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=P(e,19),n=P(e,61);return e=g(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 i=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)&65535)<<16|65535&i}function T(e,t,n,r,i){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function U(e,t){var n,r,i;return n=(65535&e.b)+(65535&t.b),i=(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,i)}function N(e,t,n,r){var i,o,s;return i=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),s=(65535&(o=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(o>>>16),new a((65535&(o=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i>>>16)))<<16|65535&i,s)}function L(e,t,n,r,i){var o,s,u;return o=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&i.b),u=(65535&(s=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i.b>>>16)+(o>>>16)))<<16|65535&o,o=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&i.a)+(s>>>16),new a((65535&(s=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i.a>>>16)+(o>>>16)))<<16|65535&o,u)}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 H(e,t){var n,r,i,o,a,s,u,c=[];for(n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=0;80>u;u+=1)c[u]=16>u?e[u]:w(c[u-3]^c[u-8]^c[u-14]^c[u-16],1),s=20>u?T(w(n,5),r&i^~r&o,a,1518500249,c[u]):40>u?T(w(n,5),r^i^o,a,1859775393,c[u]):60>u?T(w(n,5),A(r,i,o),a,2400959708,c[u]):T(w(n,5),r^i^o,a,3395469782,c[u]),a=o,o=i,i=w(r,30),r=n,n=s;return t[0]=j(n,t[0]),t[1]=j(r,t[1]),t[2]=j(i,t[2]),t[3]=j(o,t[3]),t[4]=j(a,t[4]),t}function z(e,t,n,r){var i;for(i=15+(t+65>>>9<<4);e.length<=i;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[i]=4294967295&t,e[i-1]=t/4294967296|0,t=e.length,i=0;i<t;i+=16)r=H(e.slice(i,i+16),r);return r}function B(e,t,n){var r,i,o,s,u,c,l,d,f,p,h,w,v,y,P,g,F,R,H,z,B,D,q,V=[];if("SHA-224"===n||"SHA-256"===n)p=64,w=1,D=Number,v=j,y=k,P=T,g=O,F=x,R=I,H=M,B=A,z=m,q=G;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");p=80,w=2,D=a,v=U,y=N,P=L,g=_,F=E,R=S,H=C,B=W,z=b,q=Y}for(n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=0;h<p;h+=1)16>h?(f=h*w,d=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],V[h]=new D(d,f)):V[h]=y(F(V[h-2]),V[h-7],g(V[h-15]),V[h-16]),d=P(l,H(s),z(s,u,c),q[h],V[h]),f=v(R(n),B(n,r,i)),l=c,c=u,u=s,s=v(o,d),o=i,i=r,r=n,n=v(d,f);return t[0]=v(n,t[0]),t[1]=v(r,t[1]),t[2]=v(i,t[2]),t[3]=v(o,t[3]),t[4]=v(s,t[4]),t[5]=v(u,t[5]),t[6]=v(c,t[6]),t[7]=v(l,t[7]),t}function D(e,t){var n,r,i,o,s=[],u=[];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(o=R("SHA3-"),r=0;5>r;r+=1){i=t[r][0];var c=t[r][1],l=t[r][2],d=t[r][3],f=t[r][4];s[r]=new a(i.a^c.a^l.a^d.a^f.a,i.b^c.b^l.b^d.b^f.b)}for(r=0;5>r;r+=1)u[r]=F(s[(r+4)%5],v(s[(r+1)%5],1));for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=F(t[r][i],u[r]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)o[i][(2*r+3*i)%5]=v(t[r][i],q[r][i]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=F(o[r][i],new a(~o[(r+1)%5][i].a&o[(r+2)%5][i].a,~o[(r+1)%5][i].b&o[(r+2)%5][i].b));t[0][0]=F(t[0][0],V[n])}return t}var G,Y,q,V;Y=[new a((G=[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(G[1],602891725),new a(G[2],3964484399),new a(G[3],2173295548),new a(G[4],4081628472),new a(G[5],3053834265),new a(G[6],2937671579),new a(G[7],3664609560),new a(G[8],2734883394),new a(G[9],1164996542),new a(G[10],1323610764),new a(G[11],3590304994),new a(G[12],4068182383),new a(G[13],991336113),new a(G[14],633803317),new a(G[15],3479774868),new a(G[16],2666613458),new a(G[17],944711139),new a(G[18],2341262773),new a(G[19],2007800933),new a(G[20],1495990901),new a(G[21],1856431235),new a(G[22],3175218132),new a(G[23],2198950837),new a(G[24],3999719339),new a(G[25],766784016),new a(G[26],2566594879),new a(G[27],3203337956),new a(G[28],1034457026),new a(G[29],2466948901),new a(G[30],3758326383),new a(G[31],168717936),new a(G[32],1188179964),new a(G[33],1546045734),new a(G[34],1522805485),new a(G[35],2643833823),new a(G[36],2343527390),new a(G[37],1014477480),new a(G[38],1206759142),new a(G[39],344077627),new a(G[40],1290863460),new a(G[41],3158454273),new a(G[42],3505952657),new a(G[43],106217008),new a(G[44],3606008344),new a(G[45],1432725776),new a(G[46],1467031594),new a(G[47],851169720),new a(G[48],3100823752),new a(G[49],1363258195),new a(G[50],3750685593),new a(G[51],3785050280),new a(G[52],3318307427),new a(G[53],3812723403),new a(G[54],2003034995),new a(G[55],3602036899),new a(G[56],1575990012),new a(G[57],1125592928),new a(G[58],2716904306),new a(G[59],442776044),new a(G[60],593698344),new a(G[61],3733110249),new a(G[62],2999351573),new a(G[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)],V=[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)],q=[[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 o}.call(t,n,t,e))||(e.exports=r)}()},431:(e,t,n)=>{"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)}))}}function o(){return(o=i((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 i=window.Base64?window.Base64.atob(n[1]):atob(n[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:r})}var s=n(276);function u(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))}}function l(e){return d.apply(this,arguments)}function d(){return(d=c((function*(e){var t=yield e.arrayBuffer(),n=new s("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")}))).apply(this,arguments)}function f(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function p(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function y(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){v(o,r,i,a,s,"next",e)}function s(e){v(o,r,i,a,s,"throw",e)}a(void 0)}))}}function P(){return(P=y((function*(e,t){var n=yield l(t),r=f(32),i=(new AbortController).signal,o=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:i,mediaKey:r});return h(h({},o),{},{clientUrl:o.url,filehash:n,id:n,uploadhash:o.encFilehash,mediaBlob:t})}))).apply(this,arguments)}function g(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){g(o,r,i,a,s,"next",e)}function s(e){g(o,r,i,a,s,"throw",e)}a(void 0)}))}}function b(){return(b=m((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 A(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){A(o,r,i,a,s,"next",e)}function s(e){A(o,r,i,a,s,"throw",e)}a(void 0)}))}}var I=function(){var e=W((function*(){var e=yield Promise.all(WPP.whatsapp.ContactStore.map(function(){var e=W((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 S(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){S(o,r,i,a,s,"next",e)}function s(e){S(o,r,i,a,s,"throw",e)}a(void 0)}))}}function C(){return(C=M((function*(e,t,n,r){var i=yield WAPI.sendExist(e),o=[];if(!i.erro){var a=i.msgs.models;for(var s in a)if("remove"!==s){var u=a[s],c=WAPI.processMessageObj(u,t,n);c&&o.push(c)}}return void 0!==r&&r(o),o}))).apply(this,arguments)}var O=function(e){return e.unreadCount>0},_=function(e){var t=WPP.whatsapp.ChatStore.filter(O).map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t};function x(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var E=function(){var e,t=(e=function*(){var e=_().map((e=>WPP.chat.getMessages(e.id,{count:e.unreadCount})));return(yield Promise.all(e)).flat().map(WAPI._serializeMessageObj)},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){x(o,r,i,a,s,"next",e)}function s(e){x(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();function j(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,s,"next",e)}function s(e){j(o,r,i,a,s,"throw",e)}a(void 0)}))}}function T(){return(T=k((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 U(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function N(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){U(o,r,i,a,s,"next",e)}function s(e){U(o,r,i,a,s,"throw",e)}a(void 0)}))}}function L(){return(L=N((function*(e,t){var n=[],r=window.WAPI.getAllGroups();for(var i in r)try{(yield window.WAPI.getGroupParticipantIDs(r[i].id)).filter((t=>t==e)).length&&n.push(r[i])}catch(e){console.log("Error in group:"),console.log(r[i]),console.log(e)}return void 0!==t&&t(n),n}))).apply(this,arguments)}function F(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){F(o,r,i,a,s,"next",e)}function s(e){F(o,r,i,a,s,"throw",e)}a(void 0)}))}}function H(){return(H=R((function*(e,t){var n=WPP.whatsapp.GroupMetadataStore.find(e);return void 0!==t&&t(n),n}))).apply(this,arguments)}function z(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){z(o,r,i,a,s,"next",e)}function s(e){z(o,r,i,a,s,"throw",e)}a(void 0)}))}}function D(){return(D=B((function*(e,t){var n=yield Promise.resolve(WPP.group.getParticipants()).then((e=>e.map((e=>e.id))));return void 0!==t&&t(n),n}))).apply(this,arguments)}function G(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){G(o,r,i,a,s,"next",e)}function s(e){G(o,r,i,a,s,"throw",e)}a(void 0)}))}}function q(){return(q=Y((function*(e){return(yield WAPI.getGroupMetadata(e)).participants}))).apply(this,arguments)}function V(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){V(o,r,i,a,s,"next",e)}function s(e){V(o,r,i,a,s,"throw",e)}a(void 0)}))}}function J(){return(J=K((function*(e,t){var n=yield WPP.contact.queryExists(e);if(!n||void 0===n.wid)throw 404;var r=window.WAPI._serializeNumberStatusObj({jid:n.wid,status:200,isBusiness:n.biz});return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r}))).apply(this,arguments)}function Q(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Q(o,r,i,a,s,"next",e)}function s(e){Q(o,r,i,a,s,"throw",e)}a(void 0)}))}}function $(e,t){return Z.apply(this,arguments)}function Z(){return(Z=X((function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield WPP.whatsapp.MsgStore.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,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function te(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ee(o,r,i,a,s,"next",e)}function s(e){ee(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ne(){return(ne=te((function*(e,t,n,r){return WAPI.loadAllEarlierMessages(e).then((i=>{var o=WAPI.getChat(e);if(!o)throw{error:!0,code:"chat_not_found",message:"Chat not found"};var a=[],s=o.msgs.models;for(var u in s)if("remove"!==u){var c=s[u],l=WAPI.processMessageObj(c,t,n);l&&a.push(l)}return void 0!==r&&r(a),a}))}))).apply(this,arguments)}function re(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ie(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){re(o,r,i,a,s,"next",e)}function s(e){re(o,r,i,a,s,"throw",e)}a(void 0)}))}}function oe(){return(oe=ie((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 ae(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ae(o,r,i,a,s,"next",e)}function s(e){ae(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ue(e,t){return ce.apply(this,arguments)}function ce(){return(ce=se((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 le(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){le(o,r,i,a,s,"next",e)}function s(e){le(o,r,i,a,s,"throw",e)}a(void 0)}))}}function fe(){return(fe=de((function*(e,t){e=parseInt(e,10);var n=WPP.whatsapp.ChatStore.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 pe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function he(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){pe(o,r,i,a,s,"next",e)}function s(e){pe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function we(e,t){return ve.apply(this,arguments)}function ve(){return ve=he((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=yield WPP.chat.getMessageById(e);if(!r)return!1;var i=!1;if(n)try{i=WAPI.processMessageObj(r,!0,!0)}catch(e){}else i=r;if("function"!=typeof t)return i;t(i)})),ve.apply(this,arguments)}function ye(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ye(o,r,i,a,s,"next",e)}function s(e){ye(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ge(e,t,n,r,i){return me.apply(this,arguments)}function me(){return me=Pe((function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(i=i||"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 c=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);c&&c.length&&(c=c[1]);var l=yield WAPI.sendExist(t);if(l.erro)return l;var d=null;if("string"==typeof o&&o){var f=yield we(o,null,!1);f&&f.canReply()&&(d=f)}var p=a(e,n),h=yield ue(l,p),w=h.models[0],v=(yield w.sendToChat(l,{caption:r,quotedMsg:d,isViewOnce:s}))||"",y={type:i,filename:n,text:r,mimeType:c},P=yield WAPI.getchatId(l.id);if("success"===v||"OK"===v){var g=WAPI.scope(P,!1,v,null);return Object.assign(g,y),g}return g=WAPI.scope(P,!0,v,null),Object.assign(g,y),g})),me.apply(this,arguments)}function be(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){be(o,r,i,a,s,"next",e)}function s(e){be(o,r,i,a,s,"throw",e)}a(void 0)}))}}function We(){return We=Ae((function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=yield WAPI.sendExist(t);if(s.erro)return s;var u=null;if("string"==typeof o&&o){var c=yield we(o,null,!1);c&&c.canReply()&&(u=c)}var l=a(e,n),d=yield ue(s,l),f=d.models[0];f.mediaPrep._mediaData.type="ptt";var p=(yield f.sendToChat(s,{caption:r,quotedMsg:u}))||"";void 0!==i&&i(!0);var h={type:"ptt",filename:n,text:r},w=yield WAPI.getchatId(s.id);if("success"===p||"OK"===p){var v=WAPI.scope(w,!1,p,null);return Object.assign(v,h),v}return v=WAPI.scope(w,!0,p,null),Object.assign(v,h),v})),We.apply(this,arguments)}function Ie(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ie(o,r,i,a,s,"next",e)}function s(e){Ie(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Me(e,t,n,r){return Ce.apply(this,arguments)}function Ce(){return(Ce=Se((function*(e,t,n,r){var i=yield WAPI.sendExist(t);if(i.erro)return i;var o=new window.Store.Sticker.default.modelClass;o.__x_clientUrl=e.clientUrl,o.__x_filehash=e.filehash,o.__x_id=e.filehash,o.__x_uploadhash=e.uploadhash,o.__x_mediaKey=e.mediaKey,o.__x_initialized=!1,o.__x_mediaData.mediaStage="INIT",o.mimetype="image/webp",o.height=n&&n.height?n.height:512,o.width=n&&n.width?n.width:512,yield o.initialize();var a,s=(yield o.sendToChat(i,{stickerIsFirstParty:!1,stickerSendOrigin:6}))||"",u={type:r},c=yield WAPI.getchatId(i.id);return"OK"===s?(a=WAPI.scope(c,!1,s,null),Object.assign(a,u),a):(a=WAPI.scope(c,!0,s,null),Object.assign(a,u),a)}))).apply(this,arguments)}function Oe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function xe(e,t,n,r){return Ee.apply(this,arguments)}function Ee(){return(Ee=_e((function*(e,t,n,r){var i=a("data:image/webp;base64,"+e,"file.webp"),o=yield window.WAPI.encryptAndUploadFile("sticker",i);return yield Me(o,t,n,r)}))).apply(this,arguments)}function je(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 ke(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Te(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ke(o,r,i,a,s,"next",e)}function s(e){ke(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ue(){return Ue=Te((function*(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=yield WAPI.sendExist(e);if(i.erro)return i;var o,a=WPP.chat.generateMessageID(i.id),s={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:i.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},u=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(i,s)))[1]||"",c={latitude:t,longitude:n,title:r,type:"location"},l=yield WAPI.getchatId(i.id);return"success"==u||"OK"==u?(o=WAPI.scope(l,!1,u,null),Object.assign(o,c),o):(o=WAPI.scope(l,!0,u,null),Object.assign(o,c),o)})),Ue.apply(this,arguments)}function Ne(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Le(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ne(o,r,i,a,s,"next",e)}function s(e){Ne(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Fe(){return(Fe=Le((function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=WPP.chat.generateMessageID(n.id),i={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},o=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(n,i)))[1]||"";if("success"===o||"OK"===o)return null==r?void 0:r._serialized;var a={type:"sendtext",text:i},s=yield WAPI.getchatId(n.id),u=WAPI.scope(s,!0,o,null);return Object.assign(u,a),u}))).apply(this,arguments)}function Re(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 He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){ze(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function De(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Be(o,r,i,a,s,"next",e)}function s(e){Be(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ge(){return Ge=De((function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=WPP.chat.get(e)||(yield WPP.chat.find(e)),i={};n.attachment&&(t=(i=yield WWebJS.processMediaData(n.attachment,n.sendAudioAsVoice)).preview,delete n.attachment);var o={};if(n.quotedMessageId){var a=yield we(n.quotedMessageId,null,!1);a&&a.canReply()&&(o=a.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map((e=>WPP.whatsapp.ContactStore.get(e).id)));var s={};n.location&&(s={type:"location",loc:n.location.description,lat:n.location.latitude,lng:n.location.longitude},delete n.location);var u={};if(n.contactCard){var c=WPP.whatsapp.ContactStore.get(n.contactCard);u={body:WPP.whatsapp.VCard.vcardFromContactModel(c).vcard,type:"vcard",vcardFormattedName:c.formattedName},delete n.contactCard}else if(n.contactCardList){var l=n.contactCardList.map((e=>WPP.whatsapp.ContactStore.get(e))),d=l.map((e=>WPP.whatsapp.VCard.vcardFromContactModel(e)));u={type:"multi_vcard",vcardList:d,body:void 0},delete n.contactCardList}else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var f=yield WPP.whatsapp.VCard.parseVcard(t);f&&(u={type:"vcard",vcardFormattedName:yield WPP.whatsapp.VCard.vcardGetNameFromParsed(f)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var p=yield window.Store.Validators.findLink(t);if(p&&!WPP.auth.isMultiDevice()){var h=yield window.Store.Wap2.default.queryLinkPreview(p.url);h.preview=!0,h.subtype="url",n=He(He({},n),h)}}var w=WPP.chat.generateMessageID(r.id),v=WPP.whatsapp.UserPrefs.getMaybeMeUser(),y=He(He(He(He(He({id:w,ack:0,body:t,from:v,to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),s),i),o),u);return yield WPP.whatsapp.functions.addAndSendMsgToChat(r,y),w._serialized})),Ge.apply(this,arguments)}function Ye(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function qe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ye(o,r,i,a,s,"next",e)}function s(e){Ye(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ve(){return(Ve=qe((function*(e,t){var n=e.id?e:WPP.whatsapp.ChatStore.get(e),r=n.id._serialized,i=n.msgs.filter((e=>e.__x_isSentByMe))[0];if(!i)return n.sendMessage(t);var o=Object.create(i),a=WPP.chat.generateMessageID(r),s=t.match(/@(\d*)/g).map((e=>new WPP.whatsapp.WidFactory.createUserWid(e.replace("@",""))))||void 0,u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new WPP.whatsapp.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:s};return Object.assign(o,u),yield WPP.whatsapp.functions.addAndSendMsgToChat(n,o),a._serialized}))).apply(this,arguments)}function Ke(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Je(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ke(o,r,i,a,s,"next",e)}function s(e){Ke(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Qe(){return(Qe=Je((function*(e,t,n,r,i){var o=yield WAPI.sendExist(t);if(o.erro)return o;var s=a(e,n),u=(yield ue(o,s)).models[0];u.mediaPrep._mediaData.isGif=!0,u.mediaPrep._mediaData.gifAttribution=1;var c=(yield u.sendToChat(o,{caption:r}))||"",l={filename:n,text:r},d=yield WAPI.getchatId(o.id);if("success"===c||"OK"===c){void 0!==i&&i(!1);var f=WAPI.scope(d,!1,c,null);return Object.assign(f,l),f}return void 0!==i&&i(!0),f=WAPI.scope(d,!0,c,null),Object.assign(f,l),f}))).apply(this,arguments)}function Xe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Xe(o,r,i,a,s,"next",e)}function s(e){Xe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ze(){return(Ze=$e((function*(e){yield window.Store.Perfil.setPushname(e)}))).apply(this,arguments)}function et(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,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}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 nt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function rt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){nt(o,r,i,a,s,"next",e)}function s(e){nt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function it(){return it=rt((function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=WPP.whatsapp.ChatStore.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var i,o=[],a=et(t);try{for(a.s();!(i=a.n()).done;){var s=i.value,u="string"==typeof s?s:s.id,c=yield we(u,null,!1);if(!c)throw{error:!0,code:"message_not_found",message:"Message not Found",messageId:u};o.push(c)}}catch(e){a.e(e)}finally{a.f()}var l=o.filter((e=>!n||!e.isSentByMe));return yield r.forwardMessages(l),yield new Promise((e=>setTimeout(e,100))),r.msgs.models.slice(-1*t.length).map((e=>e.id._serialized))})),it.apply(this,arguments)}function ot(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function at(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ot(o,r,i,a,s,"next",e)}function s(e){ot(o,r,i,a,s,"throw",e)}a(void 0)}))}}function st(){return st=at((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 i=n.map((e=>new WPP.whatsapp.MsgStore.modelClass(e))).map((e=>WAPI.processMessageObj(e,!0,!0)));return i})),st.apply(this,arguments)}function ut(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ct(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ut(o,r,i,a,s,"next",e)}function s(e){ut(o,r,i,a,s,"throw",e)}a(void 0)}))}}function lt(){return(lt=ct((function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")}))).apply(this,arguments)}function dt(){return(dt=ct((function*(){return yield Store.Theme.getTheme()}))).apply(this,arguments)}function ft(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function pt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ft(o,r,i,a,s,"next",e)}function s(e){ft(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ht(){return(ht=pt((function*(){return yield Store.ServiceWorker.default.restart(),!0}))).apply(this,arguments)}function wt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function vt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){wt(o,r,i,a,s,"next",e)}function s(e){wt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function yt(){return(yt=vt((function*(){return yield Store.ServiceWorker.default.killServiceWorker(),!0}))).apply(this,arguments)}function Pt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function gt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Pt(o,r,i,a,s,"next",e)}function s(e){Pt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function mt(){return(mt=gt((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 i=yield WAPI.sendExist(e);if(i.erro)return i;var o=WPP.auth.isMultiDevice()?void 0:yield Store.WapQuery.queryLinkPreview(t),a=(yield i.sendMessage(n.includes(t)?n:"".concat(t,"\n").concat(n),{linkPreview:o}))||"",s={type:"LinkPreview",url:t,text:n},u=yield WAPI.getchatId(i.id);if("success"===a||"OK"===a){var c=WAPI.scope(u,!1,a,null);return Object.assign(c,s),c}return c=WAPI.scope(u,!0,a,null),Object.assign(c,s),c}))).apply(this,arguments)}function bt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function At(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){bt(o,r,i,a,s,"next",e)}function s(e){bt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Wt(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i={me:WPP.whatsapp.Conn.attributes,to:e,erro:t,text:r,status:n};return i}function It(){return(It=At((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 St(){return St=At((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 Wt(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new WPP.whatsapp.ChatStore.modelClass({id:WPP.whatsapp.WidFactory.createWid("status@broadcast")}),WPP.whatsapp.ChatStore.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var i=yield window.WAPI.checkNumberStatus(e);if(!i.numberExists)return Wt(e,!0,i.status,"The number does not exist");yield WPP.chat.find(i.id),e=i.id._serialized,r=yield window.WAPI.getChat(e)}return r?(n&&(yield WPP.chat.markIsRead(r.id).catch((()=>null))),t?r:Wt(e,!1,200)):Wt(e,!0,404)})),St.apply(this,arguments)}function Mt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ct(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Mt(o,r,i,a,s,"next",e)}function s(e){Mt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ot(){return(Ot=Ct((function*(e,t){t||(t=WPP.whatsapp.UserPrefs.getMaybeMeUser());var n=WPP.whatsapp.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield WPP.whatsapp.functions.sendSetPicture(n,r+e.b,r+e.a)}))).apply(this,arguments)}function _t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function xt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){_t(o,r,i,a,s,"next",e)}function s(e){_t(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Et(){return Et=xt((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 i=t?"pin":"unpin",o=void 0,a=yield WAPI.sendExist(e,!0,n);if(a.erro)return a;var s={type:"pinChat",typefix:i},u=yield WAPI.getchatId(a.id);return yield Store.pinChat.setPin(a,t).then((e=>{var t=WAPI.scope(u,!1,"OK",null);Object.assign(t,s),o=t})).catch((e=>{var t=WAPI.scope(u,!0,e,"Pin Chat first");Object.assign(t,s),o=t})),o})),Et.apply(this,arguments)}function jt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function kt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){jt(o,r,i,a,s,"next",e)}function s(e){jt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Tt(){return(Tt=kt((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 Ut(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Nt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ut(o,r,i,a,s,"next",e)}function s(e){Ut(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Lt(){return(Lt=Nt((function*(e,t,n){var r=yield WAPI.sendExist(e);if(r.erro)return r;var i,o=null,a=null,s=null,u=yield WAPI.getchatId(r.id),c=yield window.Store.Mute.get(r.id),l={type:"sendMute",time:t,timeType:n};if("number"==typeof t&&"string"==typeof n){switch(n){case"hours":o=parseInt(new Date((new Date).setHours((new Date).getHours()+t)).getTime()/1e3);break;case"minutes":o=parseInt(new Date((new Date).setMinutes((new Date).getMinutes()+t)).getTime()/1e3);break;case"year":o=parseInt(new Date((new Date).setDate((new Date).getDate()+t)).getTime()/1e3)}yield window.Store.SendMute.sendConversationMute(r.id,o,0).then((e=>{a=e})).catch((e=>{a=e}))}else s=!0,yield window.Store.SendMute.sendConversationMute(r.id,0,c.__x_expiration).then((e=>{a=e})).catch((e=>{a=e}));if(200===a.status){s?(c.__x_expiration=0,c.__x_isMuted=!1):(c.__x_expiration=o,c.__x_isMuted=!0);var d=WAPI.scope(u,!1,a.status,null);return Object.assign(d,l),d}return i=s?"is not mute to remove":"This chat is already mute",d=WAPI.scope(u,!0,a.status,i),Object.assign(d,l),d}))).apply(this,arguments)}function Ft(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Rt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ft(o,r,i,a,s,"next",e)}function s(e){Ft(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ht(){return Ht=Rt((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 i in t)t[i].__x_isMuted?r.push(WAPI.interfaceMute(t[i])):n.push(WAPI.interfaceMute(t[i]));var o=null;switch(console.log(0,e),e){case"all":o=[{total:r.length+n.length,amountToMute:r.length,amountnoMute:n.length},r,n];break;case"toMute":o=[{total:r.length},r];break;case"noMute":o=[{total:n.length},n]}return o})),Ht.apply(this,arguments)}function zt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Bt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){zt(o,r,i,a,s,"next",e)}function s(e){zt(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Dt=null,Gt=!0;function Yt(){return qt.apply(this,arguments)}function qt(){return(qt=Bt((function*(){if("MAIN"===window.Store.Stream.mode&&"TIMEOUT"!==WPP.whatsapp.State.state)return Gt?(Gt=!1,WPP.whatsapp.State.sendBasic({tag:WPP.whatsapp.State.tag("ping"),data:["admin","test"]}).then((()=>{Gt=!0}))):(WPP.whatsapp.State.phoneWatchdog.activate(),void WPP.whatsapp.State.phoneWatchdog.poke(250))}))).apply(this,arguments)}function Vt(){Dt&&clearInterval(Dt),Dt=null}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 Jt(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)?Jt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Jt(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 Qt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Xt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Qt(o,r,i,a,s,"next",e)}function s(e){Qt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function $t(){return $t=Xt((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Kt(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i);Store.Presence.get(o)||(yield Store.Presence.find(o),n++)}}catch(e){r.e(e)}finally{r.f()}return n})),$t.apply(this,arguments)}function Zt(){return(Zt=Xt((function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=Kt(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i),a=Store.Presence.get(o);a&&(a.delete(),n++)}}catch(e){r.e(e)}finally{r.f()}return n}))).apply(this,arguments)}function en(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 tn(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)?tn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function tn(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 nn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function rn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){nn(o,r,i,a,s,"next",e)}function s(e){nn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function on(e){return an.apply(this,arguments)}function an(){return(an=rn((function*(e){var t=WPP.whatsapp.CallStore.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 WPP.whatsapp.functions.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 sn(){return sn=rn((function*(e){if(e)return yield on(e),1;var t,n=WPP.whatsapp.CallStore.models.filter((e=>"INCOMING_RING"===e.getState())),r=en(n);try{for(r.s();!(t=r.n()).done;){var i=t.value;yield on(i.id).catch((e=>null))}}catch(e){r.e(e)}finally{r.f()}return n.lenth})),sn.apply(this,arguments)}function un(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function cn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){un(o,r,i,a,s,"next",e)}function s(e){un(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ln(){return(ln=cn((function*(e){void 0===e&&(e=!0),e?yield WPP.whatsapp.ChatPresence.sendPresenceAvailable():yield WPP.whatsapp.ChatPresence.sendPresenceUnavailable()}))).apply(this,arguments)}function dn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function fn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){dn(o,r,i,a,s,"next",e)}function s(e){dn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function pn(){return(pn=fn((function*(e,t){var n=WPP.whatsapp.ChatStore.get(e);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};return n.isGroup?yield WPP.group.setProperty(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 hn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function wn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){hn(o,r,i,a,s,"next",e)}function s(e){hn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function vn(){return vn=wn((function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=wn((function*(e){return yield we(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)),i=0,o=function*(e){var n=WPP.whatsapp.ChatStore.get(e),o=r[e];i+=(yield n.sendStarMsgs(o,t).then((()=>o.length)).catch((()=>0)))};for(var a in r)yield*o(a);return i})),vn.apply(this,arguments)}function yn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Pn(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 gn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var mn={};function bn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var An=function(){var e,t=(e=function*(e){var t=WPP.whatsapp.WidFactory.createDeviceWid(e),n=WPP.whatsapp.ProfilePicThumbStore.get(t);return n||(n=yield WPP.whatsapp.ProfilePicThumbStore.find(t)),n?WAPI._serializeProfilePicThumb(n):null},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){bn(o,r,i,a,s,"next",e)}function s(e){bn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function Wn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Wn(o,r,i,a,s,"next",e)}function s(e){Wn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Sn(){return(Sn=In((function*(e){var t=WPP.whatsapp.CatalogStore.get(e);if(t||(t=yield WPP.whatsapp.CatalogStore.find(WPP.whatsapp.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 Mn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Cn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Mn(o,r,i,a,s,"next",e)}function s(e){Mn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function On(){return(On=Cn((function*(e){var t=yield we(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=WPP.whatsapp.OrderStore.get(t.orderId);if(n||(n=yield WPP.whatsapp.OrderStore.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 _n,xn;function En(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function jn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){En(o,r,i,a,s,"next",e)}function s(e){En(o,r,i,a,s,"throw",e)}a(void 0)}))}}function kn(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 Tn,Un=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 kn(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)?kn(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}([{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:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"ServiceWorker",conditions:e=>e.default&&e.default.killServiceWorker?e: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:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"Perfil",conditions:e=>!0===e.__esModule&&e.setPushname&&!e.getComposeContents?e:null},{id:"Parser",conditions:e=>e.convertToTextWithoutSpecialEmojis?e.default:null},{id:"Builders",conditions:e=>e.TemplateMessage&&e.HydratedFourRowTemplate?e:null},{id:"CallUtils",conditions:e=>e.sendCallEnd&&e.parseCall?e:null},{id:"Identity",conditions:e=>e.queryIdentity&&e.updateIdentity?e:null},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?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:"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:"Theme",conditions:e=>e.getTheme&&e.setTheme?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:"Stream",conditions:e=>e.default&&e.default.unobscure?e.default:null},{id:"ws2",conditions:e=>e.default&&e.default.destroyStorage?e.default: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:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"sendQueryGroupInvite",conditions:e=>e.sendQueryGroupInvite?e.sendQueryGroupInvite:null}]);try{var Nn=function(){var e=Tn.value;window.Store.promises[e.id]=Promise.resolve(WPP.webpack.search(e.conditions)).then(e.conditions).then((t=>{"Store"===e.id?window.Store=Object.assign({},window.Store,t):window.Store[e.id]=t}))};for(Un.s();!(Tn=Un.n()).done;)Nn()}catch(e){Un.e(e)}finally{Un.f()}}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 Ot.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return Tt.apply(this,arguments)},window.WAPI.scope=Wt,window.WAPI.getchatId=function(e){return It.apply(this,arguments)},window.WAPI.sendExist=function(e){return St.apply(this,arguments)},window.WAPI.pinChat=function(e){return Et.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return pn.apply(this,arguments)},window.WAPI.setTheme=function(e){return lt.apply(this,arguments)},window.WAPI.getTheme=function(){return dt.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&&WPP.whatsapp.ProfilePicThumbStore){var n=WPP.whatsapp.ProfilePicThumbStore.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=>{var t,n,r,i,o,a,s,u;return null==e?null:(e.quotedMsg&&e.quotedMsgObj&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:null==e||null===(t=e.quotedParticipant)||void 0===t?void 0:t._serialized,author:null==e||null===(n=e.author)||void 0===n?void 0:n._serialized,chatId:(null==e||null===(r=e.id)||void 0===r?void 0:r.remote)||(null==e||null===(i=e.chatId)||void 0===i?void 0:i._serialized),to:null==e||null===(o=e.to)||void 0===o?void 0:o._serialized,fromMe:null==e||null===(a=e.id)||void 0===a?void 0:a.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:null==e||null===(s=e._quotedMsgObj)||void 0===s||null===(u=s.id)||void 0===u?void 0:u._serialized,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=An,window.WAPI.sendChatstate=function(e,t){return fe.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,i,o){var a=WAPI.getChat(i);if(void 0===a)return void 0!==o&&o(!1),!1;var s={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:s,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==o&&o(!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 Ve.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return Fe.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.sendImage=function(e,t,n,r,i,o){return ge(e,t,n,r,"sendImage",i,o)},window.WAPI.sendPtt=function(e,t,n,r,i){return We.apply(this,arguments)},window.WAPI.sendFile=ge,window.WAPI.setMyName=function(e){return Ze.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,i){return Qe.apply(this,arguments)},window.WAPI.processFiles=ue,window.WAPI.sendImageWithProduct=function(e,t,n,r,i,o){WPP.whatsapp.CatalogStore.findCarouselCatalog(r).then((r=>{if(r&&r[0]){var s=r[0].productCollection.get(i),u={productMsgOptions:{businessOwnerJid:s.catalogWid.toString({legacy:!0}),productId:s.id.toString(),url:s.url,productImageCount:s.productImageCollection.length,title:s.name,description:s.description,currencyCode:s.currency,priceAmount1000:s.priceAmount1000,type:"product"},caption:n},c=new WPP.whatsapp.WidFactory.createWid(t);return WPP.chat.find(c).then((t=>{var n=a(e,s.name);ue(t,n).then((e=>{var n=e.models[0];Object.entries(u.productMsgOptions).map((e=>{var t,r,i=(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,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return je(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)?je(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.")}()),o=i[0],a=i[1];return n.mediaPrep._mediaData[o]=a})),n.mediaPrep.sendToChat(t,u),void 0!==o&&o(!0)}))}))}}))},window.WAPI.forwardMessages=function(e,t,n){return it.apply(this,arguments)},window.WAPI._sendSticker=Me,window.WAPI.encryptAndUploadFile=function(e,t){return P.apply(this,arguments)},window.WAPI.sendImageAsSticker=xe,window.WAPI.sendImageAsStickerGif=xe,window.WAPI.setOnlinePresence=function(e){return ln.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return Ue.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return mt.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return Ge.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return vn.apply(this,arguments)},window.WAPI.getAllContacts=I,window.WAPI.getMyContacts=function(e){var t=WPP.whatsapp.ContactStore.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=WPP.whatsapp.ContactStore.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=WPP.whatsapp.ChatStore.map((e=>WAPI._serializeChatObj(e)));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=O,window.WAPI.getAllChatsWithNewMsg=_,window.WAPI.getAllChatIds=function(e){var t=WPP.whatsapp.ChatStore.map((e=>e.id._serialized||e.id));return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return _().map((e=>WAPI.getChat(e.id))).flatMap((e=>e.msgs.filter((e=>e.isNewMsg)))).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=E,window.WAPI.getAllChatsWithMessages=function(e){return b.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=WPP.whatsapp.ChatStore.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=WPP.whatsapp.ChatStore.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return WPP.whatsapp.functions.sendTextMsgToChat(this,...arguments)}),t},window.WAPI.getChatByName=function(e,t){var n=WPP.whatsapp.ChatStore.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 T.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var i=WAPI.getChat(e).msgs._models,o=[],a=i.length-1;a>=0;a--)if("remove"!==a){var s=i[a];if("boolean"==typeof s.isNewMsg&&!1!==s.isNewMsg){s.isNewMsg=!1;var u=WAPI.processMessageObj(s,t,n);u&&o.push(u)}}return void 0!==r&&r(o),o},window.WAPI.loadEarlierMessages=function(e){return oe.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=$,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){$(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=WPP.whatsapp.GroupMetadataStore.map((e=>e.attributes));return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return H.apply(this,arguments)},window.WAPI._getGroupParticipants=function(e){return q.apply(this,arguments)},window.WAPI.getGroupParticipantIDs=function(e,t){return D.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return C.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return ne.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var i=WPP.whatsapp.ChatStore.models,o=[];for(var a in i)if(!isNaN(a)){var s=i[a],u=WAPI._serializeChatObj(s);u.messages=[];for(var c=s.msgs._models,l=c.length-1;l>=0;l--){var d=c[l];if("boolean"==typeof d.isNewMsg&&!1!==d.isNewMsg){d.isNewMsg=!1;var f=WAPI.processMessageObj(d,e,t);f&&u.messages.push(f)}}if(u.messages.length>0)o.push(u);else if(n){for(var p=s.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);u.messages.unshift(v),p-=1}}else{if(-1!==p)break;if(!w.isSentByMe){var y=WAPI.processMessageObj(w,e,t);u.messages.unshift(y);break}}}u.messages.length>0&&(s.unreadCount=0,o.push(u))}}return void 0!==r&&r(o),o},window.WAPI.getCommonGroups=function(e,t){return L.apply(this,arguments)},window.WAPI.downloadFile=function(e){return o.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return J.apply(this,arguments)},window.WAPI.getMessageById=we,window.WAPI.getMessages=function(e){return st.apply(this,arguments)},window.WAPI.getFileHash=l,window.WAPI.generateMediaKey=f,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),o=i.byteLength,a=o%3,s=o-a,u=0;u<s;u+=3)n+=r[(16515072&(t=i[u]<<16|i[u+1]<<8|i[u+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=i[s]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=i[s]<<8|i[s+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return Ht.apply(this,arguments)},window.WAPI.getHost=function(){return WPP.whatsapp.Conn.attributes},window.WAPI.getWid=function(){var e;return null===(e=WPP.whatsapp.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=WPP.whatsapp.ContactStore.get(WPP.whatsapp.UserPrefs.getMaybeMeUser());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=WPP.whatsapp.ContactStore&&void 0!==WPP.whatsapp.ContactStore.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return WPP.whatsapp.Conn.attributes.battery},window.WAPI.base64ImageToFile=a,window.WAPI.base64ToFile=a,window.WAPI.restartService=function(){return ht.apply(this,arguments)},window.WAPI.killServiceWorker=function(){return yt.apply(this,arguments)},window.WAPI.sendMute=function(e,t,n){return Lt.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;Vt(),Dt=setInterval(Yt,e)},window.WAPI.stopPhoneWatchdog=Vt,window.WAPI.subscribePresence=function(e){return $t.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return Zt.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return Sn.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return On.apply(this,arguments)},window.WAPI.rejectCall=function(e){return sn.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.getProfilePicSmallFromId=function(){var e=jn((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=jn((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=jn((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=jn((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=jn((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=jn((function*(e){var t=yield WPP.contact.queryExists(e);return t?{id:t.wid,isBusiness:t.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=jn((function*(e){var t=WPP.whatsapp.ChatStore.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=jn((function*(e){var t=WPP.whatsapp.ChatStore.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=jn((function*(e,t){var n=Store.Archive.setArchive(WPP.whatsapp.ChatStore.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=jn((function*(){return yield WPP.whatsapp.State.takeover(),!0})),window.WAPI.onIncomingCall=function(e){return WPP.whatsapp.CallStore.on("add",e),!0},window.WAPI.onInterfaceChange=function(e){var t=()=>({displayInfo:window.Store.Stream.displayInfo,mode:window.Store.Stream.mode,info:window.Store.Stream.info});return e(t()),window.Store.Stream.on("change:info change:displayInfo change:mode",(()=>{e(t())})),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=jn((function*(e,t){return yield WPP.group.setProperty(e,"announcement",t),!0}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=jn((function*(){return yield WPP.auth.logout()})),_n=!1,xn=()=>WPP.whatsapp.State.stream,window.WAPI.onStreamChange=function(e){return WPP.whatsapp.State.on("change:stream",(()=>e(xn()))),_n||(_n=!0,e(xn())),!0},function(){var e=!1,t=()=>WPP.whatsapp.State.state;window.WAPI.onStateChange=function(n){return WPP.whatsapp.State.on("change:state",(()=>n(t()))),e||(e=!0,n(t())),!0}}(),window.WAPI._newMessagesListener=WPP.whatsapp.MsgStore.on("add",(e=>{e&&e.isNewMsg&&!e.isSentByMe&&setTimeout((()=>{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))}),e.body?0:2e3)})),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=>WPP.whatsapp.MsgStore.on("add",(t=>{t&&t.isNewMsg&&setTimeout((()=>{var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)}),t.body?0:2e3)})),window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0},window.WAPI.onAddedToGroup=function(e){return WPP.whatsapp.MsgStore.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());var r,i=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 Pn(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)?Pn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;try{o(n)}catch(e){}}}catch(e){i.e(e)}finally{i.f()}}WPP.chat.on("live_location_start",(e=>{t({type:"enable",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,shareDuration:e.shareDuration})})),WPP.chat.on("live_location_update",(e=>{t({type:"update",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,elapsed:e.elapsed,lastUpdated:e.lastUpdated})})),WPP.chat.on("live_location_end",(e=>{t({type:"disablle",id:e.id.toString(),chat:e.chat.toString()})})),window.WAPI.onLiveLocation=function(){var t,n=(t=function*(t){e.push(t)},function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(e){yn(o,r,i,a,s,"next",e)}function s(e){yn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}()}(),window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){var n=["invite","add","remove","leave","promote","demote"],r=WPP.whatsapp.ChatStore.get(e),i=WPP.whatsapp.GroupMetadataStore.get(e);mn[e]||(mn[e]={},i.participants.forEach((t=>{mn[e][t.id.toString()]={subtype:"add",from:i.owner}})));var o=0;return r.on("change:groupMetadata.participants",(i=>r.on("all",((i,a)=>{var s=a.isGroup,u=a.previewMessage;if(s&&"change"===i&&u&&"gp2"===u.type&&n.includes(u.subtype)){var c=u.subtype,l=u.from,d=u.recipients,f=d[0].toString();mn[e][f]&&mn[e][d[0]].subtype==c||(0==o?o++:(mn[e][f]={subtype:c,from:l},t({by:l.toString(),action:c,who:d}),r.off("all",this),o=0))}})))),!0},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){gn(o,r,i,a,s,"next",e)}function s(e){gn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}(),window.WAPI.onNotificationMessage=function(e){return WPP.whatsapp.MsgStore.on("add",(t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}})),!0},window.WAPI.onPresenceChanged=function(e){return setTimeout((()=>{WPP.whatsapp.ChatStore.map((e=>e.presence.subscribe()))}),1e3),WPP.whatsapp.PresenceStore.on("change:chatstate.type",(t=>{try{var n=WPP.whatsapp.PresenceStore.models.find((e=>e.chatstate===t));if(!n||!n.hasData||!n.chatstate.type)return;var r=WPP.whatsapp.ContactStore.get(n.id),i={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&&(i.isContact=!n.chatstate.deny),n.isGroup&&(i.participants=n.chatstates.models.filter((e=>!!e.type)).map((e=>{var t=WPP.whatsapp.ContactStore.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}}))),e(i)}catch(e){console.log(e)}})),!0})},602:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new O(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===w)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?h:f,u.arg===w)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",w={};function v(){}function y(){}function P(){}var g={};u(g,o,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(_([])));b&&b!==n&&r.call(b,o)&&(g=b);var A=P.prototype=v.prototype=Object.create(g);function W(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(i,o,a,s){var u=l(e[i],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function S(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,S(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 i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):o:(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 O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function _(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],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=P,u(A,"constructor",P),u(P,"constructor",y),y.displayName=u(P,s,"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,P):(e.__proto__=P,u(e,s,"GeneratorFunction")),e.prototype=Object.create(A),e},e.awrap=function(e){return{__await:e}},W(I.prototype),u(I.prototype,a,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new I(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},W(A),u(A,s,"Generator"),u(A,o,(function(){return this})),u(A,"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:O,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.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 i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(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 i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n(602),n(431)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect-team/wppconnect",
3
- "version": "1.12.3",
3
+ "version": "1.12.6",
4
4
  "description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -58,53 +58,53 @@
58
58
  },
59
59
  "homepage": "https://github.com/wppconnect-team/wppconnect#readme",
60
60
  "devDependencies": {
61
- "@babel/core": "^7.16.10",
62
- "@babel/eslint-parser": "^7.16.5",
61
+ "@babel/core": "^7.17.5",
62
+ "@babel/eslint-parser": "^7.17.0",
63
63
  "@babel/eslint-plugin": "^7.16.5",
64
64
  "@babel/preset-env": "^7.16.11",
65
- "@commitlint/cli": "^16.1.0",
66
- "@commitlint/config-conventional": "^16.0.0",
67
- "@commitlint/cz-commitlint": "^16.1.0",
65
+ "@commitlint/cli": "^16.2.1",
66
+ "@commitlint/config-conventional": "^16.2.1",
67
+ "@commitlint/cz-commitlint": "^16.2.1",
68
68
  "@types/atob": "^2.1.2",
69
69
  "@types/mime-types": "^2.1.0",
70
70
  "@types/mocha": "^9.1.0",
71
- "@types/node": "^14.18.9",
71
+ "@types/node": "^14.18.12",
72
72
  "@types/rimraf": "^3.0.0",
73
73
  "@types/sharp": "^0.29.5",
74
74
  "@types/shelljs": "^0.8.11",
75
75
  "@types/tmp": "^0.2.3",
76
- "@types/ws": "^8.2.2",
77
- "@typescript-eslint/eslint-plugin": "^5.10.0",
78
- "@typescript-eslint/parser": "^5.10.0",
76
+ "@types/ws": "^8.2.3",
77
+ "@typescript-eslint/eslint-plugin": "^5.12.1",
78
+ "@typescript-eslint/parser": "^5.12.1",
79
79
  "babel-loader": "^8.2.3",
80
80
  "commitizen": "^4.2.3",
81
81
  "concurrently": "^7.0.0",
82
82
  "conventional-changelog-cli": "^2.2.2",
83
- "copy-webpack-plugin": "^10.2.1",
84
- "eslint": "^8.7.0",
85
- "eslint-config-prettier": "^8.1.0",
83
+ "copy-webpack-plugin": "^10.2.4",
84
+ "eslint": "^8.9.0",
85
+ "eslint-config-prettier": "^8.4.0",
86
86
  "eslint-plugin-prettier": "^4.0.0",
87
87
  "gulp": "^4.0.2",
88
88
  "husky": "^7.0.4",
89
89
  "license-check-and-add": "^4.0.3",
90
- "mocha": "^9.1.4",
90
+ "mocha": "^9.2.1",
91
91
  "prettier": "^2.5.1",
92
92
  "pretty-quick": "^3.1.3",
93
93
  "regenerator-runtime": "^0.13.7",
94
- "release-it": "^14.12.3",
94
+ "release-it": "^14.12.4",
95
95
  "shx": "^0.3.4",
96
- "ts-node": "^10.4.0",
97
- "typedoc": "^0.21.0",
96
+ "ts-node": "^10.5.0",
97
+ "typedoc": "^0.21.10",
98
98
  "typedoc-plugin-pages": "^1.1.0",
99
99
  "typescript": "^4.5.5",
100
- "webpack": "^5.66.0",
101
- "webpack-cli": "^4.9.1"
100
+ "webpack": "^5.69.1",
101
+ "webpack-cli": "^4.9.2"
102
102
  },
103
103
  "dependencies": {
104
- "@wppconnect/wa-js": "^1.1.9",
105
- "@wppconnect/wa-version": "^1.1.27",
104
+ "@wppconnect/wa-js": "^1.1.18",
105
+ "@wppconnect/wa-version": "^1.1.31",
106
106
  "atob": "^2.1.2",
107
- "axios": "^0.25.0",
107
+ "axios": "^0.26.0",
108
108
  "boxen": "^5.1.2",
109
109
  "catch-exit": "^1.1.0",
110
110
  "chalk": "~4.1.2",
@@ -112,9 +112,9 @@
112
112
  "execa": "^5.0.0",
113
113
  "file-type": "~16.5.3",
114
114
  "fsevents": "^2.3.1",
115
- "futoin-hkdf": "^1.4.3",
115
+ "futoin-hkdf": "^1.5.0",
116
116
  "latest-version": "^5.1.0",
117
- "logform": "^2.3.2",
117
+ "logform": "^2.4.0",
118
118
  "lookpath": "^1.2.0",
119
119
  "mime-types": "^2.1.34",
120
120
  "puppeteer": "*",
@@ -126,11 +126,11 @@
126
126
  "reflect-metadata": "^0.1.13",
127
127
  "rimraf": "^3.0.2",
128
128
  "sanitize-filename": "^1.6.3",
129
- "sharp": "^0.29.3",
129
+ "sharp": "^0.30.1",
130
130
  "tmp": "^0.2.1",
131
131
  "tree-kill": "^1.2.2",
132
- "winston": "^3.4.0",
133
- "ws": "^8.4.2"
132
+ "winston": "^3.6.0",
133
+ "ws": "^8.5.0"
134
134
  },
135
135
  "optionalDependencies": {
136
136
  "fsevents": "^2.3.1"