[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Download
/
Senam Line Dance Sidoarjo_files
/
[
Home
]
File: dkCSywiC7Lx.js.download
;/*FB_PKG_DELIM*/ __d("WAWebAddonConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Unified","Pin","Comment","PollVote","Reaction","EventResponse","None"]);c=b("$InternalEnum").Mirrored(["OnlineReceive","HistorySync","Send","SendRevoke","SendRetry","Revoke","DeleteForMe","DeleteWithParent","Hydration","MarkAsRead","SetAck"]);d=Object.freeze({Regular:"Regular",WithRevokes:"WithRevokes",DualEncrypted:"DualEncrypted",DualEncryptedWithMessageTraits:"DualEncryptedWithMessageTraits"});e=Object.freeze({PinInChat:1});f.AddonTableMode=a;f.AddonProcessMode=c;f.AddonProcessorType=d;f.AddonMinimizedType=e}),66); __d("WAWebAddonLogUtils",[],(function(a,b,c,d,e,f){function a(a){return a.some(function(a){return a.status==="rejected"})}f.hasSettledWithError=a}),66); __d("WARandomHex",["WACryptoDependencies","WAHex"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a=new Uint8Array(a);d("WACryptoDependencies").getCrypto().getRandomValues(a);return d("WAHex").toHex(a)}g.randomHex=a}),98); __d("WAWebMsgKeyNewId",["WABinary","WAHex","WARandomHex","WATimeUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(){var a=d("WATimeUtils").unixTime(),b=d("WAWebUserPrefsMeUser").getMeUser().toString(),c=d("WAHex").parseHex(d("WARandomHex").randomHex(16)),e=new(d("WABinary").Binary)();e.writeInt64(a);e.writeString(b);e.writeBuffer(c);return e.readByteArray()};a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=new Uint8Array(yield self.crypto.subtle.digest("SHA-256",h()),0,9);return"3EB0"+d("WAHex").toHex(a)});return function(){return a.apply(this,arguments)}}();g.genMsgKeyUint=h;g.getMsgKeyNewSHA256Id=a}),98); __d("WAWebParseMsgKeyString",["WALogger","WATypeUtils","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["MsgKey error: cannot create MsgKey from ",""]);h=function(){return a};return a}function a(a){if(!a||!d("WATypeUtils").isString(a))throw c("err")("MsgKey fromString error: str is null or not a string");var b=a.split("_"),e=void 0;b.length<3?d("WALogger").WARN(h(),a):b.length===4?b[3]!=="out"&&b[3]!=="in"&&(e=b[3]):b.length===5&&(e=b[4]);return{fromMe:b[0]==="true",remote:b[1],id:b[2],participant:e}}g["default"]=a}),98); __d("WAWebMsgKey",["WALogger","WARandomHex","WAWebMsgKeyNewId","WAWebParseMsgKeyString","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgKeyNewId: ",", message: ",", stack: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-key] generated ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Incorrect Wid MsgKey"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["MsgKey case error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Incorrect Wid MsgKey"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["No matching constructor MsgKey"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unclear constructor MsgKey"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["MsgKey error: id is already a MsgKey"]);o=function(){return a};return a}a=function(){function a(b){b=b;if(!b)throw c("err")("MsgKey error: obj is null/undefined");b.id instanceof a&&(b=b.id,d("WALogger").WARN(o()));var e=!c("isStringNullOrEmpty")(b.id),f=b.from!=null&&b.to!=null&&e;e=b.fromMe!==void 0&&b.remote!=null&&e;var g,h,i,p,q,r,s,t=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(!t)throw c("err")("MsgKey error: me is undefined. Running tests? Call setupGlobalsForTests first.");else if(f&&e){d("WALogger").WARN(n()).devConsole(b);throw c("err")("MsgKey error: unclear which constructor to use")}else if(!f&&!e){d("WALogger").WARN(m()).devConsole(b);throw c("err")("MsgKey error: don't have a matching constructor")}else if(f){f=b;g=f.from;h=f.to;i=f.id;p=f.participant;q=f.selfDir;if(!(g instanceof c("WAWebWid"))||!(h instanceof c("WAWebWid"))||p&&!(p instanceof c("WAWebWid"))){d("WALogger").WARN(l()).devConsole(g,h,p);throw c("err")("MsgKey error: something is not a wid")}f=c("WAWebWid").equals(g,h);q=f?q:void 0;f&&d("WAWebUserPrefsMeUser").isMePrimary(g)?(r=q==="out",s=h):d("WAWebUserPrefsMeUser").isMePrimary(g)?(r=!0,s=h):d("WAWebUserPrefsMeUser").isMePrimary(h)?(r=!1,s=g):f&&(c("WAWebWid").isGroup(g)||c("WAWebWid").isBroadcast(g))?(r=!0,s=g):d("WALogger").WARN(k()).devConsole(g,h,i,t);r!==void 0&&(this.fromMe=r);s&&(this.remote=s);i&&(this.id=i)}else if(e){f=b;r=f.fromMe;s=f.remote;i=f.id;p=f.participant;if(!(s instanceof c("WAWebWid"))||p&&!(p instanceof c("WAWebWid"))){d("WALogger").WARN(j()).devConsole(s,p);throw c("err")("MsgKey error: something is not a wid")}d("WAWebUserPrefsMeUser").isMePrimary(s)&&(q=r===!0?"out":"in");r!==void 0&&(this.fromMe=r);s&&(this.remote=s);i&&(this.id=i)}g=[this.fromMe,this.remote,this.id];q!==void 0&&(this.self=q,g.push(this.self));p!==void 0&&(this.participant=p,g.push(this.participant));this._serialized=g.join("_")}var e=a.prototype;e.toString=function(){return this._serialized};e.clone=function(){return new a({fromMe:this.fromMe,remote:this.remote,id:this.id,participant:this.participant})};e.equals=function(b){return b instanceof a&&this.toString()===b.toString()};a.fromString=function(b){if(b==null)throw c("err")("MsgKey.fromString error: str is null or not a string");return a.from(b)};a.from=function(b){if(b instanceof a)return b;var e;typeof b==="string"?e=c("WAWebParseMsgKeyString")(b):e=b;return new a({fromMe:e.fromMe,remote:d("WAWebWidFactory").createWidFromWidLike(e.remote),id:e.id,participant:e.participant?d("WAWebWidFactory").createWidFromWidLike(e.participant):void 0})};a.newId=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var b=(yield d("WAWebMsgKeyNewId").getMsgKeyNewSHA256Id());d("WALogger").DEV(i(),b);return b}catch(b){d("WALogger").ERROR(h(),b.name,b.message,b.stack).devConsole(b).sendLogs("msg_key: error generating sha256 message key");return a.newId_DEPRECATED()}});function e(){return c.apply(this,arguments)}return e}();a.newId_DEPRECATED=function(){return"3EB0"+d("WARandomHex").randomHex(8)};return a}();g["default"]=a}),98); __d("WAWebAddonDeleteMsgs",["Promise","WALogger","WAWebAddonConstants","WAWebAddonDBTable","WAWebAddonLogUtils","WAWebAddonPerfUtils","WAWebAddonUpdateDataUtils","WAWebMsgKey","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["delete addons finished with errors"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteAddonMsgsByParentKeys for ",": ",""]);j=function(){return a};return a}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e;try{e=(yield (h||(h=b("Promise"))).all(c.map(function(b){return d("WAWebAddonDBTable").addonInternalDBTable.bulkGetByParentMsgKey(a,[b])})).then(function(a){var b;return(b=[]).concat.apply(b,a)}))}catch(a){return}if(e.length===0)return;c=(yield d("WAWebAddonPerfUtils").createAddonQplMarker(d("WAWebAddonPerfUtils").AddonQplMarkerType.UI,{mode:a,type:d("WAWebAddonPerfUtils").AnnotationRequestType.BulkRemoveByParents,size:e.length}));try{yield d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:d("WAWebAddonConstants").AddonProcessMode.DeleteWithParent,tableMode:a},{remove:e}),c==null?void 0:c.success()}catch(b){d("WALogger").WARN(j(),a,b);c==null?void 0:c.fail();throw b}});return l.apply(this,arguments)}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.parentMsgKeys;a=a.map(function(a){return c("WAWebMsgKey").fromString(a)});var e=[];for(var f of d("WAWebAddonConstants").AddonTableMode.members())f!==d("WAWebAddonConstants").AddonTableMode.None&&e.push(k(f,a));a=(yield (h||(h=b("Promise"))).allSettled(e));d("WAWebAddonLogUtils").hasSettledWithError(a)&&d("WALogger").WARN(i()).tags("addons","messaging").sendLogs("deleteAddonMsgsByParentKeys")});return m.apply(this,arguments)}g.deleteAddonMsgsByParentKeys=a}),98); __d("WAWebAddonCrossWindowUtils",[],(function(a,b,c,d,e,f){function g(a){if(a.realType!=null)return a.realType;return a.revokeAddonType!=null?a.revokeAddonType:a.type}function a(a){return a.type===g(a)}function b(a){a=g(a);switch(a){case"pin_message":case"reaction":case"reaction_enc":case"comment":case"event_edit_encrypted":case"event_response":case"poll_update":return!0;case"keep_in_chat":case"unknown":return!1;default:a;return!1}}f.getAddonProcessorType=g;f.isRealAddonType=a;f.isInfraSupportedAddon=b}),66); __d("WAWebAddonEncryptAddonMsgData",["WAWebAddonCrossWindowUtils","WAWebAddonPluginProcessor","WAWebAddonProcessRevokeDataUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a);if(a.type!==b)return a.kind===d("WAWebMsgType").MsgKind.ProtocolAddonRevoke?d("WAWebAddonProcessRevokeDataUtils").protocolRevokeToRevokeMsgData(a):a}function a(a,b){var c=h(a);if(c!=null)return;c=d("WAWebAddonPluginProcessor").getAddonProcessor(a);c=c.convert;var e=c.toDualEncryptedMsgData,f=c.toDualDecryptedMsgData;if(e==null||f==null)return;return{decrypt:function(){return f(a,b)},encrypt:function(){return e(a,b)}}}g.createDualEncryptionHelper=a}),98); __d("WACryptoAesGcm",["WABinary","WACryptoDependencies","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c,d,e){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){f===void 0&&(f=16);b={name:"AES-GCM",iv:k(b),tagLength:f*8};e!=null&&(b.additionalData=k(e));return d("WACryptoDependencies").getCrypto().subtle.encrypt(b,yield j(a),c)});return h.apply(this,arguments)}function c(a,b,c,d,e){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){f===void 0&&(f=16);b={name:"AES-GCM",iv:k(b),tagLength:f*8};e!=null&&(b.additionalData=k(e));return d("WACryptoDependencies").getCrypto().subtle.decrypt(b,yield j(a),c)});return i.apply(this,arguments)}function j(a){return d("WACryptoDependencies").getCrypto().subtle.importKey("raw",a,"AES-GCM",!1,["encrypt","decrypt"])}function k(a){if(a instanceof Uint8Array)return a;if(typeof a==="string"){var b=new(d("WABinary").Binary)();b.writeString(a);return b.readByteArray()}return new Uint8Array(a)}g.gcmEncrypt=a;g.gcmDecrypt=c}),98); __d("WACryptoHkdf",["Promise","WABinary","WACryptoHmac","err"],(function(a,b,c,d,e,f,g){"use strict";var h,i=255*d("WACryptoHmac").SHA256_BYTE_LENGTH;function j(a,e,f){if(f<0||f>i)return(h||(h=b("Promise"))).reject(c("err")("HKDF::expand given bad length "+f));var g,j=Math.ceil(f/d("WACryptoHmac").SHA256_BYTE_LENGTH),k=d("WABinary").Binary.build(e).readByteArray(),l=new(d("WABinary").Binary)(),m=d("WACryptoHmac").encodeKeySha256(a).then(function(a){g=a;return new Uint8Array(0)});e=function(a){m=m.then(function(b){return d("WACryptoHmac").sign(g,d("WABinary").Binary.build(b,k,a).readByteArray())}).then(function(a){a=new Uint8Array(a);l.writeByteArray(a);return a})};for(a=1;a<=j;a++)e(a);return m.then(function(){return l.readBuffer(f)})}function a(a,b,c){return d("WACryptoHmac").extractSha256(null,a).then(function(a){return j(new Uint8Array(a),b,c)})}function e(a,b,c,e){return d("WACryptoHmac").extractSha256(b,a).then(function(a){return j(new Uint8Array(a),c,e)})}g.expand=j;g.extractAndExpand=a;g.extractWithSaltAndExpand=e}),98); __d("WAUseCaseSecret",["$InternalEnum","WABinary","WACryptoHkdf"],(function(a,b,c,d,e,f,g){"use strict";c=b("$InternalEnum")({POLL_VOTE:"Poll Vote",ENC_REACTION:"Enc Reaction",ENC_COMMENT:"Enc Comment",REPORT_TOKEN:"Report Token",EVENT_RESPONSE:"Event Response",EVENT_EDIT_ENCRYPTED:"Event Edit"});var h=32;function a(a){var b=a.messageSecret,c=a.stanzaId,e=a.parentMsgOriginalSender,f=a.modificationSender;a=a.modificationType;c=d("WABinary").Binary.build(c,e,f,a).readBuffer();return d("WACryptoHkdf").extractAndExpand(b instanceof ArrayBuffer?new Uint8Array(b):b,c,h)}g.UseCaseSecretModificationType=c;g.createUseCaseSecret=a}),98); __d("WAWebAddonInfraError",["$InternalEnum","WACustomError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({UnexpectedError:"unexpected_error",NotSupportedFeature:"not_supported_feature",NotSupportedMsgType:"not_supported_msg_type",UnexpectedMsgType:"unexpected_msg_type",InvalidParentMsgKey:"invalid_parent_msg_key",MissingParentMsg:"missing_parent_msg"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){b="errorCode: "+String(b);c!=null&&(b+=" comment: "+c);return a.call(this,b)||this}return b}(d("WACustomError").customError("AddonInfraError"));g.AddonInfraErrorCode=a;g.AddonInfraError=c}),98); __d("WAWebWamEnumDeviceType",[],(function(a,b,c,d,e,f){a=Object.freeze({PRIMARY:1,COMPANION:2});f.DEVICE_TYPE=a}),66); __d("WAWebWamEnumDsmError",[],(function(a,b,c,d,e,f){a=Object.freeze({INVALID_SENDER:1,MISSING_DSM:2,INVALID_DSM:3});f.DSM_ERROR=a}),66); __d("WAWebWamEnumEditType",[],(function(a,b,c,d,e,f){a=Object.freeze({NOT_EDITED:0,EDITED:1,SENDER_REVOKE:2,ADMIN_REVOKE:3,ADMIN_EDIT:4,PIN:5});f.EDIT_TYPE=a}),66); __d("WAWebWamEnumMediaType",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:1,PHOTO:2,VIDEO:3,AUDIO:4,PTT:5,LOCATION:6,CONTACT:7,DOCUMENT:8,URL:9,CALL:10,GIF:11,FUTURE:12,CONTACT_ARRAY:13,LIVE_LOCATION:14,PROFILE_PIC:15,STICKER:16,HSM:17,PRODUCT_IMAGE:18,TEMPLATE:19,MD_APP_STATE:20,MD_HISTORY_SYNC:21,CATALOG_LINK:22,PRODUCT_LINK:23,ORDER:24,LIST:25,LIST_REPLY:26,BUTTON_MESSAGE:27,BUTTON_RESPONSE_MESSAGE:28,PRODUCT_LIST:29,BUTTON_NFM:30,VIEW_ONCE_IMAGE:31,VIEW_ONCE_VIDEO:32,SHOP_STOREFRONT:33,REACTION:34,INTERACTIVE_NFM:35,INTERACTIVE_RESPONSE_NFM:36,POLL_CREATE:37,POLL_VOTE:38,TEXT:39,KEEP:40,UNKEEP:41,INVISIBLE_HELLO:42,MEDIA_EXPRESS_NOTIFY:43,UNDECRYPTED_MEDIA:44,UNDECRYPTED_TEXT:45,UNDECRYPTED_PAY:46,UNDECRYPTED_POLL:47,UNDECRYPTED_REACTION:48,UNDECRYPTED_MEDIA_NOTIFY:49,VIEW_ONCE_AUDIO:50,SCHEDULED_CALL_CREATE:51,SCHEDULED_CALL_CANCEL:52,PUSH_TO_VIDEO:53,PIN_IN_CHAT:54,INTERACTIVE_CAROUSEL:55,COMMENT:56,EPHEMERAL_SYNC_RESPONSE:57,EVENT_CREATE:58,EVENT_RESPOND:59,LOTTIE_STICKER:60,INTERACTIVE_PRODUCT_CAROUSEL:61,INTERACTIVE_PRODUCT:62,MEDIA_ALBUM:63,STICKER_PACK:64,POLL_RESULT_SNAPSHOT:65,MUSIC_ARTWORK:66,RICH_RESPONSE:67});f.MEDIA_TYPE=a}),66); __d("WAWebWamEnumMessageType",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:1,GROUP:2,BROADCAST:3,STATUS:4,CHANNEL:5,INTEROP:6});f.MESSAGE_TYPE=a}),66); __d("WAWebWamEnumRevokeType",[],(function(a,b,c,d,e,f){a=Object.freeze({SENDER:0,ADMIN:1});f.REVOKE_TYPE=a}),66); __d("WAWebMdBadDeviceSentMessageWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDeviceType","WAWebWamEnumDsmError","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumRevokeType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdBadDeviceSentMessage:[2176,{dsmError:[2,d("WAWebWamEnumDsmError").DSM_ERROR],editType:[3,d("WAWebWamEnumEditType").EDIT_TYPE],isLid:[4,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],mediaType:[5,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[6,d("WAWebWamEnumMessageType").MESSAGE_TYPE],peerType:[1,d("WAWebWamEnumDeviceType").DEVICE_TYPE],revokeType:[7,d("WAWebWamEnumRevokeType").REVOKE_TYPE]},[1,1,1],"regular"]},{MdBadDeviceSentMessage:[]});g.MdBadDeviceSentMessageWamEvent=a}),98); __d("WAWebWamEnumE2eFailureReason",[],(function(a,b,c,d,e,f){a=Object.freeze({INVALID_MESSAGE:0,LEGACY_MESSAGE:1,INVALID_VERSION:2,PRE_KEY_MESSAGE_MISSING_PRE_KEY:3,PRE_KEY_MESSAGE_INVALID_KEY:4,UNTRUSTED_IDENTITY:5,NO_SESSION_AVAILABLE:6,PLAINTEXT_BYTE_MISMATCH:7,UNKNOWN_CIPHERTEXT_TYPE:8,UNKNOWN_CIPHERTEXT_VERSION:9,INVALID_PADDING:10,INVALID_PROTOCOL_BUFFER:11,INVALID_NUMBER_OF_MESSAGE_TYPES:12,INVALID_IMAGE_FILE_LENGTH:13,INVALID_IMAGE_FILE_SHA256:14,INVALID_IMAGE_MEDIA_URL:15,INVALID_IMAGE_MEDIA_KEY:16,INVALID_IMAGE_MIME_TYPE:17,UNKNOWN_V2_TAGS:18,INVALID_EDIT_VERSION:19,INVALID_HSM_NAMESPACE:20,INVALID_HSM_ELEMENT:21,UNKNOWN_PROTOCOL_MESSAGE_TYPE:22,DUPLICATE_MESSAGE:23,FINGERPRINT_IDENTITY_MISMATCH:24,FINGERPRINT_VERSION_MISMATCH:25,INVALID_ARGUMENT:26,INVALID_KEY:27,INVALID_KEY_ID:28,INVALID_MAC:29,NO_MEMORY:30,STALE_KEY_EXCHANGE:31,VRF_SIGNATURE_VERIFICATION_FAILED:32,ERROR_MINIMUM_VALUE:33,ERROR_UNKNOWN:34,INVALID_BROADCAST_STANZA_ATTRIBUTE:35,INVALID_LIST_REPLY_MESSAGE:36,INVALID_LIST_REPLY_ROW_IDENTIFIER:37,INVALID_BUTTONS_RESPONSE_MESSAGE:38,INVALID_BUTTONS_RESPONSE_BUTTON_IDENTIFIER:39,INVALID_ORDER_MESSAGE:40,ERROR_CANCELLED:41,FUTURE_MESSAGE:42,INVALID_EMPTY_PROTOBUF_NOT_ALLOWED:43,SELF_SEND:44,INVALID_MEDIA_MIME_TYPE_TEMPLATE_MESSAGE:45,INVALID_MEDIA_ENC_HASH:46,INVALID_IDENTITY:47,PASSTHROUGH:48,NOT_IN_PENDING_DEVICES:49,EDIT_TYPE_AND_PROTOCOL_MISMATCH:50,DECRYPTION_FAILED:51,DESERIALIZE_INVALID_PROTO_FORMAT:52,DESERIALIZE_RATCHET_KEY_BAD_FORMAT:53,DESERIALIZE_PK_INVALID_PROTO_FORMAT:54,DESERIALZE_PK_KEY_BAD_FORMAT:55,TOO_MANY_MESSAGES_IN_FUTURE:56,EMPTY_VERSION_CONTENT_SUFFIX:57,CONTENT_EXCEEDED_EXPECTED_LENGTH:58,GRP_INVALID_PROTO_FORMAT:59,GRP_INVALID_KEY_FORMAT:60,GRP_VERSION_CONTENT_EMPTY:61,GRP_INVALID_VERSION_CONTENT_LENGTH:62,GRP_SENDER_KEY_INVALID_PROTO_FORMAT:63,GRP_SENDER_KEY_PROTO_ERROR:64,GRP_TOO_MANY_MESSAGES_IN_FUTURE:65,MISSING_MESSAGE_SECRET:66,MESSAGE_SECRET_INVALID:67,INVALID_REACTION_TEXT:68,UNSUPPORTED_MESSAGE_TYPE:69,UNSUPPORTED_IN_INTEROP:70,TARGET_MESSAGE_NOT_FOUND:71,STATUS_FROM_HOSTED_DEVICE_UNSUPPORTED:72,GROUP_MESSAGE_FROM_HOSTED_DEVICE_UNSUPPORTED:73,BROADCAST_FROM_HOSTED_DEVICE_UNSUPPORTED:74,LIVE_LOCATION_FROM_HOSTED_DEVICE_UNSUPPORTED:75,MESSAGE_TYPE_MISMATCH:76,ERROR_SESSION_STATE_UNACKED_PKMSG_GET_BASE_KEY:77,ERROR_SIGNAL_MESSAGE_GET_SENDER_RATCHET_KEY:78,ERROR_SESSION_STATE_GET_ROOT_KEY:79,ERROR_SESSION_STATE_GET_SENDER_RATCHET_KEY_PAIR:80,ERROR_SESSION_STATE_SET_SENDER_CHAIN_KEY:81,ERROR_SESSION_STATE_FIND_RECEIVER_CHAIN:82,ERROR_SESSION_RECORD_DESERIALIZE:83,ERROR_SENDER_KEY_STATE_REMOVE_SENDER_MESSAGE_KEY:84,ERROR_EMPTY_PLAINTEXT_DATA:85,ERROR_MAC_LEN_MISMATCH:86,ERROR_INVALID_MAC_LEN:87,ERROR_INVALID_SIGNATURE_LEN:88,ERROR_SENDER_KEY_LOAD_KEY:89,ERROR_FAST_RATCHET_SENDER_KEY_LOAD_KEY:90,ERROR_UNKNOWN_LOAD_KEY:91,ERROR_UNKNOWN_LOAD_SESSION:92,ERROR_SESSION_RECORD_GET_STATE:93,ERROR_SESSION_STATE_GET_SENDER_CHAIN_KEY:94,ERROR_INVALID_KEY_MATEIRAL_DATA_LEN:95,ERROR_SESSION_STATE_GET_SENDER_RATCHET_KEY:96,ERROR_SESSION_STATE_GET_LOCAL_IDENTITY_KEY:97,ERROR_SESSION_STATE_GET_REMOTE_IDENTITY_KEY:98,ERROR_MEDIA_HASH_VERIFICATION_FAILURE:99,ERROR_CIPHERTEXT_TOO_LONG:100,ERROR_THUMBNAIL_HASH_VERIFICATION_FAILURE:101,ERROR_PARENT_CHILD_SENDER_JID_MISMATCH:102,INVALID_EDIT_MESSAGE:103,INVALID_SESSION:104});f.E2E_FAILURE_REASON=a}),66); __d("WAWebHandleMsgError",["$InternalEnum","WACustomError","WAWebMdBadDeviceSentMessageWamEvent","WAWebWamEnumDsmError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){var e;c===d("WAWebWamEnumDsmError").DSM_ERROR.MISSING_DSM?e=a.call(this,"message should be deviceSentMessage")||this:c===d("WAWebWamEnumDsmError").DSM_ERROR.INVALID_SENDER?e=a.call(this,"message should not be deviceSentMessage")||this:c===d("WAWebWamEnumDsmError").DSM_ERROR.INVALID_DSM?e=a.call(this,"invalid deviceSentMessage")||this:e=a.call(this,"unknown deviceSentMessage error")||this;new(d("WAWebMdBadDeviceSentMessageWamEvent").MdBadDeviceSentMessageWamEvent)({peerType:b,dsmError:c}).commit();e.peerType=b;e.dsmError=c;return babelHelpers.assertThisInitialized(e)}return b}((a=d("WACustomError")).customError("DeviceSentMessageError"));e=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("UnknownDeviceMessageError"));f=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c,d){var e;e=a.call(this,typeof b==="string"?b:String(b))||this;e.code=b;e.e2eFailureReason=c;e.sendLogs=(b=d==null?void 0:d.sendLogs)!=null?b:!0;return e}return b}(a.customError("MessageValidationError"));var h=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this,"Received Nack error code "+((c=a)!=null?c:"")+" from Server on message sent")||this;c.ackErrorCode=a;return c}return a}(a.customError("MessageSentAckError"));a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("BizNodeValidationError"));b=b("$InternalEnum")({INVALID_POLL_UPDATE_STANZA:"poll_update_message_stanza_invalid",INVALID_REACTION_STANZA:"reaction_message_stanza_invalid",INVALID_PIN_IN_CHAT_STANZA:"pin_in_chat_message_stanza_invalid",INVALID_COMMENT_STANZA:"comment_message_stanza_invalid",INVALID_EVENT_RESPONSE_STANZA:"event_response_message_stanza_invalid",INVALID_EVENT_EDIT_STANZA:"event_edit_message_stanza_invalid",INVALID_EDIT_STANZA:"edit_message_stanza_invalid",INVALID_NEWSLETTER_EDIT_STANZA:"newsletter_edit_stanza_invalid"});var i=function(b){babelHelpers.inheritsLoose(a,b);function a(a){a=b.call(this,a,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MESSAGE_TYPE_MISMATCH)||this;a.name="MessageProtobufMismatchError";return a}return a}(f),j=function(b){babelHelpers.inheritsLoose(a,b);function a(a){a=b.call(this,"Received "+a.length+" message keys: "+a.join(", "),d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_NUMBER_OF_MESSAGE_TYPES)||this;a.name="MessageProtobufInvalidMessageTypes";return a}return a}(f);g.DeviceSentMessageError=c;g.UnknownDeviceMessageError=e;g.MessageValidationError=f;g.MessageSentAckError=h;g.BizNodeValidationError=a;g.MessageProtobufMismatchErrorCode=b;g.MessageProtobufMismatchError=i;g.MessageProtobufInvalidMessageTypes=j}),98); __d("WAWebWamEnumMessageSecretAllowedType",[],(function(a,b,c,d,e,f){a=Object.freeze({MESSAGE_POLL:0,MESSAGE_EDIT:1,REACTION:2,COMMENT:3,EVENT_RESPONSE:4,MESSAGE_EVENT_EDIT:5,MESSAGE_REPORTING_TOKEN:6});f.MESSAGE_SECRET_ALLOWED_TYPE=a}),66); __d("WAWebWamEnumMessageSecretErrorType",[],(function(a,b,c,d,e,f){a=Object.freeze({MISSING_MESSAGE_SECRET:0,WRONG_LENGTH:1,ENCRYPTION_ERROR:2,DECRYPTION_ERROR:3});f.MESSAGE_SECRET_ERROR_TYPE=a}),66); __d("WAWebMessageSecretErrorsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumMessageSecretAllowedType","WAWebWamEnumMessageSecretErrorType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MessageSecretErrors:[3686,{messageMediaType:[3,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageSecretAllowedList:[1,d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE],messageSecretError:[2,d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE]},[1,1,1],"regular"]},{MessageSecretErrors:[]});g.MessageSecretErrorsWamEvent=a}),98); __d("WAWebAddonEncryptionError",["$InternalEnum","WALogger","WAWebAddonInfraError","WAWebHandleMsgError","WAWebMessageSecretErrorsWamEvent","WAWebMsgType","WAWebWamEnumE2eFailureReason","WAWebWamEnumMediaType","WAWebWamEnumMessageSecretAllowedType","WAWebWamEnumMessageSecretErrorType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DualEncryptionValidationError] missing media type and allowed list value for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parent msg "," secret is not 32 bytes"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["parent msg "," secret is missing"]);j=function(){return a};return a}var k=b("$InternalEnum")({MISSING_MESSAGE_SECRET:"missing_message_secret",WRONG_MESSAGE_SECRET_LENGTH:"wrong_message_secret_length",ENCRYPTION_ERROR:"encryption_error",DECRYPTION_ERROR:"decryption_error"}),l=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){var d="addonType: "+a+", errorCode: "+String(c);d=b.call(this,d,q(c))||this;d.name="DualEncryptionValidationError";m(a,c);return d}return a}(d("WAWebHandleMsgError").MessageValidationError);a=function(a,b){var c=b.messageSecret;if(c==null){d("WALogger").LOG(j(),b.id);throw new l(a,k.MISSING_MESSAGE_SECRET)}if(c.length!==32){d("WALogger").LOG(i(),b.id);throw new l(a,k.WRONG_MESSAGE_SECRET_LENGTH)}return c};function m(a,b){var c=n(a),e=o(a);if(c==null||e==null){d("WALogger").ERROR(h(),a).sendLogs("dual-encryption-validation-error");throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)}new(d("WAWebMessageSecretErrorsWamEvent").MessageSecretErrorsWamEvent)({messageSecretError:p(b),messageMediaType:c,messageSecretAllowedList:e}).commit()}function n(a){switch(a){case d("WAWebMsgType").MsgKind.PollVoteEncrypted:case d("WAWebMsgType").MsgKind.PollVoteDecrypted:return d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_VOTE;case d("WAWebMsgType").MsgKind.ReactionEncrypted:case d("WAWebMsgType").MsgKind.ReactionDecrypted:return d("WAWebWamEnumMediaType").MEDIA_TYPE.REACTION;case d("WAWebMsgType").MsgKind.EventResponseEncrypted:case d("WAWebMsgType").MsgKind.EventResponseDecrypted:return d("WAWebWamEnumMediaType").MEDIA_TYPE.EVENT_RESPOND;case d("WAWebMsgType").MsgKind.EventEditEncrypted:case d("WAWebMsgType").MsgKind.EventEditDecrypted:return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case d("WAWebMsgType").MsgKind.CommentEncrypted:case d("WAWebMsgType").MsgKind.CommentDecrypted:return d("WAWebWamEnumMediaType").MEDIA_TYPE.COMMENT;default:return}}function o(a){switch(a){case d("WAWebMsgType").MsgKind.PollVoteEncrypted:case d("WAWebMsgType").MsgKind.PollVoteDecrypted:return d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL;case d("WAWebMsgType").MsgKind.ReactionEncrypted:case d("WAWebMsgType").MsgKind.ReactionDecrypted:return d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.REACTION;case d("WAWebMsgType").MsgKind.EventResponseEncrypted:case d("WAWebMsgType").MsgKind.EventResponseDecrypted:return d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.EVENT_RESPONSE;case d("WAWebMsgType").MsgKind.EventEditEncrypted:case d("WAWebMsgType").MsgKind.EventEditDecrypted:return d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_EVENT_EDIT;case d("WAWebMsgType").MsgKind.CommentEncrypted:case d("WAWebMsgType").MsgKind.CommentDecrypted:return d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.COMMENT;default:return}}function p(a){switch(a){case k.MISSING_MESSAGE_SECRET:return d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.MISSING_MESSAGE_SECRET;case k.WRONG_MESSAGE_SECRET_LENGTH:return d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.WRONG_LENGTH;case k.ENCRYPTION_ERROR:return d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.ENCRYPTION_ERROR;case k.DECRYPTION_ERROR:return d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.DECRYPTION_ERROR}}function q(a){switch(a){case k.MISSING_MESSAGE_SECRET:return d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MISSING_MESSAGE_SECRET;case k.WRONG_MESSAGE_SECRET_LENGTH:return d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MESSAGE_SECRET_INVALID;case k.ENCRYPTION_ERROR:return d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE;case k.DECRYPTION_ERROR:return d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.DECRYPTION_FAILED}}g.DualEncryptionValidationErrorCode=k;g.DualEncryptionValidationError=l;g.getValidatedMessageSecret=a}),98); __d("WAWebProtobufsCompanionReg.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({UNKNOWN:0,CHROME:1,FIREFOX:2,IE:3,OPERA:4,SAFARI:5,EDGE:6,DESKTOP:7,IPAD:8,ANDROID_TABLET:9,OHANA:10,ALOHA:11,CATALINA:12,TCL_TV:13,IOS_PHONE:14,IOS_CATALYST:15,ANDROID_PHONE:16,ANDROID_AMBIGUOUS:17,WEAR_OS:18,AR_WRIST:19,AR_DEVICE:20,UWP:21,VR:22,CLOUD_API:23,SMARTGLASSES:24});c={};e={};f={};b={};var h={},i={},j={},k={},l={},m={};c.internalSpec={os:[1,(d=d("WAProtoConst")).TYPES.STRING],version:[2,d.TYPES.MESSAGE,f],platformType:[3,d.TYPES.ENUM,a],requireFullSync:[4,d.TYPES.BOOL],historySyncConfig:[5,d.TYPES.MESSAGE,e]};e.internalSpec={fullSyncDaysLimit:[1,d.TYPES.UINT32],fullSyncSizeMbLimit:[2,d.TYPES.UINT32],storageQuotaMb:[3,d.TYPES.UINT32],inlineInitialPayloadInE2EeMsg:[4,d.TYPES.BOOL],recentSyncDaysLimit:[5,d.TYPES.UINT32],supportCallLogHistory:[6,d.TYPES.BOOL],supportBotUserAgentChatHistory:[7,d.TYPES.BOOL],supportCagReactionsAndPolls:[8,d.TYPES.BOOL],supportBizHostedMsg:[9,d.TYPES.BOOL],supportRecentSyncChunkMessageCountTuning:[10,d.TYPES.BOOL],supportHostedGroupMsg:[11,d.TYPES.BOOL],supportFbidBotChatHistory:[12,d.TYPES.BOOL],supportAddOnHistorySyncMigration:[13,d.TYPES.BOOL],supportMessageAssociation:[14,d.TYPES.BOOL]};f.internalSpec={primary:[1,d.TYPES.UINT32],secondary:[2,d.TYPES.UINT32],tertiary:[3,d.TYPES.UINT32],quaternary:[4,d.TYPES.UINT32],quinary:[5,d.TYPES.UINT32]};b.internalSpec={publicKey:[1,d.TYPES.BYTES],deviceType:[2,d.TYPES.ENUM,a],ref:[3,d.TYPES.STRING]};h.internalSpec={hash:[1,d.TYPES.BYTES]};i.internalSpec={companionEphemeralIdentity:[1,d.TYPES.BYTES],commitment:[2,d.TYPES.MESSAGE,h]};j.internalSpec={publicKey:[1,d.TYPES.BYTES],nonce:[2,d.TYPES.BYTES]};k.internalSpec={companionPublicKey:[1,d.TYPES.BYTES],companionIdentityKey:[2,d.TYPES.BYTES],advSecret:[3,d.TYPES.BYTES]};l.internalSpec={encryptedPayload:[1,d.TYPES.BYTES],iv:[2,d.TYPES.BYTES]};m.internalSpec={isChatDbLidMigrated:[1,d.TYPES.BOOL],isSyncdPureLidSession:[2,d.TYPES.BOOL]};g.DeviceProps$PlatformType=a;g.DevicePropsSpec=c;g.DeviceProps$HistorySyncConfigSpec=e;g.DeviceProps$AppVersionSpec=f;g.CompanionEphemeralIdentitySpec=b;g.CompanionCommitmentSpec=h;g.ProloguePayloadSpec=i;g.PrimaryEphemeralIdentitySpec=j;g.PairingRequestSpec=k;g.EncryptedPairingRequestSpec=l;g.ClientPairingPropsSpec=m}),98); __d("WAWebProtobufsMmsRetry.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({GENERAL_ERROR:0,SUCCESS:1,NOT_FOUND:2,DECRYPTION_ERROR:3});c={};e={};c.internalSpec={stanzaId:[1,(f=d("WAProtoConst")).TYPES.STRING],directPath:[2,f.TYPES.STRING],result:[3,f.TYPES.ENUM,a],messageSecret:[4,f.TYPES.BYTES]};e.internalSpec={stanzaId:[1,f.TYPES.STRING]};g.MediaRetryNotification$ResultType=a;g.MediaRetryNotificationSpec=c;g.ServerErrorReceiptSpec=e}),98); __d("WAWebProtobufsProtocol.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({UNKNOWN:0,CHAT_SETTING:1,BIZ_SUPPORTS_FB_HOSTING:2,UNKNOWN_GROUP:3});c={};e={};c.internalSpec={remoteJid:[1,(f=d("WAProtoConst")).TYPES.STRING],fromMe:[2,f.TYPES.BOOL],id:[3,f.TYPES.STRING],participant:[4,f.TYPES.STRING]};e.internalDefaults={trigger:a.UNKNOWN};e.internalSpec={sharingLimited:[1,f.TYPES.BOOL],trigger:[2,f.TYPES.ENUM,a],limitSharingSettingTimestamp:[3,f.TYPES.INT64],initiatedByMe:[4,f.TYPES.BOOL]};g.LimitSharing$Trigger=a;g.MessageKeySpec=c;g.LimitSharingSpec=e}),98); __d("WAWebProtobufsE2E.pb",["$InternalEnum","WAProtoConst","WAWebProtobufsAdv.pb","WAWebProtobufsCompanionReg.pb","WAWebProtobufsMmsRetry.pb","WAWebProtobufsProtocol.pb"],(function(a,b,c,d,e,f,g){var h,i;c=(a=b("$InternalEnum"))({FIRST_PARTY:0,THIRD_PARTY:1,USER_CREATED:2});e=a({MASK_LINKED_DEVICES:0});f=a({UNKNOWN:0,AUDIO:1,VIDEO:2});b=a({CONNECTED:0,MISSED:1,FAILED:2,REJECTED:3,ACCEPTED_ELSEWHERE:4,ONGOING:5,SILENCED_BY_DND:6,SILENCED_UNKNOWN_CALLER:7});var aa=a({REGULAR:0,SCHEDULED_CALL:1,VOICE_CHAT:2}),ba=a({UNKNOWN:0,CANCEL:1}),ca=a({UNKNOWN:0,VOICE:1,VIDEO:2}),da=a({UNKNOWN:0,GOING:1,NOT_GOING:2,MAYBE:3}),ea=a({UNKNOWN_TYPE:0,PIN_FOR_ALL:1,UNPIN_FOR_ALL:2}),fa=a({POLL:0,QUIZ:1}),ga=a({UNKNOWN:0,TEXT:1,IMAGE:2}),ha=a({UNKNOWN:0,DISPLAY_TEXT:1}),ia=a({UNKNOWN:0,RESPONSE:1,NATIVE_FLOW:2}),ja=a({UNKNOWN:0,EMPTY:1,TEXT:2,DOCUMENT:3,IMAGE:4,VIDEO:5,LOCATION:6}),ka=a({UNKNOWN:0,EVENT_EDIT:1,MESSAGE_EDIT:2}),la=a({DEFAULT:0,PARENT:1}),j=a({DEFAULT:0,EXTENSIONS_1:1}),ma=a({UNKNOWN_SURFACE:0,FB:1,IG:2,WA:3}),na=a({UNKNOWN:0,SINGLE_SELECT:1}),oa=a({UNKNOWN:0,SINGLE_SELECT:1,PRODUCT_LIST:2}),pa=a({CATALOG:1}),qa=a({INQUIRY:1,ACCEPTED:2,DECLINED:3}),ra=a({UNKNOWN:0,FBPAY:1,NOVI:2,UPI:3}),sa=a({GREGORIAN:1,SOLAR_HIJRI:2}),ta=a({MONDAY:1,TUESDAY:2,WEDNESDAY:3,THURSDAY:4,FRIDAY:5,SATURDAY:6,SUNDAY:7}),ua=a({REQUEST_SUCCESS:0,REQUEST_TIME_EXPIRED:1,DECLINED_SHARING_HISTORY:2,GENERIC_ERROR:3,ERROR_REQUEST_ON_NON_SMB_PRIMARY:4,ERROR_HOSTED_DEVICE_NOT_CONNECTED:5,ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET:6}),k=a({UPLOAD_STICKER:0,SEND_RECENT_STICKER_BOOTSTRAP:1,GENERATE_LINK_PREVIEW:2,HISTORY_SYNC_ON_DEMAND:3,PLACEHOLDER_MESSAGE_RESEND:4,WAFFLE_LINKING_NONCE_FETCH:5,FULL_HISTORY_SYNC_ON_DEMAND:6,COMPANION_META_NONCE_FETCH:7,COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:8}),va=a({INITIAL_BOOTSTRAP:0,INITIAL_STATUS_V3:1,FULL:2,RECENT:3,PUSH_NAME:4,NON_BLOCKING_DATA:5,ON_DEMAND:6,NO_HISTORY:7}),wa=a({EMPTY:0,NON_EMPTY:1}),xa=a({REVOKE:0,EPHEMERAL_SETTING:3,EPHEMERAL_SYNC_RESPONSE:4,HISTORY_SYNC_NOTIFICATION:5,APP_STATE_SYNC_KEY_SHARE:6,APP_STATE_SYNC_KEY_REQUEST:7,MSG_FANOUT_BACKFILL_REQUEST:8,INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC:9,APP_STATE_FATAL_EXCEPTION_NOTIFICATION:10,SHARE_PHONE_NUMBER:11,MESSAGE_EDIT:14,PEER_DATA_OPERATION_REQUEST_MESSAGE:16,PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:17,REQUEST_WELCOME_MESSAGE:18,BOT_FEEDBACK_MESSAGE:19,MEDIA_NOTIFY_MESSAGE:20,CLOUD_API_THREAD_CONTROL_NOTIFICATION:21,LID_MIGRATION_MAPPING_SYNC:22,REMINDER_MESSAGE:23,BOT_MEMU_ONBOARDING_MESSAGE:24,STATUS_MENTION_MESSAGE:25,STOP_GENERATION_MESSAGE:26,LIMIT_SHARING:27,AI_PSI_METADATA:28,AI_QUERY_FANOUT:29,GROUP_MEMBER_LABEL_CHANGE:30}),ya=a({UNKNOWN:0,CONTROL_PASSED:1,CONTROL_TAKEN:2}),za=a({GENERIC:0}),Aa=a({BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC:1}),Ba=a({BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC:1,BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL:2,BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING:4,BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE:8,BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE:16,BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER:32,BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED:64,BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING:128,BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT:256}),Ca=a({BOT_FEEDBACK_POSITIVE:0,BOT_FEEDBACK_NEGATIVE_GENERIC:1,BOT_FEEDBACK_NEGATIVE_HELPFUL:2,BOT_FEEDBACK_NEGATIVE_INTERESTING:3,BOT_FEEDBACK_NEGATIVE_ACCURATE:4,BOT_FEEDBACK_NEGATIVE_SAFE:5,BOT_FEEDBACK_NEGATIVE_OTHER:6,BOT_FEEDBACK_NEGATIVE_REFUSED:7,BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING:8,BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT:9,BOT_FEEDBACK_NEGATIVE_PERSONALIZED:10,BOT_FEEDBACK_NEGATIVE_CLARITY:11,BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON:12}),Da=a({NONE:0,GIPHY:1,TENOR:2}),l=a({DEFAULT:0,PARENT:1,SUB:2,DEFAULT_SUB:3}),Ea=a({NONE:0,VIDEO:1,PLACEHOLDER:4,IMAGE:5,PAYMENT_LINKS:6,PROFILE:7}),Fa=a({SYSTEM:0,SYSTEM_TEXT:1,FB_SCRIPT:2,SYSTEM_BOLD:6,MORNINGBREEZE_REGULAR:7,CALISTOGA_REGULAR:8,EXO2_EXTRABOLD:9,COURIERPRIME_BOLD:10}),Ga=a({LINK_PREVIEW:0,ORDER:1}),Ha=a({UNKNOWN:0,STATUS_ADD_YOURS:1,STATUS_RESHARE:2}),Ia=a({IMAGE:0,PDF:1}),Ja=a({USER_IMAGE:0,AI_GENERATED:1,AI_MODIFIED:2,RASTERIZED_TEXT_STATUS:3}),Ka=a({IMAGE:0,VIDEO:1,GIF:2,AUDIO:3,TEXT:4,MUSIC_STANDALONE:5}),La=a({NOT_PAIRED_MEDIA:0,SD_VIDEO_PARENT:1,HD_VIDEO_CHILD:2,SD_IMAGE_PARENT:3,HD_IMAGE_CHILD:4}),Ma=a({NONE:0,RESHARED_FROM_MENTION:1,RESHARED_FROM_POST:2}),Na=a({UPDATE:1,UPDATE_CARD:2,LINK_CARD:3}),Oa=a({CTWA:0,CAWC:1}),Pa=a({NONE:0,IMAGE:1,VIDEO:2}),Qa=a({NONE:0,IMAGE:1,VIDEO:2}),m=a({UNKNOWN_PLUGIN:0,REELS:1,SEARCH:2}),Ra=a({UNKNOWN:0,BING:1,GOOGLE:2,SUPPORT:3}),Sa=a({BOT_LINKED_ACCOUNT_TYPE_1P:0}),Ta=a({DEFAULT:0,CAROUSEL:1}),Ua=a({AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN:0,AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE:1,AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF:2}),Va=a({AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT:0,AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD:1,AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD:2,AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING:3,AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER:4,AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT:5}),Wa=a({AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED:0,AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED:1,AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED:2}),Xa=a({AI_RICH_RESPONSE_UNKNOWN:0,AI_RICH_RESPONSE_GRID_IMAGE:1,AI_RICH_RESPONSE_TEXT:2,AI_RICH_RESPONSE_INLINE_IMAGE:3,AI_RICH_RESPONSE_TABLE:4,AI_RICH_RESPONSE_CODE:5,AI_RICH_RESPONSE_DYNAMIC:6,AI_RICH_RESPONSE_MAP:7,AI_RICH_RESPONSE_LATEX:8,AI_RICH_RESPONSE_CONTENT_ITEMS:9}),Ya=a({AI_RICH_RESPONSE_TYPE_UNKNOWN:0,AI_RICH_RESPONSE_TYPE_STANDARD:1}),Za=a({UNKNOWN_TYPE:0,C50:1}),$a=a({FAVICON:1,CHATLIST:2,AISEARCH_NULL_STATE_PAPER_PLANE:3,AISEARCH_NULL_STATE_SUGGESTION:4,AISEARCH_TYPE_AHEAD_SUGGESTION:5,AISEARCH_TYPE_AHEAD_PAPER_PLANE:6,AISEARCH_TYPE_AHEAD_RESULT_CHATLIST:7,AISEARCH_TYPE_AHEAD_RESULT_MESSAGES:8,AIVOICE_SEARCH_BAR:9,AIVOICE_FAVICON:10,AISTUDIO:11,DEEPLINK:12,NOTIFICATION:13,PROFILE_MESSAGE_BUTTON:14,FORWARD:15,APP_SHORTCUT:16,FF_FAMILY:17,AI_TAB:18,AI_HOME:19,AI_DEEPLINK_IMMERSIVE:20,AI_DEEPLINK:21,META_AI_CHAT_SHORTCUT_AI_STUDIO:22,UGC_CHAT_SHORTCUT_AI_STUDIO:23,NEW_CHAT_AI_STUDIO:24}),ab=a({AI_TAB_THREAD:1,AI_HOME_THREAD:2,AI_DEEPLINK_IMMERSIVE_THREAD:3,AI_DEEPLINK_THREAD:4}),bb=a({NONE:0,NULL_STATE:1,TYPEAHEAD:2,USER_INPUT:3,EMU_FLASH:4,EMU_FLASH_FOLLOWUP:5,VOICE:6}),cb=a({CENTER:1,LEFT:2,RIGHT:3}),db=a({ONCE:1,DAILY:2,WEEKLY:3,BIWEEKLY:4,MONTHLY:5}),eb=a({NOTIFY:1,CREATE:2,DELETE:3,UPDATE:4}),fb=a({UNKNOWN_STATUS:0,AVAILABLE:1,QUOTA_EXCEED_LIMIT:2}),gb=a({UNKNOWN_TYPE:0,LLAMA_PROD:1,LLAMA_PROD_PREMIUM:2}),hb=a({UNKNOWN:0,OTHER:1,GOOGLE:2,BING:3}),ib=a({UNKNOWN_PROVIDER:0,OTHER:1,GOOGLE:2,BING:3}),jb=a({UNKNOWN:0,PLANNED:1,EXECUTING:2,FINISHED:3}),kb=a({UNKNOWN:0,PROGRESS_INDICATOR:1,RICH_RESPONSE_HEADING:2,RICH_RESPONSE_NESTED_LIST:3,AI_MEMORY:4,RICH_RESPONSE_THREAD_SURFING:5,RICH_RESPONSE_TABLE:6,RICH_RESPONSE_CODE:7,RICH_RESPONSE_STRUCTURED_RESPONSE:8,RICH_RESPONSE_INLINE_IMAGE:9,WA_IG_1P_PLUGIN_RANKING_CONTROL:10,WA_IG_1P_PLUGIN_RANKING_UPDATE_1:11,WA_IG_1P_PLUGIN_RANKING_UPDATE_2:12,WA_IG_1P_PLUGIN_RANKING_UPDATE_3:13,WA_IG_1P_PLUGIN_RANKING_UPDATE_4:14,WA_IG_1P_PLUGIN_RANKING_UPDATE_5:15,WA_IG_1P_PLUGIN_RANKING_UPDATE_6:16,WA_IG_1P_PLUGIN_RANKING_UPDATE_7:17,WA_IG_1P_PLUGIN_RANKING_UPDATE_8:18,WA_IG_1P_PLUGIN_RANKING_UPDATE_9:19,WA_IG_1P_PLUGIN_RANKING_UPDATE_10:20,RICH_RESPONSE_SUB_HEADING:21,RICH_RESPONSE_GRID_IMAGE:22,AI_STUDIO_UGC_MEMORY:23,RICH_RESPONSE_LATEX:24,RICH_RESPONSE_MAPS:25,RICH_RESPONSE_INLINE_REELS:26,AGENTIC_PLANNING:27,ACCOUNT_LINKING:28,STREAMING_DISAGGREGATION:29,RICH_RESPONSE_GRID_IMAGE_3P:30,RICH_RESPONSE_LATEX_INLINE:31,QUERY_PLAN:32,PROACTIVE_MESSAGE:33,RICH_RESPONSE_UNIFIED_RESPONSE:34,PROMOTION_MESSAGE:35}),lb=a({UNKNOWN_MODE:0,REASONING_MODE:1}),mb=a({UNKNOWN_FEATURE:0,REASONING_FEATURE:1}),nb=a({UNKNOWN:0,IMAGINE:1,MEMU:2,FLASH:3,EDIT:4}),ob=a({UNKNOWN:0,BING:1,GOOGLE:2,SUPPORT:3}),pb=a({UNKNOWN:0,MEDIA_ALBUM:1,BOT_PLUGIN:2,EVENT_COVER_IMAGE:3,STATUS_POLL:4,HD_VIDEO_DUAL_UPLOAD:5,STATUS_EXTERNAL_RESHARE:6,MEDIA_POLL:7,STATUS_ADD_YOURS:8,STATUS_NOTIFICATION:9,HD_IMAGE_DUAL_UPLOAD:10,STICKER_ANNOTATION:11,MOTION_PHOTO:12,STATUS_LINK_ACTION:13,VIEW_ALL_REPLIES:14}),qb=a({STATIC:1,DEPENDENT_ON_PARENT:2}),rb=a({RASTERIZED_LINK_PREVIEW:1,RASTERIZED_LINK_TRUNCATED:2,RASTERIZED_LINK_FULL_URL:3}),sb=a({FULL:1,TALL:2,COMPACT:3}),tb=a({UNKNOWN:0,DEFAULT:1}),ub=a({UNKNOWN:0,CHAT_SETTING:1,ACCOUNT_SETTING:2,BULK_CHANGE:3,BIZ_SUPPORTS_FB_HOSTING:4,UNKNOWN_GROUPS:5}),vb=a({CHANGED_IN_CHAT:0,INITIATED_BY_ME:1,INITIATED_BY_OTHER:2,BIZ_UPGRADE_FB_HOSTING:3}),wb=a({UNKNOWN:0,KEEP_FOR_ALL:1,UNDO_KEEP_FOR_ALL:2});a=a({UNDEFINED:0,LOW:1,MID:2,HIGH:3});var n={},o={},xb={},yb={},zb={},Ab={},p={},Bb={},Cb={},Db={},Eb={},Fb={},Gb={},Hb={},Ib={},Jb={},Kb={},Lb={},Mb={},Nb={},Ob={},Pb={},Qb={},Rb={},Sb={},Tb={},Ub={},q={},r={},Vb={},Wb={},Xb={},Yb={},Zb={},$b={},ac={},bc={},s={},cc={},dc={},ec={},fc={},gc={},t={},u={},v={},w={},x={},hc={},y={},z={},ic={},jc={},kc={},lc={},mc={},nc={},oc={},pc={},qc={},rc={},sc={},tc={},A={},B={},uc={},vc={},wc={},C={},D={},xc={},E={},yc={},zc={},Ac={},Bc={},Cc={},Dc={},F={},Ec={},Fc={},Gc={},Hc={},Ic={},Jc={},Kc={},Lc={},Mc={},Nc={},Oc={},Pc={},Qc={},Rc={},Sc={},Tc={},Uc={},Vc={},Wc={},Xc={},Yc={},Zc={},$c={},G={},ad={},bd={},cd={},dd={},ed={},H={},fd={},gd={},hd={},id={},jd={},kd={},ld={},md={},nd={},I={},od={},J={},pd={},qd={},rd={},K={},sd={},td={},ud={},L={},vd={},M={},wd={},N={},O={},P={},Q={},xd={},R={},yd={},S={},zd={},Ad={},Bd={},Cd={},Dd={},Ed={},Fd={},Gd={},Hd={},Id={},Jd={},Kd={},T={},Ld={},Md={},Nd={},Od={},Pd={},Qd={},Rd={},Sd={},Td={},Ud={},Vd={},Wd={},Xd={},Yd={},Zd={},$d={},ae={},U={},be={},ce={},de={},ee={},fe={},ge={},he={},ie={},je={},ke={},le={},me={},ne={},oe={},pe={},qe={},re={},se={},te={},ue={},ve={},we={},xe={},ye={},ze={},V={},Ae={},Be={},Ce={},De={},W={},Ee={},Fe={},Ge={},He={},Ie={},Je={},Ke={},Le={},Me={},Ne={},Oe={},X={},Pe={},Y={},Qe={},Re={},Se={},Te={},Ue={},Ve={},Z={},We={},Xe={},$={};n.internalSpec={conversation:[1,(h=d("WAProtoConst")).TYPES.STRING],senderKeyDistributionMessage:[2,h.TYPES.MESSAGE,O],imageMessage:[3,h.TYPES.MESSAGE,N],contactMessage:[4,h.TYPES.MESSAGE,M],locationMessage:[5,h.TYPES.MESSAGE,L],extendedTextMessage:[6,h.TYPES.MESSAGE,pd],documentMessage:[7,h.TYPES.MESSAGE,J],audioMessage:[8,h.TYPES.MESSAGE,od],videoMessage:[9,h.TYPES.MESSAGE,I],call:[10,h.TYPES.MESSAGE,nd],chat:[11,h.TYPES.MESSAGE,md],protocolMessage:[12,h.TYPES.MESSAGE,id],contactsArrayMessage:[13,h.TYPES.MESSAGE,Jc],highlyStructuredMessage:[14,h.TYPES.MESSAGE,F],fastRatchetKeySenderKeyDistributionMessage:[15,h.TYPES.MESSAGE,O],sendPaymentMessage:[16,h.TYPES.MESSAGE,Dc],liveLocationMessage:[18,h.TYPES.MESSAGE,yc],requestPaymentMessage:[22,h.TYPES.MESSAGE,Cc],declinePaymentRequestMessage:[23,h.TYPES.MESSAGE,Bc],cancelPaymentRequestMessage:[24,h.TYPES.MESSAGE,Ac],templateMessage:[25,h.TYPES.MESSAGE,C],stickerMessage:[26,h.TYPES.MESSAGE,E],groupInviteMessage:[28,h.TYPES.MESSAGE,fc],templateButtonReplyMessage:[29,h.TYPES.MESSAGE,wc],productMessage:[30,h.TYPES.MESSAGE,B],deviceSentMessage:[31,h.TYPES.MESSAGE,cc],messageContextInfo:[35,h.TYPES.MESSAGE,ze],listMessage:[36,h.TYPES.MESSAGE,nc],viewOnceMessage:[37,h.TYPES.MESSAGE,s],orderMessage:[38,h.TYPES.MESSAGE,A],listResponseMessage:[39,h.TYPES.MESSAGE,lc],ephemeralMessage:[40,h.TYPES.MESSAGE,s],invoiceMessage:[41,h.TYPES.MESSAGE,wd],buttonsMessage:[42,h.TYPES.MESSAGE,Yb],buttonsResponseMessage:[43,h.TYPES.MESSAGE,Xb],paymentInviteMessage:[44,h.TYPES.MESSAGE,zc],interactiveMessage:[45,h.TYPES.MESSAGE,v],reactionMessage:[46,h.TYPES.MESSAGE,Wb],stickerSyncRmrMessage:[47,h.TYPES.MESSAGE,Vb],interactiveResponseMessage:[48,h.TYPES.MESSAGE,gc],pollCreationMessage:[49,h.TYPES.MESSAGE,q],pollUpdateMessage:[50,h.TYPES.MESSAGE,Ub],keepInChatMessage:[51,h.TYPES.MESSAGE,Ob],documentWithCaptionMessage:[53,h.TYPES.MESSAGE,s],requestPhoneNumberMessage:[54,h.TYPES.MESSAGE,dc],viewOnceMessageV2:[55,h.TYPES.MESSAGE,s],encReactionMessage:[56,h.TYPES.MESSAGE,Mb],editedMessage:[58,h.TYPES.MESSAGE,s],viewOnceMessageV2Extension:[59,h.TYPES.MESSAGE,s],pollCreationMessageV2:[60,h.TYPES.MESSAGE,q],scheduledCallCreationMessage:[61,h.TYPES.MESSAGE,Gb],groupMentionedMessage:[62,h.TYPES.MESSAGE,s],pinInChatMessage:[63,h.TYPES.MESSAGE,Nb],pollCreationMessageV3:[64,h.TYPES.MESSAGE,q],scheduledCallEditMessage:[65,h.TYPES.MESSAGE,Fb],ptvMessage:[66,h.TYPES.MESSAGE,I],botInvokeMessage:[67,h.TYPES.MESSAGE,s],callLogMesssage:[69,h.TYPES.MESSAGE,Db],messageHistoryBundle:[70,h.TYPES.MESSAGE,Cb],encCommentMessage:[71,h.TYPES.MESSAGE,Lb],bcallMessage:[72,h.TYPES.MESSAGE,Ab],lottieStickerMessage:[74,h.TYPES.MESSAGE,s],eventMessage:[75,h.TYPES.MESSAGE,Jb],encEventResponseMessage:[76,h.TYPES.MESSAGE,Ib],commentMessage:[77,h.TYPES.MESSAGE,Kb],newsletterAdminInviteMessage:[78,h.TYPES.MESSAGE,ec],placeholderMessage:[80,h.TYPES.MESSAGE,zb],secretEncryptedMessage:[82,h.TYPES.MESSAGE,bc],albumMessage:[83,h.TYPES.MESSAGE,yb],eventCoverImage:[85,h.TYPES.MESSAGE,s],stickerPackMessage:[86,h.TYPES.MESSAGE,o],statusMentionMessage:[87,h.TYPES.MESSAGE,s],pollResultSnapshotMessage:[88,h.TYPES.MESSAGE,Pb],pollCreationOptionImageMessage:[90,h.TYPES.MESSAGE,s],associatedChildMessage:[91,h.TYPES.MESSAGE,s],groupStatusMentionMessage:[92,h.TYPES.MESSAGE,s],pollCreationMessageV4:[93,h.TYPES.MESSAGE,s],pollCreationMessageV5:[94,h.TYPES.MESSAGE,s],statusAddYours:[95,h.TYPES.MESSAGE,s],groupStatusMessage:[96,h.TYPES.MESSAGE,s],richResponseMessage:[97,h.TYPES.MESSAGE,Ld],statusNotificationMessage:[98,h.TYPES.MESSAGE,vd],limitSharingMessage:[99,h.TYPES.MESSAGE,s],botTaskMessage:[100,h.TYPES.MESSAGE,s],questionMessage:[101,h.TYPES.MESSAGE,s],messageHistoryNotice:[102,h.TYPES.MESSAGE,Bb]};o.internalSpec={stickerPackId:[1,h.TYPES.STRING],name:[2,h.TYPES.STRING],publisher:[3,h.TYPES.STRING],stickers:[4,h.FLAGS.REPEATED|h.TYPES.MESSAGE,xb],fileLength:[5,h.TYPES.UINT64],fileSha256:[6,h.TYPES.BYTES],fileEncSha256:[7,h.TYPES.BYTES],mediaKey:[8,h.TYPES.BYTES],directPath:[9,h.TYPES.STRING],caption:[10,h.TYPES.STRING],contextInfo:[11,h.TYPES.MESSAGE,P],packDescription:[12,h.TYPES.STRING],mediaKeyTimestamp:[13,h.TYPES.INT64],trayIconFileName:[14,h.TYPES.STRING],thumbnailDirectPath:[15,h.TYPES.STRING],thumbnailSha256:[16,h.TYPES.BYTES],thumbnailEncSha256:[17,h.TYPES.BYTES],thumbnailHeight:[18,h.TYPES.UINT32],thumbnailWidth:[19,h.TYPES.UINT32],imageDataHash:[20,h.TYPES.STRING],stickerPackSize:[21,h.TYPES.UINT64],stickerPackOrigin:[22,h.TYPES.ENUM,c]};xb.internalSpec={fileName:[1,h.TYPES.STRING],isAnimated:[2,h.TYPES.BOOL],emojis:[3,h.FLAGS.REPEATED|h.TYPES.STRING],accessibilityLabel:[4,h.TYPES.STRING],isLottie:[5,h.TYPES.BOOL],mimetype:[6,h.TYPES.STRING]};yb.internalSpec={expectedImageCount:[2,h.TYPES.UINT32],expectedVideoCount:[3,h.TYPES.UINT32],contextInfo:[17,h.TYPES.MESSAGE,P]};zb.internalSpec={type:[1,h.TYPES.ENUM,e]};Ab.internalSpec={sessionId:[1,h.TYPES.STRING],mediaType:[2,h.TYPES.ENUM,f],masterKey:[3,h.TYPES.BYTES],caption:[4,h.TYPES.STRING]};p.internalSpec={historyReceivers:[1,h.FLAGS.REPEATED|h.TYPES.STRING],firstMessageTimestamp:[2,h.TYPES.INT64],messageCount:[3,h.TYPES.INT64]};Bb.internalSpec={contextInfo:[1,h.TYPES.MESSAGE,P],messageHistoryMetadata:[2,h.TYPES.MESSAGE,p]};Cb.internalSpec={mimetype:[1,h.TYPES.STRING],fileSha256:[2,h.TYPES.BYTES],mediaKey:[3,h.TYPES.BYTES],fileEncSha256:[4,h.TYPES.BYTES],directPath:[5,h.TYPES.STRING],mediaKeyTimestamp:[6,h.TYPES.INT64],contextInfo:[7,h.TYPES.MESSAGE,P],messageHistoryMetadata:[8,h.TYPES.MESSAGE,p]};Db.internalSpec={isVideo:[1,h.TYPES.BOOL],callOutcome:[2,h.TYPES.ENUM,b],durationSecs:[3,h.TYPES.INT64],callType:[4,h.TYPES.ENUM,aa],participants:[5,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Eb]};Eb.internalSpec={jid:[1,h.TYPES.STRING],callOutcome:[2,h.TYPES.ENUM,b]};Fb.internalSpec={key:[1,h.TYPES.MESSAGE,(i=d("WAWebProtobufsProtocol.pb")).MessageKeySpec],editType:[2,h.TYPES.ENUM,ba]};Gb.internalSpec={scheduledTimestampMs:[1,h.TYPES.INT64],callType:[2,h.TYPES.ENUM,ca],title:[3,h.TYPES.STRING]};Hb.internalSpec={response:[1,h.TYPES.ENUM,da],timestampMs:[2,h.TYPES.INT64],extraGuestCount:[3,h.TYPES.INT32]};Ib.internalSpec={eventCreationMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],encPayload:[2,h.TYPES.BYTES],encIv:[3,h.TYPES.BYTES]};Jb.internalSpec={contextInfo:[1,h.TYPES.MESSAGE,P],isCanceled:[2,h.TYPES.BOOL],name:[3,h.TYPES.STRING],description:[4,h.TYPES.STRING],location:[5,h.TYPES.MESSAGE,L],joinLink:[6,h.TYPES.STRING],startTime:[7,h.TYPES.INT64],endTime:[8,h.TYPES.INT64],extraGuestsAllowed:[9,h.TYPES.BOOL],isScheduleCall:[10,h.TYPES.BOOL]};Kb.internalSpec={message:[1,h.TYPES.MESSAGE,n],targetMessageKey:[2,h.TYPES.MESSAGE,i.MessageKeySpec]};Lb.internalSpec={targetMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],encPayload:[2,h.TYPES.BYTES],encIv:[3,h.TYPES.BYTES]};Mb.internalSpec={targetMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],encPayload:[2,h.TYPES.BYTES],encIv:[3,h.TYPES.BYTES]};Nb.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],type:[2,h.TYPES.ENUM,ea],senderTimestampMs:[3,h.TYPES.INT64]};Ob.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],keepType:[2,h.TYPES.ENUM,wb],timestampMs:[3,h.TYPES.INT64]};Pb.internalSpec={name:[1,h.TYPES.STRING],pollVotes:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Qb],contextInfo:[3,h.TYPES.MESSAGE,P]};Qb.internalSpec={optionName:[1,h.TYPES.STRING],optionVoteCount:[2,h.TYPES.INT64]};Rb.internalSpec={selectedOptions:[1,h.FLAGS.REPEATED|h.TYPES.BYTES]};Sb.internalSpec={encPayload:[1,h.TYPES.BYTES],encIv:[2,h.TYPES.BYTES]};Tb.internalSpec={};Ub.internalSpec={pollCreationMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],vote:[2,h.TYPES.MESSAGE,Sb],metadata:[3,h.TYPES.MESSAGE,Tb],senderTimestampMs:[4,h.TYPES.INT64]};q.internalSpec={encKey:[1,h.TYPES.BYTES],name:[2,h.TYPES.STRING],options:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,r],selectableOptionsCount:[4,h.TYPES.UINT32],contextInfo:[5,h.TYPES.MESSAGE,P],pollContentType:[6,h.TYPES.ENUM,ga],pollType:[7,h.TYPES.ENUM,fa],correctAnswer:[8,h.TYPES.MESSAGE,r]};r.internalSpec={optionName:[1,h.TYPES.STRING],optionHash:[2,h.TYPES.STRING]};Vb.internalSpec={filehash:[1,h.FLAGS.REPEATED|h.TYPES.STRING],rmrSource:[2,h.TYPES.STRING],requestTimestamp:[3,h.TYPES.INT64]};Wb.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],text:[2,h.TYPES.STRING],groupingKey:[3,h.TYPES.STRING],senderTimestampMs:[4,h.TYPES.INT64]};Xb.internalSpec={selectedButtonId:[1,h.TYPES.STRING],contextInfo:[3,h.TYPES.MESSAGE,P],type:[4,h.TYPES.ENUM,ha],selectedDisplayText:[2,h.TYPES.STRING],__oneofs__:{response:["selectedDisplayText"]}};Yb.internalSpec={contentText:[6,h.TYPES.STRING],footerText:[7,h.TYPES.STRING],contextInfo:[8,h.TYPES.MESSAGE,P],buttons:[9,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Zb],headerType:[10,h.TYPES.ENUM,ja],text:[1,h.TYPES.STRING],documentMessage:[2,h.TYPES.MESSAGE,J],imageMessage:[3,h.TYPES.MESSAGE,N],videoMessage:[4,h.TYPES.MESSAGE,I],locationMessage:[5,h.TYPES.MESSAGE,L],__oneofs__:{header:["text","documentMessage","imageMessage","videoMessage","locationMessage"]}};Zb.internalSpec={buttonId:[1,h.TYPES.STRING],buttonText:[2,h.TYPES.MESSAGE,ac],type:[3,h.TYPES.ENUM,ia],nativeFlowInfo:[4,h.TYPES.MESSAGE,$b]};$b.internalSpec={name:[1,h.TYPES.STRING],paramsJson:[2,h.TYPES.STRING]};ac.internalSpec={displayText:[1,h.TYPES.STRING]};bc.internalSpec={targetMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],encPayload:[2,h.TYPES.BYTES],encIv:[3,h.TYPES.BYTES],secretEncType:[4,h.TYPES.ENUM,ka]};s.internalSpec={message:[1,h.TYPES.MESSAGE,n]};cc.internalSpec={destinationJid:[1,h.TYPES.STRING],message:[2,h.TYPES.MESSAGE,n],phash:[3,h.TYPES.STRING]};dc.internalSpec={contextInfo:[1,h.TYPES.MESSAGE,P]};ec.internalSpec={newsletterJid:[1,h.TYPES.STRING],newsletterName:[2,h.TYPES.STRING],jpegThumbnail:[3,h.TYPES.BYTES],caption:[4,h.TYPES.STRING],inviteExpiration:[5,h.TYPES.INT64],contextInfo:[6,h.TYPES.MESSAGE,P]};fc.internalSpec={groupJid:[1,h.TYPES.STRING],inviteCode:[2,h.TYPES.STRING],inviteExpiration:[3,h.TYPES.INT64],groupName:[4,h.TYPES.STRING],jpegThumbnail:[5,h.TYPES.BYTES],caption:[6,h.TYPES.STRING],contextInfo:[7,h.TYPES.MESSAGE,P],groupType:[8,h.TYPES.ENUM,la]};gc.internalSpec={body:[1,h.TYPES.MESSAGE,u],contextInfo:[15,h.TYPES.MESSAGE,P],nativeFlowResponseMessage:[2,h.TYPES.MESSAGE,t],__oneofs__:{interactiveResponseMessage:["nativeFlowResponseMessage"]}};t.internalDefaults={version:1};t.internalSpec={name:[1,h.TYPES.STRING],paramsJson:[2,h.TYPES.STRING],version:[3,h.TYPES.INT32]};u.internalDefaults={format:j.DEFAULT};u.internalSpec={text:[1,h.TYPES.STRING],format:[2,h.TYPES.ENUM,j]};v.internalSpec={header:[1,h.TYPES.MESSAGE,kc],body:[2,h.TYPES.MESSAGE,jc],footer:[3,h.TYPES.MESSAGE,ic],contextInfo:[15,h.TYPES.MESSAGE,P],urlTrackingMap:[16,h.TYPES.MESSAGE,Z],shopStorefrontMessage:[4,h.TYPES.MESSAGE,z],collectionMessage:[5,h.TYPES.MESSAGE,y],nativeFlowMessage:[6,h.TYPES.MESSAGE,x],carouselMessage:[7,h.TYPES.MESSAGE,w],__oneofs__:{interactiveMessage:["shopStorefrontMessage","collectionMessage","nativeFlowMessage","carouselMessage"]}};w.internalDefaults={messageVersion:1};w.internalSpec={cards:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,v],messageVersion:[2,h.TYPES.INT32]};x.internalDefaults={messageVersion:1};x.internalSpec={buttons:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,hc],messageParamsJson:[2,h.TYPES.STRING],messageVersion:[3,h.TYPES.INT32]};hc.internalSpec={name:[1,h.TYPES.STRING],buttonParamsJson:[2,h.TYPES.STRING]};y.internalDefaults={messageVersion:1};y.internalSpec={bizJid:[1,h.TYPES.STRING],id:[2,h.TYPES.STRING],messageVersion:[3,h.TYPES.INT32]};z.internalDefaults={messageVersion:1};z.internalSpec={id:[1,h.TYPES.STRING],surface:[2,h.TYPES.ENUM,ma],messageVersion:[3,h.TYPES.INT32]};ic.internalSpec={text:[1,h.TYPES.STRING]};jc.internalSpec={text:[1,h.TYPES.STRING]};kc.internalSpec={title:[1,h.TYPES.STRING],subtitle:[2,h.TYPES.STRING],hasMediaAttachment:[5,h.TYPES.BOOL],documentMessage:[3,h.TYPES.MESSAGE,J],imageMessage:[4,h.TYPES.MESSAGE,N],jpegThumbnail:[6,h.TYPES.BYTES],videoMessage:[7,h.TYPES.MESSAGE,I],locationMessage:[8,h.TYPES.MESSAGE,L],productMessage:[9,h.TYPES.MESSAGE,B],__oneofs__:{media:["documentMessage","imageMessage","jpegThumbnail","videoMessage","locationMessage","productMessage"]}};lc.internalSpec={title:[1,h.TYPES.STRING],listType:[2,h.TYPES.ENUM,na],singleSelectReply:[3,h.TYPES.MESSAGE,mc],contextInfo:[4,h.TYPES.MESSAGE,P],description:[5,h.TYPES.STRING]};mc.internalSpec={selectedRowId:[1,h.TYPES.STRING]};nc.internalSpec={title:[1,h.TYPES.STRING],description:[2,h.TYPES.STRING],buttonText:[3,h.TYPES.STRING],listType:[4,h.TYPES.ENUM,oa],sections:[5,h.FLAGS.REPEATED|h.TYPES.MESSAGE,sc],productListInfo:[6,h.TYPES.MESSAGE,oc],footerText:[7,h.TYPES.STRING],contextInfo:[8,h.TYPES.MESSAGE,P]};oc.internalSpec={productSections:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,qc],headerImage:[2,h.TYPES.MESSAGE,pc],businessOwnerJid:[3,h.TYPES.STRING]};pc.internalSpec={productId:[1,h.TYPES.STRING],jpegThumbnail:[2,h.TYPES.BYTES]};qc.internalSpec={title:[1,h.TYPES.STRING],products:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,rc]};rc.internalSpec={productId:[1,h.TYPES.STRING]};sc.internalSpec={title:[1,h.TYPES.STRING],rows:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,tc]};tc.internalSpec={title:[1,h.TYPES.STRING],description:[2,h.TYPES.STRING],rowId:[3,h.TYPES.STRING]};A.internalDefaults={messageVersion:1};A.internalSpec={orderId:[1,h.TYPES.STRING],thumbnail:[2,h.TYPES.BYTES],itemCount:[3,h.TYPES.INT32],status:[4,h.TYPES.ENUM,qa],surface:[5,h.TYPES.ENUM,pa],message:[6,h.TYPES.STRING],orderTitle:[7,h.TYPES.STRING],sellerJid:[8,h.TYPES.STRING],token:[9,h.TYPES.STRING],totalAmount1000:[10,h.TYPES.INT64],totalCurrencyCode:[11,h.TYPES.STRING],contextInfo:[17,h.TYPES.MESSAGE,P],messageVersion:[12,h.TYPES.INT32],orderRequestMessageId:[13,h.TYPES.MESSAGE,i.MessageKeySpec],catalogType:[15,h.TYPES.STRING]};B.internalSpec={product:[1,h.TYPES.MESSAGE,uc],businessOwnerJid:[2,h.TYPES.STRING],catalog:[4,h.TYPES.MESSAGE,vc],body:[5,h.TYPES.STRING],footer:[6,h.TYPES.STRING],contextInfo:[17,h.TYPES.MESSAGE,P]};uc.internalSpec={productImage:[1,h.TYPES.MESSAGE,N],productId:[2,h.TYPES.STRING],title:[3,h.TYPES.STRING],description:[4,h.TYPES.STRING],currencyCode:[5,h.TYPES.STRING],priceAmount1000:[6,h.TYPES.INT64],retailerId:[7,h.TYPES.STRING],url:[8,h.TYPES.STRING],productImageCount:[9,h.TYPES.UINT32],firstImageId:[11,h.TYPES.STRING],salePriceAmount1000:[12,h.TYPES.INT64],signedUrl:[13,h.TYPES.STRING]};vc.internalSpec={catalogImage:[1,h.TYPES.MESSAGE,N],title:[2,h.TYPES.STRING],description:[3,h.TYPES.STRING]};wc.internalSpec={selectedId:[1,h.TYPES.STRING],selectedDisplayText:[2,h.TYPES.STRING],contextInfo:[3,h.TYPES.MESSAGE,P],selectedIndex:[4,h.TYPES.UINT32],selectedCarouselCardIndex:[5,h.TYPES.UINT32]};C.internalSpec={contextInfo:[3,h.TYPES.MESSAGE,P],hydratedTemplate:[4,h.TYPES.MESSAGE,D],templateId:[9,h.TYPES.STRING],fourRowTemplate:[1,h.TYPES.MESSAGE,xc],hydratedFourRowTemplate:[2,h.TYPES.MESSAGE,D],interactiveMessageTemplate:[5,h.TYPES.MESSAGE,v],__oneofs__:{format:["fourRowTemplate","hydratedFourRowTemplate","interactiveMessageTemplate"]}};D.internalSpec={hydratedContentText:[6,h.TYPES.STRING],hydratedFooterText:[7,h.TYPES.STRING],hydratedButtons:[8,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Ke],templateId:[9,h.TYPES.STRING],maskLinkedDevices:[10,h.TYPES.BOOL],documentMessage:[1,h.TYPES.MESSAGE,J],hydratedTitleText:[2,h.TYPES.STRING],imageMessage:[3,h.TYPES.MESSAGE,N],videoMessage:[4,h.TYPES.MESSAGE,I],locationMessage:[5,h.TYPES.MESSAGE,L],__oneofs__:{title:["documentMessage","hydratedTitleText","imageMessage","videoMessage","locationMessage"]}};xc.internalSpec={content:[6,h.TYPES.MESSAGE,F],footer:[7,h.TYPES.MESSAGE,F],buttons:[8,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Ge],documentMessage:[1,h.TYPES.MESSAGE,J],highlyStructuredMessage:[2,h.TYPES.MESSAGE,F],imageMessage:[3,h.TYPES.MESSAGE,N],videoMessage:[4,h.TYPES.MESSAGE,I],locationMessage:[5,h.TYPES.MESSAGE,L],__oneofs__:{title:["documentMessage","highlyStructuredMessage","imageMessage","videoMessage","locationMessage"]}};E.internalSpec={url:[1,h.TYPES.STRING],fileSha256:[2,h.TYPES.BYTES],fileEncSha256:[3,h.TYPES.BYTES],mediaKey:[4,h.TYPES.BYTES],mimetype:[5,h.TYPES.STRING],height:[6,h.TYPES.UINT32],width:[7,h.TYPES.UINT32],directPath:[8,h.TYPES.STRING],fileLength:[9,h.TYPES.UINT64],mediaKeyTimestamp:[10,h.TYPES.INT64],firstFrameLength:[11,h.TYPES.UINT32],firstFrameSidecar:[12,h.TYPES.BYTES],isAnimated:[13,h.TYPES.BOOL],pngThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P],stickerSentTs:[18,h.TYPES.INT64],isAvatar:[19,h.TYPES.BOOL],isAiSticker:[20,h.TYPES.BOOL],isLottie:[21,h.TYPES.BOOL],accessibilityLabel:[22,h.TYPES.STRING]};yc.internalSpec={degreesLatitude:[1,h.TYPES.DOUBLE],degreesLongitude:[2,h.TYPES.DOUBLE],accuracyInMeters:[3,h.TYPES.UINT32],speedInMps:[4,h.TYPES.FLOAT],degreesClockwiseFromMagneticNorth:[5,h.TYPES.UINT32],caption:[6,h.TYPES.STRING],sequenceNumber:[7,h.TYPES.INT64],timeOffset:[8,h.TYPES.UINT32],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P]};zc.internalSpec={serviceType:[1,h.TYPES.ENUM,ra],expiryTimestamp:[2,h.TYPES.INT64]};Ac.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec]};Bc.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec]};Cc.internalSpec={noteMessage:[4,h.TYPES.MESSAGE,n],currencyCodeIso4217:[1,h.TYPES.STRING],amount1000:[2,h.TYPES.UINT64],requestFrom:[3,h.TYPES.STRING],expiryTimestamp:[5,h.TYPES.INT64],amount:[6,h.TYPES.MESSAGE,Oe],background:[7,h.TYPES.MESSAGE,X]};Dc.internalSpec={noteMessage:[2,h.TYPES.MESSAGE,n],requestMessageKey:[3,h.TYPES.MESSAGE,i.MessageKeySpec],background:[4,h.TYPES.MESSAGE,X]};F.internalSpec={namespace:[1,h.TYPES.STRING],elementName:[2,h.TYPES.STRING],params:[3,h.FLAGS.REPEATED|h.TYPES.STRING],fallbackLg:[4,h.TYPES.STRING],fallbackLc:[5,h.TYPES.STRING],localizableParams:[6,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Ec],deterministicLg:[7,h.TYPES.STRING],deterministicLc:[8,h.TYPES.STRING],hydratedHsm:[9,h.TYPES.MESSAGE,C]};Ec.internalSpec={"default":[1,h.TYPES.STRING],currency:[2,h.TYPES.MESSAGE,Ic],dateTime:[3,h.TYPES.MESSAGE,Fc],__oneofs__:{paramOneof:["currency","dateTime"]}};Fc.internalSpec={component:[1,h.TYPES.MESSAGE,Hc],unixEpoch:[2,h.TYPES.MESSAGE,Gc],__oneofs__:{datetimeOneof:["component","unixEpoch"]}};Gc.internalSpec={timestamp:[1,h.TYPES.INT64]};Hc.internalSpec={dayOfWeek:[1,h.TYPES.ENUM,ta],year:[2,h.TYPES.UINT32],month:[3,h.TYPES.UINT32],dayOfMonth:[4,h.TYPES.UINT32],hour:[5,h.TYPES.UINT32],minute:[6,h.TYPES.UINT32],calendar:[7,h.TYPES.ENUM,sa]};Ic.internalSpec={currencyCode:[1,h.TYPES.STRING],amount1000:[2,h.TYPES.INT64]};Jc.internalSpec={displayName:[1,h.TYPES.STRING],contacts:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,M],contextInfo:[17,h.TYPES.MESSAGE,P]};Kc.internalSpec={securityNotificationEnabled:[1,h.TYPES.BOOL]};Lc.internalSpec={peerDataOperationRequestType:[1,h.TYPES.ENUM,k],stanzaId:[2,h.TYPES.STRING],peerDataOperationResult:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Mc]};Mc.internalSpec={mediaUploadResult:[1,h.TYPES.ENUM,d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType],stickerMessage:[2,h.TYPES.MESSAGE,E],linkPreviewResponse:[3,h.TYPES.MESSAGE,Sc],placeholderMessageResendResponse:[4,h.TYPES.MESSAGE,Rc],waffleNonceFetchRequestResponse:[5,h.TYPES.MESSAGE,Pc],fullHistorySyncOnDemandRequestResponse:[6,h.TYPES.MESSAGE,Qc],companionMetaNonceFetchRequestResponse:[7,h.TYPES.MESSAGE,Oc],syncdSnapshotFatalRecoveryResponse:[8,h.TYPES.MESSAGE,Nc]};Nc.internalSpec={collectionSnapshot:[1,h.TYPES.BYTES],isCompressed:[2,h.TYPES.BOOL]};Oc.internalSpec={nonce:[1,h.TYPES.STRING]};Pc.internalSpec={nonce:[1,h.TYPES.STRING],waEntFbid:[2,h.TYPES.STRING]};Qc.internalSpec={requestMetadata:[1,h.TYPES.MESSAGE,G],responseCode:[2,h.TYPES.ENUM,ua]};Rc.internalSpec={webMessageInfoBytes:[1,h.TYPES.BYTES]};Sc.internalSpec={url:[1,h.TYPES.STRING],title:[2,h.TYPES.STRING],description:[3,h.TYPES.STRING],thumbData:[4,h.TYPES.BYTES],matchText:[6,h.TYPES.STRING],previewType:[7,h.TYPES.STRING],hqThumbnail:[8,h.TYPES.MESSAGE,Tc]};Tc.internalSpec={directPath:[1,h.TYPES.STRING],thumbHash:[2,h.TYPES.STRING],encThumbHash:[3,h.TYPES.STRING],mediaKey:[4,h.TYPES.BYTES],mediaKeyTimestampMs:[5,h.TYPES.INT64],thumbWidth:[6,h.TYPES.INT32],thumbHeight:[7,h.TYPES.INT32]};Uc.internalSpec={peerDataOperationRequestType:[1,h.TYPES.ENUM,k],requestStickerReupload:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,$c],requestUrlPreview:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Zc],historySyncOnDemandRequest:[4,h.TYPES.MESSAGE,Yc],placeholderMessageResendRequest:[5,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Wc],fullHistorySyncOnDemandRequest:[6,h.TYPES.MESSAGE,Xc],syncdCollectionFatalRecoveryRequest:[7,h.TYPES.MESSAGE,Vc]};Vc.internalSpec={collectionName:[1,h.TYPES.STRING],timestamp:[2,h.TYPES.INT64]};Wc.internalSpec={messageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec]};Xc.internalSpec={requestMetadata:[1,h.TYPES.MESSAGE,G],historySyncConfig:[2,h.TYPES.MESSAGE,d("WAWebProtobufsCompanionReg.pb").DeviceProps$HistorySyncConfigSpec]};Yc.internalSpec={chatJid:[1,h.TYPES.STRING],oldestMsgId:[2,h.TYPES.STRING],oldestMsgFromMe:[3,h.TYPES.BOOL],onDemandMsgCount:[4,h.TYPES.INT32],oldestMsgTimestampMs:[5,h.TYPES.INT64],accountLid:[6,h.TYPES.STRING]};Zc.internalSpec={url:[1,h.TYPES.STRING],includeHqThumbnail:[2,h.TYPES.BOOL]};$c.internalSpec={fileSha256:[1,h.TYPES.STRING]};G.internalSpec={requestId:[1,h.TYPES.STRING]};ad.internalSpec={collectionNames:[1,h.FLAGS.REPEATED|h.TYPES.STRING],timestamp:[2,h.TYPES.INT64]};bd.internalSpec={keyIds:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,H]};cd.internalSpec={keys:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,fd]};dd.internalSpec={keyData:[1,h.TYPES.BYTES],fingerprint:[2,h.TYPES.MESSAGE,ed],timestamp:[3,h.TYPES.INT64]};ed.internalSpec={rawId:[1,h.TYPES.UINT32],currentIndex:[2,h.TYPES.UINT32],deviceIndexes:[3,h.FLAGS.REPEATED|h.FLAGS.PACKED|h.TYPES.UINT32]};H.internalSpec={keyId:[1,h.TYPES.BYTES]};fd.internalSpec={keyId:[1,h.TYPES.MESSAGE,H],keyData:[2,h.TYPES.MESSAGE,dd]};gd.internalSpec={fileSha256:[1,h.TYPES.BYTES],fileLength:[2,h.TYPES.UINT64],mediaKey:[3,h.TYPES.BYTES],fileEncSha256:[4,h.TYPES.BYTES],directPath:[5,h.TYPES.STRING],syncType:[6,h.TYPES.ENUM,va],chunkOrder:[7,h.TYPES.UINT32],originalMessageId:[8,h.TYPES.STRING],progress:[9,h.TYPES.UINT32],oldestMsgInChunkTimestampSec:[10,h.TYPES.INT64],initialHistBootstrapInlinePayload:[11,h.TYPES.BYTES],peerDataRequestSessionId:[12,h.TYPES.STRING],fullHistorySyncOnDemandRequestMetadata:[13,h.TYPES.MESSAGE,G],encHandle:[14,h.TYPES.STRING]};hd.internalSpec={localChatState:[1,h.TYPES.ENUM,wa]};id.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],type:[2,h.TYPES.ENUM,xa],ephemeralExpiration:[4,h.TYPES.UINT32],ephemeralSettingTimestamp:[5,h.TYPES.INT64],historySyncNotification:[6,h.TYPES.MESSAGE,gd],appStateSyncKeyShare:[7,h.TYPES.MESSAGE,cd],appStateSyncKeyRequest:[8,h.TYPES.MESSAGE,bd],initialSecurityNotificationSettingSync:[9,h.TYPES.MESSAGE,Kc],appStateFatalExceptionNotification:[10,h.TYPES.MESSAGE,ad],disappearingMode:[11,h.TYPES.MESSAGE,Y],editedMessage:[14,h.TYPES.MESSAGE,n],timestampMs:[15,h.TYPES.INT64],peerDataOperationRequestMessage:[16,h.TYPES.MESSAGE,Uc],peerDataOperationRequestResponseMessage:[17,h.TYPES.MESSAGE,Lc],botFeedbackMessage:[18,h.TYPES.MESSAGE,ld],invokerJid:[19,h.TYPES.STRING],requestWelcomeMessageMetadata:[20,h.TYPES.MESSAGE,hd],mediaNotifyMessage:[21,h.TYPES.MESSAGE,Te],cloudApiThreadControlNotification:[22,h.TYPES.MESSAGE,jd],lidMigrationMappingSyncMessage:[23,h.TYPES.MESSAGE,Ue],limitSharing:[24,h.TYPES.MESSAGE,i.LimitSharingSpec],aiPsiMetadata:[25,h.TYPES.BYTES],aiQueryFanout:[26,h.TYPES.MESSAGE,Xe],memberLabel:[27,h.TYPES.MESSAGE,$]};jd.internalSpec={status:[1,h.TYPES.ENUM,ya],senderNotificationTimestampMs:[2,h.TYPES.INT64],consumerLid:[3,h.TYPES.STRING],consumerPhoneNumber:[4,h.TYPES.STRING],notificationContent:[5,h.TYPES.MESSAGE,kd]};kd.internalSpec={handoffNotificationText:[1,h.TYPES.STRING],extraJson:[2,h.TYPES.STRING]};ld.internalSpec={messageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],kind:[2,h.TYPES.ENUM,Ca],text:[3,h.TYPES.STRING],kindNegative:[4,h.TYPES.UINT64],kindPositive:[5,h.TYPES.UINT64],kindReport:[6,h.TYPES.ENUM,za]};md.internalSpec={displayName:[1,h.TYPES.STRING],id:[2,h.TYPES.STRING]};nd.internalSpec={callKey:[1,h.TYPES.BYTES],conversionSource:[2,h.TYPES.STRING],conversionData:[3,h.TYPES.BYTES],conversionDelaySeconds:[4,h.TYPES.UINT32],ctwaSignals:[5,h.TYPES.STRING],ctwaPayload:[6,h.TYPES.BYTES],contextInfo:[7,h.TYPES.MESSAGE,P]};I.internalSpec={url:[1,h.TYPES.STRING],mimetype:[2,h.TYPES.STRING],fileSha256:[3,h.TYPES.BYTES],fileLength:[4,h.TYPES.UINT64],seconds:[5,h.TYPES.UINT32],mediaKey:[6,h.TYPES.BYTES],caption:[7,h.TYPES.STRING],gifPlayback:[8,h.TYPES.BOOL],height:[9,h.TYPES.UINT32],width:[10,h.TYPES.UINT32],fileEncSha256:[11,h.TYPES.BYTES],interactiveAnnotations:[12,h.FLAGS.REPEATED|h.TYPES.MESSAGE,W],directPath:[13,h.TYPES.STRING],mediaKeyTimestamp:[14,h.TYPES.INT64],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P],streamingSidecar:[18,h.TYPES.BYTES],gifAttribution:[19,h.TYPES.ENUM,Da],viewOnce:[20,h.TYPES.BOOL],thumbnailDirectPath:[21,h.TYPES.STRING],thumbnailSha256:[22,h.TYPES.BYTES],thumbnailEncSha256:[23,h.TYPES.BYTES],staticUrl:[24,h.TYPES.STRING],annotations:[25,h.FLAGS.REPEATED|h.TYPES.MESSAGE,W],accessibilityLabel:[26,h.TYPES.STRING],processedVideos:[27,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Ve],externalShareFullVideoDurationInSeconds:[28,h.TYPES.UINT32]};od.internalSpec={url:[1,h.TYPES.STRING],mimetype:[2,h.TYPES.STRING],fileSha256:[3,h.TYPES.BYTES],fileLength:[4,h.TYPES.UINT64],seconds:[5,h.TYPES.UINT32],ptt:[6,h.TYPES.BOOL],mediaKey:[7,h.TYPES.BYTES],fileEncSha256:[8,h.TYPES.BYTES],directPath:[9,h.TYPES.STRING],mediaKeyTimestamp:[10,h.TYPES.INT64],contextInfo:[17,h.TYPES.MESSAGE,P],streamingSidecar:[18,h.TYPES.BYTES],waveform:[19,h.TYPES.BYTES],backgroundArgb:[20,h.TYPES.FIXED32],viewOnce:[21,h.TYPES.BOOL],accessibilityLabel:[22,h.TYPES.STRING]};J.internalSpec={url:[1,h.TYPES.STRING],mimetype:[2,h.TYPES.STRING],title:[3,h.TYPES.STRING],fileSha256:[4,h.TYPES.BYTES],fileLength:[5,h.TYPES.UINT64],pageCount:[6,h.TYPES.UINT32],mediaKey:[7,h.TYPES.BYTES],fileName:[8,h.TYPES.STRING],fileEncSha256:[9,h.TYPES.BYTES],directPath:[10,h.TYPES.STRING],mediaKeyTimestamp:[11,h.TYPES.INT64],contactVcard:[12,h.TYPES.BOOL],thumbnailDirectPath:[13,h.TYPES.STRING],thumbnailSha256:[14,h.TYPES.BYTES],thumbnailEncSha256:[15,h.TYPES.BYTES],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P],thumbnailHeight:[18,h.TYPES.UINT32],thumbnailWidth:[19,h.TYPES.UINT32],caption:[20,h.TYPES.STRING],accessibilityLabel:[21,h.TYPES.STRING]};pd.internalSpec={text:[1,h.TYPES.STRING],matchedText:[2,h.TYPES.STRING],description:[5,h.TYPES.STRING],title:[6,h.TYPES.STRING],textArgb:[7,h.TYPES.FIXED32],backgroundArgb:[8,h.TYPES.FIXED32],font:[9,h.TYPES.ENUM,Fa],previewType:[10,h.TYPES.ENUM,Ea],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P],doNotPlayInline:[18,h.TYPES.BOOL],thumbnailDirectPath:[19,h.TYPES.STRING],thumbnailSha256:[20,h.TYPES.BYTES],thumbnailEncSha256:[21,h.TYPES.BYTES],mediaKey:[22,h.TYPES.BYTES],mediaKeyTimestamp:[23,h.TYPES.INT64],thumbnailHeight:[24,h.TYPES.UINT32],thumbnailWidth:[25,h.TYPES.UINT32],inviteLinkGroupType:[26,h.TYPES.ENUM,l],inviteLinkParentGroupSubjectV2:[27,h.TYPES.STRING],inviteLinkParentGroupThumbnailV2:[28,h.TYPES.BYTES],inviteLinkGroupTypeV2:[29,h.TYPES.ENUM,l],viewOnce:[30,h.TYPES.BOOL],videoHeight:[31,h.TYPES.UINT32],videoWidth:[32,h.TYPES.UINT32],faviconMMSMetadata:[33,h.TYPES.MESSAGE,ud],linkPreviewMetadata:[34,h.TYPES.MESSAGE,qd],paymentLinkMetadata:[35,h.TYPES.MESSAGE,K]};qd.internalSpec={paymentLinkMetadata:[1,h.TYPES.MESSAGE,K],urlMetadata:[2,h.TYPES.MESSAGE,rd],fbExperimentId:[3,h.TYPES.UINT32]};rd.internalSpec={fbExperimentId:[1,h.TYPES.UINT32]};K.internalSpec={button:[1,h.TYPES.MESSAGE,td],header:[2,h.TYPES.MESSAGE,sd]};sd.internalSpec={headerType:[1,h.TYPES.ENUM,Ga]};td.internalSpec={displayText:[1,h.TYPES.STRING]};ud.internalSpec={thumbnailDirectPath:[1,h.TYPES.STRING],thumbnailSha256:[2,h.TYPES.BYTES],thumbnailEncSha256:[3,h.TYPES.BYTES],mediaKey:[4,h.TYPES.BYTES],mediaKeyTimestamp:[5,h.TYPES.INT64],thumbnailHeight:[6,h.TYPES.UINT32],thumbnailWidth:[7,h.TYPES.UINT32]};L.internalSpec={degreesLatitude:[1,h.TYPES.DOUBLE],degreesLongitude:[2,h.TYPES.DOUBLE],name:[3,h.TYPES.STRING],address:[4,h.TYPES.STRING],url:[5,h.TYPES.STRING],isLive:[6,h.TYPES.BOOL],accuracyInMeters:[7,h.TYPES.UINT32],speedInMps:[8,h.TYPES.FLOAT],degreesClockwiseFromMagneticNorth:[9,h.TYPES.UINT32],comment:[11,h.TYPES.STRING],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P]};vd.internalSpec={responseMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],originalMessageKey:[2,h.TYPES.MESSAGE,i.MessageKeySpec],type:[3,h.TYPES.ENUM,Ha]};M.internalSpec={displayName:[1,h.TYPES.STRING],vcard:[16,h.TYPES.STRING],contextInfo:[17,h.TYPES.MESSAGE,P]};wd.internalSpec={note:[1,h.TYPES.STRING],token:[2,h.TYPES.STRING],attachmentType:[3,h.TYPES.ENUM,Ia],attachmentMimetype:[4,h.TYPES.STRING],attachmentMediaKey:[5,h.TYPES.BYTES],attachmentMediaKeyTimestamp:[6,h.TYPES.INT64],attachmentFileSha256:[7,h.TYPES.BYTES],attachmentFileEncSha256:[8,h.TYPES.BYTES],attachmentDirectPath:[9,h.TYPES.STRING],attachmentJpegThumbnail:[10,h.TYPES.BYTES]};N.internalSpec={url:[1,h.TYPES.STRING],mimetype:[2,h.TYPES.STRING],caption:[3,h.TYPES.STRING],fileSha256:[4,h.TYPES.BYTES],fileLength:[5,h.TYPES.UINT64],height:[6,h.TYPES.UINT32],width:[7,h.TYPES.UINT32],mediaKey:[8,h.TYPES.BYTES],fileEncSha256:[9,h.TYPES.BYTES],interactiveAnnotations:[10,h.FLAGS.REPEATED|h.TYPES.MESSAGE,W],directPath:[11,h.TYPES.STRING],mediaKeyTimestamp:[12,h.TYPES.INT64],jpegThumbnail:[16,h.TYPES.BYTES],contextInfo:[17,h.TYPES.MESSAGE,P],firstScanSidecar:[18,h.TYPES.BYTES],firstScanLength:[19,h.TYPES.UINT32],experimentGroupId:[20,h.TYPES.UINT32],scansSidecar:[21,h.TYPES.BYTES],scanLengths:[22,h.FLAGS.REPEATED|h.TYPES.UINT32],midQualityFileSha256:[23,h.TYPES.BYTES],midQualityFileEncSha256:[24,h.TYPES.BYTES],viewOnce:[25,h.TYPES.BOOL],thumbnailDirectPath:[26,h.TYPES.STRING],thumbnailSha256:[27,h.TYPES.BYTES],thumbnailEncSha256:[28,h.TYPES.BYTES],staticUrl:[29,h.TYPES.STRING],annotations:[30,h.FLAGS.REPEATED|h.TYPES.MESSAGE,W],imageSourceType:[31,h.TYPES.ENUM,Ja],accessibilityLabel:[32,h.TYPES.STRING]};O.internalSpec={groupId:[1,h.TYPES.STRING],axolotlSenderKeyDistributionMessage:[2,h.TYPES.BYTES]};P.internalSpec={stanzaId:[1,h.TYPES.STRING],participant:[2,h.TYPES.STRING],quotedMessage:[3,h.TYPES.MESSAGE,n],remoteJid:[4,h.TYPES.STRING],mentionedJid:[15,h.FLAGS.REPEATED|h.TYPES.STRING],conversionSource:[18,h.TYPES.STRING],conversionData:[19,h.TYPES.BYTES],conversionDelaySeconds:[20,h.TYPES.UINT32],forwardingScore:[21,h.TYPES.UINT32],isForwarded:[22,h.TYPES.BOOL],quotedAd:[23,h.TYPES.MESSAGE,Bd],placeholderKey:[24,h.TYPES.MESSAGE,i.MessageKeySpec],expiration:[25,h.TYPES.UINT32],ephemeralSettingTimestamp:[26,h.TYPES.INT64],ephemeralSharedSecret:[27,h.TYPES.BYTES],externalAdReply:[28,h.TYPES.MESSAGE,Ad],entryPointConversionSource:[29,h.TYPES.STRING],entryPointConversionApp:[30,h.TYPES.STRING],entryPointConversionDelaySeconds:[31,h.TYPES.UINT32],disappearingMode:[32,h.TYPES.MESSAGE,Y],actionLink:[33,h.TYPES.MESSAGE,Qe],groupSubject:[34,h.TYPES.STRING],parentGroupJid:[35,h.TYPES.STRING],trustBannerType:[37,h.TYPES.STRING],trustBannerAction:[38,h.TYPES.UINT32],isSampled:[39,h.TYPES.BOOL],groupMentions:[40,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Re],utm:[41,h.TYPES.MESSAGE,zd],forwardedNewsletterMessageInfo:[43,h.TYPES.MESSAGE,S],businessMessageForwardInfo:[44,h.TYPES.MESSAGE,Cd],smbClientCampaignId:[45,h.TYPES.STRING],smbServerCampaignId:[46,h.TYPES.STRING],dataSharingContext:[47,h.TYPES.MESSAGE,xd],alwaysShowAdAttribution:[48,h.TYPES.BOOL],featureEligibilities:[49,h.TYPES.MESSAGE,Q],entryPointConversionExternalSource:[50,h.TYPES.STRING],entryPointConversionExternalMedium:[51,h.TYPES.STRING],ctwaSignals:[54,h.TYPES.STRING],ctwaPayload:[55,h.TYPES.BYTES],forwardedAiBotMessageInfo:[56,h.TYPES.MESSAGE,yd],statusAttributionType:[57,h.TYPES.ENUM,Ma],urlTrackingMap:[58,h.TYPES.MESSAGE,Z],pairedMediaType:[59,h.TYPES.ENUM,La],rankingVersion:[60,h.TYPES.UINT32],memberLabel:[62,h.TYPES.MESSAGE,$],isQuestion:[63,h.TYPES.BOOL],statusSourceType:[64,h.TYPES.ENUM,Ka]};Q.internalDefaults={cannotBeReactedTo:!1,cannotBeRanked:!1,canRequestFeedback:!1,canBeReshared:!1};Q.internalSpec={cannotBeReactedTo:[1,h.TYPES.BOOL],cannotBeRanked:[2,h.TYPES.BOOL],canRequestFeedback:[3,h.TYPES.BOOL],canBeReshared:[4,h.TYPES.BOOL]};xd.internalSpec={showMmDisclosure:[1,h.TYPES.BOOL],encryptedSignalTokenConsented:[2,h.TYPES.STRING],parameters:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,R]};R.internalSpec={key:[1,h.TYPES.STRING],stringData:[2,h.TYPES.STRING],intData:[3,h.TYPES.INT64],floatData:[4,h.TYPES.FLOAT],contents:[5,h.TYPES.MESSAGE,R]};yd.internalSpec={botName:[1,h.TYPES.STRING],botJid:[2,h.TYPES.STRING],creatorName:[3,h.TYPES.STRING]};S.internalSpec={newsletterJid:[1,h.TYPES.STRING],serverMessageId:[2,h.TYPES.INT32],newsletterName:[3,h.TYPES.STRING],contentType:[4,h.TYPES.ENUM,Na],accessibilityText:[5,h.TYPES.STRING]};zd.internalSpec={utmSource:[1,h.TYPES.STRING],utmCampaign:[2,h.TYPES.STRING]};Ad.internalSpec={title:[1,h.TYPES.STRING],body:[2,h.TYPES.STRING],mediaType:[3,h.TYPES.ENUM,Pa],thumbnailUrl:[4,h.TYPES.STRING],mediaUrl:[5,h.TYPES.STRING],thumbnail:[6,h.TYPES.BYTES],sourceType:[7,h.TYPES.STRING],sourceId:[8,h.TYPES.STRING],sourceUrl:[9,h.TYPES.STRING],containsAutoReply:[10,h.TYPES.BOOL],renderLargerThumbnail:[11,h.TYPES.BOOL],showAdAttribution:[12,h.TYPES.BOOL],ctwaClid:[13,h.TYPES.STRING],ref:[14,h.TYPES.STRING],clickToWhatsappCall:[15,h.TYPES.BOOL],adContextPreviewDismissed:[16,h.TYPES.BOOL],sourceApp:[17,h.TYPES.STRING],automatedGreetingMessageShown:[18,h.TYPES.BOOL],greetingMessageBody:[19,h.TYPES.STRING],ctaPayload:[20,h.TYPES.STRING],disableNudge:[21,h.TYPES.BOOL],originalImageUrl:[22,h.TYPES.STRING],automatedGreetingMessageCtaType:[23,h.TYPES.STRING],wtwaAdFormat:[24,h.TYPES.BOOL],adType:[25,h.TYPES.ENUM,Oa]};Bd.internalSpec={advertiserName:[1,h.TYPES.STRING],mediaType:[2,h.TYPES.ENUM,Qa],jpegThumbnail:[16,h.TYPES.BYTES],caption:[17,h.TYPES.STRING]};Cd.internalSpec={businessOwnerJid:[1,h.TYPES.STRING]};Dd.internalSpec={sentiment:[1,h.TYPES.UINT32],behaviorGraph:[2,h.TYPES.STRING],action:[3,h.TYPES.UINT32],intensity:[4,h.TYPES.UINT32],wordCount:[5,h.TYPES.UINT32]};Ed.internalSpec={provider:[1,h.TYPES.ENUM,Ra],pluginType:[2,h.TYPES.ENUM,m],thumbnailCdnUrl:[3,h.TYPES.STRING],profilePhotoCdnUrl:[4,h.TYPES.STRING],searchProviderUrl:[5,h.TYPES.STRING],referenceIndex:[6,h.TYPES.UINT32],expectedLinksCount:[7,h.TYPES.UINT32],searchQuery:[9,h.TYPES.STRING],parentPluginMessageKey:[10,h.TYPES.MESSAGE,i.MessageKeySpec],deprecatedField:[11,h.TYPES.ENUM,m],parentPluginType:[12,h.TYPES.ENUM,m],faviconCdnUrl:[13,h.TYPES.STRING]};Fd.internalSpec={suggestedPrompts:[1,h.FLAGS.REPEATED|h.TYPES.STRING],selectedPromptIndex:[2,h.TYPES.UINT32],promptSuggestions:[3,h.TYPES.MESSAGE,Gd],selectedPromptId:[4,h.TYPES.STRING]};Gd.internalSpec={suggestions:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Hd]};Hd.internalSpec={prompt:[1,h.TYPES.STRING],promptId:[2,h.TYPES.STRING]};Id.internalSpec={accounts:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Jd],acAuthTokens:[2,h.TYPES.BYTES],acErrorCode:[3,h.TYPES.INT32]};Jd.internalSpec={type:[1,h.TYPES.ENUM,Sa]};Kd.internalSpec={addedFacts:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,T],removedFacts:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,T],disclaimer:[3,h.TYPES.STRING]};T.internalSpec={fact:[1,h.TYPES.STRING],factId:[2,h.TYPES.STRING]};Ld.internalSpec={messageType:[1,h.TYPES.ENUM,Ya],submessages:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Md],unifiedResponse:[3,h.TYPES.MESSAGE,Ud]};Md.internalSpec={messageType:[1,h.TYPES.ENUM,Xa],gridImageMetadata:[2,h.TYPES.MESSAGE,ae],messageText:[3,h.TYPES.STRING],imageMetadata:[4,h.TYPES.MESSAGE,$d],codeMetadata:[5,h.TYPES.MESSAGE,Yd],tableMetadata:[6,h.TYPES.MESSAGE,Wd],dynamicMetadata:[7,h.TYPES.MESSAGE,Vd],latexMetadata:[8,h.TYPES.MESSAGE,Sd],mapMetadata:[9,h.TYPES.MESSAGE,Qd],contentItemsMetadata:[10,h.TYPES.MESSAGE,Nd]};Nd.internalSpec={itemsMetadata:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Od],contentType:[2,h.TYPES.ENUM,Ta]};Od.internalSpec={reelItem:[1,h.TYPES.MESSAGE,Pd],__oneofs__:{aIRichResponseContentItem:["reelItem"]}};Pd.internalSpec={title:[1,h.TYPES.STRING],profileIconUrl:[2,h.TYPES.STRING],thumbnailUrl:[3,h.TYPES.STRING],videoUrl:[4,h.TYPES.STRING]};Qd.internalSpec={centerLatitude:[1,h.TYPES.DOUBLE],centerLongitude:[2,h.TYPES.DOUBLE],latitudeDelta:[3,h.TYPES.DOUBLE],longitudeDelta:[4,h.TYPES.DOUBLE],annotations:[5,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Rd],showInfoList:[6,h.TYPES.BOOL]};Rd.internalSpec={annotationNumber:[1,h.TYPES.UINT32],latitude:[2,h.TYPES.DOUBLE],longitude:[3,h.TYPES.DOUBLE],title:[4,h.TYPES.STRING],body:[5,h.TYPES.STRING]};Sd.internalSpec={text:[1,h.TYPES.STRING],expressions:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Td]};Td.internalSpec={latexExpression:[1,h.TYPES.STRING],url:[2,h.TYPES.STRING],width:[3,h.TYPES.DOUBLE],height:[4,h.TYPES.DOUBLE],fontHeight:[5,h.TYPES.DOUBLE],imageTopPadding:[6,h.TYPES.DOUBLE],imageLeadingPadding:[7,h.TYPES.DOUBLE],imageBottomPadding:[8,h.TYPES.DOUBLE],imageTrailingPadding:[9,h.TYPES.DOUBLE]};Ud.internalSpec={data:[1,h.TYPES.BYTES]};Vd.internalSpec={type:[1,h.TYPES.ENUM,Ua],version:[2,h.TYPES.UINT64],url:[3,h.TYPES.STRING],loopCount:[4,h.TYPES.UINT32]};Wd.internalSpec={rows:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Xd]};Xd.internalSpec={items:[1,h.FLAGS.REPEATED|h.TYPES.STRING],isHeading:[2,h.TYPES.BOOL]};Yd.internalSpec={codeLanguage:[1,h.TYPES.STRING],codeBlocks:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Zd]};Zd.internalSpec={highlightType:[1,h.TYPES.ENUM,Va],codeContent:[2,h.TYPES.STRING]};$d.internalSpec={imageUrl:[1,h.TYPES.MESSAGE,U],imageText:[2,h.TYPES.STRING],alignment:[3,h.TYPES.ENUM,Wa],tapLinkUrl:[4,h.TYPES.STRING]};ae.internalSpec={gridImageUrl:[1,h.TYPES.MESSAGE,U],imageUrls:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,U]};U.internalSpec={imagePreviewUrl:[1,h.TYPES.STRING],imageHighResUrl:[2,h.TYPES.STRING],sourceUrl:[3,h.TYPES.STRING]};be.internalSpec={promotionType:[1,h.TYPES.ENUM,Za],buttonTitle:[2,h.TYPES.STRING]};ce.internalSpec={keywords:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,de]};de.internalSpec={value:[1,h.TYPES.STRING],associatedPrompts:[2,h.FLAGS.REPEATED|h.TYPES.STRING]};ee.internalSpec={destinationId:[1,h.TYPES.STRING],destinationEntryPoint:[2,h.TYPES.ENUM,$a],threadOrigin:[3,h.TYPES.ENUM,ab]};fe.internalSpec={sessionId:[1,h.TYPES.STRING],sessionSource:[2,h.TYPES.ENUM,bb]};ge.internalSpec={fileSha256:[1,h.TYPES.STRING],mediaKey:[2,h.TYPES.STRING],fileEncSha256:[3,h.TYPES.STRING],directPath:[4,h.TYPES.STRING],mediaKeyTimestamp:[5,h.TYPES.INT64],mimetype:[6,h.TYPES.STRING],orientationType:[7,h.TYPES.ENUM,cb]};he.internalSpec={faceImages:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,ge]};ie.internalSpec={requestMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],action:[2,h.TYPES.ENUM,eb],name:[3,h.TYPES.STRING],nextTriggerTimestamp:[4,h.TYPES.UINT64],frequency:[5,h.TYPES.ENUM,db]};je.internalSpec={modelType:[1,h.TYPES.ENUM,gb],premiumModelStatus:[2,h.TYPES.ENUM,fb]};ke.internalSpec={progressDescription:[1,h.TYPES.STRING],stepsMetadata:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,le]};le.internalSpec={statusTitle:[1,h.TYPES.STRING],statusBody:[2,h.TYPES.STRING],sourcesMetadata:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,oe],status:[4,h.TYPES.ENUM,jb],isReasoning:[5,h.TYPES.BOOL],isEnhancedSearch:[6,h.TYPES.BOOL],sections:[7,h.FLAGS.REPEATED|h.TYPES.MESSAGE,me]};me.internalSpec={sectionTitle:[1,h.TYPES.STRING],sectionBody:[2,h.TYPES.STRING],sourcesMetadata:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,ne]};ne.internalSpec={title:[1,h.TYPES.STRING],provider:[2,h.TYPES.ENUM,ib],sourceUrl:[3,h.TYPES.STRING],favIconUrl:[4,h.TYPES.STRING]};oe.internalSpec={sourceTitle:[1,h.TYPES.STRING],provider:[2,h.TYPES.ENUM,hb],sourceUrl:[3,h.TYPES.STRING]};pe.internalSpec={capabilities:[1,h.FLAGS.REPEATED|h.TYPES.ENUM,kb]};qe.internalSpec={mode:[1,h.FLAGS.REPEATED|h.TYPES.ENUM,lb]};re.internalSpec={botFeatureQuotaMetadata:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,se]};se.internalSpec={featureType:[1,h.TYPES.ENUM,mb],remainingQuota:[2,h.TYPES.UINT32],expirationTimestamp:[3,h.TYPES.UINT64]};te.internalSpec={imagineType:[1,h.TYPES.ENUM,nb]};ue.internalSpec={ageCollectionEligible:[1,h.TYPES.BOOL],shouldTriggerAgeCollectionOnClient:[2,h.TYPES.BOOL]};ve.internalSpec={sources:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,we]};we.internalSpec={provider:[1,h.TYPES.ENUM,ob],thumbnailCdnUrl:[2,h.TYPES.STRING],sourceProviderUrl:[3,h.TYPES.STRING],sourceQuery:[4,h.TYPES.STRING],faviconCdnUrl:[5,h.TYPES.STRING],citationNumber:[6,h.TYPES.UINT32]};xe.internalSpec={avatarMetadata:[1,h.TYPES.MESSAGE,Dd],personaId:[2,h.TYPES.STRING],pluginMetadata:[3,h.TYPES.MESSAGE,Ed],suggestedPromptMetadata:[4,h.TYPES.MESSAGE,Fd],invokerJid:[5,h.TYPES.STRING],sessionMetadata:[6,h.TYPES.MESSAGE,fe],memuMetadata:[7,h.TYPES.MESSAGE,he],timezone:[8,h.TYPES.STRING],reminderMetadata:[9,h.TYPES.MESSAGE,ie],modelMetadata:[10,h.TYPES.MESSAGE,je],messageDisclaimerText:[11,h.TYPES.STRING],progressIndicatorMetadata:[12,h.TYPES.MESSAGE,ke],capabilityMetadata:[13,h.TYPES.MESSAGE,pe],imagineMetadata:[14,h.TYPES.MESSAGE,te],memoryMetadata:[15,h.TYPES.MESSAGE,Kd],renderingMetadata:[16,h.TYPES.MESSAGE,ce],botMetricsMetadata:[17,h.TYPES.MESSAGE,ee],botLinkedAccountsMetadata:[18,h.TYPES.MESSAGE,Id],richResponseSourcesMetadata:[19,h.TYPES.MESSAGE,ve],aiConversationContext:[20,h.TYPES.BYTES],botPromotionMessageMetadata:[21,h.TYPES.MESSAGE,be],botModeSelectionMetadata:[22,h.TYPES.MESSAGE,qe],botQuotaMetadata:[23,h.TYPES.MESSAGE,re],botAgeCollectionMetadata:[24,h.TYPES.MESSAGE,ue]};ye.internalSpec={associationType:[1,h.TYPES.ENUM,pb],parentMessageKey:[2,h.TYPES.MESSAGE,i.MessageKeySpec],messageIndex:[3,h.TYPES.INT32]};ze.internalSpec={deviceListMetadata:[1,h.TYPES.MESSAGE,V],deviceListMetadataVersion:[2,h.TYPES.INT32],messageSecret:[3,h.TYPES.BYTES],paddingBytes:[4,h.TYPES.BYTES],messageAddOnDurationInSecs:[5,h.TYPES.UINT32],botMessageSecret:[6,h.TYPES.BYTES],botMetadata:[7,h.TYPES.MESSAGE,xe],reportingTokenVersion:[8,h.TYPES.INT32],messageAddOnExpiryType:[9,h.TYPES.ENUM,qb],messageAssociation:[10,h.TYPES.MESSAGE,ye],capiCreatedGroup:[11,h.TYPES.BOOL],supportPayload:[12,h.TYPES.STRING],limitSharing:[13,h.TYPES.MESSAGE,i.LimitSharingSpec],limitSharingV2:[14,h.TYPES.MESSAGE,i.LimitSharingSpec]};V.internalDefaults={senderAccountType:(d=d("WAWebProtobufsAdv.pb")).ADVEncryptionType.E2EE,receiverAccountType:d.ADVEncryptionType.E2EE};V.internalSpec={senderKeyHash:[1,h.TYPES.BYTES],senderTimestamp:[2,h.TYPES.UINT64],senderKeyIndexes:[3,h.FLAGS.REPEATED|h.FLAGS.PACKED|h.TYPES.UINT32],senderAccountType:[4,h.TYPES.ENUM,d.ADVEncryptionType],receiverAccountType:[5,h.TYPES.ENUM,d.ADVEncryptionType],recipientKeyHash:[8,h.TYPES.BYTES],recipientTimestamp:[9,h.TYPES.UINT64],recipientKeyIndexes:[10,h.FLAGS.REPEATED|h.FLAGS.PACKED|h.TYPES.UINT32]};Ae.internalSpec={stanzaId:[1,h.TYPES.STRING],message:[2,h.TYPES.MESSAGE,n]};Be.internalSpec={musicContentMediaId:[1,h.TYPES.STRING],songId:[2,h.TYPES.STRING],author:[3,h.TYPES.STRING],title:[4,h.TYPES.STRING],artworkDirectPath:[5,h.TYPES.STRING],artworkSha256:[6,h.TYPES.BYTES],artworkEncSha256:[7,h.TYPES.BYTES],artworkMediaKey:[11,h.TYPES.BYTES],artistAttribution:[8,h.TYPES.STRING],countryBlocklist:[9,h.TYPES.BYTES],isExplicit:[10,h.TYPES.BOOL]};Ce.internalSpec={embeddedMessage:[1,h.TYPES.MESSAGE,Ae],embeddedMusic:[2,h.TYPES.MESSAGE,Be],__oneofs__:{content:["embeddedMessage","embeddedMusic"]}};De.internalSpec={title:[1,h.TYPES.STRING],tapUrl:[2,h.TYPES.STRING]};W.internalSpec={polygonVertices:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Ee],shouldSkipConfirmation:[4,h.TYPES.BOOL],embeddedContent:[5,h.TYPES.MESSAGE,Ce],statusLinkType:[8,h.TYPES.ENUM,rb],location:[2,h.TYPES.MESSAGE,Fe],newsletter:[3,h.TYPES.MESSAGE,S],embeddedAction:[6,h.TYPES.BOOL],tapAction:[7,h.TYPES.MESSAGE,De],__oneofs__:{action:["location","newsletter","embeddedAction","tapAction"]}};Ee.internalSpec={xDeprecated:[1,h.TYPES.INT32],yDeprecated:[2,h.TYPES.INT32],x:[3,h.TYPES.DOUBLE],y:[4,h.TYPES.DOUBLE]};Fe.internalSpec={degreesLatitude:[1,h.TYPES.DOUBLE],degreesLongitude:[2,h.TYPES.DOUBLE],name:[3,h.TYPES.STRING]};Ge.internalSpec={index:[4,h.TYPES.UINT32],quickReplyButton:[1,h.TYPES.MESSAGE,Je],urlButton:[2,h.TYPES.MESSAGE,Ie],callButton:[3,h.TYPES.MESSAGE,He],__oneofs__:{button:["quickReplyButton","urlButton","callButton"]}};He.internalSpec={displayText:[1,h.TYPES.MESSAGE,F],phoneNumber:[2,h.TYPES.MESSAGE,F]};Ie.internalSpec={displayText:[1,h.TYPES.MESSAGE,F],url:[2,h.TYPES.MESSAGE,F]};Je.internalSpec={displayText:[1,h.TYPES.MESSAGE,F],id:[2,h.TYPES.STRING]};Ke.internalSpec={index:[4,h.TYPES.UINT32],quickReplyButton:[1,h.TYPES.MESSAGE,Ne],urlButton:[2,h.TYPES.MESSAGE,Me],callButton:[3,h.TYPES.MESSAGE,Le],__oneofs__:{hydratedButton:["quickReplyButton","urlButton","callButton"]}};Le.internalSpec={displayText:[1,h.TYPES.STRING],phoneNumber:[2,h.TYPES.STRING]};Me.internalSpec={displayText:[1,h.TYPES.STRING],url:[2,h.TYPES.STRING],consentedUsersUrl:[3,h.TYPES.STRING],webviewPresentation:[4,h.TYPES.ENUM,sb]};Ne.internalSpec={displayText:[1,h.TYPES.STRING],id:[2,h.TYPES.STRING]};Oe.internalSpec={value:[1,h.TYPES.INT64],offset:[2,h.TYPES.UINT32],currencyCode:[3,h.TYPES.STRING]};X.internalSpec={id:[1,h.TYPES.STRING],fileLength:[2,h.TYPES.UINT64],width:[3,h.TYPES.UINT32],height:[4,h.TYPES.UINT32],mimetype:[5,h.TYPES.STRING],placeholderArgb:[6,h.TYPES.FIXED32],textArgb:[7,h.TYPES.FIXED32],subtextArgb:[8,h.TYPES.FIXED32],mediaData:[9,h.TYPES.MESSAGE,Pe],type:[10,h.TYPES.ENUM,tb]};Pe.internalSpec={mediaKey:[1,h.TYPES.BYTES],mediaKeyTimestamp:[2,h.TYPES.INT64],fileSha256:[3,h.TYPES.BYTES],fileEncSha256:[4,h.TYPES.BYTES],directPath:[5,h.TYPES.STRING]};Y.internalSpec={initiator:[1,h.TYPES.ENUM,vb],trigger:[2,h.TYPES.ENUM,ub],initiatorDeviceJid:[3,h.TYPES.STRING],initiatedByMe:[4,h.TYPES.BOOL]};Qe.internalSpec={url:[1,h.TYPES.STRING],buttonTitle:[2,h.TYPES.STRING]};Re.internalSpec={groupJid:[1,h.TYPES.STRING],groupSubject:[2,h.TYPES.STRING]};Se.internalSpec={version:[1,h.TYPES.SFIXED32],encIv:[2,h.TYPES.BYTES],encPayload:[3,h.TYPES.BYTES]};Te.internalSpec={expressPathUrl:[1,h.TYPES.STRING],fileEncSha256:[2,h.TYPES.BYTES],fileLength:[3,h.TYPES.UINT64]};Ue.internalSpec={encodedMappingPayload:[1,h.TYPES.BYTES]};Ve.internalSpec={directPath:[1,h.TYPES.STRING],fileSha256:[2,h.TYPES.BYTES],height:[3,h.TYPES.UINT32],width:[4,h.TYPES.UINT32],fileLength:[5,h.TYPES.UINT64],bitrate:[6,h.TYPES.UINT32],quality:[7,h.TYPES.ENUM,a],capabilities:[8,h.FLAGS.REPEATED|h.TYPES.STRING]};Z.internalSpec={urlTrackingMapElements:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,We]};We.internalSpec={originalUrl:[1,h.TYPES.STRING],unconsentedUsersUrl:[2,h.TYPES.STRING],consentedUsersUrl:[3,h.TYPES.STRING],cardIndex:[4,h.TYPES.UINT32]};Xe.internalSpec={messageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],message:[2,h.TYPES.MESSAGE,n],timestamp:[3,h.TYPES.INT64]};$.internalSpec={label:[1,h.TYPES.STRING],labelTimestamp:[2,h.TYPES.INT64]};g.Message$StickerPackMessage$StickerPackOrigin=c;g.Message$PlaceholderMessage$PlaceholderType=e;g.Message$BCallMessage$MediaType=f;g.Message$CallLogMessage$CallOutcome=b;g.Message$CallLogMessage$CallType=aa;g.Message$ScheduledCallEditMessage$EditType=ba;g.Message$ScheduledCallCreationMessage$CallType=ca;g.Message$EventResponseMessage$EventResponseType=da;g.Message$PinInChatMessage$Type=ea;g.Message$PollCreationMessage$PollType=fa;g.Message$PollContentType=ga;g.Message$ButtonsResponseMessage$Type=ha;g.Message$ButtonsMessage$Button$Type=ia;g.Message$ButtonsMessage$HeaderType=ja;g.Message$SecretEncryptedMessage$SecretEncType=ka;g.Message$GroupInviteMessage$GroupType=la;g.Message$InteractiveResponseMessage$Body$Format=j;g.Message$InteractiveMessage$ShopMessage$Surface=ma;g.Message$ListResponseMessage$ListType=na;g.Message$ListMessage$ListType=oa;g.Message$OrderMessage$OrderSurface=pa;g.Message$OrderMessage$OrderStatus=qa;g.Message$PaymentInviteMessage$ServiceType=ra;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$CalendarType=sa;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$DayOfWeekType=ta;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$FullHistorySyncOnDemandResponseCode=ua;g.Message$PeerDataOperationRequestType=k;g.Message$HistorySyncNotification$HistorySyncType=va;g.Message$RequestWelcomeMessageMetadata$LocalChatState=wa;g.Message$ProtocolMessage$Type=xa;g.Message$CloudAPIThreadControlNotification$CloudAPIThreadControl=ya;g.Message$BotFeedbackMessage$ReportKind=za;g.Message$BotFeedbackMessage$BotFeedbackKindMultiplePositive=Aa;g.Message$BotFeedbackMessage$BotFeedbackKindMultipleNegative=Ba;g.Message$BotFeedbackMessage$BotFeedbackKind=Ca;g.Message$VideoMessage$Attribution=Da;g.Message$ExtendedTextMessage$InviteLinkGroupType=l;g.Message$ExtendedTextMessage$PreviewType=Ea;g.Message$ExtendedTextMessage$FontType=Fa;g.Message$PaymentLinkMetadata$PaymentLinkHeader$PaymentLinkHeaderType=Ga;g.Message$StatusNotificationMessage$StatusNotificationType=Ha;g.Message$InvoiceMessage$AttachmentType=Ia;g.Message$ImageMessage$ImageSourceType=Ja;g.ContextInfo$StatusSourceType=Ka;g.ContextInfo$PairedMediaType=La;g.ContextInfo$StatusAttributionType=Ma;g.ContextInfo$ForwardedNewsletterMessageInfo$ContentType=Na;g.ContextInfo$ExternalAdReplyInfo$AdType=Oa;g.ContextInfo$ExternalAdReplyInfo$MediaType=Pa;g.ContextInfo$AdReplyInfo$MediaType=Qa;g.BotPluginMetadata$PluginType=m;g.BotPluginMetadata$SearchProvider=Ra;g.BotLinkedAccount$BotLinkedAccountType=Sa;g.AIRichResponseMessage$AIRichResponseContentItemsMetadata$ContentType=Ta;g.AIRichResponseMessage$AIRichResponseDynamicMetadata$AIRichResponseDynamicMetadataType=Ua;g.AIRichResponseMessage$AIRichResponseCodeMetadata$AIRichResponseCodeHighlightType=Va;g.AIRichResponseMessage$AIRichResponseInlineImageMetadata$AIRichResponseImageAlignment=Wa;g.AIRichResponseMessage$AIRichResponseSubMessageType=Xa;g.AIRichResponseMessage$AIRichResponseMessageType=Ya;g.BotPromotionMessageMetadata$BotPromotionType=Za;g.BotMetricsEntryPoint=$a;g.BotMetricsThreadEntryPoint=ab;g.BotSessionSource=bb;g.BotMediaMetadata$OrientationType=cb;g.BotReminderMetadata$ReminderFrequency=db;g.BotReminderMetadata$ReminderAction=eb;g.BotModelMetadata$PremiumModelStatus=fb;g.BotModelMetadata$ModelType=gb;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$BotPlanningSearchSourcesMetadata$BotPlanningSearchSourceProvider=hb;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$BotSearchSourceProvider=ib;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$PlanningStepStatus=jb;g.BotCapabilityMetadata$BotCapabilityType=kb;g.BotModeSelectionMetadata$BotUserSelectionMode=lb;g.BotQuotaMetadata$BotFeatureQuotaMetadata$BotFeatureType=mb;g.BotImagineMetadata$ImagineType=nb;g.BotSourcesMetadata$BotSourceItem$SourceProvider=ob;g.MessageAssociation$AssociationType=pb;g.MessageContextInfo$MessageAddonExpiryType=qb;g.InteractiveAnnotation$StatusLinkType=rb;g.HydratedTemplateButton$HydratedURLButton$WebviewPresentationType=sb;g.PaymentBackground$Type=tb;g.DisappearingMode$Trigger=ub;g.DisappearingMode$Initiator=vb;g.KeepType=wb;g.ProcessedVideo$VideoQuality=a;g.MessageSpec=n;g.Message$StickerPackMessageSpec=o;g.Message$StickerPackMessage$StickerSpec=xb;g.Message$AlbumMessageSpec=yb;g.Message$PlaceholderMessageSpec=zb;g.Message$BCallMessageSpec=Ab;g.Message$MessageHistoryMetadataSpec=p;g.Message$MessageHistoryNoticeSpec=Bb;g.Message$MessageHistoryBundleSpec=Cb;g.Message$CallLogMessageSpec=Db;g.Message$CallLogMessage$CallParticipantSpec=Eb;g.Message$ScheduledCallEditMessageSpec=Fb;g.Message$ScheduledCallCreationMessageSpec=Gb;g.Message$EventResponseMessageSpec=Hb;g.Message$EncEventResponseMessageSpec=Ib;g.Message$EventMessageSpec=Jb;g.Message$CommentMessageSpec=Kb;g.Message$EncCommentMessageSpec=Lb;g.Message$EncReactionMessageSpec=Mb;g.Message$PinInChatMessageSpec=Nb;g.Message$KeepInChatMessageSpec=Ob;g.Message$PollResultSnapshotMessageSpec=Pb;g.Message$PollResultSnapshotMessage$PollVoteSpec=Qb;g.Message$PollVoteMessageSpec=Rb;g.Message$PollEncValueSpec=Sb;g.Message$PollUpdateMessageMetadataSpec=Tb;g.Message$PollUpdateMessageSpec=Ub;g.Message$PollCreationMessageSpec=q;g.Message$PollCreationMessage$OptionSpec=r;g.Message$StickerSyncRMRMessageSpec=Vb;g.Message$ReactionMessageSpec=Wb;g.Message$ButtonsResponseMessageSpec=Xb;g.Message$ButtonsMessageSpec=Yb;g.Message$ButtonsMessage$ButtonSpec=Zb;g.Message$ButtonsMessage$Button$NativeFlowInfoSpec=$b;g.Message$ButtonsMessage$Button$ButtonTextSpec=ac;g.Message$SecretEncryptedMessageSpec=bc;g.Message$FutureProofMessageSpec=s;g.Message$DeviceSentMessageSpec=cc;g.Message$RequestPhoneNumberMessageSpec=dc;g.Message$NewsletterAdminInviteMessageSpec=ec;g.Message$GroupInviteMessageSpec=fc;g.Message$InteractiveResponseMessageSpec=gc;g.Message$InteractiveResponseMessage$NativeFlowResponseMessageSpec=t;g.Message$InteractiveResponseMessage$BodySpec=u;g.Message$InteractiveMessageSpec=v;g.Message$InteractiveMessage$CarouselMessageSpec=w;g.Message$InteractiveMessage$NativeFlowMessageSpec=x;g.Message$InteractiveMessage$NativeFlowMessage$NativeFlowButtonSpec=hc;g.Message$InteractiveMessage$CollectionMessageSpec=y;g.Message$InteractiveMessage$ShopMessageSpec=z;g.Message$InteractiveMessage$FooterSpec=ic;g.Message$InteractiveMessage$BodySpec=jc;g.Message$InteractiveMessage$HeaderSpec=kc;g.Message$ListResponseMessageSpec=lc;g.Message$ListResponseMessage$SingleSelectReplySpec=mc;g.Message$ListMessageSpec=nc;g.Message$ListMessage$ProductListInfoSpec=oc;g.Message$ListMessage$ProductListHeaderImageSpec=pc;g.Message$ListMessage$ProductSectionSpec=qc;g.Message$ListMessage$ProductSpec=rc;g.Message$ListMessage$SectionSpec=sc;g.Message$ListMessage$RowSpec=tc;g.Message$OrderMessageSpec=A;g.Message$ProductMessageSpec=B;g.Message$ProductMessage$ProductSnapshotSpec=uc;g.Message$ProductMessage$CatalogSnapshotSpec=vc;g.Message$TemplateButtonReplyMessageSpec=wc;g.Message$TemplateMessageSpec=C;g.Message$TemplateMessage$HydratedFourRowTemplateSpec=D;g.Message$TemplateMessage$FourRowTemplateSpec=xc;g.Message$StickerMessageSpec=E;g.Message$LiveLocationMessageSpec=yc;g.Message$PaymentInviteMessageSpec=zc;g.Message$CancelPaymentRequestMessageSpec=Ac;g.Message$DeclinePaymentRequestMessageSpec=Bc;g.Message$RequestPaymentMessageSpec=Cc;g.Message$SendPaymentMessageSpec=Dc;g.Message$HighlyStructuredMessageSpec=F;g.Message$HighlyStructuredMessage$HSMLocalizableParameterSpec=Ec;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTimeSpec=Fc;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeUnixEpochSpec=Gc;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponentSpec=Hc;g.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMCurrencySpec=Ic;g.Message$ContactsArrayMessageSpec=Jc;g.Message$InitialSecurityNotificationSettingSyncSpec=Kc;g.Message$PeerDataOperationRequestResponseMessageSpec=Lc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResultSpec=Mc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$SyncDSnapshotFatalRecoveryResponseSpec=Nc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$CompanionMetaNonceFetchResponseSpec=Oc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$WaffleNonceFetchResponseSpec=Pc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$FullHistorySyncOnDemandRequestResponseSpec=Qc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$PlaceholderMessageResendResponseSpec=Rc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$LinkPreviewResponseSpec=Sc;g.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$LinkPreviewResponse$LinkPreviewHighQualityThumbnailSpec=Tc;g.Message$PeerDataOperationRequestMessageSpec=Uc;g.Message$PeerDataOperationRequestMessage$SyncDCollectionFatalRecoveryRequestSpec=Vc;g.Message$PeerDataOperationRequestMessage$PlaceholderMessageResendRequestSpec=Wc;g.Message$PeerDataOperationRequestMessage$FullHistorySyncOnDemandRequestSpec=Xc;g.Message$PeerDataOperationRequestMessage$HistorySyncOnDemandRequestSpec=Yc;g.Message$PeerDataOperationRequestMessage$RequestUrlPreviewSpec=Zc;g.Message$PeerDataOperationRequestMessage$RequestStickerReuploadSpec=$c;g.Message$FullHistorySyncOnDemandRequestMetadataSpec=G;g.Message$AppStateFatalExceptionNotificationSpec=ad;g.Message$AppStateSyncKeyRequestSpec=bd;g.Message$AppStateSyncKeyShareSpec=cd;g.Message$AppStateSyncKeyDataSpec=dd;g.Message$AppStateSyncKeyFingerprintSpec=ed;g.Message$AppStateSyncKeyIdSpec=H;g.Message$AppStateSyncKeySpec=fd;g.Message$HistorySyncNotificationSpec=gd;g.Message$RequestWelcomeMessageMetadataSpec=hd;g.Message$ProtocolMessageSpec=id;g.Message$CloudAPIThreadControlNotificationSpec=jd;g.Message$CloudAPIThreadControlNotification$CloudAPIThreadControlNotificationContentSpec=kd;g.Message$BotFeedbackMessageSpec=ld;g.Message$ChatSpec=md;g.Message$CallSpec=nd;g.Message$VideoMessageSpec=I;g.Message$AudioMessageSpec=od;g.Message$DocumentMessageSpec=J;g.Message$ExtendedTextMessageSpec=pd;g.Message$LinkPreviewMetadataSpec=qd;g.Message$URLMetadataSpec=rd;g.Message$PaymentLinkMetadataSpec=K;g.Message$PaymentLinkMetadata$PaymentLinkHeaderSpec=sd;g.Message$PaymentLinkMetadata$PaymentLinkButtonSpec=td;g.Message$MMSThumbnailMetadataSpec=ud;g.Message$LocationMessageSpec=L;g.Message$StatusNotificationMessageSpec=vd;g.Message$ContactMessageSpec=M;g.Message$InvoiceMessageSpec=wd;g.Message$ImageMessageSpec=N;g.Message$SenderKeyDistributionMessageSpec=O;g.ContextInfoSpec=P;g.ContextInfo$FeatureEligibilitiesSpec=Q;g.ContextInfo$DataSharingContextSpec=xd;g.ContextInfo$DataSharingContext$ParametersSpec=R;g.ContextInfo$ForwardedAIBotMessageInfoSpec=yd;g.ContextInfo$ForwardedNewsletterMessageInfoSpec=S;g.ContextInfo$UTMInfoSpec=zd;g.ContextInfo$ExternalAdReplyInfoSpec=Ad;g.ContextInfo$AdReplyInfoSpec=Bd;g.ContextInfo$BusinessMessageForwardInfoSpec=Cd;g.BotAvatarMetadataSpec=Dd;g.BotPluginMetadataSpec=Ed;g.BotSuggestedPromptMetadataSpec=Fd;g.BotPromptSuggestionsSpec=Gd;g.BotPromptSuggestionSpec=Hd;g.BotLinkedAccountsMetadataSpec=Id;g.BotLinkedAccountSpec=Jd;g.BotMemoryMetadataSpec=Kd;g.BotMemoryFactSpec=T;g.AIRichResponseMessageSpec=Ld;g.AIRichResponseMessage$AIRichResponseSubMessageSpec=Md;g.AIRichResponseMessage$AIRichResponseContentItemsMetadataSpec=Nd;g.AIRichResponseMessage$AIRichResponseContentItemsMetadata$AIRichResponseContentItemMetadataSpec=Od;g.AIRichResponseMessage$AIRichResponseContentItemsMetadata$AIRichResponseReelItemSpec=Pd;g.AIRichResponseMessage$AIRichResponseMapMetadataSpec=Qd;g.AIRichResponseMessage$AIRichResponseMapMetadata$AIRichResponseMapAnnotationSpec=Rd;g.AIRichResponseMessage$AIRichResponseLatexMetadataSpec=Sd;g.AIRichResponseMessage$AIRichResponseLatexMetadata$AIRichResponseLatexExpressionSpec=Td;g.AIRichResponseMessage$AIRichResponseUnifiedResponseSpec=Ud;g.AIRichResponseMessage$AIRichResponseDynamicMetadataSpec=Vd;g.AIRichResponseMessage$AIRichResponseTableMetadataSpec=Wd;g.AIRichResponseMessage$AIRichResponseTableMetadata$AIRichResponseTableRowSpec=Xd;g.AIRichResponseMessage$AIRichResponseCodeMetadataSpec=Yd;g.AIRichResponseMessage$AIRichResponseCodeMetadata$AIRichResponseCodeBlockSpec=Zd;g.AIRichResponseMessage$AIRichResponseInlineImageMetadataSpec=$d;g.AIRichResponseMessage$AIRichResponseGridImageMetadataSpec=ae;g.AIRichResponseMessage$AIRichResponseImageURLSpec=U;g.BotPromotionMessageMetadataSpec=be;g.BotRenderingMetadataSpec=ce;g.BotRenderingMetadata$KeywordSpec=de;g.BotMetricsMetadataSpec=ee;g.BotSessionMetadataSpec=fe;g.BotMediaMetadataSpec=ge;g.BotMemuMetadataSpec=he;g.BotReminderMetadataSpec=ie;g.BotModelMetadataSpec=je;g.BotProgressIndicatorMetadataSpec=ke;g.BotProgressIndicatorMetadata$BotPlanningStepMetadataSpec=le;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$BotPlanningStepSectionMetadataSpec=me;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$BotPlanningSearchSourceMetadataSpec=ne;g.BotProgressIndicatorMetadata$BotPlanningStepMetadata$BotPlanningSearchSourcesMetadataSpec=oe;g.BotCapabilityMetadataSpec=pe;g.BotModeSelectionMetadataSpec=qe;g.BotQuotaMetadataSpec=re;g.BotQuotaMetadata$BotFeatureQuotaMetadataSpec=se;g.BotImagineMetadataSpec=te;g.BotAgeCollectionMetadataSpec=ue;g.BotSourcesMetadataSpec=ve;g.BotSourcesMetadata$BotSourceItemSpec=we;g.BotMetadataSpec=xe;g.MessageAssociationSpec=ye;g.MessageContextInfoSpec=ze;g.DeviceListMetadataSpec=V;g.EmbeddedMessageSpec=Ae;g.EmbeddedMusicSpec=Be;g.EmbeddedContentSpec=Ce;g.TapLinkActionSpec=De;g.InteractiveAnnotationSpec=W;g.PointSpec=Ee;g.LocationSpec=Fe;g.TemplateButtonSpec=Ge;g.TemplateButton$CallButtonSpec=He;g.TemplateButton$URLButtonSpec=Ie;g.TemplateButton$QuickReplyButtonSpec=Je;g.HydratedTemplateButtonSpec=Ke;g.HydratedTemplateButton$HydratedCallButtonSpec=Le;g.HydratedTemplateButton$HydratedURLButtonSpec=Me;g.HydratedTemplateButton$HydratedQuickReplyButtonSpec=Ne;g.MoneySpec=Oe;g.PaymentBackgroundSpec=X;g.PaymentBackground$MediaDataSpec=Pe;g.DisappearingModeSpec=Y;g.ActionLinkSpec=Qe;g.GroupMentionSpec=Re;g.MessageSecretMessageSpec=Se;g.MediaNotifyMessageSpec=Te;g.LIDMigrationMappingSyncMessageSpec=Ue;g.ProcessedVideoSpec=Ve;g.UrlTrackingMapSpec=Z;g.UrlTrackingMap$UrlTrackingMapElementSpec=We;g.AIQueryFanoutSpec=Xe;g.MemberLabelSpec=$}),98); __d("WAWebProtobufsReporting.pb",["WAProtoConst"],(function(a,b,c,d,e,f,g){a={};b={};c={};a.internalDefaults={minVersion:1};a.internalSpec={minVersion:[1,(e=d("WAProtoConst")).TYPES.UINT32],maxVersion:[2,e.TYPES.UINT32],notReportableMinVersion:[3,e.TYPES.UINT32],never:[4,e.TYPES.BOOL]};b.internalSpec={field:[1,e.TYPES.MAP,[e.TYPES.UINT32,c]],version:[2,e.TYPES.UINT32]};c.internalDefaults={minVersion:1};c.internalSpec={minVersion:[1,e.TYPES.UINT32],maxVersion:[2,e.TYPES.UINT32],notReportableMinVersion:[3,e.TYPES.UINT32],isMessage:[4,e.TYPES.BOOL],subfield:[5,e.TYPES.MAP,[e.TYPES.UINT32,c]]};g.ReportableSpec=a;g.ConfigSpec=b;g.FieldSpec=c}),98); __d("WAHasProperty",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){return Object.prototype.hasOwnProperty.call(a,b)}f["default"]=a}),66); __d("WAProtoCompile",["WAProtoConst"],(function(a,b,c,d,e,f,g){"use strict";var h=function(a,b,c,d,e,f,g,h,i){this.names=a,this.fields=b,this.types=c,this.defaults=d,this.meta=e,this.oneofToFields=f,this.fieldToOneof=g,this.reservedTags=h?h.reduce(function(a,b){a[b]=!0;return a},{}):{},this.reservedFields=i?i.reduce(function(a,b){a[b]=!0;return a},{}):{}};function a(a){if(a.internalCompiledSpec)return a.internalCompiledSpec;var b=a.internalSpec;if(!b)throw new Error("Message Class "+String(a)+" does not have internalSpec");var c=a.internalDefaults||{},e=Object.keys(b).filter(function(a){return a!==d("WAProtoConst").KEYS.ONEOF}),f=new Array(e.length),g=[],j=[],k=new Array(e.length),l=b[d("WAProtoConst").KEYS.ONEOF]||{};e.sort(function(a,c){a=i(b,a);c=i(b,c);return a[0]-c[0]});for(var m=0;m<e.length;m++){var n=e[m],o=i(b,n);k[m]=c[n];var p=o[1],q=o[0];g.push(q);j.push(p);if((p&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.MESSAGE)f[m]=o[2];else if((p&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.ENUM){q=o[2];if(typeof q.cast==="function")f[m]=q;else{var r=!0,s=0;for(var t in q)r&&t!==s++&&(r=!1);t=void 0;if(r){t=[];for(r=0;r<s;r++)t.push(!0)}else{t={};for(r in q)t[q[r]]=!0}f[m]=t}}else if((p&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.MAP){if(o.length!==3)throw new Error("Map field "+n+" should have exactly three elements in its internalSpec");f[m]=o[2]}else f[m]=null}var u={};s=function(a){l[a].forEach(function(b){u[b]||(u[b]=[]),u[b].push(a)})};for(r in l)s(r);q=b[d("WAProtoConst").KEYS.RESERVED]&&b[d("WAProtoConst").KEYS.RESERVED][d("WAProtoConst").KEYS.RESERVED_TAGS];t=b[d("WAProtoConst").KEYS.RESERVED]&&b[d("WAProtoConst").KEYS.RESERVED][d("WAProtoConst").KEYS.RESERVED_FIELDS];p=new h(e,g,j,k,f,l,u,q,t);a.internalCompiledSpec=p;return p}function i(a,b){a=a[b];if(a==null)throw new Error("fieldData of "+b+" is missing");return a}g.Spec=h;g.compileSpec=a}),98); __d("WAProtoUtils",["WAProtoConst"],(function(a,b,c,d,e,f,g){"use strict";function a(a){if(a&d("WAProtoConst").FLAGS.PACKED)return d("WAProtoConst").ENC.BINARY;a=a&d("WAProtoConst").TYPE_MASK;if(a<=d("WAProtoConst").TYPES.ENUM)return d("WAProtoConst").ENC.VARINT;else if(a<=d("WAProtoConst").TYPES.DOUBLE)return d("WAProtoConst").ENC.BIT64;else if(a<=d("WAProtoConst").TYPES.MESSAGE)return d("WAProtoConst").ENC.BINARY;else if(a===d("WAProtoConst").TYPES.MAP)return d("WAProtoConst").ENC.BINARY;else return d("WAProtoConst").ENC.BIT32}g.typeToEncType=a}),98); __d("WAProtoValidate",["WAHasProperty","WALogger","WAProtoCompile","WAProtoConst"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is not an array']);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is not ',""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is out of range']);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is not a valid int']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is not a valid long']);l=function(){return a};return a}var m=Number.MAX_SAFE_INTEGER;function n(a,b){a=o(a,b);if(a){a.reverse();throw new TypeError("Message missing required value "+a.join("."))}}function a(a,b){n(a,b);b=u(b,a);if(b){b.path.reverse();throw new TypeError("Invalid value at "+b.path.join(".")+": "+b.error)}}function o(a,b){a=d("WAProtoCompile").compileSpec(a);var e=a.names,f=a.types;a=a.meta;var g=void 0;for(var h=0;h<f.length&&!g;h++){var i=f[h],j=e[h],k=c("WAHasProperty")(b,j)?b[j]:void 0;if(i&d("WAProtoConst").FLAGS.REQUIRED&&k==null)g=[j];else if((i&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.MESSAGE&&i&d("WAProtoConst").FLAGS.REPEATED&&k!=null){var l=a[h],m=void 0;for(m=0;m<k.length&&!g;m++)g=o(l,k[m]);g&&g.push(j+"["+m+"]")}else(i&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.MESSAGE&&k!=null&&(g=o(a[h],k),g&&g.push(j))}return g}function p(a,b,c){if(typeof a==="string")if(/^-?0x[0-9a-f]{16}$/i.test(a))return!1;else{d("WALogger").LOG(l(),s(a)).color("red");return{path:[],error:"value must be a hex string of the form '0x123...' or '-0x123...' where the tail is always 16 characters long"}}else return q(a,b,c)}function q(a,b,c){if(typeof a!=="number"||a!==a||Math.floor(a)!==a){d("WALogger").LOG(k(),s(a)).color("red");return{path:[],error:"value must be an int"}}else if(a<b||a>=c){d("WALogger").LOG(j(),s(a)).color("red");return{path:[],error:"value is out of range"}}else return!1}function r(a,b,c){if(a)return void 0;else{d("WALogger").LOG(i(),s(c),b).color("red");return{path:[],error:"value is invalid"}}}function s(a){if(typeof a==="string")return'"'+a+'"';else if(Array.isArray(a))return"["+a.join(", ")+"]";else return""+a}var t=[void 0,function(a){return q(a,-2147483648,2147483648)},function(a){return p(a,-m,m+1)},function(a){return q(a,0,4294967296)},function(a){return p(a,0,m+1)},function(a){return q(a,-2147483648,2147483648)},function(a){return p(a,-m,m+1)},function(a){return r(typeof a==="boolean","boolean",a)},function(a,b){return r(typeof a==="number"&&(b[a]||b.cast(a)!==void 0),"in enum",a)},function(a){return p(a,0,m+1)},function(a){return p(a,-m,m+1)},function(a){return r(typeof a==="number","number",a)},function(a){return r(typeof a==="string","string",a)},function(a){return r(a instanceof ArrayBuffer||a instanceof Uint8Array,"ArrayBuffer or Uint8Array",a)},u,function(a){return q(a,0,4294967296)},function(a){return q(a,-2147483648,2147483648)},function(a){return r(typeof a==="number","number",a)}];function u(a,b){b=d("WAProtoCompile").compileSpec(b);var c=b.names,e=b.fields,f=b.types,g=b.meta,i=b.oneofToFields,j=b.fieldToOneof,k=b.reservedTags,l=b.reservedFields,m=void 0;b=function(b){var n=c[b],o=f[b],p=a[n],q=o&d("WAProtoConst").TYPE_MASK,r=t[q],u=(o&d("WAProtoConst").TYPE_MASK)===d("WAProtoConst").TYPES.MAP;if(r===void 0&&!u)throw new Error("Can not find the validator for type "+q);if(o&(d("WAProtoConst").FLAGS.PACKED|d("WAProtoConst").FLAGS.REPEATED)&&p!=null)if(!Array.isArray(p))d("WALogger").LOG(h(),s(p)).color("red"),m={path:[n],error:"repeated field must be array"};else{q=g[b];for(o=0;o<p.length&&!m;o++)m=r(p[o],q),m&&m.path.push(n+"["+o+"]")}else if(u&&p!=null){o=g[b];q=o[0];u=o[1];o=typeof u==="object"?d("WAProtoConst").TYPES.MESSAGE:u;var v=t[q],w=t[o];if(v===void 0||w===void 0)throw new Error("Can not find the validator for Map with key type "+q+", value type "+o);for(o of p){var x=o[0],y=o[1];m=v(x,q);if(m){m.path.push(n+"'s key ["+x+"]");return{v:m}}m=w(y,u);if(m){m.path.push(n+"["+x+"]'s value");return{v:m}}}}else if(p!=null){m=r(p,g[b]);m&&m.path.push(n);y=j[n];y&&y.forEach(function(b){var c=i[b].filter(function(a){return a!==n});c.forEach(function(c){typeof a[c]!=="undefined"&&(m={path:[b],error:"oneof '"+b+"' has fields '"+n+"' and '"+c+"' set"})})});k[e[b]]&&(m={path:[n],error:"tag "+e[b]+" is reserved"});l[n]&&(m={path:[n],error:"field "+n+" is reserved"})}};for(var n=0;n<c.length&&!m;n++){var o=b(n);if(typeof o==="object")return o.v}return m}g.checkRequirements=n;g.checkValid=a}),98); __d("decodeProtobuf",["WABinary","WAHasProperty","WAHex","WAProtoCompile","WAProtoConst","WAProtoUtils","WAProtoValidate"],(function(a,b,c,d,e,f,g){"use strict";var h="__tu";function a(a,b){b=new(d("WABinary").Binary)(b);b=o(a,b,void 0,!1,!1);d("WAProtoValidate").checkRequirements(a,b);return b}function b(a,b){b=new(d("WABinary").Binary)(b);b=o(a,b,void 0,!1,!0);d("WAProtoValidate").checkRequirements(a,b);return b}function e(a,b){b=new(d("WABinary").Binary)(b);b=o(a,b,void 0,!0,!1);d("WAProtoValidate").checkRequirements(a,b);return b}function f(a){return c("WAHasProperty")(a,"$$unsafeUnknownFields")?a.$$unsafeUnknownFields:null}function i(a,b,c){if(a!==d("WAProtoUtils").typeToEncType(b))throw new Error("FormatError: "+c+" encoded with wire type "+a)}function j(a,b,c){switch(b){case d("WAProtoConst").TYPES.INT32:return k(c,-2147483648,2147483648,a,d("WABinary").parseInt64OrThrow);case d("WAProtoConst").TYPES.INT64:return c.readVarInt(l);case d("WAProtoConst").TYPES.UINT32:return k(c,0,4294967296,a,d("WABinary").parseUint64OrThrow);case d("WAProtoConst").TYPES.UINT64:return c.readVarInt(m);case d("WAProtoConst").TYPES.SINT32:b=k(c,0,4294967296,a,d("WABinary").parseInt64OrThrow);return b&1?~(b>>>1):b>>>1;case d("WAProtoConst").TYPES.SINT64:return c.readVarInt(n);case d("WAProtoConst").TYPES.BOOL:return!!k(c,0,2,a,d("WABinary").parseUint64OrThrow);case d("WAProtoConst").TYPES.ENUM:return c.readVarInt(d("WABinary").parseInt64OrThrow);case d("WAProtoConst").TYPES.FIXED64:return c.readLong(m,!0);case d("WAProtoConst").TYPES.SFIXED64:return c.readLong(l,!0);case d("WAProtoConst").TYPES.DOUBLE:return c.readFloat64(!0);case d("WAProtoConst").TYPES.STRING:return c.readString(c.readVarInt(d("WABinary").parseUint64OrThrow));case d("WAProtoConst").TYPES.BYTES:return c.readBuffer(c.readVarInt(d("WABinary").parseUint64OrThrow));case d("WAProtoConst").TYPES.FIXED32:return c.readUint32(!0);case d("WAProtoConst").TYPES.SFIXED32:return c.readInt32(!0);case d("WAProtoConst").TYPES.FLOAT:return c.readFloat32(!0)}}function k(a,b,c,d,e){a=a.readVarInt(e);if(a<b||a>=c)throw new Error("FormatError: "+d+" encoded with out-of-range value "+a);return a}function l(a,b){var c=d("WABinary").longFitsInDouble(!0,a,b);if(c){c=p(b);return a*4294967296+c}else{c=a<0;var e;c?e=b===0?-a:~a:e=a;a=c?-b:b;return d("WAHex").createHexLongFrom32Bits(e,a,c)}}function m(a,b){var c=d("WABinary").longFitsInDouble(!1,a,b);if(c){c=p(a);var e=p(b);return c*4294967296+e}else return d("WAHex").createHexLongFrom32Bits(a,b)}function n(a,b){var c=a>>>1;a=a<<31|b>>>1;b&1&&(c=~c,a=~a);return l(c,a)}function o(a,b,c,e,f){var g=d("WAProtoCompile").compileSpec(a),l=g.names,m=g.fields,n=g.types,p=g.meta,q=g.oneofToFields,r=g.fieldToOneof,s=g.reservedTags,t=g.reservedFields;g=a.internalDefaults;var u=c||babelHelpers["extends"]({},g)||{};u.$$unknownFieldCount=(a=c==null?void 0:c.$$unknownFieldCount)!=null?a:0;for(g=0;g<l.length;g++)n[g]&d("WAProtoConst").FLAGS.REPEATED?u[l[g]]=[]:n[g]===(d("WAProtoConst").TYPES.MAP&d("WAProtoConst").TYPE_MASK)&&(u[l[g]]=new Map());var v=0;c=m.length>0;a=m[0];while(b.size()){g=k(b,0,4294967296,"field and enc type",d("WABinary").parseInt64OrThrow);var w=g&7,x=g>>>3;if(c&&x!==a){g=v;do++v===m.length&&(v=0),a=m[v];while(x!==a&&v!==g)}if(c&&x===a)(function(){var a=l[v],c=n[v];i(w,c,a);var g=c&d("WAProtoConst").TYPE_MASK,m=p[v];if(c&d("WAProtoConst").FLAGS.PACKED){var y=b.readVarInt(d("WABinary").parseUint64OrThrow);y=b.readBinary(y);while(y.size()){var z=j(a,g,y);(g!==d("WAProtoConst").TYPES.ENUM||m[z]||(m.cast==null?void 0:m.cast(z))!==void 0)&&u[a].push(z)}}else if(g===d("WAProtoConst").TYPES.MESSAGE){z=b.readVarInt(d("WABinary").parseUint64OrThrow);y=b.readBinary(z);if(c&d("WAProtoConst").FLAGS.REPEATED)u[a].push(o(m,y,void 0,e,f));else{z=u[a];u[a]=o(m,y,z,e,f)}}else if(g===d("WAProtoConst").TYPES.MAP){y=b.readVarInt(d("WABinary").parseUint64OrThrow);z=b.readBinary(y);var A,B;for(y=0;y<p[v].length;y++){var C=k(z,0,4294967296,"map field and enc type",d("WABinary").parseInt64OrThrow),D=C&7;C=C>>>3;var E=void 0;switch(D){case d("WAProtoConst").ENC.VARINT:E=z.readVarInt(d("WABinary").parseInt64OrThrow);break;case d("WAProtoConst").ENC.BIT64:E=z.readBinary(8);break;case d("WAProtoConst").ENC.BINARY:D=m[y];if(D===d("WAProtoConst").TYPES.BYTES||D===d("WAProtoConst").TYPES.STRING)E=j(a,D,z);else{var F=z.readVarInt(d("WABinary").parseUint64OrThrow);F=z.readBinary(F);E=o(D,F,void 0,e,f)}break;case d("WAProtoConst").ENC.BIT32:E=z.readBinary(4);break}C===1?A=E:B=E}u[a].set(A,B)}else{D=j(a,g,b);(g!==d("WAProtoConst").TYPES.ENUM||m[D]||(m.cast==null?void 0:m.cast(D))!==void 0)&&(c&d("WAProtoConst").FLAGS.REPEATED?u[a].push(D):u[a]=D)}F=r[a];F&&typeof u[a]!=="undefined"&&F.forEach(function(b){var c=q[b].filter(function(b){return b!==a});c.forEach(function(a){delete u[a]});if(f){u[b]=(c={type:a,value:u[a]},c[h]=!0,c);delete u[a]}});(s[x]||t[a])&&delete u[a]})();else{u.$$unknownFieldCount++;if(e){u.$$unsafeUnknownFields||(u.$$unsafeUnknownFields={});g=void 0;switch(w){case d("WAProtoConst").ENC.VARINT:g=b.readVarInt(d("WABinary").parseInt64OrThrow);break;case d("WAProtoConst").ENC.BIT64:g=b.readBinary(8);break;case d("WAProtoConst").ENC.BINARY:g=b.readBinary(b.readVarInt(d("WABinary").parseUint64OrThrow));break;case d("WAProtoConst").ENC.BIT32:g=b.readBinary(4);break}u.$$unsafeUnknownFields[x]=g}else w===d("WAProtoConst").ENC.VARINT?b.readVarInt(d("WABinary").parseInt64OrThrow):w===d("WAProtoConst").ENC.BIT64?b.advance(8):w===d("WAProtoConst").ENC.BINARY?b.advance(b.readVarInt(d("WABinary").parseUint64OrThrow)):w===d("WAProtoConst").ENC.BIT32&&b.advance(4)}}return u}function p(a){return a>=0?a:4294967296+a}g.TAGGED_UNION_TAG=h;g.decodeProtobuf=a;g.decodeProtobufWithTaggedUnions=b;g.decodeProtobufWithUnknowns=e;g.getUnknownFields=f}),98); __d("WAWebReportingTokenConfig",["WAWebProtobufsReporting.pb","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(a){a=atob(a);var b=a.length,c=new Uint8Array(new ArrayBuffer(b));for(var d=0;d<b;d++)c[d]=a.charCodeAt(d);return c}var i="CgQIARIACjQIAxIwKgQIAhIAKgQIAxIAKgQICBIAKgQICxIAKhAIERIMKgQIFRIAKgQIFhIAKgQIGRIACioIBBImCAIqBggBEgIIAioGCBASAggCKhIIERIOCAIqBAgVEgAqBAgWEgAKOggFEjYIAioGCAMSAggCKgYIBBICCAIqBggFEgIIAioGCBASAggCKhIIERIOCAIqBAgVEgAqBAgWEgAKIggGEh4qBAgBEgAqEAgREgwqBAgVEgAqBAgWEgAqBAgeEgAKLggHEioqBAgCEgAqBAgHEgAqBAgKEgAqEAgREgwqBAgVEgAqBAgWEgAqBAgUEgAKLggIEioqBAgCEgAqBAgHEgAqBAgJEgAqEAgREgwqBAgVEgAqBAgWEgAqBAgVEgAKNAgJEjAqBAgCEgAqBAgGEgAqBAgHEgAqBAgNEgAqEAgREgwqBAgVEgAqBAgWEgAqBAgUEgAKKAgMEiQIAioGCAESAggCKgYIAhICCAIqCAgOEgQIAiABKgYIDxICCAIKKggSEiYIAioGCAYSAggCKgYIEBICCAIqEggREg4IAioECBUSACoECBYSAAouCBoSKioECAQSACoECAUSACoECAgSACoECA0SACoQCBESDCoECBUSACoECBYSAApCCBwSPggCKgYIARICCAIqBggCEgIIAioGCAQSAggCKgYIBRICCAIqBggGEgIIAioSCAcSDggCKgQIFRIAKgQIFhIACgwIJRIIKgYIARICIAEKUggxEk4IAioGCAISAggCKhYIAxISCAIqBggBEgIIAioGCAISAggCKhIIBRIOCAIqBAgVEgAqBAgWEgAqFggIEhIIAioGCAESAggCKgYIAhICCAIKDAg1EggqBggBEgIgAQoOCDcSCggCKgYIARICIAEKDgg6EgoIAioGCAESAiABCg4IOxIKCAIqBggBEgIgAQpSCDwSTggCKgYIAhICCAIqFggDEhIIAioGCAESAggCKgYIAhICCAIqEggFEg4IAioECBUSACoECBYSACoWCAgSEggCKgYIARICCAIqBggCEgIIAgpSCEASTggCKgYIAhICCAIqFggDEhIIAioGCAESAggCKgYIAhICCAIqEggFEg4IAioECBUSACoECBYSACoWCAgSEggCKgYIARICCAIqBggCEgIIAgo2CEISMggCKgQIAhIAKgQIBhIAKgQIBxIAKgQIDRIAKhAIERIMKgQIFRIAKgQIFhIAKgQIFBIACg4IShIKCAIqBggBEgIgAQoOCFcSCggCKgYIARICIAEKMghYEi4IAioGCAESAggCKg4IAhIKCAIqBggBEgIIAioSCAMSDggCKgQIFRIAKgQIFhIACg4IXBIKCAIqBggBEgIgAQoOCF0SCggCKgYIARICIAEKDgheEgoIAioGCAESAiAB",j=function(){function a(a){var b=a.fieldNumber,c=a.isMessage;c=c===void 0?!1:c;a=a.subfields;this.fieldNumber=b;this.isMessage=c;this.subfields=a}var b=a.prototype;b.isExtractWholeField=function(){return this.subfields==null||this.subfields.fieldsToFrank.size===0};return a}(),k=function(){function a(a){var b=this;this.fieldsToFrank=new Map();a==null?void 0:a.forEach(function(a){b.fieldsToFrank.set(a.fieldNumber,a)})}var b=a.prototype;b.getConfigForField=function(a){return this.fieldsToFrank.get(a)||null};return a}();function l(a,b,c){var d=c.minVersion,e=c.maxVersion;e=e===void 0?Infinity:e;var f=c.subfield;c=c.isMessage;if(a<d||a>e)return null;if(f==null)return new j({fieldNumber:b,isMessage:c});var g=[];f.forEach(function(b,c){c=l(a,c,b);c!=null&&g.push(c)});return new j({fieldNumber:b,isMessage:c,subfields:new k(g)})}var m=new Map();function a(a){var b=m.get(a);if(b!=null)return b;b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsReporting.pb").ConfigSpec,h(i));var c=[];(b=b.field)==null?void 0:b.forEach(function(b,d){d=l(a,d,b);d!=null&&c.push(d)});b=new k(c);m.set(a,b);return b}g.getBytesFromBase64=h;g.REPORTING_TOKEN_CONFIG_BASE64=i;g.FieldToExtract=j;g.ReportingTokenConfig=k;g.getReportingTokenConfig=a}),98); __d("WAWebReportingTokenProtobufUtils",["WABinary"],(function(a,b,c,d,e,f,g){function a(a){return a&7}function b(a){return a>>>3}function c(a){var b=new(d("WABinary").Binary)();b.writeVarInt(a);return b.readByteArray()}g.getWireTypeFromTag=a;g.getFieldNumberFromTag=b;g.convertToVarInt=c}),98); __d("WAWebReportingTokenContent",["WABinary","WAProtoConst","WAWebReportingTokenProtobufUtils","err"],(function(a,b,c,d,e,f,g){var h=function(a){this.value=a;a=d("WAWebReportingTokenProtobufUtils").convertToVarInt(a);this.size=a.length},i=function(){function a(a,b){this.valLengthSize=0;a=new(d("WABinary").Binary)(a);a.advance(b);var e=a.readVarInt(d("WABinary").parseInt64OrThrow);if(e<0||e>=4294967296)throw c("err")("Invalid tag value, out of bound: "+e);var f=d("WAWebReportingTokenProtobufUtils").getWireTypeFromTag(e);this.tag=new h(e);var g=0,i=new(d("WABinary").Binary)();i.writeVarInt(e);switch(f){case d("WAProtoConst").ENC.VARINT:e=a.readVarInt(d("WABinary").parseUint64OrThrow);i.writeVarInt(e);break;case d("WAProtoConst").ENC.BINARY:e=a.readVarInt(d("WABinary").parseUint64OrThrow);var j=a.readByteArray(e);g+=d("WAWebReportingTokenProtobufUtils").convertToVarInt(e).length;i.writeVarInt(e);i.writeByteArray(j);this.valLengthSize=g;break;case d("WAProtoConst").ENC.BIT64:e=a.readByteArray(8);i.writeByteArray(e);break;case d("WAProtoConst").ENC.BIT32:j=a.readByteArray(4);i.writeByteArray(j);break;default:throw c("err")("Unsupported wire type "+f)}this.bytes=i.readByteArray();this.start=b;this.end=b+this.bytes.length}var b=a.prototype;b.getFieldNumber=function(){return d("WAWebReportingTokenProtobufUtils").getFieldNumberFromTag(this.tag.value)};b.getWireType=function(){return d("WAWebReportingTokenProtobufUtils").getWireTypeFromTag(this.tag.value)};b.getTotalSize=function(){return this.bytes.length};b.getValueStartIdx=function(){return this.start+this.tag.size+this.valLengthSize};b.getValueEndIdx=function(){return this.end};b.getBytes=function(){return this.bytes};return a}(),j=function(){function a(a,b,c){this.tag=a,this.partsLength=b,this.parts=c,this.partsLengthInBytes=d("WAWebReportingTokenProtobufUtils").convertToVarInt(this.partsLength)}var b=a.prototype;b.getFieldNumber=function(){return d("WAWebReportingTokenProtobufUtils").getFieldNumberFromTag(this.tag.value)};b.getTotalSize=function(){return this.tag.size+this.partsLengthInBytes.length+this.parts.getTotalSize()};b.getBytes=function(){var a=new(d("WABinary").Binary)();a.writeVarInt(this.tag.value);a.writeVarInt(this.partsLength);for(var b of this.parts.fields)a.writeByteArray(b.getBytes());return a.readByteArray()};return a}(),k=function(){function a(){this.fields=[],this.totalSize=0}var b=a.prototype;b.add=function(a){this.fields.push(a),this.totalSize+=a.getTotalSize()};b.getTotalSize=function(){return this.totalSize};return a}();a=function(){function a(a,b){this.protobufMessage=a,this.messageConfig=b}var b=a.prototype;b.extractProtobufParts=function(a,b,c,e){var f=new k();if(e==null)return f;b=b;while(b<c){var g=new i(a,b),h=e.getConfigForField(g.getFieldNumber());b+=g.getTotalSize();if(h==null)continue;if(h.isMessage===!0||!h.isExtractWholeField()){if(g.getWireType()===d("WAProtoConst").ENC.BINARY){h=this.extractProtobufParts(a,g.getValueStartIdx(),g.getValueEndIdx(),h.isMessage===!0?this.messageConfig:h.subfields);h.fields.length>0&&f.add(new j(g.tag,h.getTotalSize(),h))}}else f.add(g)}f.fields.sort(function(a,b){return a.getFieldNumber()-b.getFieldNumber()});return f};b.getReportingTokenContent=function(){var a=this.extractProtobufParts(this.protobufMessage,0,this.protobufMessage.length,this.messageConfig);a=a.fields;var b=new(d("WABinary").Binary)();for(a of a)b.writeByteArray(a.getBytes());return b.readByteArray()};return a}();g.ReportingTokenContentCalculator=a}),98); __d("encodeProtobuf",["WABinary","WAHex","WAProtoCompile","WAProtoConst","WAProtoUtils","WAProtoValidate"],(function(a,b,c,d,e,f,g){"use strict";var h=void 0,i=128;function a(a,b,c){c===void 0&&(c=new(d("WABinary").Binary)());d("WAProtoValidate").checkValid(a,b);o(c,b,a);h=void 0;return c}function b(){return h!==void 0?"Last encoded value for "+h:"No information known"}function c(a,b){a.writeVarInt(b)}function e(a,b){if(typeof b==="number"&&b<4503599627370496&&b>=-4503599627370496)a.writeVarInt(b>=0?2*b:2*-b-1);else{var c=new(d("WABinary").Binary)(),e;typeof b==="number"?(e=b<0,c.writeVarInt(e?-b:b)):(e=d("WAHex").hexLongIsNegative(b),c.writeVarIntFromHexLong(e?d("WAHex").negateHexLong(b):b));b=c.peek(function(){return c.readByteArray()});var f=b.byteLength;if(e){var g=0,h;do h=b[g],b[g]=h&i|(h&127)-1&127,g++;while(b[g-1]===255)}h=e?1:0;for(g=0;g<f;g++){e=b[g];var j=e&i|(e&63)<<1|h;h=(e&64)>>6;b[g]=j}h===1&&(b[f-1]|=i,c.writeInt8(1));a.writeBinary(c)}}function f(a,b){typeof b==="number"?a.writeVarInt(b):a.writeVarIntFromHexLong(b)}function j(a,b){a.writeVarInt(d("WABinary").numUtf8Bytes(b)),a.writeString(b)}function k(a,b){a.writeVarInt(b.byteLength),a.writeBuffer(b)}function l(a,b,c){a.writeWithVarIntLength(function(a,b){return o(a,b,c)},b)}var m=[void 0,c,f,c,f,e,e,function(a,b){a.writeVarInt(b?1:0)},c,function(a,b){typeof b==="number"?a.writeUint64(b,!0):a.writeHexLong(b,!0)},function(a,b){typeof b==="number"?a.writeInt64(b,!0):a.writeHexLong(b,!0)},function(a,b){a.writeFloat64(b,!0)},j,k,l,function(a,b){a.writeUint32(b,!0)},function(a,b){a.writeInt32(b,!0)},function(a,b){a.writeFloat32(b,!0)}];f=function(a){if(a==null)return void 0;var b=a;function c(a,c){for(var d=0;d<c.length;d++)b(a,c[d])}return function(a,b){a.writeWithVarIntLength(c,b)}};var n=m.map(f);function o(a,b,c){var e=d("WAProtoCompile").compileSpec(c),f=e.names,g=e.fields,i=e.types;e=e.meta;c=c.internalDefaults;for(var j=0;j<f.length;j++){var k=f[j],l=b[k];l==null&&c&&(l=c[k]);if(l!=null){h=k;k=g[j];var o=i[j],p=o&d("WAProtoConst").TYPE_MASK,q=e[j];k=k*8|d("WAProtoUtils").typeToEncType(o);if(o&d("WAProtoConst").FLAGS.PACKED){if(l.length>0){a.writeVarInt(k);var r=n[p];r(a,l,q)}}else if(o&d("WAProtoConst").FLAGS.REPEATED)for(r=0;r<l.length;r++){a.writeVarInt(k);o=m[p];o(a,l[r],q)}else if(p===d("WAProtoConst").TYPES.MAP)for(o of l){r=o[0];var s=o[1];a.writeVarInt(k);var t=q[0],u=q[1],v=typeof u==="object"?d("WAProtoConst").TYPES.MESSAGE:u,w=m[t],x=m[v];if(w==null||x==null)throw new Error("Invalid encoder for map key/value");var y=new(d("WABinary").Binary)(),z=1*8|d("WAProtoUtils").typeToEncType(t);y.writeVarInt(z);w(y,r,t);z=2*8|d("WAProtoUtils").typeToEncType(v);y.writeVarInt(z);x(y,s,u);a.writeVarInt(y.size());a.writeBinary(y)}else{a.writeVarInt(k);w=m[p];w(a,l,q)}}}}g.encodeProtobuf=a;g.encodeErrorInfo=b}),98); __d("WAWebAddonEncryption",["WACryptoAesGcm","WALogger","WANullthrows","WAUseCaseSecret","WAWebABProps","WAWebAddonEncryptionError","WAWebApiContact","WAWebMessagingGatingUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebReportingTokenConfig","WAWebReportingTokenContent","WAWebWidToJid","asyncToGeneratorRuntime","encodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed decrypting an addon "," "," ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed encrypting an addon "," "," ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["LID to PN Mapping not found for addon sender"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["LID to PN Mapping not found for message sender"]);k=function(){return a};return a}function l(a,b){switch(a){case d("WAWebMsgType").MsgKind.PollVoteEncrypted:case d("WAWebMsgType").MsgKind.PollVoteDecrypted:return b.stanzaId+"\0"+b.addOnSenderJid;case d("WAWebMsgType").MsgKind.EventResponseEncrypted:case d("WAWebMsgType").MsgKind.EventResponseDecrypted:return b.stanzaId+"\0"+b.addOnSenderJid;default:return}}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.messageSecret,f=b.iv,g=b.stanzaId,h=b.originalMessageSender;b=b.addOnSender;try{var m=d("WAWebWidToJid").widToUserJid(h),n=d("WAWebWidToJid").widToUserJid(b);if(d("WAWebABProps").getABPropConfigValue("lid_one_to_one_migration_event_response_force_pn_jid")&&(a.type===d("WAWebMsgType").MsgKind.EventResponseDecrypted||a.type===d("WAWebMsgType").MsgKind.EventEditDecrypted)){if(h.isLid()){h=d("WAWebApiContact").getPhoneNumber(h);h?m=d("WAWebWidToJid").widToUserJid(h):d("WALogger").ERROR(k()).sendLogs("missing-lid-to-pn-mapping-for-message-sender")}if(b.isLid()){h=d("WAWebApiContact").getPhoneNumber(b);h?n=d("WAWebWidToJid").widToUserJid(h):d("WALogger").ERROR(j()).sendLogs("missing-lid-to-pn-mapping-for-addon-sender")}}b=c("WANullthrows")(o(a.type));h=b.spec;b=b.usecase;e=(yield d("WAUseCaseSecret").createUseCaseSecret({messageSecret:e,stanzaId:g,parentMsgOriginalSender:m,modificationSender:n,modificationType:b}));m=d("encodeProtobuf").encodeProtobuf(h,a.encode).readBuffer();b=(yield d("WACryptoAesGcm").gcmEncrypt(e,f,m,l(a.type,{stanzaId:g,addOnSenderJid:n})));h=a.type===d("WAWebMsgType").MsgKind.CommentDecrypted&&d("WAWebMessagingGatingUtils").isDualEncryptedReportingTokenSendingEnabled()?new(d("WAWebReportingTokenContent").ReportingTokenContentCalculator)(new Uint8Array(m),d("WAWebReportingTokenConfig").getReportingTokenConfig(d("WAWebMessagingGatingUtils").getSenderReportingTokenVersion())).getReportingTokenContent():null;return babelHelpers["extends"]({encPayload:b},h!=null&&{reportingTokenContent:h})}catch(b){d("WALogger").LOG(i(),g,a.type,b);throw new(d("WAWebAddonEncryptionError").DualEncryptionValidationError)(a.type,d("WAWebAddonEncryptionError").DualEncryptionValidationErrorCode.ENCRYPTION_ERROR)}});return m.apply(this,arguments)}function e(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.messageSecret,f=b.iv,g=b.stanzaId,i=b.originalMessageSender;b=b.addOnSender;try{b=d("WAWebWidToJid").widToUserJid(b);var j=c("WANullthrows")(o(a.type));j=j.usecase;e=(yield d("WAUseCaseSecret").createUseCaseSecret({messageSecret:e,stanzaId:g,parentMsgOriginalSender:d("WAWebWidToJid").widToUserJid(i),modificationSender:b,modificationType:j}));i=(yield d("WACryptoAesGcm").gcmDecrypt(e,f,a.encryptedAddOn,l(a.type,{stanzaId:g,addOnSenderJid:b})));return i}catch(b){d("WALogger").LOG(h(),g,a.type,b);throw new(d("WAWebAddonEncryptionError").DualEncryptionValidationError)(a.type,d("WAWebAddonEncryptionError").DualEncryptionValidationErrorCode.DECRYPTION_ERROR)}});return n.apply(this,arguments)}function o(a){switch(a){case d("WAWebMsgType").MsgKind.ReactionEncrypted:case d("WAWebMsgType").MsgKind.ReactionDecrypted:return{spec:d("WAWebProtobufsE2E.pb").Message$ReactionMessageSpec,usecase:d("WAUseCaseSecret").UseCaseSecretModificationType.ENC_REACTION};case d("WAWebMsgType").MsgKind.PollVoteEncrypted:case d("WAWebMsgType").MsgKind.PollVoteDecrypted:return{spec:d("WAWebProtobufsE2E.pb").Message$PollVoteMessageSpec,usecase:d("WAUseCaseSecret").UseCaseSecretModificationType.POLL_VOTE};case d("WAWebMsgType").MsgKind.CommentEncrypted:case d("WAWebMsgType").MsgKind.CommentDecrypted:return{spec:d("WAWebProtobufsE2E.pb").MessageSpec,usecase:d("WAUseCaseSecret").UseCaseSecretModificationType.ENC_COMMENT};case d("WAWebMsgType").MsgKind.EventResponseEncrypted:case d("WAWebMsgType").MsgKind.EventResponseDecrypted:return{spec:d("WAWebProtobufsE2E.pb").Message$EventResponseMessageSpec,usecase:d("WAUseCaseSecret").UseCaseSecretModificationType.EVENT_RESPONSE};case d("WAWebMsgType").MsgKind.EventEditEncrypted:case d("WAWebMsgType").MsgKind.EventEditDecrypted:return{spec:d("WAWebProtobufsE2E.pb").MessageSpec,usecase:d("WAUseCaseSecret").UseCaseSecretModificationType.EVENT_EDIT_ENCRYPTED}}}g.encryptAddOn=a;g.decryptAddOn=e}),98); __d("WAWebAddonMarkAsReadUtils",["WALogger","WAWebAddonConstants","WAWebAddonSelectUtils","WAWebAddonUpdateDataUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["processMarkAsRead update failed ",""]);h=function(){return a};return a}a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(function(a){return a.read!=null?babelHelpers["extends"]({},a,{read:!0}):a});try{a=d("WAWebAddonSelectUtils").getAddonTableMode(a[0]);yield d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:d("WAWebAddonConstants").AddonProcessMode.MarkAsRead,tableMode:a},{add:b})}catch(a){d("WALogger").ERROR(h(),a).tags("addons","messaging").sendLogs("processMarkAsRead")}});return function(b){return a.apply(this,arguments)}}();g.processMarkAsRead=a}),98); __d("WAWebAddonProcessMsgs",["AddonPlaceholderMsgsUtils","Promise","WALogger","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonEncryptAddonMsgData","WAWebAddonLogUtils","WAWebAddonPluginProcessor","WAWebAddonProcessMsgsUtils","WAWebAddonSelectUtils","WAWebAddonSortUtils","WAWebAddonUpdateDataUtils","WAWebHandleMsgError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["process optimistic addon msg send: "," ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: optimistic update "," (",") addon, id: ",", parent: ",", isParentLid: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: processed "," addon(s) during ",", table mode ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra] Failed to decrypt a message"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cannot decrypt a message: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[AddonInfraError] failed saving addons in "," with "," ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed incoming addons processing ",""]);o=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["failed saving addons in "," with ",""]);a=function(){return b};return b}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=c.addons,f=c.processor;c=c.processMode;var g=f.convert.toDualDecryptedMsgData;if(g==null)return e;if(c===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return e;if(c!==d("WAWebAddonConstants").AddonProcessMode.OnlineReceive)return e;f=[];e=(yield (h||(h=b("Promise"))).allSettled(e.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){return d("WAWebAddonCrossWindowUtils").isRealAddonType(b)?g(b,a.getForAddon(b)):b});return function(a){return c.apply(this,arguments)}}())));for(var i of e)i.status==="fulfilled"?f.push(i.value):d("WALogger").LOG(m(),i.reason);d("WAWebAddonLogUtils").hasSettledWithError(e)&&d("WALogger").ERROR(l()).tags("messagings","addons").sendLogs(String(c)+"-decription-failed",{sampling:.01});return f});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.addons,e=b.processor,f=b.processMode,g=b.tableMode,h=e.convert.toDualDecryptedMsgData;h=h==null?c:yield p(a,b);if(e.type===d("WAWebAddonConstants").AddonProcessorType.DualEncryptedWithMessageTraits){c=d("AddonPlaceholderMsgsUtils").getIncomingPlaceholderKeys(b);if(c!=null){var i=(yield d("AddonPlaceholderMsgsUtils").getPlaceholderMsgKeys(g,c));h=h.filter(function(a){return!i.has(a.id.toString())})}}b=(yield e.beforeUpsert(h,{processMode:f,parents:a}));return{processor:e,processMode:f,tableMode:g,addons:b}});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.addons,e=b.processor,f=b.processMode;b=b.tableMode;if(e.type===d("WAWebAddonConstants").AddonProcessorType.DualEncryptedWithMessageTraits){b=(yield d("AddonPlaceholderMsgsUtils").getPlaceholderMsgKeys(b,c.map(function(a){return a.id})));yield e.afterUpsert(c,{processMode:f,parents:a,existingPlaceholderKeys:b})}else yield e.afterUpsert(c,{processMode:f,parents:a})});return u.apply(this,arguments)}function v(a,b,c,d,e){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){var i,j=(yield (h||(h=b("Promise"))).all(d("WAWebAddonSortUtils").groupAddonsByProcessor(a.mode,c,e).map(function(a){return r(f,a)})));i=(i=[]).concat.apply(i,j.map(function(a){a=a.addons;return a}));i.length&&(yield d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:a.mode,tableMode:c},{add:i},{metricReporter:g}));yield h.all(j.map(function(a){return t(f,a)}));d("WALogger").LOG(k(),e.length,a.mode,d("WAWebAddonConstants").AddonTableMode.getName(c)).devConsole(e)});return w.apply(this,arguments)}function x(a,b,c,e){var f=e.metricReporter,g=e.failSilently;return Array.from(d("WAWebAddonSortUtils").groupAddonsByTableMode(b)).map(function(e){var h=e[0];e=e[1];return v(a,h,e,c,f)["catch"](function(c){if(c instanceof d("WAWebHandleMsgError").MessageValidationError){var e;d("WALogger").ERROR(o(),c).tags("addons","messaging").sendLogs("processAddonMsgs: "+((e=b[0])==null?void 0:e.type)+" in "+String(h))}else{e="addon-"+String(a.mode)+"-error: "+((e=b[0])==null?void 0:e.type);d("WALogger").ERROR(n(),h,c.message,c.stack).tags("addons","messaging").sendLogs(e)}if(!g)throw c})})}function c(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(a.length===0)return{orphans:[]};var e={mode:d("WAWebAddonConstants").AddonProcessMode.OnlineReceive};a=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs(a,e.mode));var f=a[0];a=a[1];a=d("WAWebAddonSortUtils").collectValidAndOrphanAddons(a,f);var g=a.validAddons;a=a.orphans;e=x(e,g,d("WAWebAddonSelectUtils").createAddonParentSelector(f),{metricReporter:c,failSilently:!0});yield (h||(h=b("Promise"))).allSettled(e);return{orphans:a}});return y.apply(this,arguments)}function e(a,b,c,d){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){a={mode:a};a=x(a,[c],d("WAWebAddonSelectUtils").createAddonParentSelector(e),{metricReporter:f,failSilently:!1});yield (h||(h=b("Promise"))).all(a)});return z.apply(this,arguments)}function A(a,b,c,d){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){var g=e.getForAddon(c),i=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebAddonEncryptAddonMsgData").createDualEncryptionHelper(c,g);return a?a.encrypt():c});return function(){return a.apply(this,arguments)}}();i=(yield (h||(h=b("Promise"))).all([i(),v({mode:a},d("WAWebAddonSelectUtils").getAddonTableMode(c),[c],e,f)]));a=i[0];return{encryptedMsgData:a,decryptedMsgData:c,parent:g}});return B.apply(this,arguments)}function f(a,b,c){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){try{var e=d("WAWebAddonPluginProcessor").getAddonProcessor(b);void e.updateCollection({add:[b],remove:[]},a);e=d("WAWebAddonProcessMsgsUtils").getParentMsgKey(b);d("WALogger").LOG(j(),d("WAWebAddonCrossWindowUtils").getAddonProcessorType(b),b.type,b.id.id,e.id,(e=e.participant)==null?void 0:e.isLid());e=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs([b],a));b=e[0];e=e[1];a=(yield A(a,e[0],d("WAWebAddonSelectUtils").createAddonParentSelector(b),c));return a}catch(a){d("WALogger").ERROR(i(),a.message,a.stack).tags("addons","messaging").sendLogs("failed-optimistic-addon-send");throw a}});return C.apply(this,arguments)}function D(a){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var c={mode:d("WAWebAddonConstants").AddonProcessMode.HistorySync},e=d("WAWebAddonSelectUtils").createAddonParentSelector(new Map());c=x(c,a,e,{failSilently:!0});yield (h||(h=b("Promise"))).allSettled(c)});return E.apply(this,arguments)}g.processMsgsAndGetOrphans=c;g.processOutgoingMsg=e;g.processOutgoingMsgOptimisticUpdate=f;g.processHistoryMsgs=D}),98); __d("WAWebGetters",["err"],(function(a,b,c,d,e,f,g){var h=function(){var a=i;i++;return a},i=0;function a(a){a=a||{};var b=a.root,d=a.rootEqualityCheck;a=a.createCache;a=a===void 0?s:a;var e=a(),f=h(),g=function(){var a=i;i++;return a},i=0,l=(a=b)!=null?a:k({getterGroupId:f,getterId:g(),resultEqualityCheck:(b=d)!=null?b:r,cache:e});if(l.kind!=="identity")throw c("err")("root must be an identity getter but got kind "+l.kind);return{field:function(a,b){b=b||{};var c=b["default"],d=b.getDefault;b=b.resultEqualityCheck;b=b===void 0?r:b;var h;d!=null?h=function(b){b=b[0];return(b=b[a])!=null?b:d()}:c===void 0?h=function(b){b=b[0];return b[a]}:h=function(b){b=b[0];return(b=b[a])!=null?b:c};return j({getterGroupId:f,getterId:g(),root:l,cache:e,resultFunc:h,resultEqualityCheck:b,props:{kind:"field",dependencyKey:a,dependencies:[l]}})},computed:function(a,b,c){c=c||{};c=c.resultEqualityCheck;c=c===void 0?r:c;return j({getterGroupId:f,getterId:g(),root:l,cache:e,resultFunc:a,resultEqualityCheck:c,props:{kind:"computed",dependencies:b}})},unsafeIdentityGetter:l,clearCacheFor:function(a){e["delete"](t(a))}}}function j(a){var b=a.getterGroupId,d=a.getterId,e=a.root,f=a.cache,g=a.resultFunc,h=a.resultEqualityCheck;a=a.props;var i=a.dependencies,j=i.length,k=n(d),m=o(d),r=p(d);return l({getterGroupId:b,getterId:d,root:e,cache:f,props:babelHelpers["extends"]({},a,{resultFunc:g}),recomputeIfNeeded:function(a,d,e){a=e[b];var f=a[m],l=a[r];if(l!=null&&f!=null){if(l===d)return f;if(l!=null&&j>0){var n=!1;for(var o=0;o<j;o++){var p=i[o];p=p.$$extractChangedAt(e[p.$$getterGroupId]);n=p==null||p>l;if(n)break}if(!n){a[r]=d;return f}}}p=new Array(j);for(o=0;o<j;o++){l=i[o];n=l.$$extractResult(e[l.$$getterGroupId]);if(n===void 0)throw c("err")("No result was stored");p[o]=u(n)}l=g(p);n=a[k];if(f!=null&&n!==void 0&&h(l,u(n))){a[r]=d;return f}a[k]=l===void 0?q:l;a[m]=d;a[r]=d;return d}})}function k(a){var b=a.getterGroupId,c=a.getterId,d=a.resultEqualityCheck;a=a.cache;var e=n(c),f=o(c),g=p(c);return l({getterGroupId:b,getterId:c,root:null,cache:a,props:{kind:"identity",dependencies:[]},recomputeIfNeeded:function(a,c,h){h=h[b];var i=h[e],j=a,k=h[g];a=a==null?0:a.revisionNumber||0;if(i!==void 0&&k===a&&d(j,u(i)))return c;k=c+1;h[e]=j===void 0?q:j;h[f]=k;h[g]=a;return k}})}function l(a){var b=a.getterGroupId,d=a.getterId,e=a.root,f=a.cache,g=a.recomputeIfNeeded;a=a.props;var h=a.dependencies,i=n(d),j=o(d),k=p(d);d=function(a){var d=t(a),e={};for(var f=0;f<s.length;f++){var g=s[f],h=r[g],j=h.get(d);j==null&&(j={},h.set(d,j));e[g]=j}h=q.$$recomputeIfNeeded(a,q.$$extractChangedAt(e[q.$$getterGroupId])||0,e);g=e[b];j=g[k];if(j==null||h>j)for(d=0;d<l.length;d++){f=j!=null;var m=l[d];for(var n=0;n<m.length;n++){var o=m[n].$$recomputeIfNeeded(a,h,e);(j==null||o>j)&&(f=!1)}if(f)break}o=g[i];if(o===void 0)throw c("err")("No result was stored");return u(o)};a=Object.assign(d,{kind:a.kind,dependencies:h,dependencyKey:a.dependencyKey,resultFunc:a.resultFunc,$$getterGroupId:b,$$root:e||d,$$cache:f,$$recomputeIfNeeded:g,$$extractChangedAt:function(a){return a[j]},$$extractResult:function(a){return a[i]}});var l=m(a),q=a.$$root;for(e=0;e<h.length;e++)if(h[e].$$root!==q)throw c("err")("Getter created with multiple roots. This means you used getters that came from different `createGetterFactories()` calls as dependencies in a `computed()` getter. If you want to do this, you must pass the identity getter created by one of the `createGetterFactories()` calls as the `root` option to the other.");var r=(d={},d[q.$$getterGroupId]=q.$$cache,d),s=[q.$$getterGroupId];for(f=0;f<l.length;f++)for(g=0;g<l[f].length;g++){h=l[f][g];e=h.$$getterGroupId;d=h.$$cache;r[e]==null&&(s.push(e),r[e]=d)}return a}function m(a){a=[a];for(var b=0;b<a.length;b++){var d=a[b];d.dependencies!=null&&a.push.apply(a,d.dependencies)}d=Array.from(new Set(a.reverse()));b=[];a=[];for(var e=0;e<d.length;e++){var f=d[e];switch(f.kind){case"identity":break;case"field":b.push(f);break;case"computed":a.push(f);break;default:throw c("err")("Invalid getter kind: "+f.kind)}}return[b,a].filter(function(a){return a.length>0})}var n=function(a){return 3*a},o=function(a){return 3*a+1},p=function(a){return 3*a+2};b=function(){function a(){}var b=a.prototype;b.toString=function(){return"UndefinedSentinel"};return a}();var q=new b();function r(a,b){return a===b}function s(){return new Map()}function t(a){if(a==null)throw c("err")("Getter was called with "+String(a)+" data.");a=a.id;if(a==null)throw c("err")("Data passed to getter must include an id property (it's how we memoize) but got "+String(a));return a.toString()}function u(a){return a===q?void 0:a}g.createGetterFactories=a}),98); __d("WAWebDummyCacheMap",[],(function(a,b,c,d,e,f){a=function(){function a(){this.size=0}var b=a.prototype;b.clear=function(){};b["delete"]=function(){return!1};b.get=function(){return void 0};b.has=function(){return!1};b.set=function(){return this};return a}();f.FakeCacheMap=a}),66); __d("WAWebGettersCaches",["WAWebABProps","WAWebDummyCacheMap","WAWebEnvironment"],(function(a,b,c,d,e,f,g){a=function(){if(d("WAWebABProps").getABPropConfigValue("web_getters_noop_cache"))return new(d("WAWebDummyCacheMap").FakeCacheMap)();return c("WAWebEnvironment").isWindows?new(d("WAWebDummyCacheMap").FakeCacheMap)():new Map()};b=a;e=a;f=a;var h=a,i=function(){return new Map()},j=function(){return new Map()},k=a,l=a,m=a,n=a,o=a,p=a,q=a,r=a,s=a,t=a,u=a,v=a,w=a,x=a,y=a,z=a,A=a,B=a,C=a,D=a,E=a;a=a;g.createMessagesCache=b;g.createFrontendMessagesCache=e;g.createChatCache=f;g.createFrontendChatCache=h;g.createContactsCache=i;g.createFrontendContactsCache=j;g.createLabelsCache=k;g.createMuteCache=l;g.createPinInChatsCache=m;g.createFrontendPinInChatsCache=n;g.createMsgInfosCache=o;g.createPollVotesCache=p;g.createFrontendPollVotesCache=q;g.createNewsletterPollVotesCache=r;g.createFrontendNewsletterPollVotesCache=s;g.createSettingsCache=t;g.createStickerModelMdCache=u;g.createMediaEditControllerCache=v;g.createOrderCache=w;g.createOrderItemCache=x;g.createQuickReplyCache=y;g.createFrontendQuickReplyCache=z;g.createStatusCache=A;g.createFrontendStatusCache=B;g.createRecordingSessionCache=C;g.createEventResponseCache=D;g.createFrontendEventResponseCache=E;g.createCatalogCache=a}),98); __d("WAWebChatGetters",["WAWebGetters","WAWebGettersCaches","WAWebWid"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createChatCache});b=a.field;e=a.computed;f=a.unsafeIdentityGetter;d=a.clearCacheFor;a=d;d=f;f=b("id");var h=b("t"),i=b("unreadCount",{"default":0}),j=b("archive"),k=b("isReadOnly"),l=b("isLocked"),m=b("muteExpiration",{"default":0}),n=b("isAutoMuted",{"default":!1}),o=b("name"),p=b("pin"),q=b("labels"),r=b("endOfHistoryTransferType"),s=b("pendingInitialLoading",{"default":!1}),t=b("changeNumberOldJid"),u=b("changeNumberNewJid"),v=b("chatlistPreview"),w=b("lastReactionPreview"),x=b("draftMessage"),y=b("capiThreadControl"),z=b("tcToken"),A=b("tcTokenTimestamp");b=b("previewT");var B=e(function(a){a=a[0];return c("WAWebWid").isUser(a)},[f]),C=e(function(a){a=a[0];return c("WAWebWid").isPSA(a)},[f]),D=e(function(a){a=a[0];return c("WAWebWid").isIAS(a)},[f]),E=e(function(a){a=a[0];return c("WAWebWid").isGroup(a)},[f]),F=e(function(a){a=a[0];return c("WAWebWid").isBroadcast(a)},[f]),G=e(function(a){a=a[0];return c("WAWebWid").isNewsletter(a)},[f]),H=e(function(a){var b=a[0];a=a[1];return!b&&!a},[F,C]),I=e(function(a){a=a[0];return!a},[F]);e=e(function(a){a=a[0];return a!==0},[i]);g.clearChatGetterCacheFor=a;g.getChatUnsafe=d;g.getId=f;g.getT=h;g.getUnreadCount=i;g.getArchive=j;g.getIsReadOnly=k;g.getIsLocked=l;g.getMuteExpiration=m;g.getIsAutoMuted=n;g.getName=o;g.getPin=p;g.getLabels=q;g.getEndOfHistoryTransferType=r;g.getPendingInitialLoading=s;g.getChangeNumberOldJid=t;g.getChangeNumberNewJid=u;g.getChatlistPreview=v;g.getLastReactionPreview=w;g.getDraftMessage=x;g.getCapiThreadControl=y;g.getTcToken=z;g.getTcTokenTimestamp=A;g.getPreviewT=b;g.getIsUser=B;g.getIsPSA=C;g.getIsIAS=D;g.getIsGroup=E;g.getIsBroadcast=F;g.getIsNewsletter=G;g.getIsEligibleForContactSync=H;g.getCanUnread=I;g.getHasUnread=e}),98); __d("WAWebLid1X1MigrationGating",["WALogger","WAWebUserPrefsIndexedDBStorage"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["lid: setIsLidMigrated: ",""]);h=function(){return a};return a}a=function(){function a(){}var b=a.prototype;b.isLidMigrated=function(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAIsAccountLidFieldMigrated")===!0};b.setIsLidMigrated=function(a){d("WALogger").LOG(h(),a);return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WAIsAccountLidFieldMigrated",a)};b.isSyncdSessionMigrated=function(){return!1};b.shouldCreatePnChat=function(){return!1};return a}();b=new a();g.Lid1X1MigrationUtils=b}),98); __d("WAWebIsCagGroupCache",[],(function(a,b,c,d,e,f){a=function(){function a(){this.$1=new Set()}var b=a.prototype;b.add=function(a){this.$1.add(a.toString())};b.remove=function(a){this.$1["delete"](a.toString())};b.isCag=function(a){return this.$1.has(a.toString())};b.clear=function(){this.$1.clear()};return a}();b=new a();c=b;f["default"]=c}),66); __d("WAWebMsgKeyUtils",["$InternalEnum","WALogger","WANullthrows","WAWebIsCagGroupCache","WAWebUserPrefsMeUser","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["unexpected participant "," in ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["missing participant in a group "," "," ",""]);i=function(){return a};return a}var j=b("$InternalEnum").Mirrored(["Addon","Message","EditMessage"]);function a(a){return a.fromMe&&d("WAWebUserPrefsMeUser").isMeAccount(a.remote)}function k(a,b){var e=a.remote;if(e.isGroup()){if(a.participant==null){d("WALogger").WARN(i(),a.id,a.remote,a.fromMe).sendLogs("group-missing-participant");return!1}var f=c("WAWebIsCagGroupCache").isCag(e);return f&&b===j.Addon?!0:Boolean((f=a.participant)==null?void 0:f.isLid())}return e.isLid()}function l(a,b){if(k(b,a))return d("WAWebUserPrefsMeUser").getMeLidUser();switch(a){case j.Addon:return c("WAWebIsCagGroupCache").isCag(b.remote)?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser();case j.EditMessage:case j.Message:return d("WAWebUserPrefsMeUser").getMeUser()}}function e(a,b){var e=a.remote;b=l(b,a);if(e.isBroadcastList()){var f=c("WANullthrows")(a.participant,"missing participant in broadcast"),g=a.fromMe?b:f;f=a.fromMe?f:b;return{from:g,to:f,broadcastId:e}}g=a.fromMe?b:e;f=a.fromMe?e:b;b=e.isGroup()||e.isStatus();!b&&a.participant&&d("WALogger").WARN(h(),a.participant,e).sendLogs("msgKey-unexpected-participant",{sampling:.01});b=b?a.participant:void 0;return e.isStatus()?{from:g,to:f,author:b,broadcastId:e}:{from:g,to:f,author:b}}function f(a,b){return a.fromMe===b.fromMe&&c("WAWebWid").equals(a.remote,b.remote)&&c("WAWebWid").equals(a.participant,b.participant)}g.TranslateMsgKeyType=j;g.isNoteToSelf=a;g.isLidMsgKey=k;g.msgKeyToTargetInfo=e;g.equalSendersAddressingSensitive=f}),98); __d("WAWebUserPrefsDebugKeys",[],(function(a,b,c,d,e,f){a=Object.freeze({DEBUG_ROUTING_TOKEN:"WADebugRoutingToken",DEBUG_SHOWN_MSGS:"WADebugShownMsgs",DEBUG_ENABLE_OFFLINE_MOCK:"WADebugEnableOfflineMock",DEBUG_OFFLINE_MOCK_TRAFFIC:"WADebugOfflineMockTraffic",DEBUG_READ_RECEIPT:"WADebugReadReceipt",DEBUG_DECRYPT_FAIL:"WADebugDecryptFail",DEBUG_DO_NOT_SEND_RETRY_RECEIPT:"WADebugDoNotSendRetryReceipt",DEBUG_PASSIVE_MODE:"WADebugPassiveMode",DEBUG_IGNORE_PARTICIPANT_ADD:"WADebugIgnoreParticipantAdd",IGNORE_NONDIRECT_GROUP_MSG:"WAIgnoreNondirectGroupMsg",MESSAGE_EDIT_RESTRICTION_ENABLED:"MESSAGE_EDIT_RESTRICTION_ENABLED",DEBUG_ONLY_DEFAULT_BOT_OVERIDE:"DEBUG_ONLY_DEFAULT_BOT_OVERIDE",LID_MIGRATION_DEBUG_MODE:"LID_MIGRATION_DEBUG_MODE"});b=a;f["default"]=b}),66); __d("WAWebUserPrefsMultiDeviceDebug",["WAWebUserPrefsDebugKeys","WAWebUserPrefsStore","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(a){return typeof a==="string"?a:void 0}function i(a){return typeof a==="number"?a:void 0}function a(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_READ_RECEIPT,a)}function b(){return c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_READ_RECEIPT)}function e(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_PASSIVE_MODE,a)}function f(){return c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_PASSIVE_MODE)}function j(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_ENABLE_OFFLINE_MOCK,a)}function k(){return!!c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_ENABLE_OFFLINE_MOCK)}function l(a){return c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_OFFLINE_MOCK_TRAFFIC,a)}function m(){return c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_OFFLINE_MOCK_TRAFFIC)}function n(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_DECRYPT_FAIL,a)}function o(){return i(c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_DECRYPT_FAIL))}var p=new Map();function q(a,b){p.set(a.user,b)}function r(a){return(a=p.get(a.user))!=null?a:!1}function s(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_DO_NOT_SEND_RETRY_RECEIPT,a)}function t(){return i(c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_DO_NOT_SEND_RETRY_RECEIPT))}function u(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_ROUTING_TOKEN,a)}function v(){return h(c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_ROUTING_TOKEN))}function w(a){if(a==null){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_ONLY_DEFAULT_BOT_OVERIDE,null);return}var b;a.endsWith("@bot")?b=a:b=a+"@c.us";if(!((a=d("WAWebWidFactory").createWid(b))==null?void 0:a.isBot()))return;c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_ONLY_DEFAULT_BOT_OVERIDE,b)}function x(){return h(c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_ONLY_DEFAULT_BOT_OVERIDE))}function y(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").DEBUG_IGNORE_PARTICIPANT_ADD,a)}function z(){return i(c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").DEBUG_IGNORE_PARTICIPANT_ADD))}function A(a){c("WAWebUserPrefsStore").set(c("WAWebUserPrefsDebugKeys").LID_MIGRATION_DEBUG_MODE,a)}function B(){return!!c("WAWebUserPrefsStore").get(c("WAWebUserPrefsDebugKeys").LID_MIGRATION_DEBUG_MODE)}g.setDebugReadReceipt=a;g.getDebugReadReceipt=b;g.setDebugPassiveMode=e;g.getDebugPassiveMode=f;g.setDebugEnableOfflineMock=j;g.getDebugEnableOfflineMock=k;g.setDebugOfflineMockTraffic=l;g.getDebugOfflineMockTraffic=m;g.setDebugDecryptFail=n;g.getDebugDecryptFail=o;g.setDebugEncryptFail=q;g.getDebugEncryptFail=r;g.setDebugDoNotSendRetryReceipt=s;g.getDebugDoNotSendRetryReceipt=t;g.setDebugRoutingTokenPref=u;g.getDebugRoutingTokenPref=v;g.setDebugDefaultBotOverride=w;g.getDebugDefaultBotOverride=x;g.setDebugIgnoreParticipantAdd=y;g.getDebugIgnoreParticipantAdd=z;g.setLidMigrationDebugMode=A;g.getLidMigrationDebugMode=B}),98); __d("WAWebLidMigrationUtils",["WALogger","WAWebApiContact","WAWebChatGetters","WAWebLid1X1MigrationGating","WAWebMsgKey","WAWebMsgKeyUtils","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDeviceDebug","WAWebWid","WAWebWidFactory","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid-migration] getEnforceCurrentLidForUserWid: No LID for user"]);h=function(){return a};return a}function a(a){return d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&c("WAWebWid").isRegularUser(a)}function i(a){return a.isLid()?d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a)):a}function j(a){return a.isLid()?a:d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a))}function k(a){a=d("WAWebWidFactory").toUserWid(a);return c("WAWebWid").isUserLid(a)?a:d("WAWebApiContact").getCurrentLid(a)}function b(a){var b=k(a);if(b==null){d("WALogger").ERROR(h()).devConsole(a);throw c("err")("No LID for user")}return b}function e(a){return a?j:i}function f(a,b){if(a!=null&&b!=null&&a.isUser()&&b.isUser()&&a.isLid()!==b.isLid()){var c=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));if(c!=null)return[c,b];c=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(b));if(c!=null)return[a,c]}return[a,b]}function l(a){return(a=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(d("WAWebWidFactory").createWid(a))))==null?void 0:a.toString()}function m(a){if(a.remote.isGroup())return n(a);else if(a.remote.isUser())return o(a)}function n(a){var b=a.participant!=null?d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a.participant)):null;if(b==null)return;return new(c("WAWebMsgKey"))({fromMe:a.fromMe,remote:a.remote,id:a.id,participant:b})}function o(a){var b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a.remote));if(b==null)return;return new(c("WAWebMsgKey"))({fromMe:a.fromMe,remote:b,id:a.id,participant:a.participant})}function p(a,b){var c=a.id.isLid(),e=a.isCAG();a=d("WAWebChatGetters").getIsGroup(a)&&Boolean((a=a.groupMetadata)==null?void 0:a.isLidAddressingMode);switch(b){case d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon:return c||e||a?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser();case d("WAWebMsgKeyUtils").TranslateMsgKeyType.EditMessage:case d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message:return e?a?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser():c||a?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser()}}function q(a){if(!a.isLid()){var b=j(a);if(b!=null)return[a,b]}else{b=i(a);if(b!=null)return[a,b]}return[a]}function r(a){return!c("gkx")("26258")&&(a==null?void 0:a.isLid())===!0&&d("WAWebUserPrefsMultiDeviceDebug").getLidMigrationDebugMode()}function s(a){return!c("gkx")("26258")&&a===!0&&d("WAWebUserPrefsMultiDeviceDebug").getLidMigrationDebugMode()}function t(a){return c("gkx")("26258")?!1:r(a.id.remote)||r(a.id.participant)}function u(a){return a==null?"none":a?"lid":"pn"}g.shouldHaveAccountLid=a;g.toPn=i;g.toLid=j;g.toUserLid=k;g.getEnforceCurrentLid=b;g.toAddressingModeFactory=e;g.toCommonAddressingMode=f;g.getAlternateJid=l;g.getAlternateMsgKey=m;g.getMeUserLidOrJidForChat=p;g.getPnAndLidToUpdate=q;g.getShouldShowLidDebugUI=r;g.getShouldShowLidDebugUIForGroups=s;g.getShouldShowLidDebugUIForMsg=t;g.getAddressingModeString=u}),98); __d("WAWebParentMsgKeyValidation",["$InternalEnum","WACustomError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_PARENT_MESSAGE_KEY:"missing_parent_message_key"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){b="errorCode: "+String(b);c!=null&&(b+=" comment: "+c);return a.call(this,b)||this}return b}(d("WACustomError").customError("ParentMsgKeyValidationError"));g.ParentMsgKeyValidationErrorCode=a;g.ParentMsgKeyValidationError=c}),98); __d("WAWebAddonProcessMsgsUtils",["Promise","WALogger","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonGatingUtils","WAWebAddonPerfUtils","WAWebAddonPluginProcessor","WAWebAddonQueryUtils","WAWebLidMigrationUtils","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebParentMsgKeyValidation","WAWebWid","asyncToGeneratorRuntime","nullthrows"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseHistorySyncMsg: error:",""]);i=function(){return a};return a}function j(a){if(a.targetMessageKey!=null)return"targetMessageKey";else if(a.pinParentKey!=null)return"pinParentKey";else if(a.pollUpdateParentKey!=null)return"pollUpdateParentKey";else if(a.reactionParentKey!=null)return"reactionParentKey";else if(a.parentMsgKey!=null)return"parentMsgKey";throw new(d("WAWebParentMsgKeyValidation").ParentMsgKeyValidationError)(d("WAWebParentMsgKeyValidation").ParentMsgKeyValidationErrorCode.MISSING_PARENT_MESSAGE_KEY)}function k(a){var b;b=(b=(b=(b=(b=a.targetMessageKey)!=null?b:a.parentMsgKey)!=null?b:a.pinParentKey)!=null?b:a.pollUpdateParentKey)!=null?b:a.reactionParentKey;if(b instanceof c("WAWebMsgKey"))return b;throw new(d("WAWebParentMsgKeyValidation").ParentMsgKeyValidationError)(d("WAWebParentMsgKeyValidation").ParentMsgKeyValidationErrorCode.MISSING_PARENT_MESSAGE_KEY)}function l(a){a=k(a);if(a.remote.isBroadcastList()){var b=d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message);b=a.fromMe?b.to:b.from;return new(c("WAWebMsgKey"))({remote:b,fromMe:a.fromMe,id:a.id})}return a}function m(a){var b=d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a);if(d("WAWebAddonPluginProcessor").getAddonProcessorsMap().has(b))return a}function n(a,b){var e=new Map();a=a.map(function(a){var f=l(a),g=d("WAWebLidMigrationUtils").getAlternateMsgKey(f),h=null;if(e.has(f.toString()))h=c("nullthrows")(e.get(f.toString()));else if(g!=null&&e.has(g.toString()))h=c("nullthrows")(e.get(g.toString()));else{var i=b.get(f.toString());i==null&&g&&(i=b.get(g.toString()));i!=null&&!f.equals(i.id)&&(h=i.id,e.set(f.toString(),h))}f=(i=b.get(f.toString()))!=null?i:g!=null?b.get(g.toString()):void 0;if(f==null)return a;if(h==null)return o(a,f);i=p(a,h);return o(i,f)});e.forEach(function(a,c){var d=b.get(c);d!=null&&(b.set(a.toString(),d),b["delete"](c))});return[b,a]}function o(a,b){b=b.broadcastId!=null&&c("WAWebWid").isWid(b.broadcastId)&&Boolean((b=b.broadcastId)==null?void 0:b.isBroadcastList());if(!b)return a;b=l(a);return p(a,new(c("WAWebMsgKey"))({id:b.id,fromMe:b.fromMe,remote:b.remote}))}function p(a,b){var d=j(a),e=a.id;a.id.remote.isUser()&&b.remote.isUser()&&(e=new(c("WAWebMsgKey"))({fromMe:a.id.fromMe,remote:b.remote,id:a.id.id}));return babelHelpers["extends"]({},a,(a={id:e},a[d]=b,a))}function a(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.map(l),e;b===d("WAWebAddonConstants").AddonProcessMode.OnlineReceive&&(e=(yield d("WAWebAddonPerfUtils").createMessagesQplMarker(d("WAWebAddonPerfUtils").AddonQplMarkerType.Incoming,{type:d("WAWebAddonPerfUtils").AnnotationRequestType.BulkGetParentMsgs,size:c.length})));try{b=(yield r(a));(c=e)==null?void 0:c.success();return b}catch(b){(a=e)==null?void 0:a.fail();throw b}});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(l);b=(yield d("WAWebAddonQueryUtils").getParentMsgsByMsgKey(b));return n(a,b)});return s.apply(this,arguments)}function e(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var c=[];for(var e of d("WAWebAddonPluginProcessor").getAddonProcessorsMap().entries()){var f=e[0],g=e[1];d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(f)&&c.push(g.convert.fromHistorySyncMsg(a))}f=(yield (h||(h=b("Promise"))).all(c).then(function(a){var b;return(b=[]).concat.apply(b,a)}));return f}catch(a){d("WALogger").WARN(i(),a).tags("addons","messaging").sendLogs("parseHistorySyncMsg");return[]}});return t.apply(this,arguments)}function f(a){var b=[],c=[],e=[];for(a of a){var f=a.parsedMsgPayload;if(d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(f.type)){var g=m(f);g!=null?b.push(g):c.push(a)}else f.kind===d("WAWebMsgType").MsgKind.ReactionDecrypted?e.push(f):c.push(a)}return{unifiedAddons:b,otherOrphans:c,legacyReactionAddons:e}}g.getParentMsgKeyName=j;g.getParentMsgKey=l;g.castToAddonMsgData=m;g.updateMsgParentKeyValue=p;g.queryAddonParentMsgs=a;g.queryParentMsgs=r;g.parseHistorySyncMsg=e;g.sortAddonOrphans=f}),98); __d("WAPhoneFindCC",[],(function(a,b,c,d,e,f){"use strict";var g=/^(1|2[07]|3[0-469]|4[013-9]|5[1-8]|6[0-6]|7|8[1246]|9[0-58])/;function a(a){return h(a)}function h(a){var b=a.match(g);if(b)return b[0];else return a.length>=3?a.substring(0,3):a}function b(a){a=a.match(/\d+/g);return a!=null?a.join(""):""}f.phoneCC=a;f.findCC=h;f.extractDigits=b}),66); __d("WAWebAck",[],(function(a,b,c,d,e,f){a={INACTIVE:-6,CONTENT_UNUPLOADABLE:-5,CONTENT_TOO_BIG:-4,CONTENT_GONE:-3,EXPIRED:-2,FAILED:-1,CLOCK:0,SENT:1,RECEIVED:2,READ:3,PLAYED:4,PEER:5};b={NONE:-1,MESSAGE_EDIT:1,PIN_IN_CHAT:2,NEWSLETTER_MSG_EDIT:3,SENDER_REVOKE:7,ADMIN_REVOKE:8};c={SENDER:"sender",DELIVERY:"delivery",READ:"read",PLAYED:"played",INACTIVE:"inactive",READ_SELF:"read-self",PLAYED_SELF:"played-self"};f.ACK=a;f.EDIT_ATTR=b;f.ACK_STRING=c}),66); __d("WAWebBizSystemMsgSubtypes",[],(function(a,b,c,d,e,f){a=["blue_msg_bsp_fb_to_bsp_premise","blue_msg_bsp_fb_to_self_fb","blue_msg_bsp_fb_to_self_premise","blue_msg_bsp_fb_unverified","blue_msg_bsp_fb_unverified_to_bsp_premise_verified","blue_msg_bsp_fb_unverified_to_self_fb_verified","blue_msg_bsp_fb_unverified_to_self_premise_verified","blue_msg_bsp_fb_verified","blue_msg_bsp_fb_verified_to_bsp_premise_unverified","blue_msg_bsp_fb_verified_to_self_fb_unverified","blue_msg_bsp_fb_verified_to_self_premise_unverified","blue_msg_bsp_premise_to_self_premise","blue_msg_bsp_premise_unverified","blue_msg_bsp_premise_unverified_to_self_premise_verified","blue_msg_bsp_premise_verified","blue_msg_bsp_premise_verified_to_self_premise_unverified","blue_msg_consumer_to_bsp_fb_unverified","blue_msg_consumer_to_bsp_premise_unverified","blue_msg_consumer_to_self_fb_unverified","blue_msg_consumer_to_self_premise_unverified","blue_msg_self_fb_to_bsp_premise","blue_msg_self_fb_to_self_premise","blue_msg_self_fb_unverified","blue_msg_self_fb_unverified_to_bsp_premise_verified","blue_msg_self_fb_unverified_to_self_premise_verified","blue_msg_self_fb_verified","blue_msg_self_fb_verified_to_bsp_premise_unverified","blue_msg_self_fb_verified_to_self_premise_unverified","blue_msg_self_premise_to_bsp_premise","blue_msg_self_premise_unverified","blue_msg_self_premise_verified","blue_msg_to_bsp_fb","blue_msg_to_consumer","blue_msg_to_self_fb","blue_msg_unverified_to_bsp_fb_verified","blue_msg_unverified_to_bsp_premise_verified","blue_msg_unverified_to_self_fb_verified","blue_msg_unverified_to_verified","blue_msg_verified_to_bsp_fb_unverified","blue_msg_verified_to_bsp_premise_unverified","blue_msg_verified_to_self_fb_unverified","blue_msg_verified_to_unverified"];b=["biz_privacy_mode_init_fb","biz_privacy_mode_init_bsp"];c=["biz_privacy_mode_to_fb","biz_privacy_mode_to_bsp"];d=[].concat(b,c);e=["biz_account_type_is_hosted","biz_account_type_changed_to_hosted","biz_me_account_type_is_hosted","biz_me_account_type_is_hosted_transition"];c="product_inquiry";f.BIZ_SYSTEM_MSG_SUBTYPES=a;f.BIZ_SYSTEM_MSG_SUBTYPES_V2_INIT=b;f.BIZ_SYSTEM_MSG_SUBTYPES_V2=d;f.COEX_MSG_SUBTYPES=e;f.PRODUCT_INQUIRY_TYPE=c}),66); __d("WAWebBotTypes",["$InternalEnum"],(function(a,b,c,d,e,f){c=(a=b("$InternalEnum"))({FIRST:"first",INNER:"inner",LAST:"last",FULL:"full"});d=a({BIZ_1P:"biz_1p",BIZ_3P:"biz_3p"});e=a.Mirrored(["POSITIVE","NEGATIVE_GENERIC","NEGATIVE_HELPFUL","NEGATIVE_INTERESTING","NEGATIVE_ACCURATE","NEGATIVE_SAFE","NEGATIVE_OTHER","NEGATIVE_REFUSED","NEGATIVE_NOT_VISUALLY_APPEALING","NEGATIVE_NOT_RELEVANT_TO_TEXT","NEGATIVE_NOT_ENTERTAINING","NEGATIVE_NOT_CUSTOMIZABLE","NEGATIVE_NOT_INTERESTING"]);b=a({UNKNOWN:"unknown",PARTIAL_1P:"1p_partial",FULL_3P:"3p_full"});var g=a({NONE:"none",BASIC:"basic"}),h=a({PROMPT:"prompt",COMMAND:"command",VOICE:"voice"});a=a({DEFAULT:"default",UGC:"ugc",FIRST_PARTY_CHARACTER:"1p"});f.BotMsgEditType=c;f.BizBotType=d;f.BotFeedbackKind=e;f.BizBotAutomatedType=b;f.BotWelcomeMsgProtocolModeType=g;f.BotMsgBodyType=h;f.BotPersonaType=a}),66); __d("WAWebBusinessHSMTypes",[],(function(a,b,c,d,e,f){a={MARKETING:"MARKETING",UTILITY:"UTILITY",AUTHENTICATION:"AUTHENTICATION"};f.HSM_TAG_TYPE=a}),66); __d("WAWebCallLogMsgData.flow",["$InternalEnum"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum").Mirrored(["Completed","Missed","Rejected","Canceled","AcceptedElsewhere","Ongoing","Failed","Unknown"]);g.CallOutcome=a}),98); __d("WAWebRichResponse.flow",[],(function(a,b,c,d,e,f){"use strict";a={Standard:"Standard"};b={Parsed:"Parsed",Partial:"Partial",Unparsed:"Unparsed"};c={Unknown:"Unknown",Text:"Text",Table:"Table"};f.ParsedRichResponseType=a;f.RichResponseParseState=b;f.RichResponseFragmentType=c}),66); __d("WAWebCommonMsgUtils",["$InternalEnum","WALogger","WAWebMsgType","WAWebRichResponse.flow"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["undefined message type msgId::",""]);h=function(){return a};return a}b=b("$InternalEnum")({DEFAULT:"d",SIGNIFICANT:"s",AMBIENT:"a",NOTEWORTHY:"n",IGNORE:"i"});function a(a,b){switch(a){case d("WAWebMsgType").MSG_TYPE.GP2:case d("WAWebMsgType").MSG_TYPE.BROADCAST_NOTIFICATION:case d("WAWebMsgType").MSG_TYPE.NOTIFICATION:case d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE:case d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION:case d("WAWebMsgType").MSG_TYPE.PINNED_MESSAGE:case d("WAWebMsgType").MSG_TYPE.NEWSLETTER_NOTIFICATION:return!0;case d("WAWebMsgType").MSG_TYPE.PROTOCOL:return b==="ephemeral_setting"||b==="share_phone_number"||b==="event_edit_decrypted";default:return!1}}function c(a){return a===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT||a===d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER}function e(a){if(a.type!==d("WAWebMsgType").MSG_TYPE.CIPHERTEXT)return!1;return a.subtype==="view_once_unavailable_fanout"?!1:!0}function f(a){return a===d("WAWebMsgType").MSG_TYPE.UNKNOWN}function i(a){return a===d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE}function j(a){if(!i(a.type))return!1;a=(a=a.richResponse)==null?void 0:a.parseState;return a===d("WAWebRichResponse.flow").RichResponseParseState.Partial||a===d("WAWebRichResponse.flow").RichResponseParseState.Parsed}function k(a){a.forEach(function(a){a.type===void 0&&d("WALogger").ERROR(h(),a.id).sendLogs("undefined-msg-type",{sampling:.01})})}g.EventType=b;g.isNotificationType=a;g.isPlaceholderMsg=c;g.isReportablePlaceholderMsg=e;g.isFutureproofMsg=f;g.isRichResponseMsg=i;g.isSomewhatParsedRichResponseMsg=j;g.logUndefinedMessage=k}),98); __d("WAWebEphemeralConstants",["$InternalEnum","WATimeUtils"],(function(a,b,c,d,e,f,g){c=d("WATimeUtils").DAY_SECONDS*7;e=d("WATimeUtils").DAY_SECONDS*90;f=b("$InternalEnum").Mirrored(["KEPT","UNKEPT"]);var h=b("$InternalEnum").Mirrored(["Seconds","Minutes","Hours","Days","Weeks"]);function a(a,b){b===void 0&&(b=!1);if(a<=d("WATimeUtils").MINUTE_SECONDS)return{duration:a,unit:h.Seconds};else if(a<d("WATimeUtils").HOUR_SECONDS){var c=Math.floor(a/60);return{duration:c,unit:h.Minutes}}else if(a<=d("WATimeUtils").DAY_SECONDS){c=Math.floor(a/60/60);return{duration:c,unit:h.Hours}}else if(Boolean(b)){if(a<d("WATimeUtils").WEEK_SECONDS){c=Math.floor(a/24/60/60);return{duration:c,unit:h.Days}}b=Math.floor(a/7/24/60/60);return{duration:b,unit:h.Weeks}}c=Math.floor(a/24/60/60);return{duration:c,unit:h.Days}}g.ONE_DAY=d("WATimeUtils").DAY_SECONDS;g.SEVEN_DAYS=c;g.NINETY_DAYS=e;g.KeepInChatState=f;g.DurationUnit=h;g.getDurationForString=a}),98); __d("WAWebEphemeralityTypes",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({ChangedInChat:"chat",InitiatedByMe:"me",InitiatedByOther:"other",BizUpgradeFbHosting:"biz_upgrade_fb_hosting"});c=b("$InternalEnum")({Unknown:"unknown",ChatSettings:"chat_settings",AccountSettings:"account_settings",BulkChange:"bulk_change",BizSupportFbHosting:"biz_supports_fb_hosting",UnknownGroups:"unknown_groups"});f.DisappearingModeInitiator=a;f.DisappearingModeTrigger=c}),66); __d("WAWebWamEnumDisappearingChatInitiatorType",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT:1,INITIATED_BY_ME:2,INITIATED_BY_OTHER:3,CHAT_PICKER:4,BIZ_UPGRADE_FB_HOSTING:5});f.DISAPPEARING_CHAT_INITIATOR_TYPE=a}),66); __d("WAWebWamEnumEphemeralityInitiatorType",[],(function(a,b,c,d,e,f){a=Object.freeze({INITIATED_BY_ME:1,INITIATED_BY_OTHER:2,BIZ_UPGRADE_FB_HOSTING:3});f.EPHEMERALITY_INITIATOR_TYPE=a}),66); __d("WAWebWamEnumEphemeralityTriggerActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,CHAT_SETTINGS:1,ACCOUNT_SETTINGS:2,BULK_CHANGE:3,BIZ_SUPPORTS_FB_HOSTING:4,UNKNOWN_GROUP:5});f.EPHEMERALITY_TRIGGER_ACTION_TYPE=a}),66); __d("WAWebEphemeralityWAMUtils",["WAWebEphemeralityTypes","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.ACCOUNT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.CHAT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.BULK_CHANGE;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.UNKNOWN_GROUP;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting:case d("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.UNKNOWN}}function b(a){a===void 0&&(a=!1);return Boolean(a)?d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE.INITIATED_BY_ME:d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE.INITIATED_BY_OTHER}function c(a){switch(a){case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_ME;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther:case d("WAWebEphemeralityTypes").DisappearingModeInitiator.BizUpgradeFbHosting:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_OTHER;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.CHAT}}g.getWamDisappearingModeTrigger=a;g.getWamDisappearingModeInitiatedByMe=b;g.getWamDisappearingModeInitiator=c}),98); __d("WAWebInteractiveMessageHeaderMediaType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["IMAGE","VIDEO","DOCUMENT","PRODUCT"]);c=new Set([a.IMAGE,a.VIDEO,a.DOCUMENT,a.PRODUCT]);f.InteractiveMessageHeaderMediaType=a;f.IM_MEDIA_HEADER_TYPES=c}),66); __d("WAWebCountriesNativeCountryNames",[],(function(a,b,c,d,e,f){a={AC:"Ascension Island",AD:"Andorra",AE:"\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062a \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0645\u062a\u062d\u062f\u0629",AF:"\u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646",AG:"Antigua & Barbuda",AI:"Anguilla",AL:"Shqip\xebri",AM:"\u0540\u0561\u0575\u0561\u057d\u057f\u0561\u0576",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"\xd6sterreich",AU:"Australia",AW:"Aruba",AX:"\xc5land",AZ:"Az\u0259rbaycan",BA:"Bosna i Hercegovina",BB:"Barbados",BD:"\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6",BE:"Belgi\xeb",BF:"Burkina Faso",BG:"\u0411\u044a\u043b\u0433\u0430\u0440\u0438\u044f",BH:"\u0627\u0644\u0628\u062d\u0631\u064a\u0646",BI:"Burundi",BJ:"B\xe9nin",BL:"Saint-Barth\xe9lemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"Caribisch Nederland",BR:"Brasil",BS:"Bahamas",BT:"\u0f60\u0f56\u0fb2\u0f74\u0f42",BW:"Botswana",BY:"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c",BZ:"Belize",CA:"Canada",CC:"Kepulauan Cocos (Keeling)",CD:"Congo-Kinshasa",CF:"R\xe9publique centrafricaine",CG:"Congo-Brazzaville",CH:"Schweiz",CI:"C\xf4te d\u2019Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"\u4e2d\u56fd",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Cura\xe7ao",CX:"Christmas Island",CY:"\u039a\u03cd\u03c0\u03c1\u03bf\u03c2",CZ:"\u010cesko",DE:"Deutschland",DJ:"Djibouti",DK:"Danmark",DM:"Dominica",DO:"Rep\xfablica Dominicana",DZ:"\u0627\u0644\u062c\u0632\u0627\u0626\u0631",EC:"Ecuador",EE:"Eesti",EG:"\u0645\u0635\u0631",ER:"\u0625\u0631\u064a\u062a\u0631\u064a\u0627",ES:"Espa\xf1a",ET:"\u12a2\u1275\u12ee\u1335\u12eb",FI:"Suomi",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"F\xf8royar",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"\u10e1\u10d0\u10e5\u10d0\u10e0\u10d7\u10d5\u10d4\u10da\u10dd",GF:"Guyane fran\xe7aise",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Kalaallit Nunaat",GM:"Gambia",GN:"Guin\xe9e",GP:"Guadeloupe",GQ:"Guinea Ecuatorial",GR:"\u0395\u03bb\u03bb\u03ac\u03b4\u03b1",GT:"Guatemala",GU:"Guam",GW:"Guin\xe9-Bissau",GY:"Guyana",HK:"\u4e2d\u570b\u9999\u6e2f\u7279\u5225\u884c\u653f\u5340",HN:"Honduras",HR:"Hrvatska",HT:"Ha\xefti",HU:"Magyarorsz\xe1g",ID:"Indonesia",IE:"Ireland",IL:"\u05d9\u05e9\u05e8\u05d0\u05dc",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"\u0627\u0644\u0639\u0631\u0627\u0642",IR:"\u0627\u06cc\u0631\u0627\u0646",IS:"\xcdsland",IT:"Italia",JE:"Jersey",JM:"Jamaica",JO:"\u0627\u0644\u0623\u0631\u062f\u0646",JP:"\u65e5\u672c",KE:"Kenya",KG:"\u041a\u044b\u0440\u0433\u044b\u0437\u0441\u0442\u0430\u043d",KH:"\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6",KI:"Kiribati",KM:"\u062c\u0632\u0631 \u0627\u0644\u0642\u0645\u0631",KN:"St. Kitts & Nevis",KP:"\uc870\uc120\ubbfc\uc8fc\uc8fc\uc758\uc778\ubbfc\uacf5\ud654\uad6d",KR:"\ub300\ud55c\ubbfc\uad6d",KW:"\u0627\u0644\u0643\u0648\u064a\u062a",KY:"Cayman Islands",KZ:"\u049a\u0430\u0437\u0430\u049b\u0441\u0442\u0430\u043d",LA:"\u0ea5\u0eb2\u0ea7",LB:"\u0644\u0628\u0646\u0627\u0646",LC:"St. Lucia",LI:"Liechtenstein",LK:"\u0dc1\u0dca\u200d\u0dbb\u0dd3 \u0dbd\u0d82\u0d9a\u0dcf\u0dc0",LR:"Liberia",LS:"Lesotho",LT:"Lietuva",LU:"L\xebtzebuerg",LV:"Latvija",LY:"\u0644\u064a\u0628\u064a\u0627",MA:"\u0627\u0644\u0645\u063a\u0631\u0628",MC:"Monaco",MD:"Republica Moldova",ME:"\u0426\u0440\u043d\u0430 \u0413\u043e\u0440\u0430",MF:"Saint-Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"\u0421\u0435\u0432\u0435\u0440\u043d\u0430 \u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0438\u0458\u0430",ML:"Mali",MM:"\u1019\u103c\u1014\u103a\u1019\u102c",MN:"\u041c\u043e\u043d\u0433\u043e\u043b",MO:"\u4e2d\u570b\u6fb3\u9580\u7279\u5225\u884c\u653f\u5340",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"\u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"M\xe9xico",MY:"Malaysia",MZ:"Mo\xe7ambique",NA:"Namibia",NC:"Nouvelle-Cal\xe9donie",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Nederland",NO:"Norge",NP:"\u0928\u0947\u092a\u093e\u0932",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"\u0639\u064f\u0645\u0627\u0646",PA:"Panam\xe1",PE:"Per\xfa",PF:"Polyn\xe9sie fran\xe7aise",PG:"Papua New Guinea",PH:"Philippines",PK:"\u067e\u0627\u06a9\u0633\u062a\u0627\u0646",PL:"Polska",PM:"Saint-Pierre-et-Miquelon",PR:"Puerto Rico",PS:"\u0627\u0644\u0623\u0631\u0627\u0636\u064a \u0627\u0644\u0641\u0644\u0633\u0637\u064a\u0646\u064a\u0629",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"\u0642\u0637\u0631",RE:"La R\xe9union",RO:"Rom\xe2nia",RS:"\u0421\u0440\u0431\u0438\u0458\u0430",RU:"\u0420\u043e\u0441\u0441\u0438\u044f",RW:"U Rwanda",SA:"\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629",SB:"Solomon Islands",SC:"Seychelles",SD:"\u0627\u0644\u0633\u0648\u062f\u0627\u0646",SE:"Sverige",SG:"Singapore",SH:"St. Helena",SI:"Slovenija",SJ:"\u0428\u043f\u0438\u0446\u0431\u0435\u0440\u0433\u0435\u043d \u0438 \u042f\u043d-\u041c\u0430\u0439\u0435\u043d",SK:"Slovensko",SL:"Sierra Leone",SM:"San Marino",SN:"S\xe9n\xe9gal",SO:"Soomaaliya",SR:"Suriname",SS:"South Sudan",ST:"S\xe3o Tom\xe9 e Pr\xedncipe",SV:"El Salvador",SX:"Sint-Maarten",SY:"\u0633\u0648\u0631\u064a\u0627",SZ:"Eswatini",TC:"Turks & Caicos Islands",TD:"Tchad",TG:"Togo",TH:"\u0e44\u0e17\u0e22",TJ:"\u0422\u043e\u04b7\u0438\u043a\u0438\u0441\u0442\u043e\u043d",TK:"Tokelau",TL:"Timor-Leste",TM:"T\xfcrkmenistan",TN:"\u062a\u0648\u0646\u0633",TO:"Tonga",TR:"T\xfcrkiye",TT:"Trinidad & Tobago",TV:"Tuvalu",TW:"\u53f0\u7063",TZ:"Tanzania",UA:"\u0423\u043a\u0440\u0430\u0457\u043d\u0430",UG:"Uganda",US:"United States",UY:"Uruguay",UZ:"O\u02bbzbekiston",VA:"Citt\xe0 del Vaticano",VC:"St. Vincent & Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vi\u1ec7t Nam",VU:"Vanuatu",WF:"Wallis-et-Futuna",WS:"Samoa",XK:"Kosov\xeb",YE:"\u0627\u0644\u064a\u0645\u0646",YT:"Mayotte",ZA:"iNingizimu Afrika",ZM:"Zambia",ZW:"Zimbabwe"};f["default"]=a}),66); __d("WAWebL10NCountryCodes",[],(function(a,b,c,d,e,f){var g={1:{2:{0:{4:{c:"CA"}},2:{6:{c:"CA"}},3:{6:{c:"CA"}},4:{2:{c:"BS"},9:{c:"CA"}},5:{0:{c:"CA"}},6:{4:{c:"AI"},8:{c:"AG"}},8:{4:{c:"VG"},9:{c:"CA"}}},3:{0:{6:{c:"CA"}},4:{0:{c:"VI"},3:{c:"CA"},5:{c:"KY"}},6:{5:{c:"CA"},7:{c:"CA"}}},4:{0:{3:{c:"CA"}},1:{6:{c:"CA"},8:{c:"CA"}},3:{1:{c:"CA"},7:{c:"CA"},8:{c:"CA"}},4:{1:{c:"BM"}},5:{0:{c:"CA"}},7:{3:{c:"GD"}}},5:{0:{6:{c:"CA"}},1:{4:{c:"CA"},9:{c:"CA"}},4:{8:{c:"CA"}},7:{9:{c:"CA"}},8:{1:{c:"CA"},7:{c:"CA"}}},6:{0:{4:{c:"CA"}},1:{3:{c:"CA"}},3:{9:{c:"CA"}},4:{7:{c:"CA"},9:{c:"TC"}},5:{8:{c:"JM"}},6:{4:{c:"MS"}},7:{0:{c:"MP"},1:{c:"GU"},2:{c:"CA"}},8:{4:{c:"AS"}}},7:{0:{5:{c:"CA"},9:{c:"CA"}},2:{1:{c:"MF"}},5:{8:{c:"LC"}},6:{7:{c:"DM"}},7:{8:{c:"CA"}},8:{0:{c:"CA"},2:{c:"CA"},4:{c:"VC"},7:{c:"PR"}}},8:{0:{7:{c:"CA"},9:{c:"DO"}},1:{9:{c:"CA"}},2:{5:{c:"CA"},9:{c:"DO"}},4:{9:{c:"DO"}},6:{7:{c:"CA"},8:{c:"TT"},9:{c:"KN"}},7:{3:{c:"CA"},6:{c:"JM"}}},9:{0:{2:{c:"CA"},5:{c:"CA"}},3:{9:{c:"PR"}}}},2:{0:{c:"EG"},1:{1:{c:"SS"},2:{c:"MA"},3:{c:"DZ"},6:{c:"TN"},8:{c:"LY"}},2:{0:{c:"GM"},1:{c:"SN"},2:{c:"MR"},3:{c:"ML"},4:{c:"GN"},5:{c:"CI"},6:{c:"BF"},7:{c:"NE"},8:{c:"TG"},9:{c:"BJ"}},3:{0:{c:"MU"},1:{c:"LR"},2:{c:"SL"},3:{c:"GH"},4:{c:"NG"},5:{c:"TD"},6:{c:"CF"},7:{c:"CM"},8:{c:"CV"},9:{c:"ST"}},4:{0:{c:"GQ"},1:{c:"GA"},2:{c:"CG"},3:{c:"CD"},4:{c:"AO"},5:{c:"GW"},6:{c:"IO"},7:{c:"AC"},8:{c:"SC"},9:{c:"SD"}},5:{0:{c:"RW"},1:{c:"ET"},2:{c:"SO"},3:{c:"DJ"},4:{c:"KE"},5:{c:"TZ"},6:{c:"UG"},7:{c:"BI"},8:{c:"MZ"}},6:{0:{c:"ZM"},1:{c:"MG"},2:{c:"RE"},3:{c:"ZW"},4:{c:"NA"},5:{c:"MW"},6:{c:"LS"},7:{c:"BW"},8:{c:"SZ"},9:{c:"KM"}},7:{c:"ZA"},9:{0:{c:"SH"},1:{c:"ER"},7:{c:"AW"},8:{c:"FO"},9:{c:"GL"}}},3:{0:{c:"GR"},1:{c:"NL"},2:{c:"BE"},3:{c:"FR"},4:{c:"ES"},5:{0:{c:"GI"},1:{c:"PT"},2:{c:"LU"},3:{c:"IE"},4:{c:"IS"},5:{c:"AL"},6:{c:"MT"},7:{c:"CY"},8:{c:"FI"},9:{c:"BG"}},6:{c:"HU"},7:{0:{c:"LT"},1:{c:"LV"},2:{c:"EE"},3:{c:"MD"},4:{c:"AM"},5:{c:"BY"},6:{c:"AD"},7:{c:"MC"},8:{c:"SM"}},8:{0:{c:"UA"},1:{c:"RS"},2:{c:"ME"},3:{c:"XK"},5:{c:"HR"},6:{c:"SI"},7:{c:"BA"},9:{c:"MK"}},9:{c:"IT"}},4:{0:{c:"RO"},1:{c:"CH"},2:{0:{c:"CZ"},1:{c:"SK"},3:{c:"LI"}},3:{c:"AT"},4:{c:"GB"},5:{c:"DK"},6:{c:"SE"},7:{c:"NO"},8:{c:"PL"},9:{c:"DE"}},5:{0:{0:{c:"FK"},1:{c:"BZ"},2:{c:"GT"},3:{c:"SV"},4:{c:"HN"},5:{c:"NI"},6:{c:"CR"},7:{c:"PA"},8:{c:"PM"},9:{c:"HT"}},1:{c:"PE"},2:{c:"MX"},3:{c:"CU"},4:{c:"AR"},5:{c:"BR"},6:{c:"CL"},7:{c:"CO"},8:{c:"VE"},9:{0:{c:"GP"},1:{c:"BO"},2:{c:"GY"},3:{c:"EC"},4:{c:"GF"},5:{c:"PY"},6:{c:"MQ"},7:{c:"SR"},8:{c:"UY"},9:{c:"CW"}}},6:{0:{c:"MY"},1:{c:"AU"},2:{c:"ID"},3:{c:"PH"},4:{c:"NZ"},5:{c:"SG"},6:{c:"TH"},7:{0:{c:"TL"},2:{c:"NF"},3:{c:"BN"},4:{c:"NR"},5:{c:"PG"},6:{c:"TO"},7:{c:"SB"},8:{c:"VU"},9:{c:"FJ"}},8:{0:{c:"PW"},1:{c:"WF"},2:{c:"CK"},3:{c:"NU"},5:{c:"WS"},6:{c:"KI"},7:{c:"NC"},8:{c:"TV"},9:{c:"PF"}},9:{0:{c:"TK"},1:{c:"FM"},2:{c:"MH"}}},7:{c:"RU"},8:{1:{c:"JP"},2:{c:"KR"},4:{c:"VN"},5:{0:{c:"KP"},2:{c:"HK"},3:{c:"MO"},5:{c:"KH"},6:{c:"LA"}},6:{c:"CN"},8:{0:{c:"BD"},6:{c:"TW"}}},9:{0:{c:"TR"},1:{c:"IN"},2:{c:"PK"},3:{c:"AF"},4:{c:"LK"},5:{c:"MM"},6:{0:{c:"MV"},1:{c:"LB"},2:{c:"JO"},3:{c:"SY"},4:{c:"IQ"},5:{c:"KW"},6:{c:"SA"},7:{c:"YE"},8:{c:"OM"}},7:{0:{c:"PS"},1:{c:"AE"},2:{c:"IL"},3:{c:"BH"},4:{c:"QA"},5:{c:"BT"},6:{c:"MN"},7:{c:"NP"}},8:{c:"IR"},9:{2:{c:"TJ"},3:{c:"TM"},4:{c:"AZ"},5:{c:"GE"},6:{c:"KG"},8:{c:"UZ"}}}};function h(a,b){if(a!=null&&a.length>0&&b!=null){b=b[a[0]];a=a;while(a.length>0&&b){if(b.c)return b.c;a=a.substr(1,a.length-1);b=b[a[0]]}}return""}function a(a){if(a==null||a.length===0)return"";var b=h(a,g);if(b===""&&a[0]==="1")return"US";return b==="RU"&&["6","7"].includes(a[1])?"KZ":b}f.getCountryShortcodeByPhone=a}),66); __d("WAWebL10nGetRenderedLocale",["IntlCurrentLocale"],(function(a,b,c,d,e,f,g){"use strict";function a(){return c("IntlCurrentLocale").code}g.WAWebL10nGetRenderedLocale=a}),98); __d("WAWebLocaleModules",["JSResource","WAWebL10nGetRenderedLocale","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){switch(d("WAWebL10nGetRenderedLocale").WAWebL10nGetRenderedLocale()){case"af_ZA":return c("JSResource")("WAWebCountriesLocaleAF").__setRef("WAWebLocaleModules").load();case"ar_AR":return c("JSResource")("WAWebCountriesLocaleAR").__setRef("WAWebLocaleModules").load();case"az_AZ":return c("JSResource")("WAWebCountriesLocaleAZ").__setRef("WAWebLocaleModules").load();case"bg_BG":return c("JSResource")("WAWebCountriesLocaleBG").__setRef("WAWebLocaleModules").load();case"bn_IN":return c("JSResource")("WAWebCountriesLocaleBN").__setRef("WAWebLocaleModules").load();case"ca_ES":return c("JSResource")("WAWebCountriesLocaleCA").__setRef("WAWebLocaleModules").load();case"cs_CZ":return c("JSResource")("WAWebCountriesLocaleCS").__setRef("WAWebLocaleModules").load();case"da_DK":return c("JSResource")("WAWebCountriesLocaleDA").__setRef("WAWebLocaleModules").load();case"de_DE":return c("JSResource")("WAWebCountriesLocaleDE").__setRef("WAWebLocaleModules").load();case"el_GR":return c("JSResource")("WAWebCountriesLocaleEL").__setRef("WAWebLocaleModules").load();case"en_GB":return c("JSResource")("WAWebCountriesLocaleEN").__setRef("WAWebLocaleModules").load();case"es_LA":return c("JSResource")("WAWebCountriesLocaleES").__setRef("WAWebLocaleModules").load();case"et_EE":return c("JSResource")("WAWebCountriesLocaleET").__setRef("WAWebLocaleModules").load();case"fa_IR":return c("JSResource")("WAWebCountriesLocaleFA").__setRef("WAWebLocaleModules").load();case"fi_FI":return c("JSResource")("WAWebCountriesLocaleFI").__setRef("WAWebLocaleModules").load();case"tl_PH":return c("JSResource")("WAWebCountriesLocaleFIL").__setRef("WAWebLocaleModules").load();case"fr_FR":return c("JSResource")("WAWebCountriesLocaleFR").__setRef("WAWebLocaleModules").load();case"gu_IN":return c("JSResource")("WAWebCountriesLocaleGU").__setRef("WAWebLocaleModules").load();case"he_IL":return c("JSResource")("WAWebCountriesLocaleHE").__setRef("WAWebLocaleModules").load();case"hi_IN":return c("JSResource")("WAWebCountriesLocaleHI").__setRef("WAWebLocaleModules").load();case"hr_HR":return c("JSResource")("WAWebCountriesLocaleHR").__setRef("WAWebLocaleModules").load();case"hu_HU":return c("JSResource")("WAWebCountriesLocaleHU").__setRef("WAWebLocaleModules").load();case"id_ID":return c("JSResource")("WAWebCountriesLocaleID").__setRef("WAWebLocaleModules").load();case"it_IT":return c("JSResource")("WAWebCountriesLocaleIT").__setRef("WAWebLocaleModules").load();case"ja_JP":return c("JSResource")("WAWebCountriesLocaleJA").__setRef("WAWebLocaleModules").load();case"kk_KZ":return c("JSResource")("WAWebCountriesLocaleKK").__setRef("WAWebLocaleModules").load();case"kn_IN":return c("JSResource")("WAWebCountriesLocaleKN").__setRef("WAWebLocaleModules").load();case"ko_KR":return c("JSResource")("WAWebCountriesLocaleKO").__setRef("WAWebLocaleModules").load();case"lt_LT":return c("JSResource")("WAWebCountriesLocaleLT").__setRef("WAWebLocaleModules").load();case"lv_LV":return c("JSResource")("WAWebCountriesLocaleLV").__setRef("WAWebLocaleModules").load();case"mk_MK":return c("JSResource")("WAWebCountriesLocaleMK").__setRef("WAWebLocaleModules").load();case"ml_IN":return c("JSResource")("WAWebCountriesLocaleML").__setRef("WAWebLocaleModules").load();case"mr_IN":return c("JSResource")("WAWebCountriesLocaleMR").__setRef("WAWebLocaleModules").load();case"ms_MY":return c("JSResource")("WAWebCountriesLocaleMS").__setRef("WAWebLocaleModules").load();case"nb_NO":return c("JSResource")("WAWebCountriesLocaleNB").__setRef("WAWebLocaleModules").load();case"nl_NL":return c("JSResource")("WAWebCountriesLocaleNL").__setRef("WAWebLocaleModules").load();case"pa_IN":return c("JSResource")("WAWebCountriesLocalePA").__setRef("WAWebLocaleModules").load();case"pl_PL":return c("JSResource")("WAWebCountriesLocalePL").__setRef("WAWebLocaleModules").load();case"pt_BR":case"pt_PT":return c("JSResource")("WAWebCountriesLocalePT").__setRef("WAWebLocaleModules").load();case"ro_RO":return c("JSResource")("WAWebCountriesLocaleRO").__setRef("WAWebLocaleModules").load();case"ru_RU":return c("JSResource")("WAWebCountriesLocaleRU").__setRef("WAWebLocaleModules").load();case"sk_SK":return c("JSResource")("WAWebCountriesLocaleSK").__setRef("WAWebLocaleModules").load();case"sl_SI":return c("JSResource")("WAWebCountriesLocaleSL").__setRef("WAWebLocaleModules").load();case"sq_AL":return c("JSResource")("WAWebCountriesLocaleSQ").__setRef("WAWebLocaleModules").load();case"sr_RS":return c("JSResource")("WAWebCountriesLocaleSR").__setRef("WAWebLocaleModules").load();case"sv_SE":return c("JSResource")("WAWebCountriesLocaleSV").__setRef("WAWebLocaleModules").load();case"sw_KE":return c("JSResource")("WAWebCountriesLocaleSW").__setRef("WAWebLocaleModules").load();case"ta_IN":return c("JSResource")("WAWebCountriesLocaleTA").__setRef("WAWebLocaleModules").load();case"te_IN":return c("JSResource")("WAWebCountriesLocaleTE").__setRef("WAWebLocaleModules").load();case"th_TH":return c("JSResource")("WAWebCountriesLocaleTH").__setRef("WAWebLocaleModules").load();case"tr_TR":return c("JSResource")("WAWebCountriesLocaleTR").__setRef("WAWebLocaleModules").load();case"uk_UA":return c("JSResource")("WAWebCountriesLocaleUK").__setRef("WAWebLocaleModules").load();case"ur_PK":return c("JSResource")("WAWebCountriesLocaleUR").__setRef("WAWebLocaleModules").load();case"uz_UZ":return c("JSResource")("WAWebCountriesLocaleUZ").__setRef("WAWebLocaleModules").load();case"vi_VN":return c("JSResource")("WAWebCountriesLocaleVI").__setRef("WAWebLocaleModules").load();case"zh_CN":return c("JSResource")("WAWebCountriesLocaleZH-CN").__setRef("WAWebLocaleModules").load();case"zh_TW":return c("JSResource")("WAWebCountriesLocaleZH-TW").__setRef("WAWebLocaleModules").load();case"zh_HK":return c("JSResource")("WAWebCountriesLocaleZH-HK").__setRef("WAWebLocaleModules").load();default:return c("JSResource")("WAWebCountriesLocaleEN").__setRef("WAWebLocaleModules").load()}});return h.apply(this,arguments)}g.getCountryData=a}),98); __d("WAWebCountriesUtils",["WAWebCountriesNativeCountryNames","WAWebL10NCountryCodes","WAWebLocaleModules","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=Object.freeze({META_RECOGNIZED:"META_RECOGNIZED",WHATSAPP_REGISTRATION:"WHATSAPP_REGISTRATION"}),i=new Map(Object.entries(c("WAWebCountriesNativeCountryNames")).map(function(a){a=a[0];return[a,a]})),j=(c={},c[h.META_RECOGNIZED]=["AC","CP","DG","EA","EU","EZ","IC","QO","TA","UN","XA","XB"],c[h.WHATSAPP_REGISTRATION]=["AQ","BV","CP","DG","EA","EH","EU","EZ","GS","HM","IC","PN","QO","TA","TF","UM","UN","XA","XB","ZZ"],c);function k(a,b,c){if(a==null||a==="")return void 0;if(c==null)return void 0;return b&&j[b].includes(a.toUpperCase())?void 0:c[a.toUpperCase()]}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebLocaleModules").getCountryData());return k(a,b,c)});return m.apply(this,arguments)}function n(a){if(a.countriesMap==null)return[];var b=Object.entries(a.countriesMap).filter(function(b){b=b[0];return!b.includes("@")&&!j[a.filter].includes(b)}).sort(function(a,b){a=a[1];b=b[1];return String(a).localeCompare(String(b))});a.prependWith!=null&&b.unshift([a.prependWith[0],a.prependWith[1].toJSON()]);return b.map(function(a){var b=a[0];a=a[1];return[b,a]})}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebLocaleModules").getCountryData());return n(babelHelpers["extends"]({},a,{countriesMap:b}))});return o.apply(this,arguments)}function e(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(a);if(a!=="")return l(a)});return p.apply(this,arguments)}function f(a){return i.get(a)}g.COUNTRY_FILTER_TYPE=h;g.getCountryNameWithMap=k;g.getCountryName=l;g.getCountriesWithMap=n;g.getCountries=a;g.getCountryNameByPhone=e;g.asISOCountryCode=f}),98); __d("WAWebMusicParsingUtils",["WABase64","WALogger","WAWebCountriesUtils"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[music] invalid country codes"]);h=function(){return a};return a}function i(a){a=Array.from(new Uint8Array(a)).map(function(a){return String.fromCharCode(a)});var b=new Set(),c=new Set();for(var e=0;e<a.length-1;e+=2){var f=(""+a[e]+a[e+1]).toUpperCase(),g=d("WAWebCountriesUtils").asISOCountryCode(f);g!=null?b.add(g):c.add(f)}c.size>0&&d("WALogger").ERROR(h()).devConsole(c).sendLogs("music-invalid-country-codes");return b}function a(a){var b=a.musicContentMediaId,c=a.songId,e=a.author,f=a.title,g=a.artworkDirectPath,h=a.artworkSha256,j=a.artworkEncSha256,k=a.artistAttribution,l=a.countryBlocklist,m=a.isExplicit;a=a.artworkMediaKey;return b==null||c==null||e==null||f==null?null:{musicContentMediaId:b,songId:c,author:e,title:f,artworkDirectPath:g,artworkSha256:h!=null?d("WABase64").encodeB64(h):void 0,artworkEncSha256:j!=null?d("WABase64").encodeB64(j):void 0,artworkMediaKey:a!=null?d("WABase64").encodeB64(a):void 0,isExplicit:Boolean(m),artistAttribution:k,countryBlocklist:l!=null?i(l):new Set()}}g.mapToCountryCode=i;g.toMusicMetadata=a}),98); __d("WAWebNewsletterIsNewsletterMsg",["WAWebWid"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.from;a=a.to;return c("WAWebWid").isNewsletter(b)||c("WAWebWid").isNewsletter(a)}g["default"]=a}),98); __d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({UNKNOWN:0,TEXT:1,IMAGE:2});c={};e={};f={};b={};var h={},i={},j={};c.internalSpec={currentMsg:[1,(d=d("WAProtoConst")).TYPES.MESSAGE,f],quotedMsg:[2,d.TYPES.MESSAGE,f]};e.internalSpec={encPayload:[1,d.TYPES.BYTES],encIv:[2,d.TYPES.BYTES]};f.internalSpec={body:[1,d.TYPES.STRING],caption:[3,d.TYPES.STRING],lng:[5,d.TYPES.DOUBLE],isLive:[6,d.TYPES.BOOL],lat:[7,d.TYPES.DOUBLE],paymentAmount1000:[8,d.TYPES.INT32],paymentNoteMsgBody:[9,d.TYPES.STRING],matchedText:[11,d.TYPES.STRING],title:[12,d.TYPES.STRING],description:[13,d.TYPES.STRING],futureproofBuffer:[14,d.TYPES.BYTES],clientUrl:[15,d.TYPES.STRING],loc:[16,d.TYPES.STRING],pollName:[17,d.TYPES.STRING],pollOptions:[18,d.FLAGS.REPEATED|d.TYPES.MESSAGE,j],pollSelectableOptionsCount:[20,d.TYPES.UINT32],messageSecret:[21,d.TYPES.BYTES],originalSelfAuthor:[51,d.TYPES.STRING],senderTimestampMs:[22,d.TYPES.INT64],pollUpdateParentKey:[23,d.TYPES.STRING],encPollVote:[24,d.TYPES.MESSAGE,e],isSentCagPollCreation:[28,d.TYPES.BOOL],pollContentType:[42,d.TYPES.ENUM,a],pollVotesSnapshot:[41,d.TYPES.MESSAGE,h],encReactionTargetMessageKey:[25,d.TYPES.STRING],encReactionEncPayload:[26,d.TYPES.BYTES],encReactionEncIv:[27,d.TYPES.BYTES],botMessageSecret:[29,d.TYPES.BYTES],targetMessageKey:[30,d.TYPES.STRING],encPayload:[31,d.TYPES.BYTES],encIv:[32,d.TYPES.BYTES],eventName:[33,d.TYPES.STRING],isEventCanceled:[34,d.TYPES.BOOL],eventDescription:[35,d.TYPES.STRING],eventJoinLink:[36,d.TYPES.STRING],eventStartTime:[37,d.TYPES.INT64],eventLocation:[38,d.TYPES.MESSAGE,b],eventEndTime:[40,d.TYPES.INT64],plainProtobufBytes:[43,d.TYPES.BYTES]};b.internalSpec={degreesLatitude:[1,d.TYPES.DOUBLE],degreesLongitude:[2,d.TYPES.DOUBLE],name:[3,d.TYPES.STRING],address:[4,d.TYPES.STRING],url:[5,d.TYPES.STRING],jpegThumbnail:[6,d.TYPES.BYTES]};h.internalSpec={pollVotes:[1,d.FLAGS.REPEATED|d.TYPES.MESSAGE,i]};i.internalSpec={option:[1,d.TYPES.MESSAGE,j],optionVoteCount:[2,d.TYPES.INT32]};j.internalSpec={name:[1,d.TYPES.STRING],hash:[2,d.TYPES.STRING]};g.MsgOpaqueData$PollContentType=a;g.MsgRowOpaqueDataSpec=c;g.PollEncValueSpec=e;g.MsgOpaqueDataSpec=f;g.MsgOpaqueData$EventLocationSpec=b;g.MsgOpaqueData$PollVotesSnapshotSpec=h;g.MsgOpaqueData$PollVoteSnapshotSpec=i;g.MsgOpaqueData$PollOptionSpec=j}),98); __d("WAWebPollCreationUtils",["WAWebProtobufsE2E.pb","WAWebProtobufsMdStorageMsgRowOpaqueData.pb"],(function(a,b,c,d,e,f,g){"use strict";var h={TEXT:"TEXT",IMAGE:"IMAGE"};function a(a){if(a==null)return h.TEXT;switch(a){case d("WAWebProtobufsE2E.pb").Message$PollContentType.IMAGE:return h.IMAGE;case d("WAWebProtobufsE2E.pb").Message$PollContentType.TEXT:case d("WAWebProtobufsE2E.pb").Message$PollContentType.UNKNOWN:return h.TEXT}}function b(a){switch(a){case h.TEXT:return d("WAWebProtobufsE2E.pb").Message$PollContentType.TEXT;case h.IMAGE:return d("WAWebProtobufsE2E.pb").Message$PollContentType.IMAGE}}function c(a){if(a==null)return h.TEXT;switch(a){case d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgOpaqueData$PollContentType.IMAGE:return h.IMAGE;case d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgOpaqueData$PollContentType.TEXT:case d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgOpaqueData$PollContentType.UNKNOWN:return h.TEXT}}function e(a){switch(a){case h.TEXT:return d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgOpaqueData$PollContentType.TEXT;case h.IMAGE:return d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgOpaqueData$PollContentType.IMAGE}}g.PollContentType=h;g.getPollContentTypeFromE2EValue=a;g.getPollContentTypeAsE2EValue=b;g.getPollContentTypeFromDBValue=c;g.getPollContentTypeAsDBValue=e}),98); __d("WAWebVcardParsingUtils",["WALogger","WATypeUtils","WAWeb-moment","WAWebURLUtils","WAWebWidFactory","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["vcard:parse failed because the vCard is not formatted as expected:\n Header as expected? ","\n Version as expected? ","\n Footer as expected? ","\n Lines: ",""]);h=function(){return a};return a}var i="wa-biz-name",j=/X-([^;:]+)(?:;[^:]+)*:(.+)/,k={"X-ABLabel":[/X-ABLabel(?:;([^:]+))*:(.+)/,1],ADR:[/ADR(?:;([^:]+))*:;;(.*);(.*);(.*);(.*);(.*)/,5],"X-ABADR":[/X-ABADR(?:;([^:]+))*:(.*)/,1],URL:[/URL(?:;([^:]+))*:(.*)/,1],EMAIL:[/EMAIL(?:;([^:]+))*:(.+)/,1],TEL:[/TEL(?:;([^:]+))*:(.+)/,1]},l={N:[/N(?:;([^:]+))*:([^;]*);([^;]*);([^;]*);([^;]*);(.*)/,5],FN:[/FN(?:;([^:]+))*:(.*)/,1],NICKNAME:[/NICKNAME(?:;([^:]+))*:(.*)/,1],"X-PHONETIC-FIRST-NAME":[/X-PHONETIC-FIRST-NAME(?:;([^:]+))*:(.*)/,1],"X-PHONETIC-LAST-NAME":[/X-PHONETIC-LAST-NAME(?:;([^:]+))*:(.*)/,1],ORG:[/ORG(?:;([^:]+))*:([^;]*)(?:;(.*))*/,2],TITLE:[/TITLE(?:;([^:]+))*:(.*)/,1],TEL:[/TEL(?:;([^:]+))*:(.*)/,1],PHOTO:[/PHOTO(?:;([^:]+))*:(.*)/,1],BDAY:[/BDAY(?:;([^:]+))*:(.*)/,1],URL:[/URL(?:;([^:]+))*:(.+)/,1],EMAIL:[/EMAIL(?:;([^:]+))*:(.+)/,1]},m=function(a,b,c,d){this.type=a,this.index=b,this.properties=c||{},this.value=d};function n(a,b,c){a[b]||(a[b]=[]),a[b].push(c)}function o(a){var b={};if(!a)return b;a.split(";").forEach(function(a){a=a.split(/=/);if(a.length===1){var c=a[0];n(b,c.toLowerCase(),!0)}else if(a.length===2){c=a[0];a=a[1];n(b,c.toLowerCase(),a.toLowerCase())}});return b}function a(a){if(!a)return;return a.replace(/^_\$!<([^>]*)>!\$_$/,"$1").replace(/\\,/,",").replace(/\\;/,";").replace(/\\\\/,"\\")}function p(a){var b={};c("lodash").forOwn(a,function(a,d){b[d]=c("lodash").sortBy(a,function(a){return a.index})});return b}function b(a){var b=[/-([^-]*)-([^-]*)-([^-]*)/,/([^-]*)-([^-]*)-([^-]*)/],d=a;c("lodash").forEach(b,function(b){b=a.match(b);if(b){var e=!b[1].length||b[1]==="1604",f=e?"0000":b[1];d=c("WAWeb-moment")(f+"-"+b[2]+"-"+b[3]).format("l");e&&(d=d.replace(/[.,-\/\s]*0000[.,-\/\s]*/,""));return!1}});return d}function e(a){var b=[];if(a==null?void 0:a.TEL)a.TEL.forEach(function(a){var c;((c=(c=a.properties)==null?void 0:(c=c.waid)==null?void 0:c.length)!=null?c:0)>0&&(b=b.concat(a.properties.waid.map(function(a){return d("WAWebWidFactory").createUserWid(a)})))});else{a=((a==null?void 0:a.SERVICE)||[]).find(function(a){return a.type.toLowerCase()==="wa-lid"});(a==null?void 0:a.value)&&(b=b.concat(d("WAWebWidFactory").createUserWid(a.value,"lid")))}return b}function q(a){a=a==null?void 0:a.replace(/\r?\n|\r/g,"\n").replace(/\n^[ \t]/gm,"").split("\n").filter(function(a){return a.trim().length!==0});var b={},c={};if(a==null||a.length<3)return void 0;var e=a[0].trim().toUpperCase(),f=a[1].trim().toUpperCase(),g=a[a.length-1].trim().toUpperCase();f=f==="VERSION:2.1"||f==="VERSION:3.0"||f==="VERSION:4.0";if(e!=="BEGIN:VCARD"||!f||g!=="END:VCARD"){d("WALogger").ERROR(h(),String(e==="BEGIN:VCARD"),String(f),String(g==="END:VCARD"),a.length).sendLogs("vcard-fault");return void 0}for(e=2;e<a.length-1;e++){var i;f=a[e];g=f.match(/item(\d+)\.(.*)/);f=g?g[2]:f;i=(i=f.match(/([^:;]*)[:;].*/))==null?void 0:i[1];if(i==null)continue;var q=g?k:l,r=i;i=i;var s=void 0,t=void 0;if(q[r]){q=q[r];var u=q[0];q=q[1];u=f.match(u);u&&(s=o(u[1]),t=q===1?t=u[2]:u.slice(2,2+q))}else{u=f.match(j);u&&(i="SERVICE",r=u[1],t=u[2],s={})}q=Array.isArray(t)?t:[t];if(q.some(function(a){return d("WATypeUtils").isString(a)&&a.trim()}))if(g){f=g[1];c[f]?c[f].fields.push(new m(r,null,s,t)):c[f]={type:r,index:e,key:i,properties:s,value:t,fields:[]}}else n(b,i,new m(r,e,s,t))}Object.keys(c).forEach(function(f){f=c[f];var g=f.key,h=f.index,a=f.type,e=f.value,d=f.properties;f=f.fields;f.forEach(function(a){d[a.type]=a.value});n(b,g,new m(a,h,d,e))});return p(b)}function f(a){if(!a)return void 0;a=a.PHOTO;if((a==null?void 0:a[0])&&c("WAWebURLUtils").isData(a[0].value))return a[0].value}function r(a){a=a.match(/BEGIN:VCARD([\0-\uFFFF]*?)END:VCARD/g);return a?a.map(function(a){return q(a)}).filter(Boolean):[]}function s(a){return(a.SERVICE||[]).some(function(a){return a.type.toLowerCase()===i&&a.value})}g.WA_BIZ_NAME=i;g.Field=m;g.clean=a;g.vcardGetDate=b;g.vcardWids=e;g.parseVcard=q;g.vcardThumbnail=f;g.parseMultiVcard=r;g.vcardIsBiz=s}),98); __d("WAWebViewMode.flow",["$InternalEnum"],(function(a,b,c,d,e,f){a={VISIBLE:"VISIBLE",HIDDEN:"HIDDEN",MEDIA_ALBUM:"MEDIA_ALBUM",INVISIBLE_PLACEHOLDER:"INVISIBLE_PLACEHOLDER",NEWSLETTER_TOMBSTONE:"NEWSLETTER_TOMBSTONE",POLL_MEDIA:"POLL_MEDIA",HISTORY_SYNCED_CALL_LOG:"HISTORY_SYNCED_CALL_LOG"};c=b("$InternalEnum").Mirrored(["CHAT","SEARCH","CHAT_LIST","NOTIFICATION","CHAT_SPAM_REPORT"]);f.ViewModeType=a;f.ViewModeSurface=c}),66); __d("WAWebMessageAssociation.flow",["$InternalEnum"],(function(a,b,c,d,e,f){"use strict";c=b("$InternalEnum").Mirrored(["UNKNOWN","MEDIA_ALBUM","BOT_PLUGIN","MEDIA_POLL"]);function a(a){return a.associationType!=null}f.MessageAssociationType=c;f.isAssociatedMsg=a}),66); __d("WAWebCreateViewModeProcessor",[],(function(a,b,c,d,e,f){function a(a){return babelHelpers["extends"]({},a)}function b(a){return babelHelpers["extends"]({},a,{messageVisibleInChat:function(){return!0},messageVisibleInChatlistPreview:function(){return!0},shouldShowInNotification:function(){return!0},shouldShowInSearch:function(){return!0},shouldIncludeInChatSpamReport:function(){return!0}})}function c(a){return babelHelpers["extends"]({},a,{messageVisibleInChat:function(){return!1},messageVisibleInChatlistPreview:function(){return!1},shouldShowInNotification:function(){return!1},shouldShowInSearch:function(){return!1},shouldIncludeInChatSpamReport:function(){return!1}})}f.createViewModeProcessor=a;f.createFullyVisibleViewModeProcessor=b;f.createFullyHiddenViewModeProcessor=c}),66); __d("WAWebHiddenViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createFullyHiddenViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.HIDDEN});b=a;g["default"]=b}),98); __d("WAWebHistorySyncedCallLogViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebMsgType","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.HISTORY_SYNCED_CALL_LOG,compatibleMessageTypes:[d("WAWebMsgType").MSG_TYPE.CALL_LOG],messageVisibleInChat:function(){return!1},messageVisibleInChatlistPreview:function(){return!1},shouldShowInNotification:function(){return!1},shouldShowInSearch:function(){return!0},shouldIncludeInChatSpamReport:function(){return!1}});g.HistorySyncedCallLogViewModeProcessor=a}),98); __d("WAWebInvisiblePlaceholderViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebMsgType","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createFullyHiddenViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.INVISIBLE_PLACEHOLDER,compatibleMessageTypes:[d("WAWebMsgType").MSG_TYPE.ALBUM,d("WAWebMsgType").MSG_TYPE.POLL_CREATION]});g.InvisiblePlaceholderViewModeProcessor=a}),98); __d("WAWebMediaAlbumViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebMsgType","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.MEDIA_ALBUM,compatibleMessageTypes:[d("WAWebMsgType").MSG_TYPE.IMAGE,d("WAWebMsgType").MSG_TYPE.VIDEO],messageVisibleInChat:function(){return!1},messageVisibleInChatlistPreview:function(){return!1},shouldShowInNotification:function(){return!1},shouldShowInSearch:function(){return!0},shouldIncludeInChatSpamReport:function(){return!1}});g.mediaAlbumViewModeProcessor=a}),98); __d("WAWebNewsletterTombstoneViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.NEWSLETTER_TOMBSTONE,messageVisibleInChat:function(){return!1},messageVisibleInChatlistPreview:function(){return!1},shouldShowInNotification:function(){return!1},shouldShowInSearch:function(){return!1},shouldIncludeInChatSpamReport:function(){return!1}});b=a;g["default"]=b}),98); __d("WAWebPollMediaViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.POLL_MEDIA,messageVisibleInChat:function(){return!1},messageVisibleInChatlistPreview:function(){return!1},shouldShowInNotification:function(){return!1},shouldShowInSearch:function(){return!1},shouldIncludeInChatSpamReport:function(){return!1}});b=a;g["default"]=b}),98); __d("WAWebVisibleViewModeProcessor",["WAWebCreateViewModeProcessor","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateViewModeProcessor").createFullyVisibleViewModeProcessor({type:d("WAWebViewMode.flow").ViewModeType.VISIBLE});b=a;g["default"]=b}),98); __d("WAWebViewModeProcessor",["WAWebHiddenViewModeProcessor","WAWebHistorySyncedCallLogViewModeProcessor","WAWebInvisiblePlaceholderViewModeProcessor","WAWebMediaAlbumViewModeProcessor","WAWebNewsletterTombstoneViewModeProcessor","WAWebPollMediaViewModeProcessor","WAWebViewMode.flow","WAWebVisibleViewModeProcessor"],(function(a,b,c,d,e,f,g){function a(a){if(a==null)return c("WAWebVisibleViewModeProcessor");switch(a){case d("WAWebViewMode.flow").ViewModeType.VISIBLE:return c("WAWebVisibleViewModeProcessor");case d("WAWebViewMode.flow").ViewModeType.HIDDEN:return c("WAWebHiddenViewModeProcessor");case d("WAWebViewMode.flow").ViewModeType.MEDIA_ALBUM:return d("WAWebMediaAlbumViewModeProcessor").mediaAlbumViewModeProcessor;case d("WAWebViewMode.flow").ViewModeType.INVISIBLE_PLACEHOLDER:return d("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor;case d("WAWebViewMode.flow").ViewModeType.NEWSLETTER_TOMBSTONE:return c("WAWebNewsletterTombstoneViewModeProcessor");case d("WAWebViewMode.flow").ViewModeType.POLL_MEDIA:return c("WAWebPollMediaViewModeProcessor");case d("WAWebViewMode.flow").ViewModeType.HISTORY_SYNCED_CALL_LOG:return d("WAWebHistorySyncedCallLogViewModeProcessor").HistorySyncedCallLogViewModeProcessor}}g.getViewModeProcessor=a}),98); __d("WAWebViewModeUtils",["WAWebMessageAssociation.flow","WAWebMsgType","WAWebPollCreationUtils","WAWebViewMode.flow","WAWebViewModeProcessor"],(function(a,b,c,d,e,f,g){function h(a,b){b=d("WAWebViewModeProcessor").getViewModeProcessor(b);switch(a){case d("WAWebViewMode.flow").ViewModeSurface.CHAT:return b.messageVisibleInChat();case d("WAWebViewMode.flow").ViewModeSurface.SEARCH:return b.shouldShowInSearch();case d("WAWebViewMode.flow").ViewModeSurface.CHAT_LIST:return b.messageVisibleInChatlistPreview();case d("WAWebViewMode.flow").ViewModeSurface.NOTIFICATION:return b.shouldShowInNotification();case d("WAWebViewMode.flow").ViewModeSurface.CHAT_SPAM_REPORT:return b.shouldIncludeInChatSpamReport()}}function a(a){return a.associationType===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL||a.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&a.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE?!0:h(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)}g.isViewModeVisibleInSurface=h;g.isMessageExistingInChat=a}),98); __d("WAWebMsgGetters",["WABase64","WALogger","WAPhoneFindCC","WATimeUtils","WATypeUtils","WAWebAck","WAWebBizSystemMsgSubtypes","WAWebBotTypes","WAWebBusinessHSMTypes","WAWebCallLogMsgData.flow","WAWebCommonMsgUtils","WAWebConstantsDeprecated","WAWebEphemeralConstants","WAWebEphemeralityWAMUtils","WAWebGetters","WAWebGettersCaches","WAWebInteractiveMessageHeaderMediaType","WAWebMimeTypes","WAWebMsgType","WAWebMusicParsingUtils","WAWebNewsletterIsNewsletterMsg","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebVcardParsingUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumEditType","WAWebWid","WAWebWidFactory","gkx","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: could not derive isInternational as some data is missing"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected non-wid for originalSelfAuthorOrSender; value=","; typeof=","; msg.type=",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected non-wid for originalSelfAuthorOrSender; typeof=","; msg.type=",""]);j=function(){return a};return a}a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createMessagesCache});b=a.field;e=a.computed;f=a.unsafeIdentityGetter;a=a.clearCacheFor;a=a;f=f;function k(a){if(a instanceof c("WAWebWid"))return a;return a.user!=null?d("WAWebWidFactory").createUserWid(a.user,a.server):a}var l=b("type"),m=b("subtype"),n=b("id"),o=b("to"),p=b("from"),q=b("broadcastId"),aa=e(function(a){var b=a[0];a=a[1];return a!=null?a:b.remote},[n,q]),r=b("viewMode"),s=b("author"),t=b("ack"),ba=b("viewCount"),ca=b("viewed"),u=b("originalSelfAuthor"),v=b("kicState"),da=b("kicTimestampMs"),w=b("list"),x=b("latestEditMsgKey"),ea=b("errorCode"),y=b("ephemeralDuration"),fa=b("ephemeralSettingUser"),z=b("t",{"default":0}),A=b("backgroundColor"),ga=b("headerType"),B=b("interactiveHeader"),ha=b("interactiveType"),ia=b("footer"),C=b("mentionedJidList"),ja=b("groupMentions",{getDefault:function(){return[]}}),D=b("quotedMsg"),ka=b("quotedRemoteJid"),E=b("quotedParticipant"),F=b("rcat"),G=b("isViewOnce",{"default":!1}),la=b("isGif",{"default":!1}),ma=b("gifAttribution",{"default":d("WAWebProtobufsE2E.pb").Message$VideoMessage$Attribution.NONE}),na=b("ctwaContext"),H=b("mimetype"),oa=b("filehash"),pa=b("deprecatedMms3Url"),qa=b("waveform"),I=b("disappearingModeInitiator"),J=b("disappearingModeTrigger"),ra=b("disappearingModeInitiatedByMe"),sa=b("activeBotMsgStreamingInProgress"),K=b("bizBotType"),ta=b("botTargetSenderJid"),ua=b("isSupportAIMessage"),va=b("lastBotEditBodyLength"),wa=b("botEditType"),xa=b("forwardedNewsletterMessageInfo"),ya=b("newsletterAdminInviteInfo"),za=b("bizSource");function Aa(a){return a==="smb_promo"}var Ba=e(function(a){a=a[0];return Aa(a)},[za]),Ca=e(function(a){a=a[0];return a!=null},[D]),Da=e(function(a){a=a[0];return d("WAWebMimeTypes").isOpus(a)},[H]),Ea=e(function(a){a=a[0];return a==null?null:d("WABase64").encodeB64UrlSafe(a,!0)},[F]),Fa=e(function(a){a=a[0];return a==null?!1:a.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(k(a))})},[C]),Ga=b("local",{"default":!1}),L=e(function(a){var b=a[0];a=a[1];return b&&a?d("WAWebUserPrefsMeUser").isMeAccount(k(a)):!1},[D,E]);L=e(function(a){var b=a[0];a=a[1];return b||a},[Fa,L]);var Ha=b("botPluginReferenceIndex"),Ia=e(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];if(c!=null)return!1;if(!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a))return!1;switch(b){case"interactive":return e;case"chat":case"image":case"video":case"ptv":case"audio":case"ptt":case"document":case"vcard":case"location":case"ciphertext":case"oversized":case"multi_vcard":case"sticker":case"status":case"product":case"groups_v4_invite":case"poll_creation":case"poll_result_snapshot":case"list":case"newsletter_admin_invite":case"event_creation":case"sticker-pack":case"album":case"rich_response":case"automated_greeting_message":return!0;default:b;return!1}},[l,Ha,Ba,r]),M=e(function(a){var b=a[0];a=a[1];return c("WAWebWid").isGroup(b)||c("WAWebWid").isGroup(a)},[p,o]),N=e(function(a){var b=a[0];a=a[1];return c("WAWebNewsletterIsNewsletterMsg")({from:b,to:a})},[p,o]),O=e(function(a){var b=a[0];a=a[1];return b||a!=null},[N,xa]),P=e(function(a){a=a[0];return c("WAWebWid").isStatus(a.remote)},[n]),Ja=e(function(a){var b=a[0];a=a[1];return d("WAWebCommonMsgUtils").isNotificationType(b,a)},[l,m]),Q=e(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];var f=b;if(a)return b.fromMe;return f.self==="in"||e?!1:d("WAWebUserPrefsMeUser").isMeAccount(c)},[n,p,Ja,N]),R=e(function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4];a=a[5];return b?f?d("WAWebUserPrefsMeUser").getMeUser():g:c||e||(a==null?void 0:a.isBot())?a:g},[Q,M,P,N,p,s]),Ka=e(function(a){var b=a[0],e=a[1];a=a[2];b=b||e;b!=null&&b.isUser==null&&(c("gkx")("26258")?d("WALogger").ERROR(j(),typeof b,a).sendLogs("non-wid-originalselfauthororsender"):d("WALogger").ERROR(i(),String(b),typeof b,a).sendLogs("non-wid-originalselfauthororsender"));return b!=null&&(b.isUser==null?void 0:b.isUser())?d("WAWebWidFactory").toUserWid(b):null},[u,R,l]),La=e(function(a){a=a[0];return a===d("WAWebMsgType").MSG_TYPE.REACTION||a===d("WAWebMsgType").MSG_TYPE.REACTION_ENC},[l]),Ma=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&a==="poll_vote"},[l,m]),Na=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.UNKNOWN||b===d("WAWebMsgType").MSG_TYPE.PAYMENT&&a==="futureproof"},[l,m]),Oa=e(function(a){a=a[0];return a===d("WAWebMsgType").MSG_TYPE.STICKER},[l]),Pa=b("isCarouselCard",{"default":!1}),Qa=e(function(a){var b=a[0];a=a[1];return!b&&!a},[G,Oa]),Ra=e(function(a){a=a[0];return a===d("WAWebEphemeralConstants").KeepInChatState.KEPT},[v]),Sa=e(function(a){a=a[0];return a===d("WAWebEphemeralConstants").KeepInChatState.UNKEPT},[v]),Ta=e(function(a){a=a[0];return c("WAWebWid").isPSA(a.remote)},[n]),Ua=e(function(a){a=a[0];return c("WAWebWid").isIAS(a.remote)},[n]),Va=e(function(a){a=a[0];return c("WAWebWid").isCAPISupportAccount(a.remote)},[n]),Wa=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.LIST&&(a==null?void 0:a.listType)===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST},[l,w]),Xa=b("title"),S=b("body",{"default":""}),Ya=b("caption"),Za=b("comment"),$a=b("pollName",{"default":""}),ab=b("pollOptions"),bb=b("pollSelectableOptionsCount",{"default":0}),cb=b("pollInvalidated",{"default":!1}),db=b("pollContentType",{"default":d("WAWebPollCreationUtils").PollContentType.TEXT}),eb=b("pollVotesSnapshot"),fb=b("eventName",{"default":""}),gb=b("eventDescription"),hb=b("eventStartTime",{"default":0}),ib=b("eventEndTime"),jb=b("eventJoinLink"),kb=b("eventLocation"),lb=b("isEventCanceled",{"default":!1}),mb=b("eventInvalidated",{"default":!1}),nb=b("replyCount",{"default":0}),ob=b("nativeFlowName"),pb=b("nativeFlowButtons"),qb=b("paymentCurrency",{"default":""}),rb=b("paymentAmount1000",{"default":0}),sb=b("paymentMessageReceiverJid"),tb=b("paymentStatus"),ub=b("paymentTxnStatus"),vb=b("paymentNoteMsg"),wb=b("paymentRequestMessageKey"),xb=b("paymentExpiryTimestamp"),yb=b("paymentInviteServiceType"),zb=b("isFromTemplate",{"default":!1}),Ab=b("isLive",{"default":!1}),T=b("isDynamicReplyButtonsMsg",{"default":!1}),Bb=b("dynamicReplyButtons"),Cb=e(function(a){var b=a[0],c=a[1];a=a[2];return b===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&c==="ephemeral_setting"?!1:a!=null&&a!==0},[l,m,y]),Db=e(function(a){a=a[0];return a!=null},[x]),Eb=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a==="message_edit"},[l,m]),Fb=e(function(a){var b=a[0];a=a[1];if(!b)return null;b="rgba(86, 150, 255, 255)";a=a;if(a==null||a===0)return b;b=a>>24&255;var c=a>>16&255,d=a>>8&255;a=a&255;return"rgba("+c+", "+d+", "+a+", "+b+")"},[P,A]),Gb=e(function(a){a=a[0];switch(a){case"protocol":case"chat":case"location":case"vcard":case"multi_vcard":case"image":case"video":case"ptv":case"audio":case"ptt":case"document":case"sticker":case"status":case"product":case"groups_v4_invite":case"order":case"poll_creation":case"poll_result_snapshot":case"newsletter_admin_invite":case"comment":case"event_creation":case"sticker-pack":case"album":case"rich_response":return!0;default:a;return!1}},[l]),Hb=e(function(a){var b=a[0],c=a[1];a=a[2];return b.fromMe&&c&&a},[n,Ga,Gb]),Ib=b("revokeSender"),Jb=e(function(a){a=a[0];return a!=null&&d("WAWebUserPrefsMeUser").isMeAccount(a)},[Ib]),Kb=e(function(a){var b=a[0],c=a[1];a=a[2];b=b.fromMe;b=b?c==null?void 0:c.toString({legacy:!0}):a==null?void 0:a.toString({legacy:!0});c=d("WAWebUserPrefsMeUser").getMaybeMeUser();a=c==null?void 0:c.toString({legacy:!0});if(b&&a!=null)return d("WAPhoneFindCC").phoneCC(b)!==d("WAPhoneFindCC").phoneCC(a);d("WALogger").WARN(h());return!1},[n,o,p]),Lb=e(function(a){var b=a[0];a=a[1];if(b===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE){if(d("WAWebBizSystemMsgSubtypes").BIZ_SYSTEM_MSG_SUBTYPES.includes(a))return!0;if(d("WAWebBizSystemMsgSubtypes").BIZ_SYSTEM_MSG_SUBTYPES_V2.includes(a))return!0;switch(a){case"verified_initial_unknown":case"verified_initial_low":case"verified_initial_high":case"verified_transition_any_to_none":case"verified_transition_any_to_high":case"verified_transition_high_to_low":case"verified_transition_high_to_unknown":case"verified_transition_unknown_to_low":case"verified_transition_low_to_unknown":case"verified_transition_none_to_low":case"verified_transition_none_to_unknown":case"biz_verified_transition_top_to_bottom":case"biz_verified_transition_bottom_to_top":case"biz_intro_top":case"biz_intro_bottom":case"biz_name_change":case"biz_move_to_consumer_app":case"biz_two_tier_migration_top":case"biz_two_tier_migration_bottom":return!0;default:return!1}}return!1},[l,m]),Mb=e(function(a){var b=a[0];a=a[1];switch(b){case"image":case"video":case"audio":case"sticker-pack":return!0;case"interactive":return a==null?!1:a.mediaType===d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE||a.mediaType===d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO;default:return!1}},[l,B]),U=b("isForwarded",{"default":!1}),Nb=b("forwardingScore"),Ob=e(function(a){var b=a[0];a=a[1];return a==null?b?1:0:a||0},[U,Nb]),Pb=e(function(a){a=a[0];return a>=c("WAWebConstantsDeprecated").FREQUENTLY_FORWARDED_SENTINEL},[Ob]),Qb=e(function(a){var b=a[0];a=a[1];return b.fromMe&&a!=null&&a.some(function(a){return a.isBot()})},[n,C]),Rb=e(function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b||c||a||!d},[U,O,Q,Qb]),Sb=b("invis",{"default":!1}),Tb=b("isNewMsg",{"default":!1}),Ub=b("isSendFailure",{"default":!1}),Vb=e(function(a){var b=a[0],c=a[1];a=a[2];return b&&c!=null&&c<d("WAWebAck").ACK.CLOCK||a},[Q,t,Ub]),Wb=e(function(a){var b=a[0];a=a[1];if(b!==d("WAWebMsgType").MSG_TYPE.VCARD)return void 0;try{return d("WAWebVcardParsingUtils").parseVcard(a)}catch(a){return void 0}},[l,S]),Xb=b("description"),Yb=b("matchedText",{"default":""}),Zb=b("thumbnail"),$b=b("thumbnailHQ"),ac=b("musicArtwork"),bc=b("richPreviewType",{"default":d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$PreviewType.NONE}),cc=b("paymentLinkMetadata",{"default":null}),dc=e(function(a){var b=a[0],e=a[1],f=a[2];a=a[3];return d("WATypeUtils").isString(a)&&(!c("isStringNullOrEmpty")(e)||!c("isStringNullOrEmpty")(f))&&b!=null&&b.includes(a)},[S,Xa,Xb,Yb]),ec=e(function(a){var b=a[0];a=a[1];return b||a},[T,zb]),fc=e(function(a){var b=a[0];a=a[1];return a||b===d("WAWebMsgType").MSG_TYPE.LIST||b===d("WAWebMsgType").MSG_TYPE.INTERACTIVE},[l,T]),gc=768,hc=e(function(a){var b=a[0];a=a[1];var c=308;return(a==null?void 0:a.isBot())?Infinity:b?c:gc},[Pb,R]),ic=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&a==="encrypt"||d("WAWebBizSystemMsgSubtypes").BIZ_SYSTEM_MSG_SUBTYPES_V2_INIT.includes(a)},[l,m]),jc=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a==="disappearing_mode"},[l,m]),kc=b("kicKey"),lc=e(function(a){var b=a[0];a=a[1];if(b!=null)if(b.fromMe)return d("WAWebUserPrefsMeUser").getMaybeMeUser();else if(a&&b.participant!=null)return d("WAWebWidFactory").toUserWid(b.participant);else if(!a)return d("WAWebWidFactory").toUserWid(b.remote)},[kc,M]),mc=e(function(a){var b=a[0],c=a[1];a=a[2];if(a==="ephemeral_setting")return null;return b==null||b===0?null:c+b},[y,z,m]),V=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&(a==="sender_revoke"||a==="admin_revoke")},[l,m]),nc=b("revokeDuration"),oc=e(function(a){var b=a[0],c=a[1];a=a[2];return c?b==="admin_revoke"?d("WAWebWamEnumEditType").EDIT_TYPE.ADMIN_REVOKE:d("WAWebWamEnumEditType").EDIT_TYPE.SENDER_REVOKE:a?d("WAWebWamEnumEditType").EDIT_TYPE.EDITED:d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED},[m,V,Db]),pc=e(function(a){a=a[0];if(a==null)return;return d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(a)},[J]),qc=e(function(a){a=a[0];if(a==null)return;return d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(a)},[ra]),rc=e(function(a){a=a[0];if(a==null)return;return d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(a)},[I]),sc=b("inviteCode",{"default":""}),tc=b("inviteCodeExp",{"default":""}),uc=b("inviteGrp",{"default":""}),vc=b("inviteGrpName"),wc=b("inviteGrpJpegThum"),xc=b("inviteGrpType"),yc=e(function(a){var b=a[0],c=a[1];a=a[2];if(b!==d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE)return!1;if(!c)return!0;b=new Date().getTime()/1e3;return parseInt(b,10)>=parseInt(a,10)},[l,sc,tc]),zc=e(function(a){var b=a[0];a=a[1];if(b!==d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE)return!1;if(a==null)return!0;b=a.inviteExpiration;a=d("WATimeUtils").unixTime();return a>=b},[l,ya]),Ac=b("productHeaderImageRejected",{"default":!1}),Bc=e(function(a){var b=a[0];a=a[1];return b===!0?null:(b=a==null?void 0:(b=a.productListInfo)==null?void 0:(a=b.headerImage)==null?void 0:a.jpegThumbnail)!=null?b:null},[Ac,w]),Cc=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.PTT||b===d("WAWebMsgType").MSG_TYPE.PTV||a&&b===d("WAWebMsgType").MSG_TYPE.AUDIO},[l,O]),Dc=b("hasReaction",{"default":!1}),Ec=b("recipients",{getDefault:function(){return[]}}),Fc=b("templateParams",{getDefault:function(){return[]}}),Gc=b("clientUrl",{"default":""}),Hc=b("loc",{"default":""}),Ic=b("lat"),Jc=b("lng"),Kc=b("shareDuration"),Lc=b("finalLat"),Mc=b("finalLng"),Nc=b("star",{"default":!1}),Oc=b("currencyCode"),Pc=b("priceAmount1000"),Qc=b("salePriceAmount1000"),Rc=b("isVcardOverMmsDocument",{"default":!1}),W=b("interactiveAnnotations"),X=e(function(a){a=a[0];return a==null?null:a.filter(function(a){return((a=a.embeddedContent)==null?void 0:a.embeddedMusic)!=null})},[W]),Sc=e(function(a){a=a[0];return a==null?!1:a.some(function(a){return((a=a.embeddedContent)==null?void 0:a.embeddedMessage)!=null})},[W]),Tc=e(function(a){a=a[0];return a==null?null:a[0]},[X]),Uc=e(function(a){var b=a[0];a=a[1];return b&&a!=null&&a.length>0},[P,X]),Vc=e(function(a){var b=a[0];a=a[1];return b&&a},[P,Sc]),Wc=e(function(a){a=a[0];if(a==null)return null;a=(a=a.embeddedContent)==null?void 0:a.embeddedMusic;return a==null?null:d("WAWebMusicParsingUtils").toMusicMetadata(a)},[Tc]),Xc=b("messageSecret"),Yc=b("broadcast",{"default":!1}),Zc=b("vcardList",{getDefault:function(){return[]}}),$c=b("vcardFormattedName"),ad=b("labels",{getDefault:function(){return[]}}),bd=b("agentId"),cd=b("url"),dd=b("retailerId"),ed=b("businessOwnerJid"),fd=b("productId"),gd=b("productImageCount"),hd=b("isMdHistoryMsg",{"default":!1}),id=b("campaignId"),jd=b("filename"),kd=b("smbClientCampaignId"),ld=b("isCaptionByUser",{"default":!1}),md=b("doNotPlayInline"),nd=b("thumbnailDirectPath"),od=b("thumbnailHeight"),pd=b("thumbnailWidth"),qd=b("orderTitle"),rd=b("itemCount"),sd=b("totalAmount1000"),td=b("totalCurrencyCode"),ud=b("futureproofType"),vd=b("futureproofSubtype"),wd=b("ephemeralOutOfSync"),xd=b("isAvatar"),yd=b("bizPrivacyStatus"),zd=b("verifiedBizName"),Ad=b("mediaKey"),Bd=b("message",{"default":""}),Cd=b("size",{"default":0}),Dd=b("hostedBizEncStateMismatch"),Ed=e(function(a){a=a[0];return a==="bot_unavailable_fanout"},[m]),Fd=e(function(a){a=a[0];return a==="view_once_unavailable_fanout"},[m]),Gd=e(function(a){var b=a[0];a=a[1];return b.remote.isBot()?b.fromMe:a!=null&&a.some(function(a){return a.isBot()})},[n,C]),Hd=e(function(a){var b=a[0];a=a[1];return!b.fromMe&&a===d("WAWebBotTypes").BizBotType.BIZ_1P},[n,K]),Id=e(function(a){var b=a[0];a=a[1];return!b.fromMe&&a===d("WAWebBotTypes").BizBotType.BIZ_3P},[n,K]),Jd=b("botPluginSearchProvider"),Kd=b("botPluginSearchUrl"),Ld=b("botResponseTargetId"),Md=b("botPluginSearchQuery"),Nd=b("botPluginType"),Od=b("botMessageDisclaimerText"),Pd=b("richResponse"),Qd=e(function(a){var b=a[0],c=a[1];a=a[2];return b!=null&&c!=null&&a!=null},[Jd,Kd,Md]),Y=e(function(a){a=a[0];return(a==null?void 0:a.isBot())===!0},[R]),Rd=e(function(a){var b=a[0];a=a[1];return Boolean(b&&d("WAWebUserPrefsMeUser").isMeAccount(a))},[Y,ta]),Sd=e(function(a){var b=a[0];a=a[1];return a&&!b.remote.isBot()},[n,Y]),Td=e(function(a){var b=a[0],c=a[1];a=a[2];return b||c||a},[Y,Hd,Id]),Ud=e(function(a){var b=a[0];a=a[1];return b===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a==="bot_feedback"},[l,m]),Z=b("hsmTag"),Vd=e(function(a){a=a[0];return a===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.AUTHENTICATION},[Z]),Wd=e(function(a){a=a[0];return a===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.MARKETING},[Z]),Xd=b("botRespOrInvocationRevokeBotWid"),Yd=e(function(a){var b=a[0];a=a[1];return Boolean((b==null?void 0:b.isBot())&&a)},[Xd,V]),Zd=e(function(a){var b=a[0];a=a[1];return a&&(b===d("WAWebProtobufsE2E.pb").BotPluginMetadata$PluginType.SEARCH||b===d("WAWebProtobufsE2E.pb").BotPluginMetadata$PluginType.REELS)},[Nd,Y]),$d=b("botPluginMaybeParent"),ae=b("botReelPluginThumbnailCdnUrl"),be=e(function(a){a=a[0];return a===d("WAWebMsgType").MSG_TYPE.BIZ_CONTENT_PLACEHOLDER},[l]),ce=b("statusMentioned"),de=b("isWamoSub"),$=b("isVideoCall");$=e(function(a){var b=a[0],c=a[1];a=a[2];return b===d("WAWebMsgType").MSG_TYPE.CALL_LOG&&(c==="miss_video"||c==="miss_group_video"||a===!0)},[l,m,$]);var ee=b("callOutcome"),fe=b("callSilenceReason"),ge=e(function(a){var b=a[0],c=a[1];a=a[2];return b===d("WAWebMsgType").MSG_TYPE.CALL_LOG&&(c==="silence"||a!=null)},[l,m,fe]),he=e(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b===d("WAWebMsgType").MSG_TYPE.CALL_LOG&&!d("WAWebUserPrefsMeUser").isMeAccount(a)&&(c==="miss_video"||c==="miss_group_video"||c==="miss"||c==="miss_group"||![d("WAWebCallLogMsgData.flow").CallOutcome.Completed,d("WAWebCallLogMsgData.flow").CallOutcome.Ongoing,d("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere].includes(e))},[l,m,ee,R]),ie=b("callDuration");b=b("callParticipants");var je=e(function(a){var b=a[0];a=a[1];return!b&&a!=null&&a.length>1},[M,b]);e=e(function(a){var b=a[0];a=a[1];return b||a},[M,je]);g.clearMsgGetterCacheFor=a;g.getMsgUnsafe=f;g.getType=l;g.getSubtype=m;g.getId=n;g.getTo=o;g.getFrom=p;g.getBroadcastId=q;g.getRemote=aa;g.getViewMode=r;g.getAuthor=s;g.getAck=t;g.getViewCount=ba;g.getViewed=ca;g.getOriginalSelfAuthor=u;g.getKicState=v;g.getKicTimestampMs=da;g.getList=w;g.getLatestEditMsgKey=x;g.getErrorCode=ea;g.getEphemeralDuration=y;g.getEphemeralSettingUser=fa;g.getT=z;g.getBackgroundColor=A;g.getHeaderType=ga;g.getInteractiveHeader=B;g.getInteractiveType=ha;g.getFooter=ia;g.getMentionedJidList=C;g.getGroupMentions=ja;g.getQuotedMsg=D;g.getQuotedRemoteJid=ka;g.getQuotedParticipant=E;g.getRcat=F;g.getIsViewOnce=G;g.getIsGif=la;g.getGifAttribution=ma;g.getCtwaContext=na;g.getMimetype=H;g.getFilehash=oa;g.getDeprecatedMms3Url=pa;g.getWaveform=qa;g.getDisappearingModeInitiator=I;g.getDisappearingModeTrigger=J;g.getDisappearingModeInitiatedByMe=ra;g.getActiveBotMsgStreamingInProgress=sa;g.getBizBotType=K;g.getBotTargetSenderJid=ta;g.getIsSupportAIMessage=ua;g.getLastBotEditBodyLength=va;g.getBotEditType=wa;g.getForwardedNewsletterMessageInfo=xa;g.getNewsletterAdminInviteInfo=ya;g.getBizSource=za;g.isBizSourceFromMarketingMessage=Aa;g.getIsMarketingMessage=Ba;g.getIsReply=Ca;g.getIsOpus=Da;g.getRcatString=Ea;g.getHasMentionOfMe=Fa;g.getLocal=Ga;g.getIsImportantMessage=L;g.getBotPluginReferenceIndex=Ha;g.getIsUnreadType=Ia;g.getIsGroupMsg=M;g.getIsNewsletterMsg=N;g.getHasOriginatedFromNewsletter=O;g.getIsStatus=P;g.getIsNotification=Ja;g.getIsSentByMe=Q;g.getSender=R;g.getOriginalSender=Ka;g.getIsReaction=La;g.getIsPollVote=Ma;g.getIsFutureproof=Na;g.getIsStickerMsg=Oa;g.getIsCarouselCard=Pa;g.getHasThumbList=Qa;g.getIsKept=Ra;g.getIsUnkept=Sa;g.getIsPSA=Ta;g.getIsIAS=Ua;g.getIsCAPISupport=Va;g.getIsProductListMessage=Wa;g.getTitle=Xa;g.getBody=S;g.getCaption=Ya;g.getComment=Za;g.getPollName=$a;g.getPollOptions=ab;g.getPollSelectableOptionsCount=bb;g.getPollInvalidated=cb;g.getPollContentType=db;g.getPollVotesSnapshot=eb;g.getEventName=fb;g.getEventDescription=gb;g.getEventStartTime=hb;g.getEventEndTime=ib;g.getEventJoinLink=jb;g.getEventLocation=kb;g.getIsEventCanceled=lb;g.getEventInvalidated=mb;g.getReplyCount=nb;g.getNativeFlowName=ob;g.getNativeFlowButtons=pb;g.getPaymentCurrency=qb;g.getPaymentAmount1000=rb;g.getPaymentMessageReceiverJid=sb;g.getPaymentStatus=tb;g.getPaymentTxnStatus=ub;g.getPaymentNoteMsg=vb;g.getPaymentRequestMessageKey=wb;g.getPaymentExpiryTimestamp=xb;g.getPaymentInviteServiceType=yb;g.getIsFromTemplate=zb;g.getIsLive=Ab;g.getIsDynamicReplyButtonsMsg=T;g.getDynamicReplyButtons=Bb;g.getIsEphemeral=Cb;g.getIsEdited=Db;g.getIsEditProtocolMsg=Eb;g.getStatusCanvasColor=Fb;g.getIsUserCreatedType=Gb;g.getIsSentByMeFromWeb=Hb;g.getRevokeSender=Ib;g.getIsRevokedByMe=Jb;g.getIsInternational=Kb;g.getIsBizNotification=Lb;g.getIsMedia=Mb;g.getIsForwarded=U;g.getForwardingScore=Nb;g.getNumTimesForwarded=Ob;g.getIsFrequentlyForwarded=Pb;g.getIsBotInvoke=Qb;g.getShouldDisplayAsForwarded=Rb;g.getInvis=Sb;g.getIsNewMsg=Tb;g.getIsSendFailure=Ub;g.getIsFailed=Vb;g.getVcard=Wb;g.getDescription=Xb;g.getMatchedText=Yb;g.getThumbnail=Zb;g.getThumbnailHQ=$b;g.getMusicArtwork=ac;g.getRichPreviewType=bc;g.getPaymentLinkMetadata=cc;g.getLinkPreview=dc;g.getSupportsMessageFooter=ec;g.getSupportsMessageFooterLinks=fc;g.INITIAL_PAGE_SIZE=gc;g.getInitialPageSize=hc;g.getIsInitialE2ENotification=ic;g.getIsDisappearingModeSystemMessage=jc;g.getKicKey=kc;g.getKicSender=lc;g.getEphemeralExpirationTimestamp=mc;g.getIsRevoke=V;g.getRevokeDuration=nc;g.getWamEditType=oc;g.getWamDisappearingModeTrigger=pc;g.getWamDisappearingModeInitiatedByMe=qc;g.getWamDisappearingModeInitiator=rc;g.getInviteCode=sc;g.getInviteCodeExp=tc;g.getInviteGrp=uc;g.getInviteGrpName=vc;g.getInviteGrpJpegThum=wc;g.getInviteGrpType=xc;g.getIsGroupsV4InviteExpired=yc;g.getIsNewsletterAdminInviteExpired=zc;g.getProductHeaderImageRejected=Ac;g.getProductListHeaderImage=Bc;g.getIsAckPlayable=Cc;g.getHasReaction=Dc;g.getRecipients=Ec;g.getTemplateParams=Fc;g.getClientUrl=Gc;g.getLoc=Hc;g.getLat=Ic;g.getLng=Jc;g.getShareDuration=Kc;g.getFinalLat=Lc;g.getFinalLng=Mc;g.getStar=Nc;g.getCurrencyCode=Oc;g.getPriceAmount1000=Pc;g.getSalePriceAmount1000=Qc;g.getIsVcardOverMmsDocument=Rc;g.getInteractiveAnnotations=W;g.getMusicAnnotations=X;g.getHasEmbeddedMessagesAnnotation=Sc;g.getFirstMusicAnnotation=Tc;g.isStatusWithMusic=Uc;g.isStatusWithEmbeddedMessages=Vc;g.getFirstMusicAnnotationEmbeddedContent=Wc;g.getMessageSecret=Xc;g.getBroadcast=Yc;g.getVcardList=Zc;g.getVcardFormattedName=$c;g.getLabels=ad;g.getAgendId=bd;g.getUrl=cd;g.getRetailerId=dd;g.getBusinessOwnerJid=ed;g.getProductId=fd;g.getProductImageCount=gd;g.getIsMdHistoryMsg=hd;g.getCampaignId=id;g.getFilename=jd;g.getSmbClientCampaignId=kd;g.getIsCaptionByUser=ld;g.getDoNotPlayInline=md;g.getThumbnailDirectPath=nd;g.getThumbnailHeight=od;g.getThumbnailWidth=pd;g.getOrderTitle=qd;g.getItemCount=rd;g.getTotalAmount1000=sd;g.getTotalCurrencyCode=td;g.getFutureproofType=ud;g.getFutureproofSubtype=vd;g.getEphemeralOutOfSync=wd;g.getIsAvatar=xd;g.getBizPrivacyStatus=yd;g.getVerifiedBizName=zd;g.getMediaKey=Ad;g.getMessage=Bd;g.getSize=Cd;g.getHostedBizEncStateMismatch=Dd;g.getIsBotFutureproofPlaceholder=Ed;g.getIsViewOncePlaceholder=Fd;g.getIsBotQuery=Gd;g.getIsBizBot1pResponse=Hd;g.getIsBizBot3pResponse=Id;g.getBotPluginSearchProvider=Jd;g.getBotPluginSearchUrl=Kd;g.getBotResponseTargetId=Ld;g.getBotPluginSearchQuery=Md;g.getBotPluginType=Nd;g.getBotMessageDisclaimerText=Od;g.getRichResponse=Pd;g.getIsBotSearchResponse=Qd;g.getIsMetaBotResponse=Y;g.isMetaBotResponseToMyInvoke=Rd;g.getIsMetaBotInvokeResponse=Sd;g.getIsBotResponse=Td;g.getIsBotFeedbackMessage=Ud;g.getHsmTag=Z;g.getIsAuthenticationMessage=Vd;g.getIsMarketingTemplateTag=Wd;g.getBotRespOrInvocationRevokeBotWid=Xd;g.getIsRevokeForMsgFromOrDeliveredToBot=Yd;g.getIsBotPluginCarouselMsg=Zd;g.getBotPluginMaybeParent=$d;g.getBotReelPluginThumbnailCdnUrl=ae;g.getIsBizContentPlaceholder=be;g.getStatusMentioned=ce;g.getIsWamoSub=de;g.getIsVideoCall=$;g.getCallOutcome=ee;g.getCallSilenceReason=fe;g.getIsCallSilenced=ge;g.getIsMissedCall=he;g.getCallDuration=ie;g.getCallParticipants=b;g.getIsAdHocGroupCall=je;g.getIsGroupCall=e}),98); __d("WAWebAddonProcessRevoke",["Promise","WALogger","WANullthrows","WAWebAddonConstants","WAWebAddonDBTable","WAWebAddonGatingUtils","WAWebAddonLogUtils","WAWebAddonProcessRevokeDataUtils","WAWebAddonRetryRequestUtils","WAWebAddonSelectUtils","WAWebAddonUpdateDataUtils","WAWebMsgGetters","WAWebNoop","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["process addon revokes: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["process addon revoke ",", ",": ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: processRevokeMsgs "," addon(s)"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeRevokesForTableMode for ",": ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["revoking addons finished with errors"]);m=function(){return a};return a}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=new Map(),f=[];for(var g of d("WAWebAddonConstants").AddonTableMode.members())g!==d("WAWebAddonConstants").AddonTableMode.None&&f.push(d("WAWebAddonDBTable").addonInternalDBTable.bulkGetByMsgKey(g,a,!1).then(function(a){for(a of a)a!=null&&e.set(a.id.toString(),a)})["catch"](c("WAWebNoop")));yield (h||(h=b("Promise"))).all(f);return d("WAWebAddonSelectUtils").createAddonSelector(e)});return o.apply(this,arguments)}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=[],f=function(b){var c=b[0];b=b[1];e.push(d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:a.mode,tableMode:c},b)["catch"](function(a){d("WALogger").WARN(l(),c,a);throw a}))};for(c of c)f(c);f=(yield (h||(h=b("Promise"))).allSettled(e));d("WAWebAddonLogUtils").hasSettledWithError(f)&&d("WALogger").WARN(m()).tags("addons","messaging").sendLogs("revokeAddonMsgs")});return q.apply(this,arguments)}function r(a,b,c){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=[],g=new Map();for(b of b){var h=e.get(c("WANullthrows")(b.protocolMessageKey));if(!d("WAWebAddonGatingUtils").isUnifiedInfraEnabled(h))continue;var i=d("WAWebAddonSelectUtils").getTableModeByMsgType(h.type);g.has(i)||g.set(i,{add:[],remove:[]});i=c("WANullthrows")(g.get(i));b.id.equals(h.id)||i.remove.push(h);i.add.push(b);d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebMsgGetters").getFrom(h))&&f.push([h,b])}d("WALogger").LOG(k(),g.size).devConsole(g);yield p(a,g);yield d("WAWebAddonRetryRequestUtils").replaceSelfMessageTypeRows(f)});return s.apply(this,arguments)}function a(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c={mode:d("WAWebAddonConstants").AddonProcessMode.SendRevoke};try{yield r(c,[d("WAWebAddonProcessRevokeDataUtils").protocolRevokeToRevokeMsgData(a)],d("WAWebAddonSelectUtils").createAddonSelector(new Map([[b.id.toString(),b]])))}catch(c){d("WALogger").ERROR(j(),a.id,b.id,c).tags("addons","messaging").sendLogs("processSentRevokeMsg");throw c}});return t.apply(this,arguments)}function e(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={mode:d("WAWebAddonConstants").AddonProcessMode.Revoke},c=new Set();try{var e=a.map(function(a){return a.revokeMsgKey});e=(yield n(e));var f=[];for(a of a){var g=a.revokeMsgKey;if(!e.has(g)){c.add(g);continue}g=e.get(g);g=d("WAWebAddonProcessRevokeDataUtils").revokeMsgInfoToRevokeMsgData(a,g);f.push(g)}yield r(b,f,e);return c}catch(a){d("WALogger").ERROR(i(),a).tags("addons","messaging").sendLogs("processAddonRevokes");throw a}});return u.apply(this,arguments)}g.processSentRevokeMsg=a;g.processRevokeMsgs=e}),98); __d("WAWebProcessBaseMsgInfo",[],(function(a,b,c,d,e,f){a=function(a){return{id:a.id,from:a.from,to:a.to,type:a.type,t:a.t,ack:a.ack,count:null,author:a.author,notifyName:a.notifyName,invis:a.invis,subtype:a.subtype,viewMode:a.viewMode}};b=function(a){return{id:a.id,from:a.from,to:a.to,type:a.type,t:a.t,ack:a.ack,count:null,author:a.author,notifyName:a.notifyName,invis:a.invis,subtype:a.subtype,viewMode:a.viewMode}};f.msgToBaseMsgInfo=a;f.msgDataToBaseMsgInfo=b}),66); __d("WAWebAddonProcessRevokeDataUtils",["WAWebAddonCrossWindowUtils","WAWebAddonProcessMsgsUtils","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=function(a,b){var c=d("WAWebAddonCrossWindowUtils").getAddonProcessorType(b);return babelHelpers["extends"]({id:a.newMsgKey,type:d("WAWebMsgType").MSG_TYPE.REVOKED,kind:d("WAWebMsgType").MsgKind.RevokedAddon,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:a.subtype==="admin_revoke"?"admin":"sender",revokeTimestamp:(a=a.revokeTimestamp)!=null?a:void 0},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{revokeAddonType:c,protocolMessageKey:b.id,t:d("WAWebMsgGetters").getT(b),parentMsgKey:d("WAWebAddonProcessMsgsUtils").getParentMsgKey(b)})};b=function(a){return babelHelpers["extends"]({},d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(a),{id:a.id},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.REVOKED,kind:d("WAWebMsgType").MsgKind.RevokedAddon,subtype:a.subtype==="admin_revoke"?"admin":"sender",revokeTimestamp:a.revokeTimestamp,revokeAddonType:a.revokeAddonType,protocolMessageKey:a.protocolMessageKey,parentMsgKey:a.targetMessageKey})};g.revokeMsgInfoToRevokeMsgData=a;g.protocolRevokeToRevokeMsgData=b}),98); __d("WAWebMaybe",[],(function(a,b,c,d,e,f){function a(a,b){if(a!=null)return b(a)}f.ifSome=a}),66); __d("WAWebAddonQueryUtils",["WAWebDBMsgUtils","WAWebLidMigrationUtils","WAWebMaybe","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(a.map(String))),c=new Map(b.map(function(a){return[a.id.toString(),a]}));if(c.size===a.length)return c;b=a.filter(function(a){return!c.has(a.toString())}).map(d("WAWebLidMigrationUtils").getAlternateMsgKey).filter(Boolean);if(b.length>0){a=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(b.map(String)));a.forEach(function(a){d("WAWebMaybe").ifSome(d("WAWebLidMigrationUtils").getAlternateMsgKey(a.id),function(b){c.set(b.toString(),a)})})}return c});return h.apply(this,arguments)}g.getParentMsgsByMsgKey=a}),98); __d("WAWebSchemaSelfAddonMessageTypeTable",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addAutoIncrementingPrimaryKey;b=b.addIndex;a.add("self-addon-message-type").version(d("WAWebModelStorageVersions").selfMessageTypeCreateTable(),[e("rowId"),c("msgId"),c("msgType"),b("msgId")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("self-addon-message-type")}g.addTable=a;g.getSelfAddonMessageTypeTable=b}),98); __d("WAWebAddonRetryRequestUtils",["WALogger","WANullthrows","WAWebAck","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonDBTable","WAWebAddonPluginProcessor","WAWebAddonProcessMsgsUtils","WAWebAddonSelectUtils","WAWebAddonSortUtils","WAWebModelStorageUtils","WAWebSchemaSelfAddonMessageTypeTable","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["msg-retry: can not find addon ","."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["msg-retry: can not find addon ","."]);i=function(){return a};return a}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield d("WAWebSchemaSelfAddonMessageTypeTable").getSelfAddonMessageTypeTable().equals(["msgId"],a.id))[0]});return k.apply(this,arguments)}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if((yield j(a.id))==null){a={msgId:a.id.id,msgType:d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a)};yield d("WAWebSchemaSelfAddonMessageTypeTable").getSelfAddonMessageTypeTable().createOrReplace(a)}});return l.apply(this,arguments)}function e(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;return d("WAWebModelStorageUtils").getStorage().lock(["self-addon-message-type"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.anyOf(["msgId"],a.map(function(a){a=a[0];return a.id.id}))),d=a.map(function(a){var b=a[0];a=a[1];return{msgId:a.id.id,msgType:b.type}});yield b.bulkRemove(c.map(function(a){return a.rowId}).filter(Boolean));yield b.bulkCreateOrReplace(d)});return function(a){return c.apply(this,arguments)}}())});return m.apply(this,arguments)}function f(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j(a));if(b==null)return;var e=d("WAWebAddonSelectUtils").getTableModeByMsgType(b.msgType);e=(yield d("WAWebAddonDBTable").addonInternalDBTable.getByMsgKey(e,a));if(e==null){d("WALogger").WARN(i(),a.toString());return}if(!d("WAWebAddonCrossWindowUtils").isRealAddonType(e))return{msgData:e,selfMsgRow:b};var f=e.ack;if(f==null||f<d("WAWebAck").ACK.SENT){d("WALogger").WARN(h(),a.toString()).sendLogs("msg-retry");return}f=d("WAWebAddonPluginProcessor").getAddonProcessor(e).convert.toDualEncryptedMsgData;if(f!=null){a=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs([e],d("WAWebAddonConstants").AddonProcessMode.Send));var g=a[0];a=a[1];a=d("WAWebAddonSortUtils").collectValidAndOrphanAddons(a,g);a=a.validAddons;a=a[0];g=c("WANullthrows")(g.get(d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a).toString()));return{msgData:yield f(a,g),selfMsgRow:b}}return{msgData:e,selfMsgRow:b}});return n.apply(this,arguments)}g.hasSentAddonMsg=j;g.storeSelfMessageTypeRow=a;g.replaceSelfMessageTypeRows=e;g.getSentAddonMsgRecord=f}),98); __d("WAWebAddonDBSerializationUtils",["WAWebAddonProcessMsgsUtils"],(function(a,b,c,d,e,f,g){function h(a){a=i(a,"string");return typeof a==="symbol"?a:String(a)}function i(a,b){if(typeof a!=="object"||a===null)return a;var c=a[typeof Symbol==="function"?Symbol.toPrimitive:"@@toPrimitive"];if(c!==void 0){c=c.call(a,b||"default");if(typeof c!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(a)}a=function(a){var b=d("WAWebAddonProcessMsgsUtils").getParentMsgKeyName(a),c=a.id,e=a.ack,f=a.t,g=a.read;a.to;a.from;a.type;a.kind;a.notifyName;a.count;a.subtype;a.local;a[b];b=babelHelpers.objectWithoutPropertiesLoose(a,["id","ack","t","read","to","from","type","kind","notifyName","count","subtype","local",b].map(h));return{base:{msgKey:c.toString(),ack:e,t:f,read:g,targetMsgKey:d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a).toString()},addonProps:b}};g.extractAddonForUnifiedTable=a}),98); __d("WAWebCommentSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey,f=b.addEncryptedColumn;b=b.addIndex;a.add("comments").version(d("WAWebModelStorageVersions").commentCreateTable(),[e("msgKey"),c("parentMsgKey"),b("parentMsgKey"),c("t"),c("ack"),c("sender"),c("read"),f("msgRowOpaqueData",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("isOverwrittenByRevoke"),c("revokeTimestamp"),c("protocolMessageKey"),c("subtype"),c("isPlaceholder")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("comments")}g.addTable=a;g.getTable=b}),98); __d("WAWebApiHydrateWidsUtil",["WAWebWidFactory","WAWebWidJsonReviver"],(function(a,b,c,d,e,f,g){function h(a){if(Array.isArray(a))return a.map(function(b,a){return h(d("WAWebWidJsonReviver").widReviver(a,b,d("WAWebWidFactory").isWidlike,d("WAWebWidFactory").createWidFromWidLike))});else if(a&&typeof a==="object"){var b=Object.keys(a);for(var c=0;c<b.length;c++){var e=b[c];a[e]=h(d("WAWebWidJsonReviver").widReviver(e,a[e],d("WAWebWidFactory").isWidlike,d("WAWebWidFactory").createWidFromWidLike))}return a}return a}g.hydrateWids=h}),98); __d("WAWebDBMessageUtils",["$InternalEnum","WAWebVcardParsingUtils"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({IncomingChatMessage:"1",Outgoing:"2",SystemMessage:"3"});function i(a){a=a.toString(16);return(a.length-1).toString(16)+a}function j(a){return parseInt(a.substring(1),16)}function a(a){return a.toString()+"_/"}function c(a){return a.toString()+"_g"}function e(a,b){b=i(b);return a+"_"+b+"_m"}function f(a){a=a.split("_")[1];return j(a)}function k(a,b,c,d){c?c=h.SystemMessage:!b?c=h.Outgoing:c=h.IncomingChatMessage;return a+"_"+c+"_"+(d!=null?i(d):"")}function l(a){var b;if(a.type==="vcard")b=[a.body];else if(a.kind==="multiVcard")b=a.vcardList.map(function(a){return a.vcard});else return;return b.filter(Boolean).reduce(function(a,b){b=d("WAWebVcardParsingUtils").vcardWids(d("WAWebVcardParsingUtils").parseVcard(b));return a.concat(b.map(function(a){return a.toString()}))},[])}g.MessagePropertyType=h;g.undoOrderPreservingHex=j;g.beginningOfChat=a;g.endOfChat=c;g.craftInternalId=e;g.getInChatMsgId=f;g.craftMessageRangeIndex=k;g.getVcardWids=l}),98); __d("WAWebDBMsgOpaqueDataKeys",[],(function(a,b,c,d,e,f){b=["body","caption","paymentAmount1000","futureproofBuffer","messageSecret","clientUrl","loc","lng","lat","isLive","matchedText","title","description","pollName","pollSelectableOptionsCount","isSentCagPollCreation","pollUpdateParentKey","encPollVote","senderTimestampMs","targetMessageKey","encIv","encPayload","eventName","isEventCanceled","eventDescription","eventJoinLink","eventStartTime","eventLocation","eventEndTime"];c=["targetMessageKey","pollUpdateParentKey"];var g={targetMessageKey:"encReactionTargetMessageKey",encIv:"encReactionEncIv",encPayload:"encReactionEncPayload",encReactionTargetMessageKey:"targetMessageKey",encReactionEncIv:"encIv",encReactionEncPayload:"encPayload"};function a(a,b){return a==="reaction_enc"?g[b]:b}f.MSG_OPAQUE_DATA_KEYS=b;f.MsgKeyFieldsInOpaqueData=c;f.getKey=a}),66); __d("WAWebPollOptionHashUtils",["WABase64","WAHex","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return a}function h(a){return self.crypto.subtle.digest("SHA-256",new TextEncoder().encode(a))}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield h(a));return d("WAHex").toLowerCaseHex(new Uint8Array(a))});return j.apply(this,arguments)}function c(a){return d("WAHex").toHex(a)}function e(a){return d("WAHex").toHex(new Uint8Array(d("WABase64").decodeB64(a))).toUpperCase()}function f(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield i(a));a=a.concat(b);return i(a)});return k.apply(this,arguments)}g.createOptionHashHexFromString=a;g.getHashBufferForString=h;g.getHashHexForString=i;g.bufferToHex=c;g.base64ToHex=e;g.generatePollOptionHash=f}),98); __d("WAWebPollsDbUtils",["invariant","WANullthrows","WAWebPollOptionHashUtils"],(function(a,b,c,d,e,f,g,h){function a(a){return a==null?void 0:a.slice().sort(function(a,b){return a.localId-b.localId}).map(function(a,b){var c=a.localId,d=a.name;a=a.hash;c===b||h(0,59784);return a!=null?{name:d,hash:a}:{name:d}})}function b(a){a=(a=a==null?void 0:a.pollVotes)!=null?a:[];a=a==null?void 0:a.slice().sort(function(a,b){return a.option.localId-b.option.localId}).map(function(a,b){var c=a.option;a=a.optionVoteCount;c.localId===b||h(0,59784);return{option:{name:c.name},optionVoteCount:a}});return{pollVotes:a}}function e(a){return a==null?void 0:a.map(function(a,b){var e=a.name;a=a.hash;return a==null?{name:c("WANullthrows")(e),localId:b}:{name:c("WANullthrows")(e),localId:b,hash:d("WAWebPollOptionHashUtils").createOptionHashHexFromString(a)}})}function f(a){a=(a=a==null?void 0:a.pollVotes)!=null?a:[];a=a==null?void 0:a.map(function(a,b){var d=a.option;a=a.optionVoteCount;return{option:{name:c("WANullthrows")(d==null?void 0:d.name),localId:b},optionVoteCount:c("WANullthrows")(a)}});return{pollVotes:a}}g.compressPollOptions=a;g.compressPollVotesSnapshot=b;g.expandPollOptions=e;g.expandPollVotesSnapshot=f}),98); __d("WAWebDBMessageSerialization",["invariant","WAJids","WAWebApiHydrateWidsUtil","WAWebDBMessageUtils","WAWebDBMsgOpaqueDataKeys","WAWebMsgKey","WAWebMsgType","WAWebPollCreationUtils","WAWebPollsDbUtils","WAWebProtobufsMdStorageMsgRowOpaqueData.pb","WAWebViewMode.flow","WAWebWid","WAWebWidFactory","WAWebWidToJid","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g,h){var i=1e9,j=new Set(Object.values(d("WAWebMsgType").MSG_TYPE)),k=["id","parentMsgId","protocolMessageKey","paymentRequestMessageKey","keptMessageKey","pollUpdateParentKey","kicKey","latestEditMsgKey","targetMessageKey","pinParentKey","reactionParentKey","parentMsgKey"];function a(a,b){var e,f=babelHelpers["extends"]({},a);a.quotedMsg&&(f.quotedMsg=babelHelpers["extends"]({},a.quotedMsg));((e=a.quotedMsg)==null?void 0:e.paymentNoteMsg)&&(f.quotedMsg.paymentNoteMsg=babelHelpers["extends"]({},a.quotedMsg.paymentNoteMsg));a.paymentNoteMsg&&(f.paymentNoteMsg=babelHelpers["extends"]({},a.paymentNoteMsg));a.groupMentions&&(f.groupMentions=a.groupMentions.map(function(a){return{groupSubject:a.groupSubject,groupJid:d("WAWebWidFactory").createWidFromWidLike(a.groupJid)}}));f.star=f.isStarred!==void 0;f.isMdHistoryMsg=f.rowId<i;f.internalId!=null&&(((e=f.to)==null?void 0:e.server)==="newsletter"||((a=f.from)==null?void 0:a.endsWith("@newsletter")))&&(f.serverId=d("WAWebDBMessageUtils").getInChatMsgId(f.internalId));delete f.internalId;delete f.isStarred;delete f.count;delete f.hasLink;delete f.isMediaMsg;delete f.isDocMsg;delete f.isCallLogMsg;delete f.isCarouselMsg;delete f.isEventMsg;delete f.expiredTimestamp;delete f.pendingReadReceipt;m(f);d("WAWebApiHydrateWidsUtil").hydrateWids(f);k.forEach(function(a){f[a]!=null&&(f[a]=c("WAWebMsgKey").from(f[a]))});((e=f.quotedMsg)==null?void 0:e.id)!=null&&(f.quotedMsg.id=c("WAWebMsgKey").from(f.quotedMsg.id));f.messageSecret!=null&&(f.messageSecret=new Uint8Array(f.messageSecret));f.botMessageSecret!=null&&(f.botMessageSecret=new Uint8Array(f.botMessageSecret));a=l(f);e=a[0];var g=a[1];a=a[2];f.futureproofType=e;f.futureproofSubtype=g;f.subtype=(e=a)!=null?e:void 0;f.viewMode=(g=f.viewMode)!=null?g:d("WAWebViewMode.flow").ViewModeType.VISIBLE;f.carouselCardsParsed!=null&&(f.carouselCardsParsed=f.carouselCardsParsed.map(function(a){return babelHelpers["extends"]({},a,{id:a.id instanceof c("WAWebMsgKey")?a.id:new(c("WAWebMsgKey"))(a.id),parentMsgId:a.parentMsgId instanceof c("WAWebMsgKey")?a.parentMsgId:new(c("WAWebMsgKey"))(a.parentMsgId)})}));b==null?void 0:b(f);return f}function l(a){var b=a.futureproofType,c=a.futureproofSubtype,e=a.subtype;if(a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType==null&&a.subtype!=null){switch(a.subtype){case"poll_update":b=d("WAWebMsgType").MSG_TYPE.POLL_UPDATE;c="poll_vote";break;case"message_edit":b=d("WAWebMsgType").MSG_TYPE.PROTOCOL;c="message_edit";break;case"phone":case"phone_only_feature":break;default:j.has(a.subtype)||h(0,67194),b=a.subtype}a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&b!=null&&(e=void 0)}a.type===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&e==null&&(e="poll_vote");return[b,c,e]}function m(a){var b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,a.msgRowOpaqueData),e=b.currentMsg,f=b.quotedMsg;if(e){e.paymentNoteMsgBody!=null&&a.paymentNoteMsg&&(a.paymentNoteMsg.body=e.paymentNoteMsgBody);d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(b){a[b]=e[d("WAWebDBMsgOpaqueDataKeys").getKey(a.type,b)]});a.pollOptions=d("WAWebPollsDbUtils").expandPollOptions(e.pollOptions);a.pollVotesSnapshot=d("WAWebPollsDbUtils").expandPollVotesSnapshot(e.pollVotesSnapshot);a.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&(a.pollContentType=d("WAWebPollCreationUtils").getPollContentTypeFromDBValue(e.pollContentType));b=e.originalSelfAuthor;b!=null&&c("WAWebWid").isWid(b)&&(a.originalSelfAuthor=d("WAWebWidFactory").createWid(b));e.plainProtobufBytes!=null&&(a.plainProtobufBytes=new Uint8Array(e.plainProtobufBytes))}a.quotedMsg&&f&&(f.paymentNoteMsgBody!=null&&(a.quotedMsg.paymentNoteMsg.body=f.paymentNoteMsgBody),d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(b){a.quotedMsg[b]=f[d("WAWebDBMsgOpaqueDataKeys").getKey(a.type,b)]}),a.quotedMsg.pollOptions=d("WAWebPollsDbUtils").expandPollOptions(f.pollOptions))}function b(a,b){var c,d=babelHelpers["extends"]({},a);a.quotedMsg&&(d.quotedMsg=babelHelpers["extends"]({},a.quotedMsg));((c=a.quotedMsg)==null?void 0:c.paymentNoteMsg)&&(d.quotedMsg.paymentNoteMsg=babelHelpers["extends"]({},a.quotedMsg.paymentNoteMsg));a.paymentNoteMsg&&(d.paymentNoteMsg=babelHelpers["extends"]({},a.paymentNoteMsg));a.from&&(d.from=a.from.toString());(b==null?void 0:b.storeReportingInfo)===!0&&(d.preMatChat=a.preMatChat,d.senderWithDevice=a.senderWithDevice);k.forEach(function(a){d[a]!=null&&(d[a]=d[a].toString())});delete d.notifyName;delete d.isNewMsg;delete d.clearMedia;delete d.multicast;delete d.urlNumber;delete d.urlText;delete d.linkPreview;delete d.star;delete d.forwardedFromWeb;n(d,b);return d}function n(a,b){var c,e={currentMsg:{},quotedMsg:{}};if((c=a.paymentNoteMsg)==null?void 0:c.body){e.currentMsg.paymentNoteMsgBody=a.paymentNoteMsg.body;(c=a.paymentNoteMsg)==null?void 0:delete c.body}((c=a.quotedMsg)==null?void 0:(c=c.paymentNoteMsg)==null?void 0:c.body)&&(e.quotedMsg.paymentNoteMsgBody=a.quotedMsg.paymentNoteMsg.body,delete a.quotedMsg.paymentNoteMsg.body);d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(b){e.currentMsg[d("WAWebDBMsgOpaqueDataKeys").getKey(a.type,b)]=a[b],delete a[b]});a.originalSelfAuthor&&(e.currentMsg.originalSelfAuthor=d("WAJids").extractUserJid(d("WAWebWidToJid").widToDeviceJid(a.originalSelfAuthor)),delete a.originalSelfAuthor);e.currentMsg.pollContentType=d("WAWebPollCreationUtils").getPollContentTypeAsDBValue(a.pollContentType);delete a.pollContentType;e.currentMsg.pollOptions=d("WAWebPollsDbUtils").compressPollOptions(a.pollOptions);delete a.pollOptions;e.currentMsg.pollVotesSnapshot=d("WAWebPollsDbUtils").compressPollVotesSnapshot(a.pollVotesSnapshot);delete a.pollVotesSnapshot;a.quotedMsg&&(d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(b){e.quotedMsg[b]=a.quotedMsg[b],delete a.quotedMsg[b]}),e.quotedMsg.pollOptions=d("WAWebPollsDbUtils").compressPollOptions(a.quotedMsg.pollOptions),delete a.quotedMsg.pollOptions);(b==null?void 0:b.storeReportingInfo)===!0&&a.plainProtobufBytes!=null&&(e.currentMsg.plainProtobufBytes=a.plainProtobufBytes);delete a.plainProtobufBytes;c=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,e);a.msgRowOpaqueData=c.readBuffer()}g.messageFromDbRow=a;g.movFieldFromOpaqueDataBackToMsg=m;g.dbRowFromMessage=b;g.movEncFieldToOpaqueData=n}),98); __d("WAWebDBCommentMessageSerialization",["WANullthrows","WAWebDBMessageSerialization","WAWebMsgGetters","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebViewMode.flow","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){a=babelHelpers["extends"]({},a);d("WAWebDBMessageSerialization").movEncFieldToOpaqueData(a);return babelHelpers["extends"]({},a,{msgKey:a.id.toString(),parentMsgKey:a.parentMsgKey.toString(),sender:a.author.toString()})}function b(a){var b;return{msgKey:a.id.toString(),sender:c("WANullthrows")(d("WAWebMsgGetters").getSender(a),"undefined sender").toString(),parentMsgKey:a.parentMsgKey.toString(),t:d("WAWebMsgGetters").getT(a),ack:(b=d("WAWebMsgGetters").getAck(a))!=null?b:void 0,read:a.read,isOverwrittenByRevoke:!0,subtype:a.subtype,revokeTimestamp:a.revokeTimestamp,protocolMessageKey:a.protocolMessageKey.toString()}}function e(a){return{isPlaceholder:!0,msgKey:a.id.toString(),sender:c("WANullthrows")(d("WAWebMsgGetters").getSender(a),"undefined sender").toString(),parentMsgKey:a.parentMsgKey.toString(),read:a.read,t:d("WAWebMsgGetters").getT(a)}}function f(a){var b=c("WAWebMsgKey").from(a.msgKey),e=c("WAWebMsgKey").from(a.parentMsgKey);e=babelHelpers["extends"]({id:b,parentMsgKey:e,ack:a.ack,t:a.t},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE});if(a.isOverwrittenByRevoke===!0){return babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.REVOKED,kind:d("WAWebMsgType").MsgKind.RevokedAddon,subtype:c("WANullthrows")(a.subtype),revokeAddonType:d("WAWebMsgType").MSG_TYPE.COMMENT,revokeTimestamp:(b=a.revokeTimestamp)!=null?b:void 0,protocolMessageKey:c("WAWebMsgKey").from(c("WANullthrows")(a.protocolMessageKey,"undefined protocolMessageKey"))})}if(a.isPlaceholder===!0)return babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.CIPHERTEXT,kind:d("WAWebMsgType").MsgKind.PlaceholderAddon,realType:d("WAWebMsgType").MSG_TYPE.COMMENT});b=babelHelpers["extends"]({},a);d("WAWebDBMessageSerialization").movFieldFromOpaqueDataBackToMsg(b);return babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.COMMENT,kind:d("WAWebMsgType").MsgKind.CommentDecrypted,from:d("WAWebWidFactory").createUserWid(b.sender),body:b.body,author:d("WAWebWidFactory").createUserWid(b.sender),read:(e=a.read)!=null?e:!1})}g.dbRowFromCommentMessage=a;g.dbRowFromRevokedMsgData=b;g.dbRowFromPlaceholderAddon=e;g.commentMessageFromDbRow=f}),98); __d("WAWebAddonCommentTableMode",["WAWebAddonConstants","WAWebAddonInfraError","WAWebCommentSchema","WAWebDBCommentMessageSerialization","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a={mode:d("WAWebAddonConstants").AddonTableMode.Comment,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){if(a.kind===d("WAWebMsgType").MsgKind.CommentDecrypted)return d("WAWebDBCommentMessageSerialization").dbRowFromCommentMessage(a);if(a.kind===d("WAWebMsgType").MsgKind.RevokedAddon)return d("WAWebDBCommentMessageSerialization").dbRowFromRevokedMsgData(a);if(a.kind===d("WAWebMsgType").MsgKind.PlaceholderAddon)return d("WAWebDBCommentMessageSerialization").dbRowFromPlaceholderAddon(a);throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedMsgType)});yield d("WAWebCommentSchema").getTable().bulkCreateOrReplace(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebCommentSchema").getTable().bulkGet(a.map(function(a){return a.toString()}),b));return a.map(function(a){return a==null?a:d("WAWebDBCommentMessageSerialization").commentMessageFromDbRow(a)})});function c(b,c){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebCommentSchema").getTable().anyOf(["parentMsgKey"],a.map(function(a){return a.toString()})));return a.map(d("WAWebDBCommentMessageSerialization").commentMessageFromDbRow)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebCommentSchema").getTable().bulkRemove(a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebCommentSchema").getTable().get(a.toString()));return a==null?null:d("WAWebDBCommentMessageSerialization").commentMessageFromDbRow(a)});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebCommentSchema").getTable().merge(a.id.toString(),{ack:b})});function c(b,c){return a.apply(this,arguments)}return c}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebCommentSchema").getTable().merge(a.toString(),{read:!0})});function c(b){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebCommentSchema").getTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.commentTableMode=a}),98); __d("WAWebEventResponseDBSerialization",["WANullthrows","WAWebMsgGetters","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebViewMode.flow","err"],(function(a,b,c,d,e,f,g){function h(a){a=d("WAWebProtobufsE2E.pb").Message$EventResponseMessage$EventResponseType.cast(new Uint8Array(a)[0]);if(a==null)throw c("err")("Value contained in array buffer is not a valid event response");return a}function i(a){var b=new ArrayBuffer(1);b=new Uint8Array(b);b[0]=a;return b.buffer}function a(a){var b=c("WANullthrows")(d("WAWebMsgGetters").getSender(a));return{msgKey:a.id.toString(),parentMsgKey:a.parentMsgKey.toString(),eventResponse:i(a.eventResponse),senderTimestampMs:a.senderTimestampMs,sender:b.toString(),t:a.t,ack:a.ack,read:d("WAWebUserPrefsMeUser").isMeAccount(b)||a.read}}function b(a){var b=c("WAWebMsgKey").from(a.msgKey);return babelHelpers["extends"]({id:b},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,kind:d("WAWebMsgType").MsgKind.EventResponseDecrypted,ack:a.ack,t:a.t,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,eventResponse:h(a.eventResponse),parentMsgKey:c("WAWebMsgKey").from(a.parentMsgKey),senderTimestampMs:a.senderTimestampMs,read:(b=a.read)!=null?b:!1})}g.dbRowFromEventResponseMessage=a;g.eventResponseMessageFromDBRow=b}),98); __d("WAWebEventResponsesSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey,f=b.addEncryptedColumn;b=b.addIndex;a.add("event-responses").version(d("WAWebModelStorageVersions").eventsResponsesCreateTable(),[e(["parentMsgKey","sender"]),c("msgKey"),b("parentMsgKey"),c("t"),c("ack"),c("read"),c("senderTimestampMs"),f("eventResponse",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER)]).version(d("WAWebModelStorageVersions").eventResponsesAddMsgKeyIndex(),[b("msgKey")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("event-responses")}g.addTable=a;g.getTable=b}),98); __d("WAWebAddonEventResponseTableMode",["WANullthrows","WAWebAddonConstants","WAWebAddonInfraError","WAWebEventResponseDBSerialization","WAWebEventResponsesSchema","WAWebMsgGetters","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h={mode:d("WAWebAddonConstants").AddonTableMode.EventResponse,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebEventResponsesSchema").getTable().bulkCreateOrReplace(a.map(function(a){if(a.kind!==d("WAWebMsgType").MsgKind.EventResponseDecrypted)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType);return d("WAWebEventResponseDBSerialization").dbRowFromEventResponseMessage(a)}))});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebEventResponsesSchema").getTable().anyOf(["parentMsgKey","sender"],a.map(function(a){return[a[0].toString(),a[1].toString()]})));return a.map(d("WAWebEventResponseDBSerialization").eventResponseMessageFromDBRow)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebEventResponsesSchema").getTable().anyOf(["parentMsgKey"],a.map(function(a){return a.toString()})));return a.map(d("WAWebEventResponseDBSerialization").eventResponseMessageFromDBRow)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebEventResponsesSchema").getTable().bulkRemoveByIndex(["msgKey"],a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(a=(yield d("WAWebEventResponsesSchema").getTable().equals(["msgKey"],a.toString())))==null?void 0:a[0];return a==null?a:d("WAWebEventResponseDBSerialization").eventResponseMessageFromDBRow(a)});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e;if(a.kind===d("WAWebMsgType").MsgKind.EventResponseEncrypted)e=a.targetMessageKey;else if(a.kind===d("WAWebMsgType").MsgKind.EventResponseDecrypted)e=a.parentMsgKey;else throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType);yield d("WAWebEventResponsesSchema").getTable().merge([e.toString(),c("WANullthrows")(d("WAWebMsgGetters").getSender(a)).toString()],{ack:b})});function e(b,c){return a.apply(this,arguments)}return e}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield h.getByMsgKey(a));if(a!=null)return h.bulkUpsert([babelHelpers["extends"]({},a,{read:!0})])});function c(b){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebEventResponsesSchema").getTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.eventResponseTableMode=h}),98); __d("WAWebMaxPerGroup",[],(function(a,b,c,d,e,f){function a(a,b,c){var d=new Map();for(a of a){var e=c(a),f=d.get(e);(f==null||b(a)>=b(f))&&d.set(e,a)}return Array.from(d.values())}f.maxPerGroup=a}),66); __d("WAWebPollsDbSerialization",["WAWebMsgKey","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b={msgKey:a.msgKey.toString(),parentMsgKey:a.parentMsgKey.toString(),selectedOptionLocalIds:new Uint8Array(a.selectedOptionLocalIds).buffer,senderTimestampMs:a.senderTimestampMs,sender:a.sender.toString(),read:a.read};a.t!=null&&(b.t=a.t);a.ack!=null&&(b.ack=a.ack);return b}function b(a){return{msgKey:c("WAWebMsgKey").fromString(a.msgKey),parentMsgKey:c("WAWebMsgKey").fromString(a.parentMsgKey),selectedOptionLocalIds:Array.from(new Uint8Array(a.selectedOptionLocalIds)),senderTimestampMs:a.senderTimestampMs,t:a.t,sender:d("WAWebWidFactory").createUserWid(a.sender),ack:a.ack,read:(a=a.read)!=null?a:!0}}g.dbRowFromVote=a;g.voteFromDbRow=b}),98); __d("WAWebPollsGetVoteKey",["WAWebLidMigrationUtils","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=a.parentMsgKey;a=a.sender;a=d("WAWebWidFactory").createWidFromWidLike(a);return String(b)+"|"+String(d("WAWebLidMigrationUtils").toLid(a))+"|"+String(d("WAWebLidMigrationUtils").toPn(a))}g.getVoteKey=a}),98); __d("WAWebDBPollsUpsertVotes",["WAWebApiContact","WAWebMaxPerGroup","WAWebModelStorageUtils","WAWebPollsDbSerialization","WAWebPollsGetVoteKey","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var c=d("WAWebMaxPerGroup").maxPerGroup(a,function(a){return a.senderTimestampMs},d("WAWebPollsGetVoteKey").getVoteKey);return d("WAWebModelStorageUtils").getStorage().lock(["poll-votes"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.anyOf(["parentMsgKey","sender"],h(c))),e=new Map();for(b of b)e.set(d("WAWebPollsGetVoteKey").getVoteKey(b),b);b=[];var f=[],g=[];for(var i of c){var j=e.get(d("WAWebPollsGetVoteKey").getVoteKey(i));if(j!=null){if(j.senderTimestampMs>i.senderTimestampMs){b.push(d("WAWebPollsDbSerialization").voteFromDbRow(j));continue}String(i.sender)!==String(j.sender)&&g.push(j)}var k=i.selectedOptionLocalIds.length===0;j=(j=j==null?void 0:j.read)!=null?j:!1;k=!k&&j&&i.read!==j?babelHelpers["extends"]({},i,{read:!0}):i;b.push(k);f.push(d("WAWebPollsDbSerialization").dbRowFromVote(k))}g.length>0&&(yield a.bulkRemove(f.map(function(a){return[a.parentMsgKey,a.sender]})));f.length>0&&(yield a.bulkCreateOrReplace(f));return b});return function(b){return a.apply(this,arguments)}}())}function h(a){var b=[];for(a of a){var c=a.parentMsgKey,e=a.sender;b.push([c.toString(),e.toString()]);e=d("WAWebApiContact").getAlternateUserWid(e);e!=null&&b.push([c.toString(),e.toString()])}return b}g.upsertVotesDb=a}),98); __d("WAWebPollsVoteDataUtils",["WANullthrows","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.msgKey,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),c=b.from,e=b.to;b=b.author;return{id:a.msgKey,to:e,from:c,author:b,type:d("WAWebMsgType").MSG_TYPE.POLL_UPDATE,kind:d("WAWebMsgType").MsgKind.PollVoteDecrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,pollUpdateParentKey:a.parentMsgKey,selectedOptionLocalIds:a.selectedOptionLocalIds,senderTimestampMs:a.senderTimestampMs,t:(e=a.t)!=null?e:void 0,ack:(c=a.ack)!=null?c:void 0,read:(b=a.read)!=null?b:!1}}function b(a){return{msgKey:a.id,parentMsgKey:a.pollUpdateParentKey,selectedOptionLocalIds:a.selectedOptionLocalIds,senderTimestampMs:a.senderTimestampMs,t:a.t,sender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a))),ack:d("WAWebMsgGetters").getAck(a),read:d("WAWebUserPrefsMeUser").isMeAccount(a.from)||a.read}}g.voteDataToPollVoteMsgData=a;g.pollVoteMsgDataToVoteData=b}),98); __d("WAWebPollsVotesSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey,f=b.addEncryptedColumn;b=b.addIndex;a.add("poll-votes").version(d("WAWebModelStorageVersions").pollVotesCreateTable(),[e(["parentMsgKey","sender"]),c("msgKey"),b("parentMsgKey"),f("selectedOptionLocalIds",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("senderTimestampMs"),c("ack"),c("t"),c("read")]).version(d("WAWebModelStorageVersions").pollVotesAddMsgKeyIndex(),[b("msgKey")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("poll-votes")}g.addTable=a;g.getTable=b}),98); __d("WAWebAddonPollVoteTableMode",["WANullthrows","WAWebAddonConstants","WAWebAddonInfraError","WAWebDBPollsUpsertVotes","WAWebMsgType","WAWebPollsDbSerialization","WAWebPollsVoteDataUtils","WAWebPollsVotesSchema","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(a){return d("WAWebPollsVoteDataUtils").voteDataToPollVoteMsgData(d("WAWebPollsDbSerialization").voteFromDbRow(a))},i={mode:d("WAWebAddonConstants").AddonTableMode.PollVote,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){if(a.kind!==d("WAWebMsgType").MsgKind.PollVoteDecrypted)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType);return d("WAWebPollsVoteDataUtils").pollVoteMsgDataToVoteData(a)});yield d("WAWebDBPollsUpsertVotes").upsertVotesDb(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPollsVotesSchema").getTable().anyOf(["parentMsgKey","sender"],a.map(function(a){return[a[0].toString(),a[1].toString()]})));return a.map(h)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPollsVotesSchema").getTable().anyOf(["parentMsgKey"],a.map(function(a){return a.toString()})));return a.map(h)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebPollsVotesSchema").getTable().bulkRemoveByIndex(["msgKey"],a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPollsVotesSchema").getTable().equals(["msgKey"],a.toString()))[0];return a==null?a:h(a)});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.kind!==d("WAWebMsgType").MsgKind.PollVoteDecrypted&&a.kind!==d("WAWebMsgType").MsgKind.PollVoteEncrypted)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType);yield d("WAWebPollsVotesSchema").getTable().merge([a.pollUpdateParentKey.toString(),c("WANullthrows")(a.from).toString()],{ack:b})});function e(b,c){return a.apply(this,arguments)}return e}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield i.getByMsgKey(a));if(a!=null)return i.bulkUpsert([babelHelpers["extends"]({},a,{read:!0})])});function c(b){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebPollsVotesSchema").getTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.pollVoteTableMode=i}),98); __d("WAWebAddonDBTable",["WAWebAddonCommentTableMode","WAWebAddonConstants","WAWebAddonEventResponseTableMode","WAWebAddonInfraError","WAWebAddonPinTableMode","WAWebAddonPollVoteTableMode","WAWebAddonReactionTableMode","WAWebAddonSelectUtils","WAWebAddonUnifiedAddonsTableMode","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(a){switch(a){case d("WAWebAddonConstants").AddonTableMode.Pin:return d("WAWebAddonPinTableMode").pinTableMode;case d("WAWebAddonConstants").AddonTableMode.PollVote:return d("WAWebAddonPollVoteTableMode").pollVoteTableMode;case d("WAWebAddonConstants").AddonTableMode.Comment:return d("WAWebAddonCommentTableMode").commentTableMode;case d("WAWebAddonConstants").AddonTableMode.Reaction:return d("WAWebAddonReactionTableMode").reactionTableMode;case d("WAWebAddonConstants").AddonTableMode.EventResponse:return d("WAWebAddonEventResponseTableMode").eventResponseTableMode;case d("WAWebAddonConstants").AddonTableMode.Unified:return d("WAWebAddonUnifiedAddonsTableMode").unifiedAddonsTableMode;case d("WAWebAddonConstants").AddonTableMode.None:throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)}},i={bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.length===0)return;return h(a).bulkUpsert(b)});function c(b,c){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return b.length===0?[]:h(a).bulkGetByParentAndSender(b)});function c(b,c){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return h(a).bulkGetByMsgKey(b,c)});function c(b,c,d){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return h(a).bulkGetByParentMsgKey(b)});function c(b,c){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return h(a).bulkGetByChatWid(b)});function c(b,c){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.length===0)return;return h(a).bulkRemoveByMsgKey(b)});function c(b,c){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return h(a).updateAck(b,c)});function c(b,c,d){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return h(a).getByMsgKey(b)});function c(b,c){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return h(a).getTableSize()});function c(b){return a.apply(this,arguments)}return c}()};a={bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return i.bulkGetByParentAndSender(d("WAWebAddonSelectUtils").getTableModeByMsgType(a),b)});function c(b,c){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return i.getByMsgKey(d("WAWebAddonSelectUtils").getTableModeByMsgType(a),b)});function c(b,c){return a.apply(this,arguments)}return c}()};g.addonInternalDBTable=i;g.addonDBTable=a}),98); __d("WAWebCastToPinInChatMsg",["invariant","WAWebMsgType"],(function(a,b,c,d,e,f,g,h){function i(a){return a.type===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE?a:null}function a(a){a=i(a);a!=null||h(0,76405);return a}g.assertPinInChatMsgData=a}),98); __d("WAWebPinInChatSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("pinned-messages").version(d("WAWebModelStorageVersions").pinInChatCreateTable(),[e("parentMsgKey"),c("chatId"),c("msgKey"),c("senderTimestampMs"),c("ack"),c("t"),c("pinType"),c("pinExpiryDuration"),c("sender"),b("msgKey"),b("chatId")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("pinned-messages")}g.addTable=a;g.getTable=b}),98); __d("WAWebAddonPinTableMode",["WAWebAddonConstants","WAWebAddonInfraError","WAWebCastToPinInChatMsg","WAWebDBCRUDOperationsPinInChat","WAWebPinInChatSchema","WAWebPinsDbSerialization","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h={mode:d("WAWebAddonConstants").AddonTableMode.Pin,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(function(a){return d("WAWebPinsDbSerialization").serializePinInChatMsgData(d("WAWebCastToPinInChatMsg").assertPinInChatMsgData(a))});yield d("WAWebDBCRUDOperationsPinInChat").createOrUpdatePinInChat(a[0].id.remote,b)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length!==1)return[];a=(yield d("WAWebPinInChatSchema").getTable().get(a[0].toString()));return a==null?[]:[d("WAWebPinsDbSerialization").deserializePinInChatMsgData(a)]});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPinInChatSchema").getTable().anyOf(["chatId"],a.map(function(a){return a.toString()})));return a.map(d("WAWebPinsDbSerialization").deserializePinInChatMsgData)});function c(b){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebPinInChatSchema").getTable().bulkRemoveByIndex(["msgKey"],a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPinInChatSchema").getTable().equals(["msgKey"],a.toString()))[0];return a==null?a:d("WAWebPinsDbSerialization").deserializePinInChatMsgData(a)});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WAWebPinsDbSerialization").serializePinInChatMsgData(d("WAWebCastToPinInChatMsg").assertPinInChatMsgData(a));yield d("WAWebPinInChatSchema").getTable().merge(a.parentMsgKey,{ack:b})});function c(b,c){return a.apply(this,arguments)}return c}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield h.getByMsgKey(a));if(a!=null)return h.bulkUpsert([babelHelpers["extends"]({},a,{read:!0})])});function c(b){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebPinInChatSchema").getTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.pinTableMode=h}),98); __d("WAWebCastToReactionMsg",["invariant","WAWebMsgType"],(function(a,b,c,d,e,f,g,h){function i(a){return a.type===d("WAWebMsgType").MSG_TYPE.REACTION?a:null}function a(a){a=i(a);a!=null||h(0,73785);return a}g.castToReactionMsgData=i;g.assertReactionMsgData=a}),98); __d("WAWebSchemaReactions",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){b("$InternalEnum").Mirrored(["ParentMsgPlaceholder","ParentMsgMissing","ParentMsgFutureproof"]);function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey,f=b.addCompositeIndex;b=b.addIndex;a.add("reactions").version(d("WAWebModelStorageVersions").reactionsCreateTable(),[e(["parentMsgKey","senderUserJid"]),c("msgKey"),c("reactionText"),c("timestamp"),c("orphan"),c("orphanReason"),c("read"),c("ack"),b("parentMsgKey"),b("orphan"),c("t")]).version(d("WAWebModelStorageVersions").addReactionTableOrphanIndex(),[f(["parentMsgKey","orphan"])]).version(d("WAWebModelStorageVersions").addReactionTableMsgKeyIndex(),[b("msgKey")]).view(function(a){return a})}function c(){return d("WAWebModelStorageUtils").getStorage().table("reactions")}g.addTable=a;g.getReactionsTable=c}),98); __d("WAWebAddonReactionTableMode",["WANullthrows","WAWebAddonConstants","WAWebAddonInfraError","WAWebCastToReactionMsg","WAWebMsgGetters","WAWebMsgType","WAWebReactionDataUtils","WAWebSchemaReactions","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h={mode:d("WAWebAddonConstants").AddonTableMode.Reaction,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){return d("WAWebReactionDataUtils").reactionMsgDataToReactionRow(d("WAWebCastToReactionMsg").assertReactionMsgData(a))});yield d("WAWebSchemaReactions").getReactionsTable().bulkCreateOrReplace(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaReactions").getReactionsTable().anyOf(["parentMsgKey","senderUserJid"],a.map(function(a){var b=a[0];a=a[1];return[b.toString(),a.toString()]})));return a.map(d("WAWebReactionDataUtils").reactionRowToReactionMsgData)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaReactions").getReactionsTable().anyOf(["parentMsgKey"],a.map(function(a){return a.toString()})));return a.map(d("WAWebReactionDataUtils").reactionRowToReactionMsgData)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaReactions").getReactionsTable().bulkRemoveByIndex(["msgKey"],a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaReactions").getReactionsTable().equals(["msgKey"],a.toString()))[0];return a==null?a:d("WAWebReactionDataUtils").reactionRowToReactionMsgData(a)});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e;if(a.kind===d("WAWebMsgType").MsgKind.ReactionEncrypted)e=a.targetMessageKey;else if(a.kind===d("WAWebMsgType").MsgKind.ReactionDecrypted)e=a.reactionParentKey;else throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedMsgType);yield d("WAWebSchemaReactions").getReactionsTable().merge([e.toString(),c("WANullthrows")(d("WAWebMsgGetters").getSender(a)).toString()],{ack:b})});function e(b,c){return a.apply(this,arguments)}return e}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield h.getByMsgKey(a));if(a!=null)return h.bulkUpsert([babelHelpers["extends"]({},a,{read:!0})])});function c(b){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSchemaReactions").getReactionsTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.reactionTableMode=h}),98); __d("WAWebSchemaUnifiedAddons",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("addons-unified").version(d("WAWebModelStorageVersions").createUnifiedAddonsTable(),[e("msgKey"),c("targetMsgKey"),b("targetMsgKey"),c("arbitraryIndex"),b("arbitraryIndex"),c("rowType"),b("rowType"),c("ack"),c("t"),c("read"),c("addonProps")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("addons-unified")}g.addTable=a;g.getTable=b}),98); __d("WAWebAddonUnifiedAddonsTableMode",["WAWebAddonConstants","WAWebAddonInfraError","WAWebMsgType","WAWebPinsDbSerialization","WAWebSchemaUnifiedAddons","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(a){return a.map(function(a){if(a.rowType===d("WAWebAddonConstants").AddonMinimizedType.PinInChat)return d("WAWebPinsDbSerialization").unifiedAddonRowIntoPinInChatMsgData(a);throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType)})};a={mode:d("WAWebAddonConstants").AddonTableMode.Unified,bulkUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){if(a.kind===d("WAWebMsgType").MsgKind.PinInChat)return d("WAWebPinsDbSerialization").pinInChatMsgDatIntoUnifiedAddonRow(a);throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});yield d("WAWebSchemaUnifiedAddons").getTable().bulkCreateOrReplace(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByParentAndSender:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),bulkGetByParentMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaUnifiedAddons").getTable().anyOf(["targetMsgKey"],a.map(function(a){return a.toString()})));return h(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkGetByChatWid:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaUnifiedAddons").getTable().anyOf(["arbitraryIndex"],a.map(function(a){return a.toString()})));return h(a)});function c(b){return a.apply(this,arguments)}return c}(),bulkRemoveByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaUnifiedAddons").getTable().bulkRemove(a.map(function(a){return a.toString()}))});function c(b){return a.apply(this,arguments)}return c}(),getByMsgKey:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaUnifiedAddons").getTable().get(a.toString()));return a==null?null:h([a])[0]});function c(b){return a.apply(this,arguments)}return c}(),updateAck:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebSchemaUnifiedAddons").getTable().merge(a.id.toString(),{ack:b})});function c(b,c){return a.apply(this,arguments)}return c}(),markAsRead:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});function c(){return a.apply(this,arguments)}return c}(),getTableSize:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSchemaUnifiedAddons").getTable().count()});function c(){return a.apply(this,arguments)}return c}()};g.unifiedAddonsTableMode=a}),98); __d("AddonPlaceholderMsgsUtils",["WAWebAddonConstants","WAWebAddonDBTable","WAWebAddonInfraError","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var b=a.addons;a=a.processor;if(a.type!==d("WAWebAddonConstants").AddonProcessorType.DualEncryptedWithMessageTraits)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedFeature);a=[];for(b of b)b.kind===d("WAWebMsgType").MsgKind.PlaceholderAddon&&a.push(b.id);return a.length===0?null:a}function c(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebAddonDBTable").addonInternalDBTable.bulkGetByMsgKey(a,b));b=new Set();for(a of a)a!=null&&a.kind===d("WAWebMsgType").MsgKind.PlaceholderAddon&&b.add(a.id.toString());return b});return h.apply(this,arguments)}g.getIncomingPlaceholderKeys=a;g.getPlaceholderMsgKeys=c}),98); __d("WALongInt",["WAHex","WALogger"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is over 64 bits']);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(['"','" is not a valid decimal string']);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," is not a safe integer"]);j=function(){return a};return a}function k(a){if(typeof a!=="number"){d("WALogger").LOG(j(),a).color("red");throw new Error("numberOrThrowIfTooLarge is given a non-safe integer")}return a}f=function(a){return a==null?a:k(a)};function a(a){return a==null||typeof a!=="number"?null:a}function b(a,b){if(typeof a==="number"&&typeof b==="number")return a>b;a=typeof a==="number"?d("WAHex").hexLongFromNumber(a):a;b=typeof b==="number"?d("WAHex").hexLongFromNumber(b):b;return d("WAHex").isBiggerHexLong(a,b)}function c(a){if(typeof a==="number")return a.toString(10);var b=d("WAHex").hexLongToHex(a),c=[0],e=0;for(var f=0;f<b.length;f++){e=d("WAHex").hexAt(b,f);for(var g=0;g<c.length;g++)c[g]=c[g]*16+e,e=c[g]/10|0,c[g]%=10;while(e>0)c.push(e%10),e=e/10|0}g=c.reverse().join("");return d("WAHex").hexLongIsNegative(a)?"-"+g:g}function e(a){if(!/^-?\d+$/.test(a)){d("WALogger").LOG(i(),a).color("red");throw new Error("decimalStringToLongInt is given an invalid decimal string")}var b=a[0]==="-",c=a.replace(/^-?0*/,""),e=c.length;if(e<16||e===16&&c<="9007199254740991")return b?-Number(c):Number(c);if(e>20||e===20&&c>"18446744073709551615"||b&&(e>19||e===19&&c>"9223372036854775807")){d("WALogger").LOG(h(),a).color("red");throw new Error("decimalStringToHexLong is given value over 64 bits")}a=0;var f=0;for(var g=0;g<e;g++)a=a*10+Number(c[g]),f=f*10+Math.floor(a/4294967296),a=a%4294967296;return d("WAHex").createHexLongFrom32Bits(f,a,b)}g.numberOrThrowIfTooLarge=k;g.maybeNumberOrThrowIfTooLarge=f;g.maybeNumber=a;g.isBiggerLongInt=b;g.longIntToDecimalString=c;g.decimalStringToLongInt=e}),98); __d("WAWebAddOnParseWebMsgInfo",["WALongInt","WANullthrows","WATimeUtils","WAWebE2EProtoUtils","WAWebMsgKey","WAWebUserPrefsMeUser","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a,b,e){var f=!!a.fromMe,g=d("WAWebE2EProtoUtils").decodeJid(a.remoteJid),h;f?g!=null&&typeof g!=="string"&&!g.isUser()&&(b===!0?h=d("WAWebUserPrefsMeUser").getMaybeMeLidUser():h=d("WAWebUserPrefsMeUser").getMeUser()):h=e!=null?d("WAWebE2EProtoUtils").decodeJid(e):d("WAWebE2EProtoUtils").decodeJid(a.participant);if(typeof g==="string"||g==null)return null;h!=null&&typeof h!=="string"?e=new(c("WAWebMsgKey"))({id:c("WANullthrows")(a.id),fromMe:f,remote:g,participant:h}):e=new(c("WAWebMsgKey"))({id:c("WANullthrows")(a.id),fromMe:f,remote:g});a=b===!0?c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLidUser()):d("WAWebUserPrefsMeUser").getMeUser();g=e.participant||e.remote;b=d("WAWebWidFactory").toUserWid(f===!0?a:g);return{msgKey:e,sender:b}}function b(a){return a==null?null:Math.floor(d("WALongInt").numberOrThrowIfTooLarge(a)/1e3)}function e(a){var b=d("WATimeUtils").unixTimeMs();return a==null?b:Math.max(a+1,b)}g.buildAddonMsgKey=a;g.getAddonServerTimestamp=b;g.getIncreasingLatestSenderTimestampMs=e}),98); __d("WAWebAddonGatingUtils",["WAWebAddonCrossWindowUtils","WAWebAddonPluginProcessor","WAWebAddonProcessMsgsUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebAddonPluginProcessor").hasAddonProcessor(a)?d("WAWebAddonPluginProcessor").getAddonProcessor(a).isEnabled():!1}function b(a){a=d("WAWebAddonProcessMsgsUtils").castToAddonMsgData(a);return a==null||!d("WAWebAddonCrossWindowUtils").isInfraSupportedAddon(a)?!1:d("WAWebAddonPluginProcessor").getAddonProcessor(a).isEnabled()}g.isUnifiedInfraEnabledForType=a;g.isUnifiedInfraEnabled=b}),98); __d("WAWebReactionGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){var h;function a(){h===void 0&&(h=Boolean(d("WAWebABProps").getABPropConfigValue("flattened_reactions_collection")));return h}function b(){return d("WAWebABProps").getABPropConfigValue("web_reaction_notification_via_add_on_api")}g.isFlattenedReactionsEnabled=a;g.isReactionNotificationAddOnApiEnabled=b}),98); __d("WAWebProtobufsUserPassword.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NONE:0,PBKDF2_HMAC_SHA512:1,PBKDF2_HMAC_SHA384:2});c=b("$InternalEnum")({UTF8:0,UTF8_BROKEN:1});e={};f={};b={};e.internalSpec={encoding:[1,(d=d("WAProtoConst")).TYPES.ENUM,c],transformer:[2,d.TYPES.ENUM,a],transformerArg:[3,d.FLAGS.REPEATED|d.TYPES.MESSAGE,f],transformedData:[4,d.TYPES.BYTES]};f.internalSpec={key:[1,d.TYPES.STRING],value:[2,d.TYPES.MESSAGE,b]};b.internalSpec={asBlob:[1,d.TYPES.BYTES],asUnsignedInteger:[2,d.TYPES.UINT32],__oneofs__:{value:["asBlob","asUnsignedInteger"]}};g.UserPassword$Transformer=a;g.UserPassword$Encoding=c;g.UserPasswordSpec=e;g.UserPassword$TransformerArgSpec=f;g.UserPassword$TransformerArg$ValueSpec=b}),98); __d("WAWebProtobufsChatLockSettings.pb",["WAProtoConst","WAWebProtobufsUserPassword.pb"],(function(a,b,c,d,e,f,g){a={};a.internalSpec={hideLockedChats:[1,d("WAProtoConst").TYPES.BOOL],secretCode:[2,d("WAProtoConst").TYPES.MESSAGE,d("WAWebProtobufsUserPassword.pb").UserPasswordSpec]};g.ChatLockSettingsSpec=a}),98); __d("WAWebProtobufsDeviceCapabilities.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NONE:0,MINIMAL:1,FULL:2});c={};e={};c.internalSpec={chatLockSupportLevel:[1,d("WAProtoConst").TYPES.ENUM,a],lidMigration:[2,d("WAProtoConst").TYPES.MESSAGE,e]};e.internalSpec={chatDbMigrationTimestamp:[1,d("WAProtoConst").TYPES.UINT64]};g.DeviceCapabilities$ChatLockSupportLevel=a;g.DeviceCapabilitiesSpec=c;g.DeviceCapabilities$LIDMigrationSpec=e}),98); __d("WAWebProtobufSyncAction.pb",["$InternalEnum","WAProtoConst","WAWebProtobufsChatLockSettings.pb","WAWebProtobufsDeviceCapabilities.pb","WAWebProtobufsProtocol.pb"],(function(a,b,c,d,e,f,g){var h;c=(a=b("$InternalEnum"))({REGULAR:0,SCHEDULED_CALL:1,VOICE_CHAT:2});e=a({NONE:0,SCHEDULED:1,PRIVACY:2,LIGHTWEIGHT:3});f=a({CONNECTED:0,REJECTED:1,CANCELLED:2,ACCEPTEDELSEWHERE:3,MISSED:4,INVALID:5,UNAVAILABLE:6,UPCOMING:7,FAILED:8,ABANDONED:9,ONGOING:10});b=a({DEFAULT_ALL_MESSAGES:0,ALL_MESSAGES:1,HIGHLIGHTS:2,DEFAULT_HIGHLIGHTS:3});var aa=a({ACTIVE:0}),ba=a({ACTIVE:0,INACTIVE:1}),ca=a({UNSTRUCTURED:1,STRUCTURED:2}),da=a({ALLOW_LIST:0,DENY_LIST:1,CONTACTS:2}),ea=a({PERSONALIZED:0}),fa=a({LID:1,PN:2}),ga=a({NONE:0,UNREAD:1,GROUPS:2,FAVORITES:3,PREDEFINED:4,CUSTOM:5,COMMUNITY:6,SERVER_ASSIGNED:7});a=a({ANDROID:0,SMBA:1,IPHONE:2,SMBI:3,WEB:4,UWP:5,DARWIN:6,IPAD:7,WEAROS:8});var i={},j={},k={},l={},m={},n={},o={},p={},q={},r={},s={},t={},u={},v={},w={},x={},y={},z={},A={},B={},C={},D={},E={},F={},G={},H={},I={},J={},K={},L={},M={},N={},O={},P={},Q={},R={},S={},T={},U={},V={},W={},X={},Y={},Z={},$={},ha={},ia={},ja={},ka={},la={},ma={},na={},oa={},pa={},qa={},ra={},sa={},ta={},ua={},va={},wa={},xa={},ya={},za={};i.internalSpec={emoji:[1,(h=d("WAProtoConst")).TYPES.STRING],weight:[2,h.TYPES.FLOAT]};j.internalSpec={callResult:[1,h.TYPES.ENUM,f],isDndMode:[2,h.TYPES.BOOL],silenceReason:[3,h.TYPES.ENUM,e],duration:[4,h.TYPES.INT64],startTime:[5,h.TYPES.INT64],isIncoming:[6,h.TYPES.BOOL],isVideo:[7,h.TYPES.BOOL],isCallLink:[8,h.TYPES.BOOL],callLinkToken:[9,h.TYPES.STRING],scheduledCallId:[10,h.TYPES.STRING],callId:[11,h.TYPES.STRING],callCreatorJid:[12,h.TYPES.STRING],groupJid:[13,h.TYPES.STRING],participants:[14,h.FLAGS.REPEATED|h.TYPES.MESSAGE,k],callType:[15,h.TYPES.ENUM,c]};k.internalSpec={userJid:[1,h.TYPES.STRING],callResult:[2,h.TYPES.ENUM,f]};l.internalSpec={timestamp:[1,h.TYPES.INT64],starAction:[2,h.TYPES.MESSAGE,xa],contactAction:[3,h.TYPES.MESSAGE,wa],muteAction:[4,h.TYPES.MESSAGE,va],pinAction:[5,h.TYPES.MESSAGE,ua],securityNotificationSetting:[6,h.TYPES.MESSAGE,ta],pushNameSetting:[7,h.TYPES.MESSAGE,sa],quickReplyAction:[8,h.TYPES.MESSAGE,qa],recentEmojiWeightsAction:[11,h.TYPES.MESSAGE,na],labelEditAction:[14,h.TYPES.MESSAGE,oa],labelAssociationAction:[15,h.TYPES.MESSAGE,pa],localeSetting:[16,h.TYPES.MESSAGE,ra],archiveChatAction:[17,h.TYPES.MESSAGE,ma],deleteMessageForMeAction:[18,h.TYPES.MESSAGE,la],keyExpiration:[19,h.TYPES.MESSAGE,Y],markChatAsReadAction:[20,h.TYPES.MESSAGE,ka],clearChatAction:[21,h.TYPES.MESSAGE,ja],deleteChatAction:[22,h.TYPES.MESSAGE,ia],unarchiveChatsSetting:[23,h.TYPES.MESSAGE,ha],primaryFeature:[24,h.TYPES.MESSAGE,X],androidUnsupportedActions:[26,h.TYPES.MESSAGE,W],agentAction:[27,h.TYPES.MESSAGE,V],subscriptionAction:[28,h.TYPES.MESSAGE,U],userStatusMuteAction:[29,h.TYPES.MESSAGE,T],timeFormatAction:[30,h.TYPES.MESSAGE,S],nuxAction:[31,h.TYPES.MESSAGE,R],primaryVersionAction:[32,h.TYPES.MESSAGE,Q],stickerAction:[33,h.TYPES.MESSAGE,O],removeRecentStickerAction:[34,h.TYPES.MESSAGE,P],chatAssignment:[35,h.TYPES.MESSAGE,N],chatAssignmentOpenedStatus:[36,h.TYPES.MESSAGE,M],pnForLidChatAction:[37,h.TYPES.MESSAGE,L],marketingMessageAction:[38,h.TYPES.MESSAGE,J],marketingMessageBroadcastAction:[39,h.TYPES.MESSAGE,I],externalWebBetaAction:[40,h.TYPES.MESSAGE,H],privacySettingRelayAllCalls:[41,h.TYPES.MESSAGE,G],callLogAction:[42,h.TYPES.MESSAGE,F],statusPrivacy:[44,h.TYPES.MESSAGE,E],botWelcomeRequestAction:[45,h.TYPES.MESSAGE,D],deleteIndividualCallLog:[46,h.TYPES.MESSAGE,C],labelReorderingAction:[47,h.TYPES.MESSAGE,B],paymentInfoAction:[48,h.TYPES.MESSAGE,A],customPaymentMethodsAction:[49,h.TYPES.MESSAGE,x],lockChatAction:[50,h.TYPES.MESSAGE,w],chatLockSettings:[51,h.TYPES.MESSAGE,d("WAWebProtobufsChatLockSettings.pb").ChatLockSettingsSpec],wamoUserIdentifierAction:[52,h.TYPES.MESSAGE,v],privacySettingDisableLinkPreviewsAction:[53,h.TYPES.MESSAGE,u],deviceCapabilities:[54,h.TYPES.MESSAGE,d("WAWebProtobufsDeviceCapabilities.pb").DeviceCapabilitiesSpec],noteEditAction:[55,h.TYPES.MESSAGE,t],favoritesAction:[56,h.TYPES.MESSAGE,r],merchantPaymentPartnerAction:[57,h.TYPES.MESSAGE,q],waffleAccountLinkStateAction:[58,h.TYPES.MESSAGE,p],usernameChatStartMode:[59,h.TYPES.MESSAGE,K],notificationActivitySettingAction:[60,h.TYPES.MESSAGE,o],lidContactAction:[61,h.TYPES.MESSAGE,n],ctwaPerCustomerDataSharingAction:[62,h.TYPES.MESSAGE,m]};m.internalSpec={isCtwaPerCustomerDataSharingEnabled:[1,h.TYPES.BOOL]};n.internalSpec={fullName:[1,h.TYPES.STRING],firstName:[2,h.TYPES.STRING],username:[3,h.TYPES.STRING],saveOnPrimaryAddressbook:[4,h.TYPES.BOOL]};o.internalSpec={notificationActivitySetting:[1,h.TYPES.ENUM,b]};p.internalSpec={linkState:[2,h.TYPES.ENUM,aa]};q.internalSpec={status:[1,h.FLAGS.REQUIRED|h.TYPES.ENUM,ba],country:[2,h.FLAGS.REQUIRED|h.TYPES.STRING],gatewayName:[3,h.TYPES.STRING],credentialId:[4,h.TYPES.STRING]};r.internalSpec={favorites:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,s]};s.internalSpec={id:[1,h.TYPES.STRING]};t.internalSpec={type:[1,h.TYPES.ENUM,ca],chatJid:[2,h.TYPES.STRING],createdAt:[3,h.TYPES.INT64],deleted:[4,h.TYPES.BOOL],unstructuredContent:[5,h.TYPES.STRING]};u.internalSpec={isPreviewsDisabled:[1,h.TYPES.BOOL]};v.internalSpec={identifier:[1,h.TYPES.STRING]};w.internalSpec={locked:[1,h.TYPES.BOOL]};x.internalSpec={customPaymentMethods:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,y]};y.internalSpec={credentialId:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],country:[2,h.FLAGS.REQUIRED|h.TYPES.STRING],type:[3,h.FLAGS.REQUIRED|h.TYPES.STRING],metadata:[4,h.FLAGS.REPEATED|h.TYPES.MESSAGE,z]};z.internalSpec={key:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],value:[2,h.FLAGS.REQUIRED|h.TYPES.STRING]};A.internalSpec={cpi:[1,h.TYPES.STRING]};B.internalSpec={sortedLabelIds:[1,h.FLAGS.REPEATED|h.TYPES.INT32]};C.internalSpec={peerJid:[1,h.TYPES.STRING],isIncoming:[2,h.TYPES.BOOL]};D.internalSpec={isSent:[1,h.TYPES.BOOL]};E.internalSpec={mode:[1,h.TYPES.ENUM,da],userJid:[2,h.FLAGS.REPEATED|h.TYPES.STRING]};F.internalSpec={callLogRecord:[1,h.TYPES.MESSAGE,j]};G.internalSpec={isEnabled:[1,h.TYPES.BOOL]};H.internalSpec={isOptIn:[1,h.TYPES.BOOL]};I.internalSpec={repliedCount:[1,h.TYPES.INT32]};J.internalSpec={name:[1,h.TYPES.STRING],message:[2,h.TYPES.STRING],type:[3,h.TYPES.ENUM,ea],createdAt:[4,h.TYPES.INT64],lastSentAt:[5,h.TYPES.INT64],isDeleted:[6,h.TYPES.BOOL],mediaId:[7,h.TYPES.STRING]};K.internalSpec={chatStartMode:[1,h.TYPES.ENUM,fa]};L.internalSpec={pnJid:[1,h.TYPES.STRING]};M.internalSpec={chatOpened:[1,h.TYPES.BOOL]};N.internalSpec={deviceAgentID:[1,h.TYPES.STRING]};O.internalSpec={url:[1,h.TYPES.STRING],fileEncSha256:[2,h.TYPES.BYTES],mediaKey:[3,h.TYPES.BYTES],mimetype:[4,h.TYPES.STRING],height:[5,h.TYPES.UINT32],width:[6,h.TYPES.UINT32],directPath:[7,h.TYPES.STRING],fileLength:[8,h.TYPES.UINT64],isFavorite:[9,h.TYPES.BOOL],deviceIdHint:[10,h.TYPES.UINT32],isLottie:[11,h.TYPES.BOOL]};P.internalSpec={lastStickerSentTs:[1,h.TYPES.INT64]};Q.internalSpec={version:[1,h.TYPES.STRING]};R.internalSpec={acknowledged:[1,h.TYPES.BOOL]};S.internalSpec={isTwentyFourHourFormatEnabled:[1,h.TYPES.BOOL]};T.internalSpec={muted:[1,h.TYPES.BOOL]};U.internalSpec={isDeactivated:[1,h.TYPES.BOOL],isAutoRenewing:[2,h.TYPES.BOOL],expirationDate:[3,h.TYPES.INT64]};V.internalSpec={name:[1,h.TYPES.STRING],deviceID:[2,h.TYPES.INT32],isDeleted:[3,h.TYPES.BOOL]};W.internalSpec={allowed:[1,h.TYPES.BOOL]};X.internalSpec={flags:[1,h.FLAGS.REPEATED|h.TYPES.STRING]};Y.internalSpec={expiredKeyEpoch:[1,h.TYPES.INT32]};Z.internalSpec={key:[1,h.TYPES.MESSAGE,d("WAWebProtobufsProtocol.pb").MessageKeySpec],timestamp:[2,h.TYPES.INT64]};$.internalSpec={lastMessageTimestamp:[1,h.TYPES.INT64],lastSystemMessageTimestamp:[2,h.TYPES.INT64],messages:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Z]};ha.internalSpec={unarchiveChats:[1,h.TYPES.BOOL]};ia.internalSpec={messageRange:[1,h.TYPES.MESSAGE,$]};ja.internalSpec={messageRange:[1,h.TYPES.MESSAGE,$]};ka.internalSpec={read:[1,h.TYPES.BOOL],messageRange:[2,h.TYPES.MESSAGE,$]};la.internalSpec={deleteMedia:[1,h.TYPES.BOOL],messageTimestamp:[2,h.TYPES.INT64]};ma.internalSpec={archived:[1,h.TYPES.BOOL],messageRange:[2,h.TYPES.MESSAGE,$]};na.internalSpec={weights:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,i]};oa.internalSpec={name:[1,h.TYPES.STRING],color:[2,h.TYPES.INT32],predefinedId:[3,h.TYPES.INT32],deleted:[4,h.TYPES.BOOL],orderIndex:[5,h.TYPES.INT32],isActive:[6,h.TYPES.BOOL],type:[7,h.TYPES.ENUM,ga],isImmutable:[8,h.TYPES.BOOL]};pa.internalSpec={labeled:[1,h.TYPES.BOOL]};qa.internalSpec={shortcut:[1,h.TYPES.STRING],message:[2,h.TYPES.STRING],keywords:[3,h.FLAGS.REPEATED|h.TYPES.STRING],count:[4,h.TYPES.INT32],deleted:[5,h.TYPES.BOOL]};ra.internalSpec={locale:[1,h.TYPES.STRING]};sa.internalSpec={name:[1,h.TYPES.STRING]};ta.internalSpec={showNotification:[1,h.TYPES.BOOL]};ua.internalSpec={pinned:[1,h.TYPES.BOOL]};va.internalSpec={muted:[1,h.TYPES.BOOL],muteEndTimestamp:[2,h.TYPES.INT64],autoMuted:[3,h.TYPES.BOOL]};wa.internalSpec={fullName:[1,h.TYPES.STRING],firstName:[2,h.TYPES.STRING],lidJid:[3,h.TYPES.STRING],saveOnPrimaryAddressbook:[4,h.TYPES.BOOL],pnJid:[5,h.TYPES.STRING],username:[6,h.TYPES.STRING]};xa.internalSpec={starred:[1,h.TYPES.BOOL]};ya.internalSpec={index:[1,h.TYPES.BYTES],value:[2,h.TYPES.MESSAGE,l],padding:[3,h.TYPES.BYTES],version:[4,h.TYPES.INT32]};za.internalSpec={currentLthash:[1,h.TYPES.BYTES],newLthash:[2,h.TYPES.BYTES],patchVersion:[3,h.TYPES.BYTES],collectionName:[4,h.TYPES.BYTES],firstFourBytesFromAHashOfSnapshotMacKey:[5,h.TYPES.BYTES],newLthashSubtract:[6,h.TYPES.BYTES],numberAdd:[7,h.TYPES.INT32],numberRemove:[8,h.TYPES.INT32],numberOverride:[9,h.TYPES.INT32],senderPlatform:[10,h.TYPES.ENUM,a],isSenderPrimary:[11,h.TYPES.BOOL]};g.CallLogRecord$CallType=c;g.CallLogRecord$SilenceReason=e;g.CallLogRecord$CallResult=f;g.SyncActionValue$NotificationActivitySettingAction$NotificationActivitySetting=b;g.SyncActionValue$WaffleAccountLinkStateAction$AccountLinkState=aa;g.SyncActionValue$MerchantPaymentPartnerAction$Status=ba;g.SyncActionValue$NoteEditAction$NoteType=ca;g.SyncActionValue$StatusPrivacyAction$StatusDistributionMode=da;g.SyncActionValue$MarketingMessageAction$MarketingMessagePrototypeType=ea;g.SyncActionValue$UsernameChatStartModeAction$ChatStartMode=fa;g.SyncActionValue$LabelEditAction$ListType=ga;g.PatchDebugData$Platform=a;g.RecentEmojiWeightSpec=i;g.CallLogRecordSpec=j;g.CallLogRecord$ParticipantInfoSpec=k;g.SyncActionValueSpec=l;g.SyncActionValue$CtwaPerCustomerDataSharingActionSpec=m;g.SyncActionValue$LidContactActionSpec=n;g.SyncActionValue$NotificationActivitySettingActionSpec=o;g.SyncActionValue$WaffleAccountLinkStateActionSpec=p;g.SyncActionValue$MerchantPaymentPartnerActionSpec=q;g.SyncActionValue$FavoritesActionSpec=r;g.SyncActionValue$FavoritesAction$FavoriteSpec=s;g.SyncActionValue$NoteEditActionSpec=t;g.SyncActionValue$PrivacySettingDisableLinkPreviewsActionSpec=u;g.SyncActionValue$WamoUserIdentifierActionSpec=v;g.SyncActionValue$LockChatActionSpec=w;g.SyncActionValue$CustomPaymentMethodsActionSpec=x;g.SyncActionValue$CustomPaymentMethodSpec=y;g.SyncActionValue$CustomPaymentMethodMetadataSpec=z;g.SyncActionValue$PaymentInfoActionSpec=A;g.SyncActionValue$LabelReorderingActionSpec=B;g.SyncActionValue$DeleteIndividualCallLogActionSpec=C;g.SyncActionValue$BotWelcomeRequestActionSpec=D;g.SyncActionValue$StatusPrivacyActionSpec=E;g.SyncActionValue$CallLogActionSpec=F;g.SyncActionValue$PrivacySettingRelayAllCallsSpec=G;g.SyncActionValue$ExternalWebBetaActionSpec=H;g.SyncActionValue$MarketingMessageBroadcastActionSpec=I;g.SyncActionValue$MarketingMessageActionSpec=J;g.SyncActionValue$UsernameChatStartModeActionSpec=K;g.SyncActionValue$PnForLidChatActionSpec=L;g.SyncActionValue$ChatAssignmentOpenedStatusActionSpec=M;g.SyncActionValue$ChatAssignmentActionSpec=N;g.SyncActionValue$StickerActionSpec=O;g.SyncActionValue$RemoveRecentStickerActionSpec=P;g.SyncActionValue$PrimaryVersionActionSpec=Q;g.SyncActionValue$NuxActionSpec=R;g.SyncActionValue$TimeFormatActionSpec=S;g.SyncActionValue$UserStatusMuteActionSpec=T;g.SyncActionValue$SubscriptionActionSpec=U;g.SyncActionValue$AgentActionSpec=V;g.SyncActionValue$AndroidUnsupportedActionsSpec=W;g.SyncActionValue$PrimaryFeatureSpec=X;g.SyncActionValue$KeyExpirationSpec=Y;g.SyncActionValue$SyncActionMessageSpec=Z;g.SyncActionValue$SyncActionMessageRangeSpec=$;g.SyncActionValue$UnarchiveChatsSettingSpec=ha;g.SyncActionValue$DeleteChatActionSpec=ia;g.SyncActionValue$ClearChatActionSpec=ja;g.SyncActionValue$MarkChatAsReadActionSpec=ka;g.SyncActionValue$DeleteMessageForMeActionSpec=la;g.SyncActionValue$ArchiveChatActionSpec=ma;g.SyncActionValue$RecentEmojiWeightsActionSpec=na;g.SyncActionValue$LabelEditActionSpec=oa;g.SyncActionValue$LabelAssociationActionSpec=pa;g.SyncActionValue$QuickReplyActionSpec=qa;g.SyncActionValue$LocaleSettingSpec=ra;g.SyncActionValue$PushNameSettingSpec=sa;g.SyncActionValue$SecurityNotificationSettingSpec=ta;g.SyncActionValue$PinActionSpec=ua;g.SyncActionValue$MuteActionSpec=va;g.SyncActionValue$ContactActionSpec=wa;g.SyncActionValue$StarActionSpec=xa;g.SyncActionDataSpec=ya;g.PatchDebugDataSpec=za}),98); __d("WAWebProtobufsWeb.pb",["$InternalEnum","WAProtoConst","WAWebProtobufsE2E.pb","WAWebProtobufsProtocol.pb"],(function(a,b,c,d,e,f,g){var h,i;c=(a=b("$InternalEnum"))({E2EE:0,FB:2,BSP:1,BSP_AND_FB:3});e=a({UNKNOWN:0,REVOKE:1,CIPHERTEXT:2,FUTUREPROOF:3,NON_VERIFIED_TRANSITION:4,UNVERIFIED_TRANSITION:5,VERIFIED_TRANSITION:6,VERIFIED_LOW_UNKNOWN:7,VERIFIED_HIGH:8,VERIFIED_INITIAL_UNKNOWN:9,VERIFIED_INITIAL_LOW:10,VERIFIED_INITIAL_HIGH:11,VERIFIED_TRANSITION_ANY_TO_NONE:12,VERIFIED_TRANSITION_ANY_TO_HIGH:13,VERIFIED_TRANSITION_HIGH_TO_LOW:14,VERIFIED_TRANSITION_HIGH_TO_UNKNOWN:15,VERIFIED_TRANSITION_UNKNOWN_TO_LOW:16,VERIFIED_TRANSITION_LOW_TO_UNKNOWN:17,VERIFIED_TRANSITION_NONE_TO_LOW:18,VERIFIED_TRANSITION_NONE_TO_UNKNOWN:19,GROUP_CREATE:20,GROUP_CHANGE_SUBJECT:21,GROUP_CHANGE_ICON:22,GROUP_CHANGE_INVITE_LINK:23,GROUP_CHANGE_DESCRIPTION:24,GROUP_CHANGE_RESTRICT:25,GROUP_CHANGE_ANNOUNCE:26,GROUP_PARTICIPANT_ADD:27,GROUP_PARTICIPANT_REMOVE:28,GROUP_PARTICIPANT_PROMOTE:29,GROUP_PARTICIPANT_DEMOTE:30,GROUP_PARTICIPANT_INVITE:31,GROUP_PARTICIPANT_LEAVE:32,GROUP_PARTICIPANT_CHANGE_NUMBER:33,BROADCAST_CREATE:34,BROADCAST_ADD:35,BROADCAST_REMOVE:36,GENERIC_NOTIFICATION:37,E2E_IDENTITY_CHANGED:38,E2E_ENCRYPTED:39,CALL_MISSED_VOICE:40,CALL_MISSED_VIDEO:41,INDIVIDUAL_CHANGE_NUMBER:42,GROUP_DELETE:43,GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE:44,CALL_MISSED_GROUP_VOICE:45,CALL_MISSED_GROUP_VIDEO:46,PAYMENT_CIPHERTEXT:47,PAYMENT_FUTUREPROOF:48,PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED:49,PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED:50,PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED:51,PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP:52,PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP:53,PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER:54,PAYMENT_ACTION_SEND_PAYMENT_REMINDER:55,PAYMENT_ACTION_SEND_PAYMENT_INVITATION:56,PAYMENT_ACTION_REQUEST_DECLINED:57,PAYMENT_ACTION_REQUEST_EXPIRED:58,PAYMENT_ACTION_REQUEST_CANCELLED:59,BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM:60,BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP:61,BIZ_INTRO_TOP:62,BIZ_INTRO_BOTTOM:63,BIZ_NAME_CHANGE:64,BIZ_MOVE_TO_CONSUMER_APP:65,BIZ_TWO_TIER_MIGRATION_TOP:66,BIZ_TWO_TIER_MIGRATION_BOTTOM:67,OVERSIZED:68,GROUP_CHANGE_NO_FREQUENTLY_FORWARDED:69,GROUP_V4_ADD_INVITE_SENT:70,GROUP_PARTICIPANT_ADD_REQUEST_JOIN:71,CHANGE_EPHEMERAL_SETTING:72,E2E_DEVICE_CHANGED:73,VIEWED_ONCE:74,E2E_ENCRYPTED_NOW:75,BLUE_MSG_BSP_FB_TO_BSP_PREMISE:76,BLUE_MSG_BSP_FB_TO_SELF_FB:77,BLUE_MSG_BSP_FB_TO_SELF_PREMISE:78,BLUE_MSG_BSP_FB_UNVERIFIED:79,BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:80,BLUE_MSG_BSP_FB_VERIFIED:81,BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:82,BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE:83,BLUE_MSG_BSP_PREMISE_UNVERIFIED:84,BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:85,BLUE_MSG_BSP_PREMISE_VERIFIED:86,BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:87,BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED:88,BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED:89,BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED:90,BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED:91,BLUE_MSG_SELF_FB_TO_BSP_PREMISE:92,BLUE_MSG_SELF_FB_TO_SELF_PREMISE:93,BLUE_MSG_SELF_FB_UNVERIFIED:94,BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:95,BLUE_MSG_SELF_FB_VERIFIED:96,BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:97,BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE:98,BLUE_MSG_SELF_PREMISE_UNVERIFIED:99,BLUE_MSG_SELF_PREMISE_VERIFIED:100,BLUE_MSG_TO_BSP_FB:101,BLUE_MSG_TO_CONSUMER:102,BLUE_MSG_TO_SELF_FB:103,BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED:104,BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:105,BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED:106,BLUE_MSG_UNVERIFIED_TO_VERIFIED:107,BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED:108,BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:109,BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED:110,BLUE_MSG_VERIFIED_TO_UNVERIFIED:111,BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:112,BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED:113,BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:114,BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED:115,BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:116,BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:117,E2E_IDENTITY_UNAVAILABLE:118,GROUP_CREATING:119,GROUP_CREATE_FAILED:120,GROUP_BOUNCED:121,BLOCK_CONTACT:122,EPHEMERAL_SETTING_NOT_APPLIED:123,SYNC_FAILED:124,SYNCING:125,BIZ_PRIVACY_MODE_INIT_FB:126,BIZ_PRIVACY_MODE_INIT_BSP:127,BIZ_PRIVACY_MODE_TO_FB:128,BIZ_PRIVACY_MODE_TO_BSP:129,DISAPPEARING_MODE:130,E2E_DEVICE_FETCH_FAILED:131,ADMIN_REVOKE:132,GROUP_INVITE_LINK_GROWTH_LOCKED:133,COMMUNITY_LINK_PARENT_GROUP:134,COMMUNITY_LINK_SIBLING_GROUP:135,COMMUNITY_LINK_SUB_GROUP:136,COMMUNITY_UNLINK_PARENT_GROUP:137,COMMUNITY_UNLINK_SIBLING_GROUP:138,COMMUNITY_UNLINK_SUB_GROUP:139,GROUP_PARTICIPANT_ACCEPT:140,GROUP_PARTICIPANT_LINKED_GROUP_JOIN:141,COMMUNITY_CREATE:142,EPHEMERAL_KEEP_IN_CHAT:143,GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST:144,GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:145,INTEGRITY_UNLINK_PARENT_GROUP:146,COMMUNITY_PARTICIPANT_PROMOTE:147,COMMUNITY_PARTICIPANT_DEMOTE:148,COMMUNITY_PARENT_GROUP_DELETED:149,COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL:150,GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP:151,MASKED_THREAD_CREATED:152,MASKED_THREAD_UNMASKED:153,BIZ_CHAT_ASSIGNMENT:154,CHAT_PSA:155,CHAT_POLL_CREATION_MESSAGE:156,CAG_MASKED_THREAD_CREATED:157,COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED:158,CAG_INVITE_AUTO_ADD:159,BIZ_CHAT_ASSIGNMENT_UNASSIGN:160,CAG_INVITE_AUTO_JOINED:161,SCHEDULED_CALL_START_MESSAGE:162,COMMUNITY_INVITE_RICH:163,COMMUNITY_INVITE_AUTO_ADD_RICH:164,SUB_GROUP_INVITE_RICH:165,SUB_GROUP_PARTICIPANT_ADD_RICH:166,COMMUNITY_LINK_PARENT_GROUP_RICH:167,COMMUNITY_PARTICIPANT_ADD_RICH:168,SILENCED_UNKNOWN_CALLER_AUDIO:169,SILENCED_UNKNOWN_CALLER_VIDEO:170,GROUP_MEMBER_ADD_MODE:171,GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:172,COMMUNITY_CHANGE_DESCRIPTION:173,SENDER_INVITE:174,RECEIVER_INVITE:175,COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS:176,PINNED_MESSAGE_IN_CHAT:177,PAYMENT_INVITE_SETUP_INVITER:178,PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY:179,PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE:180,LINKED_GROUP_CALL_START:181,REPORT_TO_ADMIN_ENABLED_STATUS:182,EMPTY_SUBGROUP_CREATE:183,SCHEDULED_CALL_CANCEL:184,SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH:185,GROUP_CHANGE_RECENT_HISTORY_SHARING:186,PAID_MESSAGE_SERVER_CAMPAIGN_ID:187,GENERAL_CHAT_CREATE:188,GENERAL_CHAT_ADD:189,GENERAL_CHAT_AUTO_ADD_DISABLED:190,SUGGESTED_SUBGROUP_ANNOUNCE:191,BIZ_BOT_1P_MESSAGING_ENABLED:192,CHANGE_USERNAME:193,BIZ_COEX_PRIVACY_INIT_SELF:194,BIZ_COEX_PRIVACY_TRANSITION_SELF:195,SUPPORT_AI_EDUCATION:196,BIZ_BOT_3P_MESSAGING_ENABLED:197,REMINDER_SETUP_MESSAGE:198,REMINDER_SENT_MESSAGE:199,REMINDER_CANCEL_MESSAGE:200,BIZ_COEX_PRIVACY_INIT:201,BIZ_COEX_PRIVACY_TRANSITION:202,GROUP_DEACTIVATED:203,COMMUNITY_DEACTIVATE_SIBLING_GROUP:204,EVENT_UPDATED:205,EVENT_CANCELED:206,COMMUNITY_OWNER_UPDATED:207,COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN:208,CAPI_GROUP_NE2EE_SYSTEM_MESSAGE:209,STATUS_MENTION:210,USER_CONTROLS_SYSTEM_MESSAGE:211,SUPPORT_SYSTEM_MESSAGE:212,CHANGE_LID:213,BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE:214,BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE:215,CHANGE_LIMIT_SHARING:216,GROUP_MEMBER_LINK_MODE:217});f=a({ERROR:0,PENDING:1,SERVER_ACK:2,DELIVERY_ACK:3,READ:4,PLAYED:5});b=a({UNKNOWN:0,PENDING_SETUP:1,PENDING_RECEIVER_SETUP:2,INIT:3,SUCCESS:4,COMPLETED:5,FAILED:6,FAILED_RISK:7,FAILED_PROCESSING:8,FAILED_RECEIVER_PROCESSING:9,FAILED_DA:10,FAILED_DA_FINAL:11,REFUNDED_TXN:12,REFUND_FAILED:13,REFUND_FAILED_PROCESSING:14,REFUND_FAILED_DA:15,EXPIRED_TXN:16,AUTH_CANCELED:17,AUTH_CANCEL_FAILED_PROCESSING:18,AUTH_CANCEL_FAILED:19,COLLECT_INIT:20,COLLECT_SUCCESS:21,COLLECT_FAILED:22,COLLECT_FAILED_RISK:23,COLLECT_REJECTED:24,COLLECT_EXPIRED:25,COLLECT_CANCELED:26,COLLECT_CANCELLING:27,IN_REVIEW:28,REVERSAL_SUCCESS:29,REVERSAL_PENDING:30,REFUND_PENDING:31});var j=a({UNKNOWN_STATUS:0,PROCESSING:1,SENT:2,NEED_TO_ACCEPT:3,COMPLETE:4,COULD_NOT_COMPLETE:5,REFUNDED:6,EXPIRED:7,REJECTED:8,CANCELLED:9,WAITING_FOR_PAYER:10,WAITING:11}),k=a({UNKNOWN_CURRENCY:0,INR:1}),l=a({NOT_STARTED:0,FORCE_UPGRADE:1,DEVELOPMENT:2,PRODUCTION:3}),m=a({UNKNOWN_TYPE:0,PIN_FOR_ALL:1,UNPIN_FOR_ALL:2});a=a({UNDEFINED:0,REACTION:1,EVENT_RESPONSE:2,POLL_UPDATE:3,PIN_IN_CHAT:4});var n={},o={},p={},q={},r={},s={},t={},u={},v={},w={},x={},y={},z={},A={},B={},C={},D={},E={},F={},G={},H={},I={},J={},K={};n.internalDefaults={status:f.PENDING};n.internalSpec={key:[1,(h=d("WAProtoConst")).FLAGS.REQUIRED|h.TYPES.MESSAGE,(i=d("WAWebProtobufsProtocol.pb")).MessageKeySpec],message:[2,h.TYPES.MESSAGE,(d=d("WAWebProtobufsE2E.pb")).MessageSpec],messageTimestamp:[3,h.TYPES.UINT64],status:[4,h.TYPES.ENUM,f],participant:[5,h.TYPES.STRING],messageC2STimestamp:[6,h.TYPES.UINT64],ignore:[16,h.TYPES.BOOL],starred:[17,h.TYPES.BOOL],broadcast:[18,h.TYPES.BOOL],pushName:[19,h.TYPES.STRING],mediaCiphertextSha256:[20,h.TYPES.BYTES],multicast:[21,h.TYPES.BOOL],urlText:[22,h.TYPES.BOOL],urlNumber:[23,h.TYPES.BOOL],messageStubType:[24,h.TYPES.ENUM,e],clearMedia:[25,h.TYPES.BOOL],messageStubParameters:[26,h.FLAGS.REPEATED|h.TYPES.STRING],duration:[27,h.TYPES.UINT32],labels:[28,h.FLAGS.REPEATED|h.TYPES.STRING],paymentInfo:[29,h.TYPES.MESSAGE,p],finalLiveLocation:[30,h.TYPES.MESSAGE,d.Message$LiveLocationMessageSpec],quotedPaymentInfo:[31,h.TYPES.MESSAGE,p],ephemeralStartTimestamp:[32,h.TYPES.UINT64],ephemeralDuration:[33,h.TYPES.UINT32],ephemeralOffToOn:[34,h.TYPES.BOOL],ephemeralOutOfSync:[35,h.TYPES.BOOL],bizPrivacyStatus:[36,h.TYPES.ENUM,c],verifiedBizName:[37,h.TYPES.STRING],mediaData:[38,h.TYPES.MESSAGE,u],photoChange:[39,h.TYPES.MESSAGE,v],userReceipt:[40,h.FLAGS.REPEATED|h.TYPES.MESSAGE,x],reactions:[41,h.FLAGS.REPEATED|h.TYPES.MESSAGE,y],quotedStickerData:[42,h.TYPES.MESSAGE,u],futureproofData:[43,h.TYPES.BYTES],statusPsa:[44,h.TYPES.MESSAGE,w],pollUpdates:[45,h.FLAGS.REPEATED|h.TYPES.MESSAGE,z],pollAdditionalMetadata:[46,h.TYPES.MESSAGE,A],agentId:[47,h.TYPES.STRING],statusAlreadyViewed:[48,h.TYPES.BOOL],messageSecret:[49,h.TYPES.BYTES],keepInChat:[50,h.TYPES.MESSAGE,C],originalSelfAuthorUserJidString:[51,h.TYPES.STRING],revokeMessageTimestamp:[52,h.TYPES.UINT64],pinInChat:[54,h.TYPES.MESSAGE,D],premiumMessageInfo:[55,h.TYPES.MESSAGE,F],is1PBizBotMessage:[56,h.TYPES.BOOL],isGroupHistoryMessage:[57,h.TYPES.BOOL],botMessageInvokerJid:[58,h.TYPES.STRING],commentMetadata:[59,h.TYPES.MESSAGE,o],eventResponses:[61,h.FLAGS.REPEATED|h.TYPES.MESSAGE,G],reportingTokenInfo:[62,h.TYPES.MESSAGE,t],newsletterServerId:[63,h.TYPES.UINT64],eventAdditionalMetadata:[64,h.TYPES.MESSAGE,B],isMentionedInStatus:[65,h.TYPES.BOOL],statusMentions:[66,h.FLAGS.REPEATED|h.TYPES.STRING],targetMessageId:[67,h.TYPES.MESSAGE,i.MessageKeySpec],messageAddOns:[68,h.FLAGS.REPEATED|h.TYPES.MESSAGE,I],statusMentionMessageInfo:[69,h.TYPES.MESSAGE,J],isSupportAiMessage:[70,h.TYPES.BOOL],statusMentionSources:[71,h.FLAGS.REPEATED|h.TYPES.STRING],supportAiCitations:[72,h.FLAGS.REPEATED|h.TYPES.MESSAGE,K],botTargetId:[73,h.TYPES.STRING]};o.internalSpec={commentParentKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],replyCount:[2,h.TYPES.UINT32]};p.internalSpec={currencyDeprecated:[1,h.TYPES.ENUM,k],amount1000:[2,h.TYPES.UINT64],receiverJid:[3,h.TYPES.STRING],status:[4,h.TYPES.ENUM,j],transactionTimestamp:[5,h.TYPES.UINT64],requestMessageKey:[6,h.TYPES.MESSAGE,i.MessageKeySpec],expiryTimestamp:[7,h.TYPES.UINT64],futureproofed:[8,h.TYPES.BOOL],currency:[9,h.TYPES.STRING],txnStatus:[10,h.TYPES.ENUM,b],useNoviFiatFormat:[11,h.TYPES.BOOL],primaryAmount:[12,h.TYPES.MESSAGE,d.MoneySpec],exchangeAmount:[13,h.TYPES.MESSAGE,d.MoneySpec]};q.internalSpec={timestamp:[2,h.TYPES.UINT64],unreadChats:[3,h.TYPES.UINT32],notifyMessageCount:[4,h.TYPES.UINT32],notifyMessages:[5,h.FLAGS.REPEATED|h.TYPES.MESSAGE,n]};r.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],message:[2,h.TYPES.MESSAGE,d.MessageSpec],messageTimestamp:[3,h.TYPES.UINT64],participant:[4,h.TYPES.STRING]};s.internalSpec={labelsDisplay:[1,h.TYPES.ENUM,l],voipIndividualOutgoing:[2,h.TYPES.ENUM,l],groupsV3:[3,h.TYPES.ENUM,l],groupsV3Create:[4,h.TYPES.ENUM,l],changeNumberV2:[5,h.TYPES.ENUM,l],queryStatusV3Thumbnail:[6,h.TYPES.ENUM,l],liveLocations:[7,h.TYPES.ENUM,l],queryVname:[8,h.TYPES.ENUM,l],voipIndividualIncoming:[9,h.TYPES.ENUM,l],quickRepliesQuery:[10,h.TYPES.ENUM,l],payments:[11,h.TYPES.ENUM,l],stickerPackQuery:[12,h.TYPES.ENUM,l],liveLocationsFinal:[13,h.TYPES.ENUM,l],labelsEdit:[14,h.TYPES.ENUM,l],mediaUpload:[15,h.TYPES.ENUM,l],mediaUploadRichQuickReplies:[18,h.TYPES.ENUM,l],vnameV2:[19,h.TYPES.ENUM,l],videoPlaybackUrl:[20,h.TYPES.ENUM,l],statusRanking:[21,h.TYPES.ENUM,l],voipIndividualVideo:[22,h.TYPES.ENUM,l],thirdPartyStickers:[23,h.TYPES.ENUM,l],frequentlyForwardedSetting:[24,h.TYPES.ENUM,l],groupsV4JoinPermission:[25,h.TYPES.ENUM,l],recentStickers:[26,h.TYPES.ENUM,l],catalog:[27,h.TYPES.ENUM,l],starredStickers:[28,h.TYPES.ENUM,l],voipGroupCall:[29,h.TYPES.ENUM,l],templateMessage:[30,h.TYPES.ENUM,l],templateMessageInteractivity:[31,h.TYPES.ENUM,l],ephemeralMessages:[32,h.TYPES.ENUM,l],e2ENotificationSync:[33,h.TYPES.ENUM,l],recentStickersV2:[34,h.TYPES.ENUM,l],recentStickersV3:[36,h.TYPES.ENUM,l],userNotice:[37,h.TYPES.ENUM,l],support:[39,h.TYPES.ENUM,l],groupUiiCleanup:[40,h.TYPES.ENUM,l],groupDogfoodingInternalOnly:[41,h.TYPES.ENUM,l],settingsSync:[42,h.TYPES.ENUM,l],archiveV2:[43,h.TYPES.ENUM,l],ephemeralAllowGroupMembers:[44,h.TYPES.ENUM,l],ephemeral24HDuration:[45,h.TYPES.ENUM,l],mdForceUpgrade:[46,h.TYPES.ENUM,l],disappearingMode:[47,h.TYPES.ENUM,l],externalMdOptInAvailable:[48,h.TYPES.ENUM,l],noDeleteMessageTimeLimit:[49,h.TYPES.ENUM,l]};t.internalSpec={reportingTag:[1,h.TYPES.BYTES]};u.internalSpec={localPath:[1,h.TYPES.STRING]};v.internalSpec={oldPhoto:[1,h.TYPES.BYTES],newPhoto:[2,h.TYPES.BYTES],newPhotoId:[3,h.TYPES.UINT32]};w.internalSpec={campaignId:[44,h.FLAGS.REQUIRED|h.TYPES.UINT64],campaignExpirationTimestamp:[45,h.TYPES.UINT64]};x.internalSpec={userJid:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],receiptTimestamp:[2,h.TYPES.INT64],readTimestamp:[3,h.TYPES.INT64],playedTimestamp:[4,h.TYPES.INT64],pendingDeviceJid:[5,h.FLAGS.REPEATED|h.TYPES.STRING],deliveredDeviceJid:[6,h.FLAGS.REPEATED|h.TYPES.STRING]};y.internalSpec={key:[1,h.TYPES.MESSAGE,i.MessageKeySpec],text:[2,h.TYPES.STRING],groupingKey:[3,h.TYPES.STRING],senderTimestampMs:[4,h.TYPES.INT64],unread:[5,h.TYPES.BOOL]};z.internalSpec={pollUpdateMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],vote:[2,h.TYPES.MESSAGE,d.Message$PollVoteMessageSpec],senderTimestampMs:[3,h.TYPES.INT64],serverTimestampMs:[4,h.TYPES.INT64],unread:[5,h.TYPES.BOOL]};A.internalSpec={pollInvalidated:[1,h.TYPES.BOOL]};B.internalSpec={isStale:[1,h.TYPES.BOOL]};C.internalSpec={keepType:[1,h.TYPES.ENUM,d.KeepType],serverTimestamp:[2,h.TYPES.INT64],key:[3,h.TYPES.MESSAGE,i.MessageKeySpec],deviceJid:[4,h.TYPES.STRING],clientTimestampMs:[5,h.TYPES.INT64],serverTimestampMs:[6,h.TYPES.INT64]};D.internalSpec={type:[1,h.TYPES.ENUM,m],key:[2,h.TYPES.MESSAGE,i.MessageKeySpec],senderTimestampMs:[3,h.TYPES.INT64],serverTimestampMs:[4,h.TYPES.INT64],messageAddOnContextInfo:[5,h.TYPES.MESSAGE,E]};E.internalSpec={messageAddOnDurationInSecs:[1,h.TYPES.UINT32],messageAddOnExpiryType:[2,h.TYPES.ENUM,d.MessageContextInfo$MessageAddonExpiryType]};F.internalSpec={serverCampaignId:[1,h.TYPES.STRING]};G.internalSpec={eventResponseMessageKey:[1,h.TYPES.MESSAGE,i.MessageKeySpec],timestampMs:[2,h.TYPES.INT64],eventResponseMessage:[3,h.TYPES.MESSAGE,d.Message$EventResponseMessageSpec],unread:[4,h.TYPES.BOOL]};H.internalSpec={eventResponseMessage:[1,h.TYPES.MESSAGE,d.Message$EventResponseMessageSpec],pollVote:[2,h.TYPES.MESSAGE,d.Message$PollVoteMessageSpec]};I.internalDefaults={status:f.PENDING};I.internalSpec={messageAddOnType:[1,h.TYPES.ENUM,a],messageAddOn:[2,h.TYPES.MESSAGE,d.MessageSpec],senderTimestampMs:[3,h.TYPES.INT64],serverTimestampMs:[4,h.TYPES.INT64],status:[5,h.TYPES.ENUM,f],addOnContextInfo:[6,h.TYPES.MESSAGE,E],messageAddOnKey:[7,h.TYPES.MESSAGE,i.MessageKeySpec],legacyMessage:[8,h.TYPES.MESSAGE,H]};J.internalSpec={quotedStatus:[1,h.TYPES.MESSAGE,d.MessageSpec]};K.internalSpec={title:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],subtitle:[2,h.FLAGS.REQUIRED|h.TYPES.STRING],cmsId:[3,h.FLAGS.REQUIRED|h.TYPES.STRING],imageUrl:[4,h.FLAGS.REQUIRED|h.TYPES.STRING]};g.WebMessageInfo$BizPrivacyStatus=c;g.WebMessageInfo$StubType=e;g.WebMessageInfo$Status=f;g.PaymentInfo$TxnStatus=b;g.PaymentInfo$Status=j;g.PaymentInfo$Currency=k;g.WebFeatures$Flag=l;g.PinInChat$Type=m;g.MessageAddOn$MessageAddOnType=a;g.WebMessageInfoSpec=n;g.CommentMetadataSpec=o;g.PaymentInfoSpec=p;g.WebNotificationsInfoSpec=q;g.NotificationMessageInfoSpec=r;g.WebFeaturesSpec=s;g.ReportingTokenInfoSpec=t;g.MediaDataSpec=u;g.PhotoChangeSpec=v;g.StatusPSASpec=w;g.UserReceiptSpec=x;g.ReactionSpec=y;g.PollUpdateSpec=z;g.PollAdditionalMetadataSpec=A;g.EventAdditionalMetadataSpec=B;g.KeepInChatSpec=C;g.PinInChatSpec=D;g.MessageAddOnContextInfoSpec=E;g.PremiumMessageInfoSpec=F;g.EventResponseSpec=G;g.LegacyMessageSpec=H;g.MessageAddOnSpec=I;g.StatusMentionMessageSpec=J;g.CitationSpec=K}),98); __d("WAWebProtobufsHistorySync.pb",["$InternalEnum","WAProtoConst","WAWebProtobufSyncAction.pb","WAWebProtobufsChatLockSettings.pb","WAWebProtobufsE2E.pb","WAWebProtobufsProtocol.pb","WAWebProtobufsWeb.pb"],(function(a,b,c,d,e,f,g){var h;c=(a=b("$InternalEnum"))({IN_WAITLIST:0,AI_AVAILABLE:1});e=a({INITIAL_BOOTSTRAP:0,INITIAL_STATUS_V3:1,FULL:2,RECENT:3,PUSH_NAME:4,NON_BLOCKING_DATA:5,ON_DEMAND:6});f=a({COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:0,COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:1,COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY:2});b=a({REGULAR:0,ADMIN:1,SUPERADMIN:2});var i=a({DEFAULT:0,OFF:1,ON:2}),j=a({LEFT:0,REMOVED:1});a=a({E2EE_MSG:1,NE2EE_SELF:2,NE2EE_OTHER:3});var k={},l={},m={},n={},o={},p={},q={},r={},s={},t={},u={},v={},w={},x={},y={};k.internalSpec={syncType:[1,(h=d("WAProtoConst")).FLAGS.REQUIRED|h.TYPES.ENUM,e],conversations:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,l],statusV3Messages:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,d("WAWebProtobufsWeb.pb").WebMessageInfoSpec],chunkOrder:[5,h.TYPES.UINT32],progress:[6,h.TYPES.UINT32],pushnames:[7,h.FLAGS.REPEATED|h.TYPES.MESSAGE,p],globalSettings:[8,h.TYPES.MESSAGE,s],threadIdUserSecret:[9,h.TYPES.BYTES],threadDsTimeframeOffset:[10,h.TYPES.UINT32],recentStickers:[11,h.FLAGS.REPEATED|h.TYPES.MESSAGE,u],pastParticipants:[12,h.FLAGS.REPEATED|h.TYPES.MESSAGE,v],callLogRecords:[13,h.FLAGS.REPEATED|h.TYPES.MESSAGE,d("WAWebProtobufSyncAction.pb").CallLogRecordSpec],aiWaitListState:[14,h.TYPES.ENUM,c],phoneNumberToLidMappings:[15,h.FLAGS.REPEATED|h.TYPES.MESSAGE,m],companionMetaNonce:[16,h.TYPES.STRING],shareableChatIdentifierEncryptionKey:[17,h.TYPES.BYTES],accounts:[18,h.FLAGS.REPEATED|h.TYPES.MESSAGE,n]};l.internalSpec={id:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],messages:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,o],newJid:[3,h.TYPES.STRING],oldJid:[4,h.TYPES.STRING],lastMsgTimestamp:[5,h.TYPES.UINT64],unreadCount:[6,h.TYPES.UINT32],readOnly:[7,h.TYPES.BOOL],endOfHistoryTransfer:[8,h.TYPES.BOOL],ephemeralExpiration:[9,h.TYPES.UINT32],ephemeralSettingTimestamp:[10,h.TYPES.INT64],endOfHistoryTransferType:[11,h.TYPES.ENUM,f],conversationTimestamp:[12,h.TYPES.UINT64],name:[13,h.TYPES.STRING],pHash:[14,h.TYPES.STRING],notSpam:[15,h.TYPES.BOOL],archived:[16,h.TYPES.BOOL],disappearingMode:[17,h.TYPES.MESSAGE,d("WAWebProtobufsE2E.pb").DisappearingModeSpec],unreadMentionCount:[18,h.TYPES.UINT32],markedAsUnread:[19,h.TYPES.BOOL],participant:[20,h.FLAGS.REPEATED|h.TYPES.MESSAGE,q],tcToken:[21,h.TYPES.BYTES],tcTokenTimestamp:[22,h.TYPES.UINT64],contactPrimaryIdentityKey:[23,h.TYPES.BYTES],pinned:[24,h.TYPES.UINT32],muteEndTime:[25,h.TYPES.UINT64],wallpaper:[26,h.TYPES.MESSAGE,r],mediaVisibility:[27,h.TYPES.ENUM,i],tcTokenSenderTimestamp:[28,h.TYPES.UINT64],suspended:[29,h.TYPES.BOOL],terminated:[30,h.TYPES.BOOL],createdAt:[31,h.TYPES.UINT64],createdBy:[32,h.TYPES.STRING],description:[33,h.TYPES.STRING],support:[34,h.TYPES.BOOL],isParentGroup:[35,h.TYPES.BOOL],parentGroupId:[37,h.TYPES.STRING],isDefaultSubgroup:[36,h.TYPES.BOOL],displayName:[38,h.TYPES.STRING],pnJid:[39,h.TYPES.STRING],shareOwnPn:[40,h.TYPES.BOOL],pnhDuplicateLidThread:[41,h.TYPES.BOOL],lidJid:[42,h.TYPES.STRING],username:[43,h.TYPES.STRING],lidOriginType:[44,h.TYPES.STRING],commentsCount:[45,h.TYPES.UINT32],locked:[46,h.TYPES.BOOL],systemMessageToInsert:[47,h.TYPES.ENUM,a],capiCreatedGroup:[48,h.TYPES.BOOL],accountLid:[49,h.TYPES.STRING],limitSharing:[50,h.TYPES.BOOL],limitSharingSettingTimestamp:[51,h.TYPES.INT64],limitSharingTrigger:[52,h.TYPES.ENUM,d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger],limitSharingInitiatedByMe:[53,h.TYPES.BOOL]};m.internalSpec={pnJid:[1,h.TYPES.STRING],lidJid:[2,h.TYPES.STRING]};n.internalSpec={lid:[1,h.TYPES.STRING],username:[2,h.TYPES.STRING],countryCode:[3,h.TYPES.STRING],isUsernameDeleted:[4,h.TYPES.BOOL]};o.internalSpec={message:[1,h.TYPES.MESSAGE,d("WAWebProtobufsWeb.pb").WebMessageInfoSpec],msgOrderId:[2,h.TYPES.UINT64]};p.internalSpec={id:[1,h.TYPES.STRING],pushname:[2,h.TYPES.STRING]};q.internalSpec={userJid:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],rank:[2,h.TYPES.ENUM,b]};r.internalSpec={filename:[1,h.TYPES.STRING],opacity:[2,h.TYPES.UINT32]};s.internalSpec={lightThemeWallpaper:[1,h.TYPES.MESSAGE,r],mediaVisibility:[2,h.TYPES.ENUM,i],darkThemeWallpaper:[3,h.TYPES.MESSAGE,r],autoDownloadWiFi:[4,h.TYPES.MESSAGE,t],autoDownloadCellular:[5,h.TYPES.MESSAGE,t],autoDownloadRoaming:[6,h.TYPES.MESSAGE,t],showIndividualNotificationsPreview:[7,h.TYPES.BOOL],showGroupNotificationsPreview:[8,h.TYPES.BOOL],disappearingModeDuration:[9,h.TYPES.INT32],disappearingModeTimestamp:[10,h.TYPES.INT64],avatarUserSettings:[11,h.TYPES.MESSAGE,x],fontSize:[12,h.TYPES.INT32],securityNotifications:[13,h.TYPES.BOOL],autoUnarchiveChats:[14,h.TYPES.BOOL],videoQualityMode:[15,h.TYPES.INT32],photoQualityMode:[16,h.TYPES.INT32],individualNotificationSettings:[17,h.TYPES.MESSAGE,y],groupNotificationSettings:[18,h.TYPES.MESSAGE,y],chatLockSettings:[19,h.TYPES.MESSAGE,d("WAWebProtobufsChatLockSettings.pb").ChatLockSettingsSpec],chatDbLidMigrationTimestamp:[20,h.TYPES.INT64]};t.internalSpec={downloadImages:[1,h.TYPES.BOOL],downloadAudio:[2,h.TYPES.BOOL],downloadVideo:[3,h.TYPES.BOOL],downloadDocuments:[4,h.TYPES.BOOL]};u.internalSpec={url:[1,h.TYPES.STRING],fileSha256:[2,h.TYPES.BYTES],fileEncSha256:[3,h.TYPES.BYTES],mediaKey:[4,h.TYPES.BYTES],mimetype:[5,h.TYPES.STRING],height:[6,h.TYPES.UINT32],width:[7,h.TYPES.UINT32],directPath:[8,h.TYPES.STRING],fileLength:[9,h.TYPES.UINT64],weight:[10,h.TYPES.FLOAT],lastStickerSentTs:[11,h.TYPES.INT64],isLottie:[12,h.TYPES.BOOL]};v.internalSpec={groupJid:[1,h.TYPES.STRING],pastParticipants:[2,h.FLAGS.REPEATED|h.TYPES.MESSAGE,w]};w.internalSpec={userJid:[1,h.TYPES.STRING],leaveReason:[2,h.TYPES.ENUM,j],leaveTs:[3,h.TYPES.UINT64]};x.internalSpec={fbid:[1,h.TYPES.STRING],password:[2,h.TYPES.STRING]};y.internalSpec={messageVibrate:[1,h.TYPES.STRING],messagePopup:[2,h.TYPES.STRING],messageLight:[3,h.TYPES.STRING],lowPriorityNotifications:[4,h.TYPES.BOOL],reactionsMuted:[5,h.TYPES.BOOL],callVibrate:[6,h.TYPES.STRING]};g.HistorySync$BotAIWaitListState=c;g.HistorySync$HistorySyncType=e;g.Conversation$EndOfHistoryTransferType=f;g.GroupParticipant$Rank=b;g.MediaVisibility=i;g.PastParticipant$LeaveReason=j;g.PrivacySystemMessage=a;g.HistorySyncSpec=k;g.ConversationSpec=l;g.PhoneNumberToLIDMappingSpec=m;g.AccountSpec=n;g.HistorySyncMsgSpec=o;g.PushnameSpec=p;g.GroupParticipantSpec=q;g.WallpaperSettingsSpec=r;g.GlobalSettingsSpec=s;g.AutoDownloadSettingsSpec=t;g.StickerMetadataSpec=u;g.PastParticipantsSpec=v;g.PastParticipantSpec=w;g.AvatarUserSettingsSpec=x;g.NotificationSettingsSpec=y}),98); __d("WAWebUserPrefsHistorySync",["WALogger","WATimeUtils","WAWebEnvironment","WAWebPermanentStorage","WAWebProtobufsHistorySync.pb","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsMultiDevice","WAWebUserPrefsStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set recent sync single chunk "," status to ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set last history sync chunk with chunk order ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){if(a==null||b==null)return;a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&(d("WALogger").LOG(i(),b),yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_HISTORY_LAST_RECENT_SYNC_CHUNK_PROCESSED,{chunkOrder:b,progress:e}));yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED,a+"_"+b);c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED,a+"_"+b,{shouldWriteToIdb:!1})});return j.apply(this,arguments)}function e(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED);return a}function f(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_HISTORY_LAST_RECENT_SYNC_CHUNK_PROCESSED);return a}function k(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.INITIAL_HISTORY_SYNCED,!0);return c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.INITIAL_HISTORY_SYNCED,"true",{shouldWriteToIdb:!1})});return l.apply(this,arguments)}function m(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.INITIAL_HISTORY_SYNCED);return a===!0}function n(){return!!c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").MD_KEYS.INITIAL_HISTORY_SYNCED,{storage:c("WAWebPermanentStorage")})}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=(yield q()))!=null?b:{};yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS,babelHelpers["extends"]({},b,a));c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.HISTORY_SYNC_STATUS,babelHelpers["extends"]({},b,a),{shouldWriteToIdb:!1})});return p.apply(this,arguments)}function q(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS);return a}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC,a)});return s.apply(this,arguments)}function t(){var a;return(a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC))!=null?a:0}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.ESTIMATED_HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC,a)});return v.apply(this,arguments)}function w(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.ESTIMATED_HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC);return(a=a)!=null?a:0}function x(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").MD_KEYS.HISTORY_SYNC_REMAINING_PAUSED_SECONDS);if(typeof a==="number")return a}function y(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.HISTORY_SYNC_REMAINING_PAUSED_SECONDS,a)}function z(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.HISTORY_SYNC_EARLIEST_DATE);if(typeof a!=="number"||a===0){var b;b=(b=d("WAWebUserPrefsMultiDevice").getPairingTimestamp())!=null?b:d("WATimeUtils").unixTime();var e=c("WAWebEnvironment").isWindows===!0?d("WATimeUtils").YEAR_SECONDS:90*d("WATimeUtils").DAY_SECONDS;return b-e}return a}function A(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.HISTORY_SYNC_EARLIEST_DATE,a)}function B(a,b,c){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(c==null||a!==d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT)return;d("WALogger").LOG(h(),c,b);c=(a={},a[c]=b,a);a=(b=(yield D()))!=null?b:{};yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_SINGLE_CHUNK_STATUS,babelHelpers["extends"]({},a,c))});return C.apply(this,arguments)}function D(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_SINGLE_CHUNK_STATUS);return a}function E(a){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").HASHED_KEYS.INITIAL_HIST_BOUNDARY,a)});return F.apply(this,arguments)}function G(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").HASHED_KEYS.INITIAL_HIST_BOUNDARY)}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS_AFTER_PAIRING_LOGGING_COUNT,a)});return I.apply(this,arguments)}function J(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS_AFTER_PAIRING_LOGGING_COUNT);return a}function K(a){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=M())!=null?b:0;yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_TOTAL_PROCESSED_MESSAGE_COUNT,b+a)});return L.apply(this,arguments)}function M(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.HISTORY_SYNC_TOTAL_PROCESSED_MESSAGE_COUNT);return a}g.setLastHistorySyncedChunk=a;g.getLastHistorySyncedChunk=e;g.getLastHistoryRecentSyncedChunk=f;g.setInitialHistorySyncComplete=k;g.getInitialHistorySyncComplete=m;g.getInitialHistorySyncCompleteLocalStorage=n;g.setHistorySyncStatus=o;g.getHistorySyncStatus=q;g.setChunkCountForEndOfRecentHistorySync=r;g.getChunkCountForEndOfRecentHistorySync=t;g.setEstimatedChunkCountForEndOfRecentHistorySync=u;g.getEstimatedChunkCountForEndOfRecentHistorySync=w;g.getHistorySyncRemainingPausedSeconds=x;g.setHistorySyncRemainingPausedSeconds=y;g.getHistorySyncEarliestDate=z;g.setHistorySyncEarliestDate=A;g.setRecentSyncSingleChunkStatus=B;g.getRecentSyncSingleChunkStatus=D;g.setHistoryInitialSyncBoundary=E;g.getHistoryInitialSyncBoundary=G;g.setHistorySyncStatusAfterPairingLoggingCount=H;g.getHistorySyncStatusAfterPairingLoggingCount=J;g.setHistorySyncTotalProcessedMessageCount=K;g.getHistorySyncTotalProcessedMessageCount=M}),98); __d("WAWebAddonHydrationUtils",["WALogger","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonDBTable","WAWebAddonPerfUtils","WAWebAddonPluginProcessor","WAWebAddonProcessMsgsUtils","WAWebAddonSelectUtils","WAWebMsgKey","WAWebMsgType","WAWebReactionGatingUtils","WAWebUserPrefsHistorySync","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Addon][Hydration] Failed to hydrate "," for "," with error, ",""]);h=function(){return a};return a}var i={};function a(a){var b,c=a;b=c.length&&((b=d("WAWebUserPrefsHistorySync").getHistorySyncStatus())==null?void 0:b.recentCompleted)===!0&&!(c[0].type===d("WAWebMsgType").MSG_TYPE.REACTION&&!d("WAWebReactionGatingUtils").isFlattenedReactionsEnabled());b&&(c=a.filter(function(a){var b;a.type===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE?b=a.id.remote:b=d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a);return k(b,d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a))}));return c}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.ids,e=a.hydrationType;a=function(a){i[e]||(i[e]=new Set());if(k(a,e))return;i[e].add(a.toString())};b=b.filter(function(a){return!k(a,e)});if(b.length===0)return;var f;try{var g=d("WAWebAddonSelectUtils").getTableModeByMsgType(e);if(e===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE){f=(yield d("WAWebAddonPerfUtils").createAddonQplMarker(d("WAWebAddonPerfUtils").AddonQplMarkerType.UI,{mode:g,type:d("WAWebAddonPerfUtils").AnnotationRequestType.BulkGetByChatWid,size:1}));var j=b.map(function(a){return a instanceof c("WAWebWid")?a:null}).filter(Boolean);j=(yield d("WAWebAddonDBTable").addonInternalDBTable.bulkGetByChatWid(g,j))}else{f=(yield d("WAWebAddonPerfUtils").createAddonQplMarker(d("WAWebAddonPerfUtils").AddonQplMarkerType.UI,{mode:g,type:d("WAWebAddonPerfUtils").AnnotationRequestType.BulkGetByParentMsgKeys,size:1}));var l=b.map(function(a){return a instanceof c("WAWebMsgKey")?a:null}).filter(Boolean);j=(yield d("WAWebAddonDBTable").addonInternalDBTable.bulkGetByParentMsgKey(g,l))}(g=f)==null?void 0:g.success();j.length&&(yield d("WAWebAddonPluginProcessor").getAddonProcessor(e).updateCollection({add:j,remove:[]},d("WAWebAddonConstants").AddonProcessMode.Hydration));l=d("WAWebUserPrefsHistorySync").getHistorySyncStatus();(l==null?void 0:l.recentCompleted)===!0&&b.forEach(a)}catch(a){(g=f)==null?void 0:g.fail();d("WALogger").ERROR(h(),e,b.map(function(a){return a.toString()}),a).sendLogs("hydratingAddonMsgs",{sampling:.01})}});return j.apply(this,arguments)}function k(a,b){return Boolean((b=i[b])==null?void 0:b.has(a.toString()))}function f(a,b){return k(a,b)}function l(){for(var a of Object.keys(i))delete i[a]}g.filterAddonsByHydratedStatus=a;g.hydrateAddons=e;g.haveAddonsBeenHydratedForParent=f;g.clearHydrationCache=l}),98); __d("WAWebSchemaMessage",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage();a.add_OPTIMIZED_EXPERIMENT("message",function(a,b){var c=b.addColumn,e=b.addEncryptedColumn,f=b.addUserDefinedPrimaryKey,g=b.addIndex,h=b.addUniqueIndex,i=b.addCompositeIndex,j=b.addArrayIndex;b=b.removeColumn;return a.version((a=d("WAWebModelStorageVersions")).messageCreateTable(),[f("id"),c("internalId"),h("internalId"),c("rowId"),h("rowId"),c("type"),c("subtype"),c("t"),c("notifyName"),c("from"),c("to"),c("author"),c("local"),c("ack"),c("invis"),c("isStarred"),g("isStarred"),c("mentionedJidList"),c("groupMentions"),c("count"),c("devicesAdded"),c("devicesRemoved"),c("isThisDeviceAdded"),c("recipients"),c("protocolMessageKey"),c("protocolMessageRowId"),c("templateParams"),i(["internalId","isStarred"]),c("vcardWAids"),j("vcardWAids"),c("hasLink"),c("isMediaMsg"),c("isDocMsg"),c("isEventMsg"),i(["internalId","isMediaMsg"]),i(["internalId","isDocMsg"]),i(["internalId","hasLink"]),c("ephemeralStartTimestamp"),c("ephemeralDuration"),c("ephemeralSettingTimestamp"),c("ephemeralOutOfSync"),c("ephemeralSettingUser"),c("expiredTimestamp"),g("expiredTimestamp"),c("directPath"),c("mimetype"),c("duration"),c("filehash"),c("uploadhash"),c("size"),c("filename"),c("streamingSidecar"),c("mediaKey"),c("mediaKeyTimestamp"),c("pageCount"),c("isGif"),c("gifAttribution"),c("accessibilityLabel"),c("isViewOnce"),c("width"),c("height"),c("scanLengths"),c("scansSidecar"),c("interactiveAnnotations"),c("firstFrameLength"),c("firstFrameSidecar"),c("isAnimated"),c("isLottie"),c("thumbnail"),c("richPreviewType"),c("doNotPlayInline"),c("paymentLinkMetadata"),c("broadcast"),c("broadcastParticipants"),c("bclParticipants"),c("broadcastId"),c("quotedMsg"),c("quotedStanzaID"),c("quotedRemoteJid"),c("quotedParticipant"),c("footer"),c("hydratedButtons"),c("selectedId"),c("selectedIndex"),c("selectedCarouselCardIndex"),c("vcardFormattedName"),c("isVcardOverMmsDocument"),c("isCaptionByUser"),c("hsmTag"),c("hsmCategory"),c("templateId"),c("businessOwnerJid"),c("productId"),c("currencyCode"),c("priceAmount1000"),c("retailerId"),c("url"),c("productImageCount"),c("paymentCurrency"),c("paymentMessageReceiverJid"),c("paymentTransactionTimestamp"),c("paymentStatus"),c("paymentNoteMsg"),c("paymentRequestMessageKey"),c("paymentExpiryTimestamp"),c("message"),c("orderTitle"),c("itemCount"),c("orderId"),c("surface"),c("status"),c("token"),c("textColor"),c("backgroundColor"),c("font"),c("isForwarded"),c("forwardingScore"),c("ctwaContext"),c("messageRangeIndex"),g("messageRangeIndex"),c("vcardList"),c("totalAmount1000"),c("totalCurrencyCode"),c("list"),c("listResponse"),c("isDynamicReplyButtonsMsg"),c("dynamicReplyButtons"),c("selectedButtonId"),c("sellerJid"),c("deprecatedMms3Url"),c("encFilehash"),e("msgRowOpaqueData",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("thumbnailDirectPath"),c("thumbnailSha256"),c("thumbnailEncSha256"),c("thumbnailHeight"),c("thumbnailWidth"),c("revokeSender"),c("pendingReadReceipt"),i(["from","pendingReadReceipt"]),c("inviteGrpType"),c("quotedGroupSubject"),c("quotedParentGroupJid"),c("reactionParentKey"),c("reactionTimestamp"),c("reactionText"),c("lastPlaybackProgress"),c("hasReaction"),c("kicKey"),c("kicState"),c("kicTimestampMs"),c("kicNotified"),c("keptMessageKey"),c("keepType"),c("keptCount"),c("agentId"),c("revokeTimestamp"),c("futureproofParams"),c("futureproofReparsed"),c("futureproofType"),c("futureproofSubtype"),c("botFeedbackKind"),c("botFeedbackText"),c("latestEditMsgKey"),c("latestEditSenderTimestampMs"),c("editMsgType"),c("bizSource"),c("invokedBotWid"),c("botEditType"),c("botTargetSenderJid"),c("bizBotType"),c("botPersonaId"),c("viewCount"),c("forwardedNewsletterMessageInfo"),c("viewed"),c("disappearingModeTrigger"),c("disappearingModeInitiatedByMe"),c("botResponseTargetId"),c("botPluginType"),c("botPluginReferenceIndex"),c("botPluginSearchProvider"),c("botPluginSearchUrl"),c("botReelPluginThumbnailCdnUrl"),c("botPluginMaybeParent"),c("carouselCardsParsed"),c("botMsgBodyType"),c("botPluginSearchQuery"),c("botMessageDisclaimerText"),c("newsletterAdminInviteInfo"),c("bizContentPlaceholderType"),c("hostedBizEncStateMismatch"),c("placeholderCreatedWhenAccountIsHosted"),c("senderOrRecipientAccountTypeHosted"),c("eventInvalidated"),c("replyCount"),c("associationType"),c("parentMsgKey"),c("statusMentioned"),c("viewMode"),c("stickers"),c("stickerPackId"),c("stickerPackPublisher"),c("trayIconFileName"),c("stickerPackSize"),c("isSupportAIMessage"),c("shouldShowSupportAISystemMessage"),c("supportCitations"),c("isWamoSub"),c("callSilenceReason"),c("callOutcome"),c("isVideoCall"),c("callDuration"),c("callParticipants"),c("richResponse"),c("limitSharing")]).version(a.messageAddIsSendFailureProperties(),[c("isSendFailure")]).version(a.messageAddPaymentTxnStatus(),[c("paymentTxnStatus")]).version(a.messageAddProductListPreviewInfo(),[c("productListItemCount")]).version(a.messageAddPrivacyModeFields(),[c("privacyModeWhenSent"),c("bizPrivacyStatus")]).version(a.messageAddProductListPreviewHeaderImage(),[c("productHeaderImageRejected")]).version(a.messageAddDisappearingModeInitiator(),[c("disappearingModeInitiator")]).version(a.messageAddGroupInviteV4(),[c("inviteGrp"),c("inviteGrpName"),c("comment"),c("inviteCode"),c("inviteCodeExp")]).version(a.addSupportForHSMButtons(),[c("isFromTemplate")]).version(a.messageAddPaymentRequestNFMFields(),[c("nativeFlowButtons"),c("paymentRequestHeader")]).version(a.addWaveformToAudioMessages(),[c("waveform")]).version(a.messageRemovePaymentRequestHeaderField(),[b("paymentRequestHeader")]).version(a.messageAddNativeFlowNameField(),[c("nativeFlowName")]).version(a.addStaticURLToImageVideoMessages(),[c("staticUrl")]).version(a.addRequiresDirectConnection(),[c("requiresDirectConnection")]).version(a.messageAddPaymentInviteServiceType(),[c("paymentInviteServiceType")]).version(a.addStatusPSACampaignFields(),[c("campaignId"),c("campaignDuration")]).version(a.messageAddPaymentBackground(),[c("paymentBackground")]).version(a.messageAddInteractiveMessageFields(),[c("interactiveHeader"),c("interactiveType"),c("interactivePayload")]).version(a.messageAddActionLink(),[c("actionLink")]).version(a.messageAddHeaderType(),[c("headerType")]).version(a.messageStatusPSAReadTimestamp(),[c("statusPSAReadTimestamp")]).version(a.messageAddPollInvalidated(),[c("pollInvalidated")]).version(a.messageAddRcat(),[c("rcat")]).version(a.errorCodeColumn(),[c("errorCode")]).version(a.lastUpdateTimestampColumn(),[c("lastUpdateFromServerTs")]).version(a.paidMessagingCampaignIdColumn(),[c("pmCampaignId")]).version(a.messageAddEditIndex(),[g("latestEditMsgKey")]).version(a.messageAddIsCarouselIndex(),[c("isCarouselMsg"),i(["internalId","isCarouselMsg"])]).version(a.messageAddIsEventMsgIndex(),[i(["internalId","isEventMsg"])]).version(a.messageAddVoipCallLogIndex(),[c("isCallLogMsg"),g("isCallLogMsg"),i(["internalId","isCallLogMsg"])]).view(function(a){return a}).enablePropFilter(!0).useDbMsgEncKeyForEncryptedCol(!0).commit()})}function b(){return d("WAWebModelStorageUtils").getStorage().table("message")}g.addTable=a;g.getMessageTable=b}),98); __d("WAWebAddonPerfUtils",["$InternalEnum","WANullthrows","WAQplTypes","WAWebABProps","WAWebAddonConstants","WAWebAddonDBTable","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({BulkUpsert:"bulk_upsert",BulkRemoveByParents:"bulk_remove_by_parents",BulkGetByParentMsgKeys:"bulk_get_by_parent_msg_keys",BulkGetByChatWid:"bulk_get_by_chat_wid",BulkGetParentMsgs:"bulk_get_parent_msgs"}),i=b("$InternalEnum").Mirrored(["Incoming","Outgoing","UI"]);function j(a){if(a<10001)return 1e4;else if(a<30001)return 3e4;else if(a<500001)return 5e4;else if(a<1000001)return 1e5;else if(a<3000001)return 3e5;else if(a<5000001)return 5e5;else if(a<8000001)return 8e5;return 1e6}var k={date:0,values:new Map()};function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=k,c=new Date().setHours(0,0,0,0);if(b.date===c){var e=b.values.get(a);if(e==null){var f=j(yield d("WAWebAddonDBTable").addonInternalDBTable.getTableSize(a));b.values.set(a,f);return f}return e}b.date=c;b.values.clear();f=j(yield d("WAWebAddonDBTable").addonInternalDBTable.getTableSize(a));b.values.set(a,f);return f});return m.apply(this,arguments)}function n(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a="messages",b=k,c=new Date().setHours(0,0,0,0);if(b.date===c){var e=b.values.get(a);if(e==null){var f=j(yield d("WAWebSchemaMessage").getMessageTable().count());b.values.set(a,f);return f}return e}b.date=c;b.values.clear();f=j(yield d("WAWebSchemaMessage").getMessageTable().count());b.values.set(a,f);return f});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return{string:{request_type:h.getName(a.type),table_mode:d("WAWebAddonConstants").AddonTableMode.getName(a.mode)},"int":{request_size:a.size,table_size:yield l(a.mode)}}});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return{string:{request_type:h.getName(a.type),table_mode:"messages"},"int":{request_size:a.size,table_size:yield n()}}});return s.apply(this,arguments)}function t(){return d("WAWebABProps").getABPropConfigValue("addon_infra_enable_perf_logging")}function u(a){return{success:function(){return a==null?void 0:a.end(d("WAQplTypes").QuickLogActionType.SUCCESS)},fail:function(){return a==null?void 0:a.end(d("WAQplTypes").QuickLogActionType.FAIL)}}}function v(a){var b=Math.random();return b<=a/100?!0:!1}function w(a,b){switch(a){case i.Incoming:return b===d("WAWebAddonConstants").AddonTableMode.Reaction?v(3):v(10);case i.Outgoing:return v(25);case i.UI:return v(1)}}function x(a,b,c){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){if(!t())return;if(!w(a,b))return;var f;switch(a){case i.Incoming:f=d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.ADDON_PROCESS_INCOMING;break;case i.Outgoing:f=d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.ADDON_PROCESS_OUTGOING;break;case i.UI:f=d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.ADDON_CHAT_REQUEST;break}b=d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(c("WANullthrows")(f),{annotations:yield e()});return u(b)});return y.apply(this,arguments)}function a(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return x(a,b.mode,function(){return p(b)})});return z.apply(this,arguments)}function e(a,b){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return x(a,d("WAWebAddonConstants").AddonTableMode.None,function(){return r(b)})});return A.apply(this,arguments)}g.AnnotationRequestType=h;g.AddonQplMarkerType=i;g.getCachedTableSize=l;g.createAddonQplMarker=a;g.createMessagesQplMarker=e}),98); __d("WAWebAddonSelectUtils",["WAWebABProps","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonInfraError","WAWebAddonProcessMsgsUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(a){if(a===d("WAWebMsgType").MSG_TYPE.REVOKED)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedMsgType,"revoke is not expected to cross this path");if(a===d("WAWebMsgType").MSG_TYPE.PROTOCOL)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedMsgType,"protocol revoke is not expected to cross this path");switch(a){case d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE:return d("WAWebABProps").getABPropConfigValue("unified_pin_addon_table_enabled")?d("WAWebAddonConstants").AddonTableMode.Unified:d("WAWebAddonConstants").AddonTableMode.Pin;case d("WAWebMsgType").MSG_TYPE.COMMENT:return d("WAWebAddonConstants").AddonTableMode.Comment;case d("WAWebMsgType").MSG_TYPE.POLL_UPDATE:return d("WAWebAddonConstants").AddonTableMode.PollVote;case d("WAWebMsgType").MSG_TYPE.REACTION_ENC:case d("WAWebMsgType").MSG_TYPE.REACTION:return d("WAWebAddonConstants").AddonTableMode.Reaction;case d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE:return d("WAWebAddonConstants").AddonTableMode.EventResponse;case d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED:return d("WAWebAddonConstants").AddonTableMode.None;default:throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.NotSupportedMsgType,"received "+a+" msgType")}}function a(a){return h(d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a))}function b(a){return{getByParentMsgKey:function(b){b=a.get(b);if(b==null)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);return b},getForAddon:function(b){b=a.get(d("WAWebAddonProcessMsgsUtils").getParentMsgKey(b).toString());if(b==null)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);return b}}}function c(a){return{get:function(b){b=a.get(b.toString());if(b==null)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);return b},has:function(b){return Boolean(a.get(b.toString()))}}}g.getTableModeByMsgType=h;g.getAddonTableMode=a;g.createAddonParentSelector=b;g.createAddonSelector=c}),98); __d("WAWebMessageAssociationConstants",["WAWebMsgType"],(function(a,b,c,d,e,f,g){a=new Set([d("WAWebMsgType").MSG_TYPE.ALBUM]);g.orphanIneligibleFutureproofTypes=a}),98); __d("WAWebAddonSortUtils",["WAWebAddonCrossWindowUtils","WAWebAddonPluginProcessor","WAWebAddonProcessMsgsUtils","WAWebAddonSelectUtils","WAWebMessageAssociationConstants","WAWebMsgType","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a,b){a=h(a,b);b=a.orphans;a=a.nonOrphans;return{orphans:b,validAddons:a}}function h(a,b){var e=[],f=[];for(a of a){var g=b.get(d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a).toString()),h=g==null||(g==null?void 0:g.type)===d("WAWebMsgType").MSG_TYPE.UNKNOWN;(g==null?void 0:g.futureproofType)!=null?h=!d("WAWebMessageAssociationConstants").orphanIneligibleFutureproofTypes.has(g.futureproofType):(g==null?void 0:g.type)===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT&&(h=!0);if(h)e.push(a);else if(g!=null){g=g.broadcastId!=null&&c("WAWebWid").isWid(g.broadcastId)&&Boolean((h=g.broadcastId)==null?void 0:h.isBroadcastList());g?f.push(babelHelpers["extends"]({},a,{author:void 0})):f.push(a)}}return{orphans:e,nonOrphans:f}}function b(a){var b=new Map();for(a of a){var c=d("WAWebAddonSelectUtils").getAddonTableMode(a);b.has(c)||b.set(c,[]);(c=b.get(c))==null?void 0:c.push(a)}return b}function e(a,b,c){var e=new Map();for(c of c){var f=d("WAWebAddonCrossWindowUtils").getAddonProcessorType(c);if(!e.has(f)){var g=d("WAWebAddonPluginProcessor").getAddonProcessor(f);e.set(f,{processor:g,processMode:a,tableMode:b,addons:[]})}(g=e.get(f))==null?void 0:g.addons.push(c)}return Array.from(e.values())}g.collectValidAndOrphanAddons=a;g.collectValidAndOrphans=h;g.groupAddonsByTableMode=b;g.groupAddonsByProcessor=e}),98); __d("WAWebAddonUpdateDataUtils",["Promise","WANullthrows","WAWebAddonConstants","WAWebAddonDBTable","WAWebAddonHydrationUtils","WAWebAddonInfraError","WAWebAddonPerfUtils","WAWebAddonProcessMsgsUtils","WAWebAddonSelectUtils","WAWebAddonSortUtils","WAWebCommentUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new Set([(e=d("WAWebAddonConstants")).AddonProcessMode.OnlineReceive,e.AddonProcessMode.Revoke,e.AddonProcessMode.DeleteForMe,e.AddonProcessMode.DeleteWithParent]);function j(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var i,j,k=[];i=(i=f.removeByMsgKey)!=null?i:[];j=(j=f.removeByMsgKey)!=null?j:[];f.remove!=null&&f.remove.length>0&&(i=i.concat(f.remove.map(function(a){return a.id})),j=j.concat(d("WAWebAddonHydrationUtils").filterAddonsByHydratedStatus(f.remove).map(function(a){return a.id})));if(e!==d("WAWebAddonConstants").AddonTableMode.None){if(f.add!=null&&f.add.length>0){var l=function(){var i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var i;g==null?void 0:(i=g.sendPerfReporter)==null?void 0:i.startSavedStage();i=(yield d("WAWebAddonPerfUtils").createAddonQplMarker(a===d("WAWebAddonConstants").AddonProcessMode.Send?d("WAWebAddonPerfUtils").AddonQplMarkerType.Outgoing:d("WAWebAddonPerfUtils").AddonQplMarkerType.Incoming,{mode:e,type:d("WAWebAddonPerfUtils").AnnotationRequestType.BulkUpsert,size:f.add.length}));try{a===d("WAWebAddonConstants").AddonProcessMode.SetAck?yield (h||(h=b("Promise"))).all(f.add.map(function(a){return d("WAWebAddonDBTable").addonInternalDBTable.updateAck(e,a,c("WANullthrows")(a.ack,"ack is not defined"))})):yield d("WAWebAddonDBTable").addonInternalDBTable.bulkUpsert(e,f.add),i==null?void 0:i.success()}catch(a){i==null?void 0:i.fail();throw a}g==null?void 0:(i=g.sendPerfReporter)==null?void 0:i.postSavedStage()});return function(){return i.apply(this,arguments)}}();k.push(l())}i.length>0&&k.push(d("WAWebAddonDBTable").addonInternalDBTable.bulkRemoveByMsgKey(e,i))}k.length>0&&(yield (h||(h=b("Promise"))).all(k));return{removeFromUICollection:j}});return k.apply(this,arguments)}function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=a.processMode;a=a.tableMode;e=e==null?void 0:e.metricReporter;if(f===d("WAWebAddonConstants").AddonProcessMode.Hydration)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);var g=(yield j(f,a,c,e)),k=g.removeFromUICollection;if(f===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return;if(c.add!=null){e==null?void 0:(g=e.sendPerfReporter)==null?void 0:g.startRenderedStage();yield (h||(h=b("Promise"))).all(d("WAWebAddonSortUtils").groupAddonsByProcessor(f,a,c.add).map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebAddonHydrationUtils").filterAddonsByHydratedStatus(a.addons),c=b.length!==0||k.length!==0||f===d("WAWebAddonConstants").AddonProcessMode.OnlineReceive;c&&(yield a.processor.updateCollection({add:b,remove:k},f),i.has(f)&&(yield a.processor.manageNotifications({add:f===d("WAWebAddonConstants").AddonProcessMode.Revoke?[]:a.addons,remove:k},{processMode:f})))});return function(b){return a.apply(this,arguments)}}()));e==null?void 0:(g=e.sendPerfReporter)==null?void 0:g.postRenderedStage()}else if(c.remove!=null){yield (h||(h=b("Promise"))).all(d("WAWebAddonSortUtils").groupAddonsByProcessor(f,a,c.remove).map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield a.processor.updateCollection({add:[],remove:k},f),i.has(f)&&(yield a.processor.manageNotifications({add:[],remove:k},{processMode:f}))});return function(b){return a.apply(this,arguments)}}()));if(f===d("WAWebAddonConstants").AddonProcessMode.DeleteForMe&&a===d("WAWebAddonConstants").AddonTableMode.Comment){e=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs(c.remove,d("WAWebAddonConstants").AddonProcessMode.DeleteForMe));g=e[0];a=[];for(e of c.remove)e.kind===d("WAWebMsgType").MsgKind.CommentDecrypted&&a.push(e);yield d("WAWebCommentUtils").updateReplyCount([],d("WAWebAddonSelectUtils").createAddonParentSelector(g),a)}}else throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError)});return l.apply(this,arguments)}g.updateAddonsInTableMode=a}),98); __d("WAWebSchemaMembershipApprovalRequest",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add("pending-membership-approval-request").version(d("WAWebModelStorageVersions").membershipApprovalRequestCreateTable(),[e(["groupId","id"]),b("groupId"),c("t"),c("addedBy"),c("requestMethod"),c("parentGroupId")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("pending-membership-approval-request")}g.addTable=a;g.getMembershipApprovalRequestTable=b}),98); __d("WAWebApiMembershipApprovalRequestStore",["WAWebSchemaMembershipApprovalRequest","WAWebWidFactory"],(function(a,b,c,d,e,f,g){a=function(a){return d("WAWebSchemaMembershipApprovalRequest").getMembershipApprovalRequestTable().equals(["groupId"],a.toString()).then(function(a){return a.map(function(a){var b=a.id,c=a.t,e=a.addedBy,f=a.requestMethod;a=a.parentGroupId;return{id:d("WAWebWidFactory").createWid(b),t:c,addedBy:d("WAWebWidFactory").createWid(e),requestMethod:f,parentGroupId:a!=null?d("WAWebWidFactory").createWid(a):void 0}})})};b=function(a,b){b=b.map(function(b){var c=b.id,d=b.t,e=b.addedBy,f=b.requestMethod;b=b.parentGroupId;return{groupId:a.toString(),id:c.toString(),t:d,addedBy:e.toString(),requestMethod:f,parentGroupId:b==null?void 0:b.toString()}});return d("WAWebSchemaMembershipApprovalRequest").getMembershipApprovalRequestTable().bulkCreateOrReplace(b)};c=function(a,b){var c=a.toString();return d("WAWebSchemaMembershipApprovalRequest").getMembershipApprovalRequestTable().bulkRemove(b.map(function(a){return[c,a.toString()]}))};e=function(a){return d("WAWebSchemaMembershipApprovalRequest").getMembershipApprovalRequestTable().bulkRemoveByIndex(["groupId"],[a.toString()])};g.getMembershipApprovalRequests=a;g.addMembershipApprovalRequests=b;g.removeMembershipApprovalRequests=c;g.removeAllMembershipApprovalRequests=e}),98); __d("WABatcher",["Promise","WAResolvable","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(a,d){var e=a.delayMs,f=a.maxSize,g=null;function i(a){g&&g.args===a&&(g=null);return d(a)}var j=function(){if(g==null)return(h||(h=b("Promise"))).resolve();var a=g;g=null;clearTimeout(a.timer);a.run();return a.batchPromise};a=function(a){if(g)g.args.push(a);else{var d,k=[a];a=new(h||(h=b("Promise")))(function(a){d=function(){return void a(k)}}).then(i);var l=d;g={args:k,batchPromise:a,run:l,timer:setTimeout(l,e)}}if(g==null)throw c("err")("activeBatch should not be null here");a=g;l=a.args;a=a.batchPromise;var m=l.length-1;f!=null&&l.length>=f&&void j();return a.then(function(a){return a[m]})};return{accept:a,runActiveBatch:j}}function a(a,b){var c=i(a,b);return function(a){return c.accept(a)}}function e(a){var e=[],f=new(d("WAResolvable").Resolvable)(),g=function(c){if(e.length===0)return(h||(h=b("Promise"))).resolve(new Map());var g=e,i=f;e=[];f=new(d("WAResolvable").Resolvable)();return(h||(h=b("Promise"))).resolve(a(g,c)).then(function(a){i.resolve(a);return a})},i=function(a){e.push(a);return f.promise.then(function(b){b=b.get(a);if(b==null)throw c("err")("This should not happen because we just added it to the batch");return b})};return{accept:i,runActiveBatch:g}}g.createSimpleBatcher=i;g.batch=a;g.createBatcher=e}),98); __d("WAWebWamEnumTypeOfGroupEnum",[],(function(a,b,c,d,e,f){a=Object.freeze({GROUP:1,SUBGROUP:2,DEFAULT_SUBGROUP:3});f.TYPE_OF_GROUP_ENUM=a}),66); __d("WAWebGroupType",["$InternalEnum","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){f=(e=b("$InternalEnum"))({On:"on",Off:"off"});b=e({Admin:"admin",Regular:"regular"});var h=e({Server:"server",Full:"full"}),i=Object.freeze({SUBJECT:"subject",ADD:"add",PROMOTE:"promote",DEMOTE:"demote",DELETE:"delete",REMOVE:"remove",MODIFY:"modify",INVITE_CODE:"invite",DESC_ADD:"desc_add",DESC_REMOVE:"desc_remove",RESTRICT:"restrict",ANNOUNCE:"announce",NO_FORWARD:"no_frequently_forwarded",EPHEMERAL:"ephemeral",REVOKE_INVITE:"revoke_invite",SUSPEND:"suspend",GROWTH_LOCKED:"growth_locked",GROWTH_UNLOCKED:"growth_unlocked",SUB_GROUP_LINK:"sub_group_link",PARENT_GROUP_LINK:"parent_group_link",SIBLING_GROUP_LINK:"sibling_group_link",SUB_GROUP_UNLINK:"sub_group_unlink",PARENT_GROUP_UNLINK:"parent_group_unlink",SIBLING_GROUP_UNLINK:"sibling_group_unlink",DELETE_PARENT_GROUP:"delete_parent_group",DELETE_PARENT_GROUP_UNLINK:"delete_parent_group_unlink",DELETE_PARENT_SUB_GROUP_UNLINK:"delete_parent_sub_group_unlink",INTEGRITY_PARENT_GROUP_UNLINK:"integrity_parent_group_unlink",INTEGRITY_SUB_GROUP_UNLINK:"integrity_sub_group_unlink",LINKED_GROUP_PROMOTE:"linked_group_promote",LINKED_GROUP_DEMOTE:"linked_group_demote",MEMBERSHIP_APPROVAL_MODE:"membership_approval_mode",MEMBERSHIP_APPROVAL_REQUEST:"membership_approval_request",CREATED_MEMBERSHIP_REQUESTS:"created_membership_requests",REVOKED_MEMBERSHIP_REQUESTS:"revoked_membership_requests",ALLOW_NON_ADMIN_SUB_GROUP_CREATION:"allow_non_admin_sub_group_creation",ALLOW_ADMIN_REPORTS:"allow_admin_reports",ADMIN_REPORT_RECIEVED:"admin_report_received",CREATED_SUBGROUP_SUGGESTION:"created_subgroup_suggestion",REVOKED_SUB_GROUP_SUGGESTIONS:"revoked_sub_group_suggestions",SUBGROUP_SUGGESTIONS_CHANGE_NUMBER:"subgroup_suggestions_change_number",MEMBER_ADD_MODE:"member_add_mode",GENERAL_CHAT_AUTO_ADD_DISABLED:"general_chat_auto_add_disabled",COMMUNITY_OWNER_UPDATE:"community_owner_update",HIDDEN_GROUP:"hidden_group",GROUP_SAFETY_CHECK:"group_safety_check"}),j=Object.freeze({INTEGRITY_DELETE_PARENT:"integrity_delete_parent",DELETE_PARENT:"delete_parent"}),k=Object.freeze({INVITE:"invite",LINKED_GROUP_JOIN:"linked_group_join",AUTO_ADD:"auto_add",DEFAULT_SUBGROUP_ADMIN_ADD:"default_subgroup_admin_add",DEFAULT_SUBGROUP_PROMOTE:"default_sub_group_promote",INVITE_AUTO_ADD:"invite_auto_add",GENERAL_CHAT_AUTO_ADD:"general_chat_auto_add"}),l=Object.freeze({DEFAULT_SUBGROUP_DEMOTE:"default_sub_group_demote"}),m=e({APPROVED:"approved",REJECTED:"rejected",CANCELLED:"cancelled"}),n=e.Mirrored(["DEFAULT","COMMUNITY","LINKED_SUBGROUP","LINKED_ANNOUNCEMENT_GROUP","LINKED_GENERAL_GROUP"]);function a(a){if(a.defaultSubgroup===!0)return n.LINKED_ANNOUNCEMENT_GROUP;if(a.generalSubgroup===!0)return n.LINKED_GENERAL_GROUP;if(a.parentGroup!=null)return n.LINKED_SUBGROUP;return a.isParentGroup===!0?n.COMMUNITY:n.DEFAULT}function c(a){switch(a){case n.LINKED_ANNOUNCEMENT_GROUP:return d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.DEFAULT_SUBGROUP;case n.LINKED_SUBGROUP:return d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.SUBGROUP;default:return d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.GROUP}}g.GroupSettingChangeSystemMessageToggleEnabled=f;g.GroupSettingChangeSystemMessageIsAdmin=b;g.GeneralChatAutoAddDisabledReasonEnum=h;g.GROUP_ACTIONS=i;g.DELETE_REASON=j;g.ADD_REASON=k;g.REMOVE_REASON=l;g.RevokedSubGroupSuggestionReason=m;g.GroupType=n;g.getGroupTypeFromGroupMetadata=a;g.groupTypeToWamEnum=c}),98); __d("WAWebDBParticipantTypes",[],(function(a,b,c,d,e,f,g){a=Object.freeze({ADD:"add",REMOVE:"remove",DEMOTE:"demote",PROMOTE:"promote",LINKED_GROUP_PROMOTE:"linked_group_promote",LINKED_GROUP_DEMOTE:"linked_group_demote"});b=Object.freeze({DEVICE:"device",PARTICIPANT:"participant"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="GroupUnSyncedError",b)||babelHelpers.assertThisInitialized(c)}return b}(babelHelpers.wrapNativeSuper(Error));g.PARTICIPANT_OPERATION=a;g.STALE_TYPES=b;g.GroupUnSyncedError=c}),98); __d("WAWebLeaveReasonType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Left","Removed"]);f.LeaveReason=a}),66); __d("WAWebPnhCagIncognito",["WAWebLidMigrationUtils","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=a.participants.iAmAdmin();a=a.participants.toArray();var c=[],e=[];if(b)for(b of a)c.push(b.id),e.push(d("WAWebLidMigrationUtils").toLid(d("WAWebWidFactory").toUserWid(b.id)));else for(b of a)b.id.isLid()?c.push(b.id):e.push(d("WAWebLidMigrationUtils").toLid(d("WAWebWidFactory").toUserWid(b.id)));return[].concat(c,e).filter(Boolean)}function b(a,b){var c=[];if(a){for(a of b)c.push(a.id),a.lid&&c.push(a.lid);return c}for(a of b)a.id.isLid()?c.push(a.id):a.lid&&c.push(a.lid);return c}g.augmentedCagGroupMetadataParticipantList=a;g.augmentedCagGroupParticipantList=b}),98); __d("WAWebWamEnumMessageChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,INDIVIDUAL:1,GROUP:2,STATUS:3,BROADCAST:4,CHANNEL:5});f.MESSAGE_CHAT_TYPE=a}),66); __d("WAWebGetMessageChatTypeFromWid",["WAWebWamEnumMessageChatType"],(function(a,b,c,d,e,f,g){function a(a){if(a.isUser())return d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.INDIVIDUAL;if(a.isGroup())return d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.GROUP;if(a.isBroadcast())return d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.BROADCAST;if(a.isStatus())return d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.STATUS;return a.isNewsletter()?d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.CHANNEL:d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.OTHER}g.getMessageChatTypeFromWid=a}),98); __d("WAWebWamEnumExpiryReason",[],(function(a,b,c,d,e,f){a=Object.freeze({USER_LEAVE:1,DEVICE_UNPAIR:2,IDENTITY_CHANGE:3,AUDIENCE_CHANGE:4,PERIODIC_ROTATION:5,KEY_CORRUPTION:6,PEER_COMPANION_UNPAIR:7,OTHER_DEVICE_UNPAIR:8});f.EXPIRY_REASON=a}),66); __d("WAWebWamEnumSizeBucket",[],(function(a,b,c,d,e,f){a=Object.freeze({LT32:1,LT64:2,LT128:3,LT256:4,LT512:5,LT1000:6,LT1024:16,LT1500:7,LT2000:8,LT2500:9,LT3000:10,LT3500:11,LT4000:12,LT4500:13,LT5000:14,LARGEST_BUCKET:15});f.SIZE_BUCKET=a}),66); __d("WAWebSenderKeyExpiredWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumExpiryReason","WAWebWamEnumMessageChatType","WAWebWamEnumSizeBucket"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({SenderKeyExpired:[3130,{chatType:[1,d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE],deviceSizeBucket:[2,d("WAWebWamEnumSizeBucket").SIZE_BUCKET],expiryReason:[3,d("WAWebWamEnumExpiryReason").EXPIRY_REASON]},[1,1,1],"regular"]},{SenderKeyExpired:[]});g.SenderKeyExpiredWamEvent=a}),98); __d("WAWebWamNumberToSizeBucket",["WAWebWamEnumSizeBucket"],(function(a,b,c,d,e,f,g){function a(a){if(a<32)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT32;if(a<64)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT64;if(a<128)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT128;if(a<256)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT256;if(a<512)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT512;if(a<1024)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT1024;if(a<1500)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT1500;if(a<2e3)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT2000;if(a<2500)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT2500;if(a<3e3)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT3000;if(a<3500)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT3500;if(a<4e3)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT4000;if(a<4500)return d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT4500;return a<5e3?d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT5000:d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LARGEST_BUCKET}g["default"]=a}),98); __d("WAWebPostSenderKeyExpiredMetric",["WAWebGetMessageChatTypeFromWid","WAWebSenderKeyExpiredWamEvent","WAWebWamNumberToSizeBucket","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=a.chatId,e=a.expiryReason;a=a.deviceCount;var f=new(d("WAWebSenderKeyExpiredWamEvent").SenderKeyExpiredWamEvent)();e!=null&&(f.expiryReason=e);if(b!=null){e=d("WAWebWidFactory").createWidFromWidLike(b);f.chatType=d("WAWebGetMessageChatTypeFromWid").getMessageChatTypeFromWid(e)}a!=null&&a>0&&(f.deviceSizeBucket=c("WAWebWamNumberToSizeBucket")(a));f.commit()}g.postSenderKeyExpiredMetric=a}),98); __d("WAWebSchemaParticipant",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addArrayIndex;a.add("participant").version(d("WAWebModelStorageVersions").participantCreateTable(),[e("groupId"),c("senderKey"),c("participants"),c("pastParticipants"),c("admins"),c("rotateKey"),c("version"),b("participants"),c("deviceSyncComplete"),c("staleType"),c("superAdmins")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("participant")}g.addTable=a;g.getParticipantTable=b}),98); __d("WAWebWamGroupMetricUtils",["WAWebWamNumberToSizeBucket"],(function(a,b,c,d,e,f,g){function h(a){return Math.max(a,32)}function a(a){var b=Object.freeze({}),c=a.participants.length;c!=null&&(b=babelHelpers["extends"]({participantCount:h(c)},b));c=a.cachedDeviceCount;c!=null&&(b=babelHelpers["extends"]({deviceCount:h(c)},b));return b}function b(a){return{participantCount:h(a.participants.length),deviceCount:h(a.senderKey.size),deviceSizeBucket:c("WAWebWamNumberToSizeBucket")(a.senderKey.size)}}g.capCount=h;g.getGroupCountMetricsFromGroupMetadata=a;g.getGroupMetricsFromDbRecord=b}),98); __d("WAWebWamGroupMetricCache",["Promise","WALogger","WAWebSchemaParticipant","WAWebWamGroupMetricUtils"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_getGroupMetricsFromDb: failed to get for ",": ",""]);i=function(){return a};return a}var j=new Map();function a(a){if(!a.isGroup())return(h||(h=b("Promise"))).resolve(null);a=a.toString();j.has(a)||j.set(a,k(a));return j.get(a)||(h||(h=b("Promise"))).resolve(null)}function k(a){return d("WAWebSchemaParticipant").getParticipantTable().get(a).then(function(a){return a&&d("WAWebWamGroupMetricUtils").getGroupMetricsFromDbRecord(a)})["catch"](function(b){d("WALogger").WARN(i(),a,b)})}function c(a){if(a.participants==null||a.senderKey==null)return;j.set(a.groupId,(h||(h=b("Promise"))).resolve(d("WAWebWamGroupMetricUtils").getGroupMetricsFromDbRecord(a)))}g.getGroupMetrics=a;g.cacheGroupMetrics=c}),98); __d("WAWebDBGroupParticipant",["$InternalEnum","Promise","WABatcher","WAJids","WALogger","WANullthrows","WAWebApiContact","WAWebDBParticipantTypes","WAWebGroupType","WAWebLeaveReasonType","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebPnhCagIncognito","WAWebPostSenderKeyExpiredMetric","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebWamEnumExpiryReason","WAWebWamGroupMetricCache","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["addressing mode migration failed for ",": ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCommunityParticipantsBatched: failed with unknown action ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCommunityParticipantsBatched: no local record found for group ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCommunityParticipantsBatched: aggregating "," changes"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateParticipants: failed with unknown action ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateParticipantsBatched: no local record found for group ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateParticipantsBatched: aggregating "," changes"]);o=function(){return a};return a}var p=3e3;function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.groupInfos;var b=(yield d("WAWebSchemaParticipant").getParticipantTable().bulkGet(a.map(function(a){return a.id.toString()}))),c=new Map();b.forEach(function(a){return a&&c.set(a.groupId,a.senderKey)});b=a.map(function(a){var b,e=[],f=[],g=[],h=a.id.toString(),i=c.get(h)||new Map();(b=a.participants)==null?void 0:b.forEach(function(a){a.isAdmin&&f.push(a.id),a.isSuperAdmin&&g.push(a.id),e.push(a.id)});b=(b=(b=a.pastParticipants)==null?void 0:b.map(function(a){var b=a.id,c=a.leaveTs;a=a.leaveReason;return{jid:b.toString(),leaveTs:c,leaveReason:a}}))!=null?b:[];var j=Boolean(a.incognito)&&Boolean(a.defaultSubgroup);if(j){j=f.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(a)});j=d("WAWebPnhCagIncognito").augmentedCagGroupParticipantList(j,a.participants);j.forEach(function(a){a=String(a);i.has(a)||i.set(a,!1)})}else{(j=a.participants)==null?void 0:j.forEach(function(a){i.set(String(a.id),!1)})}return{groupId:h,participants:e.map(String),pastParticipants:b,admins:f.map(String),superAdmins:g.map(String),senderKey:i,rotateKey:!1,staleType:d("WAWebDBParticipantTypes").STALE_TYPES.DEVICE}});return d("WAWebSchemaParticipant").getParticipantTable().bulkCreateOrReplace(b)});return q.apply(this,arguments)}function e(a){var c=a.group,e=a.participants,f=a.admins,g=a.superAdmins,h=a.deviceIds;a=a.groupInfo;var i=!1;a!=null&&(i=Boolean(a.incognito)&&Boolean(a.defaultSubgroup));var j=c.toString();return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(j));if(!b)return a.create(G(j,{participants:e,admins:f,superAdmins:g,deviceIds:h}));yield a.createOrReplace(i?M(b,{participants:e,admins:f,superAdmins:g,deviceIds:h}):H(b,{participants:e,admins:f,superAdmins:g,deviceIds:h}))});return function(b){return a.apply(this,arguments)}}())}function f(a){return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.bulkGet(a.map(function(a){return a.groupId}))),d=a.map(function(a,b){var d=a.groupId;a=a.pastParticipants;b=c[b];return!b?G(d,{pastParticipants:a}):z(b,a)});return b.bulkCreateOrReplace(d)});return function(a){return c.apply(this,arguments)}}())}var r=function(){return d("WABatcher").batch({delayMs:p},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(o(),a.length).devConsole(a);var c=Array.from(new Set(a.map(function(a){return a.id})));yield d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=new Map((yield b.bulkGet(c)).filter(Boolean).map(function(a){return[a.groupId,a]}));a.forEach(function(a){var b=a.id,c=a.data;a=a.groupMetadata;a=Boolean(a==null?void 0:a.defaultSubgroup);var f=e.get(b);if(!f){d("WALogger").LOG(n(),b);return}b=c.participants;var g=null;switch(c.action){case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.ADD:g=a?x(f,b,c.deviceIds):w(f,b,c.deviceIds);break;case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.REMOVE:g=a?B(f,b,c.timestamp,c.author,c.reason):A(f,b,c.timestamp,c.author,c.reason);break;case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE:g=a?E(f,b,c.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE):D(f,b,c.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE);break;case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE:g=a?E(f,b,c.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE):D(f,b,c.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE);break;default:d("WALogger").LOG(m(),c.action)}g!=null&&e.set(g.groupId,g)});return b.bulkCreateOrReplace(Array.from(e.values()))});return function(a){return e.apply(this,arguments)}}());return a.map(function(a){return void 0})});return function(b){return a.apply(this,arguments)}}())}(),s=function(){return d("WABatcher").batch({delayMs:p},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(l(),a.length).devConsole(a);var c=Array.from(new Set(a.map(function(a){return a.id})));yield d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=new Map((yield b.bulkGet(c)).filter(Boolean).map(function(a){return[a.groupId,a]}));a.forEach(function(a){var b=a.id;a=a.data;var c=e.get(b);if(!c){d("WALogger").LOG(k(),b);return}b=a.participants;var f=null;switch(a.action){case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE:f=F(c,b,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE);break;case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE:f=F(c,b,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE);break;default:d("WALogger").LOG(j(),a.action)}f!=null&&e.set(f.groupId,f)});return b.bulkCreateOrReplace(Array.from(e.values()))});return function(a){return e.apply(this,arguments)}}());return a.map(function(a){return void 0})});return function(b){return a.apply(this,arguments)}}())}();function t(a,e,f){f===void 0&&(f=!1);if(f)return s({id:String(a),data:e});var g=e.participants,h=a.toString();return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(h));if(!b)throw new(d("WAWebDBParticipantTypes").GroupUnSyncedError)("updateCommunityParticipants: group participant info missing for action "+e.action);switch(e.action){case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE:return a.createOrReplace(F(b,g,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE));case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE:return a.createOrReplace(F(b,g,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE));default:throw c("err")("updateCommunityParticipants: failed with unknown action "+e.action)}});return function(b){return a.apply(this,arguments)}}())}function u(a,c){return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=(yield b.get(a.toString()));if(!e)throw new(d("WAWebDBParticipantTypes").GroupUnSyncedError)("updateParticipants: group participant info missing when trying to update super admin");return b.createOrReplace(babelHelpers["extends"]({},e,{superAdmins:[c.toString()]}))});return function(a){return e.apply(this,arguments)}}())}function v(a,e,f,g){g===void 0&&(g=!1);var h=Boolean(f==null?void 0:f.defaultSubgroup);if(g)return r({id:String(a),data:e,groupMetadata:f});var i=e.participants,j=a.toString();return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(j));if(!b)throw new(d("WAWebDBParticipantTypes").GroupUnSyncedError)("updateParticipants: group participant info missing for action "+e.action);switch(e.action){case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.ADD:return a.createOrReplace(h?x(b,i,e.deviceIds):w(b,i,e.deviceIds));case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.REMOVE:return a.createOrReplace(h?B(b,i,e.timestamp,e.author,e.reason):A(b,i,e.timestamp,e.author,e.reason));case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE:return a.createOrReplace(h?E(b,i,e.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE):D(b,i,e.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE));case d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE:return a.createOrReplace(h?E(b,i,e.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE):D(b,i,e.deviceIds,d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE));default:throw c("err")("updateParticipants: failed with unknown action "+e.action)}});return function(b){return a.apply(this,arguments)}}())}function w(a,b,c){var e=new Map(a.senderKey);c.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a)||a.isHosted())return;e.set(a.toString(),!1)});c=new Set(b.map(function(a){a=a.id;return a.toString()}));b=y(a.pastParticipants,c);c=[].concat(a.participants,c.values().toArray().map(function(a){return a.toString()}));return{groupId:a.groupId,senderKey:e,participants:c,pastParticipants:b,admins:a.admins,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function x(a,b,c){var e=new Map(a.senderKey);c.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a)||a.isHosted())return;e.set(a.toString(),!1)});var f=new Set(),g=new Set();b.forEach(function(a){var b=a.id;a=a.lid;g.add(b.toString());a!=null&&!b.isLid()&&f.add(a.toString())});c=y(a.pastParticipants,g);b=[].concat(a.participants.filter(function(a){return!f.has(a)&&!g.has(a)}),g.values().toArray().map(function(a){return a}));return{groupId:a.groupId,senderKey:e,participants:b,pastParticipants:c,admins:a.admins,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function y(a,b){return(a=a==null?void 0:a.filter(function(a){var c=d("WAWebWidFactory").createUserWid(a.jid);c=d("WAWebApiContact").getAlternateUserWid(c);a=b.has(a.jid);c=c?b.has(c.toString()):!1;return!a&&!c}))!=null?a:[]}function z(a,b){return{groupId:a.groupId,senderKey:a.senderKey,participants:a.participants,pastParticipants:b.map(function(a){var b=a.id,c=a.leaveReason;a=a.leaveTs;return{jid:b.toString(),leaveTs:a,leaveReason:c}}),admins:a.admins,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function A(a,b,e,f,g){var h=new Map(a.senderKey),i=a.rotateKey;h.forEach(function(a,e){var f=d("WAWebWidFactory").createWid(e),g=b.some(function(a){return c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(a.id,f))});g&&(i=i||a,h["delete"](e))});i&&h.forEach(function(a,b){h.set(b,!1)});g=C(b,a.pastParticipants,e,f);!a.rotateKey&&i&&d("WAWebPostSenderKeyExpiredMetric").postSenderKeyExpiredMetric({chatId:a.groupId,deviceCount:a.senderKey.size,expiryReason:d("WAWebWamEnumExpiryReason").EXPIRY_REASON.USER_LEAVE});var j=new Set(b.map(function(a){a=a.id;return String(a)}));e=a.admins.filter(function(a){return!j.has(a)});f=(f=a.superAdmins)==null?void 0:f.filter(function(a){return!j.has(a)});var k=a.participants.filter(function(a){return!j.has(a)});return{groupId:a.groupId,senderKey:h,participants:k,pastParticipants:g,admins:e,superAdmins:f,rotateKey:i,staleType:a.staleType}}function B(a,b,c,e,f){var g,h=new Map(a.senderKey),i=a.rotateKey,j=b.map(function(a){return a.id.isLid()?a.id:a.lid}).filter(Boolean);h.forEach(function(a,c){var e=d("WAWebWidFactory").createWid(c);if(e.isLid()&&f!==d("WAWebGroupType").REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){var g=j.some(function(a){return a.isSameAccountAndAddressingMode(e)});g&&h["delete"](c);return}if(!e.isLid()&&f===d("WAWebGroupType").REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){h["delete"](c);return}g=b.some(function(a){return a.id.user===e.user&&a.id.server===e.server});g&&(i=i||a,h["delete"](c))});i&&h.forEach(function(a,b){a=d("WAWebWidFactory").createWid(b);a.isLid()||h.set(b,!1)});c=C(b,a.pastParticipants,c,e);!a.rotateKey&&i&&d("WAWebPostSenderKeyExpiredMetric").postSenderKeyExpiredMetric({chatId:a.groupId,deviceCount:a.senderKey.size,expiryReason:d("WAWebWamEnumExpiryReason").EXPIRY_REASON.USER_LEAVE});var k=new Set(b.map(function(a){a=a.id;return String(a)}));e=a.admins.filter(function(a){return!k.has(a)});g=(g=a.superAdmins)==null?void 0:g.filter(function(a){return!k.has(a)});var l=a.participants;if(f===d("WAWebGroupType").REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){var m=b.reduce(function(a,b){var c=b.lid;b=b.id;return c==null||b.isLid()?a:a.set(b.toString(),c.toString())},new Map());l=l.map(function(a){var b;return(b=m.get(a))!=null?b:a})}else l=l.filter(function(a){return!k.has(a)});return{groupId:a.groupId,senderKey:h,participants:l,pastParticipants:c,admins:e,superAdmins:g,rotateKey:i,staleType:a.staleType}}function C(a,b,c,e){var f=new Set(a.map(function(a){a=a.id;return String(a)})),g=a.map(function(a){return{jid:a.id.toString(),leaveTs:c,leaveReason:a.id.equals(e)?d("WAWebLeaveReasonType").LeaveReason.Left:d("WAWebLeaveReasonType").LeaveReason.Removed}});b.forEach(function(a){var b=d("WAWebWidFactory").createUserWid(a.jid);b=d("WAWebApiContact").getAlternateUserWid(b);var c=f.has(a.jid),e=b?f.has(b==null?void 0:b.toString()):!1;!c&&!e&&g.push(a);c||f.add(a.jid);b&&!e&&f.add(b.toString())});return g}function D(a,b,c,e){c=a.admins;var f=b.map(function(a){a=a.id;return String(a)});if(e===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE)c=a.admins.filter(function(a){return!f.includes(a)});else if(e===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE){var g=new Set(a.admins);f.forEach(function(a){return g.add(a)});c=Array.from(g)}return{groupId:a.groupId,senderKey:a.senderKey,participants:a.participants,pastParticipants:a.pastParticipants,admins:c,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function E(a,b,c,e){var f=a.admins,g=b.map(function(a){a=a.id;return String(a)}),h=new Map(a.senderKey);c!=null&&c.length>0&&c.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a))return;if(a.isHosted())return;a=String(a);h.set(a,!1)});c=a.participants;if(e===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE){f=a.admins.filter(function(a){return!g.includes(a)});var i=f.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createWid(a))});if(!i){var j=b.reduce(function(a,b){var c=b.lid;b=b.id;return c==null||b.isLid()?a:a.set(b.toString(),c.toString())},new Map());c=c.map(function(a){var b;return(b=j.get(a))!=null?b:a})}}else if(e===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE){var k=b.reduce(function(a,b){var c=b.lid;b=b.id;return c==null||b.isLid()?a:a.set(c.toString(),b.toString())},new Map());f=a.admins.concat(g);c=c.map(function(a){var b;return(b=k.get(a))!=null?b:a})}return{groupId:a.groupId,senderKey:h,participants:c,pastParticipants:a.pastParticipants,admins:f,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function F(a,b,c){var e=a.admins,f=a.participants,g=b.map(function(a){a=a.id;return String(a)});if(c===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE)e=a.admins.filter(function(a){return!g.includes(a)}),f=e;else if(c===d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE){b=g.filter(function(b){return!a.admins.includes(b)});e=a.admins.concat(b);f=e}return{groupId:a.groupId,senderKey:a.senderKey,participants:f,pastParticipants:a.pastParticipants,admins:e,superAdmins:a.superAdmins,rotateKey:a.rotateKey,staleType:a.staleType}}function G(a,b){var c=b.participants;c=c===void 0?[]:c;var e=b.pastParticipants;e=e===void 0?[]:e;var f=b.admins;f=f===void 0?[]:f;var g=b.deviceIds;g=g===void 0?[]:g;var h=new Map();g.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a))return;if(a.isHosted())return;a=String(a);h.has(a)||h.set(a,!1)});return{groupId:a,senderKey:h,participants:c.map(function(a){a=a.id;return String(a)}),pastParticipants:e.map(function(a){var b=a.id,c=a.leaveReason;a=a.leaveTs;return{jid:b.toString(),leaveTs:a,leaveReason:c}}),admins:f.map(String),superAdmins:(g=b.superAdmins)==null?void 0:g.map(String),rotateKey:!1,staleType:c.length===0?d("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT:void 0}}function H(a,b){var c=b.participants,e=b.admins,f=b.superAdmins;b=b.deviceIds;var g=a.rotateKey,h=a.senderKey,i=new Map();b.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a))return;if(a.isHosted())return;a=String(a);var b=h.get(a);b==null?i.set(a,!1):(i.set(a,b),h["delete"](a))});for(b of h.values())g=g||b;return{groupId:a.groupId,senderKey:i,participants:c.map(function(a){a=a.id;return String(a)}),pastParticipants:a.pastParticipants,admins:e.map(String),superAdmins:f==null?void 0:f.map(String),rotateKey:g}}var I=b("$InternalEnum").Mirrored(["Success","Error"]);function J(a,b){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=I.Error;yield d("WAWebModelStorageUtils").getStorage().lock(["participant","group-metadata"],function(){var g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(g){var j=g[0];g=g[1];var k=d("WAWebLidMigrationUtils").toAddressingModeFactory(e);try{var l=c("WANullthrows")(yield j.get(a.toString()),"missing participant record to migrate"),m=Array.from(l.senderKey.entries()),n=l.admins.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createUserWid(a))});l={admins:l.admins.map(function(a){return c("WANullthrows")(k(d("WAWebWidFactory").createWid(a)),"admin missing a LID-PN mapping").toString()}),participants:l.participants.map(function(a){if(!n&&!e){var b=d("WAWebWidFactory").createUserWid(a);return c("WANullthrows")(d("WAWebLidMigrationUtils").toLid(b),"participant missing a LID mapping").toString()}return c("WANullthrows")(k(d("WAWebWidFactory").createWid(a)),"participant missing a LID-PN mapping").toString()}),senderKey:new Map(m.map(function(a){var b=a[0];a[1];return[L(b,k).toString(),!1]}))};m={isLidAddressingMode:e};yield (h||(h=b("Promise"))).all([j.merge(a.toString(),l),g.merge(a.toString(),m)]);f=I.Success}catch(b){d("WALogger").ERROR(i(),a,b.message)}});return function(a){return g.apply(this,arguments)}}());return f});return K.apply(this,arguments)}function L(a,b){a=d("WAWebWidFactory").createDeviceWid(a);b=c("WANullthrows")(b(d("WAWebWidFactory").toUserWid(a)),"senderkey device missing a LID-PN mapping");return d("WAWebWidFactory").createDeviceWidFromUserAndDevice(b.user,b.server,(b=a.device)!=null?b:d("WAJids").DEFAULT_DEVICE_ID).toString()}function M(a,b){var c=b.participants,e=b.admins,f=b.superAdmins;b=b.deviceIds;var g=a.rotateKey,h=a.senderKey,i=new Map();b.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a))return;if(a.isHosted())return;a=String(a);var b=h.get(a);b==null?i.set(a,!1):(i.set(a,b),h["delete"](a))});for(b of h.entries()){var j=b[0],k=b[1];if(k&&!d("WAWebWidFactory").createWid(j).isLid()){g=!0;break}}return{groupId:a.groupId,senderKey:i,participants:c.map(function(a){a=a.id;return String(a)}),pastParticipants:a.pastParticipants,admins:e.map(String),superAdmins:f==null?void 0:f.map(String),rotateKey:g}}function N(a){var b=a.group;return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(a){a=a[0];return a.merge(String(b),{staleType:d("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT})})}function O(a){var b=a.groupIds;return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(a){a=a[0];return a.bulkCreateOrMerge(b.map(function(a){return{groupId:String(a),staleType:d("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT}}))})}function P(a){var c=a.group,e=a.oldId,f=a.newId,g=String(c);return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(g));if(!b)throw new(d("WAWebDBParticipantTypes").GroupUnSyncedError)("modifyGroupParticipant: group participant info missing");return a.createOrReplace(Q(b,e,f))});return function(b){return a.apply(this,arguments)}}())}function Q(a,b,c){var e,f=String(b),g=String(c),h=new Map(a.senderKey);c=a.participants.filter(function(a){return a!==f}).concat(g);Array.from(h.keys()).forEach(function(a){var c=d("WAWebWidFactory").createWid(a).user;b.user===c?h["delete"](a):h.set(a,!1)});h.set(g,!1);var i=a.admins.map(function(a){return a===f?g:a});e=(e=a.superAdmins)==null?void 0:e.map(function(a){return a===f?g:a});return babelHelpers["extends"]({},a,{participants:c,senderKey:h,admins:i,superAdmins:e,rotateKey:!0})}function R(a){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c;a=a.groupWid;a=(yield d("WAWebSchemaParticipant").getParticipantTable().get(String(a)));if(!a)return null;var e=new Set(a.admins),f=new Set(a.superAdmins);b=(b=(b=a.participants)==null?void 0:b.map(function(a){return{id:d("WAWebWidFactory").createWid(a),isAdmin:e.has(a),isSuperAdmin:f.has(a)}}))!=null?b:[];c=(c=(c=a.pastParticipants)==null?void 0:c.map(function(a){var b=a.jid,c=a.leaveTs;a=a.leaveReason;return{id:d("WAWebWidFactory").createWid(b),leaveTs:c,leaveReason:a}}))!=null?c:[];d("WAWebWamGroupMetricCache").cacheGroupMetrics(a);var g=a.deviceSyncComplete!=null&&!a.deviceSyncComplete?d("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT:void 0;return{participants:b,pastParticipants:c,staleType:(b=a.staleType)!=null?b:g,deviceCount:a.senderKey.size}});return S.apply(this,arguments)}g.updateGroupParticipantTableWithoutDeviceSync=a;g.replaceParticipants=e;g.addPastParticipants=f;g.updateCommunityParticipants=t;g.setDBGroupSuperAdmin=u;g.updateDBParticipants=v;g.addParticipantInfo=w;g.addParticipantInfoIncognitoCag=x;g.removeParticipantInfo=A;g.removeParticipantInfoIncognitoCag=B;g.createParticipantInfo=G;g.replaceParticipantInfo=H;g.AddressingModeMigrationResult=I;g.migrateParticipantInfoAddressingMode=J;g.replaceParticipantInfoIncognitoCag=M;g.markGroupParticipantStale=N;g.bulkMarkGroupParticipantStale=O;g.modifyGroupParticipant=P;g.getGroupParticipant=R}),98); __d("WAWebWamEnumMismatchOriginType",[],(function(a,b,c,d,e,f){a=Object.freeze({INCOMING_GROUP_MESSAGE:1,ACK_OUTGOING_MESSAGE:2,GROUP_NOTIFICATION:3,GROUP_PROFILE_PICTURE_NOTIFICATION:4,IQ_RESPONSES:5});f.MISMATCH_ORIGIN_TYPE=a}),66); __d("WAWebGroupQueryBridgeOneAlreadyInFlightLogger",["WALogger","WAWebWamEnumMismatchOriginType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["lid_migration - ",""]);h=function(){return a};return a}var i=Object.fromEntries(Object.entries(d("WAWebWamEnumMismatchOriginType").MISMATCH_ORIGIN_TYPE).map(function(a){var b=a[0];a=a[1];return[a,b]})),j=function(){function a(){this.$1=new Map()}var b=a.prototype;b.$2=function(a){return(a=this.$1.get(a))!=null?a:0};b.increment=function(a){a=a.toString();var b=this.$2(a)+1;this.$1.set(a,b);return b};b.decrement=function(a){a=a.toString();this.$1.set(a,Math.max(this.$2(a)-1,0))};return a}();function a(a){var c=new j();return function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,e){c.increment(b)>1&&d("WALogger").ERROR(h(),i[e]).sendLogs("GroupLidInfra/one_in_flight_group_info_mismatch");try{e=(yield a(b));c.decrement(b);return e}catch(a){c.decrement(b);throw a}});function f(a,b){return e.apply(this,arguments)}return f}()}g.logDuplicateRequestsWrapper=a}),98); __d("WAWebHandleMsgCommon",["WACustomError"],(function(a,b,c,d,e,f,g){a={text:"text",media:"media",medianotify:"medianotify",pay:"pay",poll:"poll",reaction:"reaction",event:"event"};b={ctwa:"ctwa",username:"username"};c={pn:"pn",lid:"lid"};e={creation:"creation",vote:"vote",result_snapshot:"result_snapshot"};f={creation:"creation",response:"response",edit:"edit"};var h={high:"high",low:"low",unknown:"unknown"},i="peer";d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WACustomError").customError("HSMMismatchError"));var j={send:"send",request:"request",futureproof:"futureproof","request-decline":"request-decline","request-cancel":"request-cancel",invite:"invite"},k="biz_source",l={"default":"default"};g.STANZA_MSG_TYPES=a;g.STANZA_MSG_ORIGIN=b;g.STANZA_MSG_ADDRESSING_MODE=c;g.POLL_TYPES=e;g.EVENT_TYPES=f;g.MSG_VERIFIED_LEVEL=h;g.CATEGORY_PEER=i;g.HsmMismatchError=d;g.PAY_NODE_TYPES=j;g.BIZ_SOURCE_ATTR=k;g.APPDATA=l}),98); __d("WAWebWamEnumAddressingMode",[],(function(a,b,c,d,e,f){a=Object.freeze({PN:1,LID:2});f.ADDRESSING_MODE=a}),66); __d("WAWebWamEnumIqResponseType",[],(function(a,b,c,d,e,f){a=Object.freeze({ADD_PARTICIPANT:1,REMOVE_PARTICIPANT:2,PROMOTE_PARTICIPANT:3,DEMOTE_PARTICIPANT:4});f.IQ_RESPONSE_TYPE=a}),66); __d("WAWebAddressingModeMismatchWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumIqResponseType","WAWebWamEnumMismatchOriginType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({AddressingModeMismatch:[4750,{iqResponse:[1,d("WAWebWamEnumIqResponseType").IQ_RESPONSE_TYPE],localAddressingMode:[2,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],mismatchOrigin:[6,d("WAWebWamEnumMismatchOriginType").MISMATCH_ORIGIN_TYPE],notificationTag:[3,d("WAWebWamCodegenUtils").TYPES.STRING],serverAddressingMode:[5,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE]},[1,1,1],"regular"]},{AddressingModeMismatch:[]});g.AddressingModeMismatchWamEvent=a}),98); __d("WAWebWamAddressingModeUtils",["WAWebHandleMsgCommon","WAWebWamEnumAddressingMode"],(function(a,b,c,d,e,f,g){"use strict";function h(a){switch(a){case!0:return d("WAWebWamEnumAddressingMode").ADDRESSING_MODE.LID;case!1:return d("WAWebWamEnumAddressingMode").ADDRESSING_MODE.PN}}function a(a){return a===d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid?d("WAWebWamEnumAddressingMode").ADDRESSING_MODE.LID:d("WAWebWamEnumAddressingMode").ADDRESSING_MODE.PN}function b(a){return a.isLidAddressingMode==null?{}:{localAddressingMode:h(a.isLidAddressingMode)}}g.getWamAddressingModeFromString=a;g.getAddressingModeMetricsFromGroupMetadata=b}),98); __d("WAWebWamAddressingModeMismatchReporter",["WAWebAddressingModeMismatchWamEvent","WAWebWamAddressingModeUtils"],(function(a,b,c,d,e,f,g){"use strict";function a(a){new(d("WAWebAddressingModeMismatchWamEvent").AddressingModeMismatchWamEvent)(babelHelpers["extends"]({},a,{localAddressingMode:d("WAWebWamAddressingModeUtils").getWamAddressingModeFromString(a.localAddressingMode),serverAddressingMode:d("WAWebWamAddressingModeUtils").getWamAddressingModeFromString(a.serverAddressingMode)})).commit()}g.logAddressingModeMismatch=a}),98); __d("WAWebGroupHandleAddressingModeMismatch",["WALogger","WANullthrows","WAWebApiMembershipApprovalRequestStore","WAWebBackendApi","WAWebDBGroupParticipant","WAWebGroupQueryBridge","WAWebGroupQueryBridgeOneAlreadyInFlightLogger","WAWebHandleMsgCommon","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebWamAddressingModeMismatchReporter","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to migrate pending approvals in "," with local data"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to migrate participants in "," with local data"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Migrating group "," to addressing mode ",""]);j=function(){return a};return a}var k=d("WAWebGroupQueryBridgeOneAlreadyInFlightLogger").logDuplicateRequestsWrapper(d("WAWebGroupQueryBridge").sendQueryGroup);function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.serverAddressingMode===d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid;d("WALogger").LOG(j(),a.toString(),b.serverAddressingMode);d("WAWebWamAddressingModeMismatchReporter").logAddressingModeMismatch(b);yield m(a,c,b);yield o(a,c)});return l.apply(this,arguments)}function m(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebDBGroupParticipant").migrateParticipantInfoAddressingMode(a,b));if(e===d("WAWebDBGroupParticipant").AddressingModeMigrationResult.Success){e=(yield d("WAWebDBGroupParticipant").getGroupParticipant({groupWid:a}));d("WAWebBackendApi").frontendFireAndForget("updateGroupAddressingMode",{id:a,isLidAddressingMode:b,groupInfoUpdate:{participants:e==null?void 0:e.participants}})}else d("WALogger").LOG(i(),a.toString()),yield k(a,c.mismatchOrigin)});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=d("WAWebLidMigrationUtils").toAddressingModeFactory(e),g=(yield d("WAWebApiMembershipApprovalRequestStore").getMembershipApprovalRequests(a));if(g.length===0)return;try{var i=g.map(function(a){return babelHelpers["extends"]({},a,{id:c("WANullthrows")(f(a.id)),addedBy:c("WANullthrows")(f(a.addedBy))})});yield d("WAWebModelStorageUtils").getStorage().lock(["pending-membership-approval-request"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebApiMembershipApprovalRequestStore").removeMembershipApprovalRequests(a,g.map(function(a){return a.id})),yield d("WAWebApiMembershipApprovalRequestStore").addMembershipApprovalRequests(a,i)}));d("WAWebBackendApi").frontendFireAndForget("removeMembershipApprovalRequests",{groupId:a,requestIds:g.map(function(a){return a.id})});d("WAWebBackendApi").frontendFireAndForget("addMembershipApprovalRequests",{groupId:a,requests:i})}catch(b){d("WALogger").LOG(h(),a.toString())}});return p.apply(this,arguments)}g.handleAddressingModeMismatch=a}),98); __d("WAWebBackendErrors",["WACustomError","WALogger"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["",", error"]);h=function(){return a};return a}c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,c)||this;c.status=b;c.statusCode=b;return c}return b}((b=d("WACustomError")).customError("ServerStatusCodeError"));e=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c,d){d=a.call(this,d)||this;d.errors=c;d.status=b;d.statusCode=b;return d}return b}(b.customError("ServerStatusCodeError"));f=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.call(this,"CatalogUnknownError")||this}return b}(b.customError("CatalogUnknownError"));var i=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.call(this,"CollectionReorderError")||this}return a}(b.customError("CollectionReorderError",!0,Error)),j=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.call(this,451,"commerce features disabled")||this}return a}(b.customError("E451",!0,c)),k=function(b){babelHelpers.inheritsLoose(a,b);function a(a){return b.call(this,404,a)||this}return a}(b.customError("E404",!0,c)),l=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){a=b.call(this,507,a)||this;a.backoff=Number.isNaN(c)?null:c;return a}return a}(b.customError("E507",!0,c)),m=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(b.customError("Drop")),n=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(b.customError("LogoutDrop",!0,m));m=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(b.customError("EphemeralDrop",!0,m));function a(a,b){return a["catch"](function(a){d("WALogger").ERROR(h(),b).verbose().devConsole(a).sendLogs(b);throw a})}var o=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c,d){d=b.call(this,d)||this;d.gid=a;d.membershipApprovalMode=c;return d}return a}(b.customError("UnexpectedJoinGroupViaInviteResponse")),p=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){c=b.call(this,c)||this;c.membershipApprovalMode=a;return c}return a}(b.customError("UnexpectedJoinSubgroupResponse")),q=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c,d){d=b.call(this,d)||this;d.status=a;d.participantLimit=c;return d}return a}(b.customError("GroupAddParticipantCountRateLimitServerError")),r=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c,d,e){e=b.call(this,e)||this;e.status=a;e.backoff=c;e.limitType=d;return e}return a}(b.customError("GroupAddParticipantTimeRateLimitServerError")),s=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this,"Ad Account Recovery Required")||this;c.emailMask=a;return c}return a}(b.customError("AdAccountRecoveryRequiredError")),t=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(b.customError("AdAccountRecoveryRequiredEmailMaskEmptyError"));b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(b.customError("CatalogIncorrectNonceError"));g.ServerStatusCodeError=c;g.CatalogEditServerError=e;g.CatalogUnknownError=f;g.CollectionReorderError=i;g.E451=j;g.E404=k;g.E507=l;g.LogoutDrop=n;g.EphemeralDrop=m;g.attachErrorLogger=a;g.UnexpectedJoinGroupViaInviteResponse=o;g.UnexpectedJoinSubgroupResponse=p;g.GroupAddParticipantCountRateLimitServerError=q;g.GroupAddParticipantTimeRateLimitServerError=r;g.AdAccountRecoveryRequiredError=s;g.AdAccountRecoveryRequiredEmailMaskEmptyError=t;g.CatalogIncorrectNonceError=b}),98); __d("WAWebGroupQueryBridge",["WALogger","WATypeUtils","WAWebBackendApi","WAWebBackendErrors","WAWebGroupQueryGroupJob","WAWebGroupQueryJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:GroupMetadata Unexpected server response"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["querying server for groupMetadata of group id ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(i(),a.toLogString()).tags("groups");var b=d("WAWebGroupQueryGroupJob").queryGroupJob(a);try{b=(yield b);if(b==null?void 0:b.id){var c;k(a,b.subject);l(a,(c=b.isLidAddressingMode)!=null?c:!1);return{id:b.id,owner:b.owner,creation:b.creation,subject:b.subject,desc:b.desc,descId:b.descId,descOwner:b.descOwner,descTime:b.descTime,restrict:(c=b.restrict)!=null?c:!1,announce:(c=b.announce)!=null?c:!1,noFrequentlyForwarded:(c=b.noFrequentlyForwarded)!=null?c:!1,ephemeralDuration:(c=b.ephemeralDuration)!=null?c:0,membershipApprovalMode:b.membershipApprovalMode,participants:b.participants,support:(c=b.support)!=null?c:!1,suspended:(c=b.suspended)!=null?c:!1,terminated:(c=b.terminated)!=null?c:!1,parentGroup:b.parentGroup,isParentGroup:(c=b.isParentGroup)!=null?c:!1,isParentGroupClosed:(c=b.isParentGroupClosed)!=null?c:!1,defaultSubgroup:(c=b.defaultSubgroup)!=null?c:!1,generalSubgroup:(c=b.generalSubgroup)!=null?c:!1,incognito:(c=b.incognito)!=null?c:!1,isLidAddressingMode:(c=b.isLidAddressingMode)!=null?c:!1,allowNonAdminSubGroupCreation:b.allowNonAdminSubGroupCreation,generalChatAutoAddDisabled:b.generalChatAutoAddDisabled,hiddenSubgroup:(c=b.hiddenSubgroup)!=null?c:!1,groupSafetyCheck:(c=b.groupSafetyCheck)!=null?c:!1}}d("WALogger").WARN(h()).devConsole(b)}catch(b){if(b instanceof d("WAWebBackendErrors").ServerStatusCodeError&&b.status>=400)return{id:a,stale:!1};throw b}});return j.apply(this,arguments)}function c(a){return d("WAWebGroupQueryJob").queryGroupInvite(a).then(function(a){return babelHelpers["extends"]({status:200},a)})}function k(a,b){d("WATypeUtils").isString(b)&&d("WAWebBackendApi").frontendFireAndForget("updateGroupSubject",{id:a,subject:b})}function l(a,b){d("WAWebBackendApi").frontendFireAndForget("updateGroupAddressingMode",{id:a,isLidAddressingMode:b})}g.sendQueryGroup=a;g.sendQueryGroupInvite=c;g.updateSubject=k}),98); __d("WAWebMsgTunnelBridge",["WAWebMsgSyncTunnelConfig"],(function(a,b,c,d,e,f,g){a={setActiveChat:function(a){if(a==null)return;d("WAWebMsgSyncTunnelConfig").setMsgSyncTunnelConfig({openedChat:a})},resetActiveChat:function(a){if(a==null)return;d("WAWebMsgSyncTunnelConfig").resetMsgSyncTunnelOpenedChat(a)}};g.msgSyncTunnelBridge=a}),98); __d("WAWeb-curve25519-donna",[],(function $module_WAWeb_curve25519_donna(global,require,requireDynamic,requireLazy,module,exports){var IS_SMALL_CURVE25519_BUFFER_ENABLED=typeof self!="undefined"&&self.IS_SMALL_CURVE25519_BUFFER_ENABLED==!0,e={},aa={},l;for(l in e)e.hasOwnProperty(l)&&(aa[l]=e[l]);e.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText};"undefined"!=typeof arguments&&(e.arguments=arguments);"undefined"!==typeof console?(e.print||(e.print=function(a){}),e.printErr||(e.printErr=function(a){})):e.print||(e.print=function(){});"undefined"===typeof e.setWindowTitle&&(e.setWindowTitle=function(a){document.title=a});function ba(a){eval.call(null,a)}!e.load&&e.read&&(e.load=function(a){ba(e.read(a))});e.print||(e.print=function(){});e.printErr||(e.printErr=e.print);e.arguments||(e.arguments=[]);e.thisProgram||(e.thisProgram="./this.program");e.print=e.print;e.S=e.printErr;e.preRun=[];e.postRun=[];for(l in aa)aa.hasOwnProperty(l)&&(e[l]=aa[l]);var n={cb:function(a){ca=a},Ua:function(){return ca},na:function(){return m},X:function(a){m=a},Aa:function(a){switch(a){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===a[a.length-1]?n.H:"i"===a[0]?(a=parseInt(a.substr(1)),assert(0===a%8),a/8):0}},Ta:function(a){return Math.max(n.Aa(a),n.H)},dd:16,Bd:function(a,b){"double"===b||"i64"===b?a&7&&(assert(4===(a&7)),a+=4):assert(0===(a&3));return a},od:function(a,b,c){return c||"i64"!=a&&"double"!=a?a?Math.min(b||(a?n.Ta(a):0),n.H):Math.min(b,8):8},J:function(a,b,c){return c&&c.length?(c.splice||(c=Array.prototype.slice.call(c)),c.splice(0,0,b),e["dynCall_"+a].apply(null,c)):e["dynCall_"+a].call(null,b)},U:[],Ma:function(a){for(var b=0;b<n.U.length;b++)if(!n.U[b])return n.U[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},$a:function(a){n.U[(a-2)/2]=null},M:function(a){n.M.ma||(n.M.ma={}),n.M.ma[a]||(n.M.ma[a]=1,e.S(a))},ha:{},rd:function(a,b){assert(b);n.ha[b]||(n.ha[b]={});var c=n.ha[b];c[a]||(c[a]=function(){return n.J(b,a,arguments)});return c[a]},pd:function(){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},W:function(a){var b=m;m=m+a|0;m=m+15&-16;return b},Ia:function(a){var b=p;p=p+a|0;p=p+15&-16;return b},P:function(a){var b=v;v=v+a|0;v=v+15&-16;(a=v>=w)&&(z("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+w+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "),a=!0);return a?(v=b,0):b},ea:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},xd:function(a,b,c){return c?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},La:8,H:4,ed:0};e.Runtime=n;n.addFunction=n.Ma;n.removeFunction=n.$a;var A=!1,da,fa,ca;function assert(a,b){a||z("Assertion failed: "+b)}function ga(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(c){}assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)");return b}var ha,ia;(function(){function a(a){a=a.toString().match(d).slice(1);return{arguments:a[0],body:a[1],returnValue:a[2]}}var b={stackSave:function(){n.na()},stackRestore:function(){n.X()},arrayToC:function(a){var b=n.W(a.length);ja(a,b);return b},stringToC:function(a){var b=0;null!==a&&void 0!==a&&0!==a&&(b=n.W((a.length<<2)+1),ka(a,b));return b}},c={string:b.stringToC,array:b.arrayToC};ia=function(a,b,d,f,h){a=ga(a);var q=[],y=0;if(f)for(var B=0;B<f.length;B++){var J=c[d[B]];J?(0===y&&(y=n.na()),q[B]=J(f[B])):q[B]=f[B]}d=a.apply(null,q);"string"===b&&(d=la(d));if(0!==y){if(h&&h.async){EmterpreterAsync.hd.push(function(){n.X(y)});return}n.X(y)}return d};var d=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f={},h;for(h in b)b.hasOwnProperty(h)&&(f[h]=a(b[h]));ha=function(b,c,d){d=d||[];var h=ga(b);b=d.every(function(a){return"number"===a});var u="string"!==c;if(u&&b)return h;var q=d.map(function(a,b){return"$"+b});c="(function("+q.join(",")+") {";var y=d.length;if(!b){c+="var stack = "+f.stackSave.body+";";for(var B=0;B<y;B++){var J=q[B],ea=d[B];"number"!==ea&&(ea=f[ea+"ToC"],c+="var "+ea.arguments+" = "+J+";",c+=ea.body+";",c+=J+"="+ea.returnValue+";")}}d=a(function(){return h}).returnValue;c+="var ret = "+d+"("+q.join(",")+");";u||(d=a(function(){return la}).returnValue,c+="ret = "+d+"(ret);");b||(c+=f.stackRestore.body.replace("()","(stack)")+";");return eval(c+"return ret})")}})();e.ccall=ia;e.cwrap=ha;function ma(a,b,c){c=c||"i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case"i1":D[a>>0]=b;break;case"i8":D[a>>0]=b;break;case"i16":E[a>>1]=b;break;case"i32":F[a>>2]=b;break;case"i64":fa=[b>>>0,(da=b,1<=+na(da)?0<da?(oa(+pa(da/4294967296),4294967295)|0)>>>0:~~+qa((da-+(~~da>>>0))/4294967296)>>>0:0)];F[a>>2]=fa[0];F[a+4>>2]=fa[1];break;case"float":ra[a>>2]=b;break;case"double":sa[a>>3]=b;break;default:z("invalid type for setValue: "+c)}}e.setValue=ma;function ta(a,b){b=b||"i8";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case"i1":return D[a>>0];case"i8":return D[a>>0];case"i16":return E[a>>1];case"i32":return F[a>>2];case"i64":return F[a>>2];case"float":return ra[a>>2];case"double":return sa[a>>3];default:z("invalid type for setValue: "+b)}return null}e.getValue=ta;e.ALLOC_NORMAL=0;e.ALLOC_STACK=1;e.ALLOC_STATIC=2;e.ALLOC_DYNAMIC=3;e.ALLOC_NONE=4;function G(a,b,c,d){var f,h;"number"===typeof a?(f=!0,h=a):(f=!1,h=a.length);var g="string"===typeof b?b:null;c=4==c?d:[ua,n.W,n.Ia,n.P][void 0===c?2:c](Math.max(h,g?1:b.length));if(f){d=c;assert(0==(c&3));for(a=c+(h&-4);d<a;d+=4)F[d>>2]=0;for(a=c+h;d<a;)D[d++>>0]=0;return c}if("i8"===g)return a.subarray||a.slice?H.set(a,c):H.set(new Uint8Array(a),c),c;d=0;for(var k,t;d<h;){var r=a[d];"function"===typeof r&&(r=n.sd(r));f=g||b[d];0===f?d++:("i64"==f&&(f="i32"),ma(c+d,r,f),t!==f&&(k=n.Aa(f),t=f),d+=k)}return c}e.allocate=G;e.getMemory=function(a){return va?"undefined"!==typeof wa&&!wa.C||!xa?n.P(a):ua(a):n.Ia(a)};function la(a,b){if(0===b||!a)return"";for(var c=0,d,f=0;;){d=H[a+f>>0];c|=d;if(0==d&&!b)break;f++;if(b&&f==b)break}b||(b=f);d="";if(128>c){for(;0<b;)c=String.fromCharCode.apply(String,H.subarray(a,a+Math.min(b,1024))),d=d?d+c:c,a+=1024,b-=1024;return d}return e.UTF8ToString(a)}e.Pointer_stringify=la;e.AsciiToString=function(a){for(var b="";;){var c=D[a++>>0];if(!c)return b;b+=String.fromCharCode(c)}};e.stringToAscii=function(a,b){return ya(a,b,!1)};function za(a,b){for(var c,d,f,h,g,k,t="";;){c=a[b++];if(!c)return t;c&128?(d=a[b++]&63,192==(c&224)?t+=String.fromCharCode((c&31)<<6|d):(f=a[b++]&63,224==(c&240)?c=(c&15)<<12|d<<6|f:(h=a[b++]&63,240==(c&248)?c=(c&7)<<18|d<<12|f<<6|h:(g=a[b++]&63,248==(c&252)?c=(c&3)<<24|d<<18|f<<12|h<<6|g:(k=a[b++]&63,c=(c&1)<<30|d<<24|f<<18|h<<12|g<<6|k))),65536>c?t+=String.fromCharCode(c):(c-=65536,t+=String.fromCharCode(55296|c>>10,56320|c&1023)))):t+=String.fromCharCode(c)}}e.UTF8ArrayToString=za;e.UTF8ToString=function(a){return za(H,a)};function Aa(a,b,c,d){if(!(0<d))return 0;var f=c;d=c+d-1;for(var h=0;h<a.length;++h){var g=a.charCodeAt(h);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++h)&1023);if(127>=g){if(c>=d)break;b[c++]=g}else{if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6}else{if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12}else{if(2097151>=g){if(c+3>=d)break;b[c++]=240|g>>18}else{if(67108863>=g){if(c+4>=d)break;b[c++]=248|g>>24}else{if(c+5>=d)break;b[c++]=252|g>>30;b[c++]=128|g>>24&63}b[c++]=128|g>>18&63}b[c++]=128|g>>12&63}b[c++]=128|g>>6&63}b[c++]=128|g&63}}b[c]=0;return c-f}e.stringToUTF8Array=Aa;e.stringToUTF8=function(a,b,c){return Aa(a,H,b,c)};function Ba(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:2097151>=d?b+4:67108863>=d?b+5:b+6}return b}e.lengthBytesUTF8=Ba;e.UTF16ToString=function(a){for(var b=0,c="";;){var d=E[a+2*b>>1];if(0==d)return c;++b;c+=String.fromCharCode(d)}};e.stringToUTF16=function(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var f=0;f<c;++f)E[b>>1]=a.charCodeAt(f),b+=2;E[b>>1]=0;return b-d};e.lengthBytesUTF16=function(a){return 2*a.length};e.UTF32ToString=function(a){for(var b=0,c="";;){var d=F[a+4*b>>2];if(0==d)return c;++b;65536<=d?(d=d-65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023)):c+=String.fromCharCode(d)}};e.stringToUTF32=function(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var d=b;c=d+c-4;for(var f=0;f<a.length;++f){var h=a.charCodeAt(f);if(55296<=h&&57343>=h)var g=a.charCodeAt(++f),h=65536+((h&1023)<<10)|g&1023;F[b>>2]=h;b+=4;if(b+4>c)break}F[b>>2]=0;return b-d};e.lengthBytesUTF32=function(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&++c;b+=4}return b};function Ca(a){function b(c,d,f){d=d||Infinity;var h="",g=[],q;if("N"===a[k]){k++;"K"===a[k]&&k++;for(q=[];"E"!==a[k];)if("S"===a[k]){k++;var x=a.indexOf("_",k);q.push(r[a.substring(k,x)||0]||"?");k=x+1}else if("C"===a[k])q.push(q[q.length-1]),k+=2;else{var x=parseInt(a.substr(k)),Q=x.toString().length;if(!x||!Q){k--;break}var Bb=a.substr(k+Q,x);q.push(Bb);r.push(Bb);k+=Q+x}k++;q=q.join("::");d--;if(0===d)return c?[q]:q}else(("K"===a[k]||u&&"L"===a[k])&&k++,x=parseInt(a.substr(k)))&&(Q=x.toString().length,q=a.substr(k+Q,x),k+=Q+x);u=!1;"I"===a[k]?(k++,x=b(!0),Q=b(!0,1,!0),h+=Q[0]+" "+q+"<"+x.join(", ")+">"):h=q;a:for(;k<a.length&&0<d--;)if(q=a[k++],q in t)g.push(t[q]);else switch(q){case"P":g.push(b(!0,1,!0)[0]+"*");break;case"R":g.push(b(!0,1,!0)[0]+"&");break;case"L":k++;x=a.indexOf("E",k)-k;g.push(a.substr(k,x));k+=x+2;break;case"A":x=parseInt(a.substr(k));k+=x.toString().length;if("_"!==a[k])throw"?";k++;g.push(b(!0,1,!0)[0]+" ["+x+"]");break;case"E":break a;default:h+="?"+q;break a}f||1!==g.length||"void"!==g[0]||(g=[]);return c?(h&&g.push(h+"?"),g):h+("("+g.join(", ")+")")}var c=!!e.___cxa_demangle;if(c)try{var d=ua(a.length);ka(a.substr(1),d);var f=ua(4),h=e.___cxa_demangle(d,0,0,f);if(0===ta(f,"i32")&&h)return la(h)}catch(g){}finally{d&&Da(d),f&&Da(f),h&&Da(h)}var k=3,t={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},r=[],u=!0,d=a;try{if("Object._main"==a||"_main"==a)return"main()";"number"===typeof a&&(a=la(a));if("_"!==a[0]||"_"!==a[1]||"Z"!==a[2])return a;switch(a[3]){case"n":return"operator new()";case"d":return"operator delete()"}d=b()}catch(q){d+="?"}0<=d.indexOf("?")&&!c&&n.M("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return d}function Ea(){return Fa().replace(/__Z[\w\d_]+/g,function(a){var b=Ca(a);return a===b?a:a+" ["+b+"]"})}function Fa(){var a=Error();if(!a.stack){try{throw Error(0)}catch(b){a=b}if(!a.stack)return"(no stack trace available)"}return a.stack.toString()}e.stackTrace=function(){return Ea()};function Ga(){var a=v;0<a%4096&&(a+=4096-a%4096);return a}for(var D,H,E,Ha,F,Ia,ra,sa,Ja=0,p=0,va=!1,Ka=0,m=0,La=0,Ma=0,v=0,Na=e.TOTAL_STACK||(IS_SMALL_CURVE25519_BUFFER_ENABLED?524288:5242880),w=e.TOTAL_MEMORY||(IS_SMALL_CURVE25519_BUFFER_ENABLED?1048576:16777216),I=65536;I<w||I<2*Na;)I=16777216>I?2*I:I+16777216;I!==w&&(w=I);assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(w);D=new Int8Array(buffer);E=new Int16Array(buffer);F=new Int32Array(buffer);H=new Uint8Array(buffer);Ha=new Uint16Array(buffer);Ia=new Uint32Array(buffer);ra=new Float32Array(buffer);sa=new Float64Array(buffer);F[0]=255;assert(255===H[0]&&0===H[3],"Typed arrays 2 must be run on a little-endian system");e.HEAP=void 0;e.buffer=buffer;e.HEAP8=D;e.HEAP16=E;e.HEAP32=F;e.HEAPU8=H;e.HEAPU16=Ha;e.HEAPU32=Ia;e.HEAPF32=ra;e.HEAPF64=sa;function Oa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var c=b.Qa;"number"===typeof c?void 0===b.T?n.J("v",c):n.J("vi",c,[b.T]):c(void 0===b.T?null:b.T)}}}var Pa=[],Qa=[],Ra=[],K=[],Sa=[],xa=!1;function Ta(a){Pa.unshift(a)}e.addOnPreRun=Ta;e.addOnInit=function(a){Qa.unshift(a)};e.addOnPreMain=function(a){Ra.unshift(a)};e.addOnExit=function(a){K.unshift(a)};function Ua(a){Sa.unshift(a)}e.addOnPostRun=Ua;function Va(a,b,c){c=Array(0<c?c:Ba(a)+1);a=Aa(a,c,0,c.length);b&&(c.length=a);return c}e.intArrayFromString=Va;e.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];255<d&&(d&=255);b.push(String.fromCharCode(d))}return b.join("")};function ka(a,b,c){a=Va(a,c);for(c=0;c<a.length;)D[b+c>>0]=a[c],c+=1}e.writeStringToMemory=ka;function ja(a,b){for(var c=0;c<a.length;c++)D[b++>>0]=a[c]}e.writeArrayToMemory=ja;function ya(a,b,c){for(var d=0;d<a.length;++d)D[b++>>0]=a.charCodeAt(d);c||(D[b>>0]=0)}e.writeAsciiToMemory=ya;Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(a,b){var c=a&65535,d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16)|0});Math.td=Math.imul;Math.clz32||(Math.clz32=function(a){a=a>>>0;for(var b=0;32>b;b++)if(a&1<<31-b)return b;return 32});Math.kd=Math.clz32;var na=Math.abs,qa=Math.ceil,pa=Math.floor,oa=Math.min,L=0,Wa=null,Xa=null;function Ya(){L++,e.monitorRunDependencies&&e.monitorRunDependencies(L)}e.addRunDependency=Ya;function Za(){L--;e.monitorRunDependencies&&e.monitorRunDependencies(L);if(0==L&&(null!==Wa&&(clearInterval(Wa),Wa=null),Xa)){var a=Xa;Xa=null;a()}}e.removeRunDependency=Za;e.preloadedImages={};e.preloadedAudios={};Ja=8;p=Ja+1696;Qa.push();G([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,164,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",4,n.La);var $a=n.ea(G(12,"i8",2),8);assert(0==$a%8);e._bitshift64Ashr=ab;e._i64Subtract=bb;e._i64Add=cb;e._memset=db;function eb(a,b){K.push(function(){n.J("vi",a,[b])}),eb.level=K.length}e._bitshift64Lshr=fb;e._bitshift64Shl=gb;var M={G:1,B:2,Qc:3,Nb:4,F:5,sa:6,gb:7,kc:8,Z:9,ub:10,oa:11,$c:11,Ka:12,Y:13,Gb:14,wc:15,$:16,pa:17,ad:18,ba:19,qa:20,N:21,u:22,fc:23,Ja:24,O:25,Xc:26,Hb:27,sc:28,da:29,Nc:30,Zb:31,Gc:32,Db:33,Kc:34,oc:42,Kb:43,vb:44,Qb:45,Rb:46,Sb:47,Yb:48,Yc:49,ic:50,Pb:51,Ab:35,lc:37,mb:52,pb:53,bd:54,gc:55,qb:56,rb:57,Bb:35,sb:59,uc:60,jc:61,Uc:62,tc:63,pc:64,qc:65,Mc:66,mc:67,jb:68,Rc:69,wb:70,Hc:71,ac:72,Eb:73,ob:74,Bc:76,nb:77,Lc:78,Tb:79,Ub:80,Xb:81,Wb:82,Vb:83,vc:38,ra:39,bc:36,aa:40,Cc:95,Fc:96,zb:104,hc:105,kb:97,Jc:91,zc:88,rc:92,Oc:108,yb:111,hb:98,xb:103,ec:101,cc:100,Vc:110,Ib:112,Jb:113,Mb:115,lb:114,Cb:89,$b:90,Ic:93,Pc:94,ib:99,dc:102,Ob:106,xc:107,Wc:109,Zc:87,Fb:122,Sc:116,Ac:95,nc:123,Lb:84,Dc:75,tb:125,yc:131,Ec:130,Tc:86},hb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ib(a){e.___errno_location&&(F[e.___errno_location()>>2]=a);return a}function jb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];"."===f?a.splice(d,1):".."===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function N(a){var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=jb(a.split("/").filter(function(a){return!!a}),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a}function kb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function lb(a){if("/"===a)return"/";var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)}function mb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=jb(a.split("/").filter(function(a){return!!a}),!b).join("/");return(b?"/":"")+a||"."}var nb=[];function ob(a,b){nb[a]={input:[],output:[],L:b},pb(a,qb)}var qb={open:function(a){var b=nb[a.g.rdev];if(!b)throw new O(M.ba);a.tty=b;a.seekable=!1},close:function(a){a.tty.L.flush(a.tty)},flush:function(a){a.tty.L.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.L.Ba)throw new O(M.sa);for(var f=0,h=0;h<d;h++){var g;try{g=a.tty.L.Ba(a.tty)}catch(k){throw new O(M.F)}if(void 0===g&&0===f)throw new O(M.oa);if(null===g||void 0===g)break;f++;b[c+h]=g}f&&(a.g.timestamp=Date.now());return f},write:function(a,b,c,d){if(!a.tty||!a.tty.L.ja)throw new O(M.sa);for(var f=0;f<d;f++)try{a.tty.L.ja(a.tty,b[c+f])}catch(h){throw new O(M.F)}d&&(a.g.timestamp=Date.now());return f}},rb={Ba:function(a){if(!a.input.length){var b=null;"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&(b=readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=Va(b,!0)}return a.input.shift()},ja:function(a,b){null===b||10===b?(e.print(za(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(e.print(za(a.output,0)),a.output=[])}},sb={ja:function(a,b){null===b||10===b?(e.printErr(za(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(e.printErr(za(a.output,0)),a.output=[])}},P={q:null,A:function(){return P.createNode(null,"/",16895,0)},createNode:function(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new O(M.G);P.q||(P.q={dir:{g:{D:P.k.D,p:P.k.p,lookup:P.k.lookup,V:P.k.V,rename:P.k.rename,unlink:P.k.unlink,rmdir:P.k.rmdir,readdir:P.k.readdir,symlink:P.k.symlink},stream:{I:P.n.I}},file:{g:{D:P.k.D,p:P.k.p},stream:{I:P.n.I,read:P.n.read,write:P.n.write,ta:P.n.ta,Ea:P.n.Ea,Ga:P.n.Ga}},link:{g:{D:P.k.D,p:P.k.p,readlink:P.k.readlink},stream:{}},va:{g:{D:P.k.D,p:P.k.p},stream:tb}});c=ub(a,b,c,d);16384===(c.mode&61440)?(c.k=P.q.dir.g,c.n=P.q.dir.stream,c.e={}):32768===(c.mode&61440)?(c.k=P.q.file.g,c.n=P.q.file.stream,c.o=0,c.e=null):40960===(c.mode&61440)?(c.k=P.q.link.g,c.n=P.q.link.stream):8192===(c.mode&61440)&&(c.k=P.q.va.g,c.n=P.q.va.stream);c.timestamp=Date.now();a&&(a.e[b]=c);return c},Sa:function(a){if(a.e&&a.e.subarray){for(var b=[],c=0;c<a.o;++c)b.push(a.e[c]);return b}return a.e},qd:function(a){return a.e?a.e.subarray?a.e.subarray(0,a.o):new Uint8Array(a.e):new Uint8Array},ya:function(a,b){a.e&&a.e.subarray&&b>a.e.length&&(a.e=P.Sa(a),a.o=a.e.length);if(!a.e||a.e.subarray){var c=a.e?a.e.buffer.byteLength:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)|0),0!=c&&(b=Math.max(b,256)),c=a.e,a.e=new Uint8Array(b),0<a.o&&a.e.set(c.subarray(0,a.o),0))}else for(!a.e&&0<b&&(a.e=[]);a.e.length<b;)a.e.push(0)},ab:function(a,b){if(a.o!=b)if(0==b)a.e=null,a.o=0;else{if(!a.e||a.e.subarray){var c=a.e;a.e=new Uint8Array(new ArrayBuffer(b));c&&a.e.set(c.subarray(0,Math.min(b,a.o)))}else if(a.e||(a.e=[]),a.e.length>b)a.e.length=b;else for(;a.e.length<b;)a.e.push(0);a.o=b}},k:{D:function(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;16384===(a.mode&61440)?b.size=4096:32768===(a.mode&61440)?b.size=a.o:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.Pa=4096;b.blocks=Math.ceil(b.size/b.Pa);return b},p:function(a,b){void 0!==b.mode&&(a.mode=b.mode),void 0!==b.timestamp&&(a.timestamp=b.timestamp),void 0!==b.size&&P.ab(a,b.size)},lookup:function(){throw vb[M.B]},V:function(a,b,c,d){return P.createNode(a,b,c,d)},rename:function(a,b,c){if(16384===(a.mode&61440)){var d;try{d=wb(b,c)}catch(f){}if(d)for(var h in d.e)throw new O(M.ra)}delete a.parent.e[a.name];a.name=c;b.e[c]=a;a.parent=b},unlink:function(a,b){delete a.e[b]},rmdir:function(a,b){var c=wb(a,b),d;for(d in c.e)throw new O(M.ra);delete a.e[b]},readdir:function(a){var b=[".",".."],c;for(c in a.e)a.e.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=P.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(40960!==(a.mode&61440))throw new O(M.u);return a.link}},n:{read:function(a,b,c,d,f){var h=a.g.e;if(f>=a.g.o)return 0;a=Math.min(a.g.o-f,d);assert(0<=a);if(8<a&&h.subarray)b.set(h.subarray(f,f+a),c);else for(d=0;d<a;d++)b[c+d]=h[f+d];return a},write:function(a,b,c,d,f,h){if(!d)return 0;a=a.g;a.timestamp=Date.now();if(b.subarray&&(!a.e||a.e.subarray)){if(h)return a.e=b.subarray(c,c+d),a.o=d;if(0===a.o&&0===f)return a.e=new Uint8Array(b.subarray(c,c+d)),a.o=d;if(f+d<=a.o)return a.e.set(b.subarray(c,c+d),f),d}P.ya(a,f+d);if(a.e.subarray&&b.subarray)a.e.set(b.subarray(c,c+d),f);else for(h=0;h<d;h++)a.e[f+h]=b[c+h];a.o=Math.max(a.o,f+d);return d},I:function(a,b,c){1===c?b+=a.position:2===c&&32768===(a.g.mode&61440)&&(b+=a.g.o);if(0>b)throw new O(M.u);return b},ta:function(a,b,c){P.ya(a.g,b+c),a.g.o=Math.max(a.g.o,b+c)},Ea:function(a,b,c,d,f,h,g){if(32768!==(a.g.mode&61440))throw new O(M.ba);c=a.g.e;if(g&2||c.buffer!==b&&c.buffer!==b.buffer){(0<f||f+d<a.g.o)&&(c.subarray?c=c.subarray(f,f+d):c=Array.prototype.slice.call(c,f,f+d));a=!0;d=ua(d);if(!d)throw new O(M.Ka);b.set(c,d)}else a=!1,d=c.byteOffset;return{Cd:d,gd:a}},Ga:function(a,b,c,d,f){if(32768!==(a.g.mode&61440))throw new O(M.ba);if(f&2)return 0;P.n.write(a,b,0,d,c,!1);return 0}}};G(1,"i32*",2);G(1,"i32*",2);G(1,"i32*",2);var xb=null,yb=[null],zb=[],Ab=1,R=null,Cb=!0,S={},O=null,vb={};function T(a,b){a=mb("/",a);b=b||{};if(!a)return{path:"",g:null};var c={za:!0,ka:0},d;for(d in c)void 0===b[d]&&(b[d]=c[d]);if(8<b.ka)throw new O(M.aa);var c=jb(a.split("/").filter(function(a){return!!a}),!1),f=xb;d="/";for(var h=0;h<c.length;h++){var g=h===c.length-1;if(g&&b.parent)break;f=wb(f,c[h]);d=N(d+"/"+c[h]);f.R&&(!g||g&&b.za)&&(f=f.R.root);if(!g||b.ga)for(g=0;40960===(f.mode&61440);)if(f=Db(d),d=mb(kb(d),f),f=T(d,{ka:b.ka}).g,40<g++)throw new O(M.aa)}return{path:d,g:f}}function U(a){for(var b;;){if(a===a.parent)return a=a.A.Fa,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}}function Eb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%R.length}function Fb(a){var b=Eb(a.parent.id,a.name);a.K=R[b];R[b]=a}function wb(a,b){var c;if(c=(c=Gb(a,"x"))?c:a.k.lookup?0:M.Y)throw new O(c,a);for(c=R[Eb(a.id,b)];c;c=c.K){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.k.lookup(a,b)}function ub(a,b,c,d){Hb||(Hb=function(a,b,c,d){a||(a=this),this.parent=a,this.A=a.A,this.R=null,this.id=Ab++,this.name=b,this.mode=c,this.k={},this.n={},this.rdev=d},Hb.prototype={},Object.defineProperties(Hb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Xa:{get:function(){return 16384===(this.mode&61440)}},Ca:{get:function(){return 8192===(this.mode&61440)}}}));a=new Hb(a,b,c,d);Fb(a);return a}var Ib={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Gb(a,b){if(Cb)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return M.Y}else return M.Y;return 0}function Jb(a,b){try{return wb(a,b),M.pa}catch(c){}return Gb(a,"wx")}function Kb(){var a;a=4096;for(var b=0;b<=a;b++)if(!zb[b])return b;throw new O(M.Ja)}function Lb(a){Mb||(Mb=function(){},Mb.prototype={},Object.defineProperties(Mb.prototype,{object:{get:function(){return this.g},set:function(a){this.g=a}},vd:{get:function(){return 1!==(this.flags&2097155)}},wd:{get:function(){return 0!==(this.flags&2097155)}},ud:{get:function(){return this.flags&1024}}}));var b=new Mb,c;for(c in a)b[c]=a[c];a=b;b=Kb();a.fd=b;return zb[b]=a}var tb={open:function(a){a.n=yb[a.g.rdev].n,a.n.open&&a.n.open(a)},I:function(){throw new O(M.da)}};function pb(a,b){yb[a]={n:b}}function Nb(a,b){var c="/"===b,d=!b,f;if(c&&xb)throw new O(M.$);if(!c&&!d){f=T(b,{za:!1});b=f.path;f=f.g;if(f.R)throw new O(M.$);if(16384!==(f.mode&61440))throw new O(M.qa)}var d={type:a,Ad:{},Fa:b,Ya:[]},h=a.A(d);h.A=d;d.root=h;c?xb=h:f&&(f.R=d,f.A&&f.A.Ya.push(d))}function Ob(a,b,c){var d=T(a,{parent:!0}).g;a=lb(a);if(!a||"."===a||".."===a)throw new O(M.u);var f=Jb(d,a);if(f)throw new O(f);if(!d.k.V)throw new O(M.G);return d.k.V(d,a,b,c)}function Pb(a,b){b=(void 0!==b?b:438)&4095;b|=32768;return Ob(a,b,0)}function V(a,b){b=(void 0!==b?b:511)&1023;b|=16384;return Ob(a,b,0)}function Qb(a,b,c){"undefined"===typeof c&&(c=b,b=438);return Ob(a,b|8192,c)}function Rb(a,b){if(!mb(a))throw new O(M.B);var c=T(b,{parent:!0}).g;if(!c)throw new O(M.B);var d=lb(b),f=Jb(c,d);if(f)throw new O(f);if(!c.k.symlink)throw new O(M.G);return c.k.symlink(c,d,a)}function Db(a){a=T(a).g;if(!a)throw new O(M.B);if(!a.k.readlink)throw new O(M.u);return mb(U(a.parent),a.k.readlink(a))}function Sb(a,b){var c;"string"===typeof a?c=T(a,{ga:!0}).g:c=a;if(!c.k.p)throw new O(M.G);c.k.p(c,{mode:b&4095|c.mode&-4096,timestamp:Date.now()})}function Tb(a,b){var c;if(""===a)throw new O(M.B);var d;if("string"===typeof b){if(d=Ib[b],"undefined"===typeof d)throw Error("Unknown file open mode: "+b)}else d=b;b=d;c=b&64?("undefined"===typeof c?438:c)&4095|32768:0;var f;if("object"===typeof a)f=a;else{a=N(a);try{f=T(a,{ga:!(b&131072)}).g}catch(h){}}d=!1;if(b&64)if(f){if(b&128)throw new O(M.pa)}else f=Ob(a,c,0),d=!0;if(!f)throw new O(M.B);8192===(f.mode&61440)&&(b&=-513);if(b&65536&&16384!==(f.mode&61440))throw new O(M.qa);if(!d&&(f?40960===(f.mode&61440)?c=M.aa:16384===(f.mode&61440)&&(0!==(b&2097155)||b&512)?c=M.N:(c=["r","w","rw"][b&3],b&512&&(c+="w"),c=Gb(f,c)):c=M.B,c))throw new O(c);if(b&512){c=f;var g;"string"===typeof c?g=T(c,{ga:!0}).g:g=c;if(!g.k.p)throw new O(M.G);if(16384===(g.mode&61440))throw new O(M.N);if(32768!==(g.mode&61440))throw new O(M.u);if(c=Gb(g,"w"))throw new O(c);g.k.p(g,{size:0,timestamp:Date.now()})}b&=-641;f=Lb({g:f,path:U(f),flags:b,seekable:!0,position:0,n:f.n,eb:[],error:!1});f.n.open&&f.n.open(f);!e.logReadFiles||b&1||(Ub||(Ub={}),a in Ub||(Ub[a]=1,e.printErr("read file: "+a)));try{S.onOpenFile&&(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),S.onOpenFile(a,g))}catch(k){}return f}function Vb(a){a.ia&&(a.ia=null);try{a.n.close&&a.n.close(a)}catch(b){throw b}finally{zb[a.fd]=null}}function Wb(a,b,c){if(!a.seekable||!a.n.I)throw new O(M.da);a.position=a.n.I(a,b,c);a.eb=[]}function Xb(a,b,c,d,f,h){if(0>d||0>f)throw new O(M.u);if(0===(a.flags&2097155))throw new O(M.Z);if(16384===(a.g.mode&61440))throw new O(M.N);if(!a.n.write)throw new O(M.u);a.flags&1024&&Wb(a,0,2);var g=!0;if("undefined"===typeof f)f=a.position,g=!1;else if(!a.seekable)throw new O(M.da);b=a.n.write(a,b,c,d,f,h);g||(a.position+=b);try{a.path&&S.onWriteToFile&&S.onWriteToFile(a.path)}catch(k){}return b}function Yb(){O||(O=function(a,b){this.g=b,this.bb=function(a){this.Q=a;for(var b in M)if(M[b]===a){this.code=b;break}},this.bb(a),this.message=hb[a]},O.prototype=Error(),O.prototype.constructor=O,[M.B].forEach(function(a){vb[a]=new O(a),vb[a].stack="<generic error, no stack>"}))}var Zb;function $b(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c}function ac(a,b,c,d){a=N(("string"===typeof a?a:U(a))+"/"+b);return Pb(a,$b(c,d))}function bc(a,b,c,d,f,h){a=b?N(("string"===typeof a?a:U(a))+"/"+b):a;d=$b(d,f);f=Pb(a,d);if(c){if("string"===typeof c){a=Array(c.length);b=0;for(var g=c.length;b<g;++b)a[b]=c.charCodeAt(b);c=a}Sb(f,d|146);a=Tb(f,"w");Xb(a,c,0,c.length,0,h);Vb(a);Sb(f,d)}return f}function W(a,b,c,d){a=N(("string"===typeof a?a:U(a))+"/"+b);b=$b(!!c,!!d);W.Da||(W.Da=64);var f=W.Da++<<8|0;pb(f,{open:function(a){a.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(a,b,d,f){for(var r=0,u=0;u<f;u++){var q;try{q=c()}catch(y){throw new O(M.F)}if(void 0===q&&0===r)throw new O(M.oa);if(null===q||void 0===q)break;r++;b[d+u]=q}r&&(a.g.timestamp=Date.now());return r},write:function(a,b,c,f){for(var r=0;r<f;r++)try{d(b[c+r])}catch(u){throw new O(M.F)}f&&(a.g.timestamp=Date.now());return r}});return Qb(a,b,f)}function cc(a){if(a.Ca||a.Xa||a.link||a.e)return!0;var b=!0;if("undefined"!==typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(e.read)try{a.e=Va(e.read(a.url),!0),a.o=a.e.length}catch(c){b=!1}else throw Error("Cannot load without read() or XMLHttpRequest.");b||ib(M.F);return b}var dc={},Hb,Mb,Ub,ec=0;function X(){ec+=4;return F[ec-4>>2]}function fc(){var a;a=X();a=zb[a];if(!a)throw new O(M.Z);return a}function wa(a){wa.C||(v=Ga(),wa.C=!0,assert(n.P),wa.Ra=n.P,n.P=function(){z("cannot dynamically allocate, sbrk now has control")});var b=v;return 0==a||wa.Ra(a)?b:4294967295}e._memcpy=gc;function hc(a,b){ic=a;jc=b;if(!kc)return 1;if(0==a)Y=function(){setTimeout(lc,b)},mc="timeout";else if(1==a)Y=function(){nc(lc)},mc="rAF";else if(2==a){if(!window.setImmediate){var c=[];window.addEventListener("message",function(a){a.source===window&&"__emcc"===a.data&&(a.stopPropagation(),c.shift()())},!0);window.setImmediate=function(a){c.push(a),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(lc)};mc="immediate"}return 0}function oc(a,b,c,d,f){e.noExitRuntime=!0;assert(!kc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");kc=a;pc=d;var h=qc;lc=function(){if(!A)if(0<rc.length){var b=Date.now(),c=rc.shift();c.Qa(c.T);if(sc){var f=sc,r=0==f%1?f-1:Math.floor(f);sc=c.ld?r:(8*f+(r+.5))/9}tc();setTimeout(lc,0)}else h<qc||(uc=uc+1|0,1==ic&&1<jc&&0!=uc%jc?Y():("timeout"===mc&&e.fa&&(e.S("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),mc=""),vc(function(){"undefined"!==typeof d?n.J("vi",a,[d]):n.J("v",a)}),h<qc||("object"===typeof SDL&&SDL.audio&&SDL.audio.Za&&SDL.audio.Za(),Y())))};f||(b&&0<b?hc(0,1e3/b):hc(1,1),Y());if(c)throw"SimulateInfiniteLoop"}var Y=null,mc="",qc=0,kc=null,pc=0,ic=0,jc=0,uc=0,rc=[];function tc(){if(e.setStatus){var a=e.statusMessage||"Please wait...",b=sc,c=wc.nd;b?b<c?e.setStatus(a+" ("+(c-b)+"/"+c+")"):e.setStatus(a):e.setStatus("")}}function vc(a){if(!(A||e.preMainLoop&&!1===e.preMainLoop())){try{a()}catch(b){if(b instanceof xc)return;b&&"object"===typeof b&&b.stack&&e.S("exception thrown: "+[b,b.stack]);throw b}e.postMainLoop&&e.postMainLoop()}}var wc={},lc,sc,yc=!1,zc=!1,Ac=[];function Bc(){function a(){zc=document.pointerLockElement===c||document.mozPointerLockElement===c||document.webkitPointerLockElement===c||document.msPointerLockElement===c}e.preloadPlugins||(e.preloadPlugins=[]);if(!Cc){Cc=!0;try{Dc=!0}catch(b){Dc=!1,!1}Ec="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Dc?null:!1;Fc="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0;e.Ha||"undefined"!==typeof Fc||(!1,e.Ha=!0);e.preloadPlugins.push({canHandle:function(a){return!e.Ha&&/\.(jpg|jpeg|png|bmp)$/i.test(a)},handle:function(a,b,c,g){var k=null;if(Dc)try{k=new Blob([a],{type:Gc(b)}),k.size!==a.length&&(k=new Blob([new Uint8Array(a).buffer],{type:Gc(b)}))}catch(t){n.M("Blob constructor present but fails: "+t+"; falling back to blob builder")}k||(k=new Ec,k.append(new Uint8Array(a).buffer),k=k.getBlob());var r=Fc.createObjectURL(k),u=new Image;u.onload=function(){assert(u.complete,"Image "+b+" could not be decoded");var g=document.createElement("canvas");g.width=u.width;g.height=u.height;g.getContext("2d").drawImage(u,0,0);e.preloadedImages[b]=g;Fc.revokeObjectURL(r);c&&c(a)};u.onerror=function(){g&&g()};u.src=r}});e.preloadPlugins.push({canHandle:function(a){return!e.zd&&a.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(a,b,c,g){function k(g){r||(r=!0,e.preloadedAudios[b]=g,c&&c(a))}function t(){r||(r=!0,e.preloadedAudios[b]=new Audio,g&&g())}var r=!1;if(Dc){try{var u=new Blob([a],{type:Gc(b)})}catch(q){return t()}var u=Fc.createObjectURL(u),y=new Audio;y.addEventListener("canplaythrough",function(){k(y)},!1);y.onerror=function(){if(!r){for(var c="",h=0,g=0,q=0;q<a.length;q++)for(h=h<<8|a[q],g+=8;6<=g;)var t=h>>g-6&63,g=g-6,c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t];2==g?(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(h&3)<<4],c+="=="):4==g&&(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(h&15)<<2],c+="=");y.src="data:audio/x-"+b.substr(-3)+";base64,"+c;k(y)}};y.src=u;Hc(function(){k(y)})}else return t()}});var c=e.canvas;c&&(c.la=c.requestPointerLock||c.mozRequestPointerLock||c.webkitRequestPointerLock||c.msRequestPointerLock||function(){},c.wa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},c.wa=c.wa.bind(document),document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),document.addEventListener("webkitpointerlockchange",a,!1),document.addEventListener("mspointerlockchange",a,!1),e.elementPointerLock&&c.addEventListener("click",function(a){!zc&&c.la&&(c.la(),a.preventDefault())},!1))}}function Ic(a,b,c,d){if(b&&e.fa&&a==e.canvas)return e.fa;var f,h;if(b){h={antialias:!1,alpha:!1};if(d)for(var g in d)h[g]=d[g];(h=GL.createContext(a,h))&&(f=GL.getContext(h).cd);a.style.backgroundColor="black"}else f=a.getContext("2d");if(!f)return null;c&&(b||assert("undefined"===typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.fa=f,b&&GL.yd(h),e.Dd=b,Ac.forEach(function(a){a()}),Bc());return f}var Jc=!1,Kc=void 0,Lc=void 0;function Mc(a,b,c){function d(){yc=!1;var a=f.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===a?(f.ua=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},f.ua=f.ua.bind(document),Kc&&f.la(),yc=!0,Lc&&Nc()):(a.parentNode.insertBefore(f,a),a.parentNode.removeChild(a),Lc&&Oc());e.onFullScreen&&e.onFullScreen(yc);Pc(f)}Kc=a;Lc=b;Qc=c;"undefined"===typeof Kc&&(Kc=!0);"undefined"===typeof Lc&&(Lc=!1);"undefined"===typeof Qc&&(Qc=null);var f=e.canvas;Jc||(Jc=!0,document.addEventListener("fullscreenchange",d,!1),document.addEventListener("mozfullscreenchange",d,!1),document.addEventListener("webkitfullscreenchange",d,!1),document.addEventListener("MSFullscreenChange",d,!1));var h=document.createElement("div");f.parentNode.insertBefore(h,f);h.appendChild(f);h.C=h.requestFullScreen||h.mozRequestFullScreen||h.msRequestFullscreen||(h.webkitRequestFullScreen?function(){h.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null);c?h.C({Ed:c}):h.C()}var Rc=0;function Sc(a){var b=Date.now();if(0===Rc)Rc=b+1e3/60;else for(;b+2>=Rc;)Rc+=1e3/60;b=Math.max(Rc-b,0);setTimeout(a,b)}function nc(a){"undefined"===typeof window?Sc(a):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Sc),window.requestAnimationFrame(a))}function Hc(a){e.noExitRuntime=!0,setTimeout(function(){A||a()},1e4)}function Gc(a){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[a.substr(a.lastIndexOf(".")+1)]}function Tc(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)}function Uc(a,b,c){Tc(a,function(c){assert(c,'Loading data file "'+a+'" failed (no arrayBuffer).'),b(new Uint8Array(c)),Za()},function(){if(c)c();else throw'Loading data file "'+a+'" failed.'}),Ya()}var Vc=[];function Wc(){var a=e.canvas;Vc.forEach(function(b){b(a.width,a.height)})}function Nc(){if("undefined"!=typeof SDL){var a=Ia[SDL.screen+0*n.H>>2];F[SDL.screen+0*n.H>>2]=a|8388608}Wc()}function Oc(){if("undefined"!=typeof SDL){var a=Ia[SDL.screen+0*n.H>>2];F[SDL.screen+0*n.H>>2]=a&-8388609}Wc()}function Pc(a,b,c){b&&c?(a.fb=b,a.Va=c):(b=a.fb,c=a.Va);var d=b,f=c;e.forcedAspectRatio&&0<e.forcedAspectRatio&&(d/f<e.forcedAspectRatio?d=Math.round(f*e.forcedAspectRatio):f=Math.round(d/e.forcedAspectRatio));if((document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===a.parentNode&&"undefined"!=typeof screen)var h=Math.min(screen.width/d,screen.height/f),d=Math.round(d*h),f=Math.round(f*h);Lc?(a.width!=d&&(a.width=d),a.height!=f&&(a.height=f),"undefined"!=typeof a.style&&(a.style.removeProperty("width"),a.style.removeProperty("height"))):(a.width!=b&&(a.width=b),a.height!=c&&(a.height=c),"undefined"!=typeof a.style&&(d!=b||f!=c?(a.style.setProperty("width",d+"px","important"),a.style.setProperty("height",f+"px","important")):(a.style.removeProperty("width"),a.style.removeProperty("height"))))}var Cc,Dc,Ec,Fc,Qc;Yb();R=Array(4096);Nb(P,"/");V("/tmp");V("/home");V("/home/web_user");(function(){V("/dev");pb(259,{read:function(){return 0},write:function(a,b,f,h){return h}});Qb("/dev/null",259);ob(1280,rb);ob(1536,sb);Qb("/dev/tty",1280);Qb("/dev/tty1",1536);var a;if("undefined"!==typeof crypto){var b=new Uint8Array(1);a=function(){crypto.getRandomValues(b);return b[0]}}else a=function(){return 256*Math.random()|0};W("/dev","random",a);W("/dev","urandom",a);V("/dev/shm");V("/dev/shm/tmp")})();V("/proc");V("/proc/self");V("/proc/self/fd");Nb({A:function(){var a=ub("/proc/self","fd",16895,73);a.k={lookup:function(a,c){var d=zb[+c];if(!d)throw new O(M.Z);var f={parent:null,A:{Fa:"fake"},k:{readlink:function(){return d.path}}};return f.parent=f}};return a}},"/proc/self/fd");Qa.unshift(function(){if(!e.noFSInit&&!Zb){assert(!Zb,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");Zb=!0;Yb();e.stdin=e.stdin;e.stdout=e.stdout;e.stderr=e.stderr;e.stdin?W("/dev","stdin",e.stdin):Rb("/dev/tty","/dev/stdin");e.stdout?W("/dev","stdout",null,e.stdout):Rb("/dev/tty","/dev/stdout");e.stderr?W("/dev","stderr",null,e.stderr):Rb("/dev/tty1","/dev/stderr");var a=Tb("/dev/stdin","r");assert(0===a.fd,"invalid handle for stdin ("+a.fd+")");a=Tb("/dev/stdout","w");assert(1===a.fd,"invalid handle for stdout ("+a.fd+")");a=Tb("/dev/stderr","w");assert(2===a.fd,"invalid handle for stderr ("+a.fd+")")}});Ra.push(function(){Cb=!1});K.push(function(){Zb=!1;var a=e._fflush;a&&a(0);for(a=0;a<zb.length;a++){var b=zb[a];b&&Vb(b)}});e.FS_createFolder=function(a,b,c,d){a=N(("string"===typeof a?a:U(a))+"/"+b);return V(a,$b(c,d))};e.FS_createPath=function(a,b){a="string"===typeof a?a:U(a);for(var c=b.split("/").reverse();c.length;){var d=c.pop();if(d){var f=N(a+"/"+d);try{V(f)}catch(h){}a=f}}return f};e.FS_createDataFile=bc;e.FS_createPreloadedFile=function(a,b,c,d,f,h,g,k,t,r){function u(c){function u(c){r&&r(),k||bc(a,b,c,d,f,t),h&&h(),Za()}var J=!1;e.preloadPlugins.forEach(function(a){!J&&a.canHandle(q)&&(a.handle(c,q,u,function(){g&&g(),Za()}),J=!0)});J||u(c)}Bc();var q=b?mb(N(a+"/"+b)):a;Ya();"string"==typeof c?Uc(c,function(a){u(a)},g):u(c)};e.FS_createLazyFile=function(a,b,c,d,f){if("undefined"!==typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";c={Ca:!1,url:c};var h=ac(a,b,d,f);c.e?h.e=c.e:c.url&&(h.e=null,h.url=c.url);Object.defineProperty(h,"usedBytes",{get:function(){return this.e.length}});var g={};Object.keys(h.n).forEach(function(a){var b=h.n[a];g[a]=function(){if(!cc(h))throw new O(M.F);return b.apply(null,arguments)}});g.read=function(a,b,c,d,f){if(!cc(h))throw new O(M.F);a=a.g.e;if(f>=a.length)return 0;d=Math.min(a.length-f,d);assert(0<=d);if(a.slice)for(var g=0;g<d;g++)b[c+g]=a[f+g];else for(g=0;g<d;g++)b[c+g]=a.get(f+g);return d};h.n=g;return h};e.FS_createLink=function(a,b,c){a=N(("string"===typeof a?a:U(a))+"/"+b);return Rb(c,a)};e.FS_createDevice=W;e.FS_unlink=function(a){var b=T(a,{parent:!0}).g,c=lb(a),d=wb(b,c),f;a:{try{f=wb(b,c)}catch(h){f=h.Q;break a}var g=Gb(b,"wx");f=g?g:16384===(f.mode&61440)?M.N:0}if(f)throw f===M.N&&(f=M.G),new O(f);if(!b.k.unlink)throw new O(M.G);if(d.R)throw new O(M.$);try{S.willDeletePath&&S.willDeletePath(a)}catch(k){}b.k.unlink(b,c);b=Eb(d.parent.id,d.name);if(R[b]===d)R[b]=d.K;else for(b=R[b];b;){if(b.K===d){b.K=d.K;break}b=b.K}try{S.onDeletePath&&S.onDeletePath(a)}catch(t){}};Qa.unshift(function(){});K.push(function(){});e.requestFullScreen=function(a,b,c){Mc(a,b,c)};e.requestAnimationFrame=function(a){nc(a)};e.setCanvasSize=function(a,b,c){Pc(e.canvas,a,b),c||Wc()};e.pauseMainLoop=function(){Y=null,qc++};e.resumeMainLoop=function(){qc++;var a=ic,b=jc,c=kc;kc=null;oc(c,0,!1,pc,!0);hc(a,b);Y()};e.getUserMedia=function(){window.C||(window.C=navigator.getUserMedia||navigator.mozGetUserMedia),window.C(void 0)};e.createContext=function(a,b,c,d){return Ic(a,b,c,d)};Ka=m=n.ea(p);va=!0;La=Ka+Na;Ma=v=n.ea(La);assert(Ma<w,"TOTAL_MEMORY not big enough for stack");var Xc=G([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",3);e.Na={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:Infinity};e.Oa={abort:z,assert:assert,invoke_ii:function(a,b){try{return e.dynCall_ii(a,b)}catch(c){if("number"!==typeof c&&"longjmp"!==c)throw c;Z.setThrew(1,0)}},invoke_iiii:function(a,b,c,d){try{return e.dynCall_iiii(a,b,c,d)}catch(f){if("number"!==typeof f&&"longjmp"!==f)throw f;Z.setThrew(1,0)}},invoke_vi:function(a,b){try{e.dynCall_vi(a,b)}catch(c){if("number"!==typeof c&&"longjmp"!==c)throw c;Z.setThrew(1,0)}},_pthread_cleanup_pop:function(){assert(eb.level==K.length,"cannot pop if something else added meanwhile!"),K.pop(),eb.level=K.length},___lock:function(){},_emscripten_set_main_loop:oc,_pthread_self:function(){return 0},___syscall6:function(a,b){ec=b;try{var c=fc();Vb(c);return 0}catch(d){return"undefined"!==typeof dc&&d instanceof O||z(d),-d.Q}},_emscripten_set_main_loop_timing:hc,_abort:function(){e.abort()},_sbrk:wa,_time:function(a){var b=Date.now()/1e3|0;a&&(F[a>>2]=b);return b},___setErrNo:ib,_emscripten_memcpy_big:function(a,b,c){H.set(H.subarray(b,b+c),a);return a},___syscall54:function(a,b){ec=b;try{var c=fc(),d=X();switch(d){case 21505:return c.tty?0:-M.O;case 21506:return c.tty?0:-M.O;case 21519:if(!c.tty)return-M.O;var f=X();return F[f>>2]=0;case 21520:return c.tty?-M.u:-M.O;case 21531:f=X();if(!c.n.Wa)throw new O(M.O);return c.n.Wa(c,d,f);default:z("bad ioctl syscall "+d)}}catch(h){return"undefined"!==typeof dc&&h instanceof O||z(h),-h.Q}},___unlock:function(){},___syscall140:function(a,b){ec=b;try{var c=fc(),d=X(),f=X(),h=X(),g=X();assert(0===d);Wb(c,f,g);F[h>>2]=c.position;c.ia&&0===f&&0===g&&(c.ia=null);return 0}catch(k){return"undefined"!==typeof dc&&k instanceof O||z(k),-k.Q}},_pthread_cleanup_push:eb,_sysconf:function(a){switch(a){case 30:return 4096;case 85:return I/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"===typeof navigator?navigator.hardwareConcurrency||1:1}ib(M.u);return-1},___syscall146:function(a,b){ec=b;try{var c=fc(),d=X(),f;a:{for(var h=X(),g=0,k=0;k<h;k++){var t=Xb(c,D,F[d+8*k>>2],F[d+(8*k+4)>>2],void 0);if(0>t){f=-1;break a}g+=t}f=g}return f}catch(r){return"undefined"!==typeof dc&&r instanceof O||z(r),-r.Q}},STACKTOP:m,STACK_MAX:La,tempDoublePtr:$a,ABORT:A,cttz_i8:Xc};var Z=function(global,env,buffer){var a=new global.Int8Array(buffer),b=new global.Int16Array(buffer),c=new global.Int32Array(buffer),d=new global.Uint8Array(buffer),e=new global.Uint16Array(buffer),f=new global.Uint32Array(buffer),g=new global.Float32Array(buffer),h=new global.Float64Array(buffer),i=env.STACKTOP|0,j=env.STACK_MAX|0,k=env.tempDoublePtr|0,l=env.ABORT|0,m=env.cttz_i8|0,n=0,o=0,p=0,q=0,r=global.NaN,s=global.Infinity,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=global.Math.floor,N=global.Math.abs,O=global.Math.sqrt,P=global.Math.pow,Q=global.Math.cos,R=global.Math.sin,S=global.Math.tan,T=global.Math.acos,U=global.Math.asin,V=global.Math.atan,W=global.Math.atan2,X=global.Math.exp,Y=global.Math.log,Z=global.Math.ceil,_=global.Math.imul,$=global.Math.min,aa=global.Math.clz32,ba=env.abort,ca=env.assert,da=env.invoke_ii,ea=env.invoke_iiii,fa=env.invoke_vi,ga=env._pthread_cleanup_pop,ha=env.___lock,ia=env._emscripten_set_main_loop,ja=env._pthread_self,ka=env.___syscall6,la=env._emscripten_set_main_loop_timing,ma=env._abort,na=env._sbrk,oa=env._time,pa=env.___setErrNo,qa=env._emscripten_memcpy_big,ra=env.___syscall54,sa=env.___unlock,ta=env.___syscall140,ua=env._pthread_cleanup_push,va=env._sysconf,wa=env.___syscall146,xa=0;function Ba(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function Ca(){return i|0}function Da(a){a=a|0,i=a}function Ea(a,b){a=a|0,b=b|0,i=a,j=b}function Fa(a,b){a=a|0,b=b|0,n||(n=a,o=b)}function Ga(b){b=b|0,a[k>>0]=a[b>>0],a[k+1>>0]=a[b+1>>0],a[k+2>>0]=a[b+2>>0],a[k+3>>0]=a[b+3>>0]}function Ha(b){b=b|0,a[k>>0]=a[b>>0],a[k+1>>0]=a[b+1>>0],a[k+2>>0]=a[b+2>>0],a[k+3>>0]=a[b+3>>0],a[k+4>>0]=a[b+4>>0],a[k+5>>0]=a[b+5>>0],a[k+6>>0]=a[b+6>>0],a[k+7>>0]=a[b+7>>0]}function Ia(a){a=a|0,C=a}function Ja(){return C|0}function Ka(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,gb=0,hb=0,ib=0,jb=0,kb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0,Gc=0,Hc=0;g=i;i=i+2640|0;h=g+2456|0;j=g+2304|0;k=g+2152|0;l=g+2e3|0;m=g+1848|0;n=g+1696|0;o=g+1544|0;p=g+1392|0;q=g+1240|0;r=g+1088|0;s=g+936|0;t=g+784|0;u=g+632|0;v=g+480|0;w=g+328|0;x=g+248|0;y=g+168|0;z=g+80|0;A=g;B=g+2608|0;D=B;E=e;e=D+32|0;do a[D>>0]=a[E>>0]|0,D=D+1|0,E=E+1|0;while((D|0)<(e|0));a[B>>0]=(d[B>>0]|0)&248;F=B+31|0;a[F>>0]=(d[F>>0]|0)&63|64;F=d[f>>0]|0;G=fb(d[f+1>>0]|0|0,0,8)|0;H=C;I=fb(d[f+2>>0]|0|0,0,16)|0;J=H|C;H=d[f+3>>0]|0;K=fb(H|0,0,24)|0;L=x;c[L>>2]=G|F|I|K&50331648;c[L+4>>2]=J;J=fb(d[f+4>>0]|0|0,0,8)|0;L=C;K=fb(d[f+5>>0]|0|0,0,16)|0;I=L|C;L=d[f+6>>0]|0;F=fb(L|0,0,24)|0;G=eb(J|H|K|F|0,I|C|0,2)|0;I=x+8|0;c[I>>2]=G&33554431;c[I+4>>2]=0;I=fb(d[f+7>>0]|0|0,0,8)|0;G=C;F=fb(d[f+8>>0]|0|0,0,16)|0;K=G|C;G=d[f+9>>0]|0;H=fb(G|0,0,24)|0;J=eb(I|L|F|H|0,K|C|0,3)|0;K=x+16|0;c[K>>2]=J&67108863;c[K+4>>2]=0;K=fb(d[f+10>>0]|0|0,0,8)|0;J=C;H=fb(d[f+11>>0]|0|0,0,16)|0;F=J|C;J=d[f+12>>0]|0;L=fb(J|0,0,24)|0;I=eb(K|G|H|L|0,F|C|0,5)|0;F=x+24|0;c[F>>2]=I&33554431;c[F+4>>2]=0;F=fb(d[f+13>>0]|0|0,0,8)|0;I=C;L=fb(d[f+14>>0]|0|0,0,16)|0;H=I|C;I=fb(d[f+15>>0]|0|0,0,24)|0;G=eb(F|J|L|I|0,H|C|0,6)|0;H=x+32|0;c[H>>2]=G&67108863;c[H+4>>2]=0;H=d[f+16>>0]|0;G=fb(d[f+17>>0]|0|0,0,8)|0;I=C;L=fb(d[f+18>>0]|0|0,0,16)|0;J=I|C;I=d[f+19>>0]|0;F=fb(I|0,0,24)|0;K=x+40|0;c[K>>2]=G|H|L|F&16777216;c[K+4>>2]=J;J=fb(d[f+20>>0]|0|0,0,8)|0;K=C;F=fb(d[f+21>>0]|0|0,0,16)|0;L=K|C;K=d[f+22>>0]|0;H=fb(K|0,0,24)|0;G=eb(J|I|F|H|0,L|C|0,1)|0;L=x+48|0;c[L>>2]=G&67108863;c[L+4>>2]=0;L=fb(d[f+23>>0]|0|0,0,8)|0;G=C;H=fb(d[f+24>>0]|0|0,0,16)|0;F=G|C;G=d[f+25>>0]|0;I=fb(G|0,0,24)|0;J=eb(L|K|H|I|0,F|C|0,3)|0;F=x+56|0;c[F>>2]=J&33554431;c[F+4>>2]=0;F=fb(d[f+26>>0]|0|0,0,8)|0;J=C;I=fb(d[f+27>>0]|0|0,0,16)|0;H=J|C;J=d[f+28>>0]|0;K=fb(J|0,0,24)|0;L=eb(F|G|I|K|0,H|C|0,4)|0;H=x+64|0;c[H>>2]=L&67108863;c[H+4>>2]=0;H=fb(d[f+29>>0]|0|0,0,8)|0;L=C;K=fb(d[f+30>>0]|0|0,0,16)|0;I=L|C;L=fb(d[f+31>>0]|0|0,0,24)|0;f=eb(H|J|K|L|0,I|C|0,6)|0;I=x+72|0;c[I>>2]=f&33554431;c[I+4>>2]=0;db(q|0,0,152)|0;I=q;c[I>>2]=1;c[I+4>>2]=0;db(r|0,0,152)|0;I=r;c[I>>2]=1;c[I+4>>2]=0;db(s|0,0,152)|0;db(t|0,0,152)|0;db(u|0,0,152)|0;I=u;c[I>>2]=1;c[I+4>>2]=0;db(v|0,0,152)|0;db(w|0,0,152)|0;I=w;c[I>>2]=1;c[I+4>>2]=0;D=p+80|0;e=D+72|0;do c[D>>2]=0,D=D+4|0;while((D|0)<(e|0));D=p;E=x;e=D+80|0;do c[D>>2]=c[E>>2],D=D+4|0,E=E+4|0;while((D|0)<(e|0));I=l+144|0;f=l+64|0;L=l+136|0;K=l+56|0;J=l+128|0;H=l+48|0;G=l+120|0;F=l+40|0;M=l+112|0;N=l+32|0;O=l+104|0;P=l+24|0;Q=l+96|0;R=l+16|0;S=l+88|0;T=l+8|0;U=l+80|0;V=m+144|0;W=m+64|0;X=m+136|0;Y=m+56|0;Z=m+128|0;$=m+48|0;aa=m+120|0;ba=m+40|0;ca=m+112|0;da=m+32|0;ea=m+104|0;fa=m+24|0;ga=m+96|0;ha=m+16|0;ia=m+88|0;ja=m+8|0;ka=m+80|0;la=l+72|0;ma=m+72|0;na=j+8|0;oa=k+8|0;pa=j+16|0;qa=k+16|0;ra=j+24|0;sa=k+24|0;ta=j+32|0;ua=k+32|0;va=j+40|0;wa=k+40|0;xa=j+48|0;ya=k+48|0;za=j+56|0;Aa=k+56|0;Ba=j+64|0;Ca=k+64|0;Da=j+72|0;Ea=k+72|0;Fa=h+80|0;Ga=h+8|0;Ha=h+16|0;Ia=h+24|0;Ja=h+32|0;Ka=h+40|0;Oa=h+48|0;Pa=h+56|0;Qa=h+64|0;Ra=h+72|0;Sa=0;Ta=p;Ua=t;t=q;Va=u;u=r;Wa=v;v=s;s=w;while(1){w=a[B+(31-Sa)>>0]|0;Xa=0;Ya=Ta;Za=Ua;_a=t;$a=Va;gb=u;hb=Wa;ib=v;jb=s;while(1){kb=w&255;mb=bb(0,0,kb>>>7|0,0)|0;nb=C;ob=0;do pb=gb+(ob<<3)|0,qb=pb,rb=c[qb>>2]|0,sb=c[qb+4>>2]|0,qb=Ya+(ob<<3)|0,tb=qb,ub=c[tb>>2]|0,vb=c[tb+4>>2]|0,tb=(ub^rb)&mb,wb=(vb^sb)&nb,sb=ab(0,tb^rb|0,32)|0,rb=pb,c[rb>>2]=sb,c[rb+4>>2]=C,rb=ab(0,tb^ub|0,32)|0,ub=qb,c[ub>>2]=rb,c[ub+4>>2]=C,ob=ob+1|0;while((ob|0)!=10);xb=0;do ob=ib+(xb<<3)|0,ub=ob,rb=c[ub>>2]|0,qb=c[ub+4>>2]|0,ub=_a+(xb<<3)|0,tb=ub,sb=c[tb>>2]|0,pb=c[tb+4>>2]|0,tb=(sb^rb)&mb,vb=(pb^qb)&nb,qb=ab(0,tb^rb|0,32)|0,rb=ob,c[rb>>2]=qb,c[rb+4>>2]=C,rb=ab(0,tb^sb|0,32)|0,sb=ub,c[sb>>2]=rb,c[sb+4>>2]=C,xb=xb+1|0;while((xb|0)!=10);sb=gb;rb=c[sb>>2]|0;ub=c[sb+4>>2]|0;sb=gb+8|0;tb=sb;qb=c[tb>>2]|0;ob=c[tb+4>>2]|0;tb=gb+16|0;pb=tb;vb=c[pb>>2]|0;wb=c[pb+4>>2]|0;pb=gb+24|0;yb=pb;zb=c[yb>>2]|0;Ab=c[yb+4>>2]|0;yb=gb+32|0;Bb=yb;Cb=c[Bb>>2]|0;Db=c[Bb+4>>2]|0;Bb=gb+40|0;Eb=Bb;Fb=c[Eb>>2]|0;Gb=c[Eb+4>>2]|0;Eb=gb+48|0;Hb=Eb;Ib=c[Hb>>2]|0;Jb=c[Hb+4>>2]|0;Hb=gb+56|0;Kb=Hb;Lb=c[Kb>>2]|0;Mb=c[Kb+4>>2]|0;Kb=gb+64|0;Nb=Kb;Ob=c[Nb>>2]|0;Pb=c[Nb+4>>2]|0;Nb=gb+72|0;Qb=Nb;Rb=c[Qb>>2]|0;Sb=c[Qb+4>>2]|0;Qb=ib;Tb=c[Qb>>2]|0;Ub=c[Qb+4>>2]|0;Qb=cb(Tb|0,Ub|0,rb|0,ub|0)|0;Vb=gb;c[Vb>>2]=Qb;c[Vb+4>>2]=C;Vb=ib+8|0;Qb=Vb;Wb=c[Qb>>2]|0;Xb=c[Qb+4>>2]|0;Qb=cb(Wb|0,Xb|0,qb|0,ob|0)|0;Yb=sb;c[Yb>>2]=Qb;c[Yb+4>>2]=C;Yb=ib+16|0;Qb=Yb;sb=c[Qb>>2]|0;Zb=c[Qb+4>>2]|0;Qb=cb(sb|0,Zb|0,vb|0,wb|0)|0;_b=tb;c[_b>>2]=Qb;c[_b+4>>2]=C;_b=ib+24|0;Qb=_b;tb=c[Qb>>2]|0;$b=c[Qb+4>>2]|0;Qb=cb(tb|0,$b|0,zb|0,Ab|0)|0;ac=pb;c[ac>>2]=Qb;c[ac+4>>2]=C;ac=ib+32|0;Qb=ac;pb=c[Qb>>2]|0;bc=c[Qb+4>>2]|0;Qb=cb(pb|0,bc|0,Cb|0,Db|0)|0;cc=yb;c[cc>>2]=Qb;c[cc+4>>2]=C;cc=ib+40|0;Qb=cc;yb=c[Qb>>2]|0;dc=c[Qb+4>>2]|0;Qb=cb(yb|0,dc|0,Fb|0,Gb|0)|0;ec=Bb;c[ec>>2]=Qb;c[ec+4>>2]=C;ec=ib+48|0;Qb=ec;Bb=c[Qb>>2]|0;fc=c[Qb+4>>2]|0;Qb=cb(Bb|0,fc|0,Ib|0,Jb|0)|0;gc=Eb;c[gc>>2]=Qb;c[gc+4>>2]=C;gc=ib+56|0;Qb=gc;Eb=c[Qb>>2]|0;hc=c[Qb+4>>2]|0;Qb=cb(Eb|0,hc|0,Lb|0,Mb|0)|0;ic=Hb;c[ic>>2]=Qb;c[ic+4>>2]=C;ic=ib+64|0;Qb=ic;Hb=c[Qb>>2]|0;jc=c[Qb+4>>2]|0;Qb=cb(Hb|0,jc|0,Ob|0,Pb|0)|0;kc=Kb;c[kc>>2]=Qb;c[kc+4>>2]=C;kc=ib+72|0;Qb=kc;Kb=c[Qb>>2]|0;lc=c[Qb+4>>2]|0;Qb=cb(Kb|0,lc|0,Rb|0,Sb|0)|0;mc=Nb;c[mc>>2]=Qb;c[mc+4>>2]=C;mc=bb(rb|0,ub|0,Tb|0,Ub|0)|0;Ub=ib;c[Ub>>2]=mc;c[Ub+4>>2]=C;Ub=bb(qb|0,ob|0,Wb|0,Xb|0)|0;Xb=Vb;c[Xb>>2]=Ub;c[Xb+4>>2]=C;Xb=bb(vb|0,wb|0,sb|0,Zb|0)|0;Zb=Yb;c[Zb>>2]=Xb;c[Zb+4>>2]=C;Zb=bb(zb|0,Ab|0,tb|0,$b|0)|0;$b=_b;c[$b>>2]=Zb;c[$b+4>>2]=C;$b=bb(Cb|0,Db|0,pb|0,bc|0)|0;bc=ac;c[bc>>2]=$b;c[bc+4>>2]=C;bc=bb(Fb|0,Gb|0,yb|0,dc|0)|0;dc=cc;c[dc>>2]=bc;c[dc+4>>2]=C;dc=bb(Ib|0,Jb|0,Bb|0,fc|0)|0;fc=ec;c[fc>>2]=dc;c[fc+4>>2]=C;fc=bb(Lb|0,Mb|0,Eb|0,hc|0)|0;hc=gc;c[hc>>2]=fc;c[hc+4>>2]=C;hc=bb(Ob|0,Pb|0,Hb|0,jc|0)|0;jc=ic;c[jc>>2]=hc;c[jc+4>>2]=C;jc=bb(Rb|0,Sb|0,Kb|0,lc|0)|0;lc=kc;c[lc>>2]=jc;c[lc+4>>2]=C;lc=Ya;jc=c[lc>>2]|0;kc=c[lc+4>>2]|0;lc=Ya+8|0;Kb=lc;Sb=c[Kb>>2]|0;Rb=c[Kb+4>>2]|0;Kb=Ya+16|0;hc=Kb;ic=c[hc>>2]|0;Hb=c[hc+4>>2]|0;hc=Ya+24|0;Pb=hc;Ob=c[Pb>>2]|0;fc=c[Pb+4>>2]|0;Pb=Ya+32|0;gc=Pb;Eb=c[gc>>2]|0;Mb=c[gc+4>>2]|0;gc=Ya+40|0;Lb=gc;dc=c[Lb>>2]|0;ec=c[Lb+4>>2]|0;Lb=Ya+48|0;Bb=Lb;Jb=c[Bb>>2]|0;Ib=c[Bb+4>>2]|0;Bb=Ya+56|0;bc=Bb;cc=c[bc>>2]|0;yb=c[bc+4>>2]|0;bc=Ya+64|0;Gb=bc;Fb=c[Gb>>2]|0;$b=c[Gb+4>>2]|0;Gb=Ya+72|0;ac=Gb;pb=c[ac>>2]|0;Db=c[ac+4>>2]|0;ac=_a;Cb=c[ac>>2]|0;Zb=c[ac+4>>2]|0;ac=cb(Cb|0,Zb|0,jc|0,kc|0)|0;_b=Ya;c[_b>>2]=ac;c[_b+4>>2]=C;_b=_a+8|0;ac=_b;tb=c[ac>>2]|0;Ab=c[ac+4>>2]|0;ac=cb(tb|0,Ab|0,Sb|0,Rb|0)|0;zb=lc;c[zb>>2]=ac;c[zb+4>>2]=C;zb=_a+16|0;ac=zb;lc=c[ac>>2]|0;Xb=c[ac+4>>2]|0;ac=cb(lc|0,Xb|0,ic|0,Hb|0)|0;Yb=Kb;c[Yb>>2]=ac;c[Yb+4>>2]=C;Yb=_a+24|0;ac=Yb;Kb=c[ac>>2]|0;sb=c[ac+4>>2]|0;ac=cb(Kb|0,sb|0,Ob|0,fc|0)|0;wb=hc;c[wb>>2]=ac;c[wb+4>>2]=C;wb=_a+32|0;ac=wb;hc=c[ac>>2]|0;vb=c[ac+4>>2]|0;ac=cb(hc|0,vb|0,Eb|0,Mb|0)|0;Ub=Pb;c[Ub>>2]=ac;c[Ub+4>>2]=C;Ub=_a+40|0;ac=Ub;Pb=c[ac>>2]|0;Vb=c[ac+4>>2]|0;ac=cb(Pb|0,Vb|0,dc|0,ec|0)|0;Wb=gc;c[Wb>>2]=ac;c[Wb+4>>2]=C;Wb=_a+48|0;ac=Wb;gc=c[ac>>2]|0;ob=c[ac+4>>2]|0;ac=cb(gc|0,ob|0,Jb|0,Ib|0)|0;qb=Lb;c[qb>>2]=ac;c[qb+4>>2]=C;qb=_a+56|0;ac=qb;Lb=c[ac>>2]|0;mc=c[ac+4>>2]|0;ac=cb(Lb|0,mc|0,cc|0,yb|0)|0;Tb=Bb;c[Tb>>2]=ac;c[Tb+4>>2]=C;Tb=_a+64|0;ac=Tb;Bb=c[ac>>2]|0;ub=c[ac+4>>2]|0;ac=cb(Bb|0,ub|0,Fb|0,$b|0)|0;rb=bc;c[rb>>2]=ac;c[rb+4>>2]=C;rb=_a+72|0;ac=rb;bc=c[ac>>2]|0;Qb=c[ac+4>>2]|0;ac=cb(bc|0,Qb|0,pb|0,Db|0)|0;Nb=Gb;c[Nb>>2]=ac;c[Nb+4>>2]=C;Nb=bb(jc|0,kc|0,Cb|0,Zb|0)|0;Zb=_a;c[Zb>>2]=Nb;c[Zb+4>>2]=C;Zb=bb(Sb|0,Rb|0,tb|0,Ab|0)|0;Ab=_b;c[Ab>>2]=Zb;c[Ab+4>>2]=C;Ab=bb(ic|0,Hb|0,lc|0,Xb|0)|0;Xb=zb;c[Xb>>2]=Ab;c[Xb+4>>2]=C;Xb=bb(Ob|0,fc|0,Kb|0,sb|0)|0;sb=Yb;c[sb>>2]=Xb;c[sb+4>>2]=C;sb=bb(Eb|0,Mb|0,hc|0,vb|0)|0;vb=wb;c[vb>>2]=sb;c[vb+4>>2]=C;vb=bb(dc|0,ec|0,Pb|0,Vb|0)|0;Vb=Ub;c[Vb>>2]=vb;c[Vb+4>>2]=C;Vb=bb(Jb|0,Ib|0,gc|0,ob|0)|0;ob=Wb;c[ob>>2]=Vb;c[ob+4>>2]=C;ob=bb(cc|0,yb|0,Lb|0,mc|0)|0;mc=qb;c[mc>>2]=ob;c[mc+4>>2]=C;mc=bb(Fb|0,$b|0,Bb|0,ub|0)|0;ub=Tb;c[ub>>2]=mc;c[ub+4>>2]=C;ub=bb(pb|0,Db|0,bc|0,Qb|0)|0;Qb=rb;c[Qb>>2]=ub;c[Qb+4>>2]=C;Ma(l,Ya,ib);Ma(m,gb,_a);Qb=I;ub=c[Qb>>2]|0;rb=c[Qb+4>>2]|0;Qb=f;bc=c[Qb>>2]|0;Db=c[Qb+4>>2]|0;Qb=lb(ub|0,rb|0,18,0)|0;pb=C;mc=cb(bc|0,Db|0,ub|0,rb|0)|0;rb=cb(mc|0,C|0,Qb|0,pb|0)|0;pb=f;c[pb>>2]=rb;c[pb+4>>2]=C;pb=L;rb=c[pb>>2]|0;Qb=c[pb+4>>2]|0;pb=K;mc=c[pb>>2]|0;ub=c[pb+4>>2]|0;pb=lb(rb|0,Qb|0,18,0)|0;Db=C;bc=cb(mc|0,ub|0,rb|0,Qb|0)|0;Qb=cb(bc|0,C|0,pb|0,Db|0)|0;Db=K;c[Db>>2]=Qb;c[Db+4>>2]=C;Db=J;Qb=c[Db>>2]|0;pb=c[Db+4>>2]|0;Db=H;bc=c[Db>>2]|0;rb=c[Db+4>>2]|0;Db=lb(Qb|0,pb|0,18,0)|0;ub=C;mc=cb(bc|0,rb|0,Qb|0,pb|0)|0;pb=cb(mc|0,C|0,Db|0,ub|0)|0;ub=H;c[ub>>2]=pb;c[ub+4>>2]=C;ub=G;pb=c[ub>>2]|0;Db=c[ub+4>>2]|0;ub=F;mc=c[ub>>2]|0;Qb=c[ub+4>>2]|0;ub=lb(pb|0,Db|0,18,0)|0;rb=C;bc=cb(mc|0,Qb|0,pb|0,Db|0)|0;Db=cb(bc|0,C|0,ub|0,rb|0)|0;rb=F;c[rb>>2]=Db;c[rb+4>>2]=C;rb=M;Db=c[rb>>2]|0;ub=c[rb+4>>2]|0;rb=N;bc=c[rb>>2]|0;pb=c[rb+4>>2]|0;rb=lb(Db|0,ub|0,18,0)|0;Qb=C;mc=cb(bc|0,pb|0,Db|0,ub|0)|0;ub=cb(mc|0,C|0,rb|0,Qb|0)|0;Qb=N;c[Qb>>2]=ub;c[Qb+4>>2]=C;Qb=O;ub=c[Qb>>2]|0;rb=c[Qb+4>>2]|0;Qb=P;mc=c[Qb>>2]|0;Db=c[Qb+4>>2]|0;Qb=lb(ub|0,rb|0,18,0)|0;pb=C;bc=cb(mc|0,Db|0,ub|0,rb|0)|0;rb=cb(bc|0,C|0,Qb|0,pb|0)|0;pb=P;c[pb>>2]=rb;c[pb+4>>2]=C;pb=Q;rb=c[pb>>2]|0;Qb=c[pb+4>>2]|0;pb=R;bc=c[pb>>2]|0;ub=c[pb+4>>2]|0;pb=lb(rb|0,Qb|0,18,0)|0;Db=C;mc=cb(bc|0,ub|0,rb|0,Qb|0)|0;Qb=cb(mc|0,C|0,pb|0,Db|0)|0;Db=R;c[Db>>2]=Qb;c[Db+4>>2]=C;Db=S;Qb=c[Db>>2]|0;pb=c[Db+4>>2]|0;Db=T;mc=c[Db>>2]|0;rb=c[Db+4>>2]|0;Db=lb(Qb|0,pb|0,18,0)|0;ub=C;bc=cb(mc|0,rb|0,Qb|0,pb|0)|0;pb=cb(bc|0,C|0,Db|0,ub|0)|0;ub=T;c[ub>>2]=pb;c[ub+4>>2]=C;ub=U;pb=c[ub>>2]|0;Db=c[ub+4>>2]|0;ub=l;bc=c[ub>>2]|0;Qb=c[ub+4>>2]|0;ub=lb(pb|0,Db|0,18,0)|0;rb=C;mc=cb(bc|0,Qb|0,pb|0,Db|0)|0;Db=cb(mc|0,C|0,ub|0,rb|0)|0;rb=C;ub=l;c[ub>>2]=Db;c[ub+4>>2]=rb;ub=U;c[ub>>2]=0;c[ub+4>>2]=0;ub=rb;rb=Db;Db=0;do mc=cb(ub>>31>>>6|0,0,rb|0,ub|0)|0,pb=ab(mc|0,C|0,26)|0,mc=C,Qb=fb(pb|0,mc|0,26)|0,bc=bb(rb|0,ub|0,Qb|0,C|0)|0,Qb=l+(Db<<3)|0,c[Qb>>2]=bc,c[Qb+4>>2]=C,Qb=l+((Db|1)<<3)|0,bc=Qb,Tb=cb(pb|0,mc|0,c[bc>>2]|0,c[bc+4>>2]|0)|0,bc=C,mc=cb(bc>>31>>>7|0,0,Tb|0,bc|0)|0,pb=ab(mc|0,C|0,25)|0,mc=C,Bb=fb(pb|0,mc|0,25)|0,$b=bb(Tb|0,bc|0,Bb|0,C|0)|0,Bb=Qb,c[Bb>>2]=$b,c[Bb+4>>2]=C,Db=Db+2|0,Bb=l+(Db<<3)|0,$b=Bb,rb=cb(pb|0,mc|0,c[$b>>2]|0,c[$b+4>>2]|0)|0,ub=C,$b=Bb,c[$b>>2]=rb,c[$b+4>>2]=ub;while(Db>>>0<10);Db=U;ub=c[Db>>2]|0;rb=c[Db+4>>2]|0;Db=l;$b=c[Db>>2]|0;Bb=c[Db+4>>2]|0;Db=lb(ub|0,rb|0,18,0)|0;mc=C;pb=cb($b|0,Bb|0,ub|0,rb|0)|0;rb=cb(pb|0,C|0,Db|0,mc|0)|0;mc=C;Db=U;c[Db>>2]=0;c[Db+4>>2]=0;Db=cb(mc>>31>>>6|0,0,rb|0,mc|0)|0;pb=ab(Db|0,C|0,26)|0;Db=C;ub=fb(pb|0,Db|0,26)|0;Bb=bb(rb|0,mc|0,ub|0,C|0)|0;ub=C;mc=l;c[mc>>2]=Bb;c[mc+4>>2]=ub;mc=T;rb=cb(pb|0,Db|0,c[mc>>2]|0,c[mc+4>>2]|0)|0;mc=C;Db=T;c[Db>>2]=rb;c[Db+4>>2]=mc;Db=V;pb=c[Db>>2]|0;$b=c[Db+4>>2]|0;Db=W;Qb=c[Db>>2]|0;bc=c[Db+4>>2]|0;Db=lb(pb|0,$b|0,18,0)|0;Tb=C;Fb=cb(Qb|0,bc|0,pb|0,$b|0)|0;$b=cb(Fb|0,C|0,Db|0,Tb|0)|0;Tb=W;c[Tb>>2]=$b;c[Tb+4>>2]=C;Tb=X;$b=c[Tb>>2]|0;Db=c[Tb+4>>2]|0;Tb=Y;Fb=c[Tb>>2]|0;pb=c[Tb+4>>2]|0;Tb=lb($b|0,Db|0,18,0)|0;bc=C;Qb=cb(Fb|0,pb|0,$b|0,Db|0)|0;Db=cb(Qb|0,C|0,Tb|0,bc|0)|0;bc=Y;c[bc>>2]=Db;c[bc+4>>2]=C;bc=Z;Db=c[bc>>2]|0;Tb=c[bc+4>>2]|0;bc=$;Qb=c[bc>>2]|0;$b=c[bc+4>>2]|0;bc=lb(Db|0,Tb|0,18,0)|0;pb=C;Fb=cb(Qb|0,$b|0,Db|0,Tb|0)|0;Tb=cb(Fb|0,C|0,bc|0,pb|0)|0;pb=$;c[pb>>2]=Tb;c[pb+4>>2]=C;pb=aa;Tb=c[pb>>2]|0;bc=c[pb+4>>2]|0;pb=ba;Fb=c[pb>>2]|0;Db=c[pb+4>>2]|0;pb=lb(Tb|0,bc|0,18,0)|0;$b=C;Qb=cb(Fb|0,Db|0,Tb|0,bc|0)|0;bc=cb(Qb|0,C|0,pb|0,$b|0)|0;$b=ba;c[$b>>2]=bc;c[$b+4>>2]=C;$b=ca;bc=c[$b>>2]|0;pb=c[$b+4>>2]|0;$b=da;Qb=c[$b>>2]|0;Tb=c[$b+4>>2]|0;$b=lb(bc|0,pb|0,18,0)|0;Db=C;Fb=cb(Qb|0,Tb|0,bc|0,pb|0)|0;pb=cb(Fb|0,C|0,$b|0,Db|0)|0;Db=da;c[Db>>2]=pb;c[Db+4>>2]=C;Db=ea;pb=c[Db>>2]|0;$b=c[Db+4>>2]|0;Db=fa;Fb=c[Db>>2]|0;bc=c[Db+4>>2]|0;Db=lb(pb|0,$b|0,18,0)|0;Tb=C;Qb=cb(Fb|0,bc|0,pb|0,$b|0)|0;$b=cb(Qb|0,C|0,Db|0,Tb|0)|0;Tb=fa;c[Tb>>2]=$b;c[Tb+4>>2]=C;Tb=ga;$b=c[Tb>>2]|0;Db=c[Tb+4>>2]|0;Tb=ha;Qb=c[Tb>>2]|0;pb=c[Tb+4>>2]|0;Tb=lb($b|0,Db|0,18,0)|0;bc=C;Fb=cb(Qb|0,pb|0,$b|0,Db|0)|0;Db=cb(Fb|0,C|0,Tb|0,bc|0)|0;bc=ha;c[bc>>2]=Db;c[bc+4>>2]=C;bc=ia;Db=c[bc>>2]|0;Tb=c[bc+4>>2]|0;bc=ja;Fb=c[bc>>2]|0;$b=c[bc+4>>2]|0;bc=lb(Db|0,Tb|0,18,0)|0;pb=C;Qb=cb(Fb|0,$b|0,Db|0,Tb|0)|0;Tb=cb(Qb|0,C|0,bc|0,pb|0)|0;pb=ja;c[pb>>2]=Tb;c[pb+4>>2]=C;pb=ka;Tb=c[pb>>2]|0;bc=c[pb+4>>2]|0;pb=m;Qb=c[pb>>2]|0;Db=c[pb+4>>2]|0;pb=lb(Tb|0,bc|0,18,0)|0;$b=C;Fb=cb(Qb|0,Db|0,Tb|0,bc|0)|0;bc=cb(Fb|0,C|0,pb|0,$b|0)|0;$b=C;pb=m;c[pb>>2]=bc;c[pb+4>>2]=$b;pb=ka;c[pb>>2]=0;c[pb+4>>2]=0;pb=$b;$b=bc;bc=0;do Fb=cb(pb>>31>>>6|0,0,$b|0,pb|0)|0,Tb=ab(Fb|0,C|0,26)|0,Fb=C,Db=fb(Tb|0,Fb|0,26)|0,Qb=bb($b|0,pb|0,Db|0,C|0)|0,Db=m+(bc<<3)|0,c[Db>>2]=Qb,c[Db+4>>2]=C,Db=m+((bc|1)<<3)|0,Qb=Db,ob=cb(Tb|0,Fb|0,c[Qb>>2]|0,c[Qb+4>>2]|0)|0,Qb=C,Fb=cb(Qb>>31>>>7|0,0,ob|0,Qb|0)|0,Tb=ab(Fb|0,C|0,25)|0,Fb=C,qb=fb(Tb|0,Fb|0,25)|0,Lb=bb(ob|0,Qb|0,qb|0,C|0)|0,qb=Db,c[qb>>2]=Lb,c[qb+4>>2]=C,bc=bc+2|0,qb=m+(bc<<3)|0,Lb=qb,$b=cb(Tb|0,Fb|0,c[Lb>>2]|0,c[Lb+4>>2]|0)|0,pb=C,Lb=qb,c[Lb>>2]=$b,c[Lb+4>>2]=pb;while(bc>>>0<10);bc=ka;pb=c[bc>>2]|0;$b=c[bc+4>>2]|0;bc=m;Lb=c[bc>>2]|0;qb=c[bc+4>>2]|0;bc=lb(pb|0,$b|0,18,0)|0;Fb=C;Tb=cb(Lb|0,qb|0,pb|0,$b|0)|0;$b=cb(Tb|0,C|0,bc|0,Fb|0)|0;Fb=C;bc=ka;c[bc>>2]=0;c[bc+4>>2]=0;bc=cb(Fb>>31>>>6|0,0,$b|0,Fb|0)|0;Tb=ab(bc|0,C|0,26)|0;bc=C;pb=fb(Tb|0,bc|0,26)|0;qb=bb($b|0,Fb|0,pb|0,C|0)|0;pb=C;Fb=ja;$b=cb(Tb|0,bc|0,c[Fb>>2]|0,c[Fb+4>>2]|0)|0;Fb=C;bc=R;Tb=c[bc>>2]|0;Lb=c[bc+4>>2]|0;bc=P;Db=c[bc>>2]|0;Qb=c[bc+4>>2]|0;bc=N;ob=c[bc>>2]|0;yb=c[bc+4>>2]|0;bc=F;cc=c[bc>>2]|0;Vb=c[bc+4>>2]|0;bc=H;Wb=c[bc>>2]|0;gc=c[bc+4>>2]|0;bc=K;Ib=c[bc>>2]|0;Jb=c[bc+4>>2]|0;bc=f;vb=c[bc>>2]|0;Ub=c[bc+4>>2]|0;bc=la;Pb=c[bc>>2]|0;ec=c[bc+4>>2]|0;bc=cb(qb|0,pb|0,Bb|0,ub|0)|0;dc=l;c[dc>>2]=bc;c[dc+4>>2]=C;dc=cb($b|0,Fb|0,rb|0,mc|0)|0;bc=T;c[bc>>2]=dc;c[bc+4>>2]=C;bc=ha;dc=c[bc>>2]|0;sb=c[bc+4>>2]|0;bc=cb(dc|0,sb|0,Tb|0,Lb|0)|0;wb=R;c[wb>>2]=bc;c[wb+4>>2]=C;wb=fa;bc=c[wb>>2]|0;hc=c[wb+4>>2]|0;wb=cb(bc|0,hc|0,Db|0,Qb|0)|0;Mb=P;c[Mb>>2]=wb;c[Mb+4>>2]=C;Mb=da;wb=c[Mb>>2]|0;Eb=c[Mb+4>>2]|0;Mb=cb(wb|0,Eb|0,ob|0,yb|0)|0;Xb=N;c[Xb>>2]=Mb;c[Xb+4>>2]=C;Xb=ba;Mb=c[Xb>>2]|0;Yb=c[Xb+4>>2]|0;Xb=cb(Mb|0,Yb|0,cc|0,Vb|0)|0;Kb=F;c[Kb>>2]=Xb;c[Kb+4>>2]=C;Kb=$;Xb=c[Kb>>2]|0;fc=c[Kb+4>>2]|0;Kb=cb(Xb|0,fc|0,Wb|0,gc|0)|0;Ob=H;c[Ob>>2]=Kb;c[Ob+4>>2]=C;Ob=Y;Kb=c[Ob>>2]|0;Ab=c[Ob+4>>2]|0;Ob=cb(Kb|0,Ab|0,Ib|0,Jb|0)|0;zb=K;c[zb>>2]=Ob;c[zb+4>>2]=C;zb=W;Ob=c[zb>>2]|0;lc=c[zb+4>>2]|0;zb=cb(Ob|0,lc|0,vb|0,Ub|0)|0;Hb=f;c[Hb>>2]=zb;c[Hb+4>>2]=C;Hb=ma;zb=c[Hb>>2]|0;ic=c[Hb+4>>2]|0;Hb=cb(zb|0,ic|0,Pb|0,ec|0)|0;Zb=la;c[Zb>>2]=Hb;c[Zb+4>>2]=C;Zb=bb(Bb|0,ub|0,qb|0,pb|0)|0;pb=m;c[pb>>2]=Zb;c[pb+4>>2]=C;pb=bb(rb|0,mc|0,$b|0,Fb|0)|0;Fb=ja;c[Fb>>2]=pb;c[Fb+4>>2]=C;Fb=bb(Tb|0,Lb|0,dc|0,sb|0)|0;sb=ha;c[sb>>2]=Fb;c[sb+4>>2]=C;sb=bb(Db|0,Qb|0,bc|0,hc|0)|0;hc=fa;c[hc>>2]=sb;c[hc+4>>2]=C;hc=bb(ob|0,yb|0,wb|0,Eb|0)|0;Eb=da;c[Eb>>2]=hc;c[Eb+4>>2]=C;Eb=bb(cc|0,Vb|0,Mb|0,Yb|0)|0;Yb=ba;c[Yb>>2]=Eb;c[Yb+4>>2]=C;Yb=bb(Wb|0,gc|0,Xb|0,fc|0)|0;fc=$;c[fc>>2]=Yb;c[fc+4>>2]=C;fc=bb(Ib|0,Jb|0,Kb|0,Ab|0)|0;Ab=Y;c[Ab>>2]=fc;c[Ab+4>>2]=C;Ab=bb(vb|0,Ub|0,Ob|0,lc|0)|0;lc=W;c[lc>>2]=Ab;c[lc+4>>2]=C;lc=bb(Pb|0,ec|0,zb|0,ic|0)|0;ic=ma;c[ic>>2]=lc;c[ic+4>>2]=C;Na(o,l);Na(n,m);Ma(m,n,x);ic=V;lc=c[ic>>2]|0;zb=c[ic+4>>2]|0;ic=W;ec=c[ic>>2]|0;Pb=c[ic+4>>2]|0;ic=lb(lc|0,zb|0,18,0)|0;Ab=C;Ob=cb(ec|0,Pb|0,lc|0,zb|0)|0;zb=cb(Ob|0,C|0,ic|0,Ab|0)|0;Ab=W;c[Ab>>2]=zb;c[Ab+4>>2]=C;Ab=X;zb=c[Ab>>2]|0;ic=c[Ab+4>>2]|0;Ab=Y;Ob=c[Ab>>2]|0;lc=c[Ab+4>>2]|0;Ab=lb(zb|0,ic|0,18,0)|0;Pb=C;ec=cb(Ob|0,lc|0,zb|0,ic|0)|0;ic=cb(ec|0,C|0,Ab|0,Pb|0)|0;Pb=Y;c[Pb>>2]=ic;c[Pb+4>>2]=C;Pb=Z;ic=c[Pb>>2]|0;Ab=c[Pb+4>>2]|0;Pb=$;ec=c[Pb>>2]|0;zb=c[Pb+4>>2]|0;Pb=lb(ic|0,Ab|0,18,0)|0;lc=C;Ob=cb(ec|0,zb|0,ic|0,Ab|0)|0;Ab=cb(Ob|0,C|0,Pb|0,lc|0)|0;lc=$;c[lc>>2]=Ab;c[lc+4>>2]=C;lc=aa;Ab=c[lc>>2]|0;Pb=c[lc+4>>2]|0;lc=ba;Ob=c[lc>>2]|0;ic=c[lc+4>>2]|0;lc=lb(Ab|0,Pb|0,18,0)|0;zb=C;ec=cb(Ob|0,ic|0,Ab|0,Pb|0)|0;Pb=cb(ec|0,C|0,lc|0,zb|0)|0;zb=ba;c[zb>>2]=Pb;c[zb+4>>2]=C;zb=ca;Pb=c[zb>>2]|0;lc=c[zb+4>>2]|0;zb=da;ec=c[zb>>2]|0;Ab=c[zb+4>>2]|0;zb=lb(Pb|0,lc|0,18,0)|0;ic=C;Ob=cb(ec|0,Ab|0,Pb|0,lc|0)|0;lc=cb(Ob|0,C|0,zb|0,ic|0)|0;ic=da;c[ic>>2]=lc;c[ic+4>>2]=C;ic=ea;lc=c[ic>>2]|0;zb=c[ic+4>>2]|0;ic=fa;Ob=c[ic>>2]|0;Pb=c[ic+4>>2]|0;ic=lb(lc|0,zb|0,18,0)|0;Ab=C;ec=cb(Ob|0,Pb|0,lc|0,zb|0)|0;zb=cb(ec|0,C|0,ic|0,Ab|0)|0;Ab=fa;c[Ab>>2]=zb;c[Ab+4>>2]=C;Ab=ga;zb=c[Ab>>2]|0;ic=c[Ab+4>>2]|0;Ab=ha;ec=c[Ab>>2]|0;lc=c[Ab+4>>2]|0;Ab=lb(zb|0,ic|0,18,0)|0;Pb=C;Ob=cb(ec|0,lc|0,zb|0,ic|0)|0;ic=cb(Ob|0,C|0,Ab|0,Pb|0)|0;Pb=ha;c[Pb>>2]=ic;c[Pb+4>>2]=C;Pb=ia;ic=c[Pb>>2]|0;Ab=c[Pb+4>>2]|0;Pb=ja;Ob=c[Pb>>2]|0;zb=c[Pb+4>>2]|0;Pb=lb(ic|0,Ab|0,18,0)|0;lc=C;ec=cb(Ob|0,zb|0,ic|0,Ab|0)|0;Ab=cb(ec|0,C|0,Pb|0,lc|0)|0;lc=ja;c[lc>>2]=Ab;c[lc+4>>2]=C;lc=ka;Ab=c[lc>>2]|0;Pb=c[lc+4>>2]|0;lc=m;ec=c[lc>>2]|0;ic=c[lc+4>>2]|0;lc=lb(Ab|0,Pb|0,18,0)|0;zb=C;Ob=cb(ec|0,ic|0,Ab|0,Pb|0)|0;Pb=cb(Ob|0,C|0,lc|0,zb|0)|0;zb=C;lc=m;c[lc>>2]=Pb;c[lc+4>>2]=zb;lc=ka;c[lc>>2]=0;c[lc+4>>2]=0;lc=zb;zb=Pb;Pb=0;do Ob=cb(lc>>31>>>6|0,0,zb|0,lc|0)|0,Ab=ab(Ob|0,C|0,26)|0,Ob=C,ic=fb(Ab|0,Ob|0,26)|0,ec=bb(zb|0,lc|0,ic|0,C|0)|0,ic=m+(Pb<<3)|0,c[ic>>2]=ec,c[ic+4>>2]=C,ic=m+((Pb|1)<<3)|0,ec=ic,Ub=cb(Ab|0,Ob|0,c[ec>>2]|0,c[ec+4>>2]|0)|0,ec=C,Ob=cb(ec>>31>>>7|0,0,Ub|0,ec|0)|0,Ab=ab(Ob|0,C|0,25)|0,Ob=C,vb=fb(Ab|0,Ob|0,25)|0,fc=bb(Ub|0,ec|0,vb|0,C|0)|0,vb=ic,c[vb>>2]=fc,c[vb+4>>2]=C,Pb=Pb+2|0,vb=m+(Pb<<3)|0,fc=vb,zb=cb(Ab|0,Ob|0,c[fc>>2]|0,c[fc+4>>2]|0)|0,lc=C,fc=vb,c[fc>>2]=zb,c[fc+4>>2]=lc;while(Pb>>>0<10);Pb=ka;lc=c[Pb>>2]|0;zb=c[Pb+4>>2]|0;Pb=m;mc=c[Pb>>2]|0;rb=c[Pb+4>>2]|0;Pb=lb(lc|0,zb|0,18,0)|0;ub=C;Bb=cb(mc|0,rb|0,lc|0,zb|0)|0;zb=cb(Bb|0,C|0,Pb|0,ub|0)|0;ub=C;Pb=ka;c[Pb>>2]=0;c[Pb+4>>2]=0;Pb=cb(ub>>31>>>6|0,0,zb|0,ub|0)|0;Bb=ab(Pb|0,C|0,26)|0;Pb=C;lc=fb(Bb|0,Pb|0,26)|0;rb=bb(zb|0,ub|0,lc|0,C|0)|0;lc=m;c[lc>>2]=rb;c[lc+4>>2]=C;lc=ja;rb=cb(Bb|0,Pb|0,c[lc>>2]|0,c[lc+4>>2]|0)|0;lc=ja;c[lc>>2]=rb;c[lc+4>>2]=C;D=Za;E=o;e=D+80|0;do c[D>>2]=c[E>>2],D=D+4|0,E=E+4|0;while((D|0)<(e|0));D=$a;E=m;e=D+80|0;do c[D>>2]=c[E>>2],D=D+4|0,E=E+4|0;while((D|0)<(e|0));Na(j,gb);Na(k,ib);Ma(hb,j,k);lc=hb+144|0;rb=c[lc>>2]|0;Pb=c[lc+4>>2]|0;lc=hb+64|0;Bb=lc;ub=c[Bb>>2]|0;zb=c[Bb+4>>2]|0;Bb=lb(rb|0,Pb|0,18,0)|0;mc=C;fc=cb(ub|0,zb|0,rb|0,Pb|0)|0;Pb=cb(fc|0,C|0,Bb|0,mc|0)|0;mc=lc;c[mc>>2]=Pb;c[mc+4>>2]=C;mc=hb+136|0;Pb=c[mc>>2]|0;lc=c[mc+4>>2]|0;mc=hb+56|0;Bb=mc;fc=c[Bb>>2]|0;rb=c[Bb+4>>2]|0;Bb=lb(Pb|0,lc|0,18,0)|0;zb=C;ub=cb(fc|0,rb|0,Pb|0,lc|0)|0;lc=cb(ub|0,C|0,Bb|0,zb|0)|0;zb=mc;c[zb>>2]=lc;c[zb+4>>2]=C;zb=hb+128|0;lc=c[zb>>2]|0;mc=c[zb+4>>2]|0;zb=hb+48|0;Bb=zb;ub=c[Bb>>2]|0;Pb=c[Bb+4>>2]|0;Bb=lb(lc|0,mc|0,18,0)|0;rb=C;fc=cb(ub|0,Pb|0,lc|0,mc|0)|0;mc=cb(fc|0,C|0,Bb|0,rb|0)|0;rb=zb;c[rb>>2]=mc;c[rb+4>>2]=C;rb=hb+120|0;mc=c[rb>>2]|0;zb=c[rb+4>>2]|0;rb=hb+40|0;Bb=rb;fc=c[Bb>>2]|0;lc=c[Bb+4>>2]|0;Bb=lb(mc|0,zb|0,18,0)|0;Pb=C;ub=cb(fc|0,lc|0,mc|0,zb|0)|0;zb=cb(ub|0,C|0,Bb|0,Pb|0)|0;Pb=rb;c[Pb>>2]=zb;c[Pb+4>>2]=C;Pb=hb+112|0;zb=c[Pb>>2]|0;rb=c[Pb+4>>2]|0;Pb=hb+32|0;Bb=Pb;ub=c[Bb>>2]|0;mc=c[Bb+4>>2]|0;Bb=lb(zb|0,rb|0,18,0)|0;lc=C;fc=cb(ub|0,mc|0,zb|0,rb|0)|0;rb=cb(fc|0,C|0,Bb|0,lc|0)|0;lc=Pb;c[lc>>2]=rb;c[lc+4>>2]=C;lc=hb+104|0;rb=c[lc>>2]|0;Pb=c[lc+4>>2]|0;lc=hb+24|0;Bb=lc;fc=c[Bb>>2]|0;zb=c[Bb+4>>2]|0;Bb=lb(rb|0,Pb|0,18,0)|0;mc=C;ub=cb(fc|0,zb|0,rb|0,Pb|0)|0;Pb=cb(ub|0,C|0,Bb|0,mc|0)|0;mc=lc;c[mc>>2]=Pb;c[mc+4>>2]=C;mc=hb+96|0;Pb=c[mc>>2]|0;lc=c[mc+4>>2]|0;mc=hb+16|0;Bb=mc;ub=c[Bb>>2]|0;rb=c[Bb+4>>2]|0;Bb=lb(Pb|0,lc|0,18,0)|0;zb=C;fc=cb(ub|0,rb|0,Pb|0,lc|0)|0;lc=cb(fc|0,C|0,Bb|0,zb|0)|0;zb=mc;c[zb>>2]=lc;c[zb+4>>2]=C;zb=hb+88|0;lc=c[zb>>2]|0;mc=c[zb+4>>2]|0;zb=hb+8|0;Bb=zb;fc=c[Bb>>2]|0;Pb=c[Bb+4>>2]|0;Bb=lb(lc|0,mc|0,18,0)|0;rb=C;ub=cb(fc|0,Pb|0,lc|0,mc|0)|0;mc=cb(ub|0,C|0,Bb|0,rb|0)|0;rb=zb;c[rb>>2]=mc;c[rb+4>>2]=C;rb=hb+80|0;mc=rb;Bb=c[mc>>2]|0;ub=c[mc+4>>2]|0;mc=hb;lc=c[mc>>2]|0;Pb=c[mc+4>>2]|0;mc=lb(Bb|0,ub|0,18,0)|0;fc=C;vb=cb(lc|0,Pb|0,Bb|0,ub|0)|0;ub=cb(vb|0,C|0,mc|0,fc|0)|0;fc=C;mc=hb;c[mc>>2]=ub;c[mc+4>>2]=fc;mc=rb;c[mc>>2]=0;c[mc+4>>2]=0;mc=fc;fc=ub;ub=0;do vb=cb(mc>>31>>>6|0,0,fc|0,mc|0)|0,Bb=ab(vb|0,C|0,26)|0,vb=C,Pb=fb(Bb|0,vb|0,26)|0,lc=bb(fc|0,mc|0,Pb|0,C|0)|0,Pb=hb+(ub<<3)|0,c[Pb>>2]=lc,c[Pb+4>>2]=C,Pb=hb+((ub|1)<<3)|0,lc=Pb,Ob=cb(Bb|0,vb|0,c[lc>>2]|0,c[lc+4>>2]|0)|0,lc=C,vb=cb(lc>>31>>>7|0,0,Ob|0,lc|0)|0,Bb=ab(vb|0,C|0,25)|0,vb=C,Ab=fb(Bb|0,vb|0,25)|0,ic=bb(Ob|0,lc|0,Ab|0,C|0)|0,Ab=Pb,c[Ab>>2]=ic,c[Ab+4>>2]=C,ub=ub+2|0,Ab=hb+(ub<<3)|0,ic=Ab,fc=cb(Bb|0,vb|0,c[ic>>2]|0,c[ic+4>>2]|0)|0,mc=C,ic=Ab,c[ic>>2]=fc,c[ic+4>>2]=mc;while(ub>>>0<10);ub=rb;mc=c[ub>>2]|0;fc=c[ub+4>>2]|0;ub=hb;ic=c[ub>>2]|0;Ab=c[ub+4>>2]|0;ub=lb(mc|0,fc|0,18,0)|0;vb=C;Bb=cb(ic|0,Ab|0,mc|0,fc|0)|0;fc=cb(Bb|0,C|0,ub|0,vb|0)|0;vb=C;ub=rb;c[ub>>2]=0;c[ub+4>>2]=0;ub=cb(vb>>31>>>6|0,0,fc|0,vb|0)|0;Bb=ab(ub|0,C|0,26)|0;ub=C;mc=fb(Bb|0,ub|0,26)|0;Ab=bb(fc|0,vb|0,mc|0,C|0)|0;mc=hb;c[mc>>2]=Ab;c[mc+4>>2]=C;mc=zb;Ab=cb(Bb|0,ub|0,c[mc>>2]|0,c[mc+4>>2]|0)|0;mc=zb;c[mc>>2]=Ab;c[mc+4>>2]=C;mc=j;Ab=c[mc>>2]|0;ub=c[mc+4>>2]|0;mc=k;Bb=bb(Ab|0,ub|0,c[mc>>2]|0,c[mc+4>>2]|0)|0;mc=C;vb=k;c[vb>>2]=Bb;c[vb+4>>2]=mc;vb=na;fc=c[vb>>2]|0;ic=c[vb+4>>2]|0;vb=oa;Pb=bb(fc|0,ic|0,c[vb>>2]|0,c[vb+4>>2]|0)|0;vb=C;lc=oa;c[lc>>2]=Pb;c[lc+4>>2]=vb;lc=pa;Ob=c[lc>>2]|0;ec=c[lc+4>>2]|0;lc=qa;Ub=bb(Ob|0,ec|0,c[lc>>2]|0,c[lc+4>>2]|0)|0;lc=C;Kb=qa;c[Kb>>2]=Ub;c[Kb+4>>2]=lc;Kb=ra;Jb=c[Kb>>2]|0;Ib=c[Kb+4>>2]|0;Kb=sa;Yb=bb(Jb|0,Ib|0,c[Kb>>2]|0,c[Kb+4>>2]|0)|0;Kb=C;Xb=sa;c[Xb>>2]=Yb;c[Xb+4>>2]=Kb;Xb=ta;gc=c[Xb>>2]|0;Wb=c[Xb+4>>2]|0;Xb=ua;Eb=bb(gc|0,Wb|0,c[Xb>>2]|0,c[Xb+4>>2]|0)|0;Xb=C;Mb=ua;c[Mb>>2]=Eb;c[Mb+4>>2]=Xb;Mb=va;Vb=c[Mb>>2]|0;cc=c[Mb+4>>2]|0;Mb=wa;hc=bb(Vb|0,cc|0,c[Mb>>2]|0,c[Mb+4>>2]|0)|0;Mb=C;wb=wa;c[wb>>2]=hc;c[wb+4>>2]=Mb;wb=xa;yb=c[wb>>2]|0;ob=c[wb+4>>2]|0;wb=ya;sb=bb(yb|0,ob|0,c[wb>>2]|0,c[wb+4>>2]|0)|0;wb=C;bc=ya;c[bc>>2]=sb;c[bc+4>>2]=wb;bc=za;Qb=c[bc>>2]|0;Db=c[bc+4>>2]|0;bc=Aa;Fb=bb(Qb|0,Db|0,c[bc>>2]|0,c[bc+4>>2]|0)|0;bc=C;dc=Aa;c[dc>>2]=Fb;c[dc+4>>2]=bc;dc=Ba;Lb=c[dc>>2]|0;Tb=c[dc+4>>2]|0;dc=Ca;pb=bb(Lb|0,Tb|0,c[dc>>2]|0,c[dc+4>>2]|0)|0;dc=C;$b=Ca;c[$b>>2]=pb;c[$b+4>>2]=dc;$b=Da;Zb=c[$b>>2]|0;qb=c[$b+4>>2]|0;$b=Ea;Hb=bb(Zb|0,qb|0,c[$b>>2]|0,c[$b+4>>2]|0)|0;$b=C;_b=Ea;c[_b>>2]=Hb;c[_b+4>>2]=$b;D=Fa;e=D+72|0;do c[D>>2]=0,D=D+4|0;while((D|0)<(e|0));zb=lb(Bb|0,mc|0,121665,0)|0;rb=C;_b=h;c[_b>>2]=zb;c[_b+4>>2]=rb;_b=lb(Pb|0,vb|0,121665,0)|0;tb=Ga;c[tb>>2]=_b;c[tb+4>>2]=C;tb=lb(Ub|0,lc|0,121665,0)|0;_b=Ha;c[_b>>2]=tb;c[_b+4>>2]=C;_b=lb(Yb|0,Kb|0,121665,0)|0;tb=Ia;c[tb>>2]=_b;c[tb+4>>2]=C;tb=lb(Eb|0,Xb|0,121665,0)|0;_b=Ja;c[_b>>2]=tb;c[_b+4>>2]=C;_b=lb(hc|0,Mb|0,121665,0)|0;tb=Ka;c[tb>>2]=_b;c[tb+4>>2]=C;tb=lb(sb|0,wb|0,121665,0)|0;_b=Oa;c[_b>>2]=tb;c[_b+4>>2]=C;_b=lb(Fb|0,bc|0,121665,0)|0;tb=Pa;c[tb>>2]=_b;c[tb+4>>2]=C;tb=lb(pb|0,dc|0,121665,0)|0;_b=Qa;c[_b>>2]=tb;c[_b+4>>2]=C;_b=lb(Hb|0,$b|0,121665,0)|0;tb=Ra;c[tb>>2]=_b;c[tb+4>>2]=C;tb=Fa;c[tb>>2]=0;c[tb+4>>2]=0;tb=rb;rb=zb;zb=0;do _b=cb(tb>>31>>>6|0,0,rb|0,tb|0)|0,Rb=ab(_b|0,C|0,26)|0,_b=C,Sb=fb(Rb|0,_b|0,26)|0,Nb=bb(rb|0,tb|0,Sb|0,C|0)|0,Sb=h+(zb<<3)|0,c[Sb>>2]=Nb,c[Sb+4>>2]=C,Sb=h+((zb|1)<<3)|0,Nb=Sb,Cb=cb(Rb|0,_b|0,c[Nb>>2]|0,c[Nb+4>>2]|0)|0,Nb=C,_b=cb(Nb>>31>>>7|0,0,Cb|0,Nb|0)|0,Rb=ab(_b|0,C|0,25)|0,_b=C,kc=fb(Rb|0,_b|0,25)|0,jc=bb(Cb|0,Nb|0,kc|0,C|0)|0,kc=Sb,c[kc>>2]=jc,c[kc+4>>2]=C,zb=zb+2|0,kc=h+(zb<<3)|0,jc=kc,rb=cb(Rb|0,_b|0,c[jc>>2]|0,c[jc+4>>2]|0)|0,tb=C,jc=kc,c[jc>>2]=rb,c[jc+4>>2]=tb;while(zb>>>0<10);zb=Fa;tb=c[zb>>2]|0;rb=c[zb+4>>2]|0;zb=h;$b=c[zb>>2]|0;Hb=c[zb+4>>2]|0;zb=lb(tb|0,rb|0,18,0)|0;dc=C;pb=cb($b|0,Hb|0,tb|0,rb|0)|0;rb=cb(pb|0,C|0,zb|0,dc|0)|0;dc=C;zb=Fa;c[zb>>2]=0;c[zb+4>>2]=0;zb=cb(dc>>31>>>6|0,0,rb|0,dc|0)|0;pb=ab(zb|0,C|0,26)|0;zb=C;tb=fb(pb|0,zb|0,26)|0;Hb=C;$b=Ga;bc=c[$b>>2]|0;Fb=c[$b+4>>2]|0;$b=cb(rb|0,dc|0,Ab|0,ub|0)|0;dc=bb($b|0,C|0,tb|0,Hb|0)|0;Hb=h;c[Hb>>2]=dc;c[Hb+4>>2]=C;Hb=cb(bc|0,Fb|0,fc|0,ic|0)|0;Fb=cb(Hb|0,C|0,pb|0,zb|0)|0;zb=Ga;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Ha;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Ob|0,ec|0)|0;zb=Ha;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Ia;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Jb|0,Ib|0)|0;zb=Ia;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Ja;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,gc|0,Wb|0)|0;zb=Ja;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Ka;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Vb|0,cc|0)|0;zb=Ka;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Oa;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,yb|0,ob|0)|0;zb=Oa;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Pa;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Qb|0,Db|0)|0;zb=Pa;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Qa;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Lb|0,Tb|0)|0;zb=Qa;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=Ra;Fb=cb(c[zb>>2]|0,c[zb+4>>2]|0,Zb|0,qb|0)|0;zb=Ra;c[zb>>2]=Fb;c[zb+4>>2]=C;Ma(jb,k,h);zb=jb+144|0;Fb=c[zb>>2]|0;pb=c[zb+4>>2]|0;zb=jb+64|0;Hb=zb;bc=c[Hb>>2]|0;dc=c[Hb+4>>2]|0;Hb=lb(Fb|0,pb|0,18,0)|0;tb=C;$b=cb(bc|0,dc|0,Fb|0,pb|0)|0;pb=cb($b|0,C|0,Hb|0,tb|0)|0;tb=zb;c[tb>>2]=pb;c[tb+4>>2]=C;tb=jb+136|0;pb=c[tb>>2]|0;zb=c[tb+4>>2]|0;tb=jb+56|0;Hb=tb;$b=c[Hb>>2]|0;Fb=c[Hb+4>>2]|0;Hb=lb(pb|0,zb|0,18,0)|0;dc=C;bc=cb($b|0,Fb|0,pb|0,zb|0)|0;zb=cb(bc|0,C|0,Hb|0,dc|0)|0;dc=tb;c[dc>>2]=zb;c[dc+4>>2]=C;dc=jb+128|0;zb=c[dc>>2]|0;tb=c[dc+4>>2]|0;dc=jb+48|0;Hb=dc;bc=c[Hb>>2]|0;pb=c[Hb+4>>2]|0;Hb=lb(zb|0,tb|0,18,0)|0;Fb=C;$b=cb(bc|0,pb|0,zb|0,tb|0)|0;tb=cb($b|0,C|0,Hb|0,Fb|0)|0;Fb=dc;c[Fb>>2]=tb;c[Fb+4>>2]=C;Fb=jb+120|0;tb=c[Fb>>2]|0;dc=c[Fb+4>>2]|0;Fb=jb+40|0;Hb=Fb;$b=c[Hb>>2]|0;zb=c[Hb+4>>2]|0;Hb=lb(tb|0,dc|0,18,0)|0;pb=C;bc=cb($b|0,zb|0,tb|0,dc|0)|0;dc=cb(bc|0,C|0,Hb|0,pb|0)|0;pb=Fb;c[pb>>2]=dc;c[pb+4>>2]=C;pb=jb+112|0;dc=c[pb>>2]|0;Fb=c[pb+4>>2]|0;pb=jb+32|0;Hb=pb;bc=c[Hb>>2]|0;tb=c[Hb+4>>2]|0;Hb=lb(dc|0,Fb|0,18,0)|0;zb=C;$b=cb(bc|0,tb|0,dc|0,Fb|0)|0;Fb=cb($b|0,C|0,Hb|0,zb|0)|0;zb=pb;c[zb>>2]=Fb;c[zb+4>>2]=C;zb=jb+104|0;Fb=c[zb>>2]|0;pb=c[zb+4>>2]|0;zb=jb+24|0;Hb=zb;$b=c[Hb>>2]|0;dc=c[Hb+4>>2]|0;Hb=lb(Fb|0,pb|0,18,0)|0;tb=C;bc=cb($b|0,dc|0,Fb|0,pb|0)|0;pb=cb(bc|0,C|0,Hb|0,tb|0)|0;tb=zb;c[tb>>2]=pb;c[tb+4>>2]=C;tb=jb+96|0;pb=c[tb>>2]|0;zb=c[tb+4>>2]|0;tb=jb+16|0;Hb=tb;bc=c[Hb>>2]|0;Fb=c[Hb+4>>2]|0;Hb=lb(pb|0,zb|0,18,0)|0;dc=C;$b=cb(bc|0,Fb|0,pb|0,zb|0)|0;zb=cb($b|0,C|0,Hb|0,dc|0)|0;dc=tb;c[dc>>2]=zb;c[dc+4>>2]=C;dc=jb+88|0;zb=c[dc>>2]|0;tb=c[dc+4>>2]|0;dc=jb+8|0;Hb=dc;$b=c[Hb>>2]|0;pb=c[Hb+4>>2]|0;Hb=lb(zb|0,tb|0,18,0)|0;Fb=C;bc=cb($b|0,pb|0,zb|0,tb|0)|0;tb=cb(bc|0,C|0,Hb|0,Fb|0)|0;Fb=dc;c[Fb>>2]=tb;c[Fb+4>>2]=C;Fb=jb+80|0;tb=Fb;Hb=c[tb>>2]|0;bc=c[tb+4>>2]|0;tb=jb;zb=c[tb>>2]|0;pb=c[tb+4>>2]|0;tb=lb(Hb|0,bc|0,18,0)|0;$b=C;rb=cb(zb|0,pb|0,Hb|0,bc|0)|0;bc=cb(rb|0,C|0,tb|0,$b|0)|0;$b=C;tb=jb;c[tb>>2]=bc;c[tb+4>>2]=$b;tb=Fb;c[tb>>2]=0;c[tb+4>>2]=0;tb=$b;$b=bc;bc=0;do rb=cb(tb>>31>>>6|0,0,$b|0,tb|0)|0,Hb=ab(rb|0,C|0,26)|0,rb=C,pb=fb(Hb|0,rb|0,26)|0,zb=bb($b|0,tb|0,pb|0,C|0)|0,pb=jb+(bc<<3)|0,c[pb>>2]=zb,c[pb+4>>2]=C,pb=jb+((bc|1)<<3)|0,zb=pb,wb=cb(Hb|0,rb|0,c[zb>>2]|0,c[zb+4>>2]|0)|0,zb=C,rb=cb(zb>>31>>>7|0,0,wb|0,zb|0)|0,Hb=ab(rb|0,C|0,25)|0,rb=C,sb=fb(Hb|0,rb|0,25)|0,Mb=bb(wb|0,zb|0,sb|0,C|0)|0,sb=pb,c[sb>>2]=Mb,c[sb+4>>2]=C,bc=bc+2|0,sb=jb+(bc<<3)|0,Mb=sb,$b=cb(Hb|0,rb|0,c[Mb>>2]|0,c[Mb+4>>2]|0)|0,tb=C,Mb=sb,c[Mb>>2]=$b,c[Mb+4>>2]=tb;while(bc>>>0<10);bc=Fb;tb=c[bc>>2]|0;$b=c[bc+4>>2]|0;bc=jb;qb=c[bc>>2]|0;Zb=c[bc+4>>2]|0;bc=lb(tb|0,$b|0,18,0)|0;Tb=C;Lb=cb(qb|0,Zb|0,tb|0,$b|0)|0;$b=cb(Lb|0,C|0,bc|0,Tb|0)|0;Tb=C;bc=Fb;c[bc>>2]=0;c[bc+4>>2]=0;bc=cb(Tb>>31>>>6|0,0,$b|0,Tb|0)|0;Lb=ab(bc|0,C|0,26)|0;bc=C;tb=fb(Lb|0,bc|0,26)|0;Zb=bb($b|0,Tb|0,tb|0,C|0)|0;tb=jb;c[tb>>2]=Zb;c[tb+4>>2]=C;tb=dc;Zb=cb(Lb|0,bc|0,c[tb>>2]|0,c[tb+4>>2]|0)|0;tb=dc;c[tb>>2]=Zb;c[tb+4>>2]=C;tb=0;do Zb=hb+(tb<<3)|0,bc=Zb,Lb=c[bc>>2]|0,Tb=c[bc+4>>2]|0,bc=Za+(tb<<3)|0,$b=bc,qb=c[$b>>2]|0,Db=c[$b+4>>2]|0,$b=(qb^Lb)&mb,Qb=(Db^Tb)&nb,Tb=ab(0,$b^Lb|0,32)|0,Lb=Zb,c[Lb>>2]=Tb,c[Lb+4>>2]=C,Lb=ab(0,$b^qb|0,32)|0,qb=bc,c[qb>>2]=Lb,c[qb+4>>2]=C,tb=tb+1|0;while((tb|0)!=10);nc=0;do tb=jb+(nc<<3)|0,dc=tb,Fb=c[dc>>2]|0,qb=c[dc+4>>2]|0,dc=$a+(nc<<3)|0,Lb=dc,bc=c[Lb>>2]|0,$b=c[Lb+4>>2]|0,Lb=(bc^Fb)&mb,Tb=($b^qb)&nb,qb=ab(0,Lb^Fb|0,32)|0,Fb=tb,c[Fb>>2]=qb,c[Fb+4>>2]=C,Fb=ab(0,Lb^bc|0,32)|0,bc=dc,c[bc>>2]=Fb,c[bc+4>>2]=C,nc=nc+1|0;while((nc|0)!=10);Xa=Xa+1|0;if((Xa|0)==8){oc=Ya;pc=Za;qc=_a;rc=$a;sc=gb;tc=hb;uc=ib;vc=jb;break}else nb=jb,mb=hb,bc=$a,Fb=Za,w=kb<<1&255,jb=ib,ib=nb,hb=gb,gb=mb,$a=_a,_a=bc,Za=Ya,Ya=Fb}Ya=Sa+1|0;if((Ya|0)==32){wc=tc;xc=vc;break}else Sa=Ya,Ta=pc,Ua=oc,t=rc,Va=qc,u=tc,Wa=sc,v=vc,s=uc}D=y;E=wc;e=D+80|0;do c[D>>2]=c[E>>2],D=D+4|0,E=E+4|0;while((D|0)<(e|0));D=z;E=xc;e=D+80|0;do c[D>>2]=c[E>>2],D=D+4|0,E=E+4|0;while((D|0)<(e|0));Na(h,z);Na(r,h);Na(q,r);La(j,q,z);La(k,j,h);Na(q,k);La(l,q,j);Na(q,l);Na(r,q);Na(q,r);Na(r,q);Na(q,r);La(m,q,l);Na(q,m);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);La(n,r,m);Na(q,n);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);La(q,r,n);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);Na(q,r);La(o,q,m);Na(q,o);Na(r,q);m=2;do Na(q,r),Na(r,q),m=m+2|0;while((m|0)<50);La(p,r,o);Na(r,p);Na(q,r);m=2;do Na(r,q),Na(q,r),m=m+2|0;while((m|0)<100);La(r,q,p);Na(q,r);Na(r,q);p=2;do Na(q,r),Na(r,q),p=p+2|0;while((p|0)<50);La(q,r,o);Na(r,q);Na(q,r);Na(r,q);Na(q,r);Na(r,q);La(A,r,k);La(z,y,A);A=c[z>>2]|0;c[h>>2]=A;y=h+4|0;c[y>>2]=c[z+8>>2];k=h+8|0;c[k>>2]=c[z+16>>2];r=h+12|0;c[r>>2]=c[z+24>>2];q=h+16|0;c[q>>2]=c[z+32>>2];o=h+20|0;c[o>>2]=c[z+40>>2];p=h+24|0;c[p>>2]=c[z+48>>2];m=h+28|0;c[m>>2]=c[z+56>>2];n=h+32|0;c[n>>2]=c[z+64>>2];l=h+36|0;c[l>>2]=c[z+72>>2];z=A;A=0;while(1){j=h+(A<<2)|0;E=z>>31&z;!(A&1)?(D=E>>26,c[j>>2]=(_(D,-67108864)|0)+z,e=A+1|0,xc=h+(e<<2)|0,wc=(c[xc>>2]|0)+D|0,c[xc>>2]=wc,yc=wc,zc=e):(e=E>>25,c[j>>2]=(_(e,-33554432)|0)+z,j=A+1|0,E=h+(j<<2)|0,wc=(c[E>>2]|0)+e|0,c[E>>2]=wc,yc=wc,zc=j);if((zc|0)==9)break;else z=yc,A=zc}zc=c[l>>2]|0;A=(zc>>31&zc)>>25;c[l>>2]=(_(A,-33554432)|0)+zc;zc=(A*19|0)+(c[h>>2]|0)|0;c[h>>2]=zc;A=zc;zc=0;while(1){yc=h+(zc<<2)|0;z=A>>31&A;!(zc&1)?(j=z>>26,c[yc>>2]=(_(j,-67108864)|0)+A,wc=zc+1|0,E=h+(wc<<2)|0,e=(c[E>>2]|0)+j|0,c[E>>2]=e,Ac=wc,Bc=e):(e=z>>25,c[yc>>2]=(_(e,-33554432)|0)+A,yc=zc+1|0,z=h+(yc<<2)|0,wc=(c[z>>2]|0)+e|0,c[z>>2]=wc,Ac=yc,Bc=wc);if((Ac|0)==9)break;else A=Bc,zc=Ac}Ac=c[l>>2]|0;zc=(Ac>>31&Ac)>>25;c[l>>2]=(_(zc,-33554432)|0)+Ac;Ac=(zc*19|0)+(c[h>>2]|0)|0;zc=(Ac>>31&Ac)>>26;Bc=(_(zc,-67108864)|0)+Ac|0;c[h>>2]=Bc;c[y>>2]=zc+(c[y>>2]|0);zc=Bc;Bc=0;while(1){Ac=h+(Bc<<2)|0;!(Bc&1)?(c[Ac>>2]=zc&67108863,A=Bc+1|0,wc=h+(A<<2)|0,yc=(c[wc>>2]|0)+(zc>>26)|0,c[wc>>2]=yc,Cc=A,Dc=yc):(c[Ac>>2]=zc&33554431,Ac=Bc+1|0,yc=h+(Ac<<2)|0,A=(c[yc>>2]|0)+(zc>>25)|0,c[yc>>2]=A,Cc=Ac,Dc=A);if((Cc|0)==9)break;else zc=Dc,Bc=Cc}Cc=c[l>>2]|0;c[l>>2]=Cc&33554431;Bc=((Cc>>25)*19|0)+(c[h>>2]|0)|0;c[h>>2]=Bc;Cc=Bc;Bc=0;while(1){Dc=h+(Bc<<2)|0;!(Bc&1)?(c[Dc>>2]=Cc&67108863,zc=Bc+1|0,A=h+(zc<<2)|0,Ac=(c[A>>2]|0)+(Cc>>26)|0,c[A>>2]=Ac,Ec=zc,Fc=Ac):(c[Dc>>2]=Cc&33554431,Dc=Bc+1|0,Ac=h+(Dc<<2)|0,zc=(c[Ac>>2]|0)+(Cc>>25)|0,c[Ac>>2]=zc,Ec=Dc,Fc=zc);if((Ec|0)==9)break;else Cc=Fc,Bc=Ec}Ec=c[l>>2]|0;Bc=Ec&33554431;c[l>>2]=Bc;Fc=((Ec>>25)*19|0)+(c[h>>2]|0)|0;c[h>>2]=Fc;Ec=1;Cc=~(Fc+-67108845>>31);while(1){zc=c[h+(Ec<<2)>>2]|0;!(Ec&1)?(Dc=zc<<16&(zc^-67108864),Ac=Dc<<8&Dc,Dc=Ac<<4&Ac,Ac=Dc<<2&Dc,Gc=Ac<<1&Ac):(Ac=zc<<16&(zc^-33554432),zc=Ac<<8&Ac,Ac=zc<<4&zc,zc=Ac<<2&Ac,Gc=zc<<1&zc);zc=Gc>>31&Cc;Ec=Ec+1|0;if((Ec|0)==10){Hc=zc;break}else Cc=zc}Cc=Fc-(Hc&67108845)|0;c[h>>2]=Cc;h=Hc&67108863;Fc=Hc&33554431;Ec=(c[y>>2]|0)-Fc|0;Gc=Ec<<2;zc=(c[k>>2]|0)-h|0;Ac=zc<<3;Dc=(c[r>>2]|0)-Fc|0;A=Dc<<5;yc=(c[q>>2]|0)-Hc|0;Hc=yc<<6;wc=(c[o>>2]|0)-Fc|0;c[o>>2]=wc;o=(c[p>>2]|0)-h|0;z=o<<1;e=(c[m>>2]|0)-Fc|0;E=e<<3;j=(c[n>>2]|0)-h<<4;c[y>>2]=Gc;c[k>>2]=Ac;c[r>>2]=A;c[q>>2]=Hc;c[p>>2]=z;c[m>>2]=E;c[n>>2]=j;c[l>>2]=Bc-Fc<<6;a[b>>0]=Cc;a[b+1>>0]=Cc>>>8;a[b+2>>0]=Cc>>>16;a[b+3>>0]=Gc|Cc>>>24;a[b+4>>0]=Ec>>>6;a[b+5>>0]=Ec>>>14;a[b+6>>0]=Ac|Ec>>>22;a[b+7>>0]=zc>>>5;a[b+8>>0]=zc>>>13;a[b+9>>0]=A|zc>>>21;a[b+10>>0]=Dc>>>3;a[b+11>>0]=Dc>>>11;a[b+12>>0]=Hc|Dc>>>19;a[b+13>>0]=yc>>>2;a[b+14>>0]=yc>>>10;a[b+15>>0]=yc>>>18;a[b+16>>0]=wc;a[b+17>>0]=wc>>>8;a[b+18>>0]=wc>>>16;a[b+19>>0]=wc>>>24|z;a[b+20>>0]=o>>>7;a[b+21>>0]=o>>>15;a[b+22>>0]=o>>>23|E;a[b+23>>0]=e>>>5;a[b+24>>0]=e>>>13;E=c[n>>2]|0;a[b+25>>0]=e>>>21|E;a[b+26>>0]=E>>>8;a[b+27>>0]=E>>>16;e=c[l>>2]|0;a[b+28>>0]=E>>>24|e;a[b+29>>0]=e>>>8;a[b+30>>0]=e>>>16;a[b+31>>0]=e>>>24;i=g;return 0}function La(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+160|0;f=e;Ma(f,b,d);d=f+144|0;b=c[d>>2]|0;g=c[d+4>>2]|0;d=f+64|0;h=d;j=c[h>>2]|0;k=c[h+4>>2]|0;h=lb(b|0,g|0,18,0)|0;l=C;m=cb(j|0,k|0,b|0,g|0)|0;g=cb(m|0,C|0,h|0,l|0)|0;l=d;c[l>>2]=g;c[l+4>>2]=C;l=f+136|0;g=c[l>>2]|0;d=c[l+4>>2]|0;l=f+56|0;h=l;m=c[h>>2]|0;b=c[h+4>>2]|0;h=lb(g|0,d|0,18,0)|0;k=C;j=cb(m|0,b|0,g|0,d|0)|0;d=cb(j|0,C|0,h|0,k|0)|0;k=l;c[k>>2]=d;c[k+4>>2]=C;k=f+128|0;d=c[k>>2]|0;l=c[k+4>>2]|0;k=f+48|0;h=k;j=c[h>>2]|0;g=c[h+4>>2]|0;h=lb(d|0,l|0,18,0)|0;b=C;m=cb(j|0,g|0,d|0,l|0)|0;l=cb(m|0,C|0,h|0,b|0)|0;b=k;c[b>>2]=l;c[b+4>>2]=C;b=f+120|0;l=c[b>>2]|0;k=c[b+4>>2]|0;b=f+40|0;h=b;m=c[h>>2]|0;d=c[h+4>>2]|0;h=lb(l|0,k|0,18,0)|0;g=C;j=cb(m|0,d|0,l|0,k|0)|0;k=cb(j|0,C|0,h|0,g|0)|0;g=b;c[g>>2]=k;c[g+4>>2]=C;g=f+112|0;k=c[g>>2]|0;b=c[g+4>>2]|0;g=f+32|0;h=g;j=c[h>>2]|0;l=c[h+4>>2]|0;h=lb(k|0,b|0,18,0)|0;d=C;m=cb(j|0,l|0,k|0,b|0)|0;b=cb(m|0,C|0,h|0,d|0)|0;d=g;c[d>>2]=b;c[d+4>>2]=C;d=f+104|0;b=c[d>>2]|0;g=c[d+4>>2]|0;d=f+24|0;h=d;m=c[h>>2]|0;k=c[h+4>>2]|0;h=lb(b|0,g|0,18,0)|0;l=C;j=cb(m|0,k|0,b|0,g|0)|0;g=cb(j|0,C|0,h|0,l|0)|0;l=d;c[l>>2]=g;c[l+4>>2]=C;l=f+96|0;g=c[l>>2]|0;d=c[l+4>>2]|0;l=f+16|0;h=l;j=c[h>>2]|0;b=c[h+4>>2]|0;h=lb(g|0,d|0,18,0)|0;k=C;m=cb(j|0,b|0,g|0,d|0)|0;d=cb(m|0,C|0,h|0,k|0)|0;k=l;c[k>>2]=d;c[k+4>>2]=C;k=f+88|0;d=c[k>>2]|0;l=c[k+4>>2]|0;k=f+8|0;h=k;m=c[h>>2]|0;g=c[h+4>>2]|0;h=lb(d|0,l|0,18,0)|0;b=C;j=cb(m|0,g|0,d|0,l|0)|0;l=cb(j|0,C|0,h|0,b|0)|0;b=k;c[b>>2]=l;c[b+4>>2]=C;b=f+80|0;l=b;h=c[l>>2]|0;j=c[l+4>>2]|0;l=f;d=c[l>>2]|0;g=c[l+4>>2]|0;l=lb(h|0,j|0,18,0)|0;m=C;n=cb(d|0,g|0,h|0,j|0)|0;j=cb(n|0,C|0,l|0,m|0)|0;m=C;l=f;c[l>>2]=j;c[l+4>>2]=m;l=b;c[l>>2]=0;c[l+4>>2]=0;l=m;m=j;j=0;do n=cb(l>>31>>>6|0,0,m|0,l|0)|0,h=ab(n|0,C|0,26)|0,n=C,g=fb(h|0,n|0,26)|0,d=bb(m|0,l|0,g|0,C|0)|0,g=f+(j<<3)|0,c[g>>2]=d,c[g+4>>2]=C,g=f+((j|1)<<3)|0,d=g,o=cb(h|0,n|0,c[d>>2]|0,c[d+4>>2]|0)|0,d=C,n=cb(d>>31>>>7|0,0,o|0,d|0)|0,h=ab(n|0,C|0,25)|0,n=C,p=fb(h|0,n|0,25)|0,q=bb(o|0,d|0,p|0,C|0)|0,p=g,c[p>>2]=q,c[p+4>>2]=C,j=j+2|0,p=f+(j<<3)|0,q=p,m=cb(h|0,n|0,c[q>>2]|0,c[q+4>>2]|0)|0,l=C,q=p,c[q>>2]=m,c[q+4>>2]=l;while(j>>>0<10);j=b;l=c[j>>2]|0;m=c[j+4>>2]|0;j=f;q=c[j>>2]|0;p=c[j+4>>2]|0;j=lb(l|0,m|0,18,0)|0;n=C;h=cb(q|0,p|0,l|0,m|0)|0;m=cb(h|0,C|0,j|0,n|0)|0;n=C;j=b;c[j>>2]=0;c[j+4>>2]=0;j=cb(n>>31>>>6|0,0,m|0,n|0)|0;b=ab(j|0,C|0,26)|0;j=C;h=fb(b|0,j|0,26)|0;l=bb(m|0,n|0,h|0,C|0)|0;h=f;c[h>>2]=l;c[h+4>>2]=C;h=k;l=cb(b|0,j|0,c[h>>2]|0,c[h+4>>2]|0)|0;h=k;c[h>>2]=l;c[h+4>>2]=C;h=a;a=f;f=h+80|0;do c[h>>2]=c[a>>2],h=h+4|0,a=a+4|0;while((h|0)<(f|0));i=e;return}function Ma(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;e=ab(0,c[b>>2]|0,32)|0;f=C;g=ab(0,c[d>>2]|0,32)|0;h=lb(g|0,C|0,e|0,f|0)|0;f=a;c[f>>2]=h;c[f+4>>2]=C;f=ab(0,c[b>>2]|0,32)|0;h=C;e=d+8|0;g=ab(0,c[e>>2]|0,32)|0;i=lb(g|0,C|0,f|0,h|0)|0;h=C;f=b+8|0;g=ab(0,c[f>>2]|0,32)|0;j=C;k=ab(0,c[d>>2]|0,32)|0;l=lb(k|0,C|0,g|0,j|0)|0;j=cb(l|0,C|0,i|0,h|0)|0;h=a+8|0;c[h>>2]=j;c[h+4>>2]=C;h=ab(0,c[f>>2]|0,31)|0;j=C;i=ab(0,c[e>>2]|0,32)|0;l=lb(i|0,C|0,h|0,j|0)|0;j=C;h=ab(0,c[b>>2]|0,32)|0;i=C;g=d+16|0;k=ab(0,c[g>>2]|0,32)|0;m=lb(k|0,C|0,h|0,i|0)|0;i=cb(m|0,C|0,l|0,j|0)|0;j=C;l=b+16|0;m=ab(0,c[l>>2]|0,32)|0;h=C;k=ab(0,c[d>>2]|0,32)|0;n=lb(k|0,C|0,m|0,h|0)|0;h=cb(i|0,j|0,n|0,C|0)|0;n=a+16|0;c[n>>2]=h;c[n+4>>2]=C;n=ab(0,c[f>>2]|0,32)|0;h=C;j=ab(0,c[g>>2]|0,32)|0;i=lb(j|0,C|0,n|0,h|0)|0;h=C;n=ab(0,c[l>>2]|0,32)|0;j=C;m=ab(0,c[e>>2]|0,32)|0;k=lb(m|0,C|0,n|0,j|0)|0;j=cb(k|0,C|0,i|0,h|0)|0;h=C;i=ab(0,c[b>>2]|0,32)|0;k=C;n=d+24|0;m=ab(0,c[n>>2]|0,32)|0;o=lb(m|0,C|0,i|0,k|0)|0;k=cb(j|0,h|0,o|0,C|0)|0;o=C;h=b+24|0;j=ab(0,c[h>>2]|0,32)|0;i=C;m=ab(0,c[d>>2]|0,32)|0;p=lb(m|0,C|0,j|0,i|0)|0;i=cb(k|0,o|0,p|0,C|0)|0;p=a+24|0;c[p>>2]=i;c[p+4>>2]=C;p=ab(0,c[l>>2]|0,32)|0;i=C;o=ab(0,c[g>>2]|0,32)|0;k=lb(o|0,C|0,p|0,i|0)|0;i=C;p=ab(0,c[f>>2]|0,32)|0;o=C;j=ab(0,c[n>>2]|0,32)|0;m=lb(j|0,C|0,p|0,o|0)|0;o=C;p=ab(0,c[h>>2]|0,32)|0;j=C;q=ab(0,c[e>>2]|0,32)|0;r=lb(q|0,C|0,p|0,j|0)|0;j=cb(r|0,C|0,m|0,o|0)|0;o=fb(j|0,C|0,1)|0;j=cb(o|0,C|0,k|0,i|0)|0;i=C;k=ab(0,c[b>>2]|0,32)|0;o=C;m=d+32|0;r=ab(0,c[m>>2]|0,32)|0;p=lb(r|0,C|0,k|0,o|0)|0;o=cb(j|0,i|0,p|0,C|0)|0;p=C;i=b+32|0;j=ab(0,c[i>>2]|0,32)|0;k=C;r=ab(0,c[d>>2]|0,32)|0;q=lb(r|0,C|0,j|0,k|0)|0;k=cb(o|0,p|0,q|0,C|0)|0;q=a+32|0;c[q>>2]=k;c[q+4>>2]=C;q=ab(0,c[l>>2]|0,32)|0;k=C;p=ab(0,c[n>>2]|0,32)|0;o=lb(p|0,C|0,q|0,k|0)|0;k=C;q=ab(0,c[h>>2]|0,32)|0;p=C;j=ab(0,c[g>>2]|0,32)|0;r=lb(j|0,C|0,q|0,p|0)|0;p=cb(r|0,C|0,o|0,k|0)|0;k=C;o=ab(0,c[f>>2]|0,32)|0;r=C;q=ab(0,c[m>>2]|0,32)|0;j=lb(q|0,C|0,o|0,r|0)|0;r=cb(p|0,k|0,j|0,C|0)|0;j=C;k=ab(0,c[i>>2]|0,32)|0;p=C;o=ab(0,c[e>>2]|0,32)|0;q=lb(o|0,C|0,k|0,p|0)|0;p=cb(r|0,j|0,q|0,C|0)|0;q=C;j=ab(0,c[b>>2]|0,32)|0;r=C;k=d+40|0;o=ab(0,c[k>>2]|0,32)|0;s=lb(o|0,C|0,j|0,r|0)|0;r=cb(p|0,q|0,s|0,C|0)|0;s=C;q=b+40|0;p=ab(0,c[q>>2]|0,32)|0;j=C;o=ab(0,c[d>>2]|0,32)|0;t=lb(o|0,C|0,p|0,j|0)|0;j=cb(r|0,s|0,t|0,C|0)|0;t=a+40|0;c[t>>2]=j;c[t+4>>2]=C;t=ab(0,c[h>>2]|0,32)|0;j=C;s=ab(0,c[n>>2]|0,32)|0;r=lb(s|0,C|0,t|0,j|0)|0;j=C;t=ab(0,c[f>>2]|0,32)|0;s=C;p=ab(0,c[k>>2]|0,32)|0;o=lb(p|0,C|0,t|0,s|0)|0;s=cb(o|0,C|0,r|0,j|0)|0;j=C;r=ab(0,c[q>>2]|0,32)|0;o=C;t=ab(0,c[e>>2]|0,32)|0;p=lb(t|0,C|0,r|0,o|0)|0;o=cb(s|0,j|0,p|0,C|0)|0;p=fb(o|0,C|0,1)|0;o=C;j=ab(0,c[l>>2]|0,32)|0;s=C;r=ab(0,c[m>>2]|0,32)|0;t=lb(r|0,C|0,j|0,s|0)|0;s=cb(p|0,o|0,t|0,C|0)|0;t=C;o=ab(0,c[i>>2]|0,32)|0;p=C;j=ab(0,c[g>>2]|0,32)|0;r=lb(j|0,C|0,o|0,p|0)|0;p=cb(s|0,t|0,r|0,C|0)|0;r=C;t=ab(0,c[b>>2]|0,32)|0;s=C;o=d+48|0;j=ab(0,c[o>>2]|0,32)|0;u=lb(j|0,C|0,t|0,s|0)|0;s=cb(p|0,r|0,u|0,C|0)|0;u=C;r=b+48|0;p=ab(0,c[r>>2]|0,32)|0;t=C;j=ab(0,c[d>>2]|0,32)|0;v=lb(j|0,C|0,p|0,t|0)|0;t=cb(s|0,u|0,v|0,C|0)|0;v=a+48|0;c[v>>2]=t;c[v+4>>2]=C;v=ab(0,c[h>>2]|0,32)|0;t=C;u=ab(0,c[m>>2]|0,32)|0;s=lb(u|0,C|0,v|0,t|0)|0;t=C;v=ab(0,c[i>>2]|0,32)|0;u=C;p=ab(0,c[n>>2]|0,32)|0;j=lb(p|0,C|0,v|0,u|0)|0;u=cb(j|0,C|0,s|0,t|0)|0;t=C;s=ab(0,c[l>>2]|0,32)|0;j=C;v=ab(0,c[k>>2]|0,32)|0;p=lb(v|0,C|0,s|0,j|0)|0;j=cb(u|0,t|0,p|0,C|0)|0;p=C;t=ab(0,c[q>>2]|0,32)|0;u=C;s=ab(0,c[g>>2]|0,32)|0;v=lb(s|0,C|0,t|0,u|0)|0;u=cb(j|0,p|0,v|0,C|0)|0;v=C;p=ab(0,c[f>>2]|0,32)|0;j=C;t=ab(0,c[o>>2]|0,32)|0;s=lb(t|0,C|0,p|0,j|0)|0;j=cb(u|0,v|0,s|0,C|0)|0;s=C;v=ab(0,c[r>>2]|0,32)|0;u=C;p=ab(0,c[e>>2]|0,32)|0;t=lb(p|0,C|0,v|0,u|0)|0;u=cb(j|0,s|0,t|0,C|0)|0;t=C;s=ab(0,c[b>>2]|0,32)|0;j=C;v=d+56|0;p=ab(0,c[v>>2]|0,32)|0;w=lb(p|0,C|0,s|0,j|0)|0;j=cb(u|0,t|0,w|0,C|0)|0;w=C;t=b+56|0;u=ab(0,c[t>>2]|0,32)|0;s=C;p=ab(0,c[d>>2]|0,32)|0;x=lb(p|0,C|0,u|0,s|0)|0;s=cb(j|0,w|0,x|0,C|0)|0;x=a+56|0;c[x>>2]=s;c[x+4>>2]=C;x=ab(0,c[i>>2]|0,32)|0;s=C;w=ab(0,c[m>>2]|0,32)|0;j=lb(w|0,C|0,x|0,s|0)|0;s=C;x=ab(0,c[h>>2]|0,32)|0;w=C;u=ab(0,c[k>>2]|0,32)|0;p=lb(u|0,C|0,x|0,w|0)|0;w=C;x=ab(0,c[q>>2]|0,32)|0;u=C;y=ab(0,c[n>>2]|0,32)|0;z=lb(y|0,C|0,x|0,u|0)|0;u=cb(z|0,C|0,p|0,w|0)|0;w=C;p=ab(0,c[f>>2]|0,32)|0;z=C;x=ab(0,c[v>>2]|0,32)|0;y=lb(x|0,C|0,p|0,z|0)|0;z=cb(u|0,w|0,y|0,C|0)|0;y=C;w=ab(0,c[t>>2]|0,32)|0;u=C;p=ab(0,c[e>>2]|0,32)|0;x=lb(p|0,C|0,w|0,u|0)|0;u=cb(z|0,y|0,x|0,C|0)|0;x=fb(u|0,C|0,1)|0;u=cb(x|0,C|0,j|0,s|0)|0;s=C;j=ab(0,c[l>>2]|0,32)|0;x=C;y=ab(0,c[o>>2]|0,32)|0;z=lb(y|0,C|0,j|0,x|0)|0;x=cb(u|0,s|0,z|0,C|0)|0;z=C;s=ab(0,c[r>>2]|0,32)|0;u=C;j=ab(0,c[g>>2]|0,32)|0;y=lb(j|0,C|0,s|0,u|0)|0;u=cb(x|0,z|0,y|0,C|0)|0;y=C;z=ab(0,c[b>>2]|0,32)|0;x=C;s=d+64|0;j=ab(0,c[s>>2]|0,32)|0;w=lb(j|0,C|0,z|0,x|0)|0;x=cb(u|0,y|0,w|0,C|0)|0;w=C;y=b+64|0;u=ab(0,c[y>>2]|0,32)|0;z=C;j=ab(0,c[d>>2]|0,32)|0;p=lb(j|0,C|0,u|0,z|0)|0;z=cb(x|0,w|0,p|0,C|0)|0;p=a+64|0;c[p>>2]=z;c[p+4>>2]=C;p=ab(0,c[i>>2]|0,32)|0;z=C;w=ab(0,c[k>>2]|0,32)|0;x=lb(w|0,C|0,p|0,z|0)|0;z=C;p=ab(0,c[q>>2]|0,32)|0;w=C;u=ab(0,c[m>>2]|0,32)|0;j=lb(u|0,C|0,p|0,w|0)|0;w=cb(j|0,C|0,x|0,z|0)|0;z=C;x=ab(0,c[h>>2]|0,32)|0;j=C;p=ab(0,c[o>>2]|0,32)|0;u=lb(p|0,C|0,x|0,j|0)|0;j=cb(w|0,z|0,u|0,C|0)|0;u=C;z=ab(0,c[r>>2]|0,32)|0;w=C;x=ab(0,c[n>>2]|0,32)|0;p=lb(x|0,C|0,z|0,w|0)|0;w=cb(j|0,u|0,p|0,C|0)|0;p=C;u=ab(0,c[l>>2]|0,32)|0;j=C;z=ab(0,c[v>>2]|0,32)|0;x=lb(z|0,C|0,u|0,j|0)|0;j=cb(w|0,p|0,x|0,C|0)|0;x=C;p=ab(0,c[t>>2]|0,32)|0;w=C;u=ab(0,c[g>>2]|0,32)|0;z=lb(u|0,C|0,p|0,w|0)|0;w=cb(j|0,x|0,z|0,C|0)|0;z=C;x=ab(0,c[f>>2]|0,32)|0;j=C;p=ab(0,c[s>>2]|0,32)|0;u=lb(p|0,C|0,x|0,j|0)|0;j=cb(w|0,z|0,u|0,C|0)|0;u=C;z=ab(0,c[y>>2]|0,32)|0;w=C;x=ab(0,c[e>>2]|0,32)|0;p=lb(x|0,C|0,z|0,w|0)|0;w=cb(j|0,u|0,p|0,C|0)|0;p=C;u=ab(0,c[b>>2]|0,32)|0;j=C;z=d+72|0;x=ab(0,c[z>>2]|0,32)|0;A=lb(x|0,C|0,u|0,j|0)|0;j=cb(w|0,p|0,A|0,C|0)|0;A=C;p=b+72|0;b=ab(0,c[p>>2]|0,32)|0;w=C;u=ab(0,c[d>>2]|0,32)|0;d=lb(u|0,C|0,b|0,w|0)|0;w=cb(j|0,A|0,d|0,C|0)|0;d=a+72|0;c[d>>2]=w;c[d+4>>2]=C;d=ab(0,c[q>>2]|0,32)|0;w=C;A=ab(0,c[k>>2]|0,32)|0;j=lb(A|0,C|0,d|0,w|0)|0;w=C;d=ab(0,c[h>>2]|0,32)|0;A=C;b=ab(0,c[v>>2]|0,32)|0;u=lb(b|0,C|0,d|0,A|0)|0;A=cb(u|0,C|0,j|0,w|0)|0;w=C;j=ab(0,c[t>>2]|0,32)|0;u=C;d=ab(0,c[n>>2]|0,32)|0;b=lb(d|0,C|0,j|0,u|0)|0;u=cb(A|0,w|0,b|0,C|0)|0;b=C;w=ab(0,c[f>>2]|0,32)|0;f=C;A=ab(0,c[z>>2]|0,32)|0;j=lb(A|0,C|0,w|0,f|0)|0;f=cb(u|0,b|0,j|0,C|0)|0;j=C;b=ab(0,c[p>>2]|0,32)|0;u=C;w=ab(0,c[e>>2]|0,32)|0;e=lb(w|0,C|0,b|0,u|0)|0;u=cb(f|0,j|0,e|0,C|0)|0;e=fb(u|0,C|0,1)|0;u=C;j=ab(0,c[i>>2]|0,32)|0;f=C;b=ab(0,c[o>>2]|0,32)|0;w=lb(b|0,C|0,j|0,f|0)|0;f=cb(e|0,u|0,w|0,C|0)|0;w=C;u=ab(0,c[r>>2]|0,32)|0;e=C;j=ab(0,c[m>>2]|0,32)|0;b=lb(j|0,C|0,u|0,e|0)|0;e=cb(f|0,w|0,b|0,C|0)|0;b=C;w=ab(0,c[l>>2]|0,32)|0;f=C;u=ab(0,c[s>>2]|0,32)|0;j=lb(u|0,C|0,w|0,f|0)|0;f=cb(e|0,b|0,j|0,C|0)|0;j=C;b=ab(0,c[y>>2]|0,32)|0;e=C;w=ab(0,c[g>>2]|0,32)|0;u=lb(w|0,C|0,b|0,e|0)|0;e=cb(f|0,j|0,u|0,C|0)|0;u=a+80|0;c[u>>2]=e;c[u+4>>2]=C;u=ab(0,c[q>>2]|0,32)|0;e=C;j=ab(0,c[o>>2]|0,32)|0;f=lb(j|0,C|0,u|0,e|0)|0;e=C;u=ab(0,c[r>>2]|0,32)|0;j=C;b=ab(0,c[k>>2]|0,32)|0;w=lb(b|0,C|0,u|0,j|0)|0;j=cb(w|0,C|0,f|0,e|0)|0;e=C;f=ab(0,c[i>>2]|0,32)|0;w=C;u=ab(0,c[v>>2]|0,32)|0;b=lb(u|0,C|0,f|0,w|0)|0;w=cb(j|0,e|0,b|0,C|0)|0;b=C;e=ab(0,c[t>>2]|0,32)|0;j=C;f=ab(0,c[m>>2]|0,32)|0;u=lb(f|0,C|0,e|0,j|0)|0;j=cb(w|0,b|0,u|0,C|0)|0;u=C;b=ab(0,c[h>>2]|0,32)|0;w=C;e=ab(0,c[s>>2]|0,32)|0;f=lb(e|0,C|0,b|0,w|0)|0;w=cb(j|0,u|0,f|0,C|0)|0;f=C;u=ab(0,c[y>>2]|0,32)|0;j=C;b=ab(0,c[n>>2]|0,32)|0;e=lb(b|0,C|0,u|0,j|0)|0;j=cb(w|0,f|0,e|0,C|0)|0;e=C;f=ab(0,c[l>>2]|0,32)|0;l=C;w=ab(0,c[z>>2]|0,32)|0;u=lb(w|0,C|0,f|0,l|0)|0;l=cb(j|0,e|0,u|0,C|0)|0;u=C;e=ab(0,c[p>>2]|0,32)|0;j=C;f=ab(0,c[g>>2]|0,32)|0;g=lb(f|0,C|0,e|0,j|0)|0;j=cb(l|0,u|0,g|0,C|0)|0;g=a+88|0;c[g>>2]=j;c[g+4>>2]=C;g=ab(0,c[r>>2]|0,32)|0;j=C;u=ab(0,c[o>>2]|0,32)|0;l=lb(u|0,C|0,g|0,j|0)|0;j=C;g=ab(0,c[q>>2]|0,32)|0;u=C;e=ab(0,c[v>>2]|0,32)|0;f=lb(e|0,C|0,g|0,u|0)|0;u=C;g=ab(0,c[t>>2]|0,32)|0;e=C;w=ab(0,c[k>>2]|0,32)|0;b=lb(w|0,C|0,g|0,e|0)|0;e=cb(b|0,C|0,f|0,u|0)|0;u=C;f=ab(0,c[h>>2]|0,32)|0;h=C;b=ab(0,c[z>>2]|0,32)|0;g=lb(b|0,C|0,f|0,h|0)|0;h=cb(e|0,u|0,g|0,C|0)|0;g=C;u=ab(0,c[p>>2]|0,32)|0;e=C;f=ab(0,c[n>>2]|0,32)|0;n=lb(f|0,C|0,u|0,e|0)|0;e=cb(h|0,g|0,n|0,C|0)|0;n=fb(e|0,C|0,1)|0;e=cb(n|0,C|0,l|0,j|0)|0;j=C;l=ab(0,c[i>>2]|0,32)|0;n=C;g=ab(0,c[s>>2]|0,32)|0;h=lb(g|0,C|0,l|0,n|0)|0;n=cb(e|0,j|0,h|0,C|0)|0;h=C;j=ab(0,c[y>>2]|0,32)|0;e=C;l=ab(0,c[m>>2]|0,32)|0;g=lb(l|0,C|0,j|0,e|0)|0;e=cb(n|0,h|0,g|0,C|0)|0;g=a+96|0;c[g>>2]=e;c[g+4>>2]=C;g=ab(0,c[r>>2]|0,32)|0;e=C;h=ab(0,c[v>>2]|0,32)|0;n=lb(h|0,C|0,g|0,e|0)|0;e=C;g=ab(0,c[t>>2]|0,32)|0;h=C;j=ab(0,c[o>>2]|0,32)|0;l=lb(j|0,C|0,g|0,h|0)|0;h=cb(l|0,C|0,n|0,e|0)|0;e=C;n=ab(0,c[q>>2]|0,32)|0;l=C;g=ab(0,c[s>>2]|0,32)|0;j=lb(g|0,C|0,n|0,l|0)|0;l=cb(h|0,e|0,j|0,C|0)|0;j=C;e=ab(0,c[y>>2]|0,32)|0;h=C;n=ab(0,c[k>>2]|0,32)|0;g=lb(n|0,C|0,e|0,h|0)|0;h=cb(l|0,j|0,g|0,C|0)|0;g=C;j=ab(0,c[i>>2]|0,32)|0;i=C;l=ab(0,c[z>>2]|0,32)|0;e=lb(l|0,C|0,j|0,i|0)|0;i=cb(h|0,g|0,e|0,C|0)|0;e=C;g=ab(0,c[p>>2]|0,32)|0;h=C;j=ab(0,c[m>>2]|0,32)|0;m=lb(j|0,C|0,g|0,h|0)|0;h=cb(i|0,e|0,m|0,C|0)|0;m=a+104|0;c[m>>2]=h;c[m+4>>2]=C;m=ab(0,c[t>>2]|0,32)|0;h=C;e=ab(0,c[v>>2]|0,32)|0;i=lb(e|0,C|0,m|0,h|0)|0;h=C;m=ab(0,c[q>>2]|0,32)|0;q=C;e=ab(0,c[z>>2]|0,32)|0;g=lb(e|0,C|0,m|0,q|0)|0;q=cb(g|0,C|0,i|0,h|0)|0;h=C;i=ab(0,c[p>>2]|0,32)|0;g=C;m=ab(0,c[k>>2]|0,32)|0;k=lb(m|0,C|0,i|0,g|0)|0;g=cb(q|0,h|0,k|0,C|0)|0;k=fb(g|0,C|0,1)|0;g=C;h=ab(0,c[r>>2]|0,32)|0;q=C;i=ab(0,c[s>>2]|0,32)|0;m=lb(i|0,C|0,h|0,q|0)|0;q=cb(k|0,g|0,m|0,C|0)|0;m=C;g=ab(0,c[y>>2]|0,32)|0;k=C;h=ab(0,c[o>>2]|0,32)|0;i=lb(h|0,C|0,g|0,k|0)|0;k=cb(q|0,m|0,i|0,C|0)|0;i=a+112|0;c[i>>2]=k;c[i+4>>2]=C;i=ab(0,c[t>>2]|0,32)|0;k=C;m=ab(0,c[s>>2]|0,32)|0;q=lb(m|0,C|0,i|0,k|0)|0;k=C;i=ab(0,c[y>>2]|0,32)|0;m=C;g=ab(0,c[v>>2]|0,32)|0;h=lb(g|0,C|0,i|0,m|0)|0;m=cb(h|0,C|0,q|0,k|0)|0;k=C;q=ab(0,c[r>>2]|0,32)|0;r=C;h=ab(0,c[z>>2]|0,32)|0;i=lb(h|0,C|0,q|0,r|0)|0;r=cb(m|0,k|0,i|0,C|0)|0;i=C;k=ab(0,c[p>>2]|0,32)|0;m=C;q=ab(0,c[o>>2]|0,32)|0;o=lb(q|0,C|0,k|0,m|0)|0;m=cb(r|0,i|0,o|0,C|0)|0;o=a+120|0;c[o>>2]=m;c[o+4>>2]=C;o=ab(0,c[y>>2]|0,32)|0;m=C;i=ab(0,c[s>>2]|0,32)|0;r=lb(i|0,C|0,o|0,m|0)|0;m=C;o=ab(0,c[t>>2]|0,32)|0;t=C;i=ab(0,c[z>>2]|0,32)|0;k=lb(i|0,C|0,o|0,t|0)|0;t=C;o=ab(0,c[p>>2]|0,32)|0;i=C;q=ab(0,c[v>>2]|0,32)|0;v=lb(q|0,C|0,o|0,i|0)|0;i=cb(v|0,C|0,k|0,t|0)|0;t=fb(i|0,C|0,1)|0;i=cb(t|0,C|0,r|0,m|0)|0;m=a+128|0;c[m>>2]=i;c[m+4>>2]=C;m=ab(0,c[y>>2]|0,32)|0;y=C;i=ab(0,c[z>>2]|0,32)|0;r=lb(i|0,C|0,m|0,y|0)|0;y=C;m=ab(0,c[p>>2]|0,32)|0;i=C;t=ab(0,c[s>>2]|0,32)|0;s=lb(t|0,C|0,m|0,i|0)|0;i=cb(s|0,C|0,r|0,y|0)|0;y=a+136|0;c[y>>2]=i;c[y+4>>2]=C;y=ab(0,c[p>>2]|0,31)|0;p=C;i=ab(0,c[z>>2]|0,32)|0;z=lb(i|0,C|0,y|0,p|0)|0;p=a+144|0;c[p>>2]=z;c[p+4>>2]=C;return}function Na(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;d=i;i=i+160|0;e=d;f=c[b>>2]|0;g=ab(0,f|0,32)|0;h=C;j=lb(g|0,h|0,g|0,h|0)|0;k=e;c[k>>2]=j;c[k+4>>2]=C;k=ab(0,f|0,31)|0;f=C;j=b+8|0;l=c[j>>2]|0;m=ab(0,l|0,32)|0;n=C;o=lb(m|0,n|0,k|0,f|0)|0;p=e+8|0;q=p;c[q>>2]=o;c[q+4>>2]=C;q=lb(m|0,n|0,m|0,n|0)|0;o=C;r=b+16|0;s=ab(0,c[r>>2]|0,32)|0;t=C;u=lb(s|0,t|0,g|0,h|0)|0;v=cb(u|0,C|0,q|0,o|0)|0;o=fb(v|0,C|0,1)|0;v=e+16|0;q=v;c[q>>2]=o;c[q+4>>2]=C;q=lb(s|0,t|0,m|0,n|0)|0;o=C;u=b+24|0;w=ab(0,c[u>>2]|0,32)|0;x=C;y=lb(w|0,x|0,g|0,h|0)|0;z=cb(y|0,C|0,q|0,o|0)|0;o=fb(z|0,C|0,1)|0;z=e+24|0;q=z;c[q>>2]=o;c[q+4>>2]=C;q=lb(s|0,t|0,s|0,t|0)|0;o=C;y=ab(0,l|0,30)|0;A=lb(w|0,x|0,y|0,C|0)|0;y=cb(A|0,C|0,q|0,o|0)|0;o=C;q=b+32|0;A=ab(0,c[q>>2]|0,32)|0;B=C;D=lb(A|0,B|0,k|0,f|0)|0;f=cb(y|0,o|0,D|0,C|0)|0;D=e+32|0;o=D;c[o>>2]=f;c[o+4>>2]=C;o=lb(w|0,x|0,s|0,t|0)|0;f=C;y=lb(A|0,B|0,m|0,n|0)|0;k=cb(y|0,C|0,o|0,f|0)|0;f=C;o=b+40|0;y=ab(0,c[o>>2]|0,32)|0;E=C;F=lb(y|0,E|0,g|0,h|0)|0;G=cb(k|0,f|0,F|0,C|0)|0;F=fb(G|0,C|0,1)|0;G=e+40|0;f=G;c[f>>2]=F;c[f+4>>2]=C;f=lb(w|0,x|0,w|0,x|0)|0;F=C;k=lb(A|0,B|0,s|0,t|0)|0;H=cb(k|0,C|0,f|0,F|0)|0;F=C;f=b+48|0;k=ab(0,c[f>>2]|0,32)|0;I=C;J=lb(k|0,I|0,g|0,h|0)|0;K=cb(H|0,F|0,J|0,C|0)|0;J=C;F=ab(0,l|0,31)|0;l=lb(y|0,E|0,F|0,C|0)|0;F=cb(K|0,J|0,l|0,C|0)|0;l=fb(F|0,C|0,1)|0;F=e+48|0;J=F;c[J>>2]=l;c[J+4>>2]=C;J=lb(A|0,B|0,w|0,x|0)|0;l=C;K=lb(y|0,E|0,s|0,t|0)|0;H=cb(K|0,C|0,J|0,l|0)|0;l=C;J=lb(k|0,I|0,m|0,n|0)|0;K=cb(H|0,l|0,J|0,C|0)|0;J=C;l=b+56|0;H=ab(0,c[l>>2]|0,32)|0;L=C;M=lb(H|0,L|0,g|0,h|0)|0;N=cb(K|0,J|0,M|0,C|0)|0;M=fb(N|0,C|0,1)|0;N=e+56|0;J=N;c[J>>2]=M;c[J+4>>2]=C;J=lb(A|0,B|0,A|0,B|0)|0;M=C;K=lb(k|0,I|0,s|0,t|0)|0;O=C;P=b+64|0;Q=ab(0,c[P>>2]|0,32)|0;R=C;S=lb(Q|0,R|0,g|0,h|0)|0;h=cb(S|0,C|0,K|0,O|0)|0;O=C;K=lb(H|0,L|0,m|0,n|0)|0;n=C;m=lb(y|0,E|0,w|0,x|0)|0;S=cb(m|0,C|0,K|0,n|0)|0;n=fb(S|0,C|0,1)|0;S=cb(h|0,O|0,n|0,C|0)|0;n=fb(S|0,C|0,1)|0;S=cb(n|0,C|0,J|0,M|0)|0;M=e+64|0;J=M;c[J>>2]=S;c[J+4>>2]=C;J=lb(y|0,E|0,A|0,B|0)|0;S=C;n=lb(k|0,I|0,w|0,x|0)|0;x=cb(n|0,C|0,J|0,S|0)|0;S=C;J=lb(H|0,L|0,s|0,t|0)|0;t=cb(x|0,S|0,J|0,C|0)|0;J=C;S=ab(0,c[j>>2]|0,32)|0;j=C;x=lb(Q|0,R|0,S|0,j|0)|0;s=cb(t|0,J|0,x|0,C|0)|0;x=C;J=ab(0,c[b>>2]|0,32)|0;t=C;n=c[b+72>>2]|0;b=ab(0,n|0,32)|0;w=C;O=lb(b|0,w|0,J|0,t|0)|0;t=cb(s|0,x|0,O|0,C|0)|0;O=fb(t|0,C|0,1)|0;t=e+72|0;c[t>>2]=O;c[t+4>>2]=C;t=lb(y|0,E|0,y|0,E|0)|0;O=C;x=lb(k|0,I|0,A|0,B|0)|0;B=cb(x|0,C|0,t|0,O|0)|0;O=C;t=ab(0,c[r>>2]|0,32)|0;r=C;x=lb(Q|0,R|0,t|0,r|0)|0;A=cb(B|0,O|0,x|0,C|0)|0;x=C;O=ab(0,c[u>>2]|0,32)|0;u=C;B=lb(H|0,L|0,O|0,u|0)|0;s=C;J=lb(b|0,w|0,S|0,j|0)|0;j=cb(J|0,C|0,B|0,s|0)|0;s=fb(j|0,C|0,1)|0;j=cb(A|0,x|0,s|0,C|0)|0;s=fb(j|0,C|0,1)|0;j=e+80|0;x=j;c[x>>2]=s;c[x+4>>2]=C;x=lb(k|0,I|0,y|0,E|0)|0;E=C;y=ab(0,c[q>>2]|0,32)|0;q=C;s=lb(H|0,L|0,y|0,q|0)|0;A=cb(s|0,C|0,x|0,E|0)|0;E=C;x=lb(Q|0,R|0,O|0,u|0)|0;s=cb(A|0,E|0,x|0,C|0)|0;x=C;E=lb(b|0,w|0,t|0,r|0)|0;r=cb(s|0,x|0,E|0,C|0)|0;E=C;x=fb(r|0,E|0,1)|0;s=C;t=e+88|0;c[t>>2]=x;c[t+4>>2]=s;t=lb(k|0,I|0,k|0,I|0)|0;I=C;k=lb(Q|0,R|0,y|0,q|0)|0;A=C;B=c[o>>2]|0;o=ab(0,B|0,32)|0;J=C;S=lb(H|0,L|0,o|0,J|0)|0;h=C;K=lb(b|0,w|0,O|0,u|0)|0;u=cb(K|0,C|0,S|0,h|0)|0;h=fb(u|0,C|0,1)|0;u=cb(h|0,C|0,k|0,A|0)|0;A=fb(u|0,C|0,1)|0;u=cb(A|0,C|0,t|0,I|0)|0;I=C;t=e+96|0;c[t>>2]=u;c[t+4>>2]=I;t=ab(0,c[f>>2]|0,32)|0;f=C;A=lb(H|0,L|0,t|0,f|0)|0;L=C;H=lb(Q|0,R|0,o|0,J|0)|0;J=cb(H|0,C|0,A|0,L|0)|0;L=C;A=lb(b|0,w|0,y|0,q|0)|0;q=cb(J|0,L|0,A|0,C|0)|0;A=C;L=fb(q|0,A|0,1)|0;J=C;y=e+104|0;c[y>>2]=L;c[y+4>>2]=J;y=c[l>>2]|0;l=ab(0,y|0,32)|0;H=C;o=lb(l|0,H|0,l|0,H|0)|0;k=C;h=lb(Q|0,R|0,t|0,f|0)|0;R=cb(h|0,C|0,o|0,k|0)|0;k=C;o=ab(0,B|0,31)|0;B=lb(b|0,w|0,o|0,C|0)|0;o=cb(R|0,k|0,B|0,C|0)|0;B=C;k=fb(o|0,B|0,1)|0;R=C;h=e+112|0;c[h>>2]=k;c[h+4>>2]=R;h=c[P>>2]|0;P=ab(0,h|0,32)|0;Q=C;S=lb(P|0,Q|0,l|0,H|0)|0;H=C;l=lb(b|0,w|0,t|0,f|0)|0;f=cb(l|0,C|0,S|0,H|0)|0;H=C;S=fb(f|0,H|0,1)|0;l=C;t=e+120|0;c[t>>2]=S;c[t+4>>2]=l;t=lb(P|0,Q|0,P|0,Q|0)|0;Q=C;P=ab(0,y|0,30)|0;y=lb(b|0,w|0,P|0,C|0)|0;P=cb(y|0,C|0,t|0,Q|0)|0;Q=C;t=e+128|0;c[t>>2]=P;c[t+4>>2]=Q;t=ab(0,h|0,31)|0;h=lb(b|0,w|0,t|0,C|0)|0;t=C;y=e+136|0;c[y>>2]=h;c[y+4>>2]=t;y=ab(0,n|0,31)|0;n=lb(y|0,C|0,b|0,w|0)|0;w=C;b=e+144|0;c[b>>2]=n;c[b+4>>2]=w;b=M;y=c[b>>2]|0;K=c[b+4>>2]|0;b=lb(n|0,w|0,18,0)|0;O=C;m=cb(n|0,w|0,y|0,K|0)|0;K=cb(m|0,C|0,b|0,O|0)|0;O=M;c[O>>2]=K;c[O+4>>2]=C;O=N;K=c[O>>2]|0;M=c[O+4>>2]|0;O=lb(h|0,t|0,18,0)|0;b=C;m=cb(K|0,M|0,h|0,t|0)|0;t=cb(m|0,C|0,O|0,b|0)|0;b=N;c[b>>2]=t;c[b+4>>2]=C;b=F;t=c[b>>2]|0;N=c[b+4>>2]|0;b=lb(P|0,Q|0,18,0)|0;O=C;m=cb(t|0,N|0,P|0,Q|0)|0;Q=cb(m|0,C|0,b|0,O|0)|0;O=F;c[O>>2]=Q;c[O+4>>2]=C;O=G;Q=c[O>>2]|0;F=c[O+4>>2]|0;O=lb(f|0,H|0,36,0)|0;H=C;f=cb(Q|0,F|0,S|0,l|0)|0;l=cb(f|0,C|0,O|0,H|0)|0;H=G;c[H>>2]=l;c[H+4>>2]=C;H=D;l=c[H>>2]|0;G=c[H+4>>2]|0;H=lb(o|0,B|0,36,0)|0;B=C;o=cb(l|0,G|0,k|0,R|0)|0;R=cb(o|0,C|0,H|0,B|0)|0;B=D;c[B>>2]=R;c[B+4>>2]=C;B=z;R=c[B>>2]|0;D=c[B+4>>2]|0;B=lb(q|0,A|0,36,0)|0;A=C;q=cb(R|0,D|0,L|0,J|0)|0;J=cb(q|0,C|0,B|0,A|0)|0;A=z;c[A>>2]=J;c[A+4>>2]=C;A=v;J=c[A>>2]|0;z=c[A+4>>2]|0;A=lb(u|0,I|0,18,0)|0;B=C;q=cb(J|0,z|0,u|0,I|0)|0;I=cb(q|0,C|0,A|0,B|0)|0;B=v;c[B>>2]=I;c[B+4>>2]=C;B=p;I=c[B>>2]|0;v=c[B+4>>2]|0;B=lb(r|0,E|0,36,0)|0;E=C;r=cb(I|0,v|0,x|0,s|0)|0;s=cb(r|0,C|0,B|0,E|0)|0;E=p;c[E>>2]=s;c[E+4>>2]=C;E=j;s=c[E>>2]|0;B=c[E+4>>2]|0;E=e;r=c[E>>2]|0;x=c[E+4>>2]|0;E=lb(s|0,B|0,18,0)|0;v=C;I=cb(r|0,x|0,s|0,B|0)|0;B=cb(I|0,C|0,E|0,v|0)|0;v=C;E=e;c[E>>2]=B;c[E+4>>2]=v;E=j;c[E>>2]=0;c[E+4>>2]=0;E=v;v=B;B=0;do I=cb(E>>31>>>6|0,0,v|0,E|0)|0,s=ab(I|0,C|0,26)|0,I=C,x=fb(s|0,I|0,26)|0,r=bb(v|0,E|0,x|0,C|0)|0,x=e+(B<<3)|0,c[x>>2]=r,c[x+4>>2]=C,x=e+((B|1)<<3)|0,r=x,A=cb(s|0,I|0,c[r>>2]|0,c[r+4>>2]|0)|0,r=C,I=cb(r>>31>>>7|0,0,A|0,r|0)|0,s=ab(I|0,C|0,25)|0,I=C,q=fb(s|0,I|0,25)|0,u=bb(A|0,r|0,q|0,C|0)|0,q=x,c[q>>2]=u,c[q+4>>2]=C,B=B+2|0,q=e+(B<<3)|0,u=q,v=cb(s|0,I|0,c[u>>2]|0,c[u+4>>2]|0)|0,E=C,u=q,c[u>>2]=v,c[u+4>>2]=E;while(B>>>0<10);B=j;E=c[B>>2]|0;v=c[B+4>>2]|0;B=e;u=c[B>>2]|0;q=c[B+4>>2]|0;B=lb(E|0,v|0,18,0)|0;I=C;s=cb(u|0,q|0,E|0,v|0)|0;v=cb(s|0,C|0,B|0,I|0)|0;I=C;B=j;c[B>>2]=0;c[B+4>>2]=0;B=cb(I>>31>>>6|0,0,v|0,I|0)|0;j=ab(B|0,C|0,26)|0;B=C;s=fb(j|0,B|0,26)|0;E=bb(v|0,I|0,s|0,C|0)|0;s=e;c[s>>2]=E;c[s+4>>2]=C;s=p;E=cb(j|0,B|0,c[s>>2]|0,c[s+4>>2]|0)|0;s=p;c[s>>2]=E;c[s+4>>2]=C;s=a;a=e;e=s+80|0;do c[s>>2]=c[a>>2],s=s+4|0,a=a+4|0;while((s|0)<(e|0));i=d;return}function Oa(){var a=0;!(c[2]|0)?a=56:a=c[(ja()|0)+60>>2]|0;return a|0}function Pa(a){a=a|0;var b=0;a>>>0>4294963200?(c[(Oa()|0)>>2]=0-a,b=-1):b=a;return b|0}function Qa(a){a=a|0;return 0}function Ra(a){a=a|0;return}function Sa(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=c[a+60>>2];a=Pa(ka(6,d|0)|0)|0;i=b;return a|0}function Ta(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]=g;c[f+16>>2]=d;(Pa(ta(140,f|0)|0)|0)<0?(c[g>>2]=-1,h=-1):h=c[g>>2]|0;i=e;return h|0}function Ua(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=i;i=i+48|0;f=e+16|0;g=e;h=e+32|0;j=a+28|0;k=c[j>>2]|0;c[h>>2]=k;l=a+20|0;m=(c[l>>2]|0)-k|0;c[h+4>>2]=m;c[h+8>>2]=b;c[h+12>>2]=d;b=a+60|0;k=a+44|0;n=h;h=2;o=m+d|0;while(1){!(c[2]|0)?(c[f>>2]=c[b>>2],c[f+4>>2]=n,c[f+8>>2]=h,p=Pa(wa(146,f|0)|0)|0):(ua(1,a|0),c[g>>2]=c[b>>2],c[g+4>>2]=n,c[g+8>>2]=h,m=Pa(wa(146,g|0)|0)|0,ga(0),p=m);if((o|0)==(p|0)){q=6;break}if((p|0)<0){r=n;s=h;q=8;break}m=o-p|0;t=c[n+4>>2]|0;p>>>0<=t>>>0?(h|0)==2?(c[j>>2]=(c[j>>2]|0)+p,u=t,v=p,w=n,x=2):(u=t,v=p,w=n,x=h):(y=c[k>>2]|0,c[j>>2]=y,c[l>>2]=y,u=c[n+12>>2]|0,v=p-t|0,w=n+8|0,x=h+-1|0);c[w>>2]=(c[w>>2]|0)+v;c[w+4>>2]=u-v;n=w;h=x;o=m}(q|0)==6?(o=c[k>>2]|0,c[a+16>>2]=o+(c[a+48>>2]|0),k=o,c[j>>2]=k,c[l>>2]=k,z=d):(q|0)==8&&(c[a+16>>2]=0,c[j>>2]=0,c[l>>2]=0,c[a>>2]=c[a>>2]|32,(s|0)==2?z=0:z=d-(c[r+4>>2]|0)|0);i=e;return z|0}function Va(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+80|0;g=f;c[b+36>>2]=3;((c[b>>2]&64|0)==0?(c[g>>2]=c[b+60>>2],c[g+4>>2]=21505,c[g+8>>2]=f+12,(ra(54,g|0)|0)!=0):0)&&(a[b+75>>0]=-1);g=Ua(b,d,e)|0;i=f;return g|0}function Wa(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;do if(a){if((c[a+76>>2]|0)<=-1){b=Ya(a)|0;break}d=(Qa(a)|0)==0;e=Ya(a)|0;d?b=e:(Ra(a),b=e)}else{!(c[13]|0)?f=0:f=Wa(c[13]|0)|0;ha(36);e=c[8]|0;if(!e)g=f;else{d=e;e=f;while(1){(c[d+76>>2]|0)>-1?h=Qa(d)|0:h=0;(c[d+20>>2]|0)>>>0>(c[d+28>>2]|0)>>>0?i=Ya(d)|0|e:i=e;h&&Ra(d);d=c[d+56>>2]|0;if(!d){g=i;break}else e=i}}sa(36);b=g}while(0);return b|0}function Xa(a){a=a|0;c[a+68>>2]|0||Ra(a);return}function Ya(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=a+20|0;d=a+28|0;((c[b>>2]|0)>>>0>(c[d>>2]|0)>>>0?(za[c[a+36>>2]&3](a,0,0)|0,(c[b>>2]|0)==0):0)?e=-1:(f=a+4|0,g=c[f>>2]|0,h=a+8|0,i=c[h>>2]|0,g>>>0<i>>>0&&za[c[a+40>>2]&3](a,g-i|0,1)|0,c[a+16>>2]=0,c[d>>2]=0,c[b>>2]=0,c[h>>2]=0,c[f>>2]=0,e=0);return e|0}function Za(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Pa=0,Qa=0,Ra=0;do if(a>>>0<245){b=a>>>0<11?16:a+11&-8;d=b>>>3;e=c[43]|0;f=e>>>d;if(f&3){g=(f&1^1)+d|0;h=212+(g<<1<<2)|0;i=h+8|0;j=c[i>>2]|0;k=j+8|0;l=c[k>>2]|0;do if((h|0)!=(l|0)){l>>>0<(c[47]|0)>>>0&&ma();m=l+12|0;if((c[m>>2]|0)==(j|0)){c[m>>2]=h;c[i>>2]=l;break}else ma()}else c[43]=e&~(1<<g);while(0);l=g<<3;c[j+4>>2]=l|3;i=j+l+4|0;c[i>>2]=c[i>>2]|1;n=k;return n|0}i=c[45]|0;if(b>>>0>i>>>0){if(f){l=2<<d;h=f<<d&(l|0-l);l=(h&0-h)+-1|0;h=l>>>12&16;m=l>>>h;l=m>>>5&8;o=m>>>l;m=o>>>2&4;p=o>>>m;o=p>>>1&2;q=p>>>o;p=q>>>1&1;r=(l|h|m|o|p)+(q>>>p)|0;p=212+(r<<1<<2)|0;q=p+8|0;o=c[q>>2]|0;m=o+8|0;h=c[m>>2]|0;do if((p|0)!=(h|0)){h>>>0<(c[47]|0)>>>0&&ma();l=h+12|0;if((c[l>>2]|0)==(o|0)){c[l>>2]=p;c[q>>2]=h;s=c[45]|0;break}else ma()}else c[43]=e&~(1<<r),s=i;while(0);i=(r<<3)-b|0;c[o+4>>2]=b|3;e=o+b|0;c[e+4>>2]=i|1;c[e+i>>2]=i;s&&(h=c[48]|0,q=s>>>3,p=212+(q<<1<<2)|0,d=c[43]|0,f=1<<q,d&f?(q=p+8|0,k=c[q>>2]|0,k>>>0<(c[47]|0)>>>0?ma():(t=q,u=k)):(c[43]=d|f,t=p+8|0,u=p),c[t>>2]=h,c[u+12>>2]=h,c[h+8>>2]=u,c[h+12>>2]=p);c[45]=i;c[48]=e;n=m;return n|0}e=c[44]|0;if(e){i=(e&0-e)+-1|0;e=i>>>12&16;p=i>>>e;i=p>>>5&8;h=p>>>i;p=h>>>2&4;f=h>>>p;h=f>>>1&2;d=f>>>h;f=d>>>1&1;k=c[476+((i|e|p|h|f)+(d>>>f)<<2)>>2]|0;f=(c[k+4>>2]&-8)-b|0;d=k;h=k;while(1){k=c[d+16>>2]|0;if(!k){p=c[d+20>>2]|0;if(!p){v=f;w=h;break}else x=p}else x=k;k=(c[x+4>>2]&-8)-b|0;p=k>>>0<f>>>0;f=p?k:f;d=x;h=p?x:h}h=c[47]|0;w>>>0<h>>>0&&ma();d=w+b|0;w>>>0>=d>>>0&&ma();f=c[w+24>>2]|0;m=c[w+12>>2]|0;do if((m|0)==(w|0)){o=w+20|0;r=c[o>>2]|0;if(!r){p=w+16|0;k=c[p>>2]|0;if(!k){y=0;break}else z=k,A=p}else z=r,A=o;while(1){o=z+20|0;r=c[o>>2]|0;if(r){z=r;A=o;continue}o=z+16|0;r=c[o>>2]|0;if(!r){B=z;C=A;break}else z=r,A=o}if(C>>>0<h>>>0)ma();else{c[C>>2]=0;y=B;break}}else{o=c[w+8>>2]|0;o>>>0<h>>>0&&ma();r=o+12|0;(c[r>>2]|0)!=(w|0)&&ma();p=m+8|0;if((c[p>>2]|0)==(w|0)){c[r>>2]=m;c[p>>2]=o;y=m;break}else ma()}while(0);do if(f){m=c[w+28>>2]|0;h=476+(m<<2)|0;if((w|0)==(c[h>>2]|0)){c[h>>2]=y;if(!y){c[44]=c[44]&~(1<<m);break}}else{f>>>0<(c[47]|0)>>>0&&ma();m=f+16|0;(c[m>>2]|0)==(w|0)?c[m>>2]=y:c[f+20>>2]=y;if(!y)break}m=c[47]|0;y>>>0<m>>>0&&ma();c[y+24>>2]=f;h=c[w+16>>2]|0;do if(h)if(h>>>0<m>>>0)ma();else{c[y+16>>2]=h;c[h+24>>2]=y;break}while(0);h=c[w+20>>2]|0;if(h)if(h>>>0<(c[47]|0)>>>0)ma();else{c[y+20>>2]=h;c[h+24>>2]=y;break}}while(0);v>>>0<16?(f=v+b|0,c[w+4>>2]=f|3,h=w+f+4|0,c[h>>2]=c[h>>2]|1):(c[w+4>>2]=b|3,c[d+4>>2]=v|1,c[d+v>>2]=v,h=c[45]|0,h&&(f=c[48]|0,m=h>>>3,h=212+(m<<1<<2)|0,o=c[43]|0,p=1<<m,o&p?(m=h+8|0,r=c[m>>2]|0,r>>>0<(c[47]|0)>>>0?ma():(D=m,E=r)):(c[43]=o|p,D=h+8|0,E=h),c[D>>2]=f,c[E+12>>2]=f,c[f+8>>2]=E,c[f+12>>2]=h),c[45]=v,c[48]=d);n=w+8|0;return n|0}else F=b}else F=b}else if(a>>>0<=4294967231){h=a+11|0;f=h&-8;p=c[44]|0;if(p){o=0-f|0;r=h>>>8;r?f>>>0>16777215?G=31:(h=(r+1048320|0)>>>16&8,m=r<<h,r=(m+520192|0)>>>16&4,k=m<<r,m=(k+245760|0)>>>16&2,e=14-(r|h|m)+(k<<m>>>15)|0,G=f>>>(e+7|0)&1|e<<1):G=0;e=c[476+(G<<2)>>2]|0;a:do if(!e)H=o,I=0,J=0,K=86;else{m=o;k=0;h=f<<((G|0)==31?0:25-(G>>>1)|0);r=e;i=0;while(1){q=c[r+4>>2]&-8;j=q-f|0;if(j>>>0<m>>>0)if((q|0)==(f|0)){L=j;M=r;N=r;K=90;break a}else O=j,P=r;else O=m,P=i;j=c[r+20>>2]|0;r=c[r+16+(h>>>31<<2)>>2]|0;q=(j|0)==0|(j|0)==(r|0)?k:j;j=(r|0)==0;if(j){H=O;I=q;J=P;K=86;break}else m=O,k=q,h=h<<(j&1^1),i=P}}while(0);if((K|0)==86){if((I|0)==0&(J|0)==0){e=2<<G;o=p&(e|0-e);if(!o){F=f;break}e=(o&0-o)+-1|0;o=e>>>12&16;b=e>>>o;e=b>>>5&8;d=b>>>e;b=d>>>2&4;i=d>>>b;d=i>>>1&2;h=i>>>d;i=h>>>1&1;Q=c[476+((e|o|b|d|i)+(h>>>i)<<2)>>2]|0}else Q=I;!Q?(R=H,S=J):(L=H,M=Q,N=J,K=90)}if((K|0)==90)while(1){K=0;i=(c[M+4>>2]&-8)-f|0;h=i>>>0<L>>>0;d=h?i:L;i=h?M:N;h=c[M+16>>2]|0;if(h){L=d;M=h;N=i;K=90;continue}M=c[M+20>>2]|0;if(!M){R=d;S=i;break}else L=d,N=i,K=90}if((S|0)!=0?R>>>0<((c[45]|0)-f|0)>>>0:0){p=c[47]|0;S>>>0<p>>>0&&ma();i=S+f|0;S>>>0>=i>>>0&&ma();d=c[S+24>>2]|0;h=c[S+12>>2]|0;do if((h|0)==(S|0)){b=S+20|0;o=c[b>>2]|0;if(!o){e=S+16|0;k=c[e>>2]|0;if(!k){T=0;break}else U=k,V=e}else U=o,V=b;while(1){b=U+20|0;o=c[b>>2]|0;if(o){U=o;V=b;continue}b=U+16|0;o=c[b>>2]|0;if(!o){W=U;X=V;break}else U=o,V=b}if(X>>>0<p>>>0)ma();else{c[X>>2]=0;T=W;break}}else{b=c[S+8>>2]|0;b>>>0<p>>>0&&ma();o=b+12|0;(c[o>>2]|0)!=(S|0)&&ma();e=h+8|0;if((c[e>>2]|0)==(S|0)){c[o>>2]=h;c[e>>2]=b;T=h;break}else ma()}while(0);do if(d){h=c[S+28>>2]|0;p=476+(h<<2)|0;if((S|0)==(c[p>>2]|0)){c[p>>2]=T;if(!T){c[44]=c[44]&~(1<<h);break}}else{d>>>0<(c[47]|0)>>>0&&ma();h=d+16|0;(c[h>>2]|0)==(S|0)?c[h>>2]=T:c[d+20>>2]=T;if(!T)break}h=c[47]|0;T>>>0<h>>>0&&ma();c[T+24>>2]=d;p=c[S+16>>2]|0;do if(p)if(p>>>0<h>>>0)ma();else{c[T+16>>2]=p;c[p+24>>2]=T;break}while(0);p=c[S+20>>2]|0;if(p)if(p>>>0<(c[47]|0)>>>0)ma();else{c[T+20>>2]=p;c[p+24>>2]=T;break}}while(0);do if(R>>>0>=16){c[S+4>>2]=f|3;c[i+4>>2]=R|1;c[i+R>>2]=R;d=R>>>3;if(R>>>0<256){p=212+(d<<1<<2)|0;h=c[43]|0;b=1<<d;h&b?(d=p+8|0,e=c[d>>2]|0,e>>>0<(c[47]|0)>>>0?ma():(Y=d,Z=e)):(c[43]=h|b,Y=p+8|0,Z=p);c[Y>>2]=i;c[Z+12>>2]=i;c[i+8>>2]=Z;c[i+12>>2]=p;break}p=R>>>8;p?R>>>0>16777215?_=31:(b=(p+1048320|0)>>>16&8,h=p<<b,p=(h+520192|0)>>>16&4,e=h<<p,h=(e+245760|0)>>>16&2,d=14-(p|b|h)+(e<<h>>>15)|0,_=R>>>(d+7|0)&1|d<<1):_=0;d=476+(_<<2)|0;c[i+28>>2]=_;h=i+16|0;c[h+4>>2]=0;c[h>>2]=0;h=c[44]|0;e=1<<_;if(!(h&e)){c[44]=h|e;c[d>>2]=i;c[i+24>>2]=d;c[i+12>>2]=i;c[i+8>>2]=i;break}e=R<<((_|0)==31?0:25-(_>>>1)|0);h=c[d>>2]|0;while(1){if((c[h+4>>2]&-8|0)==(R|0)){$=h;K=148;break}d=h+16+(e>>>31<<2)|0;b=c[d>>2]|0;if(!b){aa=d;ba=h;K=145;break}else e=e<<1,h=b}if((K|0)==145)if(aa>>>0<(c[47]|0)>>>0)ma();else{c[aa>>2]=i;c[i+24>>2]=ba;c[i+12>>2]=i;c[i+8>>2]=i;break}else if((K|0)==148){h=$+8|0;e=c[h>>2]|0;b=c[47]|0;if(e>>>0>=b>>>0&$>>>0>=b>>>0){c[e+12>>2]=i;c[h>>2]=i;c[i+8>>2]=e;c[i+12>>2]=$;c[i+24>>2]=0;break}else ma()}}else e=R+f|0,c[S+4>>2]=e|3,h=S+e+4|0,c[h>>2]=c[h>>2]|1;while(0);n=S+8|0;return n|0}else F=f}else F=f}else F=-1;while(0);S=c[45]|0;if(S>>>0>=F>>>0){R=S-F|0;$=c[48]|0;R>>>0>15?(ba=$+F|0,c[48]=ba,c[45]=R,c[ba+4>>2]=R|1,c[ba+R>>2]=R,c[$+4>>2]=F|3):(c[45]=0,c[48]=0,c[$+4>>2]=S|3,R=$+S+4|0,c[R>>2]=c[R>>2]|1);n=$+8|0;return n|0}$=c[46]|0;if($>>>0>F>>>0){R=$-F|0;c[46]=R;$=c[49]|0;S=$+F|0;c[49]=S;c[S+4>>2]=R|1;c[$+4>>2]=F|3;n=$+8|0;return n|0}do if(!(c[161]|0)){$=va(30)|0;if(!($+-1&$)){c[163]=$;c[162]=$;c[164]=-1;c[165]=-1;c[166]=0;c[154]=0;c[161]=(oa(0)|0)&-16^1431655768;break}else ma()}while(0);$=F+48|0;R=c[163]|0;S=F+47|0;ba=R+S|0;aa=0-R|0;R=ba&aa;if(R>>>0<=F>>>0){n=0;return n|0}_=c[153]|0;if((_|0)!=0?(Z=c[151]|0,Y=Z+R|0,Y>>>0<=Z>>>0|Y>>>0>_>>>0):0){n=0;return n|0}b:do if(!(c[154]&4)){_=c[49]|0;c:do if(_){Y=620;while(1){Z=c[Y>>2]|0;if(Z>>>0<=_>>>0?(T=Y+4|0,(Z+(c[T>>2]|0)|0)>>>0>_>>>0):0){ca=Y;da=T;break}Y=c[Y+8>>2]|0;if(!Y){K=173;break c}}Y=ba-(c[46]|0)&aa;if(Y>>>0<2147483647){T=na(Y|0)|0;if((T|0)==((c[ca>>2]|0)+(c[da>>2]|0)|0)){if((T|0)!=(-1|0)){ea=T;fa=Y;K=193;break b}}else ga=T,ha=Y,K=183}}else K=173;while(0);do if((K|0)==173?(_=na(0)|0,(_|0)!=(-1|0)):0){f=_;Y=c[162]|0;T=Y+-1|0;!(T&f)?ia=R:ia=R-f+(T+f&0-Y)|0;Y=c[151]|0;f=Y+ia|0;if(ia>>>0>F>>>0&ia>>>0<2147483647){T=c[153]|0;if((T|0)!=0?f>>>0<=Y>>>0|f>>>0>T>>>0:0)break;T=na(ia|0)|0;if((T|0)==(_|0)){ea=_;fa=ia;K=193;break b}else ga=T,ha=ia,K=183}}while(0);d:do if((K|0)==183){T=0-ha|0;do if($>>>0>ha>>>0&(ha>>>0<2147483647&(ga|0)!=(-1|0))?(_=c[163]|0,f=S-ha+_&0-_,f>>>0<2147483647):0)if((na(f|0)|0)==(-1|0)){na(T|0)|0;break d}else{ja=f+ha|0;break}else ja=ha;while(0);if((ga|0)!=(-1|0)){ea=ga;fa=ja;K=193;break b}}while(0);c[154]=c[154]|4;K=190}else K=190;while(0);((((K|0)==190?R>>>0<2147483647:0)?(ja=na(R|0)|0,R=na(0)|0,ja>>>0<R>>>0&((ja|0)!=(-1|0)&(R|0)!=(-1|0))):0)?(ga=R-ja|0,ga>>>0>(F+40|0)>>>0):0)&&(ea=ja,fa=ga,K=193);if((K|0)==193){ga=(c[151]|0)+fa|0;c[151]=ga;ga>>>0>(c[152]|0)>>>0&&(c[152]=ga);ga=c[49]|0;do if(ga){ja=620;do{R=c[ja>>2]|0;ha=ja+4|0;S=c[ha>>2]|0;if((ea|0)==(R+S|0)){ka=R;la=ha;pa=S;qa=ja;K=203;break}ja=c[ja+8>>2]|0}while((ja|0)!=0);if(((K|0)==203?(c[qa+12>>2]&8|0)==0:0)?ga>>>0<ea>>>0&ga>>>0>=ka>>>0:0){c[la>>2]=pa+fa;ja=ga+8|0;S=(ja&7|0)==0?0:0-ja&7;ja=ga+S|0;ha=fa-S+(c[46]|0)|0;c[49]=ja;c[46]=ha;c[ja+4>>2]=ha|1;c[ja+ha+4>>2]=40;c[50]=c[165];break}ha=c[47]|0;ea>>>0<ha>>>0?(c[47]=ea,ra=ea):ra=ha;ha=ea+fa|0;ja=620;while(1){if((c[ja>>2]|0)==(ha|0)){sa=ja;ta=ja;K=211;break}ja=c[ja+8>>2]|0;if(!ja){ua=620;break}}if((K|0)==211)if(!(c[ta+12>>2]&8)){c[sa>>2]=ea;ja=ta+4|0;c[ja>>2]=(c[ja>>2]|0)+fa;ja=ea+8|0;S=ea+((ja&7|0)==0?0:0-ja&7)|0;ja=ha+8|0;R=ha+((ja&7|0)==0?0:0-ja&7)|0;ja=S+F|0;$=R-S-F|0;c[S+4>>2]=F|3;do if((R|0)!=(ga|0)){if((R|0)==(c[48]|0)){ia=(c[45]|0)+$|0;c[45]=ia;c[48]=ja;c[ja+4>>2]=ia|1;c[ja+ia>>2]=ia;break}ia=c[R+4>>2]|0;if((ia&3|0)==1){da=ia&-8;ca=ia>>>3;e:do if(ia>>>0>=256){aa=c[R+24>>2]|0;ba=c[R+12>>2]|0;do if((ba|0)==(R|0)){T=R+16|0;f=T+4|0;_=c[f>>2]|0;if(!_){Y=c[T>>2]|0;if(!Y){wa=0;break}else xa=Y,ya=T}else xa=_,ya=f;while(1){f=xa+20|0;_=c[f>>2]|0;if(_){xa=_;ya=f;continue}f=xa+16|0;_=c[f>>2]|0;if(!_){za=xa;Aa=ya;break}else xa=_,ya=f}if(Aa>>>0<ra>>>0)ma();else{c[Aa>>2]=0;wa=za;break}}else{f=c[R+8>>2]|0;f>>>0<ra>>>0&&ma();_=f+12|0;(c[_>>2]|0)!=(R|0)&&ma();T=ba+8|0;if((c[T>>2]|0)==(R|0)){c[_>>2]=ba;c[T>>2]=f;wa=ba;break}else ma()}while(0);if(!aa)break;ba=c[R+28>>2]|0;f=476+(ba<<2)|0;do if((R|0)!=(c[f>>2]|0)){aa>>>0<(c[47]|0)>>>0&&ma();T=aa+16|0;(c[T>>2]|0)==(R|0)?c[T>>2]=wa:c[aa+20>>2]=wa;if(!wa)break e}else{c[f>>2]=wa;if(wa)break;c[44]=c[44]&~(1<<ba);break e}while(0);ba=c[47]|0;wa>>>0<ba>>>0&&ma();c[wa+24>>2]=aa;f=R+16|0;T=c[f>>2]|0;do if(T)if(T>>>0<ba>>>0)ma();else{c[wa+16>>2]=T;c[T+24>>2]=wa;break}while(0);T=c[f+4>>2]|0;if(!T)break;if(T>>>0<(c[47]|0)>>>0)ma();else{c[wa+20>>2]=T;c[T+24>>2]=wa;break}}else{T=c[R+8>>2]|0;ba=c[R+12>>2]|0;aa=212+(ca<<1<<2)|0;do if((T|0)!=(aa|0)){T>>>0<ra>>>0&&ma();if((c[T+12>>2]|0)==(R|0))break;ma()}while(0);if((ba|0)==(T|0)){c[43]=c[43]&~(1<<ca);break}do if((ba|0)==(aa|0))Ba=ba+8|0;else{ba>>>0<ra>>>0&&ma();f=ba+8|0;if((c[f>>2]|0)==(R|0)){Ba=f;break}ma()}while(0);c[T+12>>2]=ba;c[Ba>>2]=T}while(0);Ca=R+da|0;Da=da+$|0}else Ca=R,Da=$;ca=Ca+4|0;c[ca>>2]=c[ca>>2]&-2;c[ja+4>>2]=Da|1;c[ja+Da>>2]=Da;ca=Da>>>3;if(Da>>>0<256){ia=212+(ca<<1<<2)|0;aa=c[43]|0;f=1<<ca;do if(!(aa&f))c[43]=aa|f,Ea=ia+8|0,Fa=ia;else{ca=ia+8|0;_=c[ca>>2]|0;if(_>>>0>=(c[47]|0)>>>0){Ea=ca;Fa=_;break}ma()}while(0);c[Ea>>2]=ja;c[Fa+12>>2]=ja;c[ja+8>>2]=Fa;c[ja+12>>2]=ia;break}f=Da>>>8;do if(!f)Ga=0;else{if(Da>>>0>16777215){Ga=31;break}aa=(f+1048320|0)>>>16&8;da=f<<aa;_=(da+520192|0)>>>16&4;ca=da<<_;da=(ca+245760|0)>>>16&2;Y=14-(_|aa|da)+(ca<<da>>>15)|0;Ga=Da>>>(Y+7|0)&1|Y<<1}while(0);f=476+(Ga<<2)|0;c[ja+28>>2]=Ga;ia=ja+16|0;c[ia+4>>2]=0;c[ia>>2]=0;ia=c[44]|0;Y=1<<Ga;if(!(ia&Y)){c[44]=ia|Y;c[f>>2]=ja;c[ja+24>>2]=f;c[ja+12>>2]=ja;c[ja+8>>2]=ja;break}Y=Da<<((Ga|0)==31?0:25-(Ga>>>1)|0);ia=c[f>>2]|0;while(1){if((c[ia+4>>2]&-8|0)==(Da|0)){Ha=ia;K=281;break}f=ia+16+(Y>>>31<<2)|0;da=c[f>>2]|0;if(!da){Ia=f;Ja=ia;K=278;break}else Y=Y<<1,ia=da}if((K|0)==278)if(Ia>>>0<(c[47]|0)>>>0)ma();else{c[Ia>>2]=ja;c[ja+24>>2]=Ja;c[ja+12>>2]=ja;c[ja+8>>2]=ja;break}else if((K|0)==281){ia=Ha+8|0;Y=c[ia>>2]|0;da=c[47]|0;if(Y>>>0>=da>>>0&Ha>>>0>=da>>>0){c[Y+12>>2]=ja;c[ia>>2]=ja;c[ja+8>>2]=Y;c[ja+12>>2]=Ha;c[ja+24>>2]=0;break}else ma()}}else Y=(c[46]|0)+$|0,c[46]=Y,c[49]=ja,c[ja+4>>2]=Y|1;while(0);n=S+8|0;return n|0}else ua=620;while(1){ja=c[ua>>2]|0;if(ja>>>0<=ga>>>0?($=ja+(c[ua+4>>2]|0)|0,$>>>0>ga>>>0):0){Ka=$;break}ua=c[ua+8>>2]|0}S=Ka+-47|0;$=S+8|0;ja=S+(($&7|0)==0?0:0-$&7)|0;$=ga+16|0;S=ja>>>0<$>>>0?ga:ja;ja=S+8|0;R=ea+8|0;ha=(R&7|0)==0?0:0-R&7;R=ea+ha|0;Y=fa+-40-ha|0;c[49]=R;c[46]=Y;c[R+4>>2]=Y|1;c[R+Y+4>>2]=40;c[50]=c[165];Y=S+4|0;c[Y>>2]=27;c[ja>>2]=c[155];c[ja+4>>2]=c[156];c[ja+8>>2]=c[157];c[ja+12>>2]=c[158];c[155]=ea;c[156]=fa;c[158]=0;c[157]=ja;ja=S+24|0;do ja=ja+4|0,c[ja>>2]=7;while((ja+4|0)>>>0<Ka>>>0);if((S|0)!=(ga|0)){ja=S-ga|0;c[Y>>2]=c[Y>>2]&-2;c[ga+4>>2]=ja|1;c[S>>2]=ja;R=ja>>>3;if(ja>>>0<256){ha=212+(R<<1<<2)|0;ia=c[43]|0;da=1<<R;ia&da?(R=ha+8|0,f=c[R>>2]|0,f>>>0<(c[47]|0)>>>0?ma():(La=R,Ma=f)):(c[43]=ia|da,La=ha+8|0,Ma=ha);c[La>>2]=ga;c[Ma+12>>2]=ga;c[ga+8>>2]=Ma;c[ga+12>>2]=ha;break}ha=ja>>>8;ha?ja>>>0>16777215?Na=31:(da=(ha+1048320|0)>>>16&8,ia=ha<<da,ha=(ia+520192|0)>>>16&4,f=ia<<ha,ia=(f+245760|0)>>>16&2,R=14-(ha|da|ia)+(f<<ia>>>15)|0,Na=ja>>>(R+7|0)&1|R<<1):Na=0;R=476+(Na<<2)|0;c[ga+28>>2]=Na;c[ga+20>>2]=0;c[$>>2]=0;ia=c[44]|0;f=1<<Na;if(!(ia&f)){c[44]=ia|f;c[R>>2]=ga;c[ga+24>>2]=R;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break}f=ja<<((Na|0)==31?0:25-(Na>>>1)|0);ia=c[R>>2]|0;while(1){if((c[ia+4>>2]&-8|0)==(ja|0)){Pa=ia;K=307;break}R=ia+16+(f>>>31<<2)|0;da=c[R>>2]|0;if(!da){Qa=R;Ra=ia;K=304;break}else f=f<<1,ia=da}if((K|0)==304)if(Qa>>>0<(c[47]|0)>>>0)ma();else{c[Qa>>2]=ga;c[ga+24>>2]=Ra;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break}else if((K|0)==307){ia=Pa+8|0;f=c[ia>>2]|0;ja=c[47]|0;if(f>>>0>=ja>>>0&Pa>>>0>=ja>>>0){c[f+12>>2]=ga;c[ia>>2]=ga;c[ga+8>>2]=f;c[ga+12>>2]=Pa;c[ga+24>>2]=0;break}else ma()}}}else{f=c[47]|0;(f|0)==0|ea>>>0<f>>>0&&(c[47]=ea);c[155]=ea;c[156]=fa;c[158]=0;c[52]=c[161];c[51]=-1;f=0;do ia=212+(f<<1<<2)|0,c[ia+12>>2]=ia,c[ia+8>>2]=ia,f=f+1|0;while((f|0)!=32);f=ea+8|0;ia=(f&7|0)==0?0:0-f&7;f=ea+ia|0;ja=fa+-40-ia|0;c[49]=f;c[46]=ja;c[f+4>>2]=ja|1;c[f+ja+4>>2]=40;c[50]=c[165]}while(0);fa=c[46]|0;if(fa>>>0>F>>>0){ea=fa-F|0;c[46]=ea;fa=c[49]|0;ga=fa+F|0;c[49]=ga;c[ga+4>>2]=ea|1;c[fa+4>>2]=F|3;n=fa+8|0;return n|0}}c[(Oa()|0)>>2]=12;n=0;return n|0}function _a(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;if(!a)return;b=a+-8|0;d=c[47]|0;b>>>0<d>>>0&&ma();e=c[a+-4>>2]|0;a=e&3;(a|0)==1&&ma();f=e&-8;g=b+f|0;do if(!(e&1)){h=c[b>>2]|0;if(!a)return;i=b+(0-h)|0;j=h+f|0;i>>>0<d>>>0&&ma();if((i|0)==(c[48]|0)){k=g+4|0;l=c[k>>2]|0;if((l&3|0)!=3){m=i;n=j;break}c[45]=j;c[k>>2]=l&-2;c[i+4>>2]=j|1;c[i+j>>2]=j;return}l=h>>>3;if(h>>>0<256){h=c[i+8>>2]|0;k=c[i+12>>2]|0;o=212+(l<<1<<2)|0;(h|0)!=(o|0)&&(h>>>0<d>>>0&&ma(),(c[h+12>>2]|0)!=(i|0)&&ma());if((k|0)==(h|0)){c[43]=c[43]&~(1<<l);m=i;n=j;break}(k|0)!=(o|0)?(k>>>0<d>>>0&&ma(),o=k+8|0,(c[o>>2]|0)==(i|0)?p=o:ma()):p=k+8|0;c[h+12>>2]=k;c[p>>2]=h;m=i;n=j;break}h=c[i+24>>2]|0;k=c[i+12>>2]|0;do if((k|0)==(i|0)){o=i+16|0;l=o+4|0;q=c[l>>2]|0;if(!q){r=c[o>>2]|0;if(!r){s=0;break}else t=r,u=o}else t=q,u=l;while(1){l=t+20|0;q=c[l>>2]|0;if(q){t=q;u=l;continue}l=t+16|0;q=c[l>>2]|0;if(!q){v=t;w=u;break}else t=q,u=l}if(w>>>0<d>>>0)ma();else{c[w>>2]=0;s=v;break}}else{l=c[i+8>>2]|0;l>>>0<d>>>0&&ma();q=l+12|0;(c[q>>2]|0)!=(i|0)&&ma();o=k+8|0;if((c[o>>2]|0)==(i|0)){c[q>>2]=k;c[o>>2]=l;s=k;break}else ma()}while(0);if(h){k=c[i+28>>2]|0;l=476+(k<<2)|0;if((i|0)==(c[l>>2]|0)){c[l>>2]=s;if(!s){c[44]=c[44]&~(1<<k);m=i;n=j;break}}else{h>>>0<(c[47]|0)>>>0&&ma();k=h+16|0;(c[k>>2]|0)==(i|0)?c[k>>2]=s:c[h+20>>2]=s;if(!s){m=i;n=j;break}}k=c[47]|0;s>>>0<k>>>0&&ma();c[s+24>>2]=h;l=i+16|0;o=c[l>>2]|0;do if(o)if(o>>>0<k>>>0)ma();else{c[s+16>>2]=o;c[o+24>>2]=s;break}while(0);o=c[l+4>>2]|0;if(o)if(o>>>0<(c[47]|0)>>>0)ma();else{c[s+20>>2]=o;c[o+24>>2]=s;m=i;n=j;break}else m=i,n=j}else m=i,n=j}else m=b,n=f;while(0);m>>>0>=g>>>0&&ma();f=g+4|0;b=c[f>>2]|0;b&1||ma();if(!(b&2)){if((g|0)==(c[49]|0)){s=(c[46]|0)+n|0;c[46]=s;c[49]=m;c[m+4>>2]=s|1;if((m|0)!=(c[48]|0))return;c[48]=0;c[45]=0;return}if((g|0)==(c[48]|0)){s=(c[45]|0)+n|0;c[45]=s;c[48]=m;c[m+4>>2]=s|1;c[m+s>>2]=s;return}s=(b&-8)+n|0;d=b>>>3;do if(b>>>0>=256){v=c[g+24>>2]|0;w=c[g+12>>2]|0;do if((w|0)==(g|0)){u=g+16|0;t=u+4|0;p=c[t>>2]|0;if(!p){a=c[u>>2]|0;if(!a){x=0;break}else y=a,z=u}else y=p,z=t;while(1){t=y+20|0;p=c[t>>2]|0;if(p){y=p;z=t;continue}t=y+16|0;p=c[t>>2]|0;if(!p){A=y;B=z;break}else y=p,z=t}if(B>>>0<(c[47]|0)>>>0)ma();else{c[B>>2]=0;x=A;break}}else{t=c[g+8>>2]|0;t>>>0<(c[47]|0)>>>0&&ma();p=t+12|0;(c[p>>2]|0)!=(g|0)&&ma();u=w+8|0;if((c[u>>2]|0)==(g|0)){c[p>>2]=w;c[u>>2]=t;x=w;break}else ma()}while(0);if(v){w=c[g+28>>2]|0;j=476+(w<<2)|0;if((g|0)==(c[j>>2]|0)){c[j>>2]=x;if(!x){c[44]=c[44]&~(1<<w);break}}else{v>>>0<(c[47]|0)>>>0&&ma();w=v+16|0;(c[w>>2]|0)==(g|0)?c[w>>2]=x:c[v+20>>2]=x;if(!x)break}w=c[47]|0;x>>>0<w>>>0&&ma();c[x+24>>2]=v;j=g+16|0;i=c[j>>2]|0;do if(i)if(i>>>0<w>>>0)ma();else{c[x+16>>2]=i;c[i+24>>2]=x;break}while(0);i=c[j+4>>2]|0;if(i)if(i>>>0<(c[47]|0)>>>0)ma();else{c[x+20>>2]=i;c[i+24>>2]=x;break}}}else{i=c[g+8>>2]|0;w=c[g+12>>2]|0;v=212+(d<<1<<2)|0;(i|0)!=(v|0)&&(i>>>0<(c[47]|0)>>>0&&ma(),(c[i+12>>2]|0)!=(g|0)&&ma());if((w|0)==(i|0)){c[43]=c[43]&~(1<<d);break}(w|0)!=(v|0)?(w>>>0<(c[47]|0)>>>0&&ma(),v=w+8|0,(c[v>>2]|0)==(g|0)?C=v:ma()):C=w+8|0;c[i+12>>2]=w;c[C>>2]=i}while(0);c[m+4>>2]=s|1;c[m+s>>2]=s;if((m|0)==(c[48]|0)){c[45]=s;return}else D=s}else c[f>>2]=b&-2,c[m+4>>2]=n|1,c[m+n>>2]=n,D=n;n=D>>>3;if(D>>>0<256){b=212+(n<<1<<2)|0;f=c[43]|0;s=1<<n;f&s?(n=b+8|0,C=c[n>>2]|0,C>>>0<(c[47]|0)>>>0?ma():(E=n,F=C)):(c[43]=f|s,E=b+8|0,F=b);c[E>>2]=m;c[F+12>>2]=m;c[m+8>>2]=F;c[m+12>>2]=b;return}b=D>>>8;b?D>>>0>16777215?G=31:(F=(b+1048320|0)>>>16&8,E=b<<F,b=(E+520192|0)>>>16&4,s=E<<b,E=(s+245760|0)>>>16&2,f=14-(b|F|E)+(s<<E>>>15)|0,G=D>>>(f+7|0)&1|f<<1):G=0;f=476+(G<<2)|0;c[m+28>>2]=G;c[m+20>>2]=0;c[m+16>>2]=0;E=c[44]|0;s=1<<G;do if(E&s){F=D<<((G|0)==31?0:25-(G>>>1)|0);b=c[f>>2]|0;while(1){if((c[b+4>>2]&-8|0)==(D|0)){H=b;I=130;break}C=b+16+(F>>>31<<2)|0;n=c[C>>2]|0;if(!n){J=C;K=b;I=127;break}else F=F<<1,b=n}if((I|0)==127)if(J>>>0<(c[47]|0)>>>0)ma();else{c[J>>2]=m;c[m+24>>2]=K;c[m+12>>2]=m;c[m+8>>2]=m;break}else if((I|0)==130){b=H+8|0;F=c[b>>2]|0;j=c[47]|0;if(F>>>0>=j>>>0&H>>>0>=j>>>0){c[F+12>>2]=m;c[b>>2]=m;c[m+8>>2]=F;c[m+12>>2]=H;c[m+24>>2]=0;break}else ma()}}else c[44]=E|s,c[f>>2]=m,c[m+24>>2]=f,c[m+12>>2]=m,c[m+8>>2]=m;while(0);m=(c[51]|0)+-1|0;c[51]=m;if(!m)L=628;else return;while(1){m=c[L>>2]|0;if(!m)break;else L=m+8|0}c[51]=-1;return}function $a(){}function ab(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}C=(b|0)<0?-1:0;return b>>c-32|0}function bb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return(C=e,a-c>>>0|0)|0}function cb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return(C=b+d+(e>>>0<a>>>0|0)>>>0,e|0)|0}function db(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&-4;if(g){g=b+4-g|0;while((b|0)<(g|0))a[b>>0]=d,b=b+1|0}while((b|0)<(i|0))c[b>>2]=h,b=b+4|0}while((b|0)<(f|0))a[b>>0]=d,b=b+1|0;return b-e|0}function eb(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}C=0;return b>>>c-32|0}function fb(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}C=a<<c-32;return 0}function gb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return qa(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4)c[b>>2]=c[d>>2],b=b+4|0,d=d+4|0,e=e-4|0}while((e|0)>0)a[b>>0]=a[d>>0]|0,b=b+1|0,d=d+1|0,e=e-1|0;return f|0}function hb(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;return(c|0)<8?c+16|0:(a[m+(b>>>24)>>0]|0)+24|0}function ib(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=_(d,c)|0;f=a>>>16;a=(e>>>16)+(_(d,f)|0)|0;d=b>>>16;b=_(d,c)|0;return(C=(a>>>16)+(_(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function jb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=bb(e^a,f^b,e,f)|0;b=C;a=g^e;e=h^f;return bb((ob(i,b,bb(g^c,h^d,g,h)|0,C,0)|0)^a,C^e,a,e)|0}function kb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+16|0;g=f|0;h=b>>31|((b|0)<0?-1:0)<<1;j=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;k=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;m=bb(h^a,j^b,h,j)|0;b=C;ob(m,b,bb(k^d,l^e,k,l)|0,C,g)|0;l=bb(c[g>>2]^h,c[g+4>>2]^j,h,j)|0;j=C;i=f;return(C=j,l)|0}function lb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=ib(e,a)|0;f=C;return(C=(_(b,a)|0)+(_(d,e)|0)+f|f&0,c|0|0)|0}function mb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ob(a,b,c,d,0)|0}function nb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f|0;ob(a,b,d,e,g)|0;i=f;return(C=c[g+4>>2]|0,c[g>>2]|0)|0}function ob(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0;g=a;h=b;i=h;j=d;k=e;l=k;if(!i){m=(f|0)!=0;if(!l){m&&(c[f>>2]=(g>>>0)%(j>>>0),c[f+4>>2]=0);n=0;o=(g>>>0)/(j>>>0)>>>0;return(C=n,o)|0}else{if(!m){n=0;o=0;return(C=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return(C=n,o)|0}}m=(l|0)==0;do if(j){if(!m){p=(aa(l|0)|0)-(aa(i|0)|0)|0;if(p>>>0<=31){q=p+1|0;r=31-p|0;s=p-31>>31;t=q;u=g>>>(q>>>0)&s|i<<r;v=i>>>(q>>>0)&s;w=0;x=g<<r;break}if(!f){n=0;o=0;return(C=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(C=n,o)|0}r=j-1|0;if(r&j){s=(aa(j|0)|0)+33-(aa(i|0)|0)|0;q=64-s|0;p=32-s|0;y=p>>31;z=s-32|0;A=z>>31;t=s;u=p-1>>31&i>>>(z>>>0)|(i<<p|g>>>(s>>>0))&A;v=A&i>>>(s>>>0);w=g<<q&y;x=(i<<q|g>>>(z>>>0))&y|g<<p&s-33>>31;break}f&&(c[f>>2]=r&g,c[f+4>>2]=0);if((j|0)==1){n=h|b&0;o=a|0|0;return(C=n,o)|0}else{r=hb(j|0)|0;n=i>>>(r>>>0)|0;o=i<<32-r|g>>>(r>>>0)|0;return(C=n,o)|0}}else{if(m){f&&(c[f>>2]=(i>>>0)%(j>>>0),c[f+4>>2]=0);n=0;o=(i>>>0)/(j>>>0)>>>0;return(C=n,o)|0}if(!g){f&&(c[f>>2]=0,c[f+4>>2]=(i>>>0)%(l>>>0));n=0;o=(i>>>0)/(l>>>0)>>>0;return(C=n,o)|0}r=l-1|0;if(!(r&l)){f&&(c[f>>2]=a|0,c[f+4>>2]=r&i|b&0);n=0;o=i>>>((hb(l|0)|0)>>>0);return(C=n,o)|0}r=(aa(l|0)|0)-(aa(i|0)|0)|0;if(r>>>0<=30){s=r+1|0;p=31-r|0;t=s;u=i<<p|g>>>(s>>>0);v=i>>>(s>>>0);w=0;x=g<<p;break}if(!f){n=0;o=0;return(C=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(C=n,o)|0}while(0);if(!t)B=x,D=w,E=v,F=u,G=0,H=0;else{b=d|0|0;d=k|e&0;e=cb(b|0,d|0,-1,-1)|0;k=C;h=x;x=w;w=v;v=u;u=t;t=0;do a=h,h=x>>>31|h<<1,x=t|x<<1,g=v<<1|a>>>31|0,a=v>>>31|w<<1|0,bb(e,k,g,a)|0,i=C,l=i>>31|((i|0)<0?-1:0)<<1,t=l&1,v=bb(g,a,l&b,(((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1)&d)|0,w=C,u=u-1|0;while((u|0)!=0);B=h;D=x;E=w;F=v;G=0;H=t}t=D;D=0;f&&(c[f>>2]=F,c[f+4>>2]=E);n=(t|0)>>>31|(B|D)<<1|(D<<1|t>>>31)&0|G;o=(t<<1|0>>>31)&-2|H;return(C=n,o)|0}function pb(a,b){a=a|0;b=b|0;return ya[a&1](b|0)|0}function qb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return za[a&3](b|0,c|0,d|0)|0}function rb(a,b){a=a|0,b=b|0,Aa[a&1](b|0)}function sb(a){a=a|0;ba(0);return 0}function tb(a,b,c){a=a|0;b=b|0;c=c|0;ba(1);return 0}function ub(a){a=a|0,ba(2)}var ya=[sb,Sa],za=[tb,Va,Ta,Ua],Aa=[ub,Xa];return{_curve25519_donna:Ka,_free:_a,_i64Add:cb,_bitshift64Ashr:ab,_i64Subtract:bb,_memset:db,_malloc:Za,_memcpy:gb,_bitshift64Lshr:eb,_fflush:Wa,___errno_location:Oa,_bitshift64Shl:fb,runPostSets:$a,stackAlloc:Ba,stackSave:Ca,stackRestore:Da,establishStackSpace:Ea,setThrew:Fa,setTempRet0:Ia,getTempRet0:Ja,dynCall_ii:pb,dynCall_iiii:qb,dynCall_vi:rb}}(e.Na,e.Oa,buffer);e._curve25519_donna=Z._curve25519_donna;var Da=e._free=Z._free;e.runPostSets=Z.runPostSets;var cb=e._i64Add=Z._i64Add,ab=e._bitshift64Ashr=Z._bitshift64Ashr,bb=e._i64Subtract=Z._i64Subtract,db=e._memset=Z._memset,ua=e._malloc=Z._malloc,gc=e._memcpy=Z._memcpy,fb=e._bitshift64Lshr=Z._bitshift64Lshr;e._fflush=Z._fflush;e.___errno_location=Z.___errno_location;var gb=e._bitshift64Shl=Z._bitshift64Shl;e.dynCall_ii=Z.dynCall_ii;e.dynCall_iiii=Z.dynCall_iiii;e.dynCall_vi=Z.dynCall_vi;n.W=Z.stackAlloc;n.na=Z.stackSave;n.X=Z.stackRestore;n.md=Z.establishStackSpace;n.cb=Z.setTempRet0;n.Ua=Z.getTempRet0;function xc(a){this.name="ExitStatus",this.message="Program terminated with exit("+a+")",this.status=a}xc.prototype=Error();xc.prototype.constructor=xc;var Yc=null,Xa=function Zc(){e.calledRun||$c(),e.calledRun||(Xa=Zc)};e.callMain=e.jd=function(a){function b(){for(var a=0;3>a;a++)d.push(0)}assert(0==L,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(0==Pa.length,"cannot call main when preRun functions remain to be called");a=a||[];xa||(xa=!0,Oa(Qa));var c=a.length+1,d=[G(Va(e.thisProgram),"i8",0)];b();for(var f=0;f<c-1;f+=1)d.push(G(Va(a[f]),"i8",0)),b();d.push(0);d=G(d,"i32",0);try{var h=e._main(c,d,0);ad(h,!0)}catch(g){if(!(g instanceof xc))if("SimulateInfiniteLoop"==g)e.noExitRuntime=!0;else throw g&&"object"===typeof g&&g.stack&&e.S("exception thrown: "+[g,g.stack]),g}finally{}};function $c(a){function b(){if(!e.calledRun&&(e.calledRun=!0,!A)){xa||(xa=!0,Oa(Qa));Oa(Ra);e.onRuntimeInitialized&&e.onRuntimeInitialized();e._main&&bd&&e.callMain(a);if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)Ua(e.postRun.shift());Oa(Sa)}}a=a||e.arguments;null===Yc&&(Yc=Date.now());if(!(0<L)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)Ta(e.preRun.shift());Oa(Pa);0<L||e.calledRun||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),b()},1)):b())}}e.run=e.run=$c;function ad(a,b){if(!b||!e.noExitRuntime){!e.noExitRuntime&&(A=!0,m=void 0,Oa(K),e.onExit)&&e.onExit(a);throw new xc(a)}}e.exit=e.exit=ad;var cd=[];function z(a){void 0!==a?(e.print(a),e.S(a),a=JSON.stringify(a)):a="";A=!0;var b="abort("+a+") at "+Ea()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";cd&&cd.forEach(function(c){b=c(b,a)});throw b}e.abort=e.abort=z;if(e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();var bd=!0;e.noInitialRun&&(bd=!1);$c();module.exports=e}),null); __d("WAWebCryptoCurve25519",["Promise","WAWeb-curve25519-donna","WAWebABProps","WAWebCryptoLibraryUtilsApi","WAWebEnvironment","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h,i;function j(){i||(self.IS_SMALL_CURVE25519_BUFFER_ENABLED=x(),i=b("WAWeb-curve25519-donna"))}var k=new Uint8Array(32);k[0]=9;function a(a){var b;a===void 0?(b=new Uint8Array(32),self.crypto.getRandomValues(b)):b=new Uint8Array(a);b[0]&=248;b[31]&=127;b[31]|=64;return t({pubKey:32,privKey:b,basepoint:k},function(a){var d=i._curve25519_donna(a.pubKey,a.privKey,a.basepoint);if(d)throw c("err")("Curve25519:keyPair Error Code "+d);return{pubKey:s(a.pubKey,32),privKey:b.buffer}})}function e(a,d){return(h||(h=b("Promise"))).resolve().then(function(){return t({sharedKey:32,pubKey:a,privKey:d},function(a){var b=i._curve25519_donna(a.sharedKey,a.privKey,a.pubKey);if(b)throw c("err")("Curve25519:sharedSecret Error Code "+b);return s(a.sharedKey,32)})})}var l=5;function m(a){return a.pubKey.byteLength===33&&a.privKey.byteLength===32}function f(a){if(m(a))return a;if(a.pubKey.byteLength!==32||a.privKey.byteLength!==32)throw c("err")("Invalid key pair type");var b=n(a.pubKey),d=new Uint8Array(32);d.set(new Uint8Array(a.privKey));return{pubKey:b,privKey:d.buffer}}function n(a){if(a.byteLength!==32)throw c("err")("Invalid key type");var b=new Uint8Array(33);b[0]=l;b.set(new Uint8Array(a),1);return b.buffer}function o(a){return a.privKey.byteLength===32&&a.pubKey.byteLength===32}function p(a){if(o(a))return a;if(a.pubKey.byteLength!==33||a.privKey.byteLength!==32)throw c("err")("Invalid key pair type");var b=new Uint8Array(32),d=new Uint8Array(32);b.set(new Uint8Array(a.pubKey).subarray(1));d.set(new Uint8Array(a.privKey));return{pubKey:b.buffer,privKey:d.buffer}}function q(a){if(a.byteLength!==33)throw c("err")("Invalid key type");var b=new Uint8Array(32);b.set(new Uint8Array(a).subarray(1));return b.buffer}function r(a){if(typeof a==="number")return i._malloc(a);a=new Uint8Array(a.buffer||a);var b=i._malloc(a.length);i.HEAPU8.set(a,b);return b}function s(a,b){var c=new Uint8Array(b);c.set(i.HEAPU8.subarray(a,a+b));return c.buffer}function t(a,b){j();var c={};try{for(var d in a)c[d]=r(a[d]);return b(c)}finally{for(d in c)i._free(c[d])}}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield c("WAWebCryptoLibraryUtilsApi").signMsg(a.pubKey,a.privKey,b));return a});return v.apply(this,arguments)}function w(a,b,d){if(a.byteLength!==32)throw c("err")("Invalid public key length: "+a.byteLength);var e=new Uint8Array(33);e[0]=l;e.set(a,1);return c("WAWebCryptoLibraryUtilsApi").verifySignature(e,b,d)}function x(){return c("WAWebEnvironment").isWindows||d("WAWebABProps").getABPropConfigValue("web_curve25519_donna_small_buffer_size_enabled")}g.keyPair=a;g.sharedSecret=e;g.toSignalCurveKeyPair=f;g.toSignalCurvePubKey=n;g.toCurveKeyPair=p;g.toCurveKeyPubKey=q;g.calculateSignature=u;g.verifySignature=w}),98); __d("WAWebChatThreadLoggingLocalstorageMetadataHandler",["Promise","WABase64","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(){function a(){}var c=a.prototype;c.setOffset=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsMultiDevice").setChatThreadLoggingOffset(a);return!0});function c(b){return a.apply(this,arguments)}return c}();c.getOffset=function(){return(h||(h=b("Promise"))).resolve(d("WAWebUserPrefsMultiDevice").getChatThreadLoggingOffset())};c.setSecret=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsMultiDevice").setChatThreadLoggingSecretB64(d("WABase64").encodeB64(a));return!0});function c(b){return a.apply(this,arguments)}return c}();c.getSecret=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsMultiDevice").getChatThreadLoggingSecretB64());return a==null?null:d("WABase64").decodeB64(a)});function c(){return a.apply(this,arguments)}return c}();c.setLastUploadedStartTs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsMultiDevice").setChatThreadLoggingLastUploadedStartTs(a);return!0});function c(b){return a.apply(this,arguments)}return c}();c.getLastUploadedStartTs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsMultiDevice").getChatThreadLoggingLastUploadedStartTs());return(a=a)!=null?a:0});function c(){return a.apply(this,arguments)}return c}();return a}();g.ChatThreadLoggingMetadataLocalStorage=a}),98); __d("WAWebChatThreadLogging",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebChatThreadLoggingEventStore","WAWebChatThreadLoggingEventUploader","WAWebChatThreadLoggingLocalstorageMetadataHandler","WAWebChatThreadLoggingUtils","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa] labels: cannot generate getChatThreadIDHMAC because secret is unset"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: cannot generate getChatThreadID because secret is unset."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: cannot get user secret from the thread logging metadata store"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: uploaded "," events"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: attempting to upload but secret is unset."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: attempting to upload but offset is unset."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: uploading events"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: setting offset"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat thread logging initialized"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: will upload in "," seconds."]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: error handling activities"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: handling "," message(s)"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: setting thread_id_user_secret"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["getChatThreadLoggingState: init incomplete!"]);v=function(){return a};return a}var w=null;function x(){w==null&&d("WALogger").ERROR(v());return w}function a(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!0);a=a&&d("WAWebABProps").getABPropConfigValue("message_count_logging_md_enabled");(yield d("WAWebUserPrefsMultiDevice").getChatThreadLoggingLastUploadedStartTs())==null&&(yield d("WAWebUserPrefsMultiDevice").setChatThreadLoggingLastUploadedStartTs(0));var c=new(d("WAWebChatThreadLoggingLocalstorageMetadataHandler").ChatThreadLoggingMetadataLocalStorage)(),e=a?new(d("WAWebChatThreadLoggingEventStore").ChatThreadLoggingEventStoreImpl)(c):{handleMessages:function(){return(h||(h=b("Promise"))).resolve()},getEvent:function(){return(h||(h=b("Promise"))).resolve()},getBeforeInclusive:function(){return(h||(h=b("Promise"))).resolve([])},deleteBeforeInclusive:function(){return(h||(h=b("Promise"))).resolve(0)}};a=a?new(d("WAWebChatThreadLoggingEventUploader").ChatThreadLoggingEventUploaderImpl)(c,e):{uploadEvents:function(){return(h||(h=b("Promise"))).resolve(0)}};var f=(yield c.getOffset());f!=null&&D(f);w={metadataStore:c,eventStore:e,eventUploader:a};d("WALogger").LOG(q())});return y.apply(this,arguments)}function e(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;d("WALogger").LOG(p());b=(b=(yield (b=x())==null?void 0:b.metadataStore.setOffset(a)))!=null?b:!1;b&&D(a);return b});return z.apply(this,arguments)}function f(a){var c;d("WALogger").LOG(u());return(c=(c=x())==null?void 0:c.metadataStore.setSecret(a))!=null?c:(h||(h=b("Promise"))).resolve(!1)}function A(a){var b;d("WALogger").LOG(t(),a.length).devConsole({activities:a});(b=x())==null?void 0:b.eventStore.handleMessages(a)["catch"](function(a){d("WALogger").ERROR(s())})}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;d("WALogger").DEV(o());b=(yield (b=x())==null?void 0:b.metadataStore.getOffset());if(b==null){d("WALogger").ERROR(n());return}b=(yield (b=x())==null?void 0:b.metadataStore.getSecret());if(b==null){d("WALogger").ERROR(m());return}b=(yield (b=x())==null?void 0:b.eventUploader.uploadEvents(a));d("WALogger").DEV(l(),b)});return C.apply(this,arguments)}function D(a){var c=d("WATimeUtils").unixTime(),e=c-c%86400;e=e+a;e=e-c;e<0&&(e+=d("WATimeUtils").DAY_SECONDS);d("WALogger").DEV(r(),e);self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b;yield (b=x())==null?void 0:b.eventUploader.uploadEvents();D(a)}),e*1e3)}function E(){if(!c("gkx")("26258"))return x()}function F(){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield x());a=(yield a==null?void 0:a.metadataStore.getSecret());if(a==null){d("WALogger").WARN(k()).sendLogs("ctl-secret-unset");return null}return a});return G.apply(this,arguments)}function H(a,b){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield F());if(c==null){d("WALogger").WARN(j());return void 0}b=d("WAWebChatThreadLoggingUtils").getThreadDs((b=b)!=null?b:d("WATimeUtils").unixTime());return d("WAWebChatThreadLoggingUtils").generateThreadID(c,a,b)});return I.apply(this,arguments)}function J(a){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield F());if(b==null){d("WALogger").WARN(i()).sendLogs("ctwa-labels-thread-id-hmac-error");return null}return d("WAWebChatThreadLoggingUtils").generateThreadIDHMAC(b,a)});return K.apply(this,arguments)}g.initChatThreadLogging=a;g.setThreadDsTimeframeOffset=e;g.setThreadIdUserSecret=f;g.handleActivitiesForChatThreadLogging=A;g.uploadChatThreadLoggingEvents=B;g.getChatThreadLoggingStateDebug=E;g.getChatThreadID=H;g.getChatThreadIDHMAC=J}),98); __d("WAWebChatThreadLoggingBoolFlagFields",[],(function(a,b,c,d,e,f){b={isCartAddClicked:!1,isCtaOnPdpClicked:!1,isCommerceViewed:!1,viaContactlessChats:!1};var g=Object.freeze(b);c=Object.freeze(Object.keys(b));function a(a){if(!Object.prototype.hasOwnProperty.call(g,a))return null;a=a;return a}f.FLAG_FIELDS=g;f.FLAG_FIELD_NAMES=c;f.toMaybeBoolFlagActionType=a}),66); __d("WAWebChatThreadLoggingCountFields",[],(function(a,b,c,d,e,f){b={profileViews:0,statusViews:0,statusReplies:0,groupMembershipReplies:0,groupPrivateReplies:0,profileReplies:0,chatOverflowClicks:0,pdpViews:0,ordersSent:0,repliesSent:0,commentsReceived:0};var g=Object.freeze(b);c=Object.freeze(Object.keys(b));function a(a){if(!Object.prototype.hasOwnProperty.call(g,a))return null;a=a;return a}f.COUNT_FIELDS=g;f.COUNT_FIELD_NAMES=c;f.toMaybeCountActionType=a}),66); __d("WAPromiseQueue",["Promise"],(function(a,b,c,d,e,f){"use strict";var g;a=function(){function a(a){a===void 0&&(a=-1),this.$1=(g||(g=b("Promise"))).resolve(),this.$3=0,this.$2=a}var c=a.prototype;c.wait=function(){return this.$1};c.enqueueHandlers=function(a,b,c){var d=this;this.$3++;b=this.$1.then(function(){return a}).then(b,c);c=b.then();this.$1=h(b,this.$2)["finally"](function(){d.$3--});return c};c.enqueue=function(a){var b=this;this.$3++;a=this.$1.then(a);var c=a.then();this.$1=h(a,this.$2)["finally"](function(){b.$3--});return c};c.size=function(){return this.$3};return a}();c=function(){function a(a){a===void 0&&(a=-1),this.$1=new Map(),this.$2=a}var c=a.prototype;c.waitIfPending=function(a){return this.$1.get(a)};c.wait=function(a){return this.$1.get(a)||(g||(g=b("Promise"))).resolve()};c.enqueueHandlers=function(a,b,c,d){c=this.wait(a).then(function(){return b}).then(c,d);return this.$3(a,c)};c.enqueue=function(a,b){b=this.wait(a).then(b);return this.$3(a,b)};c.$3=function(a,b){var c=this,d=b.then(),e,f=function(){c.$1.get(a)===e&&c.$1["delete"](a)};e=h(b,this.$2).then(f,f);this.$1.set(a,e);return d};return a}();function h(a,c){if(c>=0)return new(g||(g=b("Promise")))(function(b){var d=function(){return void b()};a.then(d,d);setTimeout(d,c)});else return a.then(i,i)}function i(){}f.PromiseQueue=a;f.PromiseQueueMap=c}),66); __d("WAWebPromiseQueue",["Promise","WALogger","WAPromiseQueue","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseQueue: wait called more than 10 times"]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(b){return a.call(this,b)||this}var e=c.prototype;e.wait=function(){return a.prototype.wait.call(this)};e.waitUntilResolved=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var e=this;c===void 0&&(c=0);if(c>9){d("WALogger").ERROR(i()).sendLogs("promise_queue_long_wait_time");return}var f=a.prototype.wait.call(this);return new(h||(h=b("Promise")))(function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,d){try{yield f,f!==a.prototype.wait.call(e)&&(yield e.waitUntilResolved(c+1)),b()}catch(a){d(a)}});return function(a,b){return d.apply(this,arguments)}}())});function e(a){return c.apply(this,arguments)}return e}();return c}(d("WAPromiseQueue").PromiseQueue);g.PromiseQueue=a}),98); __d("WAWebSchemaChatThreadLoggingPendingEvents",["WAWebChatThreadLoggingBoolFlagFields","WAWebChatThreadLoggingCountFields","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){var h="chat-thread-logging-pending-events";function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add(h).version(d("WAWebModelStorageVersions").addChatThreadLoggingTable(),[e(["chatId","startTs"]),b("chatId"),b("startTs"),c("msgsSent"),c("msgsReceived"),c("msgsRead"),c("viewOnceMsgsSent"),c("viewOnceMsgsReceived"),c("viewOnceMessagesOpened"),c("callOffersSent"),c("callOffersReceived"),c("totalCallDuration"),c("commerceMsgsSent"),c("commerceMsgsReceived"),c("pdpInquiriesSent"),c("reactionsSent"),c("reactionsReceived"),c("forwardMessagesSent"),c("forwardMessagesReceived"),c("editedMsgsSent"),c("botMessagesSent"),c("botMessagesReceived"),c("botMessagesEdited"),c("eventCreationMessagesSent"),c("eventCreationMessagesReceived"),c("eventResponseMessagesSent"),c("eventResponseMessagesReceived")].concat([].concat(d("WAWebChatThreadLoggingCountFields").COUNT_FIELD_NAMES,d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELD_NAMES).map(function(a){return c(a)}))).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table(h)}g.addTable=a;g.getChatThreadLoggingPendingEventsTable=b}),98); __d("WAWebApiChatThreadLoggingPendingEvents",["WAWebChatThreadLoggingBoolFlagFields","WAWebChatThreadLoggingCountFields","WAWebPromiseQueue","WAWebSchemaChatThreadLoggingPendingEvents","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=Object.freeze({msgsSent:0,msgsReceived:0,msgsRead:0,viewOnceMsgsSent:0,viewOnceMsgsReceived:0,viewOnceMessagesOpened:0,callOffersSent:0,callOffersReceived:0,totalCallDuration:0,commerceMsgsSent:0,commerceMsgsReceived:0,pdpInquiriesSent:0,reactionsSent:0,reactionsReceived:0,forwardMessagesSent:0,forwardMessagesReceived:0,editedMsgsSent:0,botMessagesSent:0,botMessagesReceived:0,botMessagesEdited:0,eventCreationMessagesSent:0,eventCreationMessagesReceived:0,eventResponseMessagesSent:0,eventResponseMessagesReceived:0}),i=Object.freeze(babelHelpers["extends"]({},d("WAWebChatThreadLoggingCountFields").COUNT_FIELDS,d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELDS,h)),j=new(d("WAWebPromiseQueue").PromiseQueue)();function a(a){return j.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebSchemaChatThreadLoggingPendingEvents").getChatThreadLoggingPendingEventsTable().bulkGet(a.map(function(a){var b=a.chatId;a=a.startTs;return[b,a]})));b=b.map(function(b,c){var e=a[c],f=k(e.chatId,e.startTs,b);d("WAWebChatThreadLoggingCountFields").COUNT_FIELD_NAMES.forEach(function(a){f[a]+=e[a]});d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELD_NAMES.forEach(function(a){f[a]=e[a]});f.msgsSent+=e.addMsgsSent;f.msgsReceived+=e.addMsgsReceived;f.msgsRead+=e.addMsgsRead;f.viewOnceMsgsSent+=e.addViewOnceMsgsSent;f.viewOnceMsgsReceived+=e.addViewOnceMsgsReceived;f.viewOnceMessagesOpened+=e.addViewOnceMsgsOpened;f.callOffersSent+=e.addCallOffersSent;f.callOffersReceived+=e.addCallOffersReceived;f.totalCallDuration+=e.addTotalCallDuration;f.commerceMsgsSent+=e.addCommerceMsgsSent;f.commerceMsgsReceived+=e.addCommerceMsgsReceived;f.pdpInquiriesSent+=e.addPdpInquiriesSent;f.reactionsSent+=e.addReactionsSent;f.reactionsReceived+=e.addReactionsReceived;f.forwardMessagesSent+=e.addForwardMessagesSent;f.forwardMessagesReceived+=e.addForwardMessagesReceived;f.editedMsgsSent+=e.addEditedMsgsSent;f.botMessagesSent+=e.addBotMessagesSent;f.botMessagesReceived+=e.addBotMessagesReceived;f.botMessagesEdited+=e.addBotMessagesEdited;f.eventCreationMessagesSent+=e.addEventCreationMessagesSent;f.eventCreationMessagesReceived+=e.addEventCreationMessagesReceived;f.eventResponseMessagesSent+=e.addEventResponseMessagesSent;f.eventResponseMessagesReceived+=e.addEventResponseMessagesReceived;return f});return d("WAWebSchemaChatThreadLoggingPendingEvents").getChatThreadLoggingPendingEventsTable().bulkCreateOrReplace(b)}))}function k(a,b,c){if(c==null)return babelHelpers["extends"]({chatId:a,startTs:b},i);d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELD_NAMES.forEach(function(a){c[a]==null&&(c[a]=i[a])});d("WAWebChatThreadLoggingCountFields").COUNT_FIELD_NAMES.forEach(function(a){c[a]==null&&(c[a]=i[a])});Object.keys(h).forEach(function(a){c[a]==null&&(c[a]=i[a])});return c}function c(a,b){return d("WAWebSchemaChatThreadLoggingPendingEvents").getChatThreadLoggingPendingEventsTable().get([a,b])}function e(a){return d("WAWebSchemaChatThreadLoggingPendingEvents").getChatThreadLoggingPendingEventsTable().lessThan(["startTs"],a,{inclusive:!0})}function f(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaChatThreadLoggingPendingEvents").getChatThreadLoggingPendingEventsTable().bulkDeleteRange(["startTs"],0,a+1));return a});return l.apply(this,arguments)}g.createOrUpdateChatEvents=a;g.getChatEvent=c;g.getBeforeInclusive=e;g.deleteBeforeInclusive=f}),98); __d("WAWebSchemaVerifiedBusinessName",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.removeColumn;a.add("verified-business-name").version(d("WAWebModelStorageVersions").verifiedBusinessNameCreateTable(),[e("id"),c("serial"),c("name"),c("isApi"),c("level"),c("actualActors"),c("hostStorage"),c("privacyModeTs")]).version(d("WAWebModelStorageVersions").verifiedBusinessNameAddPrivacyMode(),[c("privacyMode"),b("actualActors"),b("hostStorage"),b("privacyModeTs")]).version(d("WAWebModelStorageVersions").verifiedBusinessNameAddSmbColumn(),[c("isSmb")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("verified-business-name")}g.addTable=a;g.getVerifiedBusinessNameTable=b}),98); __d("WAWebDBBulkGetIsContactABusiness",["WAWebSchemaVerifiedBusinessName"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable().bulkGet(a.map(function(a){return(a=a==null?void 0:a.user)!=null?a:""})).then(function(a){return a.map(function(a){return a!=null})})}g.bulkGetIsContactABusiness=a}),98); __d("WAWebDBGetStarredMessagesForChat",["Promise","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebSchemaMessage"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e){return(h||(h=b("Promise"))).resolve().then(function(){if(e!=null)return d("WAWebSchemaMessage").getMessageTable().get(e.toString())}).then(function(b){b=b==null?[d("WAWebDBMessageUtils").endOfChat(a),Infinity]:[b.internalId,b.isStarred];var e=[d("WAWebDBMessageUtils").beginningOfChat(a),0];return d("WAWebSchemaMessage").getMessageTable().between(["internalId","isStarred"],e,b,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:c}).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})})}g.getStarredMessagesForChat=a}),98); __d("WAWebSchemaGroupMetadata",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions"],(function(a,b,c,d,e,f,g){e=b("$InternalEnum")({ADMIN_ADD:"admin_add",ALL_MEMBER_ADD:"all_member_add"});function a(){var a=d("WAWebModelStorageUtils").getStorage();a.add_OPTIMIZED_EXPERIMENT("group-metadata",function(a,b){var c=b.addColumn,e=b.addUserDefinedPrimaryKey,f=b.addIndex;b=b.removeColumn;return a.version((a=d("WAWebModelStorageVersions")).groupMetadataCreateTable(),[e("id"),c("subject"),c("subjectTime"),c("creation"),c("owner"),c("desc"),c("descId"),c("descTime"),c("descOwner"),c("restrict"),c("announce"),c("a_v_id"),c("noFrequentlyForwarded"),c("ephemeralDuration"),c("membershipApprovalMode"),c("size"),c("support"),c("suspended"),c("terminated"),c("notAddedByContact"),c("addedBy"),c("parentGroup"),c("subgroups"),c("isParentGroup"),c("isParentGroupClosed"),c("defaultSubgroup"),c("generalSubgroup"),c("growthLockExpiration"),c("growthLockType"),c("lastActivityTimestamp"),c("lastSeenActivityTimestamp"),c("isLidAddressingMode"),c("reportToAdminMode"),c("lastReportToAdminTimestamp"),c("allowNonAdminSubGroupCreation"),c("memberAddMode"),c("generalChatAutoAddDisabled"),c("unreadMentionMapDB"),c("pendingUnreadMentionCountDB"),c("disappearingModeTrigger"),c("disappearingModeInitiatedByMe"),c("hasCapi"),c("hiddenSubgroup"),c("groupSafetyCheck"),c("groupAdder"),c("lastCommunityPollTimestamp")]).version(a.migrateSubgroupsArray(),[b("subgroups"),c("unjoinedSubgroups")]).version(a.removeUnjoinedSubgroups(),[b("unjoinedSubgroups")]).version(a.removeSpamColumnsInGroupMetadata(),[b("notAddedByContact"),b("addedBy")]).version(a.addCommunityAdminPromotionColumns(),[c("displayCadminPromotion")]).version(a.renameCommunityAdminPromotionColumns(),[b("displayCadminPromotion"),c("acknowledgedCadminPromotion")]).version(a.removeCommunityAdminPromotionColumns(),[b("acknowledgedCadminPromotion")]).version(a.addIncognitoGroupMetadataColumn(),[c("incognito")]).version(a.groupMetadataAddParentIndex(),[f("parentGroup")]).version(a.addUnreadMentionMetadataColumn(),[c("unreadMentionMetadata")]).version(a.removeUnreadMentionMetadataColumn(),[b("unreadMentionMetadata")]).version(a.addEphemeralityIndexToGroupMetadataTable(),[f("ephemeralDuration")]).view(function(a){return a}).commit()})}function c(){return d("WAWebModelStorageUtils").getStorage().table("group-metadata")}g.MemberAddMode=e;g.addTable=a;g.getGroupMetadataTable=c}),98); __d("WAWebDBGroupsGroupMetadata",["Promise","WABatcher","WALogger","WAWebABProps","WAWebModelStorageUtils","WAWebSchemaGroupMetadata","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["persistGroupMetadataBatched: persisting "," records"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["persistGroupMetadataBatched: aggregating "," changes"]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.groupInfos;yield d("WAWebModelStorageUtils").getStorage().lock(["group-metadata"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=(yield b.bulkGet(c.map(function(a){return a.id.toString()})));a=c.map(function(a,b){var c;b=e[b];var f={subject:a.subject,subjectTime:a.subjectTime||0},g={announce:a.announce,a_v_id:a.a_v_id||0};c={desc:a.desc,descId:a.descId,descOwner:(c=a.descOwner)==null?void 0:c.toString(),descTime:a.descTime||0};if(b){var h=b.subjectTime||0,i=b.a_v_id||0,j=b.descTime||0;h>f.subjectTime&&(f={subject:b.subject,subjectTime:h});i>g.a_v_id&&(g={announce:b.announce,a_v_id:i});j>c.descTime&&(c={desc:b.desc,descId:b.descId,descOwner:b.descOwner,descTime:j})}d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")?h={ephemeralDuration:a.ephemeralDuration||0,disappearingModeTrigger:a.disappearingModeTrigger,disappearingModeInitiatedByMe:a.disappearingModeInitiatedByMe}:h={ephemeralDuration:a.ephemeralDuration||0};i=babelHelpers["extends"]({id:a.id.toString(),creation:a.creation,owner:(i=a.owner)==null?void 0:i.toString(),restrict:a.restrict,noFrequentlyForwarded:a.noFrequentlyForwarded,membershipApprovalMode:a.membershipApprovalMode,memberAddMode:a.memberAddMode,growthLockExpiration:a.growthLockExpiration,growthLockType:a.growthLockType,size:a.size||0,support:(j=a.support)!=null?j:!1,suspended:(i=a.suspended)!=null?i:!1,terminated:(j=a.terminated)!=null?j:!1,parentGroup:(i=a.parentGroup)==null?void 0:i.toString(),isParentGroup:a.isParentGroup,isParentGroupClosed:a.isParentGroupClosed,defaultSubgroup:a.defaultSubgroup,generalSubgroup:a.generalSubgroup,lastActivityTimestamp:(j=b==null?void 0:b.lastActivityTimestamp)!=null?j:0,lastSeenActivityTimestamp:(i=b==null?void 0:b.lastSeenActivityTimestamp)!=null?i:0,incognito:a.incognito,isLidAddressingMode:a.isLidAddressingMode,reportToAdminMode:(j=a.reportToAdminMode)!=null?j:!1,lastReportToAdminTimestamp:b==null?void 0:b.lastReportToAdminTimestamp,allowNonAdminSubGroupCreation:a.allowNonAdminSubGroupCreation,generalChatAutoAddDisabled:a.generalChatAutoAddDisabled,hasCapi:a.hasCapi===!0,hiddenSubgroup:a.hiddenSubgroup,groupSafetyCheck:a.groupSafetyCheck,lastCommunityPollTimestamp:b==null?void 0:b.lastCommunityPollTimestamp},f,c,g,h);return a.groupAdder!=null?babelHelpers["extends"]({},i,{groupAdder:(j=a.groupAdder)==null?void 0:j.toString()}):i});return b.bulkCreateOrMerge(a)});return function(a){return e.apply(this,arguments)}}())});return k.apply(this,arguments)}function c(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.groupWid;var b=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(String(a)));return!b?null:{id:a,owner:b.owner==null?null:d("WAWebWidFactory").createWid(b.owner),creation:b.creation,desc:(a=b.desc)!=null?a:void 0,descId:(a=b.descId)!=null?a:void 0,descOwner:b.descOwner==null?null:d("WAWebWidFactory").createWid(b.descOwner),descTime:(a=b.descTime)!=null?a:void 0,restrict:b.restrict||!1,announce:b.announce||!1,noFrequentlyForwarded:b.noFrequentlyForwarded||!1,ephemeralDuration:b.ephemeralDuration||0,membershipApprovalMode:(a=b.membershipApprovalMode)!=null?a:!1,memberAddMode:b.memberAddMode,subject:b.subject,support:b.support===!0,lastActivityTimestamp:(a=b.lastActivityTimestamp)!=null?a:0,lastSeenActivityTimestamp:(a=b.lastSeenActivityTimestamp)!=null?a:0,lastReportToAdminTimestamp:(a=b.lastReportToAdminTimestamp)!=null?a:null,incognito:b.incognito,isLidAddressingMode:b.isLidAddressingMode,allowNonAdminSubGroupCreation:(a=b.allowNonAdminSubGroupCreation)!=null?a:!1,generalChatAutoAddDisabled:(a=b.generalChatAutoAddDisabled)!=null?a:!1,hasCapi:b.hasCapi===!0,lastCommunityPollTimestamp:(a=b.lastCommunityPollTimestamp)!=null?a:0}});return l.apply(this,arguments)}var m=function(){var a=3e3;return d("WABatcher").batch({delayMs:a},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(j(),a.length);b=b();d("WALogger").DEV(i(),b.length);yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().bulkCreateOrMerge(b);return a.map(function(a){return void 0});function b(){return Array.from(a.reduce(function(a,b){var c;a.set(b.id,babelHelpers["extends"]({},(c=a.get(b.id))!=null?c:{},b));return a},new Map()).values())}});return function(b){return a.apply(this,arguments)}}())}();function e(a,b,c){c===void 0&&(c=!1);return c?m(babelHelpers["extends"]({id:a.toString()},b)):d("WAWebSchemaGroupMetadata").getGroupMetadataTable().createOrMerge(a.toString(),babelHelpers["extends"]({id:a.toString()},b))}function f(a){return d("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(a.toString())}function n(a){return a.length===0?(h||(h=b("Promise"))).resolve([]):d("WAWebSchemaGroupMetadata").getGroupMetadataTable().bulkGet(a.map(function(a){return a==null?"":a.toString()}))}g.updateGroupMetadataTable=a;g.getGroupMetadataUNSAFE=c;g.persistGroupMetadata=e;g.getGroupMetadata=f;g.bulkGetGroupMetadata=n}),98); __d("WAWebSchemaBusinessProfile",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("business-profile").version(d("WAWebModelStorageVersions").businessProfileCreateTable(),[b("id"),c("commandsDescription"),c("commands"),c("prompts"),c("automatedType"),c("welcomeMsgProtocolMode")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("business-profile")}g.addTable=a;g.getBusinessProfileTable=b}),98); __d("WAWebUsernameTypes",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({PNH_CTWA:"ctwa",USERNAME:"username",GENERAL:"general"});f.LidOriginType=a}),66); __d("WAWebWamEnumChatOriginsType",[],(function(a,b,c,d,e,f){a=Object.freeze({LID_USERNAME:1,LID_CTWA:2,OTHERS:3});f.CHAT_ORIGINS_TYPE=a}),66); __d("WAWebChatThreadLoggingEventStore",["Promise","WAJids","WALogger","WAShiftTimer","WAWebABProps","WAWebApiChat","WAWebApiChatThreadLoggingPendingEvents","WAWebApiContact","WAWebBotTypes","WAWebChatThreadLoggingBoolFlagFields","WAWebChatThreadLoggingCountFields","WAWebChatThreadLoggingUtils","WAWebDBBulkGetIsContactABusiness","WAWebDBGetStarredMessagesForChat","WAWebDBGroupsGroupMetadata","WAWebGroupType","WAWebLidAwareContactsDB","WAWebSchemaBusinessProfile","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebUsernameTypes","WAWebWamEnumChatOriginsType","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingEventStoreImpl: flushing cache with "," updates"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Passed event store info type not valid: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingEventStoreImpl: lastUploadedStartTs=",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingEventStoreImpl: handleMessages: offset unset."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingEventStoreImpl: flush error"]);m=function(){return a};return a}var n=5;a=function(){function a(a,b){var c=this;this.metadataStore=a;this.$1=new Map();this.$2=(a=b)!=null?a:n;this.$3=new(d("WAShiftTimer").ShiftTimer)(function(){c.$4()["catch"](function(a){d("WALogger").WARN(m()).devConsole(a)})})}var e=a.prototype;e.handleMessages=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=(yield this.metadataStore.getOffset());if(c==null){d("WALogger").LOG(l());return}var e=(yield this.metadataStore.getLastUploadedStartTs());d("WALogger").LOG(k(),e);a.forEach(function(a){var f;if(!d("WAWebChatThreadLoggingUtils").shouldUpdateChatEvent(c,a.ts,e))return;var g=d("WAWebChatThreadLoggingUtils").computeStartTs(c,a.ts),h=a.chatId.toString({legacy:!0}),i=h+"_"+String(g),k=b.$1.get(i);f=(f=k)!=null?f:babelHelpers["extends"]({},d("WAWebChatThreadLoggingCountFields").COUNT_FIELDS,d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELDS,{startTs:g,chatId:h,addMsgsSent:0,addMsgsReceived:0,addMsgsRead:0,addViewOnceMsgsSent:0,addViewOnceMsgsReceived:0,addViewOnceMsgsOpened:0,addCallOffersSent:0,addCallOffersReceived:0,addTotalCallDuration:0,addCommerceMsgsSent:0,addCommerceMsgsReceived:0,addPdpInquiriesSent:0,addReactionsSent:0,addReactionsReceived:0,addForwardMessagesSent:0,addForwardMessagesReceived:0,addEditedMsgsSent:0,addBotMessagesSent:0,addBotMessagesReceived:0,addBotMessagesEdited:0,addEventCreationMessagesSent:0,addEventCreationMessagesReceived:0,addEventResponseMessagesSent:0,addEventResponseMessagesReceived:0});k==null&&b.$1.set(i,f);g=d("WAWebChatThreadLoggingCountFields").toMaybeCountActionType(a.activityType);h=d("WAWebChatThreadLoggingBoolFlagFields").toMaybeBoolFlagActionType(a.activityType);if(g!=null)f[g]+=1;else if(h!=null)f[h]=a.boolValue===void 0?!0:a.boolValue;else switch(a.activityType){case"msgSend":f.addMsgsSent+=1;a.isViewOnce&&(f.addViewOnceMsgsSent+=1);a.isCommerceMessage===!0&&(f.addCommerceMsgsSent+=1);a.isPdpInquiry===!0&&(f.addPdpInquiriesSent+=1);a.isReply&&(f.repliesSent+=1);a.isReaction&&(f.addReactionsSent+=1);a.isForwarded&&(f.addForwardMessagesSent+=1);a.isEdit&&(f.addEditedMsgsSent+=1);a.isBot&&(f.addBotMessagesSent+=1);a.isEventCreation&&(f.addEventCreationMessagesSent+=1);a.isEventResponse&&(f.addEventResponseMessagesSent+=1);break;case"msgReceive":f.addMsgsReceived+=1;a.isViewOnce&&(f.addViewOnceMsgsReceived+=1);a.isCommerceMessage===!0&&(f.addCommerceMsgsReceived+=1);a.isReaction&&(f.addReactionsReceived+=1);a.isForwarded&&(f.addForwardMessagesReceived+=1);a.isBot&&(a.isEdit?f.addBotMessagesEdited+=1:f.addBotMessagesReceived+=1);a.isEventCreation&&(f.addEventCreationMessagesReceived+=1);a.isEventResponse&&(f.addEventResponseMessagesReceived+=1);break;case"msgRead":f.addMsgsRead+=a.readCount;break;case"viewOnceOpen":f.addViewOnceMsgsOpened+=1;break;case"voipCall":a.outgoing?f.addCallOffersSent+=1:f.addCallOffersReceived+=1;f.addTotalCallDuration+=a.durationInSeconds;break;default:d("WALogger").WARN(j(),a.activityType)}});yield this.$5()});function c(b){return a.apply(this,arguments)}return c}();e.$5=function(){this.$3.onOrBefore(this.$2*1e3)};e.$4=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=Array.from(this.$1.values());d("WALogger").DEV(i(),a.length).devConsole({updates:a});this.$1.clear();yield d("WAWebApiChatThreadLoggingPendingEvents").createOrUpdateChatEvents(a)});function c(){return a.apply(this,arguments)}return c}();e.$6=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=d("WAWebApiChat").bulkGetChats(a.map(function(a){return d("WAWebWidFactory").createWid(a.chatId)})),f=e.then(function(a){return t(a)}),g=e.then(function(a){return u(a)}),i=e.then(function(a){return v(a)}),j=e.then(function(a){return x(a)}),k=e.then(function(a){return y(a)});w=e.then(w);e=(yield (h||(h=b("Promise"))).all([e,f,g,i,w,j,k]));var l=e[0],m=e[1],n=e[2],o=e[3],p=e[4],q=e[5],r=e[6],s=d("WAWebUserPrefsMeUser").getMeUser()!=null?yield d("WAWebChatThreadLoggingUtils").getMeHasUsername():!1;return h.all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f,g,h,i,j=l[b],k=c("WAWebWid").isGroup(a.chatId),t=o[b];e=d("WAWebBotTypes").BizBotAutomatedType.cast((e=q[b])==null?void 0:e.automatedType);f=k?{isAGroup:k,groupSize:(f=(f=p[b])==null?void 0:(f=f.participants)==null?void 0:f.length)!=null?f:1,groupType:t==null?d("WAWebGroupType").GroupType.DEFAULT:d("WAWebGroupType").getGroupTypeFromGroupMetadata(t)}:{isAGroup:k,isAContact:yield d("WAWebApiContact").isAddressBookContact(a.chatId),automatedType:e};k=d("WAWebWidFactory").createWid(a.chatId);e=((e=j==null?void 0:j.pin)!=null?e:0)>0;g=(g=j==null?void 0:j.archive)!=null?g:!1;var u=m[b];h=(h=j==null?void 0:j.unreadCount)!=null?h:0;i=((i=j==null?void 0:j.muteExpiration)!=null?i:0)!==0;var v=n[b]?yield d("WAWebChatThreadLoggingUtils").getBizCatalogType(k):null,w=c("WAWebWid").isLid(a.chatId)||(t==null?void 0:t.defaultSubgroup)===!0,x=d("WAWebUserPrefsMeUser").isMeAccount(k),y=k.isBot(),z=d("WAWebChatThreadLoggingUtils").getWamDisappearingModeInitiatedByMe(j==null?void 0:j.disappearingModeInitiatedByMe),A=d("WAWebChatThreadLoggingUtils").getWamDisappearingModeTrigger(j==null?void 0:j.disappearingModeTrigger);d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")&&c("WAWebWid").isGroup(j==null?void 0:j.id)&&(z=d("WAWebChatThreadLoggingUtils").getWamDisappearingModeInitiatedByMe(t==null?void 0:t.disappearingModeInitiatedByMe),A=d("WAWebChatThreadLoggingUtils").getWamDisappearingModeTriggerGroups(t==null?void 0:t.disappearingModeTrigger));t=s;var B=null;b=r[b];if(b!=null){var C=d("WAWebWidFactory").createWid(b.id).isLid()?"lid":"pn";B=d("WAWebChatThreadLoggingUtils").getOppositeVisibleIdentificationType(b,C)}b=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.OTHERS;k.isLid()&&(b=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_CTWA);if(j==null?void 0:j.lidOriginType)switch(j==null?void 0:j.lidOriginType){case d("WAWebUsernameTypes").LidOriginType.PNH_CTWA:b=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_CTWA;break;case d("WAWebUsernameTypes").LidOriginType.USERNAME:b=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_USERNAME;break;case d("WAWebUsernameTypes").LidOriginType.GENERAL:b=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.OTHERS;break}return babelHelpers["extends"]({},a,{isPinned:e,isArchived:g,contactInfo:f,messagesStarred:u,messagesUnread:h,isMuted:i,bizCatalogType:v,isPnhEnabledChat:w,isMessageYourself:x,isUserAgent:y,ephemeralityInitiator:z,ephemeralityTriggerAction:A,hasUsername:t,oppositeVisibleIdentification:B,chatOrigins:b})});return function(b,c){return a.apply(this,arguments)}}()));function t(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return a==null?0:(yield d("WAWebDBGetStarredMessagesForChat").getStarredMessagesForChat(d("WAWebWidFactory").createWid(a.id),Number.MAX_SAFE_INTEGER)).length});return function(b){return a.apply(this,arguments)}}()))}function u(a){return d("WAWebDBBulkGetIsContactABusiness").bulkGetIsContactABusiness(a.map(function(a){return a==null?null:d("WAWebWidFactory").createWid(a.id)}))}function v(a){return d("WAWebDBGroupsGroupMetadata").bulkGetGroupMetadata(a.map(function(a){return a==null?null:d("WAWebWidFactory").createWid(a.id)}))}function w(a){return d("WAWebSchemaParticipant").getParticipantTable().bulkGet(a.map(function(a){return a==null?"":d("WAWebWidFactory").createWid(a.id).toString()}))}function x(a){return d("WAWebSchemaBusinessProfile").getBusinessProfileTable().bulkGet(a.map(function(a){return a==null?"":d("WAWebWidFactory").createWid(a.id).toString()}))}function y(a){return c("WAWebLidAwareContactsDB").bulkGet(a.map(function(a){if(a==null)return null;a=d("WAWebWidFactory").createWid(a.id);if(!a.isUserNotPSA())return null;if(a.isLid()){var b=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));if(b==null)return a.toString()}return d("WAJids").toPhoneUserJid(a.user.toString())}).filter(Boolean))}});function e(b){return a.apply(this,arguments)}return e}();e.getEvent=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){this.$1.size>0&&(yield this.$4());a=(yield d("WAWebApiChatThreadLoggingPendingEvents").getChatEvent(a,b));return a==null?null:(yield this.$6([a]))[0]});function c(b,c){return a.apply(this,arguments)}return c}();e.getBeforeInclusive=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){this.$1.size>0&&(yield this.$4());return this.$6(yield d("WAWebApiChatThreadLoggingPendingEvents").getBeforeInclusive(a))});function c(b){return a.apply(this,arguments)}return c}();e.deleteBeforeInclusive=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){this.$1.size>0&&(yield this.$4());return d("WAWebApiChatThreadLoggingPendingEvents").deleteBeforeInclusive(a)});function c(b){return a.apply(this,arguments)}return c}();return a}();g.ChatThreadLoggingEventStoreImpl=a}),98); __d("WAWebWamEnumAiChatOriginsType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,AI_HOME:1,AI_TAB_TEXT:2,AI_TAB_VOICE:3});f.AI_CHAT_ORIGINS_TYPE=a}),66); __d("WAWebWamEnumBizCatalogType",[],(function(a,b,c,d,e,f){a=Object.freeze({SHOPS:0,NATIVE:1});f.BIZ_CATALOG_TYPE=a}),66); __d("WAWebWamEnumBlockReason",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,NO_LONGER_NEEDED:1,NO_SIGN_UP:2,SPAM:3,OFFENSIVE_MESSAGES:4,OTP_DID_NOT_REQUEST:5});f.BLOCK_REASON=a}),66); __d("WAWebWamEnumChatMutedType",[],(function(a,b,c,d,e,f){a=Object.freeze({NOT_MUTED:1,MUTED_NO_NOTIFICATIONS:2,MUTED_SILENT_NOTIFICATIONS:3});f.CHAT_MUTED_TYPE=a}),66); __d("WAWebWamEnumChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:1,SMB:2,ENT:3,INTEROP:4});f.CHAT_TYPE=a}),66); __d("WAWebWamEnumGaStatus",[],(function(a,b,c,d,e,f){a=Object.freeze({NEW:0,RETAINED:1,RESURRECTED:2});f.GA_STATUS=a}),66); __d("WAWebWamEnumGroupInfoSettingType",[],(function(a,b,c,d,e,f){a=Object.freeze({ADMINS_ONLY:1,ALL_PARTICIPANTS:2});f.GROUP_INFO_SETTING_TYPE=a}),66); __d("WAWebWamEnumOppositeVisibleIdentificationType",[],(function(a,b,c,d,e,f){a=Object.freeze({PHONE_NUMBER:1,SAVED_CONTACT_NAME:2,USERNAME:3,MASKED_PHONE_NUMBER:4,VERIFIED_BUSINESS_NAME:5,PLACEHOLDER:6,PUSHNAME:7});f.OPPOSITE_VISIBLE_IDENTIFICATION_TYPE=a}),66); __d("WAWebChatMessageCountsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAiChatOriginsType","WAWebWamEnumBizCatalogType","WAWebWamEnumBlockReason","WAWebWamEnumChatMutedType","WAWebWamEnumChatOriginsType","WAWebWamEnumChatType","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumGaStatus","WAWebWamEnumGroupInfoSettingType","WAWebWamEnumOppositeVisibleIdentificationType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ChatMessageCounts:[1644,{aiChatOrigins:[224,d("WAWebWamEnumAiChatOriginsType").AI_CHAT_ORIGINS_TYPE],aiDiscoveryTab:[195,a.TYPES.STRING],aptTestId:[212,a.TYPES.STRING],audioMessagesReceived:[149,a.TYPES.INTEGER],audioMessagesSent:[150,a.TYPES.INTEGER],autoReplyFromIcebreakerSent:[190,a.TYPES.INTEGER],awayMsgsSent:[56,a.TYPES.INTEGER],bizCatalogType:[60,d("WAWebWamEnumBizCatalogType").BIZ_CATALOG_TYPE],bizConversationDepth:[65,a.TYPES.INTEGER],blockReason:[33,d("WAWebWamEnumBlockReason").BLOCK_REASON],bottomSheetAnimatedSent:[206,a.TYPES.INTEGER],bottomSheetEditedAnimatedSent:[207,a.TYPES.INTEGER],bottomSheetEditedSent:[208,a.TYPES.INTEGER],bottomSheetForwardMessagesSent:[196,a.TYPES.INTEGER],bottomSheetImagesEdited:[209,a.TYPES.INTEGER],bottomSheetImagesGenerated:[197,a.TYPES.INTEGER],bottomSheetMemuImagesGenerated:[220,a.TYPES.INTEGER],bottomSheetMemuInitiated:[221,a.TYPES.INTEGER],bottomSheetMemuMessagesSent:[222,a.TYPES.INTEGER],bottomSheetMessagesDownloaded:[198,a.TYPES.INTEGER],bottomSheetMessagesReceived:[199,a.TYPES.INTEGER],bottomSheetMessagesSent:[200,a.TYPES.INTEGER],bottomSheetPromptsInitiated:[201,a.TYPES.INTEGER],bottomSheetRegeneratedSent:[210,a.TYPES.INTEGER],broadcastMsgsReceived:[30,a.TYPES.INTEGER],broadcastMsgsSent:[29,a.TYPES.INTEGER],callOffersReceived:[27,a.TYPES.INTEGER],callOffersSent:[26,a.TYPES.INTEGER],callsResultBusy:[70,a.TYPES.INTEGER],callsResultCancelled:[71,a.TYPES.INTEGER],callsResultConnected:[72,a.TYPES.INTEGER],callsResultError:[78,a.TYPES.INTEGER],callsResultMissed:[73,a.TYPES.INTEGER],callsResultRejected:[74,a.TYPES.INTEGER],canEditDmSettings:[88,a.TYPES.BOOLEAN],cartViews:[86,a.TYPES.INTEGER],chatEphemeralityDuration:[15,a.TYPES.INTEGER],chatMuted:[8,d("WAWebWamEnumChatMutedType").CHAT_MUTED_TYPE],chatOrigins:[179,d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE],chatOverflowClicks:[79,a.TYPES.INTEGER],chatTypeInd:[2,d("WAWebWamEnumChatType").CHAT_TYPE],collectionInquiriesSent:[44,a.TYPES.INTEGER],commandSheetShow:[174,a.TYPES.INTEGER],commentsReceived:[126,a.TYPES.INTEGER],commerceMsgsReceived:[41,a.TYPES.INTEGER],commerceMsgsSent:[40,a.TYPES.INTEGER],deviceLanguage:[219,a.TYPES.STRING],disappearingChatInitiator:[59,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],documentMessagesReceived:[151,a.TYPES.INTEGER],documentMessagesSent:[152,a.TYPES.INTEGER],editedMsgsSent:[100,a.TYPES.INTEGER],emuFlashPlaybacks:[184,a.TYPES.INTEGER],emuFlashPreviewShow:[182,a.TYPES.INTEGER],emuFlashSent:[183,a.TYPES.INTEGER],entryPointConversionApp:[47,a.TYPES.STRING],entryPointConversionSource:[46,a.TYPES.STRING],ephemeralMessagesReceived:[14,a.TYPES.INTEGER],ephemeralMessagesSent:[13,a.TYPES.INTEGER],ephemeralMessagesUnreadExpired:[69,a.TYPES.INTEGER],ephemeralityInitiator:[109,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],ephemeralityTriggerAction:[110,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],eventCreationMessagesReceived:[142,a.TYPES.INTEGER],eventCreationMessagesSent:[143,a.TYPES.INTEGER],eventResponseMessagesReceived:[144,a.TYPES.INTEGER],eventResponseMessagesSent:[145,a.TYPES.INTEGER],fbCtaInquiriesSent:[45,a.TYPES.INTEGER],firstResponseTime:[25,a.TYPES.INTEGER],fmxNotMvClicks:[229,a.TYPES.INTEGER],forwardAudioMessagesReceived:[153,a.TYPES.INTEGER],forwardAudioMessagesSent:[154,a.TYPES.INTEGER],forwardDocumentMessagesReceived:[155,a.TYPES.INTEGER],forwardDocumentMessagesSent:[156,a.TYPES.INTEGER],forwardGifMessagesReceived:[157,a.TYPES.INTEGER],forwardGifMessagesSent:[158,a.TYPES.INTEGER],forwardMessagesReceived:[89,a.TYPES.INTEGER],forwardMessagesSent:[90,a.TYPES.INTEGER],forwardPhotoMessagesReceived:[128,a.TYPES.INTEGER],forwardPhotoMessagesSent:[129,a.TYPES.INTEGER],forwardPtvMessagesReceived:[159,a.TYPES.INTEGER],forwardPtvMessagesSent:[160,a.TYPES.INTEGER],forwardStatusReplyMessagesReceived:[161,a.TYPES.INTEGER],forwardStatusReplyMessagesSent:[162,a.TYPES.INTEGER],forwardStickerMessagesReceived:[163,a.TYPES.INTEGER],forwardStickerMessagesSent:[164,a.TYPES.INTEGER],forwardTextMessagesReceived:[130,a.TYPES.INTEGER],forwardTextMessagesSent:[131,a.TYPES.INTEGER],forwardUrlMessagesReceived:[132,a.TYPES.INTEGER],forwardUrlMessagesSent:[133,a.TYPES.INTEGER],forwardVideoMessagesReceived:[165,a.TYPES.INTEGER],forwardVideoMessagesSent:[166,a.TYPES.INTEGER],gaStatus:[22,d("WAWebWamEnumGaStatus").GA_STATUS],gifMessagesReceived:[167,a.TYPES.INTEGER],gifMessagesSent:[168,a.TYPES.INTEGER],googleSearchClick:[214,a.TYPES.INTEGER],googleSearchShow:[215,a.TYPES.INTEGER],greetingMsgsSent:[57,a.TYPES.INTEGER],groupContainsBiz:[75,a.TYPES.BOOLEAN],groupInfoSetting:[87,d("WAWebWamEnumGroupInfoSettingType").GROUP_INFO_SETTING_TYPE],groupLimitSharingOnCnt:[225,a.TYPES.INTEGER],groupMembershipReplies:[51,a.TYPES.INTEGER],groupPrivateReplies:[52,a.TYPES.INTEGER],groupSize:[19,a.TYPES.INTEGER],hasReplied1On1:[216,a.TYPES.BOOLEAN],hasUsername:[180,a.TYPES.BOOLEAN],hasUsernamePin:[228,a.TYPES.BOOLEAN],imagineCommandClick:[175,a.TYPES.INTEGER],imagineMeMessagesSent:[202,a.TYPES.INTEGER],imagineMePromptsInitiatedCount:[203,a.TYPES.INTEGER],imagineMentionClick:[146,a.TYPES.INTEGER],imagineMentionShow:[176,a.TYPES.INTEGER],isAContact:[6,a.TYPES.BOOLEAN],isAContactAtThreadCreation:[213,a.TYPES.BOOLEAN],isAGroup:[5,a.TYPES.BOOLEAN],isArchived:[10,a.TYPES.BOOLEAN],isAutoMuted:[108,a.TYPES.BOOLEAN],isBizMvFrictionEligible:[230,a.TYPES.BOOLEAN],isBlocked:[32,a.TYPES.BOOLEAN],isCartAddClicked:[36,a.TYPES.BOOLEAN],isCommerceViewed:[35,a.TYPES.BOOLEAN],isCtaOnPdpClicked:[37,a.TYPES.BOOLEAN],isDeleted:[185,a.TYPES.BOOLEAN],isInviteCreatedThread:[106,a.TYPES.BOOLEAN],isLabelled:[54,a.TYPES.BOOLEAN],isMessageYourself:[91,a.TYPES.BOOLEAN],isMetaAiAssistant:[211,a.TYPES.BOOLEAN],isOppositePartyInitiated:[62,a.TYPES.BOOLEAN],isPinned:[9,a.TYPES.BOOLEAN],isPnhEnabledChat:[92,a.TYPES.BOOLEAN],isReported:[186,a.TYPES.BOOLEAN],isUser1pBizBotChat:[141,a.TYPES.BOOLEAN],isUser3pBotChat:[140,a.TYPES.BOOLEAN],isUserAgent:[111,a.TYPES.BOOLEAN],isUserCreatedAgent:[123,a.TYPES.BOOLEAN],isWaPayRegistered:[81,a.TYPES.BOOLEAN],labelledMsgs:[55,a.TYPES.INTEGER],limitSharingOption:[226,a.TYPES.BOOLEAN],locationsSent:[96,a.TYPES.INTEGER],markedReadCnt:[193,a.TYPES.INTEGER],markedReadMessageCnt:[194,a.TYPES.INTEGER],messagesRead:[127,a.TYPES.INTEGER],messagesReceived:[4,a.TYPES.INTEGER],messagesSent:[3,a.TYPES.INTEGER],messagesStarred:[12,a.TYPES.INTEGER],messagesUnread:[11,a.TYPES.INTEGER],metaAiMentionClick:[147,a.TYPES.INTEGER],metaAiMentionShow:[148,a.TYPES.INTEGER],newThread:[68,a.TYPES.BOOLEAN],notMvImpressions:[231,a.TYPES.INTEGER],odReceived:[82,a.TYPES.INTEGER],oppositePartyHasBusinessIntent:[204,a.TYPES.BOOLEAN],oppositePartyHasProfilePhoto:[217,a.TYPES.BOOLEAN],oppositePartyLimitSharingOption:[227,a.TYPES.BOOLEAN],oppositeVisibleIdentification:[181,d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE],ordersSent:[38,a.TYPES.INTEGER],p2mOdNnpTransactionsSent:[83,a.TYPES.INTEGER],p2mOdNpTransactionsSent:[84,a.TYPES.INTEGER],paymentsSent:[39,a.TYPES.INTEGER],pdpInquiriesSent:[42,a.TYPES.INTEGER],pdpViews:[61,a.TYPES.INTEGER],photoMessagesReceived:[134,a.TYPES.INTEGER],photoMessagesSent:[135,a.TYPES.INTEGER],pollCreationMessagesReceived:[115,a.TYPES.INTEGER],pollCreationMessagesSent:[116,a.TYPES.INTEGER],pollUpdateMessagesReceived:[117,a.TYPES.INTEGER],pollUpdateMessagesSent:[118,a.TYPES.INTEGER],profileReplies:[64,a.TYPES.INTEGER],profileViews:[63,a.TYPES.INTEGER],pttMessagesReceived:[119,a.TYPES.INTEGER],pttMessagesSent:[120,a.TYPES.INTEGER],ptvMessagesReceived:[121,a.TYPES.INTEGER],ptvMessagesSent:[122,a.TYPES.INTEGER],quickRepliesSent:[58,a.TYPES.INTEGER],reactionsReceived:[97,a.TYPES.INTEGER],reactionsSent:[98,a.TYPES.INTEGER],receiverDefaultDisappearingDuration:[21,a.TYPES.INTEGER],repliesSent:[80,a.TYPES.INTEGER],requestedPhoneNumber:[93,a.TYPES.BOOLEAN],seenMaskedPhoneNumber:[94,a.TYPES.BOOLEAN],senderDefaultDisappearingDuration:[20,a.TYPES.INTEGER],sharedPhoneNumber:[99,a.TYPES.BOOLEAN],sharesCommonGroup:[218,a.TYPES.BOOLEAN],smbMarketingMessagesReactionsSent:[101,a.TYPES.INTEGER],smbMarketingMessagesRepliesSent:[102,a.TYPES.INTEGER],smbMarketingMessagesSpamReports:[103,a.TYPES.INTEGER],smbMarketingMsgsReceived:[104,a.TYPES.INTEGER],smbMarketingMsgsSent:[105,a.TYPES.INTEGER],spamReports:[31,a.TYPES.INTEGER],startTime:[7,a.TYPES.INTEGER],statusReactionsReceived:[191,a.TYPES.INTEGER],statusReactionsSent:[192,a.TYPES.INTEGER],statusReplies:[50,a.TYPES.INTEGER],statusReplyMessagesReceived:[169,a.TYPES.INTEGER],statusViews:[49,a.TYPES.INTEGER],stickerMessagesReceived:[170,a.TYPES.INTEGER],stickerMessagesSent:[171,a.TYPES.INTEGER],storefrontInquiriesSent:[43,a.TYPES.INTEGER],suggestionPromptsClick:[177,a.TYPES.INTEGER],suggestionPromptsShow:[178,a.TYPES.INTEGER],textMessagesReceived:[136,a.TYPES.INTEGER],textMessagesSent:[137,a.TYPES.INTEGER],textMessagesToUserCreatedAgentCnt:[124,a.TYPES.INTEGER],threadCreationDate:[189,a.TYPES.STRING],threadDs:[66,a.TYPES.STRING],threadId:[67,a.TYPES.STRING],threadIdMonthly:[223,a.TYPES.STRING],totalCallDuration:[28,a.TYPES.INTEGER],totalMessageEditsFromAgentCnt:[112,a.TYPES.INTEGER],totalMessageFromAgentCnt:[113,a.TYPES.INTEGER],totalMessageToAgentCnt:[114,a.TYPES.INTEGER],totalMessagesToUserCreatedAgentCnt:[125,a.TYPES.INTEGER],typeOfGroup:[85,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM],urlMessagesReceived:[138,a.TYPES.INTEGER],urlMessagesSent:[139,a.TYPES.INTEGER],userHasBusinessIntent:[205,a.TYPES.BOOLEAN],viaContactlessChats:[107,a.TYPES.BOOLEAN],videoCallsOffered:[76,a.TYPES.INTEGER],videoMessagesReceived:[172,a.TYPES.INTEGER],videoMessagesSent:[173,a.TYPES.INTEGER],viewOnceMessagesOpened:[18,a.TYPES.INTEGER],viewOnceMessagesReceived:[17,a.TYPES.INTEGER],viewOnceMessagesSent:[16,a.TYPES.INTEGER],voiceCallsOffered:[77,a.TYPES.INTEGER]},[1,1,1],"regular"]},{ChatMessageCounts:[]});g.ChatMessageCountsWamEvent=b}),98); __d("WAWebChatThreadLoggingEventUploader",["Promise","WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebBotGating","WAWebBotTypes","WAWebChatMessageCountsWamEvent","WAWebChatThreadLoggingBoolFlagFields","WAWebChatThreadLoggingCountFields","WAWebChatThreadLoggingUtils","WAWebGroupType","WAWebWamEnumChatMutedType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadEvents: uploaded "," events but only deleted "," (they should be the same!)"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_thread_logging: error uploading events: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingBatchEventUploader: secret not in store!"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatThreadLoggingBatchEventUploader: offset not in store!"]);l=function(){return a};return a}a=function(){function a(a,b){this.eventStore=b,this.metadataStore=a}var e=a.prototype;e.uploadEvents=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e,f=this;e=(e=a==null?void 0:a.purgeAfter)!=null?e:!0;var g=(yield this.metadataStore.getOffset());if(g==null){d("WALogger").WARN(l());return-1}a=(a=a==null?void 0:a.lastStartTs)!=null?a:d("WAWebChatThreadLoggingUtils").computeStartTs(g,d("WATimeUtils").unixTime()-d("WATimeUtils").DAY_SECONDS);if(this.secret==null){g=(yield this.metadataStore.getSecret());if(g==null){d("WALogger").WARN(k());return-1}this.secret=g}g=(yield this.eventStore.getBeforeInclusive(a));try{yield (h||(h=b("Promise"))).all(g.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebChatThreadLoggingUtils").getThreadDs(a.startTs),e=a.contactInfo,g=new(d("WAWebChatMessageCountsWamEvent").ChatMessageCountsWamEvent)({messagesSent:a.msgsSent,messagesReceived:a.msgsReceived,commentsReceived:a.commentsReceived,viewOnceMessagesSent:a.viewOnceMsgsSent,viewOnceMessagesReceived:a.viewOnceMsgsReceived,viewOnceMessagesOpened:a.viewOnceMessagesOpened,threadDs:b,threadId:yield d("WAWebChatThreadLoggingUtils").generateThreadID(c("WANullthrows")(f.secret),a.chatId,b),isAGroup:a.contactInfo.isAGroup,groupSize:e.isAGroup?e.groupSize:void 0,isAContact:e.isAGroup?void 0:e.isAContact,isArchived:a.isArchived,isPinned:a.isPinned,messagesStarred:a.messagesStarred,messagesRead:a.msgsRead,messagesUnread:a.messagesUnread,chatMuted:a.isMuted?d("WAWebWamEnumChatMutedType").CHAT_MUTED_TYPE.MUTED_NO_NOTIFICATIONS:d("WAWebWamEnumChatMutedType").CHAT_MUTED_TYPE.NOT_MUTED,callOffersSent:a.callOffersSent,callOffersReceived:a.callOffersReceived,totalCallDuration:a.totalCallDuration,typeOfGroup:a.contactInfo.groupType!=null?d("WAWebGroupType").groupTypeToWamEnum(a.contactInfo.groupType):void 0,isPnhEnabledChat:a.isPnhEnabledChat,reactionsSent:a.reactionsSent,reactionsReceived:a.reactionsReceived,isMessageYourself:a.isMessageYourself,forwardMessagesSent:a.forwardMessagesSent,forwardMessagesReceived:a.forwardMessagesReceived,editedMsgsSent:a.editedMsgsSent,totalMessageToAgentCnt:a.botMessagesSent,totalMessageFromAgentCnt:a.botMessagesReceived,totalMessageEditsFromAgentCnt:a.botMessagesEdited,isUserAgent:a.isUserAgent,hasUsername:a.hasUsername,oppositeVisibleIdentification:a.oppositeVisibleIdentification!=null?a.oppositeVisibleIdentification:void 0,chatOrigins:a.chatOrigins!=null?a.chatOrigins:void 0,eventCreationMessagesReceived:a.eventCreationMessagesReceived,eventCreationMessagesSent:a.eventCreationMessagesSent,eventResponseMessagesReceived:a.eventResponseMessagesReceived,eventResponseMessagesSent:a.eventResponseMessagesSent});d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")&&(a.ephemeralityTriggerAction!=null&&(g.ephemeralityTriggerAction=a.ephemeralityTriggerAction),a.ephemeralityInitiator!=null&&(g.ephemeralityInitiator=a.ephemeralityInitiator));d("WAWebChatThreadLoggingCountFields").COUNT_FIELD_NAMES.forEach(function(b){g[b]=a[b]});d("WAWebChatThreadLoggingBoolFlagFields").FLAG_FIELD_NAMES.forEach(function(b){g[b]=a[b]});e.isAGroup||(d("WAWebBotGating").isBizBot3pEnabled()&&(g.isUser3pBotChat=e.automatedType===d("WAWebBotTypes").BizBotAutomatedType.FULL_3P),d("WAWebBotGating").isBizBot1pEnabled()&&(g.isUser1pBizBotChat=e.automatedType===d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P));g.commit()});return function(b){return a.apply(this,arguments)}}()))}catch(a){d("WALogger").ERROR(j(),a.toString()).sendLogs("thread-logging-upload-failure")}if(e){e=(yield this.eventStore.deleteBeforeInclusive(a));e!==g.length&&d("WALogger").ERROR(i(),g.length,e)}yield this.metadataStore.setLastUploadedStartTs(a);return g.length});function e(b){return a.apply(this,arguments)}return e}();return a}();g.ChatThreadLoggingEventUploaderImpl=a}),98); __d("WAWebBusinessProfileTypes",["$InternalEnum"],(function(a,b,c,d,e,f){var g={UNKNOWN:0,LOW:1,HIGH:2};function a(a){if(a==null)return;switch(a){case"unknown":return g.UNKNOWN;case"low":return g.LOW;case"high":return g.HIGH;default:return g.UNKNOWN}}d=["sun","mon","tue","wed","thu","fri","sat"];e={OPEN_24H:"open_24h",SPECIFIC_HOURS:"specific_hours",APPOINTMENT_ONLY:"appointment_only"};b=b("$InternalEnum")({CATALOG:"catalog",NONE:"none",SHOP:"shop",META_CATALOG:"smb_meta_catalog"});function c(a){return a==="sun"||a==="mon"||a==="tue"||a==="wed"||a==="thu"||a==="fri"||a==="sat"}var h={limitedLiabilityPartnership:"Limited liability partnership",soleProprietorship:"Sole proprietorship",partnership:"Partnership",publicCompany:"Public Company",privateCompany:"Private Company",other:"Other"},i={WEBSITE:256,DESCRIPTION:512,EMAIL:128,ADDRESS:256};f.VERIFIED_LEVEL=g;f.convertLevel=a;f.DAYS_OF_WEEK=d;f.BUSINESS_HOUR_MODES=e;f.CommerceExperienceTypes=b;f.isBusinessHoursDayName=c;f.businessTypeOptions=h;f.BUSINESS_PROFILE_FIELDS_LENGTH=i}),66); __d("WAWebInteractiveMessagesNativeFlowName",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({ORDER_DETAILS:"order_details",ORDER_STATUS:"order_status",PAYMENT_STATUS:"payment_status",PAYMENT_METHOD:"payment_method",MESSAGE_WITH_LINK:"message_with_link",MESSAGE_WITH_LINK_STATUS:"message_with_link_status",QUICK_REPLY:"quick_reply",CTA_CALL:"cta_call",CTA_URL:"cta_url",CTA_CATALOG:"cta_catalog",PAYMENT_INFO:"payment_info",CTA_COPY_CODE:"cta_copy",MIXED:"mixed",CTA_FLOW:"galaxy_message"});c=a;f["default"]=c}),66); __d("WAWebCTWAConstants",[],(function(a,b,c,d,e,f){a="11478";b="11525";c="11522";d="12015";e="12502";var g="12503",h=new Map([[a,"WHATSAPP_FOR_SMB_WEB_WHATSAPP_SMB_WEB_CHATLIST_BANNER_QP"],[b,"WHATSAPP_FOR_WEB_GROUPSBANNER_QP"],[c,"WHATSAPP_FOR_WEB_PROFILEBANNER_QP"],[d,"WHATSAPP_FOR_SMB_WEB_BUSINESS_HOME_CARD_QP"],[g,"WHATSAPP_FOR_SMB_WEB_UPDATES_TAB_FOOTER_NOTICE_QP"],[e,"WHATSAPP_FOR_WEB_UPDATES_TAB_FOOTER_NOTICE_QP"]]),i=20*1e3,j=20*1e3,k=20*1e3,l=20*1e3,m=Object.freeze({NEW_ORDER:2,PENDING_PAYMENT:3,PAID:4,ORDER_COMPLETE:5}),n=new Set(Object.keys(m).map(function(a){return m[a]})),o=1,p=7,q=8,r=6;f.QP_SURFACE_ID_CHAT_LIST_TOP=a;f.QP_SURFACE_ID_EXITED_GROUP=b;f.QP_SURFACE_ID_PROFILE=c;f.QP_SURFACE_BUSINESS_HOME_TOP_CARD=d;f.QP_SURFACE_UPDATES_TAB_PRIVACY_FOOTER=e;f.QP_SURFACE_BUSINESS_UPDATES_TAB_PRIVACY_FOOTER=g;f.KNOWN_QP_SURFACES=h;f.QP_FETCH_TIMEOUT_MS=i;f.QP_ACTION_MUTATION_TIMEOUT_MS=j;f.MANAGE_ADS_FETCH_TIMEOUT_MS=k;f.AD_ENTRY_POINTS_FETCH_TIMEOUT_MS=l;f.ALLOWED_PREDEFINED_LABEL_IDS=m;f.ALLOWED_PREDEFINED_LABEL_IDS_SET=n;f.NEW_CUSTOMER_LABEL_ID=o;f.FOLLOW_UP_LABEL_ID=p;f.LEAD_LABEL_ID=q;f.IMPORTANT_LABEL_ID=r}),66); __d("WAWebClientFeatureFlags",["WAWebEnvironment","gkx"],(function(a,b,c,d,e,f,g){d=!1;var h={a11y_block:!1,lid_debug:!1,media_existence_check:!c("gkx")("26258"),youtube_video_preview_without_blur:!c("gkx")("26258"),message_add_ons:!1,reactions_filter_problematic_flags:!0,skip_compliance_phone_check:!1,debug_commands:d,debug_1_year_history_sync:c("WAWebEnvironment").isWindows};function a(a){return h[a]}function i(a){h[a]=!0}function j(a){h[a]=!1}function b(){if(!c("gkx")("26258")){var a;a=new URLSearchParams(((a=location.search)!=null?a:"").toLowerCase());k(a,"feature_enable",i);k(a,"feature_disable",j)}}function k(a,b,c){a=a.get(b);if(a==null)return;b=a.split(",");b.forEach(function(a){a in h&&c(a)})}g.isFeatureEnabled=a;g.debugEnableFeatureFlag=i;g.debugDisableFeatureFlag=j;g.overwriteDebugFeatures=b}),98); __d("WAWebComplianceConstants",[],(function(a,b,c,d,e,f){a={INDIA:"IN"};b={ENTITY_NAME:1024,ENTITY_TYPE_CUSTOM:1024,EMAIL:256,GRIEVANCE_OFFICER_NAME:256,LANDLINE_NUMBER:20,MOBILE_NUMBER:20,IMPORTER_NAME:1024,STREET1:1024,STREET2:1024,CITY:1024,REGION:1024,POSTAL_CODE:12};f.COMPLIANCE_INFO_CODES=a;f.COMPLIANCE_INFO_LENGTH=b}),66); __d("WAWebPrimaryFeatures",["WALogger","WAWebBackendApi","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore","asyncToGeneratorRuntime","gkx","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["primary features loaded"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["primaryFeatureEnabled: primary features have not been initialized!"]);i=function(){return a};return a}var j=null;function a(a){if(j==null){d("WALogger").ERROR(i());return!1}return j.has(a)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.PRIMARY_FEATURES,a),yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.PRIMARY_FEATURES,a),j=new Set(m(a)),d("WAWebBackendApi").frontendFireAndForget("setPrimaryFeatures",{primaryFeatures:Array.from(j)})});return k.apply(this,arguments)}function f(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;a=(a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").KEYS.PRIMARY_FEATURES))!=null?a:[];a=m(a);j=new Set(a);d("WAWebBackendApi").frontendFireAndForget("setPrimaryFeatures",{primaryFeatures:a});d("WALogger").LOG(h())});return l.apply(this,arguments)}function m(a){var b,d;a=a;if(c("gkx")("26258"))return a;b=new URLSearchParams((b=window.location.search)!=null?b:"");d=((d=b.get("primary_features_enabled"))!=null?d:"").split(",").map(function(a){return c("lodash").snakeCase(a)});a=Array.from(new Set([].concat(a,d)));var e=new Set(((d=b.get("primary_features_disabled"))!=null?d:"").split(",").map(function(a){return c("lodash").snakeCase(a)}));a=a.filter(function(a){return!e.has(a)});return a}g.primaryFeatureEnabled=a;g.setPrimaryFeatures=e;g.loadPrimaryFeatures=f}),98); __d("WAWebListsGatingUtils",["WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeatures"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("primary_lists_support")&&d("WAWebABProps").getABPropConfigValue("lists_feature_enabled")}function a(){return!d("WAWebMobilePlatforms").isSMB()&&h()}g.isListsEnabled=h;g.shouldListsSettingsItemBeVisible=a}),98); __d("WAWebBizGatingUtils",["$InternalEnum","WALogger","WAWebABProps","WAWebApiContact","WAWebBusinessProfileTypes","WAWebCTWAConstants","WAWebChatGetters","WAWebClientFeatureFlags","WAWebComplianceConstants","WAWebL10NCountryCodes","WAWebLidMigrationUtils","WAWebListsGatingUtils","WAWebMobilePlatforms","WAWebPrimaryFeatures","WAWebUserPrefsMeUser","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["qpSurfaceIdsUsingGraphQL: unknown surface ID ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["isOrderDetailsQuickPayEnabled failed to parse config json: error ",""]);i=function(){return a};return a}function a(){return d("WAWebMobilePlatforms").isSMB()}function c(){return d("WAWebMobilePlatforms").isSMB()}function j(){return d("WAWebMobilePlatforms").isSMB()}function e(a){return!d("WAWebChatGetters").getIsNewsletter(a)&&j()&&!((a=a.contact.businessProfile)==null?void 0:a.isBizBot3p)}function f(){return d("WAWebABProps").getABPropConfigValue("web_biz_profile_options")}function k(){return d("WAWebABProps").getABPropConfigValue("business_profile_refresh_m1_enabled")}function l(){return d("WAWebABProps").getABPropConfigValue("smb_collections_enabled")}function m(){return d("WAWebABProps").getABPropConfigValue("smb_collections_appeal_flow_enabled")}function n(){return d("WAWebABProps").getABPropConfigValue("nfm_rendering_enabled")}function o(){return!d("WAWebABProps").getABPropConfigValue("interactive_message_native_flow_killswitch")}function p(){return!d("WAWebABProps").getABPropConfigValue("interactive_response_message_killswitch")}function q(){return!d("WAWebABProps").getABPropConfigValue("interactive_response_message_native_flow_killswitch")}function r(a){var b;if(a!=null){var c;b=a.isLid()?(c=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a)))==null?void 0:c.user:a.user;if(a.isLid()&&b==null)return!0}return v(b)}function s(a){return z(a,function(){return d("WAWebABProps").getABPropConfigValue("smb_ecommerce_compliance_india_m4")})}function t(a){return z(a,function(){return d("WAWebABProps").getABPropConfigValue("smb_ecommerce_compliance_india_m4_5")})}function u(a){var b=z(a==null?void 0:a.id,function(){return d("WAWebABProps").getABPropConfigValue("web_abprop_block_catalog_creation_ecommerce_compliance_india")});return b&&(a==null?void 0:(b=a.profileOptions)==null?void 0:b.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.NONE}function v(a){a=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(a||"");var b=d("WAWebComplianceConstants").COMPLIANCE_INFO_CODES.INDIA;return a===b||d("WAWebClientFeatureFlags").isFeatureEnabled("skip_compliance_phone_check")}function w(a){a=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(a||"");return a==="BR"}function x(a){var b;if(!a)return!1;b=a.isLid()?(b=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a)))==null?void 0:b.user:a.user;return b==null?!1:v(b)||w(b)}function y(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("web_business_tools_drawer_enabled")}function z(a,b){b===void 0&&(b=function(){return!1});var c;if(a!=null){var e;c=a.isLid()?(e=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a)))==null?void 0:e.user:a.user;if(a.isLid()&&c==null)return!0}return!v(c)?!1:b()}function A(){return!d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("tos_3_client_gating_enabled"):!1}function B(){return d("WAWebABProps").getABPropConfigValue("tos_client_state_fetch_iteration")}function C(){return!d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("tos_client_state_fetch_enabled"):!1}function D(){return d("WAWebABProps").getABPropConfigValue("web_shop_storefront_message")}function E(){return d("WAWebABProps").getABPropConfigValue("banned_shops_ux_enabled")}function F(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("smb_click_to_chat_logging_enabled"):!1}function G(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("smb_biz_profile_logging_enabled"):!1}function H(){return d("WAWebABProps").getABPropConfigValue("web_abprop_business_profile_refresh_linked_accounts_killswitch")}function I(){return d("WAWebABProps").getABPropConfigValue("web_abprop_business_profile_refresh_linked_account_enabled")}function J(){return d("WAWebABProps").getABPropConfigValue("commerce_sanctioned")}function K(){return d("WAWebABProps").getABPropConfigValue("web_abprop_business_profile_refresh_edit_cover_photo_enabled")}function L(){return d("WAWebABProps").getABPropConfigValue("web_abprop_business_profile_refresh_cover_photo_view_enabled")}function aa(){return d("WAWebABProps").getABPropConfigValue("catalog_categories_enabled")}var M=b("$InternalEnum")({DIGITAL_GOODS:"digital-goods",PHYSICAL_GOODS:"physical-goods",ANY:"any",NONE:"none"});function ba(a){a===void 0&&(a=M.NONE);try{var b=JSON.parse(d("WAWebABProps").getABPropConfigValue("order_details_quick_pay"));b=b.allowed_product_type;if(b&&b!==M.NONE)return b===M.ANY||b===a}catch(a){d("WALogger").WARN(i(),a)}return!1}function ca(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_billing_enabled")}function da(){return d("WAWebABProps").getABPropConfigValue("web_enable_biz_catalog_view_ps_logging")}function ea(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smart_filters_enabled")||!d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smart_filters_enabled_consumer")}function N(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_multi_device_message_attribution_enabled")}b=function(){return d("WAWebABProps").getABPropConfigValue("order_messages_ephemeral_exception_enabled")};function fa(){return N()&&d("WAWebABProps").getABPropConfigValue("smb_multi_device_agents_logging_V2_enabled")}function ga(){return!d("WAWebMobilePlatforms").isSMB()?!1:d("WAWebABProps").getABPropConfigValue("smb_orange_enabled")}function ha(){return!d("WAWebMobilePlatforms").isSMB()?!1:O()||P()}function O(){return!d("WAWebMobilePlatforms").isSMB()?!1:d("WAWebABProps").getABPropConfigValue("premium_blue_enabled")}function P(){return!d("WAWebMobilePlatforms").isSMB()?!1:d("WAWebABProps").getABPropConfigValue("smb_billing_enabled")||d("WAWebABProps").getABPropConfigValue("smb_ctwa_billing_enabled")}function ia(){return d("WAWebABProps").getABPropConfigValue("native_commerce_threads_logging_enabled")}function ja(){return d("WAWebABProps").getABPropConfigValue("smb_biz_profile_custom_url")}function Q(){return d("WAWebABProps").getABPropConfigValue("wa_web_fmx_agm_enabled")}function R(){return d("WAWebABProps").getABPropConfigValue("wamo_agm_enabled")}function ka(){return d("WAWebABProps").getABPropConfigValue("web_quantity_controls_enabled")}function la(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("companion_biz_quick_reply_sync_support")}function ma(){return d("WAWebABProps").getABPropConfigValue("smb_catalog_collections_reordering_enabled")}function na(){return d("WAWebABProps").getABPropConfigValue("smb_temp_cover_photo_privacy_messaging")}function S(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_enabled")}function oa(){return S()&&d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_system_messages_enabled")}function pa(){return!S()?0:d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_nux_impressions")}function qa(){return d("WAWebABProps").getABPropConfigValue("smb_hide_unsupported_currency_price")}function ra(){return d("WAWebABProps").getABPropConfigValue("graphql_privacy_imp_m1")}function sa(){return d("WAWebABProps").getABPropConfigValue("graphql_privacy_imp_m2")}function ta(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_create_product_catalog")}function ua(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_product_catalog")}function va(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_add_product")}function wa(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_edit_product")}function xa(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_delete_product")}function ya(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_product")}function za(){return d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_report_product")}function Aa(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_appeal_product")}function Ba(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_create_collection")}function Ca(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_update_collection")}function Da(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_update_collection_list")}function Ea(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_delete_collection")}function Fa(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_appeal_collection")}function Ga(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_collection")}function Ha(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_single_collection")}function Ia(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_product_list")}function Ja(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_update_product_visibility")}function Ka(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_commerce_settings")}function La(){return d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_verify_postcode")}function Ma(){return d("WAWebABProps").getABPropConfigValue("smb_catalog_graphql_get_public_key")}function Na(){return d("WAWebABProps").getABPropConfigValue("smb_orders_graphql_refresh_cart")}function Oa(){return!d("WAWebMobilePlatforms").isSMB()?"{}":d("WAWebABProps").getABPropConfigValue("smb_billing_premium_access_config")}function Pa(){return d("WAWebABProps").getABPropConfigValue("country_client_gating_enabled")}function Qa(){return d("WAWebABProps").getABPropConfigValue("order_details_custom_item_enabled")}function Ra(){return d("WAWebABProps").getABPropConfigValue("order_details_from_catalog_enabled")}function Sa(){return d("WAWebABProps").getABPropConfigValue("order_details_from_cart_enabled")}function Ta(){return d("WAWebABProps").getABPropConfigValue("order_details_total_order_minimum_value")}function Ua(a){return Z(a)?5e3:d("WAWebABProps").getABPropConfigValue("order_details_total_maximum_value")}function Va(){return d("WAWebABProps").getABPropConfigValue("order_management_enabled")}function Wa(){return d("WAWebABProps").getABPropConfigValue("btm_threads_logging_enabled")}function Xa(a){return a?d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_chats_reorder_on_chat_unassignment_enabled"):d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_chats_reorder_on_chat_assignment_enabled")}function Ya(){return d("WAWebABProps").getABPropConfigValue("utm_tracking_expiration_hours")}function Za(){return d("WAWebABProps").getABPropConfigValue("utm_tracking_enabled")}function $a(){return!d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_thread_ad_attribution_enabled")||d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_web_parse_always_show_ad_attribution")}function ab(){return d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_hide_ad_context_if_soft_dismissed_in_primary")}function bb(){return d("WAWebABProps").getABPropConfigValue("ctwa_consumer_data_sharing_consent")}function cb(){return d("WAWebABProps").getABPropConfigValue("ctwa_mm_biz_ai_disclosure_update_enabled")&&!d("WAWebABProps").getABPropConfigValue("ctwa_mm_biz_ai_tos_filtering_enabled")}function db(){return d("WAWebABProps").getABPropConfigValue("ctwa_mm_biz_ai_disclosure_update_enabled")&&d("WAWebABProps").getABPropConfigValue("ctwa_mm_biz_ai_tos_filtering_enabled")}function eb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_smb_data_sharing_consent")}function fb(){return d("WAWebABProps").getABPropConfigValue("ctwa_smb_data_sharing_opt_in_cool_off_period")}function gb(){return d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_notifications_enabled")}function hb(){return d("WAWebABProps").getABPropConfigValue("biz_ai_consumer_tos_update_enabled")}function T(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_ads_action_banner_enabled_web")}function ib(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_action_banner_logging_enabled_web")}function jb(){return T()&&d("WAWebABProps").getABPropConfigValue("in_app_comms_manage_ads_web_banner_campaign_enabled")}function kb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("qp_campaign_client_enabled")}function lb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_graphql_to_fetch_qp_enabled")}function mb(){return d("WAWebABProps").getABPropConfigValue("smb_graphql_to_fetch_qp_frequency_mins")}function nb(){var a=d("WAWebABProps").getABPropConfigValue("smb_graphql_to_fetch_qp_surface_ids"),b=new Map(Array.from(d("WAWebCTWAConstants").KNOWN_QP_SURFACES.values(),function(a){return[a,a]})),c=new Set();a.split(",").forEach(function(a){var e=b.get(a);e!=null?c.add(e):d("WALogger").ERROR(h(),a)});return c}var ob=function(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_entrypoint_home_header_enabled")},pb=function(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_entrypoint_home_header_dropdown_enabled")},qb=function(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_ad_creation_entry_point_catalog_web")},rb=function(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_ad_creation_entry_point_catalog_product_web")};function U(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("kill_switch_ctwa_ml_entry_point_config")===!1}function sb(){return d("WAWebABProps").getABPropConfigValue("ctwa_entry_point_config_fetch_threshhold")}function tb(){return U()&&d("WAWebABProps").getABPropConfigValue("ctwa_long_term_holdout_content_enabled")}function ub(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_long_term_holdout_client_side_check")}var vb=function(a){return d("WAWebMobilePlatforms").isSMB()&&(a==null?void 0:a.hasCreatedAd)===!0&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_entrypoint_manage_ads_home_header_dropdown_enabled")},wb=function(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_fetch_linked_accounts_enabled")};function V(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_manage_ads_tab_web")}function xb(){return V()&&d("WAWebABProps").getABPropConfigValue("ctwa_manage_ads_tab_web_ad_actions_menu")}function yb(){return V()&&d("WAWebABProps").getABPropConfigValue("ctwa_manage_ads_tab_web_ad_metrics")}function W(){return V()&&d("WAWebABProps").getABPropConfigValue("ctwa_manage_ads_tab_web_recovery_flow")}function zb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_ad_account_token_storage_kill_switch_web")===!1}function Ab(){return d("WAWebABProps").getABPropConfigValue("ctwa_ad_account_nonce_push_wait_timeout_web")}function Bb(){return d("WAWebABProps").getABPropConfigValue("ctwa_ad_account_nonce_retries_max_web")}function Cb(){return W()&&d("WAWebABProps").getABPropConfigValue("smb_graphql_token_recovery_during_account_recovery_enabled")}function Db(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("business_tool_enhanced_logging")}function Eb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_labels_ctwa_data_sharing")}function Fb(){return d("WAWebMobilePlatforms").isSMB()&&X()}function X(){return d("WAWebABProps").getABPropConfigValue("payments_br_content_optimization_variant")!==0}function Gb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_smb_data_sharing_settings_killswitch")===!1}function Hb(){return d("WAWebABProps").getABPropConfigValue("ctwa_enable_biz_data_sharing_after_nux_dismiss")}function Ib(){return d("WAWebABProps").getABPropConfigValue("ctwa_show_ads_data_sharing_after_message")}function Jb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_message_labels_ctwa_data_sharing")}function Kb(){return d("WAWebABProps").getABPropConfigValue("payments_link_to_lite_consumer_enabled")}function Lb(){return d("WAWebABProps").getABPropConfigValue("smb_premium_messages_click_logging_enabled")}function Y(){return d("WAWebABProps").getABPropConfigValue("row_buyer_order_revamp_m0_enabled")}function Mb(){return d("WAWebABProps").getABPropConfigValue("seller_orders_management_revamp")}function Nb(){return Y()&&d("WAWebABProps").getABPropConfigValue("buyer_initiated_order_request_variant_enabled")}function Ob(){return d("WAWebABProps").getABPropConfigValue("order_statuses_revamp_m1_enabled")}function Pb(){return d("WAWebABProps").getABPropConfigValue("smb_premium_messages_url_cta_alert_dialog_enabled")}function Z(a){var b=d("WAWebLidMigrationUtils").toPn(d("WAWebUserPrefsMeUser").getMeUser());b=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(b==null?void 0:b.user);a=d("WAWebLidMigrationUtils").toPn(a.contact.id);a=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(a==null?void 0:a.user);return b==="BR"&&a==="BR"}function Qb(){return d("WAWebABProps").getABPropConfigValue("carousel_message_client_enabled")}function Rb(){return(d("WAWebMobilePlatforms").isSMB()||d("WAWebListsGatingUtils").isListsEnabled())&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("companion_biz_label_sync_support")}function Sb(){return(d("WAWebMobilePlatforms").isSMB()||d("WAWebListsGatingUtils").isListsEnabled())&&d("WAWebABProps").getABPropConfigValue("smb_label_improvements_reordering")}function Tb(){return(d("WAWebMobilePlatforms").isSMB()||d("WAWebListsGatingUtils").isListsEnabled())&&d("WAWebABProps").getABPropConfigValue("smb_label_improvements_reordering")&&d("WAWebABProps").getABPropConfigValue("web_smb_label_reordering_m2_two_way")}function Ub(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_new_customer_label_signals")}function Vb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_lead_labels_send_signals")}function Wb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("ctwa_important_label_sends_signals")}function Xb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smba_premium_messages_leaving_wa_content")}function Yb(){return d("WAWebABProps").getABPropConfigValue("smba_premium_messages_insights_v2_trackable_link_domain")}function Zb(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_notes_v1_enabled")}function $b(){return d("WAWebABProps").getABPropConfigValue("smb_notes_privacy_string")}function ac(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("wa_web_business_tools_top_card_enabled")}function bc(){return d("WAWebABProps").getABPropConfigValue("smb_meta_verified_context_card")}function cc(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("profile_edit_for_mv_users_enabled")}function dc(){return d("WAWebABProps").getABPropConfigValue("web_catalog_video_view_fallback_enabled")}function ec(){return d("WAWebABProps").getABPropConfigValue("web_catalog_video_view_enabled")}function fc(){return d("WAWebABProps").getABPropConfigValue("smb_get_subscriptions_graphql_migration_enabled")}function gc(){return d("WAWebABProps").getABPropConfigValue("smb_custom_url_get_user_graphql_migration_enabled")}function hc(){return d("WAWebABProps").getABPropConfigValue("web_biz_ai_chat_assignment_hiding_enabled")}function ic(){return d("WAWebABProps").getABPropConfigValue("smb_ai_agents_web_chat_assignment_interop_enabled")}function jc(){return d("WAWebABProps").getABPropConfigValue("lid_migration_for_vname_enabled")}function kc(){return d("WAWebABProps").getABPropConfigValue("use_signed_shimmed_url_link")}function lc(){return d("WAWebABProps").getABPropConfigValue("lid_migration_for_biz_profile_enabled")}function mc(){return d("WAWebABProps").getABPropConfigValue("catalog_product_sale_price_enabled")}function nc(){return d("WAWebABProps").getABPropConfigValue("catalog_lid_migration_enabled")}function oc(){return d("WAWebABProps").getABPropConfigValue("ctwa_signal_decoupling_enabled")}function $(){return d("WAWebABProps").getABPropConfigValue("smb_product_country_of_origin_m1")}function pc(){return d("WAWebABProps").getABPropConfigValue("ctwa_download_3pd_signals")}function qc(a){return r(a)||$()}function rc(){return r(d("WAWebUserPrefsMeUser").getMeUser())}function sc(){return d("WAWebABProps").getABPropConfigValue("web_catalog_recovery_flow_enabled")}function tc(a){var b=R(),c=Q();return a.ctwaContext!=null&&(b||c&&a.ctwaContext.sourceApp!=="whatsapp")}function uc(){return d("WAWebABProps").getABPropConfigValue("web_catalog_viewing_variants_enabled")}function vc(){return d("WAWebABProps").getABPropConfigValue("ctwa_smb_detected_outcome_labels_soak_enabled")}g.canDisplayLabel=a;g.canEditLabelAssociation=c;g.canSendQuickReply=j;g.canSendQuickReplyInChat=e;g.webBizProfileOptions=f;g.canSeeBizProfileV3=k;g.canManageCollections=l;g.canAppealCollections=m;g.nativeFlowMessagesEnabled=n;g.interactiveNativeFlowMessagesEnabled=o;g.interactiveResponseMessagesEnabled=p;g.interactiveNativeFlowResponseMessagesEnabled=q;g.canSeeECommerceComplianceIndiaSoftEnforcement=r;g.canSeeECommerceComplianceIndiaHardEnforcementBusinessJourney=s;g.canSeeECommerceComplianceIndiaCountryOriginExemptBusinessJourney=t;g.blockCatalogCreationECommerceComplianceIndia=u;g.isWidInPaymentsCountry=x;g.isBizToolsDrawerEnabled=y;g.tos3GatingEnabled=A;g.tosFetchIteration=B;g.tosFetchEnabled=C;g.shopsInteractiveMessageEnabled=D;g.bannedShopsEnabled=E;g.smbClickToChatLoggingEnabled=F;g.smbBizProfileLoggingEnabled=G;g.bizLinkedAccountsEnabled=H;g.canViewBizLinkedAccounts=I;g.commerceFeaturesDisabledBySanctions=J;g.isBizCoverPhotoEditEnabled=K;g.isBizCoverPhotoViewEnabled=L;g.catalogCategoriesEnabled=aa;g.QuickPayProductTypeGating=M;g.isOrderDetailsQuickPayEnabled=ba;g.billingEnabled=ca;g.isPSForCatalogViewEnabled=da;g.smartFiltersEnabled=ea;g.isMultiDeviceMessageAttributionEnabled=N;g.inOrderMessagesEphemeralExceptionEnabled=b;g.isMultiDeviceAgentsLoggingEnabled=fa;g.isSmbOrangeEnabled=ga;g.subscriptionFetchEnabled=ha;g.isMetaVerifiedEnabled=O;g.isPremiumBillingEnabled=P;g.commerceThreadsLoggingEnabled=ia;g.isCustomURLViaBizProfileEnabled=ja;g.getFmxAgmEnabled=Q;g.getWamoAgmEnabled=R;g.isQuantityControlsFeatureEnabled=ka;g.quickRepliesManagementEnabled=la;g.isCollectionReorderingEnabled=ma;g.coverPhotoPrivacyMessagingEnabled=na;g.chatAssignmentEnabled=S;g.chatAssignmentSystemMessagesEnabled=oa;g.chatAssignmentMaxNuxImpressions=pa;g.hideUnsupportedCurrency=qa;g.graphQLForCatalogM1Enabled=ra;g.graphQLForCollectionM2Enabled=sa;g.graphQLForCreateProductCatalogEnabled=ta;g.graphQLForGetProductCatalogEnabled=ua;g.graphQLForAddProductEnabled=va;g.graphQLForEditProductEnabled=wa;g.graphQLForDeleteProductEnabled=xa;g.graphQLForGetProductEnabled=ya;g.graphQLForReportProductEnabled=za;g.graphQLForAppealProductEnabled=Aa;g.graphQLForCreateCollectionEnabled=Ba;g.graphQLForUpdateCollectionEnabled=Ca;g.graphQLForUpdateCollectionListEnabled=Da;g.graphQLForDeleteCollectionEnabled=Ea;g.graphQLForAppealCollectionEnabled=Fa;g.graphQLForGetCollectionsEnabled=Ga;g.graphQLForGetSingleCollectionEnabled=Ha;g.graphQLForGetProductListEnabled=Ia;g.graphQLForUpdateProductVisibilityEnabled=Ja;g.graphQLForCommerceSettingsEnabled=Ka;g.isGraphQLForVerifyPostcodeEnabled=La;g.isGraphQLForGetPublicKeyEnabled=Ma;g.graphQLForRefreshCartEnabled=Na;g.getBillingPremiumAccessConfig=Oa;g.countryGatingEnabled=Pa;g.orderDetailsCustomItemEnabled=Qa;g.orderDetailsFromCatalogEnabled=Ra;g.orderDetailsFromCartEnabled=Sa;g.orderDetailsTotalOrderMinimumValue=Ta;g.orderDetailsTotalMaxValue=Ua;g.orderManagementEnabled=Va;g.btmThreadsLoggingEnabled=Wa;g.shouldReorderChatOnAssignment=Xa;g.utmTrackingExpirationInHours=Ya;g.isUtmTrackingEnabled=Za;g.isAdsAttributionEnabled=$a;g.isHideAdContextIfSoftDismissed=ab;g.isConsumerTransparencyEnabled=bb;g.isUpdatedConsumerDisclosureUiRowEnabled=cb;g.isUpdatedConsumerDisclosureUiIndiaEnabled=db;g.smbDataSharingConsentEnabled=eb;g.smbDataSharingOptInCoolOffSeconds=fb;g.chatAssignmentNotificationsEnabled=gb;g.isNonBlockingConsumerTosAbpropEnabled=hb;g.adsActionBannersEnabled=T;g.adsActionBannersLoggingEnabled=ib;g.adsActionBannersEnabledOnStartup=d("WAWebMobilePlatforms").isSMB;g.adsActionManageAdsBannerEnabled=jb;g.qpCampaignsEnabled=kb;g.qpGraphQLEnabled=lb;g.qpGraphQLFetchIntervalMinutes=mb;g.qpSurfaceIdsUsingGraphQL=nb;g.shouldShowAdCreationIcon=ob;g.shouldShowAdCreationDropdown=pb;g.adCreationEntryPointCatalogEnabled=qb;g.adCreationEntryPointCatalogProductEnabled=rb;g.adEntryPointsConfigurationFetchEnabled=U;g.adEntryPointsConfigurationFetchThreshold=sb;g.adEntryPointsConfigurationFetchM1Enabled=tb;g.isInLongTermHoldoutFallbackWhenAdEntryPointsConfigurationMissing=ub;g.shouldShowManageAdsDropdown=vb;g.shouldFetchLinkedAccounts=wb;g.adManagementEnabled=V;g.adManagementActionsDisplayingEnabled=xb;g.adManagementMetricsDisplayingEnabled=yb;g.adManagementRecoveryFlowEnabled=W;g.adAccountTokenStoringEnabled=zb;g.adAccountTokenNoncePushWaitTimeoutSeconds=Ab;g.adAccountTokenNonceMaxRetries=Bb;g.grapQLRecoveryDuringAdAccountRecoveryEnabled=Cb;g.isSMBEnhancedLoggingEnabled=Db;g.isSMBLabelsDataSharingEnabledForChats=Eb;g.isSMBDataSharingOrderCopyOptimizationEnabled=Fb;g.isOrderContentOptimizationEnabled=X;g.shouldShowSMBDataSharingSettings=Gb;g.showDataSharingInSettingsAfterNuxDismiss=Hb;g.showDataSharingInSettingsAfterCtwaMessageReceived=Ib;g.isSMBLabelsDataSharingEnabledForMessages=Jb;g.isMessageWithLinkNfmEnabled=Kb;g.isPremiumMessagesClickLoggingEnabled=Lb;g.isBuyerOrderRevampEnabled=Y;g.isSellerOrderRevampEnabled=Mb;g.isBuyerOrderRequestVariantEnabled=Nb;g.isOrderStatusM1Enabled=Ob;g.isPremiumMessagesUrlCtaDialogEnabled=Pb;g.isBrazilToBrazilOrder=Z;g.carouselsEnabled=Qb;g.labelsEditingEnabled=Rb;g.isLabelReorderingSyncFromPrimaryEnabled=Sb;g.isLabelReorderingInWebEnabled=Tb;g.is3pdSignalNewCustomerEnabled=Ub;g.is3pdLeadOptimisationLabelSignalsEnabled=Vb;g.is3pdImportantLabelSignalsEnabled=Wb;g.isPremiumMessagesNewLeavingWAContentEnabled=Xb;g.getTrackableLinkDomain=Yb;g.smbNotesV1Enabled=Zb;g.smbNotesPrivacyStringABProp=$b;g.isBizToolsTopCardEnabled=ac;g.isMetaVerifiedContextCardEnabled=bc;g.isMetaVerifiedLockedProfileEditingV1Enabled=cc;g.isCatalogVideoViewFallbackEnabled=dc;g.isCatalogVideoViewEnabled=ec;g.isGetSubscriptionsGraphqlMigrationEnabled=fc;g.isGetCustomUrlUserGraphqlMigrationEnabled=gc;g.isBizAiChatAssignmentHidingEnabled=hc;g.isBizAiChatAssignmentInteropTosEnabled=ic;g.isLidMigrationForVnameEnabled=jc;g.isUsingSignedShimmedLinkInCatalogueEnabled=kc;g.isLidMigrationForBusinessProfileEnabled=lc;g.isCatalogProductSalePriceEnabled=mc;g.isLidMigrationForCatalogEnabled=nc;g.isSignalDecouplingEnabled=oc;g.isCountryOfOriginEnabled=$;g.isDownload3PDSignalsEnabled=pc;g.showComplianceFieldsInEditProductDrawer=qc;g.showImporterInformationInEditProductDrawer=rc;g.catalogTokenRecoveryEnabled=sc;g.shouldGenerateAGMMsgs=tc;g.isCatalogVariantsViewingEnabled=uc;g.isCTWADetectedOutcomeWS1Enabled=vc}),98); __d("WAWebBusinessProfileVersioningBridge",["WAWebBizGatingUtils"],(function(a,b,c,d,e,f,g){var h=3,i=4,j=16,k=32,l=64,m=128,n=256;function a(){return o(d("WAWebBizGatingUtils").webBizProfileOptions())}function o(a){var b=h|i|j|l|m|k;d("WAWebBizGatingUtils").bizLinkedAccountsEnabled()&&(b|=n);return a&b}g.DIRECT_CONNECTION_FLAG=m;g.getBusinessProfileQueryVersion=a;g.getBusinessProfileQueryVersionWithCustomBizProfileOptions=o}),98); __d("WAXmlParsingFailure",[],(function(a,b,c,d,e,f){"use strict";a=function(){function a(a,b){this.parser=a,this.reason=b}var b=a.prototype;b.toString=function(){return"XmlParsingFailure: "+this.parser+": "+this.reason};return a}();f.XmlParsingFailure=a}),66); __d("WAParsableXmlNode",["WAHasProperty","WAXmlParsingFailure","err"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(a,b){var c=this;this.$1=a;this.$2=b;this.$3=Array.isArray(b.content)?b.content.map(function(b){return new c.constructor(a,b)}):null}var b=a.prototype;b.name=function(){return this.$1};b.node=function(){return this.$2};b.hasAttr=function(a){return c("WAHasProperty")(this.$2.attrs,a)};b.assertTag=function(a){this.$2.tag!==a&&this["throw"]("to be <"+a+">")};b.tag=function(){return this.$2.tag};b.maybeChild=function(a){var b=this.$3;if(!b)return null;for(var c=0;c<b.length;c++)if(b[c].tag()===a)return b[c];return null};b.hasChild=function(a){return!!this.maybeChild(a)};b.child=function(a){var b=this.maybeChild(a);return!b?this["throw"]("to have child <"+a+">"):b};b.assertAttr=function(a,b){var c=this.attrString(a);c!==b&&this["throw"]('to have "'+a+'"="'+b+'", but instead has "'+c+'"')};b.attrString=function(a){return!c("WAHasProperty")(this.$2.attrs,a)?this["throw"]('to have attribute "'+a+'"'):this.decodeAsString(this.$2.attrs[a])};b.forEachAttributeKey=function(a){var b=this.$2.attrs;Object.keys(b).forEach(function(b){return a(b)})};b.maybeAttrString=function(a){return this.hasAttr(a)?this.decodeAsString(this.$2.attrs[a]):null};b.maybeAttrInt=function(a,b,c){return this.hasAttr(a)?this.attrInt(a,b,c):null};b.attrEnumValues=function(a,b,c){b=new Set(b);var d=this.attrString(a);if(!b.has(d)){if(c!=null)return c;c=Array.from(b).join("|");return this["throw"]('to have "'+a+'"={'+c+'} but has value "'+d+'"')}return d};b.attrEnum=function(a,b){var d=this.attrString(a);if(!c("WAHasProperty")(b,d)){var e=Object.keys(b).join("|");return this["throw"]('to have "'+a+'"={'+e+'} but has value "'+d+'"')}return b[d]};b.attrEnumOrNullIfUnknown=function(a,b){a=this.attrString(a);return!c("WAHasProperty")(b,a)?null:b[a]};b.attrEnumOrDefault=function(a,b,c){return this.hasAttr(a)?this.attrEnum(a,b):c};b.attrInt=function(a,b,c){var d=this.attrString(a);return this.$4(d,a,b,c)};b.$4=function(a,b,c,d){var e=parseInt(a,10);if(Number.isNaN(e))return this["throw"]('to have "'+b+'"={integer} but has value "'+a+'"');else if(c!==void 0&&e<c)return this["throw"]('to have "'+b+'"={at least '+c+"} but has value "+e);else if(d!==void 0&&e>=d)return this["throw"]('to have "'+b+'"={below '+d+"} but has value "+e);return e};b.forEachChild=function(a){var b=this.$3;if(b)b.forEach(function(b){return a(b)});else if(this.$2.content!=null)return this["throw"]("to have children")};b.forEachChildWithTag=function(a,b){this.forEachChild(function(c){c.tag()===a&&b(c)})};b.mapChildren=function(a){var b=this.$3;return!b&&this.$2.content!=null?this["throw"]("to have children"):b?b.map(function(b){return a(b)}):[]};b.mapChildrenWithTag=function(a,b){var c=this.$3;return!c&&this.$2.content!=null?this["throw"]("to have children"):c?c.filter(function(b){return b.tag()===a}).map(function(a){return b(a)}):[]};b.mapFirstChild=function(a){var b=this.$3;return!b||b.length===0?this["throw"]("to have children"):a(b[0])};b.hasContent=function(){return!this.$3&&!!this.$2.content};b.hasChildren=function(){return this.$3!=null};b.getChildren=function(){return this.$3};b.mapAttrKeys=function(a){var b=this.getAttrKeys();return b&&b.length?b.map(a):[]};b.getAttrKeys=function(){return Object.keys(this.$2.attrs)};b.hasAttrs=function(){var a=this.$2.attrs?Object.keys(this.$2.attrs):[];return a.length>0};b.getNode=function(){return this.$2};b.unsafeSetChildren=function(a){this.$3=a};b.unsafeSetNodeContent=function(a){this.$2.content=a};b.contentUint=function(a){var b=this.contentBytes(a);return h(b,a)};b.contentBytes=function(a){a===void 0&&(a=-1);if(this.$3)return this["throw"]("to have binary content, but has children instead");else if(this.$2.content!=null){var b=this.$2.content;return a!==-1&&b.length!==a?this["throw"]("to be "+a+" bytes, but got "+b.length+" instead"):b}else return this["throw"]("to have content")};b.contentString=function(){if(this.$3)return this["throw"]("to have string content, but has children instead");else if(this.$2.content!=null)return this.$2.content;else return this["throw"]("to have content")};b.contentInt=function(a,b){var c=this.contentString();return this.$4(c,"content",a,b)};b.contentEnum=function(a){var b=this.contentString();if(!c("WAHasProperty")(a,b)){var d=Object.keys(a).join("|");return this["throw"]("to have content {"+d+'} but has value "'+b+'"')}return a[b]};b.decodeAsString=function(a){if(typeof a!=="string")throw c("err")("decodeAsString: attribute is "+typeof a+" not a string: "+a);return a};b["throw"]=function(a){throw new(d("WAXmlParsingFailure").XmlParsingFailure)(this.$1,"expected <"+this.$2.tag+"> "+a)};b.toString=function(){return this.$2.toString()};return a}();function h(a,b){var c=0;for(var d=0;d<b;d++)c=c*256+a[d];return c}g.ParsableXmlNode=a;g.convertBytesToUint=h}),98); __d("WACryptoPrimitives",["tweetnacl"],(function(a,b,c,d,e,f,g){"use strict";b={scalarbase:(a=d("tweetnacl")).lowlevel.scalarbase,crypto_hash:a.lowlevel.crypto_hash,modL:a.lowlevel.modL,pack25519:a.lowlevel.pack25519,S:a.lowlevel.S,M:a.lowlevel.M,A:a.lowlevel.A,Z:a.lowlevel.Z,D:a.lowlevel.D,unpack25519:a.lowlevel.unpack25519,pow2523:a.lowlevel.pow2523,crypto_verify_32:a.lowlevel.crypto_verify_32,set25519:a.lowlevel.set25519,add:a.lowlevel.add,scalarmult:a.lowlevel.scalarmult};g.hash=a.hash;g.scalarMult=a.scalarMult;g.verify=a.verify;g.lowlevel=b;g.keypairFromSecretKey=a.box.keyPair.fromSecretKey;g.keyPair=a.box.keyPair;g.signDetachedVerify=a.sign.detached.verify}),98); __d("WASignalLocalStorageProtocol.pb",["WAProtoConst"],(function(a,b,c,d,e,f,g){a={};b={};c={};e={};f={};var h={},i={},j={},k={},l={},m={},n={},o={},p={},q={};a.internalSpec={sessionVersion:[1,(d=d("WAProtoConst")).TYPES.UINT32],localIdentityPublic:[2,d.TYPES.BYTES],remoteIdentityPublic:[3,d.TYPES.BYTES],rootKey:[4,d.TYPES.BYTES],previousCounter:[5,d.TYPES.UINT32],senderChain:[6,d.TYPES.MESSAGE,e],receiverChains:[7,d.FLAGS.REPEATED|d.TYPES.MESSAGE,e],pendingKeyExchange:[8,d.TYPES.MESSAGE,c],pendingPreKey:[9,d.TYPES.MESSAGE,b],remoteRegistrationId:[10,d.TYPES.UINT32],localRegistrationId:[11,d.TYPES.UINT32],needsRefresh:[12,d.TYPES.BOOL],aliceBaseKey:[13,d.TYPES.BYTES]};b.internalSpec={preKeyId:[1,d.TYPES.UINT32],signedPreKeyId:[3,d.TYPES.INT32],baseKey:[2,d.TYPES.BYTES]};c.internalSpec={sequence:[1,d.TYPES.UINT32],localBaseKey:[2,d.TYPES.BYTES],localBaseKeyPrivate:[3,d.TYPES.BYTES],localRatchetKey:[4,d.TYPES.BYTES],localRatchetKeyPrivate:[5,d.TYPES.BYTES],localIdentityKey:[7,d.TYPES.BYTES],localIdentityKeyPrivate:[8,d.TYPES.BYTES]};e.internalSpec={senderRatchetKey:[1,d.TYPES.BYTES],senderRatchetKeyPrivate:[2,d.TYPES.BYTES],chainKey:[3,d.TYPES.MESSAGE,h],messageKeys:[4,d.FLAGS.REPEATED|d.TYPES.MESSAGE,f]};f.internalSpec={index:[1,d.TYPES.UINT32],cipherKey:[2,d.TYPES.BYTES],macKey:[3,d.TYPES.BYTES],iv:[4,d.TYPES.BYTES]};h.internalSpec={index:[1,d.TYPES.UINT32],key:[2,d.TYPES.BYTES]};i.internalSpec={currentSession:[1,d.TYPES.MESSAGE,a],previousSessions:[2,d.FLAGS.REPEATED|d.TYPES.MESSAGE,a]};j.internalSpec={id:[1,d.TYPES.UINT32],publicKey:[2,d.TYPES.BYTES],privateKey:[3,d.TYPES.BYTES]};k.internalSpec={id:[1,d.TYPES.UINT32],publicKey:[2,d.TYPES.BYTES],privateKey:[3,d.TYPES.BYTES],signature:[4,d.TYPES.BYTES],timestamp:[5,d.TYPES.FIXED64]};l.internalSpec={publicKey:[1,d.TYPES.BYTES],privateKey:[2,d.TYPES.BYTES]};m.internalSpec={senderKeyId:[1,d.TYPES.UINT32],senderChainKey:[2,d.TYPES.MESSAGE,p],senderSigningKey:[3,d.TYPES.MESSAGE,n],senderMessageKeys:[4,d.FLAGS.REPEATED|d.TYPES.MESSAGE,o]};n.internalSpec={"public":[1,d.TYPES.BYTES],"private":[2,d.TYPES.BYTES]};o.internalSpec={iteration:[1,d.TYPES.UINT32],seed:[2,d.TYPES.BYTES]};p.internalSpec={iteration:[1,d.TYPES.UINT32],seed:[2,d.TYPES.BYTES]};q.internalSpec={senderKeyStates:[1,d.FLAGS.REPEATED|d.TYPES.MESSAGE,m]};g.SessionStructureSpec=a;g.SessionStructure$PendingPreKeySpec=b;g.SessionStructure$PendingKeyExchangeSpec=c;g.SessionStructure$ChainSpec=e;g.SessionStructure$Chain$MessageKeySpec=f;g.SessionStructure$Chain$ChainKeySpec=h;g.RecordStructureSpec=i;g.PreKeyRecordStructureSpec=j;g.SignedPreKeyRecordStructureSpec=k;g.IdentityKeyPairStructureSpec=l;g.SenderKeyStateStructureSpec=m;g.SenderKeyStateStructure$SenderSigningKeySpec=n;g.SenderKeyStateStructure$SenderMessageKeySpec=o;g.SenderKeyStateStructure$SenderChainKeySpec=p;g.SenderKeyRecordStructureSpec=q}),98); __d("WACryptoUtils",["WACryptoDependencies","WACryptoPrimitives","err"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return h(new Uint8Array(a),new Uint8Array(b))}function h(a,b){return a.length===0&&b.length===0||d("WACryptoPrimitives").verify(a,b)}function b(a,b){return a.length===0&&b.length===0||d("WACryptoPrimitives").verify(a,b)}function e(a,b){return a.length===0&&b.length===0||d("WACryptoPrimitives").verify(a,b)}function f(a){if(a!==(a|0))throw c("err")("bound must be int32");if(a<=0)throw c("err")("bound must not be positive");var b=new Int32Array(1),e=-1>>>1;e=a*Math.floor(e/a);var f=-1;while(f===-1){d("WACryptoDependencies").getCrypto().getRandomValues(b);var g=b[0]>>>1;g<e&&(f=g%a)}return f}g.arrayBuffersEqual=a;g.uint8ArraysEqual=h;g.rawKeysEqual=b;g.serializedPubKeysEqual=e;g.randomNumberLessThan=f}),98); __d("WASignalOther",["WACryptoDependencies","WACryptoHkdf","WACryptoUtils","WAParsableXmlNode","decodeProtobuf","encodeProtobuf","err"],(function(a,b,c,d,e,f,g){"use strict";var h={name:"AES-CBC"},i={name:"HMAC",hash:"SHA-256"};function j(a,b){if(a.length!==b)throw c("err")("Signal expected "+b+" bytes, given "+a.length);return a}function a(a,b){return j(new Uint8Array(a),b)}function b(a){var b=a.buffer,c=a.byteOffset;a=a.length;return c===0&&a===b.byteLength?b:b.slice(c,c+a)}function e(a,b){return a.readByteArray(b)}function f(a){return new Uint8Array(a)}function k(a,b,d){if(a.length-b<d)throw c("err")("Can not split off "+d+" bytes from index "+b+" of "+a.length+" bytes");return a.slice(b,b+d)}function l(a){a=a==="extendedRange"?(-1>>>1)-1:16380;return d("WACryptoUtils").randomNumberLessThan(a)+1}function m(a){return q(a)}function n(a){return d("WAParsableXmlNode").convertBytesToUint(a,4)}function o(){var a=-1>>>1;return d("WACryptoUtils").randomNumberLessThan(a)+1}function p(a){return q(a)}function q(a,b,d){b===void 0&&(b=0);d===void 0&&(d=4294967296);if(typeof a==="number"&&b<=a&&a<d&&Math.floor(a)===a)return a;else throw c("err")("Expected integer in range ["+b+", "+d+"), given "+String(a))}function r(a,b){return d("encodeProtobuf").encodeProtobuf(a,b).readByteArray()}function s(a,b,c){return c(d("decodeProtobuf").decodeProtobuf(a,b))}function t(a,b,c,e){return d("WACryptoHkdf").extractWithSaltAndExpand(a,b,c,e).then(function(a){return new Uint8Array(a)})}function u(a,b){var c,e;b==="hmac-sha256"?(c=i,e=["sign"]):(b,c=h,e=["encrypt","decrypt"]);return d("WACryptoDependencies").getCrypto().subtle.importKey("raw",a,c,!1,e)}function v(a){return a}function w(a){return a}function x(a,b){return d("WACryptoUtils").arrayBuffersEqual(a,b)}g.AES_CBC=h;g.HMAC_SHA256=i;g.ensureSize=j;g.toBytes=a;g.toBuffer=b;g.readBytes=e;g.makeBytes=f;g.sliceBytes=k;g.makeRegistrationId=l;g.castRegistrationId=m;g.castRegistrationIdFromBytes=n;g.makeSenderKeyId=o;g.castSenderKeyId=p;g.ensureIntInRange=q;g.encodeSignalProto=r;g.decodeSignalProto=s;g.hkdf=t;g.makeCryptoKey=u;g.castToByteEncoded=v;g.castToSessionHash=w;g.areSessionHashesEqual=x}),98); __d("WASignalKeys",["WACryptoDependencies","WACryptoPrimitives","WALogger","WASignalLocalStorageProtocol.pb","WASignalOther","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["deserializePreKey error ",""]);h=function(){return a};return a}var i=5,j=16777215;function k(a,b){return{publicKey:a,privateKey:b}}function a(a){a=d("WACryptoPrimitives").keypairFromSecretKey(a);var b=a.publicKey;a=a.secretKey;return k(d("WASignalOther").ensureSize(b,32),d("WASignalOther").ensureSize(a,32))}function b(a,b){return{publicKey:d("WASignalOther").toBytes(a,32),privateKey:d("WASignalOther").toBytes(b,32)}}function l(){var a=d("WACryptoPrimitives").keyPair(),b=a.publicKey;a=a.secretKey;a[0]&=248;a[31]=64|a[31]&63;return k(d("WASignalOther").ensureSize(b,32),d("WASignalOther").ensureSize(a,32))}function m(a,b){return k(d("WASignalOther").sliceBytes(b,1,32),a)}function n(a,b){return{serializedPubKey:b,privateKey:a}}function e(){var a=l();return n(a.privateKey,o(a))}function o(a){var b=d("WASignalOther").makeBytes(33);b[0]=i;b.set(a.publicKey,1);return b}function f(a){var b=d("WASignalOther").makeBytes(33);b[0]=i;b.set(d("WASignalOther").ensureSize(a,32),1);return b}function p(a){return n(a.privateKey,o(a))}function q(a,b){a=(a-1)%j;a<=0&&(a+=j);var c=[];for(var e=0;e<b;e++){var f=a===j?1:a+1,g=l(),h=d("WASignalOther").encodeSignalProto(d("WASignalLocalStorageProtocol.pb").PreKeyRecordStructureSpec,{id:f,publicKey:o(g),privateKey:g.privateKey});c.push({plainObject:{id:f,keyPair:g},record:h});a=f}return c}function r(a){try{a=d("decodeProtobuf").decodeProtobuf(d("WASignalLocalStorageProtocol.pb").PreKeyRecordStructureSpec,a);var b=a.id,c=a.publicKey;a=a.privateKey;return b==null||c==null||a==null?null:{id:s(b),keyPair:m(d("WASignalOther").toBytes(a,32),u(new Uint8Array(c)))}}catch(a){d("WALogger").DEV(h(),a);return null}}function s(a){return d("WASignalOther").ensureIntInRange(a,1,j)}function t(a){return d("WASignalOther").ensureIntInRange(a,0,j)}function u(a){if(a.length===0||a[0]!==i)throw c("err")("Unrecognized public key type");return d("WASignalOther").ensureSize(a,33)}function v(){var a=d("WASignalOther").makeBytes(32);d("WACryptoDependencies").getCrypto().getRandomValues(a);return a}function w(a,b){return d("WACryptoPrimitives").scalarMult(a,b.subarray(1)).buffer}g.KEY_TYPE=i;g.makeKeyPairFrom=a;g.makeKeyPairFromArrayBuffers=b;g.makeKeyPair=l;g.makeKeyPairFromSerialized=m;g.makeSerializedKeyPairFrom=n;g.makeSerializedKeyPair=e;g.serializePubKey=o;g.serializeIdentity=f;g.toSerializedKeyPair=p;g.makePreKeys=q;g.deserializePreKey=r;g.castToPreKeyId=s;g.castToSignedPreKeyId=t;g.castToSerializedPubKey=u;g.makeRawSenderKey=v;g.ecdh=w}),98); __d("WATextEncoding",[],(function(a,b,c,d,e,f){"use strict";e=TextEncoder;var g=TextDecoder,h=e,i=g;function a(){return new h()}function b(){return new i()}function c(a){h=a}function d(a){i=a}f.newTextEncoder=a;f.newTextDecoder=b;f.setTextEncoderClass=c;f.setTextDecoderClass=d}),66); __d("WAWapDict",[],(function(a,b,c,d,e,f){"use strict";a=3;b=["xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"];c=["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"];d=["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"];e=["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"];var g=["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"],h=[c,d,e,g];f.DICT_VERSION=a;f.SINGLE_BYTE_TOKEN=b;f.DICTIONARY_0_TOKEN=c;f.DICTIONARY_1_TOKEN=d;f.DICTIONARY_2_TOKEN=e;f.DICTIONARY_3_TOKEN=g;f.DICTIONARIES=h}),66); __d("WAWapJid",["$InternalEnum","WAJids"],(function(a,b,c,d,e,f,g){"use strict";var h={JID:0,JID_U:1,JID_AD:1,JID_FB:3,JID_INTEROP:4},i=b("$InternalEnum")({WHATSAPP:0,LID:1,HOSTED:128,HOSTED_LID:129});a=function(){function a(a){this.$1=a}a.createAD=function(b,c,d){return new a({type:h.JID_AD,user:b,device:d==null?0:d,agent:c==null?0:c,domainType:i.WHATSAPP})};a.createJidU=function(b,c,d){return new a({type:h.JID_U,user:b,device:d==null?0:d,domainType:c==null?i.WHATSAPP:c})};a.createFbJid=function(b,c){c=c==null?0:c;return new a({type:h.JID_FB,user:b,device:c})};a.createInteropJid=function(b,c,d){c=c==null?0:c;return new a({type:h.JID_INTEROP,user:b,device:c,integrator:d})};a.create=function(b,c){return new a({type:h.JID,user:b,server:c})};var b=a.prototype;b.toString=function(){if(this.$1.type===h.JID_AD||this.$1.type===h.JID_U){var a=this.$1,b=a.user,c=a.device;a=a.domainType;var e;a===i.WHATSAPP?e=d("WAJids").WA_USER_JID_SUFFIX:a===i.HOSTED?e=d("WAJids").HOSTED_SUFFIX:a===i.HOSTED_LID?e=d("WAJids").HOSTED_LID_SUFFIX:e=d("WAJids").LID_SUFFIX;return c===0?b+"@"+e:b+":"+c+"@"+e}else if(this.$1.type===h.JID_FB){a=this.$1;b=a.user;c=a.device;e=d("WAJids").MSGR_USER_JID_SUFFIX;return b+":"+c+"@"+e}else if(this.$1.type===h.JID_INTEROP){a=this.$1;b=a.user;c=a.device;e=a.integrator;a=d("WAJids").INTEROP_USER_JID_SUFFIX;return e+"-"+b+":"+c+"@"+a}else{this.$1.type;e=this.$1;b=e.user;c=e.server;return b!=null?b+"@"+c:c}};b.getInnerJid=function(){return this.$1};return a}();g.WAP_JID_SUBTYPE=h;g.DomainType=i;g.WapJid=a}),98); __d("WAXmlFormatter",[],(function(a,b,c,d,e,f){"use strict";function a(a){a=a.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").replace(/\s*xmlns:/g,"~::~xmlns:").replace(/\s*xmlns=/g,"~::~xmlns=").split("~::~");var b=a.length,c=!1,d=0,e="",f=0,h=["\n"];for(f=0;f<100;f++)h.push(h[f]+" ");var i=function(b,a){var c=/^<[\w:\-.,]+/.exec(b[a-1]);b=/^<\/[\w:\-.,]+/.exec(b[a]);return c!=null&&b!=null&&c[0]===b[0]};for(f=0;f<b;f++)a[f].search(/<!/)>-1?(e+=h[d]+a[f],c=!0,(a[f].search(/-->/)>-1||a[f].search(/\]>/)>-1||a[f].search(/!DOCTYPE/)>-1)&&(c=!1)):a[f].search(/-->/)>-1||a[f].search(/\]>/)>-1?(e+=a[f],c=!1):i(a,f)?(e+=a[f],c||d--):a[f].search(/<\w/)>-1&&a[f].search(/<\//)===-1&&a[f].search(/\/>/)===-1?(a[f]=g(a[f]),e=c?e+=a[f]:e+=h[d++]+a[f]):a[f].search(/<\w/)>-1&&a[f].search(/<\//)>-1?e=c?e+=a[f]:e+=h[d]+a[f]:a[f].search(/<\//)>-1?e=c?e+=a[f]:e+=h[d===0?d:--d]+a[f]:a[f].search(/\/>/)>-1?e=c?e+=a[f]:e+=h[d]+a[f]:a[f].search(/<\?/)>-1?e+=h[d]+a[f]:a[f].search(/xmlns:/)>-1||a[f].search(/xmlns=/)>-1?e+=h[d]+a[f]:e+=a[f];return e[0]==="\n"?e.slice(1):e}function g(a){var b=a.match(/(<query.*>|<result>)(\{.*\})/);if(b===null)return a;try{var c=b[1];b=JSON.stringify(JSON.parse(b[2]),null,2);return c+"\n"+b}catch(b){return a+"[Error formatting JSON]"}}f["default"]=a}),66); __d("WAXmlNode",["WAHex"],(function(a,b,c,d,e,f,g){"use strict";var h={};a=function(){function a(a,b,c){b===void 0&&(b=h),c===void 0&&(c=null),this.tag=a,this.attrs=b,this.content=c}var b=a.prototype;b.toString=function(){var a="<"+this.tag;a+=i(this.attrs);var b=this.content;Array.isArray(b)?a+=">"+b.map(String).join("")+"</"+this.tag+">":b instanceof Uint8Array?a+=">"+j(b)+"</"+this.tag+">":b!=null?a+=">"+String(b)+"</"+this.tag+">":a+=" />";return a};return a}();function i(a){var b=Object.keys(a),c="";for(var d=0;d<b.length;d++){var e=b[d];c+=" "+e+'="'+a[e].toString()+'"'}return c}function j(a){var b;a.length===0?b="<!-- empty binary -->":a.length<50?b=d("WAHex").bytesToDebugString(a):b="<!-- "+a.length+" bytes -->";return b}g.XmlNode=a;g.attrsToString=i;g.uint8ArrayToDebugString=j}),98); __d("WAWap",["WAAssertUnreachable","WABinary","WACryptoDependencies","WAJids","WALogger","WALongInt","WATextEncoding","WAWapDict","WAWapJid","WAXmlFormatter","WAXmlNode","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["decodeNullableString got invalid value: ",", string expected"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["decodeString got invalid value: ",", string expected"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Decoding compressed stanza"]);k=function(){return a};return a}var l=(h=d("WAJids")).MSGR_USER_DOMAIN.replace("@",""),aa=h.WA_USER_DOMAIN.replace("@",""),m=h.LID_DOMAIN.replace("@",""),n=h.INTEROP_DOMAIN.replace("@",""),o=h.HOSTED_DOMAIN.replace("@",""),p=2,ba=128,q=0,r=236,s=237,t=238,u=239,ca=[r,s,t,u],v=245,w=246,x=247,y=248,z=249,A=250,B=251,C=252,D=253,E=254,F=255,da=["0","1","2","3","4","5","6","7","8","9","-",".","\ufffd","\ufffd","\ufffd","\ufffd"],ea=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],G="",fa=1,H={sentinel:"DROP_ATTR"},I=(s=d("WAWapJid")).WapJid.create(null,"g.us"),J=s.WapJid.create(null,h.WA_SERVER_JID_SUFFIX);t=s.WapJid.create("status","broadcast");var K=s.WapJid.create(null,"newsletter");h=s.WapJid.create(null,"hosted");var ga=s.WapJid.create(null,"hosted.lid"),L=s.WapJid.create(null,"call"),M={},N=!1;function a(){N=!0}var ha=d("WATextEncoding").newTextEncoder(),O=function(){function a(a,b,c){b===void 0&&(b=M),c===void 0&&(c=null),this.tag=a,this.attrs=b,this.content=c}var b=a.prototype;b.toString=function(){var a="<"+this.tag;a+=d("WAXmlNode").attrsToString(this.attrs);var b=this.content;Array.isArray(b)?a+=">"+b.map(String).join("")+"</"+this.tag+">":b?a+=">"+d("WAXmlNode").uint8ArrayToDebugString(b)+"</"+this.tag+">":a+=" />";N&&(a=c("WAXmlFormatter")(a));return a};return a}();function b(a,b,e){var f=null;if(b&&b.children!=null)throw c("err")('Children should not be passed via props (see eslint check "react/no-children-props")');if(Array.isArray(e))f=e.filter(Boolean);else if(typeof e==="string")f=d("WABinary").Binary.build(e).readByteArray();else if(e instanceof ArrayBuffer)f=new Uint8Array(e);else if(e instanceof Uint8Array)f=e;else{var g=[];for(var h=2;h<arguments.length;h++){var i=arguments[h];i&&g.push(i)}f=g}Array.isArray(f)&&f.length===0&&(f=null);var j={};if(b){var k=b;Object.keys(k).forEach(function(b){if(["__self","__source"].includes(b))return;var d=k[b];if(d==null)throw c("err")("Attr "+b+" in <"+a+"> is null");if(d===H)return;j[b]=d})}return new O(a,j,f)}s=b;function e(a){return a instanceof d("WAWapJid").WapJid?a.toString():a}function P(a){var b=a.content;Array.isArray(b)?b=b.map(P):typeof b==="string"&&(b=d("WABinary").Binary.build(b).readByteArray());return new O(a.tag,a.attrs||M,b)}function f(a){a=a instanceof O?a:P(a);var b=new(d("WABinary").Binary)();Q(a,b);a=0;b=b.readByteArray();var c=new Uint8Array(1+b.length);c[0]=a;c.set(b,1);return c}function Q(a,b){if(a==null)b.writeUint8(q);else if(a instanceof O)R(a,b);else if(a instanceof d("WAWapJid").WapJid)ia(a,b);else if(typeof a==="string")V(a,b);else if(a instanceof Uint8Array)ka(a,b);else{a;b=typeof a;throw c("err")("Invalid payload type "+b)}}function ia(a,b){a=a.getInnerJid();if(a.type===d("WAWapJid").WAP_JID_SUBTYPE.JID_U){var c=a.user,e=a.device,f=a.domainType;b.writeUint8(x);b.writeUint8(f);b.writeUint8(e);Q(c,b)}else if(a.type===d("WAWapJid").WAP_JID_SUBTYPE.JID_FB){f=a.user;e=a.device;b.writeUint8(w);Q(f,b);b.writeUint16(e);Q(l,b)}else if(a.type===d("WAWapJid").WAP_JID_SUBTYPE.JID_INTEROP){c=a.user;f=a.device;e=a.integrator;b.writeUint8(v);Q(c,b);b.writeUint16(f);b.writeUint16(e)}else{c=a.user;f=a.server;b.writeUint8(A);c!=null?Q(c,b):b.writeUint8(q);Q(f,b)}}function R(a,b){if(a.tag===void 0){b.writeUint8(y);b.writeUint8(q);return}var c=1;a.attrs&&(c+=Object.keys(a.attrs).length*2);a.content&&c++;c<256?(b.writeUint8(y),b.writeUint8(c)):c<65536&&(b.writeUint8(z),b.writeUint16(c));Q(a.tag,b);a.attrs&&Object.keys(a.attrs).forEach(function(c){V(c,b),Q(a.attrs[c],b)});c=a.content;if(Array.isArray(c)){c.length<256?(b.writeUint8(y),b.writeUint8(c.length)):c.length<65536&&(b.writeUint8(z),b.writeUint16(c.length));for(var d=0;d<c.length;d++)R(c[d],b)}else c&&Q(c,b)}var S,T;function U(a){var b=new Map();for(var c=0;c<a.length;c++)b.set(a[c],c);return b}function V(a,b){if(a===""){b.writeUint8(C);b.writeUint8(0);return}S==null&&(S=U(d("WAWapDict").SINGLE_BYTE_TOKEN));var c=S.get(a);if(c!=null){b.writeUint8(c+1);return}if(T==null){T=[];for(c=0;c<d("WAWapDict").DICTIONARIES.length;++c)T.push(U(d("WAWapDict").DICTIONARIES[c]))}for(c=0;c<T.length;++c){var e=T[c].get(a);if(e!=null){b.writeUint8(ca[c]);b.writeUint8(e);return}}e=d("WABinary").numUtf8Bytes(a);if(e<128){c=/[^0-9.-]+?/;var f=/[^0-9A-F]+?/;if(!c.exec(a)){ja(a,F,b);return}else if(!f.exec(a)){ja(a,B,b);return}}la(e,b);b.writeString(a)}function ja(a,b,d){var e=a.length%2===1;d.writeUint8(b);var f=Math.ceil(a.length/2);e&&(f|=ba);d.writeUint8(f);e=0;for(f=0;f<a.length;f++){var g=a.charCodeAt(f),h=null;48<=g&&g<=57?h=g-48:b===F?g===45?h=10:g===46&&(h=11):b===B&&(65<=g&&g<=70&&(h=g-55));if(h==null)throw c("err")("Cannot nibble encode "+g);else f%2===0?(e=h<<4,f===a.length-1&&(e|=15,d.writeUint8(e))):(e|=h,d.writeUint8(e))}}function ka(a,b){la(a.length,b),b.writeByteArray(a)}function la(a,b){if(a<256)b.writeUint8(C),b.writeUint8(a);else if(a<1048576)b.writeUint8(D),b.writeUint8(a>>>16&255),b.writeUint8(a>>>8&255),b.writeUint8(a&255);else if(a<4294967296)b.writeUint8(E),b.writeUint32(a);else throw c("err")("Binary with length "+a+" is too big for WAP protocol")}function ma(a,b){a=new(d("WABinary").Binary)(a);var c=a.readUint8();c=c&p;if(c){d("WALogger").LOG(k());return b(a.readByteArray()).then(function(a){return X(new(d("WABinary").Binary)(a))})}return Promise.resolve(X(a))}function na(a){a=new(d("WABinary").Binary)(a);var b=a.readUint8();b=b&p;if(b)throw c("err")("Cannot pass compressed stanza to decodeStanzaDebug");return X(a)}function W(a,b){var e=a.readUint8();if(e===q)return null;if(e===y)return oa(a,a.readUint8());if(e===z)return oa(a,a.readUint16());if(e===C){var f=a.readUint8();return Z(a,f,b)}if(e===D){f=a.readUint8();var g=a.readUint8(),h=a.readUint8();f=((f&15)<<16)+(g<<8)+h;return Z(a,f,b)}if(e===E){g=a.readUint32();return Z(a,g,b)}if(e===A)return qa(a);if(e===w)return ra(a);if(e===v)return sa(a);if(e===x)return ta(a);if(e===F){h=a.readUint8();f=h>>>7;g=h&127;return ua(a,da,f,g)}if(e===B){b=a.readUint8();h=b>>>7;f=b&127;return ua(a,ea,h,f)}if(e<=0||e>=240)throw c("err")("Unable to decode WAP buffer");if(e>=r&&e<=u){g=e-r;b=d("WAWapDict").DICTIONARIES[g];if(b===void 0)throw c("err")("Missing WAP dictionary "+g);h=a.readUint8();f=b[h];if(f===void 0)throw c("err")("Invalid value index "+h+" in dict "+g);return f}a=d("WAWapDict").SINGLE_BYTE_TOKEN[e-1];if(a===void 0)throw c("err")("Undefined token with index "+e);return a}function oa(a,b){var c=[];for(var d=0;d<b;d++)c.push(X(a));return c}function X(a){var b=a.readUint8(),e;if(b===y)e=a.readUint8();else if(b===z)e=a.readUint16();else throw c("err")("Failed to decode node since type byte "+String(b)+" is invalid");b=void 0;var f=null;if(e===0)throw c("err")("Failed to decode node, list cannot be empty");var g=Y(a);e-=1;while(e>1){b||(b={});var h=Y(a),i=W(a,!0);b[h]=i;e-=2}e===1&&(f=W(a,!1),f instanceof d("WAWapJid").WapJid&&(f=String(f)),typeof f==="string"&&(f=ha.encode(f)));return new O(g,b,f)}function Y(a){a=W(a,!0);if(typeof a!=="string"){d("WALogger").DEV(j(),String(a));throw c("err")("WAWap:decodeString got invalid value, string expected")}return a}function pa(a){a=W(a,!0);if(a!=null&&typeof a!=="string"){d("WALogger").DEV(i(),String(a));throw c("err")("WAWap:decodeNullableString got invalid value, string expected")}return a}function qa(a){var b=pa(a);a=Y(a);return d("WAWapJid").WapJid.create(b,a)}function ra(a){var b=Y(a),c=a.readUint16();Y(a);return d("WAWapJid").WapJid.createFbJid(b,c)}function sa(a){var b=Y(a),c=a.readUint16(),e=a.readUint16();Y(a);return d("WAWapJid").WapJid.createInteropJid(b,c,e)}function ta(a){var b=null,e=a.readUint8();if(e===0)b=d("WAWapJid").DomainType.WHATSAPP;else if(e===1)b=d("WAWapJid").DomainType.LID;else if((1&e)===0&&(128&e)!==0)b=d("WAWapJid").DomainType.HOSTED;else if(e===129)b=d("WAWapJid").DomainType.HOSTED_LID;else throw c("err")("decodeJidU - Invalid domain type encoding "+e);e=a.readUint8();a=Y(a);return d("WAWapJid").WapJid.createJidU(a,b,e)}function Z(a,b,c){c===void 0&&(c=!1);if(c)return a.readString(b);else return a.readByteArray(b)}function ua(a,b,c,d){d=new Array(d*2-c);for(var e=0;e<d.length-1;e+=2){var f=a.readUint8();d[e]=b[f>>>4];d[e+1]=b[f&15]}if(c){f=a.readUint8();d[d.length-1]=b[f>>>4]}return d.join("")}function va(){if(!G){var a=new Uint16Array(2);d("WACryptoDependencies").getCrypto().getRandomValues(a);G=String(a[0])+"."+String(a[1])+"-"}return""+G+fa++}function wa(a){switch(a.type){case"group":return a.groupJid;case"status":return d("WAJids").STATUS_JID;case"device":return a.deviceJid;case"newsletter":return a.newsletterJid;case"hosted":return a.hostedDeviceJid;case"hostedLid":return a.hostedLidDeviceJid;default:a.type;return a.broadcastJid}}function xa(a){switch(a.type){case"group":return a.author;case"status":return a.author;case"broadcast":return a.author;default:a.type;return null}}function ya(a){return a.type==="status"||a.type==="group"||a.type==="broadcast"?$(a.author):H}function za(a){return $(wa(a))}function $(a){var b=d("WAJids").validateDomainJid(a);if(b!=null)return Aa(b);b=a.split("@");a=b[0];b=b[1];var e=null;if((b===aa||b===l||b===n||b===m||b===o||b===d("WAJids").HOSTED_LID_SUFFIX)&&a.indexOf(":")!==-1){var f=a.split(":");a=f[0];f=f[1];e=parseInt(f,10)}if(b===n){f=a.split("-");var g=f[0];f=f[1];return d("WAWapJid").WapJid.createInteropJid(f,e,parseInt(g,10))}else if(b===l)return d("WAWapJid").WapJid.createFbJid(a,e);f=null;if(b===m)f=d("WAWapJid").DomainType.LID;else if(b===o){if(e!==99)throw c("err")("wid unexpected deviceId");f=d("WAWapJid").DomainType.HOSTED}else if(b===d("WAJids").HOSTED_LID_SUFFIX){if(e!==99)throw c("err")("lid invalid deviceId");f=d("WAWapJid").DomainType.HOSTED_LID}else f=d("WAWapJid").DomainType.WHATSAPP;return e!=null&&e!==0?d("WAWapJid").WapJid.createJidU(a,f,e):d("WAWapJid").WapJid.create(a,b)}function Aa(a){if(a==="s.whatsapp.net")return J;else if(a==="g.us")return I;else if(a==="newsletter")return K;else if(a==="call")return L;else return c("WAAssertUnreachable")(a)}function Ba(a){return $(a)}function Ca(a){return $(a)}function Da(a){return $(a)}function Ea(a){return $(a)}function Fa(a){return $(a)}function Ga(a){return $(a)}function Ha(a){if(a.jidType==="phoneDevice")return $(a.deviceJid);else if(a.jidType==="msgrDevice")return $(a.deviceJid);else if(a.jidType==="lidDevice")return $(a.deviceJid);else if(a.jidType==="phoneUser")return $(a.userJid);else if(a.jidType==="msgrUser")return $(a.userJid);else if(a.jidType==="lidUser")return $(a.userJid);else if(a.jidType==="group")return $(a.groupJid);else if(a.jidType==="status")return $(a.statusJid);else if(a.jidType==="call")return $(a.callJid);else if(a.jidType==="interopDevice")return $(a.deviceJid);else if(a.jidType==="interopUser")return $(a.userJid);else if(a.jidType==="newsletter")return $(a.newsletterJid);else if(a.jidType==="hosted")return $(a.hostedDeviceJid);else if(a.jidType==="hostedLid")return $(a.hostedLidDeviceJid);else if(a.jidType==="bot")return $(a.botJid);else{a.jidType;return $(a.broadcastJid)}}function Ia(a){return a}function Ja(a){return a.toString()}function Ka(a){return a}function La(a){return a==null?H:a}function Ma(a){return a.toString()}function Na(a){return d("WALongInt").longIntToDecimalString(a)}function Oa(a,b){b===void 0&&(b=4);a=a;var c=new Uint8Array(b);for(b=b-1;b>=0;b--)c[b]=a&255,a>>>=8;return c}g.DROP_ATTR=H;g.G_US=I;g.S_WHATSAPP_NET=J;g.STATUS_BROADCAST=t;g.NEWSLETTER=K;g.HOSTED=h;g.HOSTED_LID=ga;g.CALL=L;g.enableXMLFormat=a;g.WapNode=O;g.makeWapNode=b;g.wap=s;g.decodeAsString=e;g.makeStanza=P;g.encodeStanza=f;g.decodeStanza=ma;g.decodeStanzaDebug=na;g.generateId=va;g.extractToJid=wa;g.extractParticipantJid=xa;g.PARTICIPANT_JID=ya;g.TO_JID=za;g.JID=$;g.DOMAIN_JID=Aa;g.USER_JID=Ba;g.DEVICE_JID=Ca;g.GROUP_JID=Da;g.BROADCAST_JID=Ea;g.CALL_JID=Fa;g.NEWSLETTER_JID=Ga;g.TO_WAP_JID=Ha;g.STANZA_ID=Ia;g.SMAX_ID=Ja;g.CUSTOM_STRING=Ka;g.MAYBE_CUSTOM_STRING=La;g.INT=Ma;g.LONG_INT=Na;g.BIG_ENDIAN_CONTENT=Oa}),98); __d("WAParsableWapNode",["WABinary","WAJids","WALogger","WALongInt","WAParsableXmlNode","WASignalKeys","WATimeUtils","WAWap","WAWapJid","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ParsableWapNode: attrFromJid() is called with ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ParsableWapNode: attrFromJid() is called with ",""]);i=function(){return a};return a}var j=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){var d;d=b.call(this,"XmppParsingFailure: "+a+": "+c)||this;d.name="XmppParsingFailure";d.parser=a;d.reason=c;return d}var c=a.prototype;c.toString=function(){return"XmppParsingFailure: "+this.parser+": "+this.reason};return a}(babelHelpers.wrapNativeSuper(Error));a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){return a.call(this,b,c)||this}var e=b.prototype;e.assertFromServer=function(){var a=this.attrString("from");a!==d("WAJids").WA_SERVER_JID_SUFFIX&&this["throw"]('to have "from"="s.whatsapp.net", but instead has "'+a+'"')};e.attrUserJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.botJid!=null)return c.botJid;else if(c.userJid==null)return this["throw"]('to have "'+a+'"={UserJid}, but instead has "'+b+'"');return c.userJid};e.attrPhoneUserJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);return c.jidType==="phoneUser"?c.userJid:this["throw"]('to have "'+a+'"={PhoneUserJid}, but instead has "'+b+'"')};e.attrLidUserJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);return c.jidType==="lidUser"?c.userJid:this["throw"]('to have "'+a+'"={LidUserJid}, but instead has "'+b+'"')};e.maybeAttrUserJid=function(a){return this.hasAttr(a)?this.attrUserJid(a):null};e.maybeAttrPhoneUserJid=function(a){return this.hasAttr(a)?this.attrPhoneUserJid(a):null};e.maybeAttrLidUserJid=function(a){return this.hasAttr(a)?this.attrLidUserJid(a):null};e.attrGroupJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);return c.groupJid==null?this["throw"]('to have "'+a+'"={GroupJid}, but instead has "'+b+'"'):c.groupJid};e.maybeAttrGroupJid=function(a){return this.hasAttr(a)?this.attrGroupJid(a):null};e.attrChatJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.userJid!=null)return c.userJid;return c.groupJid!=null?c.groupJid:this["throw"]('to have "'+a+'"={ChatJid}, but instead has "'+b+'"')};e.attrPhoneChatJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.jidType==="phoneUser")return c.userJid;else if(c.jidType==="group")return c.groupJid;else return this["throw"]('to have "'+a+'"={ChatJid}, but instead has "'+b+'"')};e.attrDeviceJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.deviceJid!=null)return c.deviceJid;if(c.userJid!=null)return d("WAJids").defaultDeviceJidForUser(c.userJid);if(c.hostedDeviceJid!=null)return c.hostedDeviceJid;if(c.hostedLidDeviceJid!=null)return c.hostedLidDeviceJid;return c.botJid!=null?c.botJid:this["throw"]('to have "'+a+'"={DeviceJid}, but instead has "'+b+'"')};e.attrPhoneDeviceJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.jidType==="phoneDevice")return c.deviceJid;return c.jidType==="phoneUser"?d("WAJids").defaultPhoneDeviceJidForUser(c.userJid):this["throw"]('to have "'+a+'"={PhoneDeviceJid}, but instead has "'+b+'"')};e.attrLidDeviceJid=function(a){var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);if(c.jidType==="lidDevice")return c.deviceJid;return c.jidType==="lidUser"?d("WAJids").defaultLidDeviceJidForLidUserJid(c.userJid):this["throw"]('to have "'+a+'"={LidDeviceJid}, but instead has "'+b+'"')};e.attrDeviceId=function(a){a=this.attrInt(a);return d("WAJids").interpretAsDeviceId(a)};e.attrFromJidChat=function(){var a=this.attrJidWithType();switch(a.jidType){case"msgrUser":var b=a.userJid,e=d("WAJids").defaultDeviceJidForUser(b);return{type:"device",chat:b,deviceJid:e,author:e};case"interopUser":b=a.userJid;e=d("WAJids").defaultDeviceJidForUser(b);return{type:"device",chat:b,deviceJid:e,author:e};case"phoneUser":b=a.userJid;e=d("WAJids").defaultDeviceJidForUser(b);return{type:"device",chat:b,deviceJid:e,author:e};case"lidUser":b=a.userJid;e=d("WAJids").defaultLidDeviceJidForLidUserJid(b);return{type:"device",chat:b,deviceJid:e,author:e};case"phoneDevice":b=a.deviceJid;return{type:"device",chat:d("WAJids").extractUserJid(b),deviceJid:b,author:b};case"msgrDevice":e=a.deviceJid;return{type:"device",chat:d("WAJids").extractUserJid(e),deviceJid:e,author:e};case"interopDevice":b=a.deviceJid;return{type:"device",chat:d("WAJids").extractUserJid(b),deviceJid:b,author:b};case"lidDevice":e=a.deviceJid;return{type:"device",chat:d("WAJids").extractUserJid(e),deviceJid:e,author:e};case"group":b=this.hasAttr("participant")?this.attrDeviceJid("participant"):null;return b==null?this["throw"]("expected to have participant JID for group"):{type:"group",chat:a.groupJid,groupJid:a.groupJid,author:b};case"broadcast":e=this.hasAttr("participant")?this.attrDeviceJid("participant"):null;return e==null?this["throw"]("expected to have participant JID for group"):{type:"broadcast",broadcastJid:a.broadcastJid,chat:d("WAJids").extractUserJid(e),author:e};case"hosted":b=a.hostedDeviceJid;return{type:"device",chat:d("WAJids").extractUserJid(b),deviceJid:b,author:b};case"hostedLid":e=a.hostedLidDeviceJid;return{type:"device",chat:d("WAJids").extractUserJid(e),deviceJid:e,author:e};case"call":d("WALogger").ERROR(i(),a.callJid);throw c("err")("ParsableWapNode: attrFromJid() does not support CallJid");default:a.jidType;return this["throw"]("attrFromJidChat should not be used with jid of type "+a.jidType)}};e.attrFromJidPhoneChat=function(){var a=this.attrJidWithType();switch(a.jidType){case"phoneUser":var b=a.userJid,e=d("WAJids").defaultPhoneDeviceJidForUser(b);return{type:"device",chat:b,deviceJid:e,author:e};case"phoneDevice":b=a.deviceJid;return{type:"device",chat:d("WAJids").extractPhoneUserJid(b),deviceJid:b,author:b};case"group":e=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return e==null?this["throw"]("expected to have participant JID for group"):{type:"group",chat:a.groupJid,groupJid:a.groupJid,author:e};case"broadcast":b=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return b==null?this["throw"]("expected to have participant JID for group"):{type:"broadcast",broadcastJid:a.broadcastJid,chat:d("WAJids").extractPhoneUserJid(b),author:b};case"call":d("WALogger").ERROR(h(),a.callJid);throw c("err")("ParsableWapNode: attrFromJid() does not support CallJid");default:a.jidType;return this["throw"]("attrFromJidChat should not be used with jid of type "+a.jidType)}};e.attrFromPhoneJid=function(){var a=this.attrJidWithType();if(a.jidType==="status"){a=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return a==null?this["throw"]("to have participant for status msg"):{type:"status",author:a}}else return this.attrFromJidPhoneChat()};e.attrFromJid=function(){var a=this.attrJidWithType();if(a.jidType==="status"){var b=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return b==null?this["throw"]("to have participant for status msg"):{type:"status",author:b}}if(a.jidType==="newsletter")return{type:"newsletter",newsletterJid:a.newsletterJid};if(a.jidType==="hosted")return{type:"hosted",hostedDeviceJid:a.hostedDeviceJid};return a.jidType==="hostedLid"?{type:"hostedLid",hostedLidDeviceJid:a.hostedLidDeviceJid}:this.attrFromJidChat()};e.attrJidWithType=function(a){a===void 0&&(a="from");var b=this.attrString(a),c=d("WAJids").interpretAndValidateJid(b);return c.jidType==="unknown"?this["throw"]('to have "'+a+'"={Jid}, but instead has "'+b+'"'):c};e.attrWapJid=function(a){a===void 0&&(a="from");a=this.attrString(a);var b=d("WAJids").interpretAndValidateJid(a);return b.jidType==="unknown"?d("WAWapJid").WapJid.create(null,a):d("WAWap").JID(d("WAJids").extractFromJid(b))};e.attrLongInt=function(a){a=this.attrString(a);return d("WALongInt").decimalStringToLongInt(a)};e.attrTime=function(a){return d("WATimeUtils").castToUnixTime(this.attrInt(a))};e.attrFutureTime=function(a){a=this.attrInt(a);return d("WATimeUtils").futureUnixTime(a)};e.contentString=function(){if(this.hasChildren())return this["throw"]("to have string content, but has children instead");else if(this.hasContent()){var a=new(d("WABinary").Binary)(this.contentBytes());return a.readString(a.size())}else return this["throw"]("to have content")};e.decodeAsString=function(a){return d("WAWap").decodeAsString(a)};e.contentSerializedPubKey=function(){if(this.hasContent())return d("WASignalKeys").serializeIdentity(this.contentBytes());else return this["throw"]("to have content")};e.createParseError=function(a){return new j(this.name(),"expected <"+this.tag()+"> "+a)};e["throw"]=function(a){throw this.createParseError(a)};return b}(d("WAParsableXmlNode").ParsableXmlNode);g.XmppParsingFailure=j;g.ParsableWapNode=a}),98); __d("WADeprecatedWapParser",["WAParsableWapNode","err"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(a,b){this.$1=a,this.$2=b}var b=a.prototype;b.parse=function(a){a=new(d("WAParsableWapNode").ParsableWapNode)(this.$1,a);try{return{success:this.$2(a)}}catch(a){if(a instanceof d("WAParsableWapNode").XmppParsingFailure)return{error:a};else throw a}};b.parseOrThrow=function(a){a=this.parse(a);if(a.error)throw c("err")(String(a.error));return a.success};return a}();g["default"]=a}),98); __d("WAAckParser",["WADeprecatedWapParser","WAJids"],(function(a,b,c,d,e,f,g){"use strict";b=new(c("WADeprecatedWapParser"))("ack",function(a){a.assertTag("ack");return{id:a.attrString("id"),ts:a.maybeAttrString("t"),"class":a.attrString("class"),type:a.maybeAttrString("type"),from:a.attrJidWithType(),participant:a.hasAttr("participant")?a.attrDeviceJid("participant"):null,recipient:a.hasAttr("recipient")?a.attrUserJid("recipient"):null}});function a(a,b){return a.id===b.id&&(b["class"]===void 0||a["class"]===b["class"])&&(b.type===void 0||a.type===b.type)&&(b.from===void 0||h(a.from,b.from))&&(b.participant===void 0||a.participant===b.participant)&&(b.recipient===void 0||a.recipient===b.recipient)&&(b.ts===void 0||a.ts===b.ts)}function h(a,b){if(d("WAJids").extractFromJid(a)===b)return!0;if(a.userJid!=null)return d("WAJids").defaultDeviceJidForUser(a.userJid)===b;if(a.deviceJid!=null){a=a.deviceJid;return d("WAJids").extractDeviceId(a)===0&&d("WAJids").extractUserJid(a)===b}return!1}g.AckParser=b;g.ackMatchesTemplate=a;g.fromJidsAreEqual=h}),98); __d("WAArrayUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=a.pop();b<a.length&&(a[b]=c)}function* b(a,b){for(var c=0;c<a.length;c+=b)yield a.slice(c,c+b)}function c(a,b,c){var d=new Map();for(a of a){var e,f=b(a);e=(e=d.get(f))!=null?e:[];e.push(c(a));d.set(f,e)}return d}f.removeIndexWithoutPreservingOrder=a;f.peekEvery=b;f.groupByAndMap=c}),66); __d("WAErrors",["WACustomError"],(function(a,b,c,d,e,f,g){"use strict";b=(a=d("WACustomError")).customError("BufferTooLarge",!1);c=a.customError("Disconnected",!1);e=a.customError("Offline",!1,c);f=a.customError("MaxRetries",!1);d=a.customError("Aborted",!1);g.BufferTooLargeError=b;g.Disconnected=c;g.Offline=e;g.MaxRetries=f;g.Aborted=d}),98); __d("WANotifyConnectionChangeFactory",[],(function(a,b,c,d,e,f){"use strict";var g=15e3;function a(a,b,c){c===void 0&&(c=g);var d={timeoutID:null,connectionStatus:"disconnected",optimismLevel:"optimist"},e=function(){var a=d.optimismLevel,e=d.connectionStatus;a==="optimist"?d.timeoutID=setTimeout(function(){d.optimismLevel="realist",b(e)},c):b(e)};return function(c){d.connectionStatus=c,c==="disconnected"?e():c==="in_handshake"?e():(c,d.timeoutID!=null&&(clearTimeout(d.timeoutID),d.timeoutID=null),b(c)),a(c)}}f.notifyConnectionChangeFactory=a}),66); __d("WAPromiseBackoffs",["Promise","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,b){if(a===0)return 0;var c=o(b.algo);for(var d=1;d<a;d++)c();return j(b,c())}function i(a){var b=a.relativeDelay,c=b===void 0?!1:b,d=null,e=o(a.algo);return function(){var b=d;if(b==null){d=c?Date.now():0;return 0}var f=j(a,e());if(c){var g=Date.now();b=g-b;b>0&&(f=Math.max(0,f-b));d=g}return f}}function d(a){var c=i(a);return function(a){return new(h||(h=b("Promise")))(function(b){var d=c();d>0?setTimeout(b,d,a):b(a)})}}function j(a,b){var c=a.max,d=a.min;a=a.jitter;a=a===void 0?.1:a;b=b;c!=null&&b>c&&(b=c);d!=null&&b<d&&(b=d);a!==0&&(b=Math.ceil(b*(1+a*Math.random())));return b}function k(a){var b=a.second-a.first,c=a.first-b;return function(){var a=b+c;c=b;b=a;return a}}function l(a){var b=a.base,c=b===void 0?2:b,d=a.first;return function(){var a=d;d*=c;return a}}function m(a){var b=a.delay;return function(){return b}}function n(a){var b=a.toMs;a=a.backoff;var c=o(a);return function(){return b(c())}}function o(a){switch(a.type){case"fibonacci":return k(a);case"exponential":return l(a);case"constant":return m(a);case"adjust":return n(a);default:a;throw c("err")("makeTimeFunc unrecognized backoff "+a.type)}}g.getDelay=a;g.createTimer=i;g.createPromiseTimer=d}),98); __d("WAPromiseDelays",["Promise","WAAbortError"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,c){return new(h||(h=b("Promise")))(function(b,e){if(c==null?void 0:c.aborted)throw new(d("WAAbortError").AbortError)();var f=setTimeout(g,a);c==null?void 0:c.addEventListener("abort",h);function g(){c==null?void 0:c.removeEventListener("abort",h),b()}function h(){c==null?void 0:c.removeEventListener("abort",h),clearTimeout(f),e(new(d("WAAbortError").AbortError)())}})}function c(a,c,d){return new(h||(h=b("Promise")))(function(b,e){var f=setTimeout(function(){try{b(d())}catch(a){e(a)}},c);a.then(function(a){clearTimeout(f),b(a)},function(a){clearTimeout(f),e(a)})})}g.delayMs=a;g.withTimeout=c}),98); __d("WAPromiseRetryLoop",["Promise","WALogger","WAPromiseBackoffs","WAPromiseDelays","WAResolvable","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: retrying "," in ","ms"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: resetting ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: loop paused - waiting for unpause"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: loop unpaused"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: pause requested on next iteration"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop was called several times. You may have race conditions"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: starting ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["PromiseRetryLoop: resetting ",""]);p=function(){return a};return a}a=function(){function a(a){var b=this;this.$2=new(d("WAResolvable").Resolvable)();this.$3=null;this.$4=null;this.$5=0;this.$6=new(d("WAResolvable").Resolvable)();this.endWithValue=function(a){b.$5++,b.$2.resolve(a)};this.$1=a}var e=a.prototype;e.resetTimeoutAfter=function(a){this.$4=Date.now()+a};e.cancelReset=function(){this.$4=null};e.reset=function(){if(this.$2.resolveWasCalled())return;d("WALogger").LOG(p(),this.$1.name);this.$5++;this.$6.resolve();this.$7()};e.start=function(){if(this.$2.resolveWasCalled())return;d("WALogger").LOG(o(),this.$1.name);this.$5!==0&&d("WALogger").ERROR(n());this.$5++;this.$6.resolve();this.$7()};e.pauseOnNextIteration=function(){d("WALogger").LOG(m()),this.$6.resolve(),this.$6=new(d("WAResolvable").Resolvable)()};e.unpause=function(){this.$6.resolveWasCalled()||d("WALogger").LOG(l()),this.$6.resolve()};e.$7=function(){var a=this,c=this.$1,e=this.$5,f=d("WAPromiseBackoffs").createTimer(this.$1.timer);f();var g=function(){if(a.$1.isPauseEnabled!==!0)return(h||(h=b("Promise"))).resolve();a.$6.resolveWasCalled()||d("WALogger").LOG(k());return a.$6.promise},l=function b(){if(a.$2.resolveWasCalled())return;if(e!==a.$5)return;var h=Date.now();a.$3=c.code(a.endWithValue).then(function(){if(a.$2.resolveWasCalled())return;var e=c.resetDelay;(e!==void 0&&Date.now()>=h+e||a.$4!=null&&a.$4<=Date.now())&&(d("WALogger").LOG(j(),c.name),f=d("WAPromiseBackoffs").createTimer(a.$1.timer));a.$4=null;e=f();d("WALogger").LOG(i(),c.name,e);return d("WAPromiseDelays").delayMs(e).then(g).then(b)});return a.$3};this.$3=(h||(h=b("Promise"))).resolve().then(l)};e.promise=function(){var a=this;if(this.$2.resolveWasCalled())return this.$2.promise;return!this.$3?(h||(h=b("Promise"))).reject(c("err")("PromiseRetryLoop "+this.$1.name+" had promise() called before start()")):(h||(h=b("Promise"))).race([this.$2.promise,this.$3.then(function(){return a.$2.promise})])};return a}();g.PromiseRetryLoop=a}),98); __d("WASmaxInPingsEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={validators:[d("WAJids").validateDomainJid,d("WAJids").validateUserJid],typeName:"DomainJid|UserJid"};g.DOMAINJID_USERJID=a}),98); __d("WADeepEquals",[],(function(a,b,c,d,e,f){"use strict";function g(a,b){if(a===b)return!0;if(!a||!b||typeof a!=="object"&&typeof b!=="object")return!1;var c=Array.isArray(a),d=Array.isArray(b);if(c!==d)return!1;d=!0;if(c){c=a.length;if(c!==b.length)return!1;for(var e=0;d&&e<c;e++)d=g(a[e],b[e]);return d}c=Object.keys(a);for(e=0;d&&e<c.length;e++){var f=c[e];d=b.propertyIsEnumerable(f)&&g(a[f],b[f])}return d&&Object.keys(b).length===c.length}f.deepEqual=g}),66); __d("WAStanzaUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a}f.toStanzaId=a}),66); __d("WASmaxParseUtils",["WABase64","WABinary","WACryptoUtils","WADeepEquals","WAHasProperty","WAResultOrError","WAStanzaUtils","WAWapJid"],(function(a,b,c,d,e,f,g){"use strict";var h=d("WAResultOrError").makeResult();function a(a,b){return a.tag!==b?H(a,"to be <"+b+">"):h}function i(a,b){return!I(a,b)?H(a,'to have attribute "'+b+'"'):J(a,a.attrs[b])}function j(a,b,c,e){var f=i(a,b);if(!f.success)return f;c=c(f.value);return c!=null?d("WAResultOrError").makeResult(c):H(a,'to have "'+b+'"={'+e+'}, but instead has "'+f.value+'"')}function k(a,b,c){var e=B(a);if(!e.success)return e;b=b(e.value);return b!=null?d("WAResultOrError").makeResult(b):H(a,"to have "+c+' content, but instead has "'+e.value+'"')}function b(a,b,c){var d=i(a,b);if(!d.success)return d;else if(d.value!==c)return H(a,'to have "'+b+'"="'+c+'", but instead has "'+d.value+'"');return h}function e(a,b){return j(a,b,d("WAStanzaUtils").toStanzaId,"stanzaID")}function l(a,b){return j(a,b,K,"integer")}function f(a,b,c,e){var f=l(a,b);if(!f.success)return f;f=f.value;if(c!==void 0&&f<c)return H(a,'to have "'+b+'"={at least '+c+"} but has value "+f);else if(e!==void 0&&f>e)return H(a,'to have "'+b+'"={at most '+e+"} but has value "+f);return d("WAResultOrError").makeResult(f)}function m(a){var b=a.content;return b instanceof Uint8Array?H(a,"to have children"):d("WAResultOrError").makeResult(b)}function n(a,b){var c=m(a);if(!c.success)return c;c=c.value;if(c==null)return h;var e=null;for(var f=0;f<c.length;f++){var g=c[f];if(g.tag===b){if(e!=null)return H(a,"to have 1 child <"+b+">, but found more than 1");e=g}}return d("WAResultOrError").makeResult(e)}function o(a,b,c){a=n(a,b);if(!a.success)return a;return a.value==null?h:c(a.value)}function p(a,b,c){c=o(a,b,c);if(!c.success)return c;c=c.value;return c==null?H(a,"to have 1 child <"+b+">, but found 0"):d("WAResultOrError").makeResult(c)}function q(a,b){var c=n(a,b);if(!c.success)return c;return c.value==null?H(a,"to have 1 child <"+b+">, but found 0"):d("WAResultOrError").makeResult(c.value)}function r(a,b,c,e,f){a=L(a,b,c,e);if(!a.success)return a;b=[];for(c=0;c<a.value.length;c++){e=f(a.value[c]);if(!e.success)return e;b.push(e.value)}return d("WAResultOrError").makeResult(b)}function s(a,b,c,e,f){a=L(a,b,c,e);if(!a.success)return a;b=a.value.length;for(c=0;c<b;c++){e=f(a.value[c]);if(!e.success)return e}return d("WAResultOrError").makeResult(b)}function t(a,b,c){b=r(a,b,0,Infinity,c);if(!b.success)return b;for(c=0;c<b.value.length;c++)if(!d("WADeepEquals").deepEqual(b.value[0],b.value[c]))return H(a,"to have homogeneous children, but found two children that are not equal");return b}function u(a,b,c){a=t(a,b,c);return!a.success?a:d("WAResultOrError").makeResult(a.value.length)}function v(a,b,c,d,e){return I(b,c)?a(b,c,d,e):h}function w(a,b,c,e){if(e==null)return h;a=v(a,b,c);if(!a.success)return a;if(a.value===e)return d("WAResultOrError").makeResult(e);return a.value==null?h:H(b,'to have "'+c+'"={'+e+'}, but instead has "'+a.value+'"')}function x(a,b,c,e){a=a(b,c);if(!a.success)return a;return a.value===e?d("WAResultOrError").makeResult(e):H(b,'to have "'+c+'"={'+e+'}, but instead has "'+a.value+'"')}function y(a,b,c){a=a(b);if(!a.success)return a;return a.value===c?d("WAResultOrError").makeResult(c):H(b,'to have content "'+c+'", but instead has "'+a.value+'"')}function z(a,b,c){var e=i(a,b);if(!e.success)return e;var f=c[e.value];if(f!=null)return d("WAResultOrError").makeResult(f);f=Object.values(c).join("|");return H(a,'to have "'+b+'"={'+f+'}, but instead has "'+e.value+'"')}function A(a,b){var c=B(a);if(!c.success)return c;var e=b[c.value];if(e!=null)return d("WAResultOrError").makeResult(e);e=Object.values(b).join("|");return H(a,'to have content "'+e+'", but instead has "'+c.value+'"')}function B(a){var b=C(a);if(!b.success)return b;else try{b=new(d("WABinary").Binary)(b.value);b=b.readString(b.size());return d("WAResultOrError").makeResult(b)}catch(b){return H(a,"to have string content, but run into decoding error: "+b.message)}}function C(a){var b=a.content;if(b==null)return H(a,"to have content");else if(Array.isArray(b))return H(a,"to have content, but has children instead");else return d("WAResultOrError").makeResult(b)}function D(a,b){var c=C(a);if(!c.success)return c;return d("WACryptoUtils").uint8ArraysEqual(c.value,b)?d("WAResultOrError").makeResult(b):H(a,'to have content ":binary:'+d("WABase64").encodeB64(b)+'", but instead has ":binary:'+d("WABase64").encodeB64(c.value)+'"')}function E(a,b,c){var e=a.content;if(e==null)if(b===void 0||b<1)return d("WAResultOrError").makeResult(new Uint8Array([]));else return H(a,"to have content");else if(Array.isArray(e))return H(a,"to have content, but has children instead");else{var f=e.length;if(b!==void 0&&f<b)return H(a,"to have binary content at least "+b+" bytes but has "+f+" bytes");else if(c!==void 0&&f>c)return H(a,"to have binary content at most "+c+" bytes but has "+f+" bytes");return d("WAResultOrError").makeResult(e)}}function F(a){return k(a,K,"integer")}function G(a){return a}function H(a,b){return d("WAResultOrError").makeError("expected <"+a.tag+">: "+b)}function I(a,b){return c("WAHasProperty")(a.attrs,b)}function J(a,b){if(b instanceof d("WAWapJid").WapJid)return d("WAResultOrError").makeResult(b.toString());return typeof b==="string"?d("WAResultOrError").makeResult(b):H(a,"decodeAsString: attribute is "+typeof b+" not a string: "+String(b))}function K(a){a=parseInt(a,10);return Number.isNaN(a)?null:a}function L(a,b,c,e){var f=m(a);if(!f.success)return f;f=f.value;if(f==null)if(c!==0)return H(a,"to have at least "+c+" <"+b+"> children, but found 0");else return d("WAResultOrError").makeResult([]);var g=[];for(var h=0;h<f.length;h++){var i=f[h];i.tag===b&&g.push(i)}i=g.length;if(i<c)return H(a,"to have at least "+c+" <"+b+"> children, but found "+i);else if(i>e)return H(a,"to have at most "+e+" <"+b+"> children, but found "+i);return d("WAResultOrError").makeResult(g)}var M={};function N(a,b,c){var d=b.map(function(a,b){return a+": "+c[b].error});return H(a,["to match any of following mixins: "+b.join(", ")+", but all mixins failed."].concat(d).join(" "))}g.voidSuccess=h;g.assertTag=a;g.attrString=i;g.attrValidate=j;g.contentValidate=k;g.assertAttr=b;g.attrStanzaId=e;g.attrInt=l;g.attrIntRange=f;g.maybeChildren=m;g.optionalChild=n;g.optionalChildWithTag=o;g.childWithTag=p;g.flattenedChildWithTag=q;g.mapChildrenWithTag=r;g.countChildrenWithTag=s;g.mapHomogeneousChildrenWithTag=t;g.countHomogeneousChildrenWithTag=u;g.optional=v;g.optionalLiteral=w;g.literal=x;g.literalContent=y;g.attrStringEnum=z;g.contentStringEnum=A;g.contentString=B;g.contentBytes=C;g.contentLiteralBytes=D;g.contentBytesRange=E;g.contentInt=F;g.identity=G;g.errorMessage=H;g.emptyObject=M;g.errorMixinDisjunction=N}),98); __d("WASmaxParseJid",["WAJids","WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateUserJid,"UserJid")}function b(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateDeviceJid,"DeviceJid")}function c(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateGroupJid,"GroupJid")}function e(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateCallJid,"CallJid")}function f(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateDomainJid,"DomainJid")}function h(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateBroadcastJid,"BroadcastJid")}function i(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateStatusJid,"StatusJid")}function j(a,b){return d("WASmaxParseUtils").attrValidate(a,b,d("WAJids").validateNewsletterJid,"NewsletterJid")}function k(a,b,c){var e=d("WASmaxParseUtils").attrString(a,b);if(!e.success)return e;var f=c.validators;c=c.typeName;for(var g=0;g<f.length;g++){var h=f[g](e.value);if(h!=null)return d("WAResultOrError").makeResult(h)}return d("WASmaxParseUtils").errorMessage(a,'to have "'+b+'"={'+c+'}, but instead has "'+e.value+'"')}function l(a,b,c,e){a=a(b,c);if(!a.success)return a;return a.value===e?a:d("WASmaxParseUtils").errorMessage(b,'to have "'+c+'"={'+e+'}, but instead has "'+a.value+'"')}function m(a,b,c,e){a=d("WASmaxParseUtils").optional(a,b,c);if(!a.success)return a;return a.value==null||a.value===e?a:d("WASmaxParseUtils").errorMessage(b,'to have "'+c+'"={'+e+'}, but instead has "'+a.value+'"')}g.attrUserJid=a;g.attrDeviceJid=b;g.attrGroupJid=c;g.attrCallJid=e;g.attrDomainJid=f;g.attrBroadcastJid=h;g.attrStatusJid=i;g.attrNewsletterJid=j;g.attrJidEnum=k;g.literalJid=l;g.optionalLiteralJid=m}),98); __d("WASmaxParseReference",["WAHasProperty","WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){"use strict";function h(a,b,c,d,e){b=j(b,c);if(!b.success)return l(b);a=a(b.value,c[c.length-1],d,e);return!a.success?l(a):a}function a(a,b,c,e,f){return k(b,c)?h(a,b,c,e,f):d("WASmaxParseUtils").voidSuccess}function i(a,b){return h(d("WASmaxParseUtils").attrString,a,b)}function b(a,b){return k(a,b)?i(a,b):d("WASmaxParseUtils").voidSuccess}function e(a,b){a=j(a,b);if(!a.success)return l(a);b=d("WASmaxParseUtils").contentString(a.value);return!b.success?l(b):b}function j(a,b){var c=b.length;a=a;for(var e=0;e<c-1;e++){var f=b[e];f=d("WASmaxParseUtils").flattenedChildWithTag(a,f);if(!f.success)return f;a=f.value}return d("WAResultOrError").makeResult(a)}function k(a,b){a=j(a,b);return a.success&&c("WAHasProperty")(a.value.attrs,b[b.length-1])}function l(a){return d("WAResultOrError").makeError("in the reference, "+a.error)}g.attrFromReference=h;g.optionalAttrFromReference=a;g.attrStringFromReference=i;g.optionalAttrStringFromReference=b;g.contentStringFromReference=e}),98); __d("WASmaxInPingsClientResponseServerResponse",["WAResultOrError","WASmaxInPingsEnums","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseJid").attrJidEnum(a,"from",d("WASmaxInPingsEnums").DOMAINJID_USERJID);if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").attrInt(a,"t");return!b.success?b:d("WAResultOrError").makeResult({from:c.value,type:e.value,t:b.value})}g.parseClientResponseServerResponse=a}),98); __d("WASmaxJsx",["WAWap"],(function(a,b,c,d,e,f,g){"use strict";g.smax=d("WAWap").wap}),98); __d("WAArrayBufferUtils",["Promise","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){var b=new ArrayBuffer(a.length);b=new Uint8Array(b);var c,d;for(c=0,d=a.length;c<d;c++)b[c]=a.charCodeAt(c);return b.buffer}function d(a,c){c===void 0&&(c=5e5);return new(h||(h=b("Promise")))(function(b,d){var e=a.length,f=new ArrayBuffer(e),g=new Uint8Array(f),h=0;setTimeout(i,0);function i(){var d=Math.min(h+c,e);while(h<d)g[h]=a.charCodeAt(h),h++;if(h===e){b(f);return}setTimeout(i,16)}})}function e(a){return String.fromCharCode.apply(null,new Uint8Array(a))}var i=8388607;function f(a,b){a=new Uint8Array(a);if(b>i)throw c("err")("Divisor is too big");var d=0;for(var e=0;e<a.length;++e)d=((d<<8)+a[e])%b;return d}function j(a){a=a.map(function(a){return new Uint8Array(a)});var b=a.reduce(function(a,b){return a+b.byteLength},0),c=new Uint8Array(b);a.reduce(function(a,b){c.set(b,a);return a+b.byteLength},0);return c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength)}function k(a,b){a=new Uint8Array(a);b=new Uint8Array(b);return l(a,b)}function l(a,b){if(a.byteLength!==b.byteLength)return!1;for(var c=0;c!==a.byteLength;c++)if(a[c]!==b[c])return!1;return!0}g.stringToArrayBuffer=a;g.largeStringToArrayBuffer=d;g.arrayBufferToString=e;g.arrayBufferMod=f;g.concatBuffers=j;g.arrayBuffersEqualUNSAFE=k;g.uint8ArraysEqualUNSAFE=l}),98); __d("WASmaxMixins",["WAArrayBufferUtils","WAWapJid"],(function(a,b,c,d,e,f,g){"use strict";var h="smax$any";function i(a,b){j(a,b);k(a,b);b.content instanceof Uint8Array?m(a,b.content):b.content!=null&&n(a,b.content);return a}function a(a,b,c,d){return c!=null?a(b,c,d):b}function j(a,b){a=a.tag;b=b.tag;if(b===h)return;if(a!==b)throw new Error("tag mismatch: "+a+" != "+b)}function k(a,b){var c=a.attrs,d=b.attrs;Object.keys(d).forEach(function(a){var b=d[a],e=c[a];if(b!=null&&e!=null){if(l(b,e))return;throw new Error("conflict for key: "+a)}c[a]=b})}function l(a,b){if(typeof a==="string"&&typeof b==="string")return a===b;return a instanceof d("WAWapJid").WapJid&&b instanceof d("WAWapJid").WapJid?a.toString()===b.toString():!1}function m(a,b){var c=a.content;if(c instanceof Uint8Array){if(!d("WAArrayBufferUtils").uint8ArraysEqualUNSAFE(c,b))throw new Error("elementValue mismatch: bytes dose not equal");return}if(c!=null)throw new Error("elementValue mismatch: destination has children");a.content=b}function n(a,b){var c=a.content;if(c instanceof Uint8Array)throw new Error("children mismatch: destination has element value");if(c==null||c.length===0){a.content=b;return}if(!o(c,b))throw new Error("children mismatch: child counts are not compatible");var d=[],e=Array.from(c);b.forEach(function(a){var b=e.findIndex(function(b){return b.tag===a.tag});if(b===-1)d.push(a);else{b=e.splice(b,1);b=i(b[0],a);d.push(b)}});e.forEach(function(a){return d.push(a)});a.content=d}function o(a,b){b=p(b);a=p(a);var c=Object.keys(b);for(var d=0;d<c.length;d++){var e=c[d],f=b[e];e=a[e];if(f!=null&&e!=null&&f!==e)return!1}return!0}function p(a){return a.reduce(function(a,b){b=b.tag;var c=a[b];a[b]=c==null?1:c+1;return a},{})}g.mergeStanzas=i;g.optionalMerge=a}),98); __d("WASmaxOutPingsClientWellFormedToMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeClientWellFormedToMixin=a}),98); __d("WASmaxOutPingsClientRequest",["WASmaxJsx","WASmaxOutPingsClientWellFormedToMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(){var a=d("WASmaxOutPingsClientWellFormedToMixin").mergeClientWellFormedToMixin(d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get",xmlns:"w:p"}));return a}g.makeClientRequest=a}),98); __d("WAComms",["Promise","WAArrayUtils","WAErrors","WALogger","WANotifyConnectionChangeFactory","WAPromiseRetryLoop","WAResolvable","WAShiftTimer","WASmaxInPingsClientResponseServerResponse","WASmaxOutPingsClientRequest","WASmaxParseUtils","WATimeUtils","WAWap","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms has no open socket"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] closeSocket called"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] Socket "," closed"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] socketLoopIteration failed ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] socketLoopIteration socket closed while in noise handshake"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] socketLoopIteration socket disconnected while in noise handshake"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] socketLoopIteration socket closed while in noise handshake using treasureHunt strategy"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] Socket "," closed"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] Socket "," opened"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] Socket "," opening"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] maybeResetSocketLoop"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] closeSocketAndResume called"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] closeSocketAndPause called"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] closeSocketAndPreventRetry called"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAck: unrecognized ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] job response is CLOSE_SOCKET"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["--- Receiving ---\n",""],["--- Receiving ---\\n",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failure parsing stanza!"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms.startHandlingRequests"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["castStanza error ",""]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["castStanza async error ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["--- Sending ---\n",""],["--- Sending ---\\n",""]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error in onBeforeCastStanza, we consumed and continue with normal stanza sending to the server:\n",""],["Error in onBeforeCastStanza, we consumed and continue with normal stanza sending to the server:\\n",""]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["Dropping stanza since onBeforeCastStanza matched. We return mock response directly."]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["--- Receive (via SMAX+E2E) ---\n",""],["--- Receive (via SMAX+E2E) ---\\n",""]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["Dropping stanza since onBeforeCastStanza matched:\n",". We return mock response directly."],["Dropping stanza since onBeforeCastStanza matched:\\n",". We return mock response directly."]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms has no open socket, will resend stanza when socket opens"]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] No stanzaId in ping request stanza"]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] sendPing ping still pending"]);K=function(){return a};return a}function L(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] sendPing when socket dead"]);L=function(){return a};return a}function M(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] Socket "," expired"]);M=function(){return a};return a}function N(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleIq no handler for iq"]);N=function(){return a};return a}function O(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleIq no handler for iq with id ",""]);O=function(){return a};return a}var P=null,Q=null,R=1,S=0,T=function(){function a(a,c,e){var f=this;this.nextSocketId=1;this.pendingIqs=new Map();this.ackHandlers=[];this.pendingSmaxStanzas=new Map();this.$2=new(d("WAResolvable").Resolvable)();this.socketAbortController=null;this.activePing=null;this.$3=new Set();this.socketId=S;this.socket=null;this.softCloseSocket=null;this.handleStanza=function(a,b,c){var e=d("WASmaxParseUtils").attrString(a,"id");if(e.success&&a.tag!=="receipt"){e=e.value;var g=f.pendingSmaxStanzas.get(e);if(g){f.pendingSmaxStanzas["delete"](e);g.resolve(a);f.maybeScheduleHealthCheck();return"NO_ACK"}}e=$(a);if(e!=null){g=f.pendingIqs.get(e);g?(f.pendingIqs["delete"](e),g.resolve(a),f.maybeScheduleHealthCheck()):(d("WALogger").WARN(O(),e),d("WALogger").ERROR(N()))}else if(a.tag==="ack")f.handleAck(a);else return a.tag==="failure"&&f.config.shouldBlockReceivingUntilSuccess?f.$1(a,b,c):f.$2.promise.then(function(){return f.$1(a,b,c)});return"NO_ACK"};this.healthCheckTimer=new(d("WAShiftTimer").ShiftTimer)(function(){if(!f.socketId)return;void f.sendPing()});this.deadSocketTimer=new(d("WAShiftTimer").ShiftTimer)(function(a){if(a!==f.socketId)return;d("WALogger").LOG(M(),a);f.softCloseSocket&&f.softCloseSocket()});this.sendPing=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=Z("sendPing");if(!a.socketId){d("WALogger").LOG(L());return(h||(h=b("Promise"))).resolve()}if(a.activePing&&a.activePing.socketId===a.socketId){d("WALogger").LOG(K());return(h||(h=b("Promise"))).resolve()}a.activePing&&a.activePing.handler.resolve();var c=d("WASmaxOutPingsClientRequest").makeClientRequest(),e=c.attrs.id;if(typeof e!=="string"){d("WALogger").ERROR(J());return(h||(h=b("Promise"))).resolve()}var f=new(d("WAResolvable").Resolvable)();a.activePing={socketId:a.socketId,stanzaId:e,handler:f};void a.callStanza(c);e=(yield f.promise);if(e){f=d("WASmaxInPingsClientResponseServerResponse").parseClientResponseServerResponse(e,c);if(f.success){e=d("WATimeUtils").castToUnixTime(f.value.t);c=Math.round(Date.now()/1e3-e);a.config.handlers.onClockSkewUpdate==null?void 0:a.config.handlers.onClockSkewUpdate(c)}}});this.$1=a;this.onConnectionChange=d("WANotifyConnectionChangeFactory").notifyConnectionChangeFactory((a=c.handlers.onConnectionChange)!=null?a:function(){},(a=c.handlers.onOptimisticConnectionChange)!=null?a:function(){});this.gzipInflate=e;this.config=c;this.socketLoop=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"MainSocketLoop",code:W,timer:(a=c.socketReconnectBackoffAlgo)!=null?a:{jitter:.1,max:c.maxSocketLoopWaitTime,algo:{type:"fibonacci",first:1e4,second:1e4},relativeDelay:!0},resetDelay:3e4,isPauseEnabled:c.isPauseEnabled===!0})}var e=a.prototype;e.filterPending=function(a){var b=[];function c(c){a(c)&&b.push(c)}this.pendingIqs.forEach(c);this.ackHandlers.forEach(c);this.pendingSmaxStanzas.forEach(c);return b};e.sendPendingStanza=function(a){a.cleanup==null?void 0:a.cleanup(),a.cleanup=void 0,void this.callStanza(a.stanza)};e.maybeSendPendingStanza=function(a){if(a.attempt>=this.config.maxRetries)this.config.handlers.onDropStanza==null?void 0:this.config.handlers.onDropStanza(a),a.cleanup==null?void 0:a.cleanup(),a.cleanup=void 0,this.removeHandler(a,"max-retries");else if(this.socket){a.attempt+=1;this.sendPendingStanza(a);return}else d("WALogger").LOG(I())};e.callStanzaAsync=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield this.callStanza(a,b));return a});function c(b,c){return a.apply(this,arguments)}return c}();e.callStanza=function(a,b){a=this.castStanza(a,b);this.deadSocketTimer.onOrBefore(this.config.deadSocketTime,this.socketId);this.healthCheckTimer.cancel();return a};e.castStanzaAsync=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield this.castStanza(a));return a});function c(b){return a.apply(this,arguments)}return c}();e.castStanza=function(a,c){var e=this;try{var f=this.config.handlers.onBeforeCastStanzaForE2E==null?void 0:this.config.handlers.onBeforeCastStanzaForE2E(a,c);if(f!=null){d("WALogger").DEV_XMPP(H(),a);d("WALogger").DEV_XMPP(G(),f);d("WALogger").ERROR(F());if(Array.isArray(f))return(h||(h=b("Promise"))).all(f.map(function(a){return(h||(h=b("Promise"))).resolve(e.handleStanza(a,e.socketId,S))}));else{this.handleStanza(f,this.socketId,S);return(h||(h=b("Promise"))).resolve()}}}catch(a){d("WALogger").DEV_XMPP(E(),a)}f=this.socketOrThrow("castStanza");try{d("WALogger").DEV_XMPP(D(),a);return f.sendFrame(d("WAWap").encodeStanza(a)).then(function(){e.config.handlers.onCastStanza==null?void 0:e.config.handlers.onCastStanza(a,c)})["catch"](function(a){d("WALogger").ERROR(C(),a).devConsole(a);if(a instanceof d("WAErrors").BufferTooLargeError)return(h||(h=b("Promise"))).reject(a)})}catch(a){d("WALogger").ERROR(B(),a).devConsole(a)}return(h||(h=b("Promise"))).resolve()};e.socketOrThrow=function(a){var b=this.socket;if(b)return b;throw c("err")("Comms."+a+" called while no socket")};e.startHandlingRequests=function(){d("WALogger").LOG(A());this.$2.resolve();return this.$2.promise.then(function(){})};e.parseAndHandleStanza=function(a,b){var c=this;a===this.socketId&&(this.deadSocketTimer.cancel(),Q&&(Q.resolve(),Q=null));var e=d("WAWap").decodeStanza(b,this.gzipInflate)["catch"](function(a){d("WALogger").ERROR(z()).devConsole(b);throw a}).then(function(e){d("WALogger").DEV_XMPP(y(),e);c.config.handlers.onHandleStanza==null?void 0:c.config.handlers.onHandleStanza(e,a,b.byteLength);var f=c.activePing;if(f&&f.socketId===a&&f.stanzaId===$(e)){c.activePing=null;f.handler.resolve(e);c.maybeScheduleHealthCheck();return"NO_ACK"}return c.handleStanza(e,a,b.byteLength)}).then(function(b){if(a!==c.socketId)return;if(b==="CLOSE_SOCKET"){d("WALogger").LOG(x());var e=c.socket;e&&e.close()}else b==="NO_ACK"||void c.castStanza(b);return"NO_ACK"});this.$3.add(e);e["finally"](function(){return void c.$3["delete"](e)})};e.handleAck=function(a){var b=this.ackHandlers,c=-1,e=null;while(!e&&++c<b.length)e=b[c].parseAndTest(a);if(e){var f=b[c];d("WAArrayUtils").removeIndexWithoutPreservingOrder(b,c);this.config.handlers.onHandleAck==null?void 0:this.config.handlers.onHandleAck(a);f.resolve(e);this.maybeScheduleHealthCheck()}else d("WALogger").WARN(w(),a)};e.removeHandler=function(a,c){c===void 0&&(c="disconnect");if(a.type==="iq"||a.type==="smax"){var e=a.stanza.attrs.id;if(!e||typeof e!=="string")return;if(a.type==="iq"&&!this.pendingIqs["delete"](e)||a.type==="smax"&&!this.pendingSmaxStanzas["delete"](e))return}else{a.type;e=this.ackHandlers.indexOf(a);if(e===-1)return;d("WAArrayUtils").removeIndexWithoutPreservingOrder(this.ackHandlers,e)}c==="disconnect"?a.resolve((h||(h=b("Promise"))).reject(new(d("WAErrors").Disconnected)())):c==="abort"?a.resolve((h||(h=b("Promise"))).reject(new(d("WAErrors").Aborted)())):a.resolve((h||(h=b("Promise"))).reject(new(d("WAErrors").MaxRetries)()))};e.maybeScheduleHealthCheck=function(){if(this.healthCheckTimer.isScheduled())return;if(this.activePing||this.ackHandlers.length||this.pendingIqs.size||this.pendingSmaxStanzas.size)return;var a=this.config.healthCheckInterval;a=Math.ceil(a*1e3*(1+Math.random()));this.healthCheckTimer.onOrBefore(a)};return a}();function a(){return P}function e(a,b,c,d){d===void 0&&(d=!0);if(P)return;P=new T(a,b,c);d&&setTimeout(U,0)}function f(){var a=Z("stopComms");a.socketLoop.endWithValue();a.socket&&X();P=null}function aa(){var a=Z("closeSocketAndPreventRetry");a.socketLoop.endWithValue();a.socket&&(d("WALogger").LOG(v()),X())}function ba(){var a=Z("closeSocketAndPause");a.socketLoop.pauseOnNextIteration();a.socket&&(d("WALogger").LOG(u()),X())}function ca(){var a=Z("closeSocketAndResume");a.socketLoop.unpause();a.socket&&(d("WALogger").LOG(t()),X())}function U(){Z("openSocketLoop").socketLoop.start()}function da(){d("WALogger").LOG(s()),V()||Z("maybeResetSocketLoop").socketLoop.reset()}function ea(){Z("forceResetSocketLoop").socketLoop.reset()}function fa(){var a,b=Z("socketAbortController");(a=b.socketAbortController)==null?void 0:a.abort();b.softCloseSocket==null?void 0:b.softCloseSocket()}function V(){var a;return!!((a=P)==null?void 0:a.socket)}function W(){var a=Z("socketLoopIteration"),b=a.nextSocketId++;d("WALogger").LOG(r(),b);var c=function(){a.onConnectionChange("in_handshake")};a.config.handlers.onSocketLoopIteration==null?void 0:a.config.handlers.onSocketLoopIteration(a.socketAbortController);typeof AbortController==="function"&&(a.socketAbortController=new AbortController());return a.config.openChatSocket(c,(c=a.socketAbortController)==null?void 0:c.signal).then(function(c){if(c.success){var e=c.value;a.config.handlers.onSocketOpen==null?void 0:a.config.handlers.onSocketOpen();var f=new(d("WAResolvable").Resolvable)();d("WALogger").LOG(q(),b);a.socketId=b;a.socket=e;a.softCloseSocket=function(){a.softCloseSocket=null,a.socket&&a.config.shouldCloseStaleSocket&&(X(),a.socket=null),f.resolve()};a.socketLoop.resetTimeoutAfter(1e4);a.deadSocketTimer.cancel();a.maybeScheduleHealthCheck();e.setOnFrame(function(c){return a.parseAndHandleStanza(b,c)});e.setOnClose(function(){d("WALogger").LOG(p(),b);a.activePing&&b===a.activePing.socketId&&(a.activePing.handler.resolve(),a.activePing=null);a.filterPending(function(a){return a.attachedToSocketId===b}).forEach(function(b){return void a.removeHandler(b)});if(b!==a.socketId)return;a.socketId=S;a.socket=null;a.onConnectionChange("disconnected");a.config.handlers.onDisconnect==null?void 0:a.config.handlers.onDisconnect();f.resolve()});a.onConnectionChange("connected");a.config.handlers.onConnect==null?void 0:a.config.handlers.onConnect();a.filterPending(function(a){return!a.attachedToSocketId}).sort(function(a,b){return a.orderedId-b.orderedId}).forEach(function(b){switch(b.type){case"smax":case"iq":a.maybeSendPendingStanza(b);break;case"ack":void a.callStanza(b.stanza);break;default:b.type;break}});return f.promise}else{e=c.error;switch(e){case"max-hunters":d("WALogger").WARN(o());break;case"disconnected":d("WALogger").WARN(n());break;default:e;return}}})["catch"](function(a){a instanceof d("WAErrors").Disconnected?d("WALogger").LOG(m()):d("WALogger").ERROR(l(),a).devConsole(a)})}function X(){var a=Z("closeSocket");a.socket&&(d("WALogger").LOG(k(),a.socketId),d("WALogger").LOG(j()),a.socket.close())}function ga(){Z("onStreamErrorReceived").socketLoop.cancelReset()}function ha(){void Z("waitForConnection").sendPing();Q||(Q=new(d("WAResolvable").Resolvable)());return Q.promise}function ia(a,b){var c=Z("castStanza");c.socket?void c.castStanza(a,b):d("WALogger").LOG(i())}function ja(a){var b=Z("castStanza");return b.socketId===a}function Y(a,e,f,g,i){f===void 0&&(f=0);i===void 0&&(i="iq");return new(h||(h=b("Promise")))(function(j){var k=Z("sendIq"),l=a.attrs.id;if(!l||typeof l!=="string")throw c("err")("[comms] sendIq given iq without id: "+String(a));var m=k.socketId;if(e&&!m){j((h||(h=b("Promise"))).reject(new(d("WAErrors").Offline)()));return}var n=function(a){a===void 0&&(a="disconnect");var d=i==="iq"?k.pendingIqs.get(l):k.pendingSmaxStanzas.get(l);if(!d){j((h||(h=b("Promise"))).reject(c("err")("[comms] _sendIq unexisting stanza to be cancelled: "+l)));return}k.removeHandler(d,a)},o=null;if(f>0){var p=setTimeout(n,f*1e3);o=function(){clearTimeout(p)}}if(g!=null)if(g.aborted){j((h||(h=b("Promise"))).reject(new(d("WAErrors").Disconnected)()));return}else{var q=function(){n("abort")};g.addEventListener("abort",q);o=function(){g.removeEventListener("abort",q)}}m={resolve:j,stanza:a,attachedToSocketId:e?m:S,orderedId:R++,attempt:0,cleanup:o};if(i==="iq"){o=babelHelpers["extends"]({type:i},m);k.pendingIqs.set(l,o);k.config.handlers.onSendIq==null?void 0:k.config.handlers.onSendIq(a);k.maybeSendPendingStanza(o)}else{i;o=babelHelpers["extends"]({type:i},m);k.pendingSmaxStanzas.set(l,o);k.maybeSendPendingStanza(o)}})}function ka(a,b){var c,d;c=(c=b==null?void 0:b.withoutRetry)!=null?c:!1;d=(d=b==null?void 0:b.timeoutSeconds)!=null?d:0;b=(b=b==null?void 0:b.signal)!=null?b:null;return Y(a,c,d,b,"smax")}function la(){var a=Z("sendPing");return a.sendPing()}function ma(){return Z("startHandlingRequests").startHandlingRequests()}function na(){P&&P.deadSocketTimer.cancel()}function Z(a){if(P)return P;throw c("err")("[comms] "+a+" called before startComms")}function $(a){if(a.tag==="iq"){var b=a.attrs.type;if(b==="result"||b==="error")return d("WAWap").decodeAsString(a.attrs.id)||null}return null}function oa(){return R++}function pa(){P=null,Q=new(d("WAResolvable").Resolvable)(),R=1}g.DEFAULT_SOCKET_ID=S;g.getComms=a;g.startComms=e;g.stopComms=f;g.closeSocketAndPreventRetry=aa;g.closeSocketAndPause=ba;g.closeSocketAndResume=ca;g.openSocketLoop=U;g.maybeResetSocketLoop=da;g.forceResetSocketLoop=ea;g.forceAbortSocketConnection=fa;g.isSocketConnected=V;g.socketLoopIteration=W;g.closeSocket=X;g.onStreamErrorReceived=ga;g.waitForConnection=ha;g.castSmaxStanza=ia;g.isActiveSocket=ja;g._sendIq=Y;g.sendSmaxStanza=ka;g.sendPing=la;g.startHandlingRequests=ma;g.cancelDeadSocketTimer=na;g.singletonOrThrowIfUninitialized=Z;g.getAndIncrementNextOrderedId=oa;g.resetStateForTests=pa}),98); __d("WAParseIqResponse",["WAWap"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c){var e=a.content;if(e&&Array.isArray(e)&&e[0]){e=e[0];if(e.tag==="error"){var f=e.attrs||{},g;c&&(typeof c==="function"?g=c(a):g=c.parseOrThrow(e));c=g;return{success:!1,errorCode:parseInt(f.code,10),errorText:d("WAWap").decodeAsString(f.text)||"",errorType:d("WAWap").decodeAsString(f.type)||"",errorBackoff:parseInt(f.backoff,10),toString:h,customError:c}}}if(typeof b==="function")return{success:!0,result:b(a)};else return{success:!0,result:b.parseOrThrow(a)}}function h(){return"IqError "+this.errorCode+": "+this.errorText}g.parseIqResponse=a}),98); __d("WADeprecatedSendIq",["Promise","WAAckParser","WAArrayUtils","WAComms","WALogger","WAParseIqResponse"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms has no open socket, will send stanza when socket opens"]);i=function(){return a};return a}function a(a,b){return d("WAComms")._sendIq(a,!1).then(function(a){return d("WAParseIqResponse").parseIqResponse(a,b)})}function c(a,b,c){return d("WAComms")._sendIq(a,!1).then(function(a){return d("WAParseIqResponse").parseIqResponse(a,b,c)})}function e(a,b,c){return d("WAComms")._sendIq(a,!1,c).then(function(a){return d("WAParseIqResponse").parseIqResponse(a,b)})}function f(a,b){return d("WAComms")._sendIq(a,!0).then(function(a){return d("WAParseIqResponse").parseIqResponse(a,b)})}function j(a,b){return k(a,b).then(function(){})}function k(a,c){return new(h||(h=b("Promise")))(function(e){var f=d("WAComms").singletonOrThrowIfUninitialized("deprecatedSendStanzaAndReturnAck"),g=function(a){var b=d("WAAckParser").AckParser.parse(a);return!b.error&&d("WAAckParser").ackMatchesTemplate(b.success,c)?a:null},j={type:"ack",parseAndTest:g,resolve:e,stanza:a,attachedToSocketId:d("WAComms").DEFAULT_SOCKET_ID,orderedId:d("WAComms").getAndIncrementNextOrderedId()};f.ackHandlers.push(j);if(!f.socket){d("WALogger").LOG(i());return}f.callStanza(a)["catch"](function(a){var c=f.ackHandlers.indexOf(j);if(c===-1)return;d("WAArrayUtils").removeIndexWithoutPreservingOrder(f.ackHandlers,c);j.resolve((h||(h=b("Promise"))).reject(a))})})}function l(a,b){d("WAComms").castSmaxStanza(a,b)}g.deprecatedSendIq=a;g.deprecatedSendIqErrorParser=c;g.deprecatedSendIqIfConnectedWithin=e;g.deprecatedSendIqWithoutRetry=f;g.deprecatedSendStanzaAndWaitForAck=j;g.deprecatedSendStanzaAndReturnAck=k;g.deprecatedCastStanza=l}),98); __d("WAWapDeprecatedSmaxID",["$InternalEnum"],(function(a,b,c,d,e,f){"use strict";a=b("$InternalEnum")({SupportContactForm:3,CtwaGetContext:4,QueryOrder:5,CreateOrder:10,RefreshCart:11,CatalogGetProductList:21,SetCatalogVisibility:23,CommerceSettingsSet:25,CatalogGetSingleCollection:30,CatalogGetCollections:35,CatalogCreateCollection:36,CatalogUpdateCollection:40,CatalogDeleteCollections:43,CatalogAppealCollection:48,BizGetPublicKey:52,MerchantGetComplianceInfo:53,MerchantSetComplianceInfo:54,CatalogVerifyPostcode:70,BtmCustomUrlGet:78,BtmCustomUrlGetUser:79,QuerySubscription:90,UpdateCollectionList:92});c=a;f["default"]=c}),66); __d("WAWebCommsWapMd",["WALogger","WAWapJid","WAWebBizCoexGatingUtils","WAWebWid","WAWebWidValidator","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["USER_JID: invalid PSA jid"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["DEVICE_JID: invalid PSA jid"]);i=function(){return a};return a}function j(a){if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled())if(a.server==="hosted")return d("WAWapJid").DomainType.HOSTED;else if(a.server==="hosted.lid")return d("WAWapJid").DomainType.HOSTED_LID;return a.server==="lid"?d("WAWapJid").DomainType.LID:d("WAWapJid").DomainType.WHATSAPP}function a(a){if(!(a instanceof c("WAWebWid"))||!a.isUser())throw c("err")("DEVICE_JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));if(a.isPSA()){d("WALogger").ERROR(i()).sendLogs("invalid-psa-user-jid");throw c("err")("USER_JID: invalid PSA jid")}return a.isFbidBot()?d("WAWapJid").WapJid.create(a.user,a.getJidServer()):d("WAWapJid").WapJid.createJidU(a.user,j(a),a.device)}function b(a){if(!(a instanceof c("WAWebWid"))||!a.isUser())throw c("err")("USER_JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));if(a.isPSA()){d("WALogger").ERROR(h()).sendLogs("invalid-psa-user-jid");throw c("err")("USER_JID: invalid PSA jid")}return d("WAWapJid").WapJid.create(a.user,a.getJidServer())}function e(a){if(!(a instanceof c("WAWebWid"))||!a.isUser()&&!a.isGroup()&&!a.isBroadcast()&&!a.isNewsletter())throw c("err")("CHAT_JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));return d("WAWapJid").WapJid.create(a.user,a.getJidServer())}function f(a){if(!(a instanceof c("WAWebWid"))||!a.isGroup())throw c("err")("GROUP_JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));return d("WAWapJid").WapJid.create(a.user,d("WAWebWidValidator").Domains.G_US)}function k(a){if(!(a instanceof c("WAWebWid"))||!a.isGroupCall())throw c("err")("GROUP_CALL_JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));return d("WAWapJid").WapJid.create(a.user,d("WAWebWidValidator").Domains.CALL)}function l(a){if(!(a instanceof c("WAWebWid")))throw c("err")("JID: invalid jid type: "+(a instanceof c("WAWebWid")?a.toString():"Not an instance of WID"));var b=a.device==null||a.device===0;return!b?d("WAWapJid").WapJid.createJidU(a.user,j(a),a.device):d("WAWapJid").WapJid.create(a.user,a.getJidServer())}g.DEVICE_JID=a;g.USER_JID=b;g.CHAT_JID=e;g.GROUP_JID=f;g.GROUP_CALL_JID=k;g.JID=l}),98); __d("WAWebMerchantComplianceJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebCommsWapMd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(a){var b;return{email:(a==null?void 0:(b=a.maybeChild("email"))==null?void 0:b.contentString())||"",landline_number:(a==null?void 0:(b=a.maybeChild("landline_number"))==null?void 0:b.contentString())||"",mobile_number:(a==null?void 0:(b=a.maybeChild("mobile_number"))==null?void 0:b.contentString())||""}},i=new(c("WADeprecatedWapParser"))("merchantComplianceResponse",function(a){a.assertTag("iq");a.assertFromServer();var b=[];a.forEachChildWithTag("merchant_info",function(a){var c,d,e,f;c=((c=a.maybeChild("entity_name"))==null?void 0:c.contentString())||"";d=((d=a.maybeChild("entity_type"))==null?void 0:d.contentString())||"";e=(e=a.maybeChild("entity_type_custom"))==null?void 0:e.contentString();var g=a.attrString("is_registered")==="true",i=a.maybeChild("customer_care_details");a=a.maybeChild("grievance_officer_details");i=babelHelpers["extends"]({},h(i));f=babelHelpers["extends"]({name:(a==null?void 0:(f=a.maybeChild("name"))==null?void 0:f.contentString())||""},h(a));b.push({entity_name:c,entity_type:d,is_registered:g,entity_type_custom:e,customer_care_details:i,grievance_officer_details:f})});return b});function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,xmlns:"w:biz:merchant_info",id:b.generateId(),type:"get",smax_id:b.SMAX_ID(c("WAWapDeprecatedSmaxID").MerchantGetComplianceInfo)},a.map(function(a){return d("WAWap").wap("merchant_info",{jid:d("WAWebCommsWapMd").USER_JID(a.wid)})}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,i));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);else return a.result});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a===void 0?{}:a;var b=a.entityName,e=a.entityType,f=a.isRegistered;f=f===void 0?!1:f;var g=a.entityTypeCustom,h=a.customerCareDetails;a=a.grievanceOfficerDetails;f=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"w:biz:merchant_info",id:d("WAWap").generateId(),type:"set",smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").MerchantSetComplianceInfo)},d("WAWap").wap("merchant_info",{is_registered:f?"true":"false"},b!==void 0?d("WAWap").wap("entity_name",null,b):null,e!==void 0?d("WAWap").wap("entity_type",null,e):null,g!==void 0?d("WAWap").wap("entity_type_custom",null,g):null,h?d("WAWap").wap("customer_care_details",null,h.email!==void 0?d("WAWap").wap("email",null,h.email):null,h.landlineNumber!==void 0?d("WAWap").wap("landline_number",null,h.landlineNumber):null,h.mobileNumber!==void 0?d("WAWap").wap("mobile_number",null,h.mobileNumber):null):null,a?d("WAWap").wap("grievance_officer_details",null,a.name!==void 0?d("WAWap").wap("name",null,a.name):null,a.email!==void 0?d("WAWap").wap("email",null,a.email):null,a.landlineNumber!==void 0?d("WAWap").wap("landline_number",null,a.landlineNumber):null,a.mobileNumber!==void 0?d("WAWap").wap("mobile_number",null,a.mobileNumber):null):null));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(f,i));if(!b.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode);else return b.result});return k.apply(this,arguments)}g.getMerchantCompliance=a;g.setMerchantCompliance=e}),98); __d("WAWebCommonParsersParseBusinessProfile",["WAWebBizGatingUtils","WAWebBotTypes","WAWebBusinessProfileTypes","cr:5664","gkx","lodash"],(function(a,b,c,d,e,f,g){function a(a){var e=a.maybeChild("address");e=e?e.contentString():void 0;var f,g=a.maybeChild("description");g&&(f=g.contentString());g=a.maybeChild("email");g=g?g.contentString():void 0;var j=a.maybeChild("latitude");j=j?parseFloat(j.contentString()):void 0;var k=a.maybeChild("longitude");k=k?parseFloat(k.contentString()):void 0;var l=[];a.forEachChildWithTag("website",function(a){l.push({url:a.contentString()})});var m;if(d("WAWebBizGatingUtils").getFmxAgmEnabled()){var n=a.maybeChild("member_since_text");n&&(m=n.contentString())}var o=[];n=a.maybeChild("categories");n&&n.forEachChildWithTag("category",function(a){var b=a.attrString("id");o.push({id:b,localized_display_name:a.contentString()})});var p;n=a.maybeChild("business_hours");if(n){var q=n.maybeAttrString("timezone"),r=[];n.forEachChildWithTag("business_hours_config",function(a){r.push({day_of_week:a.attrString("day_of_week"),mode:a.attrString("mode"),open_time:a.hasAttr("open_time")?parseInt(a.attrString("open_time"),10):0,close_time:a.hasAttr("close_time")?parseInt(a.attrString("close_time"),10):0})});p={config:r};q!=null&&(p.timezone=q)}var s;n=a.maybeChild("profile_options");if(n){s={};q=n.maybeChild("commerce_experience");if(q){s.commerce_experience=(q=d("WAWebBusinessProfileTypes").CommerceExperienceTypes.cast(q.contentString()))!=null?q:d("WAWebBusinessProfileTypes").CommerceExperienceTypes.NONE}q=n.maybeChild("cart_enabled");q&&(s.cart_enabled=q.contentString()==="true");q=n.maybeChild("shop_url");q&&(s.shop_url=q.contentString());q=n.maybeChild("commerce_manager_url");q&&(s.commerce_manager_url=q.contentString());q=n.maybeChild("is_banned");q&&(s.is_banned=q.contentString()==="true");q=n.maybeChild("direct_connection");q&&(s.direct_connection=q.contentString()==="true");q=n.maybeChild("is_profile_edit_disabled");q&&(s.is_profile_edit_disabled=q.contentString()==="true")}n=a.maybeChild("direct_connection");var t;if(n){q=n.maybeChild("default_postcode");t={enabled:n.maybeAttrString("enabled")==="true",defaultPostcode:q?{code:q.attrString("code"),locationName:q.attrString("location_name")}:void 0}}n=a.maybeChild("catalog_status");q=n?n.attrString("status"):void 0;n={};var u={},v=!1,w,x=a.maybeChild("linked_accounts");if(x){v=!0;var y=x.maybeChild("fb_page");if(y){var z=y.maybeChild("display_name"),A=y.maybeChild("likes");n.display_name=z==null?void 0:z.contentString();n.likes=A==null?void 0:A.contentInt();z=y.maybeAttrString("id");z!=null&&(n.id=z)}A=x.maybeChild("ig_professional");if(A){y=A.maybeChild("ig_handle");z=A.maybeChild("followers");u={ig_handle:y==null?void 0:y.contentString(),followers:z==null?void 0:z.contentInt()}}}x=a.maybeChild("cover_photo");A=x?{id:x.attrString("id"),url:new URL(x.contentString())}:void 0;if(d("WAWebBizGatingUtils").isCustomURLViaBizProfileEnabled()){y=a.maybeChild("custom_url");y&&(w=y==null?void 0:y.contentString())}x=d("WAWebBotTypes").BizBotAutomatedType.cast((z=a.maybeChild("automated_type"))==null?void 0:z.contentString());z=d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.cast((y=a.maybeChild("welcome_message_protocol_mode"))==null?void 0:y.contentString());var B;y=a.maybeChild("prompts");y&&(B=h(y));y=(y=a.maybeChild("commands"))==null?void 0:(y=y.maybeChild("description"))==null?void 0:y.contentString();var C;a=a.maybeChild("commands");a&&(C=i(a));!c("gkx")("26258")&&b("cr:5664")&&(b("cr:5664").debugBotConfigs.injectBizBotFields===!0&&(z=d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.BASIC,f="Hello! I'm Midjourney, your personal assistant. I'm here to assist you with anything you might need, from travel information to workout plans, and even caring for your plants. I can even sketch your imagination!",B=[{emoji:"\u2728",text:"Create an alien world!"},{emoji:"\ud83d\udd25",text:"Show a future city!"},{emoji:"\u2728",text:"Fantasy landscape? Generate now!"},{emoji:"\ud83d\udd25",text:"Describe a mythical world filled with magical creatures and let the bot generate an image that brings it to life!"},{emoji:"\u2728",text:"Picture an enchanted forest with towering trees, sparkling fairies, and vibrant flora, and let the bot create an image that captures its magic!"},{emoji:"\ud83d\udd25",text:"Imagine yourself as a time traveler who has just stepped into an ancient civilization. You find yourself surrounded by towering structures and exotic landscapes that are unfamiliar to you. Take a moment to observe the surroundings, notice the intricate details on the buildings and the unique attire worn by the people. Now, let the bot generate an image that captures the essence of this unexplored world, bringing forth a visual representation that transcends time and space!"}],y="Try these commands to get started",C=[{description:"Create images with Midjourney",name:"imagine"},{description:"View and adjust your personal settings",name:"settings"},{description:"Blend images together seamlessly",name:"blend"},{description:"View information about your profile",name:"info"},{description:"Subscribe to the profile for updates",name:"subscribe"}],l.length===0&&(l=[{url:"https://meta.com"}])));a={address:e,description:f,email:g,latitude:j,longitude:k,website:l,categories:o,business_hours:p,catalog_status:q,profile_options:s,fb_page:n,ig_professional:u,profile_is_linked:v,directConnection:t,cover_photo:A,custom_url:w,prompts:B,commands:C,commands_description:y,automated_type:x,welcome_message_protocol_mode:z,member_since_text:m};return c("lodash").omitBy(a,function(a){return a==null})}function h(a){var b=[];a.forEachChildWithTag("prompt",function(a){var c=a.maybeChild("emoji");c=(c=c==null?void 0:c.contentString())!=null?c:"";a=a.maybeChild("text");a=(a=a==null?void 0:a.contentString())!=null?a:"";b.push({emoji:c,text:a})});return b}function i(a){var b=[];a.forEachChildWithTag("command",function(a){var c=a.maybeChild("name");c=(c=c==null?void 0:c.contentString())!=null?c:"";a=a.maybeChild("description");a=(a=a==null?void 0:a.contentString())!=null?a:"";b.push({name:c,description:a})});return b}g["default"]=a}),98); __d("WAWebJidToWid",["WAJids","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebWidFactory").createUserWid(a)}function b(a){return d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(a))}function h(a){return d("WAWebWidFactory").toUserWid(d("WAWebWidFactory").createWid(a))}function c(a){return d("WAWebWidFactory").toUserLidOrThrow(h(a))}function e(a){return d("WAWebWidFactory").createDeviceWid(a)}function f(a){return d("WAWebWidFactory").toChatWid(d("WAWebWidFactory").createWid(a))}function i(a){return d("WAWebWidFactory").createWid(a)}function j(a){a=d("WAJids").extractJidFromJidWithType(a);return d("WAWebWidFactory").createWid(a)}function k(a){return d("WAWebWidFactory").createWid(a)}g.userJidToUserWid=a;g.lidUserJidToUserLid=b;g.deviceJidToUserWid=h;g.lidDeviceJidToUserLid=c;g.deviceJidToDeviceWid=e;g.chatJidToChatWid=f;g.groupJidToWid=i;g.jidWithTypeToWid=j;g.newsletterJidToWid=k}),98); __d("WAWebQueryBusinessProfileJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommonParsersParseBusinessProfile","WAWebCommsWapMd","WAWebJidToWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("businessProfileResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("business_profile");var b=[];a.forEachChildWithTag("profile",function(a){var e=d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("jid")),f=a.attrString("tag");a=c("WAWebCommonParsersParseBusinessProfile")(a);Object.keys(a).length?b.push({wid:e,tag:f,profile:a}):b.push({wid:e,tag:f})});return b});function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;c=(c=d("WAWap")).wap("iq",{to:c.S_WHATSAPP_NET,xmlns:"w:biz",id:c.generateId(),type:"get"},c.wap("business_profile",{v:c.INT(b)},a.map(function(a){return d("WAWap").wap("profile",{jid:d("WAWebCommsWapMd").USER_JID(a.wid),tag:a.tag!=null?d("WAWap").INT(a.tag):d("WAWap").DROP_ATTR})})));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(c,h));if(!b.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode);else return b.result});return i.apply(this,arguments)}g["default"]=a}),98); __d("WAWebQueryBusinessProfile",["Promise","WAWebBackendErrors","WAWebBusinessProfileVersioningBridge","WAWebMerchantComplianceJob","WAWebQueryBusinessProfileJob"],(function(a,b,c,d,e,f,g){var h;function a(a,e){var f=d("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersion();e?e=(h||(h=b("Promise"))).all([c("WAWebQueryBusinessProfileJob")(a,f),d("WAWebMerchantComplianceJob").getMerchantCompliance(a)]).then(i):e=c("WAWebQueryBusinessProfileJob")(a,f);return d("WAWebBackendErrors").attachErrorLogger(e,"Query business profile failed")}function i(a){var b=a[0],c=a[1];return b.map(function(a,b){return babelHelpers["extends"]({},a,{profile:babelHelpers["extends"]({},a.profile,{legal_entity_details:c[b]})})})}g.queryBusinessProfile=a}),98); __d("WAWebChatThreadLoggingUtils",["WABase64","WACryptoHmac","WAJids","WALogger","WATimeUtils","WAWebApiContact","WAWebApiParse","WAWebBusinessProfileTypes","WAWebEphemeralityTypes","WAWebInteractiveMessagesNativeFlowName","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebMsgType","WAWebQueryBusinessProfile","WAWebUserPrefsMeUser","WAWebWamEnumChatOriginsType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumOppositeVisibleIdentificationType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getChatOriginType: could not find chat with id ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getOppositeVisibleIdentificationType: could not find contact with id ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMeHasUsername: could not find contact with id ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMeHasUsername: wid is not a valid user ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(['Thread Logging: Failed to query business profile to set "biz_catalog_type"']);l=function(){return a};return a}var m=new TextEncoder(),n=function(a){return m.encode(a).buffer};function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WACryptoHmac").hmacSha256(a,b));return d("WABase64").encodeB64(a)});return p.apply(this,arguments)}function a(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=n(b+c);return o(a,b)});return q.apply(this,arguments)}function e(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=n(b);return o(a,b)});return r.apply(this,arguments)}function f(a){return d("WATimeUtils").toDate(d("WATimeUtils").castToUnixTime(a-8*d("WATimeUtils").HOUR_SECONDS)).toISOString().split("T")[0].replace(/-/g,"/")}function s(a,b){var c=b%d("WATimeUtils").DAY_SECONDS;b=b-c;return c>=a?b+a:b-d("WATimeUtils").DAY_SECONDS+a}function t(a,b,c){return s(a,b)>c}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;try{b=(yield d("WAWebQueryBusinessProfile").queryBusinessProfile([{wid:a}]))}catch(a){d("WALogger").ERROR(l()).verbose().devConsole(a).sendLogs("query-business-profile-fail");return null}a=b[0];if(!a)return null;a=(a=a.profile)==null?void 0:(a=a.profile_options)==null?void 0:a.commerce_experience;if(a===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.CATALOG)return"native";else if(a===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.SHOP)return"shop";return null});return v.apply(this,arguments)}function w(a){return[d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT].includes(a.type)?!1:!0}function x(a){var b=new Set([d("WAWebMsgType").MSG_TYPE.PRODUCT,d("WAWebMsgType").MSG_TYPE.ORDER,d("WAWebMsgType").MSG_TYPE.LIST]);return b.has(a.type)||b.has((b=a.quotedMsg)==null?void 0:b.type)||!!(a.matchedText!=null&&a.matchedText!==""&&y(a.matchedText))||a.type===d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW&&(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS||a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS)}function y(a){return d("WAWebApiParse").matchCatalogUrl(a)||d("WAWebApiParse").matchProductUrl(a)}function z(a){if(a==null)return null;switch(a){case d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.ACCOUNT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.CHAT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.BULK_CHANGE;default:return null}}function A(a){if(a==null)return null;switch(a){case d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.ACCOUNT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.CHAT_SETTINGS;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange:return d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE.BULK_CHANGE;default:return null}}function B(a){if(a==null)return null;return a?d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE.INITIATED_BY_ME:d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE.INITIATED_BY_OTHER}function C(){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMeUser").getMeUser();if(!a.isUser()){d("WALogger").ERROR(k(),a);return!1}var b=!1,e=(yield c("WAWebLidAwareContactsDB").get(a.toJid().toString()));(e==null?void 0:e.username)!=null&&e.username!==""&&(b=!0);if(!a.isLid()){e=d("WAWebApiContact").getCurrentLid(a);if(e){e=(yield c("WAWebLidAwareContactsDB").get(e.toString()));(e==null?void 0:e.username)!=null&&e.username!==""&&(b=!0)}return b}d("WALogger").ERROR(j(),a);return b});return D.apply(this,arguments)}function E(a){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return J(a)?null:d("WAWebModelStorageUtils").getStorage().lock(["contact"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b,e;if(a.isLid()){var f=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));f==null?(b=a.toString(),e="lid"):(b=d("WAJids").toPhoneUserJid(f.user.toString()),e="pn")}else b=d("WAJids").toPhoneUserJid(a.user.toString()),e="pn";f=(yield c("WAWebLidAwareContactsDB").get(b));if(f==null){d("WALogger").ERROR(i(),a);return null}return G(f,e)}))});return F.apply(this,arguments)}function G(a,b){if(a==null)return d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.PLACEHOLDER;var c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.MASKED_PHONE_NUMBER;a==null?c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.PLACEHOLDER:a.isAddressBookContact?c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.SAVED_CONTACT_NAME:a.verifiedName?c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.VERIFIED_BUSINESS_NAME:b==="pn"?c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.PHONE_NUMBER:a.username!=null&&a.username!==""&&(c=d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.USERNAME);return c}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return J(a)?null:d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=a.toString();b=(yield b.get(c));if(b==null){d("WALogger").ERROR(h(),c);return}switch(b.lidOriginType){case"ctwa":return d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_CTWA;case"username":return d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_USERNAME;default:return d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.OTHERS}});return function(a){return c.apply(this,arguments)}}())});return I.apply(this,arguments)}function J(a){return!a.isUser()||a.isPSA()||a.isBot()}g.generateThreadID=a;g.generateThreadIDHMAC=e;g.getThreadDs=f;g.computeStartTs=s;g.shouldUpdateChatEvent=t;g.getBizCatalogType=u;g.shouldIncrementMsgSendAndReceive=w;g.isCommerceMessage=x;g.getWamDisappearingModeTrigger=z;g.getWamDisappearingModeTriggerGroups=A;g.getWamDisappearingModeInitiatedByMe=B;g.getMeHasUsername=C;g.getOppositeVisibleIdentification=E;g.getOppositeVisibleIdentificationType=G;g.getChatOriginType=H}),98); __d("WAWebDBMarkAsReadForTable",["WAWebModelStorageUtils","WAWebMsgKey","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,e){return d("WAWebModelStorageUtils").getStorage().lock([a],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.anyOf(["msgKey"],e));b.length!==0&&(yield a.bulkCreateOrReplace(b.map(function(a){return babelHelpers["extends"]({},a,{read:!0})})));return b.map(function(a){a=a.msgKey;return c("WAWebMsgKey").from(a)})});return function(b){return a.apply(this,arguments)}}())}g.markAsReadForTable=a}),98); __d("WAWebDBUpdateAddOnAcksForTable",["WANullthrows","WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,e,f){return d("WAWebModelStorageUtils").getStorage().lock([a],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=[],d=new Map();for(var g of e){var h=g.msgKey.toString();b.push(h);d.set(g.msgKey.toString(),g)}h=(yield a.anyOf(["msgKey"],b,{shouldDecrypt:!1}));g=[];b=[];for(h of h){var i=c("WANullthrows")(d.get(h.msgKey));if(!f(h,i))continue;var j=babelHelpers["extends"]({},h,{ack:i.ack});g.push(j);b.push(i)}yield a.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(g);return b});return function(b){return a.apply(this,arguments)}}())}g.updateAddOnAcksForTable=a}),98); __d("WAWebMessageAddOnType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({Reaction:"reaction",ReactionEnc:"reaction_enc",PollVote:"poll_vote",KeepInChat:"keep_in_chat",MessageEdit:"message_edit",PinMessage:"pin_message",Comment:"comment",Unknown:"unknown"});f.MessageAddOnType=a}),66); __d("WAWebDBCommentAddOnProvider",["Promise","WAWebDBMarkAsReadForTable","WAWebDBUpdateAddOnAcksForTable","WAWebMessageAddOnType","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a={type:d("WAWebMessageAddOnType").MessageAddOnType.Comment,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.COMMENT},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.COMMENT},canRenderInUi:function(){return!0},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){return(h||(h=b("Promise"))).resolve()});function c(b,c){return a.apply(this,arguments)}return c}(),updateAcks:function(a,b){return d("WAWebDBUpdateAddOnAcksForTable").updateAddOnAcksForTable("comments",a,b)},markAsRead:function(a){return d("WAWebDBMarkAsReadForTable").markAsReadForTable("comments",a.map(String))}};g.commentsAddOnProvider=a}),98); __d("WAWebEphemeralKeepInChatUtils",["WAWebBackendApi","WAWebEphemeralConstants","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){if(a!=null&&a===d("WAWebProtobufsE2E.pb").KeepType.KEEP_FOR_ALL)return d("WAWebEphemeralConstants").KeepInChatState.KEPT;else if(a!=null&&a===d("WAWebProtobufsE2E.pb").KeepType.UNDO_KEEP_FOR_ALL)return d("WAWebEphemeralConstants").KeepInChatState.UNKEPT;return null}function b(a){return a===d("WAWebEphemeralConstants").KeepInChatState.KEPT}function h(a){return a===d("WAWebEphemeralConstants").KeepInChatState.UNKEPT}function e(a){var b,c;a.forEach(function(a){(!b||i(a,b)===1)&&(c=b,b=a)});c!=null&&d("WAWebBackendApi").frontendFireAndForget("logTieBreakIgnoredKicWam",{keepInChatMessage:c});return b}function i(a,b){if(a.senderTimestampMs==null)return-1;if(b.senderTimestampMs==null)return 1;if(a.senderTimestampMs>b.senderTimestampMs)return 1;else if(a.senderTimestampMs===b.senderTimestampMs&&a.id.id>b.id.id)return 1;return-1}function j(a){if(a.kicKey!=null){var b,c=d("WAWebMsgGetters").getIsGroupMsg(a);if(((b=a.kicKey)==null?void 0:b.fromMe)===!0)return d("WAWebUserPrefsMeUser").getMaybeMeUser();else if(c&&((b=a.kicKey)==null?void 0:b.participant)!=null)return d("WAWebWidFactory").toUserWid(a.kicKey.participant);else if(!c&&((b=a.kicKey)==null?void 0:b.remote)!=null)return d("WAWebWidFactory").toUserWid(a.kicKey.remote)}}function f(a){return h(a.kicState)&&c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(j(a),d("WAWebMsgGetters").getSender(a)))}g.parseKeepTypeToKicState=a;g.isKept=b;g.runKeepInChatTieBreaker=e;g.compareKeepInChatMessages=i;g.kicSenderSuperPowerActive=f}),98); __d("WAWebMsgDataFromModel",[],(function(a,b,c,d,e,f){function g(a){a=a.toJSON();return babelHelpers["extends"]({},a,{paymentNoteMsg:a.paymentNoteMsg?g(a.paymentNoteMsg):void 0})}f.msgDataFromMsgModel=g}),66); __d("WAWebDBKeepInChatAddOnProvider",["WALogger","WAWebBackendApi","WAWebEphemeralKeepInChatUtils","WAWebMessageAddOnType","WAWebMsgDataFromModel","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["keepInChatAddOnProvider: found orphan"]);h=function(){return a};return a}a={type:d("WAWebMessageAddOnType").MessageAddOnType.KeepInChat,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT},canRenderInUi:function(){return!0},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.map(function(a){return a.parsedMsgPayload});b=d("WAWebEphemeralKeepInChatUtils").runKeepInChatTieBreaker(a);d("WALogger").LOG(h()).devConsole({winningOrphanMsg:b});if(b!=null){a=d("WAWebMsgDataFromModel").msgDataFromMsgModel(b);yield d("WAWebBackendApi").frontendSendAndReceive("processKeepInChatMessage",{keepInChatMessage:a,allowNotification:!1})}});function c(b,c){return a.apply(this,arguments)}return c}()};g.keepInChatAddOnProvider=a}),98); __d("WAWebDBReactionsAddOnProvider",["WAWebDBMarkAsReadForTable","WAWebDBUpdateAddOnAcksForTable","WAWebMessageAddOnType","WAWebMsgType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAddOnType").MessageAddOnType.Reaction,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.REACTION},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.REACTION},canRenderInUi:function(){return!0},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw c("err")("Reactions not yet integrated into orphan framework")});function d(){return a.apply(this,arguments)}return d}(),updateAcks:function(a,b){return d("WAWebDBUpdateAddOnAcksForTable").updateAddOnAcksForTable("reactions",a,b)},markAsRead:function(a){return d("WAWebDBMarkAsReadForTable").markAsReadForTable("reactions",a.map(String))}};g.reactionsAddOnProvider=a}),98); __d("WAWebDBReactionsEncAddOnProvider",["WAWebMessageAddOnType","WAWebMsgType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAddOnType").MessageAddOnType.ReactionEnc,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.REACTION_ENC},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.type===d("WAWebMsgType").MSG_TYPE.REACTION_ENC},canRenderInUi:function(){return!0},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw c("err")("Reactions provider is deprecated")});function d(){return a.apply(this,arguments)}return d}()};g.reactionsEncAddOnProvider=a}),98); __d("WAWebDBAddOnProviders",["WAWebDBCommentAddOnProvider","WAWebDBKeepInChatAddOnProvider","WAWebDBMessageEditAddOnProvider","WAWebDBPinInChatAddOnProvider","WAWebDBPollVotesAddOnProvider","WAWebDBReactionsAddOnProvider","WAWebDBReactionsEncAddOnProvider"],(function(a,b,c,d,e,f,g){var h=[d("WAWebDBPollVotesAddOnProvider").pollVotesAddOnProvider,d("WAWebDBKeepInChatAddOnProvider").keepInChatAddOnProvider,d("WAWebDBReactionsAddOnProvider").reactionsAddOnProvider,d("WAWebDBReactionsEncAddOnProvider").reactionsEncAddOnProvider,d("WAWebDBMessageEditAddOnProvider").messageEditAddOnProvider,d("WAWebDBPinInChatAddOnProvider").pinInChatAddOnProvider,d("WAWebDBCommentAddOnProvider").commentsAddOnProvider];function a(a){var b;return(b=h.find(function(b){return b.type===a}))!=null?b:null}function b(a){return h.find(function(b){return b.matches(a)})}function c(a){return h.find(function(b){return b.matchesFutureproof(a)})}g.addOnProviders=h;g.getProviderForAddOnType=a;g.getAddOnProviderForMsg=b;g.getAddOnProviderForFutureproofMsg=c}),98); __d("WAWebMessageEditGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("message_edit_receive")||h()}function h(){return d("WAWebABProps").getABPropConfigValue("message_edit_send")}function b(){return d("WAWebABProps").getABPropConfigValue("caption_edit_receive")||i()}function i(){return d("WAWebABProps").getABPropConfigValue("caption_edit_send")}function c(){return d("WAWebABProps").getABPropConfigValue("web_message_edit_processing_reply_messages")}function e(){return d("WAWebABProps").getABPropConfigValue("cag_message_edit_send")}function f(){return d("WAWebABProps").getABPropConfigValue("cag_message_edit_receive")}g.receiveTextEditEnabled=a;g.sendTextEditEnabled=h;g.receiveCaptionEditEnabled=b;g.sendCaptionEditEnabled=i;g.processReplyMessagesEnabled=c;g.sendCagMsgEditEnabled=e;g.receiveCagMsgEditEnabled=f}),98); __d("WAWebMessageEditUtils",["$InternalEnum","WATimeUtils","WAWebABProps","WAWebMsgType","WAWebWid"],(function(a,b,c,d,e,f,g){var h=30*24*60*60;function i(a){if(a)return h;a=d("WAWebABProps").getABPropConfigValue("message_edit_window_duration_seconds");return a==null||a<=0?20*60:a}function j(a){if(a)return h;a=d("WAWebABProps").getABPropConfigValue("message_edit_client_entry_point_limit_seconds");return a==null||a<=0?15*60:a}var k=b("$InternalEnum").Mirrored(["TextEdit","CaptionEdit","EventEdit","RichResponseEdit"]);function a(a){switch(a){case d("WAWebMsgType").MSG_TYPE.CHAT:return k.TextEdit;case d("WAWebMsgType").MSG_TYPE.IMAGE:case d("WAWebMsgType").MSG_TYPE.VIDEO:case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return k.CaptionEdit;case d("WAWebMsgType").MSG_TYPE.EVENT_CREATION:return k.EventEdit;case d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE:return k.RichResponseEdit;default:return null}}var l=[(b=d("WAWebMsgType")).MSG_TYPE.CHAT,b.MSG_TYPE.IMAGE,b.MSG_TYPE.VIDEO,b.MSG_TYPE.DOCUMENT,b.MSG_TYPE.EVENT_CREATION,b.MSG_TYPE.RICH_RESPONSE];function e(a){return l.includes(a)?!0:!1}function f(a){var b=a.parentTsInSeconds,e=a.editTsInSeconds;a=a.msgKey;a=c("WAWebWid").isNewsletter(a.remote);return e!=null?e<b+i(a):d("WATimeUtils").unixTime()<b+i(a)}function m(a){var b=a.parentTsInSeconds;a=a.msgKey;return d("WATimeUtils").unixTime()<b+j(c("WAWebWid").isNewsletter(a.remote))}g.getMessageEditProcessingWindowDurationSeconds=i;g.MsgEditType=k;g.getMsgEditType=a;g.msgTypeSupportsEditing=e;g.isParentWithinEditProcessingWindow=f;g.isParentWithinEditUIWindow=m}),98); __d("WAWebDBMessageEditAddOnProvider",["WAWebDBProcessEditProtocolMsgs","WAWebMessageAddOnType","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAddOnType").MessageAddOnType.MessageEdit,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.subtype==="message_edit"},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.futureproofSubtype==="message_edit"},canRenderInUi:function(a){a=a.editMsgType?d("WAWebMessageEditUtils").getMsgEditType(a.editMsgType):d("WAWebMessageEditUtils").MsgEditType.TextEdit;if(!a)return!1;switch(a){case d("WAWebMessageEditUtils").MsgEditType.TextEdit:return d("WAWebMessageEditGatingUtils").receiveTextEditEnabled();case d("WAWebMessageEditUtils").MsgEditType.CaptionEdit:return d("WAWebMessageEditGatingUtils").receiveCaptionEditEnabled();case d("WAWebMessageEditUtils").MsgEditType.EventEdit:return!1;case d("WAWebMessageEditUtils").MsgEditType.RichResponseEdit:return!0}},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(b.map(function(a){return a.parsedMsgPayload})));b=(b=b.find(function(b){return b.parentMsg.id.equals(a.id)}))==null?void 0:b.editedMsgData;b&&Object.assign(a,b)});function c(b,c){return a.apply(this,arguments)}return c}()};g.messageEditAddOnProvider=a}),98); __d("WAWebPinMsgGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("pinned_messages_m1_receiver")}function b(){return d("WAWebABProps").getABPropConfigValue("pinned_messages_m1_sender")}function h(){return d("WAWebABProps").getABPropConfigValue("pinned_messages_m2")}function c(){return h()?d("WAWebABProps").getABPropConfigValue("pinned_messages_m2_pin_max"):1}g.isPinnedMessagesM1ReceiverEnabled=a;g.isPinnedMessagesM1SenderEnabled=b;g.isPinnedMessagesM2Enabled=h;g.getMaxPins=c}),98); __d("WAWebDBPinInChatAddOnProvider",["WAWebDBUpdateAddOnAcksForTable","WAWebMessageAddOnType","WAWebMsgType","WAWebPinMessageProcessor","WAWebPinMsgGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAddOnType").MessageAddOnType.PinMessage,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE},canRenderInUi:function(){return d("WAWebPinMsgGatingUtils").isPinnedMessagesM1ReceiverEnabled()},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.map(function(a){return a.parsedMsgPayload});yield d("WAWebPinMessageProcessor").processPinMessages(a.id.remote,b)});function c(b,c){return a.apply(this,arguments)}return c}(),updateAcks:function(a,b){return d("WAWebDBUpdateAddOnAcksForTable").updateAddOnAcksForTable("pinned-messages",a,b)}};g.pinInChatAddOnProvider=a}),98); __d("WAWebDBPollVotesAddOnProvider",["WAWebDBMarkAsReadForTable","WAWebDBProcessPollUpdateMsgs","WAWebDBUpdateAddOnAcksForTable","WAWebMessageAddOnType","WAWebMsgType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAddOnType").MessageAddOnType.PollVote,matches:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&a.subtype==="poll_vote"},matchesFutureproof:function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE},canRenderInUi:function(){return!0},processOrphansForNewMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=new Map();for(a of b)e.set(a.msgKey,a);a=(yield d("WAWebDBProcessPollUpdateMsgs").processPollUpdateMsgs(b.map(function(a){a=a.parsedMsgPayload;if(a.type===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&a.addonEncrypted)return a;throw c("err")("Invalid poll vote orphan type")})));return a.map(function(a){var b;b=a.read||((b=(b=e.get(a.msgKey.toString()))==null?void 0:b.read)!=null?b:!1);return a.read===b?a:babelHelpers["extends"]({},a,{read:b})})});function e(b,c){return a.apply(this,arguments)}return e}(),updateAcks:function(a,b){return d("WAWebDBUpdateAddOnAcksForTable").updateAddOnAcksForTable("poll-votes",a,b)},markAsRead:function(a){return d("WAWebDBMarkAsReadForTable").markAsReadForTable("poll-votes",a.map(String))}};g.pollVotesAddOnProvider=a}),98); __d("WAWebDBUpdateLastAddOnPreviewChat",["WAWebApiChat"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebApiChat").bulkUpdateChatLastAddOnPreview(a)}g.updateDatabaseForLastAddOnPreview=a}),98); __d("WAWebRunInBatches",["Promise","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f){var g;function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,d){d===void 0&&(d=1e3);for(var e=0;e<a.length;e+=d){var f=a.slice(e,e+d);yield c(f);yield new(g||(g=b("Promise")))(function(a){return self.requestAnimationFrame(a)})}});return h.apply(this,arguments)}f.runInBatches=a}),66); __d("WAWebWorkerSafeBackendApi",["WAWebBackendApi"],(function(a,b,c,d,e,f,g){function a(a,b){d("WAWebBackendApi").fireAndForgetInternalDoNotUse("workerSafeEvent",a,b)}function b(a,b){return d("WAWebBackendApi").sendAndReceiveInternalDoNotUse("workerSafeEvent",a,b)}g.workerSafeFireAndForget=a;g.workerSafeSendAndReceive=b}),98); __d("WAWebDBCreateLidPnMappings",["Promise","WALogger","WATimeUtils","WAWebApiContact","WAWebBackendApi","WAWebContactsDbLidMigrationUtils","WAWebEnvironment","WAWebIdentityChangeApi","WAWebRunInBatches","WAWebSchemaContact_DEPRECATED","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["flushLidPnMappingsToDbImpl: "," records to update"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["flushLidPnMappingsToDb failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPnRowData failed! ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["createLidPnMappings: "," contacts requiring usync, source ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["createLidPnMappings: "," identity change notifications generated, source ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["lidPnCacheDirtySet: "," flushed"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["flush lidPnCacheDirtySet: get dirty updates for ",""]);o=function(){return a};return a}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.mappings,e=a.flushImmediately,f=a.identityChangeHandlingEnabled,g=a.learningSource;c("WAWebEnvironment").isWindows?yield d("WAWebRunInBatches").runInBatches(b,function(a){return q({mappings:a,flushImmediately:e,identityChangeHandlingEnabled:f,learningSource:g})}):yield q({mappings:b,flushImmediately:e,identityChangeHandlingEnabled:f,learningSource:g})});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.mappings,e=a.flushImmediately,f=a.identityChangeHandlingEnabled,g=a.learningSource,i=(a=f)!=null?a:!0,j=[],k=[],n=new Map(c.map(function(a){return[a.pn,a.lid]})),o=d("WATimeUtils").unixTime(),p=d("WATimeUtils").castToUnixTime(0),q=[],r=new Set();c.forEach(function(a){var b=a.lid;a=a.pn;var c=d("WAWebApiContact").lidPnCache.getCurrentLid(a),f=d("WAWebApiContact").lidPnCache.getPhoneNumber(b);f=f==null;var h=!f,l=(c==null?void 0:c.equals(b))===!0;h=h&&!l;var m,s;switch(g){case"usync":m=!1;s=f||h;break;case"peer-pn-message":case"recipient-latest-lid":case"peer-lid-message":case"migration-sync-latest":case"migration-sync-old":m=!1;s=!l;break;default:g,m=h,s=f}if(s){c!=null&&i&&q.push(d("WAWebIdentityChangeApi").handleNewIdentity(a,!e));g==="migration-sync-old"?l=!0:(g,l=n.get(a)!==b);h=l?p:o;d("WAWebApiContact").warmUpLidPnMapping(b,a,h);j.push({lid:b.toString(),phoneNumber:a.toString()});e?k.push({lid:b,pn:a,phoneNumberCreatedAt:h}):d("WAWebApiContact").lidPnCacheDirtySet.add(b.toString())}m&&r.add(a)});e&&d("WAWebApiContact").lidPnCacheDirtySet.size>0&&v(k);f=q.length>0?(h||(h=b("Promise"))).all(q).then(function(a){var b=0;for(a of a){var c;b+=(c=a==null?void 0:(c=a.notifications)==null?void 0:c.length)!=null?c:0}d("WALogger").LOG(m(),b,g)}):(h||(h=b("Promise"))).resolve();r.size!==0&&(d("WALogger").LOG(l(),r.size,g),d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("syncContactListJob",{contactIds:Array.from(r),shouldSyncDevice:!1,mode:"query"}));a=[f];k.length>0&&a.push(w(k));yield (h||(h=b("Promise"))).all(a);j.length>0&&(yield d("WAWebBackendApi").frontendSendAndReceive("bulkUpdatePhoneNumberJids",{lidPhoneNumberMappings:j}))});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{a=(yield d("WAWebSchemaContact_DEPRECATED").getContactTable().bulkGet(a));return new Map(a.filter(Boolean).map(function(a){return[a.id,a]}))}catch(a){d("WALogger").ERROR(k(),a.stack)}return new Map()});return t.apply(this,arguments)}function e(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=[];v(a);yield w(a)}catch(a){d("WALogger").ERROR(j()).devConsole(a).sendLogs("Failed to flushLidPnMappingsToDb")}});return u.apply(this,arguments)}function v(a){var b;d("WALogger").LOG(o(),Array.from((b=d("WAWebApiContact")).lidPnCacheDirtySet).join(","));b.lidPnCacheDirtySet.forEach(function(b){b=d("WAWebWidFactory").createUserWid(b);var c=d("WAWebApiContact").lidPnCache.getLidEntry(b);c!=null&&a.push({lid:d("WAWebWidFactory").toUserLidOrThrow(b),pn:d("WAWebWidFactory").toUserWid(c.phoneNumber),phoneNumberCreatedAt:d("WATimeUtils").castToUnixTime(c.phoneNumberCreatedAt)})});d("WALogger").LOG(n(),b.lidPnCacheDirtySet.size);b.lidPnCacheDirtySet.clear()}function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var b=(yield s(a.map(function(a){a=a.pn;return a.toJid()})));a=a.map(function(a){var c=a.lid,e=a.pn;a=a.phoneNumberCreatedAt;var f=b.get(e.toJid());return babelHelpers["extends"]({id:c.toString(),phoneNumber:e.toString(),phoneNumberCreatedAt:a},f?d("WAWebContactsDbLidMigrationUtils").createContactLidRowFromPnRow(c.toString(),f):null)});d("WALogger").LOG(i(),a.length);return d("WAWebSchemaContact_DEPRECATED").getContactTable().bulkCreateOrMerge(a)});return x.apply(this,arguments)}g.createLidPnMappingsInBatches=a;g.createLidPnMappings=q;g.flushLidPnMappingsToDb=e}),98); __d("WAWebDBCommunityTypes",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["SubGroupLink","SiblingGroupLink","SubGroupUnlink","SiblingGroupUnlink"]);f.CommunityLinkOperation=a}),66); __d("WAWebSchemaUnjoinedSubgroupMetadata",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("unjoined-subgroup-metadata").version(d("WAWebModelStorageVersions").unjoinedSubgroupMetadataCreateTable(),[e("id"),c("subject"),c("subjectTime"),c("defaultSubgroup"),c("generalSubgroup"),c("parentGroup"),c("membershipApprovalMode"),c("membershipApprovalRequest"),c("hiddenSubgroup"),c("size")]).version(d("WAWebModelStorageVersions").unjoinedSubgroupParentGroupIndex(),[b("parentGroup")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("unjoined-subgroup-metadata")}g.addTable=a;g.getUnjoinedSubgroupMetadataTable=b}),98); __d("WAWebDBCommunity",["Promise","WABatcher","WALogger","WAWebDBCommunityTypes","WAWebGroupsParticipantsApi","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebSchemaUnjoinedSubgroupMetadata","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkPersistCommunityLink"]);i=function(){return a};return a}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i()).devConsole(a);var c=new Map(),e=new Map();a.forEach(function(a){a.subgroups.forEach(function(a){e.set(String(a.id),null)});switch(a.action){case d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupLink:case d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupUnlink:c.set(String(a.chatId),null);break;default:return}});(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().bulkGet(Array.from(c.keys()))).forEach(function(a){a&&a.parentGroup!=null&&c.set(a.id,String(a.parentGroup))});(yield d("WAWebSchemaChat").getChatTable().bulkGet(Array.from(e.keys()))).forEach(function(a){a&&e.set(a.id,a)});var f=new Map(),g=new Map(),j=new Set(),k=function(a,b,c){b.forEach(function(b){var d=String(b.id),h=e.get(d);if(h!=null&&!h.isReadOnly)f.set(d,{id:d,parentGroup:c?a:void 0});else if(c){j["delete"](d);b={id:d,subject:b.subject,subjectTime:(h=b.subjectTime)!=null?h:0,parentGroup:a};h=g.get(d);h&&h.subjectTime>b.subjectTime&&(b.subject=h.subject,b.subjectTime=h.subjectTime);g.set(d,b)}else g["delete"](d),j.add(d)})};a.forEach(function(a){var b=null,e=!1;switch(a.action){case d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupLink:b=c.get(String(a.chatId));e=!0;break;case d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupUnlink:b=c.get(String(a.chatId));e=!1;break;case d("WAWebDBCommunityTypes").CommunityLinkOperation.SubGroupLink:b=String(a.chatId);e=!0;break;case d("WAWebDBCommunityTypes").CommunityLinkOperation.SubGroupUnlink:b=String(a.chatId),e=!1}b!=null&&k(b,a.subgroups,e)});yield (h||(h=b("Promise"))).all([d("WAWebSchemaGroupMetadata").getGroupMetadataTable().bulkCreateOrMerge(Array.from(f.values())),d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkRemove(Array.from(j)),d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkGet(Array.from(g.keys())).then(function(a){a.forEach(function(a){if(!a)return;var b=g.get(a.id);if(!b)return;a.subjectTime!=null&&a.subjectTime>b.subjectTime&&(b.subjectTime=a.subjectTime,b.subject=a.subject)});return d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkCreateOrMerge(Array.from(g.values()).map(function(a){return babelHelpers["extends"]({},a)}))})])});return k.apply(this,arguments)}var l=function(){var a=5e3;return d("WABatcher").batch({delayMs:a},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield j(a);return(h||(h=b("Promise"))).resolve(a.map(function(a){return void 0}))});return function(b){return a.apply(this,arguments)}}())}();function a(a,b,c,d){d===void 0&&(d=!1);a={chatId:a,subgroups:b,action:c};return d?l(a):j([a])}function m(a){return d("WAWebSchemaGroupMetadata").getGroupMetadataTable().equals(["parentGroup"],a.toString())}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield m(a)).find(function(a){return a.defaultSubgroup===!0})});return o.apply(this,arguments)}function c(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield n(a));return a==null?null:d("WAWebWidFactory").createWid(a.id)});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield m(a));a=(yield d("WAWebGroupsParticipantsApi").bulkCheckMyMembership(b.map(function(a){a=a.id;return d("WAWebWidFactory").createWid(a)}))).map(function(a,c){return[b[c],a]});return a.filter(function(a){a=a[1];return a}).map(function(a){a=a[0];return a})});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield q(a)).map(function(a){a=a.id;return d("WAWebWidFactory").createWid(a)})});return t.apply(this,arguments)}function e(a){return d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().equals(["parentGroup"],a.toString())}function f(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.parentGroup;if(b==null)return!1;a=d("WAWebWidFactory").createWid(a.id);b=(yield s(d("WAWebWidFactory").createWid(b)));return b.length===1&&b[0].equals(a)});return u.apply(this,arguments)}g.persistCommunityLink=a;g.getDefaultSubgroup=c;g.getJoinedSubgroupsMetadata=q;g.getJoinedSubgroups=s;g.getUnjoinedSubgroupsMetadata=e;g.isLastJoinedSubgroup=f}),98); __d("WAWebSchemaGroupInviteV4",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addCompositeIndex;a.add("group-invite-v4").version(d("WAWebModelStorageVersions").groupInviteV4CreateTable(),[e("id"),c("from"),c("to"),c("groupId"),c("expiration"),c("expired"),b(["from","to","groupId"])]).version(d("WAWebModelStorageVersions").addGroupFromKeyToGroupInviteV4(),[b(["from","groupId"])]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("group-invite-v4")}g.addTable=a;g.getGroupInviteV4Table=b}),98); __d("WAWebApiGroupInviteV4Store",["WATimeUtils","WAWebSchemaGroupInviteV4","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return d("WAWebSchemaGroupInviteV4").getGroupInviteV4Table().createOrMerge(a,b)}function c(a){return d("WAWebSchemaGroupInviteV4").getGroupInviteV4Table().bulkCreateOrMerge(a)}function e(a,b,c,d){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield d("WAWebSchemaGroupInviteV4").getGroupInviteV4Table().equals(["from","to","groupId"],[a,b,c]).then(function(a){return a.filter(function(a){return!a.expired&&a.expiration<=e})}));d("WAWebSchemaGroupInviteV4").getGroupInviteV4Table().bulkCreateOrReplace(a.map(function(a){return babelHelpers["extends"]({},a,{expired:!0})}));return a});return h.apply(this,arguments)}function f(a,b){var c=d("WAWebUserPrefsMeUser").getMeUser().toString(),e=d("WAWebUserPrefsMeUser").getMeLidUser().toString();b=b?e:c;return d("WAWebSchemaGroupInviteV4").getGroupInviteV4Table().equals(["from","groupId"],[b,a.toString()]).then(function(a){return a.filter(function(a){return!a.expired&&d("WATimeUtils").unixTime()<=a.expiration})}).then(function(a){return a.map(function(a){return a.to})})}g.persistGroupInviteV4Msg=a;g.persistGroupInviteV4Msgs=c;g.revokeGroupInvites=e;g.getPendingParticipants=f}),98); __d("WAWebDBRevokeInviteV4",["WAWebApiGroupInviteV4Store","WAWebBackendApi","WAWebDBMsgUtils","WAWebDBProcessMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c,d){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield d("WAWebApiGroupInviteV4Store").revokeGroupInvites(a,b,c,e));b=(a==null?void 0:a.map(function(a){return a.id}))||[];c=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(b,function(a){a.inviteCodeExp="0"}));for(e of c)d("WAWebBackendApi").frontendFireAndForget("expireGroupInviteV4",{inviteMsgId:e.id}),d("WAWebDBProcessMessage").updateExistingMessages([e],e.id.remote)});return h.apply(this,arguments)}g.revokeGroupInviteV4=a}),98); __d("WAWebSchemaMessageOrphans",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey,f=b.addIndex;b=b.removeIndex;a.add("message-orphans").version(d("WAWebModelStorageVersions").messageOrphansCreateTable(),[e("msgKey"),c("parentMsgKey"),f("parentMsgKey"),c("sender"),c("parsedMsgPayload"),c("senderTimestampMs"),f("senderTimestampMs")]).version(d("WAWebModelStorageVersions").messageOrphansAddColumns(),[c("t"),f("t"),c("type"),b("senderTimestampMs"),c("read"),c("reportingTokenInfo")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("message-orphans")}g.addTable=a;g.getMessageOrphanTable=b}),98); __d("WAWebDBStoreMessageOrphans",["WALogger","WAWebDBAddOnProviders","WAWebDBMessageSerialization","WAWebMessageAddOnType","WAWebMsgGetters","WAWebSchemaMessageOrphans","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessageOrphans:"]);h=function(){return a};return a}function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(h()).devConsole({msgs:a});a=a.map(function(a){var e;return babelHelpers["extends"]({msgKey:a.id.toString(),parentMsgKey:b(a).toString(),sender:d("WAWebMsgGetters").getSender(a).toString(),parsedMsgPayload:d("WAWebDBMessageSerialization").dbRowFromMessage(babelHelpers["extends"]({},a),c),type:(e=(e=d("WAWebDBAddOnProviders").addOnProviders.find(function(b){return b.matches(a)}))==null?void 0:e.type)!=null?e:d("WAWebMessageAddOnType").MessageAddOnType.Unknown,senderTimestampMs:a.senderTimestampMs,t:a.t},(c==null?void 0:c.storeReportingInfo)===!0&&a.reportingTokenInfo!=null&&{reportingTokenInfo:a.reportingTokenInfo})});yield d("WAWebSchemaMessageOrphans").getMessageOrphanTable().bulkCreateOrReplace(a)});return i.apply(this,arguments)}g.storeMessageOrphans=a}),98); __d("WAWebDBEphemeralMessage",["WALogger","WATimeUtils","WAWebDBMessageDelete","WAWebEphemeralKeepInChatUtils","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["pruneExpiredMessages completed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["pruneExpiredMessages started"]);i=function(){return a};return a}function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(i()).tags("ephemeral-messages");var a=(yield d("WAWebSchemaMessage").getMessageTable().lessThan(["expiredTimestamp"],d("WATimeUtils").unixTime(),{shouldDecrypt:!1}));a=a.filter(function(a){return!d("WAWebEphemeralKeepInChatUtils").isKept(a.kicState)});yield d("WAWebDBMessageDelete").removeMessagesFromHistory(a.map(function(a){return a.id.toString()}));d("WALogger").LOG(h()).tags("ephemeral-messages");return a});return j.apply(this,arguments)}function c(a){return d("WAWebDBMessageDelete").removeMessagesFromHistory(a.map(function(a){return a.id.toString()}))}g.pruneExpiredMessages=a;g.removeExpiredMessagesFromHistory=c}),98); __d("WAAsyncSleep",["Promise","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f){"use strict";var g;function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b===void 0&&(b=200),c===void 0&&(c=200),a>0&&a%b===0&&(yield i(c))});return h.apply(this,arguments)}function i(a){return new(g||(g=b("Promise")))(function(b){return setTimeout(b,a)})}f.asyncSleepAfterGivenLoopIteration=a;f.asyncSleep=i}),66); __d("WATopLevelDomains",[],(function(a,b,c,d,e,f){a=new Set(["aaa","abb","abbott","abogado","abudhabi","ac","academy","accountant","accountants","ad","adult","ae","aero","af","afl","africa","ag","agency","ai","aig","airforce","al","alsace","am","amazon","amex","amsterdam","android","ao","apartments","app","apple","ar","arab","archi","army","arpa","art","as","asia","associates","at","au","auction","audi","audio","auspost","auto","autos","aw","aws","ax","az","ba","baby","band","bank","bar","barcelona","barclaycard","barclays","bargains","basketball","bauhaus","bayern","bb","bbva","bd","be","beauty","beer","berlin","best","bet","bf","bg","bh","bi","bible","bid","bike","bingo","bio","biz","bj","black","blackfriday","blog","blue","bm","bmw","bn","bnpparibas","bo","boats","bond","boo","boston","bot","boutique","box","br","bradesco","broker","brother","brussels","bs","bt","build","builders","business","buzz","bw","by","bz","bzh","ca","cab","cafe","cam","camera","camp","canon","capetown","capital","car","cards","care","career","careers","cars","casa","cash","casino","cat","catering","cba","cc","cd","center","ceo","cern","cf","cfd","cg","ch","charity","chase","chat","cheap","christmas","chrome","church","ci","citic","city","ck","cl","claims","cleaning","click","clinic","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","community","company","computer","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupons","courses","cpa","cr","credit","cricket","crs","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dad","dance","date","dating","day","de","dealer","deals","delivery","deloitte","democrat","dental","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","diy","dj","dk","dm","do","doctor","dog","domains","download","durban","dvag","dz","earth","ec","eco","edeka","edu","education","ee","eg","email","energy","engineer","engineering","enterprises","epson","equipment","es","esq","estate","et","eu","eus","events","exchange","expert","exposed","express","extraspace","fail","faith","family","fan","fans","farm","fashion","feedback","fi","film","finance","financial","fish","fishing","fit","fitness","fj","fk","flights","flir","florist","flowers","fm","fo","foo","food","football","forex","forsale","forum","foundation","fox","fr","frl","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","game","games","garden","gay","gd","gdn","ge","gent","gf","gg","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmbh","gn","godaddy","gold","golf","goog","google","gop","gov","gp","gq","gr","graphics","gratis","green","group","gs","gt","guide","guru","gw","gy","hair","hamburg","haus","health","healthcare","help","hermes","hiphop","hk","hm","hn","hockey","holdings","holiday","homes","honda","horse","host","hosting","house","how","hr","ht","hu","ice","icu","id","ie","ikano","il","im","immo","immobilien","in","inc","industries","info","ing","ink","institute","insurance","insure","int","international","investments","io","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","java","jcb","je","jetzt","jewelry","jio","jm","jnj","jo","jobs","joburg","jp","kaufen","ke","kg","kh","ki","kids","kim","kitchen","kiwi","kn","koeln","komatsu","kp","kpmg","kr","krd","kred","kw","ky","kyoto","kz","la","land","landrover","lat","law","lawyer","lb","lc","leclerc","legal","lgbt","li","lidl","life","lighting","lilly","limited","limo","link","live","lk","llc","loan","loans","local","lol","london","love","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","makeup","man","management","mango","market","marketing","markets","mba","mc","md","me","media","meet","melbourne","meme","memorial","men","menu","mg","mh","miami","microsoft","mil","mk","ml","mm","mn","mo","mobi","moda","moe","mom","monash","money","monster","mortgage","moscow","motorcycles","mov","movie","mp","mq","mr","ms","mt","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","navy","nc","ne","net","network","neustar","new","news","next","nexus","nf","ng","ngo","ni","nico","nike","ninja","nl","no","np","nr","nrw","ntt","nu","nyc","nz","observer","okinawa","om","one","ong","onion","onl","online","ooo","orange","org","organic","ovh","pa","page","panasonic","paris","partners","parts","party","pe","pet","pf","pg","ph","pharmacy","phd","photo","photography","photos","pics","pictet","pictures","pink","pioneer","pizza","pk","pl","place","plumbing","plus","pm","pn","poker","politie","porn","post","pr","press","pro","productions","prof","promo","properties","property","ps","pt","pub","pw","py","qa","qpon","quebec","quest","racing","radio","re","realestate","realtor","recipes","red","rehab","reisen","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rio","rip","ro","rocks","rodeo","rs","rsvp","ru","rugby","ruhr","run","rw","ryukyu","sa","saarland","sale","salon","sandvik","sanofi","sap","sarl","saxo","sb","sbi","sbs","sc","scb","schmidt","school","schule","schwarz","science","scot","sd","se","seat","security","select","sener","services","sex","sexy","sg","sh","sharp","shell","shiksha","shoes","shop","shopping","show","si","singles","site","sk","ski","skin","sky","sl","sm","sn","sncf","so","soccer","social","software","solar","solutions","sony","soy","space","sport","sr","srl","ss","st","statebank","statefarm","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swiss","sx","sy","sydney","systems","sz","taipei","tatamotors","tatar","tattoo","tax","taxi","tc","td","team","tech","technology","tel","tennis","teva","tf","tg","th","theater","tickets","tienda","tips","tirol","tj","tk","tl","tm","tn","to","today","tokyo","tools","top","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","tt","tube","tui","tv","tw","tz","ua","ug","uk","university","uno","uol","us","uy","uz","va","vacations","vanguard","vc","ve","vegas","ventures","vet","vg","vi","video","vin","vip","vision","vivo","vlaanderen","vn","vodka","vote","voto","voyage","vu","wales","wang","watch","webcam","weber","website","wedding","weir","wf","wien","wiki","williamhill","win","wine","woodside","work","works","world","ws","wtf","xin","xyz","yachts","yandex","ye","yoga","yokohama","youtube","yt","za","zappos","zara","zip","zm","zone","zw","\u0431\u0435\u043b","\u0434\u0435\u0442\u0438","\u043c\u043e\u0441\u043a\u0432\u0430","\u043e\u043d\u043b\u0430\u0439\u043d","\u0440\u0443\u0441","\u0440\u0444","\u0443\u043a\u0440","\u092d\u093e\u0930\u0924","\u09ad\u09be\u09f0\u09a4","\u0aad\u0abe\u0ab0\u0aa4","\u0b2d\u0b3e\u0b30\u0b24","\u30bb\u30fc\u30eb","\u4e2d\u56fd","\u516c\u53f8","\u6211\u7231\u4f60","\u79fb\u52a8","\u7f51\u5740","\u7f51\u7ad9","\u7f51\u7edc","\ub2f7\ub137","\ub2f7\ucef4","\ud55c\uad6d"]);f.TLD=a}),66); /** * License: https://www.facebook.com/legal/license/NKF0mBOyBt2/ */ __d("punycode-2.1.1",[],(function(a,b,c,d,e,f){"use strict";b={};var g={exports:b};function h(){var a=2147483647,b=36,c=1,d=26,e=38,f=700,h=72,i=128,j="-",k=/^xn--/,l=/[^\0-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,n={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=b-c,p=Math.floor,q=String.fromCharCode;function r(a){throw new RangeError(n[a])}function s(a,b){var c=[],d=a.length;while(d--)c[d]=b(a[d]);return c}function t(a,b){var c=a.split("@"),d="";c.length>1&&(d=c[0]+"@",a=c[1]);a=a.replace(m,".");c=a.split(".");a=s(c,b).join(".");return d+a}function u(a){var b=[],c=0,d=a.length;while(c<d){var e=a.charCodeAt(c++);if(e>=55296&&e<=56319&&c<d){var f=a.charCodeAt(c++);(f&64512)==56320?b.push(((e&1023)<<10)+(f&1023)+65536):(b.push(e),c--)}else b.push(e)}return b}var v=function(a){return String.fromCodePoint.apply(String,a)},w=function(a){if(a-48<10)return a-22;if(a-65<26)return a-65;return a-97<26?a-97:b},x=function(a,b){return a+22+75*(a<26)-((b!=0)<<5)},y=function(a,c,g){var h=0;a=g?p(a/f):a>>1;a+=p(a/c);for(;a>o*d>>1;h+=b)a=p(a/o);return p(h+(o+1)*a/(a+e))},z=function(e){var f=[],g=e.length,k=0,l=i,m=h,n=e.lastIndexOf(j);n<0&&(n=0);for(var o=0;o<n;++o)e.charCodeAt(o)>=128&&r("not-basic"),f.push(e.charCodeAt(o));for(o=n>0?n+1:0;o<g;){n=k;for(var q=1,s=b;;s+=b){o>=g&&r("invalid-input");var t=w(e.charCodeAt(o++));(t>=b||t>p((a-k)/q))&&r("overflow");k+=t*q;var u=s<=m?c:s>=m+d?d:s-m;if(t<u)break;t=b-u;q>p(a/t)&&r("overflow");q*=t}u=f.length+1;m=y(k-n,u,n==0);p(k/u)>a-l&&r("overflow");l+=p(k/u);k%=u;f.splice(k++,0,l)}return String.fromCodePoint.apply(String,f)},A=function(e){var f=[];e=u(e);var g=e.length,k=i,l=0,m=h;for(var n of e)n<128&&f.push(q(n));n=f.length;var o=n;n&&f.push(j);while(o<g){var s=a;for(var t of e)t>=k&&t<s&&(s=t);t=o+1;s-k>p((a-l)/t)&&r("overflow");l+=(s-k)*t;k=s;for(s of e){s<k&&++l>a&&r("overflow");if(s==k){var v=l;for(var w=b;;w+=b){var z=w<=m?c:w>=m+d?d:w-m;if(v<z)break;var A=v-z,B=b-z;f.push(q(x(z+A%B,0)));v=p(A/B)}f.push(q(x(v,0)));m=y(l,t,o==n);l=0;++o}}++l;++k}return f.join("")},B=function(a){return t(a,function(a){return k.test(a)?z(a.slice(4).toLowerCase()):a})},C=function(a){return t(a,function(a){return l.test(a)?"xn--"+A(a):a})};v={version:"2.1.0",ucs2:{decode:u,encode:v},decode:z,encode:A,toASCII:C,toUnicode:B};g.exports=v}var i=!1;function j(){i||(i=!0,h());return g.exports}function a(a){switch(a){case void 0:return j()}}e.exports=a}),null); __d("punycode",["punycode-2.1.1"],(function(a,b,c,d,e,f){e.exports=b("punycode-2.1.1")()}),null); __d("WALinkify",["WALogger","WATopLevelDomains","punycode"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["text size: ",", error: ",""]);h=function(){return a};return a}e=Array.from(d("WATopLevelDomains").TLD).join("|");f="(?:http|https)://|mailto:";var i=/^https?:\/\/$/gi,j="\\w|[^\\s\0-\x7f\xab\xbb\u2018\u2019\u201c\u201d]|%[0-9a-f][0-9a-f]";e=e+"|xn--(?:"+j+")+";var k="(?:"+j+")|(?:"+j+")(?:"+j+"|-)*(?:"+j+")",l="(?!_)(?:(?:"+k+")\\.)+("+e+")(?!\\."+k+")",m=":\\d{1,5}",n="@!.?,(\\[{<\xab\u2018\u201c:";j="(?:"+j+"|[^\\s%])";var o="/"+j+"*?";n="["+n+"]*(?!"+j+"|#)";var p="\\?(?!"+n+")"+j+"*?";j="#"+j+"*?";var q="0-9a-z!#$%&'*+/=?^_`{|}~\\-";q="\\b\\w["+q+"]*(?:\\.["+q+"]+)*";var r="^|\\W\\.|[^/\\w.]|_";r="("+r+")("+f+")?("+q+"@)?("+l+")(?:(?!"+k+")|(?=_))(?:(?=[^:/?#])|("+m+")?("+o+")?("+p+")?("+j+")?(?="+n+"))";var s=1,t=2,u=3,v=4,w=5,x=6,y=7,z=8,A=9,B=new Map([[34,34],[41,40],[62,60],[93,91],[125,123],[187,171],[8217,8216],[8221,8220]]),C=new Map([[34,34],[40,41],[60,62],[91,93],[123,125],[171,187],[8216,8217],[8220,8221]]),D=new RegExp(""+r,"ig"),E=new RegExp("\\.(?:"+e+")","i");function F(a){try{return D.exec(a)}catch(b){d("WALogger").ERROR(h(),a.length,String(b)).devConsole(b).sendLogs("linkify-regex-error");return null}}function a(a,b){b===void 0&&(b=!1);if(!E.test(a))return[];D.lastIndex=0;var c=[],d;while(d=F(a)){d=H(d,b);d&&c.push(d)}return c}function G(a,b){b===void 0&&(b=!1);if(!E.test(a))return null;D.lastIndex=0;return H(F(a),b)}function H(a,b){b===void 0&&(b=!1);if(!a)return null;var e=a[s].length,f=a[0],g=a.index+e,h=a.index,j=a[s]==="_";if(j&&h-1&&/\S/.test(a.input[h-1]))return null;j=a[w];if(j&&j.startsWith("xn--")&&!d("WATopLevelDomains").TLD.has(c("punycode").toUnicode(j)))return null;if(a[x]){h=parseInt(a[x].slice(1),10);if(a[x][1]==="0"||!(0<h&&h<1<<16))return null}j=[A,z,y].find(function(b){return a&&a[b]})||0;if(j){h=[];var k=a[j];k.slice(-1)==="_"&&f[g-1]==="_"&&(f=f.slice(0,-1),a[j]=k=k.slice(0,-1));var l=0,m=0;for(var n=0;n<k.length;n++){var o=k.charCodeAt(n);o===m?(m=h.pop()||0,m===0&&(l=n)):C.has(o)?(m!==0&&h.push(m),m=C.get(o)):B.has(o)||m===0&&(l=n)}if(l!==k.length-1){o=a.slice(t,j);o.splice(w-t,1);f=o.filter(function(a){return a}).join("")+k.slice(0,l+1);D.lastIndex=g+f.length}else f=f.slice(e)}else f=f.slice(e);n=f;h=a[t];m=Boolean(h&&h.match(i));if(b&&!m)return null;h?h=h.toLowerCase():(n.toLowerCase().indexOf("irc.")===0?h="irc://":n.toLowerCase().indexOf("ftp.")===0?h="ftp://":a[u]?h="mailto:":h="http://",n=h+n);j=a[v];return{href:n,url:f,index:g,input:a.input,scheme:h,username:a[u],domain:j,port:a[x],path:a[y],params:a[z],anchor:a[A],isHttp:m}}function b(a){var b=G(a);return b&&b.url===a&&b.scheme==="mailto:"&&b.username!=null&&b.username!==""&&(b.params==null||b.params==="")&&(b.anchor==null||b.anchor==="")?b:null}g.findLinks=a;g.findLink=G;g.validateEmail=b}),98); __d("WALanguagesAndRegions",[],(function(a,b,c,d,e,f){"use strict";a={fub:["237","235","234"],af:["237","27"],agq:["237"],yay:["234"],bss:["237"],agg:["675"],ast:["34"],avu:["243","211"],az:["994"],bkc:["237","241"],ksf:["237"],bfd:["237"],bjt:["221"],bcn:["234"],bas:["237"],bsq:["231"],bkv:["234"],bom:["234"],btt:["234"],bin:["234"],bmq:["226","223"],bs:["387","385","383","382","381"],fue:["229","228"],br:["33"],bys:["234"],bwr:["234"],cky:["234"],ca:["376","33","39","34"],tzm:["212"],fuq:["234"],ckl:["234"],asg:["234"],co:["33","39"],crh:["7"],hr:["387","385","383","382","381"],mfn:["234"],cs:["420","421"],dbq:["237","234"],dnj:["225","231"],dzg:["235","227"],ddn:["229"],dgh:["234"],dow:["237"],dua:["229"],nl:["297","32","599","31","1","597"],igb:["234"],etr:["675"],enn:["234"],kgy:["675"],et:["372"],ich:["234"],ee:["229","233","228"],ewo:["237"],fo:["298"],fmp:["237"],fi:["358","46"],fr:["32","229","226","257","237","1","236","242","243","235","269","253","240","33","241","509","225","352","261","223","377","227","250","221","248","41","228","678"],fur:["39"],ff:["237","224","222","221"],gaj:["675"],gl:["34"],gby:["234"],gba:["236"],gmm:["237"],de:["43","32","49","423","352","41"],tof:["675"],god:["225"],ank:["234"],gkn:["234"],gux:["229","226","227","228"],gde:["237","234"],gkp:["224"],kl:["299"],jgk:["234"],ha:["229","237","235","233","225","227","234","249","228"],haw:["1"],hbb:["234"],hu:["36"],dud:["234"],jab:["234"],iby:["234"],is:["354"],idu:["234"],ig:["240"],ige:["234"],ikx:["256"],ikk:["234"],ikq:["234"],smn:["358"],ga:["353","44"],atg:["234"],izi:["234"],dyo:["220","221"],jbu:["237","234"],kab:["213"],kea:["238"],tbd:["675"],hig:["234"],kai:["234"],kkj:["237","236","242"],kzr:["237","235"],naq:["264"],geb:["675"],okr:["234"],ksh:["49"],ses:["223"],khq:["223"],kun:["291","251"],kup:["675"],kub:["237","234"],kpe:["224","231"],nmg:["237","240"],ku:["963","90"],lkt:["1"],hia:["234"],lag:["255"],lv:["371"],lmp:["237"],ln:["242","243"],liv:[],lt:["370"],yaz:["234"],nds:["55","49","31"],dsb:["49"],lu:["243"],lb:["32","33","49","352"],mda:["234"],mb:["261"],mt:["356"],mi:["64"],arn:["56"],mas:["254","255"],ffm:["223"],mql:["229","228"],mbo:["237"],mbu:["234"],mif:["237"],mzm:["234"],mua:["237","235"],sur:["234"],nv:["1"],anc:["234"],nnh:["237"],jgo:["237"],fuv:["237","234"],nin:["234"],dgi:["226"],se:["358","46","47"],nso:["27"],ann:["234"],oc:["33","39","377","34"],pbi:["237"],pip:["234"],pl:["48"],pt:["244","55","238","240","245","853","258","351","239","670"],prg:[],fuf:["224","223","221","232"],qu:["54","591","57","593","51"],ro:["373","40"],cla:["234"],sav:["221"],sg:["236","235","243"],gd:["44"],seh:["258"],sr:["387","385","383","382","381"],sh:["387","385","383","382","381"],srr:["220","221"],sch:["39"],sld:["226"],sms:["358"],sk:["420","421"],sl:["386"],sok:["235"],es:["54","501","591","56","57","506","53","593","503","240","502","504","52","505","507","595","51","34","1","598","58"],srn:["597"],gsw:["43","33","49","423","41"],shi:["212"],tal:["234"],tmh:["223"],taq:["226","223"],tan:["234"],twq:["227"],blt:["856","84"],yer:["234"],tuq:["235","218","227","234"],ttr:["234"],tik:["237"],to:["676"],dts:["223"],kdl:["234"],tsw:["234"],tr:["90"],tk:["993"],hsb:["49"],vai:["231","232"],vi:["855","84"],vo:[],vut:["237","234"],wja:["234"],wa:["32"],wae:["43","39","423","41"],wji:["234"],cy:["44"],fy:["31"],fuh:["229","226","227"],yba:["234"],yav:["237"],yle:["675"],yll:["675"],yo:["229","234"],dje:["227"],gnd:["237"]};f.LANGUAGE_TO_REGIONS=a}),66); __d("WAIdn",["WALanguagesAndRegions","WAStringz"],(function(a,b,c,d,e,f,g){"use strict";var h={í:["ast","ksf","bas","ca","cs","dua","nl","ee","ewo","fo","fr","gl","kl","hu","is","ga","dyo","kea","kkj","nmg","lkt","lag","ln","lu","mas","nnh","jgo","pt","qu","seh","sk","es","to","vai","vi","wae","cy","fy","yav","yo"],î:["af","agq","bss","bfd","bas","bkv","btt","nl","igb","ewo","fr","fur","gaj","gby","kl","jab","atg","jbu","kkj","naq","ksh","ku","nmb","lmp","ln","mda","mg","mas","mzm","jgo","nin","ann","ro","sg","scn","srn","yer","tr","wa","cy","yav","yle"],ü:["agg","ast","az","br","ca","co","cs","nl","etr","et","fr","gl","de","tof","god","hu","tbd","geb","ksh","kup","nds","lb","arn","oc","sg","sk","es","gsw","dts","tr","tk","vo","wa","wae","fy","yll"],ċ:["mt"],ī:["agq","bss","bfd","bas","bkv","btt","ddn","igb","kjy","ich","gux","haw","jab","iby","idu","jbu","kub","nmg","lv","mda","mi","mas","mql","nin","prg","gd","to","yba","yav"],ı:["az","crh","tr"],ļ:["lv"],ł:["dsb","nv","pl","hsb"],š:["bs","hr","cs","dzg","et","fi","smn","geb","khq","ses","kun","lkt","lv","lt","dsb","se","nso","prg","sr","sh","sms","sk","sl","taq","twq","tuq","hsb","wqe","dje"],ƙ:["ckl","ank","ha","ikx","kai","hia","mbu","anc","nin","pip","tal","tan","wja","wji"],ǀ:["naq"],ǁ:["naq"],ȯ:["liv"],ɑ:["fmp","dud","tmh"],ɓ:["fub","yay","bkc","bjt","bcn","bas","bsq","bmq","fue","bys","bwr","cky","fuq","ckl","asg","dbq","dnj","dgh","dow","dua","enn","ff","gby","gba","gmm","ank","gde","gkp","jgk","ha","hbb","ikx","kkj","hig","kzr","kai","kpe","nmg","hia","ffm","mbo","mbu","mif","mzm","mua","sur","anc","fuv","nin","dgi","pbi","pip","fuf","cla","sav","srr","sld","sok","tal","tan","yer","ttr","tik","kdl","tsw","vai","vut","wja","wji","fuh","gnd"],ḍ:["tzm","kab","okr","shi","tmh","taq"],ṛ:["tzm","kab","shi"],ṭ:["tzm","kab","shi","tmh","taq"],ẉ:[],ạ:["izi","yaz","blt","vi"],ẹ:["yay","bom","bin","mfn","dzg","igb","enn","gkn","iby","ikk","ikw","izi","okr","yaz","blt","tan","tuq","vi","yo"],ị:["avu","mfn","igb","enn","iby","ig","ige","ikk","ikw","izi","okr","blt","tan","vi"]},i=new Set(["abq","ab","ady","av","az","ba","be","bs","bg","bua","ce","ckt","cu","cv","crh","dar","dng","myv","evn","gag","inh","kbd","xal","krc","kaa","kk","kjh","kca","ky","kv","koi","kpy","kum","lbe","lez","mk","mns","chm","mdf","mn","ttt","gld","yrk","nog","os","ru","rue","sr","sh","cjs","alt","tab","tg","tt","tkr","tk","tyv","ude","udm","uk","uz","mrj","sah"]),j=new Set(["374","994","375","387","359","995","7","383","996","389","373","976","382","381","992","993","380","998"]),k="\u0430\u0432\u0433\u0435\u043a\u043c\u043d\u043e\u0440\u0441\u0442\u0443\u0445\u0448\u0449\u044c\u0455\u0456\u0458\u0461\u0475\u04af\u04bb\u04cf\u0501\u051b\u051d\u0527\ua699";function l(a){return i.has(a)}function m(a){return j.has(a)}function n(a){return k.includes(a)}var o=new RegExp("^[a-z0-9-]+$"),p=2;function a(a,b,c,e){a=a.split(".");var f,g=!1;a.forEach(function(a){g=!a.match(o);if(g)if(!f)f=a;else return null});if(f==null||g)return null;a=[];var i=!0,j=d("WAStringz").toArray(f);for(var k=0;k<j.length;k++){var q=j[k];i=i&&n(q);if(i)continue;if(h[q])if(a.length>=p)return null;else a.push(q)}if(i){if(m(c)||m(b))return null;return e.some(function(a){return l(a)})?null:new Set(j)}if(!a.length)return null;q=a.filter(function(a){var f=h[a];if(f==null)return!1;if(e.some(function(a){return f.includes(a)}))return!1;a=new Set();for(var g=0;g<f.length;g++){var i=d("WALanguagesAndRegions").LANGUAGE_TO_REGIONS[f[g]];if(i==null)continue;for(var j=0;j<i.length;j++)a.add(i[j])}return a.has(c)||a.has(b)?!1:!0});return q.length?new Set(q):null}g.findSuspiciousCharacters=a}),98); __d("WASuspiciousLinks",["WAIdn","WAJids","WAPhoneFindCC"],(function(a,b,c,d,e,f,g){"use strict";var h=/^(?:https?:\/\/)?([^/?#]+)(?:[/?#]|$)/i,i="ZZ";function a(a,b,c,e){a=a.match(h);a=a&&a[1];if(a==null)return null;c=d("WAPhoneFindCC").phoneCC(c);var f;if(b==="whatsapp")f="";else{var g=d("WAJids").interpretAndValidateJid(b.toString());f=g.jidType!=="lidUser"?d("WAPhoneFindCC").phoneCC(d("WAJids").toPhoneUserJid(b)):i}g=e.map(function(a){return a.toLowerCase()});return d("WAIdn").findSuspiciousCharacters(a,f,c,g)}g.findSuspiciousCharacters=a}),98); __d("WAWebLinkify",["WAJids","WALinkify","WASuspiciousLinks","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function a(a,b,c){b===void 0&&(b=!1);a=d("WALinkify").findLinks(a,b);return a.map(function(a){return i(a,c)})}function h(a,b,c){b===void 0&&(b=!1);a=d("WALinkify").findLink(a,b);if(a==null)return;return i(a,c)}function b(a){return a.body!=null&&h(a.body,!0)!=null}function i(a,b){var c=d("WAWebUserPrefsMeUser").getMaybeMeUser(),e=null;if(b&&c){b=b.isLid()?d("WAJids").toLidUserJid(b.user):d("WAJids").toPhoneUserJid(b.user);e=d("WASuspiciousLinks").findSuspiciousCharacters(a.domain,b,d("WAJids").toPhoneUserJid(c.user),[])}return babelHelpers["extends"]({},a,{suspiciousCharacters:(b=e)!=null?b:void 0})}g.findLinks=a;g.findLink=h;g.hasHttpLink=b}),98); __d("WAWebDBEncryptMultipleMsgs",["Promise","WAAsyncSleep","WALogger","WAWebBrokerGlobalAppState","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebDbEncryptionKey","WAWebLinkify","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processAndEncryptSingleMsgRow without throttle failed with error: ",", message: ",", stack: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["processAndEncryptSingleMsgRow failed for msg: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["processAndEncryptSingleMsgRow with throttle failed with error: ",", message: ",", stack: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processAndEncryptSingleMsgRow failed for msg: ",""]);l=function(){return a};return a}var m=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="DroppingMsgRowDueToLogout",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c=!1);yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey();yield new(h||(h=b("Promise")))(function(a){return self.setTimeout(a,0)});if(c){c=[];for(var e=0;e<a.length;e++)try{var f=a[e];f=(yield o(f,e));c.push(f)}catch(b){if(b instanceof m)throw b;d("WALogger").DEV(l(),a[e].id.remote).tags("message-store");d("WALogger").ERROR(k(),b.name,b.message,b.stack).tags("message-store").devConsole(b)}}else{f=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield o(a)["catch"](function(b){if(b instanceof m)throw b;d("WALogger").DEV(j(),a.id.remote).tags("message-store");d("WALogger").ERROR(i(),b.name,b.message,b.stack).tags("message-store").devConsole(b)})["finally"](function(){return void 0}));return b});return function(b){return a.apply(this,arguments)}}())));c=f.filter(Boolean)}return c});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(c("WAWebBrokerGlobalAppState").isLogoutInProgress)return(h||(h=b("Promise"))).reject(new m());e!=null&&(yield d("WAAsyncSleep").asyncSleepAfterGivenLoopIteration(e,35,100));e=d("WAWebSchemaMessage").getMessageTable();var f=d("WAWebDBMessageUtils").getVcardWids(a),g=d("WAWebDBMessageSerialization").dbRowFromMessage(a);e=(yield e.preflightEncryptSingleRecord(babelHelpers["extends"]({},g)));g=babelHelpers["extends"]({},g,e);f!=null&&(g.vcardWAids=f);return[g,d("WAWebLinkify").hasHttpLink(a)]});return p.apply(this,arguments)}g.DroppingMsgRowDueToLogout=m;g.encryptMultipleDBMsgs=a;g.processAndEncryptSingleMsgRow=o}),98); __d("WAWebWamEnumWebcChatCreateCreationMethod",[],(function(a,b,c,d,e,f){a=Object.freeze({MISSING_WHEN_SAVING_MESSAGE:0});f.WEBC_CHAT_CREATE_CREATION_METHOD=a}),66); __d("WAWebWebcChatCreateWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcChatCreateCreationMethod"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcChatCreate:[6132,{creationMethod:[1,d("WAWebWamEnumWebcChatCreateCreationMethod").WEBC_CHAT_CREATE_CREATION_METHOD],noCreated:[2,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{WebcChatCreate:[]});g.WebcChatCreateWamEvent=a}),98); __d("WAWebDBMessageBulkHelper",["Promise","WAJids","WALogger","WALoggerUtils","WANullthrows","WAWebApiContact","WAWebDBEncryptMultipleMsgs","WAWebDBStoreEncryptedMsgs","WAWebDBStoreNewsletterEncryptedMsgs","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebMsgGetters","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebUserPrefsMeUser","WAWebUsernameTypes","WAWebWamEnumWebcChatCreateCreationMethod","WAWebWebcChatCreateWamEvent","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][msg-cache]: missing chats when saving message: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][msg-cache]: storing chat updates for "," chats"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Could not log missing Lids ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: Missing PN mappings while saving Lid group messages. lid groups count: ",", pn groups count: ",",\n is history: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: number non Cag Groups: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: Missing PN mappings while saving Lid group messages. is announce: ",", is parent: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: number affected groups: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: Missing PN mappings while saving Lid group messages. type: ",", subtype: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["logMissingGroupParticipantLids: has some participants with missing Lids"]);q=function(){return a};return a}function a(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{yield u(a,b)}catch(c){if(d("WAWebDBStoreEncryptedMsgs").isEligibleForFallback(a.length,c))yield u(a,b,!0);else throw c}});return r.apply(this,arguments)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{a=a.filter(function(a){var b=a.id.participant;return b&&b.isLid()&&d("WAWebLidMigrationUtils").toPn(b)==null&&a.id.remote.isGroup()&&!d("WAWebUserPrefsMeUser").isMeAccount(b)});if(a.length===0)return;d("WALogger").LOG(q());a.forEach(function(a){d("WALogger").ERROR(p(),a.type,a.subtype)});a=new Set(a.map(function(a){return a.id.remote.toString()}));d("WALogger").LOG(o(),a.size);a=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().anyOf(["id"],Array.from(a)));a.forEach(function(a){d("WALogger").ERROR(n(),a.announce,a.isParentGroup)});a=a.filter(function(a){return(a==null?void 0:a.announce)===!1});if(a.length===0)return;d("WALogger").LOG(m(),a.length);var c=a.filter(function(a){return a==null?void 0:a.isLidAddressingMode}).length;a=a.length-c;d("WALogger").ERROR(l(),c,a,(c=b==null?void 0:b.toString())!=null?c:"na").sendLogs("no-pn-mapping-for-group-lid-message")}catch(a){d("WALogger").ERROR(k(),a).sendLogs("could-not-log-missing-lids")}});return t.apply(this,arguments)}function u(a,b,c){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=!1);void s(a);a=(yield (h||(h=b("Promise"))).all([x(a),d("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(a,!1)]));var f=a[0],g=a[1];yield d("WAWebModelStorageUtils").getStorage().lock(["chat","fts-indexing-queue","message","message-association"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a[1];a[2];a[3];yield b.bulkCreateOrMerge(f);yield d("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(g,c,!1,e)});return function(b){return a.apply(this,arguments)}}())});return v.apply(this,arguments)}function e(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).all([x(a),d("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(a,!1)]));var c=a[0],e=a[1];return d("WAWebModelStorageUtils").getStorage().lock(["chat","message","message-association"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];yield a.bulkCreateOrMerge(c);yield d("WAWebDBStoreNewsletterEncryptedMsgs").storeEncryptedNewsletterMessages(e)});return function(b){return a.apply(this,arguments)}}())});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();a.forEach(function(a){var c=a.id,e=c.remote.toString();if(e!==d("WAJids").STATUS_JID&&d("WAWebMsgGetters").getIsUnreadType(a)){var f=b.get(e)||{unread:0,t:0,unreadMentionsOfMe:[]};if(!c.fromMe){f.unread+=1;if(d("WAWebMsgGetters").getIsImportantMessage(a)){c={id:a.id.toString(),timestamp:a.t};f.unreadMentionsOfMe?f.unreadMentionsOfMe.push(c):f.unreadMentionsOfMe=[c]}}a.t!=null&&a.t>f.t&&(f.t=Math.max(a.t,f.t));b.set(e,f)}});var e=Array.from(b.keys());a=(yield d("WAWebSchemaChat").getChatTable().bulkGet(e));var f=a.map(function(a,f){var g,h;f=e[f];var i=b.get(f),j=(i==null?void 0:i.unread)||0,k=Math.max(0,a?a.unreadCount:0),l=(i==null?void 0:i.t)||void 0;a&&a.t!=null&&((l==null||a.t>l)&&(l=a.t));g=(g=a==null?void 0:a.archiveAtMentionViewedInDrawer)!=null?g:!1;i=(i=i==null?void 0:i.unreadMentionsOfMe)!=null?i:[];h=(h=a==null?void 0:a.unreadMentionsOfMe)!=null?h:[];i.length>0&&(g=!1);i=i.concat(h);h=a==null?void 0:a.isDeprecated;k={id:f,unreadCount:k+j,t:l,unreadMentionsOfMe:i,archiveAtMentionViewedInDrawer:g,isDeprecated:h};j=d("WAWebWidFactory").createWid(f);d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&c("WAWebWid").isRegularUser(j)&&(a==null&&(k.accountLid=d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebLidMigrationUtils").toLid(j))).toString(),j.isLid()&&(k.lidOriginType=d("WAWebApiContact").getPhoneNumber(j)!=null?d("WAWebUsernameTypes").LidOriginType.GENERAL:d("WAWebUsernameTypes").LidOriginType.PNH_CTWA)));return k});d("WALogger").LOG(j(),f.length);var g=a.some(function(a){return a==null});if(g){var h=new Set(a.map(function(a){return a==null?void 0:a.id}));g=e.filter(function(a){return c("WAWebWid").isRegularUserNoImply(a)&&!h.has(a)}).length;g>0&&(new(d("WAWebWebcChatCreateWamEvent").WebcChatCreateWamEvent)({creationMethod:d("WAWebWamEnumWebcChatCreateCreationMethod").WEBC_CHAT_CREATE_CREATION_METHOD.MISSING_WHEN_SAVING_MESSAGE,noCreated:g}).commit(),d("WALogger").ERROR(i(),g).sendLogs("missing-chats-when-saving-message",{sampling:c("gkx")("26258")?d("WALoggerUtils").dynamicLoggingSampling(1e-4):1}))}return f});return y.apply(this,arguments)}g.persistNewMessagesInBulk=a;g.logMissingGroupParticipantLids=s;g.persistNewNewsletterMessagesInBulk=e}),98); __d("WAWebSchemaMessageAssociation",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add("message-association").version(d("WAWebModelStorageVersions").messageAssociationCreateTable(),[e(["msgKey","associationType"]),c("parentMsgKey"),c("msgKeyInternalId"),b("parentMsgKey")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("message-association")}g.addTable=a;g.getMessageAssociationTable=b}),98); __d("WAWebDBDeleteAssociatedMsgsByMsgKey",["WAWebSchemaMessageAssociation"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkRemove(a)}function b(a){return d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkRemoveByIndex(["msgKey"],a)}g.bulkDeleteMessagesByMsgKeyAndAssociationType=a;g.bulkDeleteMessagesByMsgKeys=b}),98); __d("WAWebDBGetAssociatedMsgsByParentMsgKey",["WAWebSchemaMessageAssociation"],(function(a,b,c,d,e,f,g){function a(a){return h([a])}function h(a){return d("WAWebSchemaMessageAssociation").getMessageAssociationTable().anyOf(["parentMsgKey"],a.map(String))}g.getMessagesByParentMsgKey=a;g.bulkGetMessagesByParentMsgKey=h}),98); __d("WAWebLidMigrationDbUtils",["WAWebApiContact","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map(),c=a.filter(function(a){a=d("WAWebWidFactory").createWid(a);return a.isRegularUser()&&!a.isLid()});if(c.length===0)return b;a=(yield d("WAWebSchemaChat").getChatTable().bulkGet(c));a.forEach(function(a,e){a=a==null?void 0:a.accountLid;if(a==null){var f=d("WAWebWidFactory").createUserWid(c[e]);a=(f=d("WAWebApiContact").getCurrentLid(f))==null?void 0:f.toString()}a!=null&&b.set(c[e],a)});return b});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();a=a.filter(function(a){a=d("WAWebWidFactory").createWid(a);return a.isLid()});if(a.length===0)return b;var c=(yield d("WAWebSchemaChat").getChatTable().anyOf(["accountLid"],a));c.forEach(function(a){var c=a.accountLid;c!=null&&b.set(c,a.id)});a.forEach(function(a){if(!b.has(a)){var c=d("WAWebWidFactory").createUserWid(a);c=(c=d("WAWebApiContact").getPhoneNumber(c))==null?void 0:c.toString();c!=null&&b.set(a,c)}});return b});return i.apply(this,arguments)}g.findAccountLidsForPnChatIds=a;g.findChatIdsForAccountLids=c}),98); __d("WAWebSchemaLabelAssociation",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){b=b("$InternalEnum")({Jid:"jid",Message:"message"});function a(a){var b=a.labelId,c=a.associationId;a=a.type;return[b,c,a]}function c(a){return a[1]}function e(a){return a[2]}function f(a){return{labelId:a[0],associationId:a[1],type:a[2]}}function h(a,b){return[a[0],b,a[2]]}function i(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addCompositePrimaryKey,e=b.addIndex;b=b.addCompositeIndex;a.add("label-association").version(d("WAWebModelStorageVersions").labelAssociationCreateTable(),[c(["labelId","associationId","type"]),e("labelId"),b(["associationId","type"])]).view(function(a){return a})}function j(){return d("WAWebModelStorageUtils").getStorage().table("label-association")}g.LabelAssociationType=b;g.createLabelAssociationPrimaryKey=a;g.getAssociationIdFromPrimaryKey=c;g.getAssociationTypeFromPrimaryKey=e;g.createLabelAssociationRowFromPrimaryKey=f;g.replaceAssociationIdInPrimaryKey=h;g.addTable=i;g.getLabelAssociationTable=j}),98); __d("WAWebUserPrefsLabelAssociationsLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").UserPrefs.LabelAssociationsLidTableMigrationComplete,!0)}function b(){return c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").UserPrefs.LabelAssociationsLidTableMigrationComplete)===!0}g.setLabelAssociationsMigrationAsComplete=a;g.isLabelAssociationsMigrationComplete=b}),98); __d("WAWebDBLabelAssociationDatabaseApi",["WAWebLidMigrationDbUtils","WAWebSchemaLabelAssociation","WAWebUserPrefsLabelAssociationsLidMigration","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()?[].concat(yield l(a),a):a;yield d("WAWebSchemaLabelAssociation").getLabelAssociationTable().bulkRemove(a)});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()?yield n(a):a;yield d("WAWebSchemaLabelAssociation").getLabelAssociationTable().bulkCreateOrReplace(a)});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaLabelAssociation").getLabelAssociationTable().anyOf(["labelId"],a));return d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()?r(a):a});return j.apply(this,arguments)}function f(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()?yield p(a):a;a=(yield d("WAWebSchemaLabelAssociation").getLabelAssociationTable().anyOf(["associationId","type"],a.map(function(a){var b=a.associationId;a=a.type;return[b,a]})));return d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()?r(a):a});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set(a.filter(function(a){return d("WAWebSchemaLabelAssociation").getAssociationTypeFromPrimaryKey(a)===d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid}).map(d("WAWebSchemaLabelAssociation").getAssociationIdFromPrimaryKey)),c=(yield d("WAWebLidMigrationDbUtils").findAccountLidsForPnChatIds(Array.from(b)));return a.map(function(a){var b=c.get(d("WAWebSchemaLabelAssociation").getAssociationIdFromPrimaryKey(a));return b==null?a:d("WAWebSchemaLabelAssociation").replaceAssociationIdInPrimaryKey(a,b)})});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey);a=(yield l(a));return a.map(d("WAWebSchemaLabelAssociation").createLabelAssociationRowFromPrimaryKey)});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){return d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey({associationId:a.associationId,type:a.type,labelId:"1"})});a=(yield l(a));return a.map(function(a){return{associationId:d("WAWebSchemaLabelAssociation").getAssociationIdFromPrimaryKey(a),type:d("WAWebSchemaLabelAssociation").getAssociationTypeFromPrimaryKey(a)}})});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set(a.filter(function(a){return a.type===d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid}).map(function(a){return a.associationId})),c=(yield d("WAWebLidMigrationDbUtils").findChatIdsForAccountLids(Array.from(b)));return a.map(function(a){var b;return babelHelpers["extends"]({},a,{associationId:(b=c.get(a.associationId))!=null?b:a.associationId})})});return s.apply(this,arguments)}g.removeLabelAssociations=a;g.addOrEditLabelAssociations=c;g.queryLabelAssociationsForLabelIds=e;g.queryLocalLabelAssociations=f}),98); __d("WAWebDBQueryAndRemoveLocalLabelAssociation",["WAWebDBLabelAssociationDatabaseApi","WAWebSchemaLabelAssociation","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebDBLabelAssociationDatabaseApi").queryLocalLabelAssociations(a));yield d("WAWebDBLabelAssociationDatabaseApi").removeLabelAssociations(a.map(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey))});return h.apply(this,arguments)}g.queryAndRemoveLocalLabelAssociation=a}),98); __d("WAWebFtsStorageUtils",["invariant","Promise","WAWebIdb","WAWebStorage","err"],(function(a,b,c,d,e,f,g,h){var i,j="fts-storage",k=null;function a(){var a=new(c("WAWebIdb"))(j);k=new(d("WAWebStorage").Storage)(a)}function e(){k!=null||h(0,56265);return k}function f(){return k==null?(i||(i=b("Promise"))).reject(c("err")("[fts-storage] Storage should be created first before being destroyed")):k.purge().then(function(){k=null})["catch"](function(a){k=null;throw a})}g.DATABASE_NAME=j;g.createStorage=a;g.getStorage=e;g.destroyStorage=f}),98); __d("WAWebFtsStorageVersions",["WAWebFtsStorageUtils"],(function(a,b,c,d,e,f,g){var h=8;function a(){return d("WAWebFtsStorageUtils").getStorage().versions.version(0)}function b(){return d("WAWebFtsStorageUtils").getStorage().versions.version(1)}function c(){return d("WAWebFtsStorageUtils").getStorage().versions.version(2)}function e(){return d("WAWebFtsStorageUtils").getStorage().versions.version(3)}function f(){return d("WAWebFtsStorageUtils").getStorage().versions.version(4)}function i(){return d("WAWebFtsStorageUtils").getStorage().versions.version(5)}function j(){return d("WAWebFtsStorageUtils").getStorage().versions.version(6)}function k(){return d("WAWebFtsStorageUtils").getStorage().versions.version(7)}function l(){return d("WAWebFtsStorageUtils").getStorage().versions.version(8)}g.versionToRollout=h;g.ftsV1IndexCreateTable=a;g.manifestCreateTable=b;g.purgeRangeQueueCreateTable=c;g.ftsV2IndexCreateTable=e;g.ftsV2TokenToPrefixesCreateTable=f;g.ftsV3IndexCreateTable=i;g.ftsV1DeleteAndDeprecate=j;g.ftsV2Delete=k;g.ftsV2DeleteTokenPrefixes=l}),98); __d("WAWebSchemaFtsPurgeRangeQueue",["WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addCompositePrimaryKey,j="fts-purge-range-queue";function a(){d("WAWebFtsStorageUtils").getStorage().add(j).version(d("WAWebFtsStorageVersions").purgeRangeQueueCreateTable(),[i(["chatId","tsOfLastMessage","startRowId","endRowId"]),h("offset")]).view(function(a){return a})}function b(){return d("WAWebFtsStorageUtils").getStorage().table(j)}g.TABLE_NAME=j;g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaFtsV1Index",["WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){b=d("WAWebStorageMutationBuilder").columnBuilder();var h=b.addColumn,i=b.addUserDefinedPrimaryKey,j=b.addArrayIndex,k="fts-v1-index";function a(){d("WAWebFtsStorageUtils").getStorage().add(k).version(d("WAWebFtsStorageVersions").ftsV1IndexCreateTable(),[i("token"),h("ids"),j("ids"),h("prefixes"),j("prefixes")])["delete"](d("WAWebFtsStorageVersions").ftsV1DeleteAndDeprecate())}g.deprecateTable=a}),98); __d("WAWebSchemaFtsV2Index",["WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){b=d("WAWebStorageMutationBuilder").columnBuilder();var h=b.addColumn,i=b.addCompositePrimaryKey,j=b.addIndex,k=b.addCompositeIndex,l="fts-v2-index";function a(){d("WAWebFtsStorageUtils").getStorage().add(l).version(d("WAWebFtsStorageVersions").ftsV2IndexCreateTable(),[i(["id","chatId","token"]),j("id"),j("chatId"),j("token"),k(["chatId","token"]),h("timestamp"),k(["id","token"])])["delete"](d("WAWebFtsStorageVersions").ftsV2Delete())}g.addTable=a}),98); __d("WAWebSchemaFtsV2TokenPrefixes",["WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){var h="fts-v2-token-prefixes";b=d("WAWebStorageMutationBuilder").columnBuilder();var i=b.addColumn,j=b.addUserDefinedPrimaryKey,k=b.addArrayIndex;function a(){d("WAWebFtsStorageUtils").getStorage().add(h).version(d("WAWebFtsStorageVersions").ftsV2TokenToPrefixesCreateTable(),[j("token"),i("prefixes"),k("prefixes")])["delete"](d("WAWebFtsStorageVersions").ftsV2DeleteTokenPrefixes())}g.addTable=a}),98); __d("WAFtsV3IndexEntry",[],(function(a,b,c,d,e,f){"use strict";function a(a,b,c,d){return{id:a,chatId:b,timestamp:c,prefixes:d}}function b(a,b,c,d,e){return{ftsRowId:a,id:b,chatId:c,timestamp:d,prefixes:e}}f.buildEntry=a;f.buildDBEntry=b}),66); __d("WAWebSchemaFtsV3Index",["WAFtsV3IndexEntry","WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey,j=c.addIndex,k=c.addArrayIndex,l="fts-v3-index";function a(){d("WAWebFtsStorageUtils").getStorage().add(l).version(d("WAWebFtsStorageVersions").ftsV3IndexCreateTable(),[i("ftsRowId"),h("id"),j("id"),h("chatId"),j("chatId"),h("timestamp"),h("prefixes"),k("prefixes")]).view(function(a){return a?d("WAFtsV3IndexEntry").buildDBEntry(a.ftsRowId,a.id,a.chatId,a.timestamp,a.prefixes):null})}function b(){return d("WAWebFtsStorageUtils").getStorage().table(l)}g.TABLE_NAME=l;g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaManifest",["WAWebFtsStorageUtils","WAWebFtsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){var h="manifest";c=Object.freeze({PREV_VERSION:"prev.version",CURR_VERSION:"curr.version",NEXT_VERSION:"next.version"});e=d("WAWebStorageMutationBuilder").columnBuilder();var i=e.addColumn,j=e.addUserDefinedPrimaryKey;function a(){d("WAWebFtsStorageUtils").getStorage().add(h).version(d("WAWebFtsStorageVersions").manifestCreateTable(),[j("key"),i("tokenizerVersion"),i("schemaVersion"),i("isCurrent"),i("lastMsgKeyViaFullIndexer"),i("isFullIndexingComplete")]).view(function(a){return a||null})}function b(){return d("WAWebFtsStorageUtils").getStorage().table(h)}g.TABLE_NAME=h;g.ManifestKeys=c;g.addTable=a;g.getTable=b}),98); __d("WAWebFtsStorage",["WALogger","WAWeb-dexie","WAWebDbRolloutUtil","WAWebDexieCastTypes","WAWebFtsStorageUtils","WAWebSchemaFtsPurgeRangeQueue","WAWebSchemaFtsV1Index","WAWebSchemaFtsV2Index","WAWebSchemaFtsV2TokenPrefixes","WAWebSchemaFtsV3Index","WAWebSchemaManifest","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);h=function(){return a};return a}var i;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){i==null&&(yield d("WAWebDbRolloutUtil").loadSchemaVersions(),d("WAWebFtsStorageUtils").createStorage(),d("WAWebSchemaManifest").addTable(),d("WAWebSchemaFtsV1Index").deprecateTable(),d("WAWebSchemaFtsV2Index").addTable(),d("WAWebSchemaFtsV2TokenPrefixes").addTable(),d("WAWebSchemaFtsPurgeRangeQueue").addTable(),d("WAWebSchemaFtsV3Index").addTable(),i=d("WAWebFtsStorageUtils").getStorage().initialize()["catch"](function(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("Failed to initialize fts storage",{sendLogsType:d("WALogger").SendLogsType.EXTREMELY_BAD_USER_EXPERIENCE_SAD});throw a}));return i});return j.apply(this,arguments)}function e(){return d("WAWebFtsStorageUtils").destroyStorage()["catch"](function(){return d("WAWebDexieCastTypes").dexieCastToPromise(new(c("WAWeb-dexie"))(d("WAWebFtsStorageUtils").DATABASE_NAME)["delete"]())})["finally"](function(){i=null;return d("WAWebDexieCastTypes").dexieCastToPromise(new(c("WAWeb-dexie"))("fts-storage-dogfooding")["delete"]())})}function f(){i=null}g.getManifestTable=d("WAWebSchemaManifest").getTable;g.getPurgeRangeQueueTable=d("WAWebSchemaFtsPurgeRangeQueue").getTable;g.getIndexV3Table=d("WAWebSchemaFtsV3Index").getTable;g.initialize=a;g.destroy=e;g.clearInitializePromise=f}),98); __d("WAWebSchemaFtsIndexingQueue",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config);b=b.addUserDefinedPrimaryKey;a.add("fts-indexing-queue").version(d("WAWebModelStorageVersions").ftsIndexingQueueCreateTable(),[b("id")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("fts-indexing-queue")}g.addTable=a;g.getFtsIndexingQueueTable=b}),98); __d("WAWebFtsLightClient",["Promise","WAWebFtsStorage","WAWebRuntimeEnvironmentUtils","WAWebSchemaFtsIndexingQueue","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=null;function j(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(i!=null)return i;i=(yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("getFtsClientInstance"));return i});return k.apply(this,arguments)}function a(a){return d("WAWebSchemaFtsIndexingQueue").getFtsIndexingQueueTable().bulkCreateOrReplace(a.map(function(a){return{id:a}}))}function c(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(d("WAWebRuntimeEnvironmentUtils").isWorker())return d("WAWebFtsStorage").getIndexV3Table().bulkRemoveByIndex(["id"],a);b=(b=i)!=null?b:yield j();yield b.purge(a)});return l.apply(this,arguments)}function e(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;if(d("WAWebRuntimeEnvironmentUtils").isWorker())return(h||(h=b("Promise"))).resolve();a=(a=i)!=null?a:yield j();yield a.index()});return m.apply(this,arguments)}f={purge:c,index:e,addToIndexingTable:a};g.ftsLightClient=f}),98); __d("WAWebMessageAssociationGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("message_association_infra_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("futureproof_associated_child_enabled")}g.isMessageAssociationInfraEnabled=a;g.isFutureproofAssociatedChildEnabled=b}),98); __d("WAWebAccountLinkingSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("account-linking").version(d("WAWebModelStorageVersions").accountLinkingCreateTable(),[b("accountLinkKey"),c("linkState"),c("linkTimestamp")])}function b(){return d("WAWebModelStorageUtils").getStorage().table("account-linking")}g.addTable=a;g.getTable=b}),98); __d("WAWebPremiumMessageSchema",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addUserDefinedPrimaryKey;function a(){d("WAWebModelStorageUtils").getStorage().add("premium-message").version(d("WAWebModelStorageVersions").premiumMessageCreateTable(),[i("id"),h("name"),h("type"),h("message"),h("isDeleted"),h("mediaId"),h("sentMessageIds")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("premium-message")}g.addTable=a;g.getPremiumMessageTable=b}),98); __d("WAWebSchemaACSTokens",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){"use strict";function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addIndex;b=b.addUserDefinedPrimaryKey;a.add("acs-tokens").version(d("WAWebModelStorageVersions").acsTokenCreateTable(),[b("tokenName"),c("project"),e("project"),c("creationTs"),c("redeemCount"),c("token")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("acs-tokens")}g.addTable=a;g.getACSTokensTable=b}),98); __d("WAWebSchemaAbPropConfig",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("abpropConfigs").version(d("WAWebModelStorageVersions").abpropsConfigCreateTable(),[b("configCode"),c("configValue"),c("configExpoKey"),c("overriddenConfigValue")]).version(d("WAWebModelStorageVersions").addHasAccessedToAbpropsConfigTable(),[c("hasAccessed")]).view(function(a){return{configCode:a.configCode,configValue:a.configValue,configExpoKey:a.configExpoKey,hasAccessed:a.hasAccessed,overriddenConfigValue:a.overriddenConfigValue}})}function b(){return d("WAWebModelStorageUtils").getStorage().table("abpropConfigs")}g.addTable=a;g.getAbpropConfigsTable=b}),98); __d("WAWebSchemaAbPropEventSamplingConfig",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("abprop-event-sampling-configs").version(d("WAWebModelStorageVersions").abpropEventSamplingConfigCreateTable(),[b("eventCode"),c("samplingWeight")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("abprop-event-sampling-configs")}g.addTable=a;g.getAbpropEventSamplingConfigsTable=b}),98); __d("WAWebSchemaActiveMessageRanges",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=Object.freeze({Unknown:"unknown",Archive:"archive",MarkChatAsRead:"markChatAsRead",ClearChatKeepStarredKeepMedia:"clearChat_0_0",ClearChatKeepStarredDeleteMedia:"clearChat_0_1",ClearChatDeleteStarredKeepMedia:"clearChat_1_0",ClearChatDeleteStarredDeleteMedia:"clearChat_1_1",DeleteChatDeleteMedia:"deleteChat_1",DeleteChatKeepMedia:"deleteChat_0"});function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add("active-message-ranges").version(d("WAWebModelStorageVersions").activeMessageRangesCreateTable(),[e(["chatId","action"]),b("chatId"),c("actionValue"),c("remainingMessages")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("active-message-ranges")}g.ActiveRangeAction=c;g.addTable=a;g.getActiveMessageRangesTable=b}),98); __d("WAWebSchemaAgent",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("agent").version(d("WAWebModelStorageVersions").agentCreateTable(),[b("id"),c("deviceId"),c("name"),c("isDeleted")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("agent")}g.addTable=a;g.getAgentTable=b}),98); __d("WAWebSchemaBlocklist",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config);b=b.addUserDefinedPrimaryKey;a.add("blocklist").version(d("WAWebModelStorageVersions").blocklistCreateTable(),[b("id")]).view(function(a){return{id:a.id}})}function b(){return d("WAWebModelStorageUtils").getStorage().table("blocklist")}g.addTable=a;g.getBlocklistTable=b}),98); __d("WAWebSchemaBotProfile",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("bot-profile").version(d("WAWebModelStorageVersions").botProfileCreateTable(),[b("id"),c("name"),c("attrs"),c("description"),c("category"),c("isDefault"),c("prompts"),c("personaId"),c("commands"),c("commandsDescription"),c("isMetaCreated"),c("creatorName"),c("creatorProfileUrl"),c("lastUpdateTs")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("bot-profile")}g.addTable=a;g.getBotProfileTable=b}),98); __d("WAWebSchemaCTWASuggestion",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("ctwa-suggestion").version(d("WAWebModelStorageVersions").ctwaSuggestionsCreateTable(),[e("id"),c("type"),c("expiresAt"),b("expiresAt"),c("heading"),c("body"),c("highlight"),c("actionLink"),c("display"),c("ts")]).version(d("WAWebModelStorageVersions").ctwaSuggestionsAddTrackingData(),[c("nuxData"),c("coolOffData")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("ctwa-suggestion")}g.addTable=a;g.getCTWASuggestionTable=b}),98); __d("WAWebSchemaCart",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("cart").version(d("WAWebModelStorageVersions").cartCreateTable(),[b("id"),c("products"),c("message"),c("total"),c("currency"),c("itemCount")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("cart")}g.addTable=a;g.getCartTable=b}),98); __d("WAWebSchemaChatAssignment",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){var h="chat-assignment";function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add(h).version(d("WAWebModelStorageVersions").chatAssignmentCreateTable(),[b("id"),c("chatId"),c("agentId"),c("chatOpenedByAgent")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table(h)}g.addTable=a;g.getChatAssignmentTable=b}),98); __d("WAWebSchemaCollectionVersion",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("collection-version").version(d("WAWebModelStorageVersions").collectionVersionCreateTable(),[b("collection"),c("version"),c("state"),c("finiteFailureStartTime"),c("ltHash"),c("isCollectionInMacMismatchFatal")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("collection-version")}g.addTable=a;g.getCollectionVersionTable=b}),98); __d("WAWebSchemaDeviceList",["WAWebModelStorageUtils","WAWebModelStorageVersions"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage();a.add_OPTIMIZED_EXPERIMENT("device-list",function(a,b){var c=b.addColumn;b=b.addUserDefinedPrimaryKey;return a.version(d("WAWebModelStorageVersions").deviceListCreateTable(),[b("id"),c("devices"),c("rawId"),c("timestamp"),c("validIndexes"),c("currentIndex")]).version(d("WAWebModelStorageVersions").deviceListAddDelete(),[c("deleted"),c("deletedChangedToHost")]).version(d("WAWebModelStorageVersions").deviceListAddV2Fields(),[c("expectedTs"),c("expectedTsLastDeviceJobTs"),c("expectedTsUpdateTs"),c("advAccountType")]).view(function(a){return a}).commit()})}function b(){return d("WAWebModelStorageUtils").getStorage().table("device-list")}g.addTable=a;g.getDeviceListTable=b}),98); __d("WAWebSchemaDirectConnectionKeys",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("direct-connection-keys").version(d("WAWebModelStorageVersions").directConnectionKeysCreateTable(),[b("id"),c("certificateChain"),c("cypher"),c("cypherExpirationTimestamp")]).version(d("WAWebModelStorageVersions").directConnectionKeysAddPostcodeColumns(),[c("cypherType"),c("postcode"),c("postcodeSetByUser"),c("postcodeLocationName")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("direct-connection-keys")}g.addTable=a;g.getDirectConnectionKeysTable=b}),98); __d("WAWebSchemaDownload3PDSignals",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addAutoIncrementingPrimaryKey,e=b.addColumn;b=b.addIndex;a.add("download-3pd-signals").version(d("WAWebModelStorageVersions").download3PDSignalsCreateTable(),[c("id"),e("clickId"),e("ctwa3pdConversionType"),e("ctwa3pdConversionSubtype"),e("ctwa3pdConversionMetadata"),e("timestamp"),b("timestamp")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("download-3pd-signals")}g.addTable=a;g.getDownload3PDSignalsTable=b}),98); __d("WAWebSchemaEncryptedMutations",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addAutoIncrementingPrimaryKey;a.add("encrypted-mutations").version(d("WAWebModelStorageVersions").encryptedMutationsCreateTable(),[b("id"),c("collectionName"),c("keyId"),c("indexMac"),c("operation"),c("indexAndValueCipherText")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaFavorite",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addUserDefinedPrimaryKey;b=b.addColumn;a.add("favorite").version(d("WAWebModelStorageVersions").favoriteCreateTable(),[c("id"),b("orderIndex")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("favorite")}g.addTable=a;g.getFavoriteTable=b}),98); __d("WAWebSchemaFavoriteStickers",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("favorite-stickers").version(d("WAWebModelStorageVersions").favoriteStickersCreateTable(),[b("id"),c("timestamp"),c("sticker"),c("stickerHashWithoutMeta"),c("isFavorite"),c("deviceId")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("favorite-stickers")}g.addTable=a;g.getFavoriteStickersTable=b}),98); __d("WAWebSchemaHistorySyncNotification",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage();a.add_OPTIMIZED_EXPERIMENT("history-sync-notification",function(a,b){var c=b.addColumn,e=b.addEncryptedColumn,f=b.addUserDefinedPrimaryKey,g=b.addIndex;b=b.addCompositeIndex;return a.version((a=d("WAWebModelStorageVersions")).historySyncNotificationsCreateTable(),[f("msgKey"),c("downloadOptions"),c("syncType"),e("chunkEncryptionKey",(f=d("WAWebStorageSchema")).EncryptedValueType.STRING),c("chunkOrder"),c("processed"),g("syncType"),g("chunkOrder"),g("processed"),c("isReupload"),c("historySyncStepStartedTs"),c("historySyncPayloadSize"),c("reuploadPending"),c("downloadedHistorySyncPayload")]).version(a.encryptHistorySyncDirectPath(),[e("directPath",f.EncryptedValueType.STRING)]).version(a.encryptHistorySyncFilehash(),[e("filehash",f.EncryptedValueType.STRING),e("encFilehash",f.EncryptedValueType.STRING)]).version(a.addInitialHistBootstrapInlinePayloadColumn(),[e("initialHistBootstrapInlinePayload",f.EncryptedValueType.ARRAY_BUFFER)]).version(a.addPeerDataRequestSessionIdColumn(),[c("peerDataRequestSessionId")]).version(a.addPeerDataRequestChatIdColumn(),[c("peerDataRequestChatId")]).version(a.addProgressColumn(),[c("progress")]).version(a.addProcessedAndSyncTypeCompositeIndex(),[b(["processed","syncType"]),e("encHandle",f.EncryptedValueType.STRING)]).view(function(a){return a}).useDbMsgEncKeyForEncryptedCol(!0).commit()})}function b(){return d("WAWebModelStorageUtils").getStorage().table("history-sync-notification")}g.addTable=a;g.getHistorySyncNotificationTable=b}),98); __d("WAWebSchemaInAppBanner",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("in-app-banner").version(d("WAWebModelStorageVersions").inAppBannerCreateTable(),[b("id"),c("type"),c("surfaceId"),c("title"),c("text"),c("actionText"),c("actionLink"),c("iconDescription"),c("iconLight"),c("iconDark"),c("backgroundColor"),c("highlightColor"),c("pacing"),c("ts")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaInactiveReceipt_DEPRECATED",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("inactive-receipt").version(d("WAWebModelStorageVersions").inactiveReceiptCreateTable(),[b("msgId"),c("chatId"),c("participantId")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaLabel",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){e=b("$InternalEnum")({NONE:0,UNREAD:1,GROUPS:2,FAVORITES:3,PREDEFINED:4,CUSTOM:5,COMMUNITY:6,SERVER_ASSIGNED:7});function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("label").version(d("WAWebModelStorageVersions").labelCreateTable(),[b("id"),c("name"),c("colorIndex"),c("predefinedId"),c("orderIndex"),c("isActive"),c("type"),c("isImmutable")]).view(function(a){return a})}function c(){return d("WAWebModelStorageUtils").getStorage().table("label")}g.ListType=e;g.addTable=a;g.getLabelTable=c}),98); __d("WAWebSchemaLidChatState",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("lid-chat-state").version(d("WAWebModelStorageVersions").lidChatStateCreateTable(),[b("id"),c("shareOwnPn"),c("requestedPnTimestamp")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaLidDisplayNameMapping",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("lid-display-name-mapping").version(d("WAWebModelStorageVersions").lidDisplayNameMappingCreateTable(),[b("id"),c("displayName")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaLidPnMapping",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey,f=b.addIndex;b=b.removeColumn;a.add("lid-pn-mapping").version(d("WAWebModelStorageVersions").lidPnMappingCreateTable(),[e("id"),c("phoneNumber"),f("phoneNumber"),c("createdAtTimestamp"),c("displayName")]).version(d("WAWebModelStorageVersions").lidPnMappingRemoveDisplayName(),[b("displayName")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaMediaPlaybackEvent",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){"use strict";function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addAutoIncrementingPrimaryKey;a.add("media-playback-event").version(d("WAWebModelStorageVersions").mediaPlaybackEventCreateTable(),[b("id"),c("event")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("media-playback-event")}g.addTable=a;g.getMediaPlaybackEventTable=b}),98); __d("WAWebSchemaMessageHistory",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("message-history").version(d("WAWebModelStorageVersions").messageHistoryCreateTable(),[e("msgKey"),c("parentMsgKey"),b("parentMsgKey")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaMessageInfo",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add("message-info").version(d("WAWebModelStorageVersions").messageInfoCreateTable(),[e(["msgKey","receiverUserJid"]),c("delivery"),c("read"),c("played"),c("deviceDelivered"),c("deviceNotDelivered"),b("msgKey")]).version(d("WAWebModelStorageVersions").messageInfoAddDeliveryPrivacyMode(),[c("deliveryPrivacyMode")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("message-info")}g.addTable=a;g.getMessageInfoTable=b}),98); __d("WASyncdKeyTypes",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a}function b(a){return a}function c(a){return a}function d(a){return a}f.toSyncKeyId=a;f.fromSyncKeyId=b;f.toSyncKeyData=c;f.fromSyncKeyData=d}),66); __d("WAWebSchemaMissingKeys",["WASyncdKeyTypes","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(a){var b=a.keyHex,c=a.keyId,e=a.timestamp;a=a.deviceResponses;return{keyHex:b,keyId:d("WASyncdKeyTypes").toSyncKeyId(c),timestamp:e,deviceResponses:a}}function b(a){var b=a.keyHex,c=a.keyId,e=a.timestamp;a=a.deviceResponses;return{keyHex:b,keyId:d("WASyncdKeyTypes").fromSyncKeyId(c),timestamp:e,deviceResponses:a}}function c(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("missing-keys").version(d("WAWebModelStorageVersions").missingKeysCreateTable(),[b("keyHex"),c("keyId"),c("timestamp"),c("deviceResponses")]).view(function(a){return a})}function e(){return d("WAWebModelStorageUtils").getStorage().table("missing-keys")}g.convertToMissingKeyFromRow=a;g.convertFromMissingKeyToRow=b;g.addTable=c;g.getMissingKeysTable=e}),98); __d("WAWebSchemaNewsletterMetadata",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("newsletter-metadata").version(d("WAWebModelStorageVersions").newsletterMetadataCreateTable(),[b("id"),c("creationTime"),c("name"),c("nameUpdateTime"),c("description"),c("descriptionUpdateTime"),c("handle"),c("inviteCode"),c("size"),c("verified"),c("membershipType"),c("privacy"),c("website"),c("reactionCodesSetting"),c("suspended"),c("geosuspended"),c("terminated"),c("adminCount"),c("capabilities"),c("messageDeliveryUpdates"),c("geosuspendedCountries"),c("hasProfilePictureDeletionAlerts"),c("wamoSubPlanId"),c("wamoSubStatus")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("newsletter-metadata")}g.addTable=a;g.getNewsletterMetadataTable=b}),98); __d("WAWebSchemaNewsletterMyVotes",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addCompositePrimaryKey;a.add("newsletter-my-votes").version(d("WAWebModelStorageVersions").newsletterMyVotesCreateTable(),[b(["chatJid","msgServerId"]),c("serverTimestampMs"),c("votes"),c("ack"),c("t"),c("read"),c("msgKey")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("newsletter-my-votes")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaNewsletterPollsVotes",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("newsletter-polls-votes").version(d("WAWebModelStorageVersions").newsletterPollsVotesCreateTable(),[b("parentMsgKey"),c("serverTimestamp"),c("votesMap")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("newsletter-polls-votes")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaNewsletterReactions",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("newsletter-reactions").version(d("WAWebModelStorageVersions").newsletterReactionsCreateTable(),[b("parentMsgKey"),c("emojiCountMap"),c("serverTimestamp")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("newsletter-reactions")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaNonMessageDataRequest",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){e=b("$InternalEnum").Mirrored(["SEND_REQUEST","MEDIA_UPLOAD"]);function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("non-message-data-request").version(d("WAWebModelStorageVersions").nonMessageDataRequestCreateTable(),[b("id"),c("fileKey"),c("requestType"),c("operationType"),c("lastRequestTimeStampSec"),c("requestRetryCount"),c("responseError"),c("lastMediaUploadTimeStampSec"),c("lastMediaUploadSuccess"),c("mediaUploadFailureCount")]).view(function(a){return a})}function c(){return d("WAWebModelStorageUtils").getStorage().table("non-message-data-request")}g.DataRequestUploadOperationType=e;g.addTable=a;g.getNonMessageDataRequestTable=c}),98); __d("WAWebSchemaNote",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){"use strict";function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("note").version(d("WAWebModelStorageVersions").noteCreateTable(),[e("id"),c("type"),b("type"),c("chatJid"),b("chatJid"),c("content"),c("createdAt"),c("modifiedAt")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("note")}g.addTable=a;g.getNoteTable=b}),98); __d("WAWebSchemaOptOutList",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config);b=b.addUserDefinedPrimaryKey;a.add("optoutlist").version(d("WAWebModelStorageVersions").optOutListCreateTable(),[b("id")]).view(function(a){return{id:a.id}})}function b(){return d("WAWebModelStorageUtils").getStorage().table("optoutlist")}g.addTable=a;g.getOptOutListTable=b}),98); __d("WAWebSchemaOrphanPaymentNotification",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("orphan-payment-notification").version(d("WAWebModelStorageVersions").orphanPaymentNotificationCreateTable(),[b("msgKey"),c("receiver"),c("currency"),c("amount1000"),c("type"),c("status"),c("ts")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("orphan-payment-notification")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaOrphanReceipt",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("orphan-receipt").version(d("WAWebModelStorageVersions").orphanReceiptCreateTable(),[b("msgKey"),c("delivery"),c("read"),c("played")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("orphan-receipt")}g.addTable=a;g.getOrphanReceiptTable=b}),98); __d("WAWebSchemaOrphanRevoke",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("orphan-revoke").version(d("WAWebModelStorageVersions").orphanRevokeCreateTable(),[b("msgKey"),c("sender"),c("timestamp"),c("subtype")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("orphan-revoke")}g.addTable=a;g.getOrphanRevokeTable=b}),98); __d("WAWebSchemaOrphanTcToken",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addEncryptedColumn;b=b.addUserDefinedPrimaryKey;a.add("orphan-tc-token").version(d("WAWebModelStorageVersions").orphanTcTokenCreateTable(),[b("chatId"),e("tcToken",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("tcTokenTimestamp")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("orphan-tc-token")}g.addTable=a;g.getOrphanTcTokenTable=b}),98); __d("WAWebSchemaPeerMessage",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("peer-message").version(d("WAWebModelStorageVersions").peerMessageCreateTable(),[b("id"),c("to"),c("type"),c("subtype"),c("appStateSyncKeyShare"),c("appStateSyncKeyRequest"),c("appStateFatalExceptionNotification"),c("peerDataOperationRequestMessage"),c("peerDataOperationRequestResponseMessage")]).version(d("WAWebModelStorageVersions").paymentBackgroundsRemovedTablePlaceholder(),[]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("peer-message")}g.addTable=a;g.getPeerMessageTable=b}),98); __d("WAWebSchemaPendingMutations",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(a){var b=a.id,c=a.collection,d=a.index,e=a.binarySyncAction,f=a.version,g=a.operation,h=a.timestamp;a=a.action;return{id:b,collection:c,index:d,binarySyncAction:e,version:f,operation:g,timestamp:h,action:a}}function b(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addAutoIncrementingPrimaryKey;b=b.addIndex;a.add("pending-mutations").version(d("WAWebModelStorageVersions").pendingMutationsCreateTable(),[e("id"),c("collection"),c("index"),b("index"),c("timestamp"),b("collection"),c("version"),c("operation"),c("binarySyncAction")]).version(d("WAWebModelStorageVersions").addActionToPendingMutations(),[c("action"),b("action")]).view(function(a){return a})}function c(){return d("WAWebModelStorageUtils").getStorage().table("pending-mutations")}g.convertToPendingMutationFromRow=a;g.addTable=b;g.getPendingMutationsTable=c}),98); __d("WAWebSchemaPrivacyDisallowedList",["$InternalEnum","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){e=b("$InternalEnum")({About:"status",GroupAdd:"groupadd",LastSeen:"last",ProfilePicture:"profile"});function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("privacy-disallowed-list").version(d("WAWebModelStorageVersions").privacyDisallowedListCreateTable(),[b("id"),c("disallowedList")]).version(d("WAWebModelStorageVersions").privacyDisallowedListAddDhashField(),[c("dhash")]).view(function(a){return{id:a.id,disallowedList:a.disallowedList,dhash:a.dhash}})}function c(){return d("WAWebModelStorageUtils").getStorage().table("privacy-disallowed-list")}g.PrivacyDisallowedListType=e;g.addTable=a;g.getPrivacyDisallowedListTable=c}),98); __d("WAWebSchemaProfilePicThumb",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("profile-pic-thumb").version(d("WAWebModelStorageVersions").profilePicThumbCreateTable(),[b("id"),c("tag"),c("eurl"),c("previewEurl"),c("timestamp"),c("previewDirectPath"),c("fullDirectPath"),c("filehash")]).view(function(a){return{id:a.id,tag:a.tag,eurl:a.eurl,previewEurl:a.previewEurl,timestamp:a.timestamp,previewDirectPath:a.previewDirectPath,fullDirectPath:a.fullDirectPath,filehash:a.filehash}})}function b(){return d("WAWebModelStorageUtils").getStorage().table("profile-pic-thumb")}g.addTable=a;g.getProfilePicThumbTable=b}),98); __d("WAWebSchemaQuickPromotions",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("quick-promotions").version(d("WAWebModelStorageVersions").quickPromotionsCreateTable(),[e("id"),c("surfaceId"),b("surfaceId"),c("ts"),c("data"),c("tracking"),c("locale")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("quick-promotions")}g.addTable=a;g.getQuickPromotionsTable=b}),98); __d("WAWebSchemaQuickReply",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("quick-reply").version(d("WAWebModelStorageVersions").quickReplyCreateTable(),[b("id"),c("shortcut"),c("message"),c("count"),c("keywords")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("quick-reply")}g.addTable=a;g.getQuickReplyTable=b}),98); __d("WAWebSchemaRecentStickers",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("recent-stickers").version(d("WAWebModelStorageVersions").recentStickersCreateTable(),[b("id"),c("timestamp"),c("sticker"),c("msgId"),c("weight"),c("isNewSticker")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("recent-stickers")}g.addTable=a;g.getRecentStickersTable=b}),98); __d("WAWebSchemaReportingInfo",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositeIndex,f=b.addIndex,g=b.addAutoIncrementingPrimaryKey;b=b.addEncryptedColumn;a.add("reporting-info").version(d("WAWebModelStorageVersions").reportingInfoTable(),[g("id"),c("msgKey"),c("stanzaId"),c("reportingTag"),c("reportingToken"),b("reportingTokenContentOpaqueData",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("version"),c("msgTs"),c("receivedTs"),c("reportingTokenKey"),e(["msgKey","msgTs"]),f("receivedTs")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("reporting-info")}g.addTable=a;g.getReportingInfoTable=b}),98); __d("WAWebSchemaReportingToken",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addIndex;b=b.addUserDefinedPrimaryKey;a.add("reporting-token").version(d("WAWebModelStorageVersions").reportingTokenTable(),[b("id"),c("reportingTag"),c("reportingTokenContent"),c("version")]).version(d("WAWebModelStorageVersions").reportingTokenTableTsIndex(),[c("ts"),e("ts")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("reporting-token")}g.addTable=a;g.getReportingTokenTable=b}),98); __d("WAWebSchemaStickerDownload",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("sticker-download").version(d("WAWebModelStorageVersions").stickerDownloadCreateTable(),[b("id"),c("timestamp")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("sticker-download")}g.addTable=a;g.getStickerDownloadTable=b}),98); __d("WAWebSchemaSubgroupSuggestion",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("subgroup-suggestion").version(d("WAWebModelStorageVersions").subgroupSuggestionCreateTable(),[e("id"),c("parentGroupId"),b("parentGroupId"),c("subject"),c("desc"),c("owner"),c("t")]).view(function(a){return a})}g.addTable=a}),98); __d("WAWebSchemaSubgroupSuggestionV2",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addCompositePrimaryKey;b=b.addIndex;a.add("subgroup-suggestion-v2").version(d("WAWebModelStorageVersions").subgroupSuggestionV2CreateTable(),[e(["parentGroupId","id","owner"]),b("parentGroupId"),c("subject"),c("desc"),c("t"),c("isExistingGroup"),c("participantCount"),c("hiddenSubgroup")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("subgroup-suggestion-v2")}g.addTable=a;g.getSubgroupSuggestionTable=b}),98); __d("WAWebSchemaSubscription",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("subscription").version(d("WAWebModelStorageVersions").subscriptionCreateTable(),[b("id"),c("isDeactivated"),c("isAutoRenewing"),c("expirationDate")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("subscription")}g.addTable=a;g.getSubscriptionTable=b}),98); __d("WAServerSync.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({SET:0,REMOVE:1});c={};e={};f={};b={};var h={},i={},j={},k={},l={},m={},n={};c.internalSpec={version:[1,(d=d("WAProtoConst")).TYPES.UINT64]};e.internalSpec={code:[1,d.TYPES.UINT64],text:[2,d.TYPES.STRING]};f.internalSpec={blob:[1,d.TYPES.BYTES]};b.internalSpec={blob:[1,d.TYPES.BYTES]};h.internalSpec={id:[1,d.TYPES.BYTES]};i.internalSpec={index:[1,d.TYPES.MESSAGE,f],value:[2,d.TYPES.MESSAGE,b],keyId:[3,d.TYPES.MESSAGE,h]};j.internalSpec={mediaKey:[1,d.TYPES.BYTES],directPath:[2,d.TYPES.STRING],handle:[3,d.TYPES.STRING],fileSizeBytes:[4,d.TYPES.UINT64],fileSha256:[5,d.TYPES.BYTES],fileEncSha256:[6,d.TYPES.BYTES]};k.internalSpec={version:[1,d.TYPES.MESSAGE,c],records:[2,d.FLAGS.REPEATED|d.TYPES.MESSAGE,i],mac:[3,d.TYPES.BYTES],keyId:[4,d.TYPES.MESSAGE,h]};l.internalSpec={mutations:[1,d.FLAGS.REPEATED|d.TYPES.MESSAGE,m]};m.internalSpec={operation:[1,d.TYPES.ENUM,a],record:[2,d.TYPES.MESSAGE,i]};n.internalSpec={version:[1,d.TYPES.MESSAGE,c],mutations:[2,d.FLAGS.REPEATED|d.TYPES.MESSAGE,m],externalMutations:[3,d.TYPES.MESSAGE,j],snapshotMac:[4,d.TYPES.BYTES],patchMac:[5,d.TYPES.BYTES],keyId:[6,d.TYPES.MESSAGE,h],exitCode:[7,d.TYPES.MESSAGE,e],deviceIndex:[8,d.TYPES.UINT32],clientDebugData:[9,d.TYPES.BYTES]};g.SyncdMutation$SyncdOperation=a;g.SyncdVersionSpec=c;g.ExitCodeSpec=e;g.SyncdIndexSpec=f;g.SyncdValueSpec=b;g.KeyIdSpec=h;g.SyncdRecordSpec=i;g.ExternalBlobReferenceSpec=j;g.SyncdSnapshotSpec=k;g.SyncdMutationsSpec=l;g.SyncdMutationSpec=m;g.SyncdPatchSpec=n}),98); __d("WAProtobufsUserPassword.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NONE:0,PBKDF2_HMAC_SHA512:1,PBKDF2_HMAC_SHA384:2});c=b("$InternalEnum")({UTF8:0,UTF8_BROKEN:1});e={};f={};b={};e.internalSpec={encoding:[1,(d=d("WAProtoConst")).TYPES.ENUM,c],transformer:[2,d.TYPES.ENUM,a],transformerArg:[3,d.FLAGS.REPEATED|d.TYPES.MESSAGE,f],transformedData:[4,d.TYPES.BYTES]};f.internalSpec={key:[1,d.TYPES.STRING],value:[2,d.TYPES.MESSAGE,b]};b.internalSpec={asBlob:[1,d.TYPES.BYTES],asUnsignedInteger:[2,d.TYPES.UINT32],__oneofs__:{value:["asBlob","asUnsignedInteger"]}};g.UserPassword$Transformer=a;g.UserPassword$Encoding=c;g.UserPasswordSpec=e;g.UserPassword$TransformerArgSpec=f;g.UserPassword$TransformerArg$ValueSpec=b}),98); __d("WAProtobufsChatLockSettings.pb",["WAProtoConst","WAProtobufsUserPassword.pb"],(function(a,b,c,d,e,f,g){a={};a.internalSpec={hideLockedChats:[1,d("WAProtoConst").TYPES.BOOL],secretCode:[2,d("WAProtoConst").TYPES.MESSAGE,d("WAProtobufsUserPassword.pb").UserPasswordSpec]};g.ChatLockSettingsSpec=a}),98); __d("WAProtobufsDeviceCapabilities.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NONE:0,MINIMAL:1,FULL:2});c={};e={};c.internalSpec={chatLockSupportLevel:[1,d("WAProtoConst").TYPES.ENUM,a],lidMigration:[2,d("WAProtoConst").TYPES.MESSAGE,e]};e.internalSpec={chatDbMigrationTimestamp:[1,d("WAProtoConst").TYPES.UINT64]};g.DeviceCapabilities$ChatLockSupportLevel=a;g.DeviceCapabilitiesSpec=c;g.DeviceCapabilities$LIDMigrationSpec=e}),98); __d("WAProtocol.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({UNKNOWN:0,CHAT_SETTING:1,BIZ_SUPPORTS_FB_HOSTING:2,UNKNOWN_GROUP:3});c={};e={};c.internalSpec={remoteJid:[1,(f=d("WAProtoConst")).TYPES.STRING],fromMe:[2,f.TYPES.BOOL],id:[3,f.TYPES.STRING],participant:[4,f.TYPES.STRING]};e.internalDefaults={trigger:a.UNKNOWN};e.internalSpec={sharingLimited:[1,f.TYPES.BOOL],trigger:[2,f.TYPES.ENUM,a],limitSharingSettingTimestamp:[3,f.TYPES.INT64],initiatedByMe:[4,f.TYPES.BOOL]};g.LimitSharing$Trigger=a;g.MessageKeySpec=c;g.LimitSharingSpec=e}),98); __d("WASyncAction.pb",["$InternalEnum","WAProtoConst","WAProtobufsChatLockSettings.pb","WAProtobufsDeviceCapabilities.pb","WAProtocol.pb"],(function(a,b,c,d,e,f,g){var h;c=(a=b("$InternalEnum"))({REGULAR:0,SCHEDULED_CALL:1,VOICE_CHAT:2});e=a({NONE:0,SCHEDULED:1,PRIVACY:2,LIGHTWEIGHT:3});f=a({CONNECTED:0,REJECTED:1,CANCELLED:2,ACCEPTEDELSEWHERE:3,MISSED:4,INVALID:5,UNAVAILABLE:6,UPCOMING:7,FAILED:8,ABANDONED:9,ONGOING:10});b=a({DEFAULT_ALL_MESSAGES:0,ALL_MESSAGES:1,HIGHLIGHTS:2,DEFAULT_HIGHLIGHTS:3});var aa=a({ACTIVE:0}),ba=a({ACTIVE:0,INACTIVE:1}),ca=a({UNSTRUCTURED:1,STRUCTURED:2}),da=a({ALLOW_LIST:0,DENY_LIST:1,CONTACTS:2}),ea=a({PERSONALIZED:0}),fa=a({LID:1,PN:2}),ga=a({NONE:0,UNREAD:1,GROUPS:2,FAVORITES:3,PREDEFINED:4,CUSTOM:5,COMMUNITY:6,SERVER_ASSIGNED:7});a=a({ANDROID:0,SMBA:1,IPHONE:2,SMBI:3,WEB:4,UWP:5,DARWIN:6,IPAD:7,WEAROS:8});var i={},j={},k={},l={},m={},n={},o={},p={},q={},r={},s={},t={},u={},v={},w={},x={},y={},z={},A={},B={},C={},D={},E={},F={},G={},H={},I={},J={},K={},L={},M={},N={},O={},P={},Q={},R={},S={},T={},U={},V={},W={},X={},Y={},Z={},$={},ha={},ia={},ja={},ka={},la={},ma={},na={},oa={},pa={},qa={},ra={},sa={},ta={},ua={},va={},wa={},xa={},ya={},za={};i.internalSpec={emoji:[1,(h=d("WAProtoConst")).TYPES.STRING],weight:[2,h.TYPES.FLOAT]};j.internalSpec={callResult:[1,h.TYPES.ENUM,f],isDndMode:[2,h.TYPES.BOOL],silenceReason:[3,h.TYPES.ENUM,e],duration:[4,h.TYPES.INT64],startTime:[5,h.TYPES.INT64],isIncoming:[6,h.TYPES.BOOL],isVideo:[7,h.TYPES.BOOL],isCallLink:[8,h.TYPES.BOOL],callLinkToken:[9,h.TYPES.STRING],scheduledCallId:[10,h.TYPES.STRING],callId:[11,h.TYPES.STRING],callCreatorJid:[12,h.TYPES.STRING],groupJid:[13,h.TYPES.STRING],participants:[14,h.FLAGS.REPEATED|h.TYPES.MESSAGE,k],callType:[15,h.TYPES.ENUM,c]};k.internalSpec={userJid:[1,h.TYPES.STRING],callResult:[2,h.TYPES.ENUM,f]};l.internalSpec={timestamp:[1,h.TYPES.INT64],starAction:[2,h.TYPES.MESSAGE,xa],contactAction:[3,h.TYPES.MESSAGE,wa],muteAction:[4,h.TYPES.MESSAGE,va],pinAction:[5,h.TYPES.MESSAGE,ua],securityNotificationSetting:[6,h.TYPES.MESSAGE,ta],pushNameSetting:[7,h.TYPES.MESSAGE,sa],quickReplyAction:[8,h.TYPES.MESSAGE,qa],recentEmojiWeightsAction:[11,h.TYPES.MESSAGE,na],labelEditAction:[14,h.TYPES.MESSAGE,oa],labelAssociationAction:[15,h.TYPES.MESSAGE,pa],localeSetting:[16,h.TYPES.MESSAGE,ra],archiveChatAction:[17,h.TYPES.MESSAGE,ma],deleteMessageForMeAction:[18,h.TYPES.MESSAGE,la],keyExpiration:[19,h.TYPES.MESSAGE,Y],markChatAsReadAction:[20,h.TYPES.MESSAGE,ka],clearChatAction:[21,h.TYPES.MESSAGE,ja],deleteChatAction:[22,h.TYPES.MESSAGE,ia],unarchiveChatsSetting:[23,h.TYPES.MESSAGE,ha],primaryFeature:[24,h.TYPES.MESSAGE,X],androidUnsupportedActions:[26,h.TYPES.MESSAGE,W],agentAction:[27,h.TYPES.MESSAGE,V],subscriptionAction:[28,h.TYPES.MESSAGE,U],userStatusMuteAction:[29,h.TYPES.MESSAGE,T],timeFormatAction:[30,h.TYPES.MESSAGE,S],nuxAction:[31,h.TYPES.MESSAGE,R],primaryVersionAction:[32,h.TYPES.MESSAGE,Q],stickerAction:[33,h.TYPES.MESSAGE,O],removeRecentStickerAction:[34,h.TYPES.MESSAGE,P],chatAssignment:[35,h.TYPES.MESSAGE,N],chatAssignmentOpenedStatus:[36,h.TYPES.MESSAGE,M],pnForLidChatAction:[37,h.TYPES.MESSAGE,L],marketingMessageAction:[38,h.TYPES.MESSAGE,J],marketingMessageBroadcastAction:[39,h.TYPES.MESSAGE,I],externalWebBetaAction:[40,h.TYPES.MESSAGE,H],privacySettingRelayAllCalls:[41,h.TYPES.MESSAGE,G],callLogAction:[42,h.TYPES.MESSAGE,F],statusPrivacy:[44,h.TYPES.MESSAGE,E],botWelcomeRequestAction:[45,h.TYPES.MESSAGE,D],deleteIndividualCallLog:[46,h.TYPES.MESSAGE,C],labelReorderingAction:[47,h.TYPES.MESSAGE,B],paymentInfoAction:[48,h.TYPES.MESSAGE,A],customPaymentMethodsAction:[49,h.TYPES.MESSAGE,x],lockChatAction:[50,h.TYPES.MESSAGE,w],chatLockSettings:[51,h.TYPES.MESSAGE,d("WAProtobufsChatLockSettings.pb").ChatLockSettingsSpec],wamoUserIdentifierAction:[52,h.TYPES.MESSAGE,v],privacySettingDisableLinkPreviewsAction:[53,h.TYPES.MESSAGE,u],deviceCapabilities:[54,h.TYPES.MESSAGE,d("WAProtobufsDeviceCapabilities.pb").DeviceCapabilitiesSpec],noteEditAction:[55,h.TYPES.MESSAGE,t],favoritesAction:[56,h.TYPES.MESSAGE,r],merchantPaymentPartnerAction:[57,h.TYPES.MESSAGE,q],waffleAccountLinkStateAction:[58,h.TYPES.MESSAGE,p],usernameChatStartMode:[59,h.TYPES.MESSAGE,K],notificationActivitySettingAction:[60,h.TYPES.MESSAGE,o],lidContactAction:[61,h.TYPES.MESSAGE,n],ctwaPerCustomerDataSharingAction:[62,h.TYPES.MESSAGE,m]};m.internalSpec={isCtwaPerCustomerDataSharingEnabled:[1,h.TYPES.BOOL]};n.internalSpec={fullName:[1,h.TYPES.STRING],firstName:[2,h.TYPES.STRING],username:[3,h.TYPES.STRING],saveOnPrimaryAddressbook:[4,h.TYPES.BOOL]};o.internalSpec={notificationActivitySetting:[1,h.TYPES.ENUM,b]};p.internalSpec={linkState:[2,h.TYPES.ENUM,aa]};q.internalSpec={status:[1,h.FLAGS.REQUIRED|h.TYPES.ENUM,ba],country:[2,h.FLAGS.REQUIRED|h.TYPES.STRING],gatewayName:[3,h.TYPES.STRING],credentialId:[4,h.TYPES.STRING]};r.internalSpec={favorites:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,s]};s.internalSpec={id:[1,h.TYPES.STRING]};t.internalSpec={type:[1,h.TYPES.ENUM,ca],chatJid:[2,h.TYPES.STRING],createdAt:[3,h.TYPES.INT64],deleted:[4,h.TYPES.BOOL],unstructuredContent:[5,h.TYPES.STRING]};u.internalSpec={isPreviewsDisabled:[1,h.TYPES.BOOL]};v.internalSpec={identifier:[1,h.TYPES.STRING]};w.internalSpec={locked:[1,h.TYPES.BOOL]};x.internalSpec={customPaymentMethods:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,y]};y.internalSpec={credentialId:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],country:[2,h.FLAGS.REQUIRED|h.TYPES.STRING],type:[3,h.FLAGS.REQUIRED|h.TYPES.STRING],metadata:[4,h.FLAGS.REPEATED|h.TYPES.MESSAGE,z]};z.internalSpec={key:[1,h.FLAGS.REQUIRED|h.TYPES.STRING],value:[2,h.FLAGS.REQUIRED|h.TYPES.STRING]};A.internalSpec={cpi:[1,h.TYPES.STRING]};B.internalSpec={sortedLabelIds:[1,h.FLAGS.REPEATED|h.TYPES.INT32]};C.internalSpec={peerJid:[1,h.TYPES.STRING],isIncoming:[2,h.TYPES.BOOL]};D.internalSpec={isSent:[1,h.TYPES.BOOL]};E.internalSpec={mode:[1,h.TYPES.ENUM,da],userJid:[2,h.FLAGS.REPEATED|h.TYPES.STRING]};F.internalSpec={callLogRecord:[1,h.TYPES.MESSAGE,j]};G.internalSpec={isEnabled:[1,h.TYPES.BOOL]};H.internalSpec={isOptIn:[1,h.TYPES.BOOL]};I.internalSpec={repliedCount:[1,h.TYPES.INT32]};J.internalSpec={name:[1,h.TYPES.STRING],message:[2,h.TYPES.STRING],type:[3,h.TYPES.ENUM,ea],createdAt:[4,h.TYPES.INT64],lastSentAt:[5,h.TYPES.INT64],isDeleted:[6,h.TYPES.BOOL],mediaId:[7,h.TYPES.STRING]};K.internalSpec={chatStartMode:[1,h.TYPES.ENUM,fa]};L.internalSpec={pnJid:[1,h.TYPES.STRING]};M.internalSpec={chatOpened:[1,h.TYPES.BOOL]};N.internalSpec={deviceAgentID:[1,h.TYPES.STRING]};O.internalSpec={url:[1,h.TYPES.STRING],fileEncSha256:[2,h.TYPES.BYTES],mediaKey:[3,h.TYPES.BYTES],mimetype:[4,h.TYPES.STRING],height:[5,h.TYPES.UINT32],width:[6,h.TYPES.UINT32],directPath:[7,h.TYPES.STRING],fileLength:[8,h.TYPES.UINT64],isFavorite:[9,h.TYPES.BOOL],deviceIdHint:[10,h.TYPES.UINT32],isLottie:[11,h.TYPES.BOOL]};P.internalSpec={lastStickerSentTs:[1,h.TYPES.INT64]};Q.internalSpec={version:[1,h.TYPES.STRING]};R.internalSpec={acknowledged:[1,h.TYPES.BOOL]};S.internalSpec={isTwentyFourHourFormatEnabled:[1,h.TYPES.BOOL]};T.internalSpec={muted:[1,h.TYPES.BOOL]};U.internalSpec={isDeactivated:[1,h.TYPES.BOOL],isAutoRenewing:[2,h.TYPES.BOOL],expirationDate:[3,h.TYPES.INT64]};V.internalSpec={name:[1,h.TYPES.STRING],deviceID:[2,h.TYPES.INT32],isDeleted:[3,h.TYPES.BOOL]};W.internalSpec={allowed:[1,h.TYPES.BOOL]};X.internalSpec={flags:[1,h.FLAGS.REPEATED|h.TYPES.STRING]};Y.internalSpec={expiredKeyEpoch:[1,h.TYPES.INT32]};Z.internalSpec={key:[1,h.TYPES.MESSAGE,d("WAProtocol.pb").MessageKeySpec],timestamp:[2,h.TYPES.INT64]};$.internalSpec={lastMessageTimestamp:[1,h.TYPES.INT64],lastSystemMessageTimestamp:[2,h.TYPES.INT64],messages:[3,h.FLAGS.REPEATED|h.TYPES.MESSAGE,Z]};ha.internalSpec={unarchiveChats:[1,h.TYPES.BOOL]};ia.internalSpec={messageRange:[1,h.TYPES.MESSAGE,$]};ja.internalSpec={messageRange:[1,h.TYPES.MESSAGE,$]};ka.internalSpec={read:[1,h.TYPES.BOOL],messageRange:[2,h.TYPES.MESSAGE,$]};la.internalSpec={deleteMedia:[1,h.TYPES.BOOL],messageTimestamp:[2,h.TYPES.INT64]};ma.internalSpec={archived:[1,h.TYPES.BOOL],messageRange:[2,h.TYPES.MESSAGE,$]};na.internalSpec={weights:[1,h.FLAGS.REPEATED|h.TYPES.MESSAGE,i]};oa.internalSpec={name:[1,h.TYPES.STRING],color:[2,h.TYPES.INT32],predefinedId:[3,h.TYPES.INT32],deleted:[4,h.TYPES.BOOL],orderIndex:[5,h.TYPES.INT32],isActive:[6,h.TYPES.BOOL],type:[7,h.TYPES.ENUM,ga],isImmutable:[8,h.TYPES.BOOL]};pa.internalSpec={labeled:[1,h.TYPES.BOOL]};qa.internalSpec={shortcut:[1,h.TYPES.STRING],message:[2,h.TYPES.STRING],keywords:[3,h.FLAGS.REPEATED|h.TYPES.STRING],count:[4,h.TYPES.INT32],deleted:[5,h.TYPES.BOOL]};ra.internalSpec={locale:[1,h.TYPES.STRING]};sa.internalSpec={name:[1,h.TYPES.STRING]};ta.internalSpec={showNotification:[1,h.TYPES.BOOL]};ua.internalSpec={pinned:[1,h.TYPES.BOOL]};va.internalSpec={muted:[1,h.TYPES.BOOL],muteEndTimestamp:[2,h.TYPES.INT64],autoMuted:[3,h.TYPES.BOOL]};wa.internalSpec={fullName:[1,h.TYPES.STRING],firstName:[2,h.TYPES.STRING],lidJid:[3,h.TYPES.STRING],saveOnPrimaryAddressbook:[4,h.TYPES.BOOL],pnJid:[5,h.TYPES.STRING],username:[6,h.TYPES.STRING]};xa.internalSpec={starred:[1,h.TYPES.BOOL]};ya.internalSpec={index:[1,h.TYPES.BYTES],value:[2,h.TYPES.MESSAGE,l],padding:[3,h.TYPES.BYTES],version:[4,h.TYPES.INT32]};za.internalSpec={currentLthash:[1,h.TYPES.BYTES],newLthash:[2,h.TYPES.BYTES],patchVersion:[3,h.TYPES.BYTES],collectionName:[4,h.TYPES.BYTES],firstFourBytesFromAHashOfSnapshotMacKey:[5,h.TYPES.BYTES],newLthashSubtract:[6,h.TYPES.BYTES],numberAdd:[7,h.TYPES.INT32],numberRemove:[8,h.TYPES.INT32],numberOverride:[9,h.TYPES.INT32],senderPlatform:[10,h.TYPES.ENUM,a],isSenderPrimary:[11,h.TYPES.BOOL]};g.CallLogRecord$CallType=c;g.CallLogRecord$SilenceReason=e;g.CallLogRecord$CallResult=f;g.SyncActionValue$NotificationActivitySettingAction$NotificationActivitySetting=b;g.SyncActionValue$WaffleAccountLinkStateAction$AccountLinkState=aa;g.SyncActionValue$MerchantPaymentPartnerAction$Status=ba;g.SyncActionValue$NoteEditAction$NoteType=ca;g.SyncActionValue$StatusPrivacyAction$StatusDistributionMode=da;g.SyncActionValue$MarketingMessageAction$MarketingMessagePrototypeType=ea;g.SyncActionValue$UsernameChatStartModeAction$ChatStartMode=fa;g.SyncActionValue$LabelEditAction$ListType=ga;g.PatchDebugData$Platform=a;g.RecentEmojiWeightSpec=i;g.CallLogRecordSpec=j;g.CallLogRecord$ParticipantInfoSpec=k;g.SyncActionValueSpec=l;g.SyncActionValue$CtwaPerCustomerDataSharingActionSpec=m;g.SyncActionValue$LidContactActionSpec=n;g.SyncActionValue$NotificationActivitySettingActionSpec=o;g.SyncActionValue$WaffleAccountLinkStateActionSpec=p;g.SyncActionValue$MerchantPaymentPartnerActionSpec=q;g.SyncActionValue$FavoritesActionSpec=r;g.SyncActionValue$FavoritesAction$FavoriteSpec=s;g.SyncActionValue$NoteEditActionSpec=t;g.SyncActionValue$PrivacySettingDisableLinkPreviewsActionSpec=u;g.SyncActionValue$WamoUserIdentifierActionSpec=v;g.SyncActionValue$LockChatActionSpec=w;g.SyncActionValue$CustomPaymentMethodsActionSpec=x;g.SyncActionValue$CustomPaymentMethodSpec=y;g.SyncActionValue$CustomPaymentMethodMetadataSpec=z;g.SyncActionValue$PaymentInfoActionSpec=A;g.SyncActionValue$LabelReorderingActionSpec=B;g.SyncActionValue$DeleteIndividualCallLogActionSpec=C;g.SyncActionValue$BotWelcomeRequestActionSpec=D;g.SyncActionValue$StatusPrivacyActionSpec=E;g.SyncActionValue$CallLogActionSpec=F;g.SyncActionValue$PrivacySettingRelayAllCallsSpec=G;g.SyncActionValue$ExternalWebBetaActionSpec=H;g.SyncActionValue$MarketingMessageBroadcastActionSpec=I;g.SyncActionValue$MarketingMessageActionSpec=J;g.SyncActionValue$UsernameChatStartModeActionSpec=K;g.SyncActionValue$PnForLidChatActionSpec=L;g.SyncActionValue$ChatAssignmentOpenedStatusActionSpec=M;g.SyncActionValue$ChatAssignmentActionSpec=N;g.SyncActionValue$StickerActionSpec=O;g.SyncActionValue$RemoveRecentStickerActionSpec=P;g.SyncActionValue$PrimaryVersionActionSpec=Q;g.SyncActionValue$NuxActionSpec=R;g.SyncActionValue$TimeFormatActionSpec=S;g.SyncActionValue$UserStatusMuteActionSpec=T;g.SyncActionValue$SubscriptionActionSpec=U;g.SyncActionValue$AgentActionSpec=V;g.SyncActionValue$AndroidUnsupportedActionsSpec=W;g.SyncActionValue$PrimaryFeatureSpec=X;g.SyncActionValue$KeyExpirationSpec=Y;g.SyncActionValue$SyncActionMessageSpec=Z;g.SyncActionValue$SyncActionMessageRangeSpec=$;g.SyncActionValue$UnarchiveChatsSettingSpec=ha;g.SyncActionValue$DeleteChatActionSpec=ia;g.SyncActionValue$ClearChatActionSpec=ja;g.SyncActionValue$MarkChatAsReadActionSpec=ka;g.SyncActionValue$DeleteMessageForMeActionSpec=la;g.SyncActionValue$ArchiveChatActionSpec=ma;g.SyncActionValue$RecentEmojiWeightsActionSpec=na;g.SyncActionValue$LabelEditActionSpec=oa;g.SyncActionValue$LabelAssociationActionSpec=pa;g.SyncActionValue$QuickReplyActionSpec=qa;g.SyncActionValue$LocaleSettingSpec=ra;g.SyncActionValue$PushNameSettingSpec=sa;g.SyncActionValue$SecurityNotificationSettingSpec=ta;g.SyncActionValue$PinActionSpec=ua;g.SyncActionValue$MuteActionSpec=va;g.SyncActionValue$ContactActionSpec=wa;g.SyncActionValue$StarActionSpec=xa;g.SyncActionDataSpec=ya;g.PatchDebugDataSpec=za}),98); __d("WAWebSyncdCollectionHandlerTypesConverter",["WAServerSync.pb","WASyncAction.pb","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function h(a){a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a);return d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,{value:a}).readBuffer()}function a(a,b){return a.map(function(a){var c=h(a.binarySyncAction);return{index:a.index,action:a.action,binarySyncData:c,actionState:b,version:a.version,keyId:a.keyId,indexMac:a.indexMac,valueMac:a.valueMac,collection:a.collection,timestamp:a.timestamp}})}function b(a,b,c,d,e){return{index:a.index,binarySyncData:a.binarySyncData,version:a.version,keyId:a.keyId,indexMac:a.indexMac,valueMac:a.valueMac,collection:a.collection,timestamp:a.timestamp,action:c,actionState:b,modelId:d,modelType:e!=null?e:void 0}}function c(a){return a.map(function(a){return{collection:a.collection,index:a.index,action:a.action,indexMac:a.indexMac,keyId:a.keyId,operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,binarySyncData:a.binarySyncData,valueMac:a.valueMac,version:a.version}})}g.syncActionToSyncData=h;g.encryptedUploadMutationsToSyncActions=a;g.setMutationToSyncAction=b;g.syncActionsToDecryptedMutation=c}),98); __d("WAWebSchemaSyncActions",["WALogger","WASyncdKeyTypes","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebSyncdCollectionHandlerTypesConverter","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: binarySyncAction should not be null when binarySyncData is null"]);h=function(){return a};return a}function i(a){var b=a.index,e=a.binarySyncAction,f=a.actionState,g=a.version,i=a.keyId,j=a.modelId,k=a.modelType,l=a.indexMac,m=a.valueMac,n=a.collection,o=a.timestamp,p=a.action;a=a.binarySyncData;if(a==null){if(e==null){d("WALogger").ERROR(h()).tags("syncd").sendLogs("syncd: syncd binarySyncAction should not be null when binarySyncData is null");throw c("err")("syncd: binarySyncAction should not be null when binarySyncData is null")}a=d("WAWebSyncdCollectionHandlerTypesConverter").syncActionToSyncData(e)}return{index:b,binarySyncData:a,actionState:f,version:g,keyId:i,modelId:j,modelType:k,indexMac:l,valueMac:m,collection:n,timestamp:o,action:p}}function a(a){var b=a.keyId;return babelHelpers["extends"]({},a,{keyId:d("WASyncdKeyTypes").toSyncKeyId(b)})}function b(a){a=babelHelpers["extends"]({},a);a.keyId!=null&&(a.keyId=d("WASyncdKeyTypes").fromSyncKeyId(a.keyId));return a}function e(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addUserDefinedPrimaryKey,f=b.addIndex;b=b.addCompositeIndex;a.add("sync-actions").version(d("WAWebModelStorageVersions").syncActionsCreateTable(),[e("index"),c("keyId"),c("version"),c("actionState"),f("actionState"),c("modelId"),c("modelType"),b(["modelId","modelType","actionState"]),c("valueMac"),c("indexMac"),f("indexMac"),c("collection"),f("collection"),c("timestamp"),c("action"),f("action"),c("binarySyncAction"),c("binarySyncData")]).view(i)}function f(){return d("WAWebModelStorageUtils").getStorage().table("sync-actions")}g.convertToSyncActionFromRow=a;g.convertFromSyncActionToRow=b;g.addTable=e;g.getSyncActionsTable=f}),98); __d("WAWebSchemaSyncKeys",["WASyncdKeyTypes","WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder","WAWebStorageSchema"],(function(a,b,c,d,e,f,g){function a(a){var b=a.keyId,c=a.keyData;return babelHelpers["extends"]({},a,{keyId:d("WASyncdKeyTypes").toSyncKeyId(b.buffer),keyData:d("WASyncdKeyTypes").toSyncKeyData(c)})}function b(a){var b=a.keyId,c=a.keyData;return babelHelpers["extends"]({},a,{keyId:new Uint8Array(d("WASyncdKeyTypes").fromSyncKeyId(b)),keyData:d("WASyncdKeyTypes").fromSyncKeyData(c)})}function c(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn,e=b.addEncryptedColumn,f=b.addUserDefinedPrimaryKey;b=b.addIndex;a.add("sync-keys").version(d("WAWebModelStorageVersions").syncKeysCreateTable(),[f("keyId"),c("timestamp"),c("fingerprint"),e("keyData",d("WAWebStorageSchema").EncryptedValueType.ARRAY_BUFFER),c("keyEpoch"),b("keyEpoch")]).view(function(a){return a})}function e(){return d("WAWebModelStorageUtils").getStorage().table("sync-keys")}g.convertToSyncKeyFromRow=a;g.convertFromSyncKeyToRow=b;g.addTable=c;g.getSyncKeysTable=e}),98); __d("WAWebSchemaTasksScheduledTime",["WAWebModelStorageUtils","WAWebModelStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){function a(){var a=d("WAWebModelStorageUtils").getStorage(),b=d("WAWebStorageMutationBuilder").columnBuilder(a.config),c=b.addColumn;b=b.addUserDefinedPrimaryKey;a.add("tasks-scheduled-time").version(d("WAWebModelStorageVersions").tasksScheduledTimeCreateTable(),[b("taskName"),c("time")]).view(function(a){return a})}function b(){return d("WAWebModelStorageUtils").getStorage().table("tasks-scheduled-time")}g.addTable=a;g.getTasksScheduledTimeTable=b}),98); __d("WAWebUserPrefsDBSettings",["WAWebUserPrefsCacheStorage","WAWebUserPrefsKeys","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a!=null?yield d("WAWebUserPrefsCacheStorage").userPrefsCacheStorage.setItemToCacheStorage(d("WAWebUserPrefsKeys").MD_KEYS.COLUMN_PACKING_ENABLED,a):yield d("WAWebUserPrefsCacheStorage").userPrefsCacheStorage.removeItemFromCacheStorage(d("WAWebUserPrefsKeys").MD_KEYS.COLUMN_PACKING_ENABLED)});return h.apply(this,arguments)}function c(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsCacheStorage").userPrefsCacheStorage.getItemFromCacheStorage(d("WAWebUserPrefsKeys").MD_KEYS.COLUMN_PACKING_ENABLED));return a});return i.apply(this,arguments)}g.setColumnPackingValueToStorage=a;g.getColumnPackingValueFromStorage=c}),98); __d("WAWebStorageGatingUtils",["WALogger","WAWebModelStorageUtils","WAWebUserPrefsDBSettings","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[column-serialization] enabled from url request"]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebModelStorageUtils").storageExists());if(b){b=(yield d("WAWebUserPrefsDBSettings").getColumnPackingValueFromStorage());if(b==null){yield d("WAWebUserPrefsDBSettings").setColumnPackingValueToStorage(!1);return!1}return b}if(!c("gkx")("26258")&&URLSearchParams){b=new URLSearchParams(window.location.search);b=b.get("pack");if(b!=null){d("WALogger").LOG(h());yield d("WAWebUserPrefsDBSettings").setColumnPackingValueToStorage(b==="true"||b==="1");return!0}}yield d("WAWebUserPrefsDBSettings").setColumnPackingValueToStorage(a);return a});return i.apply(this,arguments)}g.columnPackingEnabled=a}),98); __d("WAWebModelStorageInitialize",["WALogger","WAWeb-dexie","WAWebAccountLinkingSchema","WAWebCommentSchema","WAWebDbRolloutUtil","WAWebDexieCastTypes","WAWebEventResponsesSchema","WAWebModelStorageUtils","WAWebPinInChatSchema","WAWebPollsVotesSchema","WAWebPremiumMessageSchema","WAWebSchemaACSTokens","WAWebSchemaAbPropConfig","WAWebSchemaAbPropEventSamplingConfig","WAWebSchemaActiveMessageRanges","WAWebSchemaAgent","WAWebSchemaBlocklist","WAWebSchemaBotProfile","WAWebSchemaBusinessProfile","WAWebSchemaCTWASuggestion","WAWebSchemaCart","WAWebSchemaChat","WAWebSchemaChatAssignment","WAWebSchemaChatThreadLoggingPendingEvents","WAWebSchemaCollectionVersion","WAWebSchemaContact_DEPRECATED","WAWebSchemaDeviceList","WAWebSchemaDirectConnectionKeys","WAWebSchemaDownload3PDSignals","WAWebSchemaEncryptedMutations","WAWebSchemaFavorite","WAWebSchemaFavoriteStickers","WAWebSchemaFtsIndexingQueue","WAWebSchemaGroupInviteV4","WAWebSchemaGroupMetadata","WAWebSchemaHistorySyncNotification","WAWebSchemaInAppBanner","WAWebSchemaInactiveReceipt_DEPRECATED","WAWebSchemaLabel","WAWebSchemaLabelAssociation","WAWebSchemaLidChatState","WAWebSchemaLidDisplayNameMapping","WAWebSchemaLidPnMapping","WAWebSchemaMediaPlaybackEvent","WAWebSchemaMembershipApprovalRequest","WAWebSchemaMessage","WAWebSchemaMessageAssociation","WAWebSchemaMessageHistory","WAWebSchemaMessageInfo","WAWebSchemaMessageOrphans","WAWebSchemaMissingKeys","WAWebSchemaNewsletterMetadata","WAWebSchemaNewsletterMyVotes","WAWebSchemaNewsletterPollsVotes","WAWebSchemaNewsletterReactions","WAWebSchemaNonMessageDataRequest","WAWebSchemaNote","WAWebSchemaOptOutList","WAWebSchemaOrphanPaymentNotification","WAWebSchemaOrphanReceipt","WAWebSchemaOrphanRevoke","WAWebSchemaOrphanTcToken","WAWebSchemaParticipant","WAWebSchemaPeerMessage","WAWebSchemaPendingMutations","WAWebSchemaPrivacyDisallowedList","WAWebSchemaProfilePicThumb","WAWebSchemaQuickPromotions","WAWebSchemaQuickReply","WAWebSchemaReactions","WAWebSchemaRecentStickers","WAWebSchemaReportingInfo","WAWebSchemaReportingToken","WAWebSchemaSelfAddonMessageTypeTable","WAWebSchemaStickerDownload","WAWebSchemaSubgroupSuggestion","WAWebSchemaSubgroupSuggestionV2","WAWebSchemaSubscription","WAWebSchemaSyncActions","WAWebSchemaSyncKeys","WAWebSchemaSyncdLogs","WAWebSchemaTasksScheduledTime","WAWebSchemaUnifiedAddons","WAWebSchemaUnjoinedSubgroupMetadata","WAWebSchemaUserPrefs","WAWebSchemaVerifiedBusinessName","WAWebStorage","WAWebStorageGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to initialize model storage: ",""]);h=function(){return a};return a}var i;function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(i==null){yield d("WAWebDbRolloutUtil").loadSchemaVersions();a=(yield d("WAWebStorageGatingUtils").columnPackingEnabled(!!(a==null?void 0:a.canPackColumns)));d("WAWebModelStorageUtils").createStorage({packColumns:a});d("WAWebSchemaAbPropConfig").addTable();d("WAWebSchemaAbPropEventSamplingConfig").addTable();d("WAWebSchemaActiveMessageRanges").addTable();d("WAWebSchemaAgent").addTable();d("WAWebSchemaBlocklist").addTable();d("WAWebSchemaOptOutList").addTable();d("WAWebSchemaBotProfile").addTable();d("WAWebSchemaCart").addTable();d("WAWebSchemaChat").addTable();d("WAWebSchemaChatAssignment").addTable();d("WAWebSchemaChatThreadLoggingPendingEvents").addTable();d("WAWebSchemaCollectionVersion").addTable();d("WAWebSchemaContact_DEPRECATED").addTable();d("WAWebSchemaDeviceList").addTable();d("WAWebSchemaDirectConnectionKeys").addTable();d("WAWebSchemaEncryptedMutations").addTable();d("WAWebSchemaFavorite").addTable();d("WAWebSchemaFavoriteStickers").addTable();d("WAWebSchemaFtsIndexingQueue").addTable();d("WAWebSchemaGroupInviteV4").addTable();d("WAWebSchemaGroupMetadata").addTable();d("WAWebSchemaHistorySyncNotification").addTable();d("WAWebSchemaInactiveReceipt_DEPRECATED").addTable();d("WAWebSchemaLabelAssociation").addTable();d("WAWebSchemaLabel").addTable();d("WAWebSchemaLidDisplayNameMapping").addTable();d("WAWebSchemaLidPnMapping").addTable();d("WAWebSchemaLidChatState").addTable();d("WAWebSchemaMessage").addTable();d("WAWebSchemaMessageHistory").addTable();d("WAWebSchemaMissingKeys").addTable();d("WAWebSchemaMessageInfo").addTable();d("WAWebSchemaOrphanPaymentNotification").addTable();d("WAWebSchemaOrphanReceipt").addTable();d("WAWebSchemaOrphanRevoke").addTable();d("WAWebSchemaOrphanTcToken").addTable();d("WAWebSchemaParticipant").addTable();d("WAWebSchemaPeerMessage").addTable();d("WAWebSchemaPendingMutations").addTable();d("WAWebPollsVotesSchema").addTable();d("WAWebSchemaPrivacyDisallowedList").addTable();d("WAWebSchemaProfilePicThumb").addTable();d("WAWebSchemaQuickReply").addTable();d("WAWebSchemaReactions").addTable();d("WAWebSchemaRecentStickers").addTable();d("WAWebSchemaSubscription").addTable();d("WAWebSchemaSyncActions").addTable();d("WAWebSchemaSyncKeys").addTable();d("WAWebSchemaTasksScheduledTime").addTable();d("WAWebSchemaUnjoinedSubgroupMetadata").addTable();d("WAWebSchemaUserPrefs").addTable();d("WAWebSchemaVerifiedBusinessName").addTable();d("WAWebSchemaMessageOrphans").addTable();d("WAWebSchemaMembershipApprovalRequest").addTable();d("WAWebSchemaNonMessageDataRequest").addTable();d("WAWebSchemaCTWASuggestion").addTable();d("WAWebPinInChatSchema").addTable();d("WAWebSchemaInAppBanner").addTable();d("WAWebSchemaNewsletterMetadata").addTable();d("WAWebPremiumMessageSchema").addTable();d("WAWebSchemaQuickPromotions").addTable();d("WAWebSchemaSubgroupSuggestion").addTable();d("WAWebSchemaNewsletterReactions").addTable();d("WAWebSchemaSelfAddonMessageTypeTable").addTable();d("WAWebSchemaSubgroupSuggestionV2").addTable();d("WAWebSchemaSyncdLogs").addTable();d("WAWebCommentSchema").addTable();d("WAWebSchemaBusinessProfile").addTable();d("WAWebSchemaNewsletterMyVotes").addTable();d("WAWebSchemaNewsletterPollsVotes").addTable();d("WAWebSchemaReportingToken").addTable();d("WAWebEventResponsesSchema").addTable();d("WAWebSchemaNote").addTable();d("WAWebSchemaUnifiedAddons").addTable();d("WAWebSchemaReportingInfo").addTable();d("WAWebSchemaMessageAssociation").addTable();d("WAWebSchemaStickerDownload").addTable();d("WAWebSchemaACSTokens").addTable();d("WAWebSchemaMediaPlaybackEvent").addTable();d("WAWebSchemaDownload3PDSignals").addTable();d("WAWebAccountLinkingSchema").addTable();i=d("WAWebModelStorageUtils").getStorage().initialize()["catch"](function(a){var b="Unknown error";a instanceof d("WAWebStorage").AlreadyInitializedError||a instanceof d("WAWebStorage").NoSuchDatabaseError?b=a.toString():a instanceof c("WAWeb-dexie").DexieError&&(b="Unknown DexieError");d("WALogger").ERROR(h(),b).verbose().devConsole(a).sendLogs("failed-to-initialize-model-storage",{sendLogsType:d("WALogger").SendLogsType.CRASH_OR_UNRECOVERABLE_ERROR_SAD});throw a})}return i});return j.apply(this,arguments)}function e(){return d("WAWebModelStorageUtils").destroyStorage()["catch"](function(){return d("WAWebDexieCastTypes").dexieCastToPromise(new(c("WAWeb-dexie"))(d("WAWebModelStorageUtils").DATABASE_NAME)["delete"]())})["finally"](function(){i=null})}function f(){i=null}g.initializeWithoutGKs=a;g.destroy=e;g.clearInitializePromise=f}),98); __d("WAWebDBMessageDelete",["Promise","WALogger","WAWebBotGating","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBGetAssociatedMsgsByParentMsgKey","WAWebDBQueryAndRemoveLocalLabelAssociation","WAWebDBReportingTokenUtils","WAWebDBStoreRevokeMsgs","WAWebFtsLightClient","WAWebMessageAssociationGatingUtils","WAWebModelStorageInitialize","WAWebModelStorageUtils","WAWebMsgKey","WAWebNoop","WAWebSchemaLabelAssociation","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeMessagesFromHistory: error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeMessagesFromHistory: delete "," messages"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] findAndDeleteAssociatedPluginMsg failed with error: ",", stack: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] Removing bot plugin msgs after delete for self"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[association-infra] Removing associations after delete for self"]);m=function(){return a};return a}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e===void 0&&(e={deleteAssociatedMsgs:!0});e=e;var f=e.deleteAssociatedMsgs;if(a.length===0)return;var g=[];return d("WAWebModelStorageInitialize").initializeWithoutGKs().then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=new Set(a),e=[],h=[];if(f&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var i=(yield d("WAWebDBGetAssociatedMsgsByParentMsgKey").bulkGetMessagesByParentMsgKey(Array.from(a).map(function(a){return c("WAWebMsgKey").fromString(a)})));i.forEach(function(a){h.push([a.msgKey,a.associationType]),b.add(a.msgKey)})}i=Array.from(b);yield d("WAWebSchemaMessage").getMessageTable().bulkGet(i,!1).then(function(a){a.forEach(function(a){(a==null?void 0:a.rowId)!=null&&e.push(String(a.rowId));var b=a==null?void 0:a.associationType;b!=null&&a!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&h.push([a.id.toString(),b]);b=a==null?void 0:a.botResponseTargetId;var c=a==null?void 0:a.internalId;(a==null?void 0:a.botPluginSearchProvider)!=null&&(a==null?void 0:a.botPluginSearchUrl)!=null&&b!=null&&c!=null&&g.push({internalId:c,targetId:b})})});return{deleteMsgIdsSet:b,msgRowIds:e,deleteAssociationMappings:h}})).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.deleteMsgIdsSet,e=a.deleteAssociationMappings;yield d("WAWebModelStorageUtils").getStorage().lock(["message","label-association","chat","message-association"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=Array.from(c);var f=[d("WAWebSchemaMessage").getMessageTable().bulkRemove(a)];a=d("WAWebDBQueryAndRemoveLocalLabelAssociation").queryAndRemoveLocalLabelAssociation(a.map(function(a){return{associationId:a,type:d("WAWebSchemaLabelAssociation").LabelAssociationType.Message}}));f.push(a);if(e.length>0&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){d("WALogger").LOG(m());a=d("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeyAndAssociationType(e);f.push(a)}try{d("WAWebBotGating").isBotReceiveEnabled()&&(g.length>0&&(d("WALogger").LOG(l()),yield d("WAWebDBStoreRevokeMsgs").findAndDeleteAssociatedPluginMsg(g)))}catch(a){d("WALogger").ERROR(k(),a.name,a.stack).devConsole(a).sendLogs("Plugin carousel delete failed")}return(h||(h=b("Promise"))).all(f)});return function(b){return a.apply(this,arguments)}}());return{deleteMsgIdsSet:c,msgRowIds:a.msgRowIds}});return function(b){return a.apply(this,arguments)}}()).then(function(a){var b=a.deleteMsgIdsSet;a=a.msgRowIds;a.length>0&&d("WAWebFtsLightClient").ftsLightClient.purge(a)["catch"](c("WAWebNoop"));return b}).then(function(a){a=Array.from(a);d("WALogger").DEV(j(),String(a.length));void d("WAWebDBReportingTokenUtils").handleDeleteReportingInfos(a,{removeWholeRow:!0})})["catch"](function(a){d("WALogger").ERROR(i(),a);throw a})});return n.apply(this,arguments)}function e(a){a=a.filter(function(a){return a.includes("status@broadcast")});return a.length>0?d("WAWebSchemaMessage").getMessageTable().bulkRemove(a):(h||(h=b("Promise"))).resolve()}g.removeMessagesFromHistory=a;g.removeStatusMessage=e}),98); __d("WAWebDBMsgUtils",["$InternalEnum","WANullthrows","WAWebApiChat","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebE2EProtoUtils","WAWebLid1X1MigrationGating","WAWebMsgKey","WAWebSchemaMessage","WAWebWid","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({Message:1,MessageEdit:2});function a(a,b){return d("WAWebSchemaMessage").getMessageTable().bulkGet(a).then(function(a){return a.filter(Boolean).map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a,b)})})}function e(a,b){var e=[];a.forEach(function(a){var d=new(c("WAWebMsgKey"))({fromMe:!0,remote:b,id:a});e.push(d.toString());d=new(c("WAWebMsgKey"))({fromMe:!1,remote:b,id:a});e.push(d.toString())});return d("WAWebSchemaMessage").getMessageTable().startsWithAnyOf(["id"],e)}function i(a,b){var e;a instanceof c("WAWebMsgKey")?e=a.toString():e=a;return d("WAWebSchemaMessage").getMessageTable().get(e).then(function(a){return!a?null:d("WAWebDBMessageSerialization").messageFromDbRow(a,b)})}function f(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield i(a,b));if(e)return e;e=a instanceof c("WAWebMsgKey")?a:c("WAWebMsgKey").from(a);if(e.remote.isUser()){a=(yield d("WAWebApiChat").getMatChat_DEPRECATED(e.remote));e=new(c("WAWebMsgKey"))({fromMe:e.fromMe,remote:a,id:e.id});d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("incrementPnhCtwaDailyCount",{chatId:a});return i(e,b)}});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.length===0)return b;var e=b;d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&c("WAWebWid").isUser(a)&&!c("WAWebWid").isLid(a)&&(e=b.map(function(b){var c=b.timestamp;b=b.key;var d={};c!=null&&(d.timestamp=c);b!=null&&(d.key=babelHelpers["extends"]({},b,{remoteJid:a}));return d}));e=e.map(function(a){return d("WAWebE2EProtoUtils").protobufToMsgKey(c("WANullthrows")(a.key)).toString()});var f=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(e,!1));return b.filter(function(a,b){return f[b]!=null})});return l.apply(this,arguments)}function m(a){return d("WAWebSchemaMessage").getMessageTable().bulkGet(a,!1).then(function(a){return a.map(Boolean)})}function n(a){return d("WAWebSchemaMessage").getMessageTable().between(["internalId"],d("WAWebDBMessageUtils").beginningOfChat(a),d("WAWebDBMessageUtils").endOfChat(a))}g.PendingReadReceiptType=h;g.getMsgsByMsgKey=a;g.getMsgsByMsgIdsAndChatId=e;g.getMsgByMsgKey=i;g.getMsgByMsgKeyMat=f;g.filterReceivedMessagesInRange=k;g.getMsgsExistByMsgKey=m;g.getMsgsByChatId=n}),98); __d("WAAckLevel",[],(function(a,b,c,d,e,f){"use strict";a={SENDER_BACKFILL_SENT:-7,INACTIVE_RECEIVED:-6,CONTENT_UNUPLOADABLE:-5,CONTENT_TOO_BIG:-4,CONTENT_GONE:-3,EXPIRED:-2,FAILED:-1,CLOCK:0,SENT:1,RECEIVED:2,READ:3,PLAYED:4};f.ACK=a}),66); __d("WAWebDBMarkFutureproofMessagesReparsed",["WALogger","WAWebMsgType","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["markFutureproofMessagesReparsed: error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["markFutureproofMessagesReparsed: update "," messages"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.length===0)return;a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a));a=a.filter(Boolean).filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN});if(a.length===0)return;d("WALogger").DEV(i(),String(a.length));a=a.map(function(a){return{id:a.id.toString(),futureproofReparsed:!0}});yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(a)}catch(a){d("WALogger").ERROR(h(),a);throw a}});return j.apply(this,arguments)}g.markFutureproofMessagesReparsed=a}),98); __d("WAWebDBProcessEditProtocolMsgs",["$InternalEnum","Promise","WAAckLevel","WALogger","WANullthrows","WATimeUtils","WAWeb-dexie","WAWebAddonQueryUtils","WAWebApiChat","WAWebBackendApi","WAWebBotGating","WAWebDBMarkFutureproofMessagesReparsed","WAWebDBMessageSerialization","WAWebDBMsgUtils","WAWebDBReportingTokenUtils","WAWebDBStoreMessageOrphans","WAWebFtsLightClient","WAWebHandleMsgValidate","WAWebLidMigrationUtils","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebMessagingGatingUtils","WAWebModelStorageUtils","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebNoop","WAWebOfflineResumeMsgProcessReporter","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] add unread mention."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] remove unread mention."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] updating unread chats"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] updating message rows"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] message has been updated by a newer edit. Will skip updating the message row."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] storing orphan edit protocol messages"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] processing edit protocol messages"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] protocol msg does not have a valid sender timestamp"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] sender is not the parent msg sender"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] protocol msg exceeds edit window, will be dropped"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] original message cannot be a forwarded message"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] original message msgId::"," type is "," which cannot be edited"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] protocol msg is missing original msg key"]);u=function(){return a};return a}var v=b("$InternalEnum").Mirrored(["Added","Removed"]);function a(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);if(a.length===0)return[];d("WALogger").DEV(o()).devConsole({protocolMsgs:a});var e=(yield d("WAWebAddonQueryUtils").getParentMsgsByMsgKey(a.map(function(a){return a.protocolMessageKey}).filter(Boolean))),f=z(a,e),g=[],h=[];f.sort(function(a,b){return c("WANullthrows")(b.latestEditSenderTimestampMs)-c("WANullthrows")(a.latestEditSenderTimestampMs)});for(f of f){var i=f.protocolMessageKey&&e.get(f.protocolMessageKey.toString());if(!i||i.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT)g.push(f);else{if(d("WAWebMessagingGatingUtils").isWebReportingTokenDelayProcessingEnabled()){var j=d("WAWebOfflineResumeMsgProcessReporter").msgProcessReporter.startMarker(d("WAWebOfflineResumeMsgProcessReporter").msgProcessReporter.stage.ProcessReportingTokenInfo);yield d("WAWebHandleMsgValidate").validateAndProcessReportingTokenInfo({renderableMsgs:[f]});j==null?void 0:j()}h.push(I(i,f))}}yield A(g);j=h.filter(function(a){return a.isLatest});yield x(h,j);b&&(yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a.map(function(a){return a.id.toString()})));return j});return w.apply(this,arguments)}function x(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a.length&&(yield C(a),E(a.filter(function(a){return a.isLatest&&!d("WAWebMsgGetters").getIsNewsletterMsg(a.parentMsg)}).map(function(a){return a.parentMsg})),yield L(a)),b.length&&d("WAWebBackendApi").frontendFireAndForget("updateEditedMessagesAction",{messageEdits:b})});return y.apply(this,arguments)}function z(a,b){return a.filter(function(a){var e=a.protocolMessageKey;if(!e){d("WALogger").ERROR(u()).devConsole(a).sendLogs("message-edit-missing-original-msg-key");return!1}e=b.get(e.toString());if(e){var f=d("WAWebMessageEditUtils").msgTypeSupportsEditing(e.type)||e.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT;if(!f){d("WALogger").ERROR(t(),e.id,e.type).devConsole({parentMsg:e,protocolMsg:a}).sendLogs("message-edit-unsupported-msg-type");return!1}if(e.isForwarded===!0){d("WALogger").ERROR(s()).devConsole({parentMsg:e,protocolMsg:a}).sendLogs("message-edit-forwarded-message");return!1}f=c("WANullthrows")(e.t);var g=c("WANullthrows")(a.t);if(!d("WAWebMessageEditUtils").isParentWithinEditProcessingWindow({parentTsInSeconds:f,editTsInSeconds:g,msgKey:e.id})){d("WALogger").WARN(r()).devConsole({protocolMsg:a,parentTsInSeconds:f,editTsInSeconds:g});return!1}f=d("WAWebMsgGetters").getSender(e);g=d("WAWebMsgGetters").getSender(a);if(!d("WAWebMsgGetters").getIsNewsletterMsg(e)&&(!f||!g||!c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(f,g)))){d("WALogger").ERROR(q()).devConsole({protocolMsg:a,parentMsgSender:f,protocolMsgSender:g}).sendLogs("message-edit-sender-mismatch");return!1}}if(a.latestEditSenderTimestampMs==null){d("WALogger").ERROR(p()).devConsole({protocolMsg:a}).sendLogs("message-edit-missing-timestamp");return!1}return!0})}function A(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.length)return;d("WALogger").DEV(n()).devConsole({protocolMsgs:a});yield d("WAWebDBStoreMessageOrphans").storeMessageOrphans(a,function(a){return a.protocolMessageKey},{storeReportingInfo:!0})});return B.apply(this,arguments)}function C(a){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.length)return;var c=[],e=[];yield d("WAWebModelStorageUtils").getStorage().lock(["message","chat"],function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(f){var g=f[0];f=f[1];var i=[],j=new Set();a.forEach(function(a){var b=a.parentMsg,f=a.editedMsgData,g=a.isLatest,h=a.protocolMsg;if(!g){d("WALogger").DEV(m()).devConsole({messageEdit:a});return}i.push(babelHelpers["extends"]({},b,f));if(!d("WAWebMsgGetters").getIsSentByMe(h)){g=b.id.remote.toString();j.add(g)}c.push(b.id.toString());e.push([b.id,(h=(a=f.latestEditMsgKey)==null?void 0:a.id.toString())!=null?h:""])});var n=[];i.length&&(d("WALogger").DEV(l()).devConsole({editedMsgs:i}),n.push(g.bulkCreateOrMerge(i.map(function(a){return d("WAWebDBMessageSerialization").dbRowFromMessage(a)}))));if(j.size){g=Array.from(j).map(function(a){return{id:a,unreadEditTimestampMs:d("WATimeUtils").unixTimeMs()}});d("WALogger").DEV(k()).devConsole({unreadChatUpdates:g});n.push(f.bulkCreateOrMerge(g))}yield (h||(h=b("Promise"))).all(n)});return function(a){return f.apply(this,arguments)}}());void d("WAWebDBReportingTokenUtils").handleReportingInfosUpdateOnMessageEdit(e)});return D.apply(this,arguments)}function E(a){if(!a.length)return;var e=Array.from(new Set(a.map(function(a){return String(c("WANullthrows")(a.rowId))})));d("WAWebFtsLightClient").ftsLightClient.purge(e)["catch"](c("WAWebNoop"));c("WAWeb-dexie").ignoreTransaction(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebFtsLightClient").ftsLightClient.addToIndexingTable(e),d("WAWebFtsLightClient").ftsLightClient.index()["catch"](c("WAWebNoop"))}))}function F(a,b){return d("WAWebMsgGetters").getIsNewsletterMsg(a)&&!d("WAWebUserPrefsMeUser").isMeAccount(b.from)||a.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION}function G(a,b){if(d("WAWebMsgGetters").getIsSentByMe(a)){if(a.local===!0)return F(a,b)?d("WAAckLevel").ACK.SENT:d("WAAckLevel").ACK.CLOCK;return d("WAWebMsgKeyUtils").isNoteToSelf(a.id)?d("WAAckLevel").ACK.READ:d("WAAckLevel").ACK.SENT}return void 0}var H=new Map();function I(a,b){var e,f=c("WANullthrows")(d("WAWebMessageEditUtils").getMsgEditType(a.type),"Unsupported message type for edits"),g=K(a,b,f);d("WAWebMsgGetters").getIsSentByMe(a)&&(b.count!=null&&(g.count=b.count));e=(e=(e=H.get(a.id.toString()))!=null?e:a.latestEditSenderTimestampMs)!=null?e:0;var h=c("WANullthrows")(b.latestEditSenderTimestampMs);e=h>=e;if(f===d("WAWebMessageEditUtils").MsgEditType.EventEdit){var i=Boolean(a.isEventCanceled),j=Boolean(b.isEventCanceled);!i&&j?e=!0:i&&!j&&(e=!1)}e&&H.set(a.id.toString(),h);var k;if(f!==d("WAWebMessageEditUtils").MsgEditType.EventEdit&&!d("WAWebMsgGetters").getIsSentByMe(a)){i=d("WAWebMsgGetters").getHasMentionOfMe(a);j=d("WAWebMsgGetters").getHasMentionOfMe(babelHelpers["extends"]({},a,g));i&&!j?k=v.Removed:!i&&j&&(k=v.Added)}d("WAWebBotGating").isBotReceiveEnabled()&&(d("WAWebMsgGetters").getIsMetaBotResponse(a)||a.botEditType!=null)&&(g.botEditType=b.botEditType,g.botEditTargetId=b.botEditTargetId);return{parentMsg:a,protocolMsg:b,editedMsgData:g,isLatest:e,mentionOfMe:k}}function J(a){return{botPluginSearchUrl:a.botPluginSearchUrl,botPluginSearchProvider:a.botPluginSearchProvider,botPluginReferenceIndex:a.botPluginReferenceIndex,botPluginType:a.botPluginType,botPluginMaybeParent:a.botPluginMaybeParent,botReelPluginThumbnailCdnUrl:a.botReelPluginThumbnailCdnUrl,botPluginSearchQuery:a.botPluginSearchQuery,botMessageDisclaimerText:a.botMessageDisclaimerText}}function K(a,b,c){a={latestEditMsgKey:b.latestEditMsgKey,latestEditSenderTimestampMs:b.latestEditSenderTimestampMs,errorCode:b.errorCode,ack:G(a,b),pendingReadReceipt:d("WAWebMsgGetters").getIsSentByMe(a)?void 0:d("WAWebDBMsgUtils").PendingReadReceiptType.MessageEdit};switch(c){case d("WAWebMessageEditUtils").MsgEditType.TextEdit:c=Boolean(b.matchedText)||Boolean(b.description)||Boolean(b.title);return babelHelpers["extends"]({},a,J(b),{subtype:c?"url":void 0,body:b.body,mentionedJidList:b.mentionedJidList,groupMentions:b.groupMentions,title:b.title,description:b.description,matchedText:b.matchedText,inviteGrpType:b.inviteGrpType,thumbnail:b.thumbnail,richPreviewType:b.richPreviewType,doNotPlayInline:b.doNotPlayInline,paymentLinkMetadata:b.paymentLinkMetadata,thumbnailDirectPath:(c=b.thumbnailDirectPath)!=null?c:void 0,thumbnailSha256:(c=b.thumbnailSha256)!=null?c:void 0,thumbnailEncSha256:(c=b.thumbnailEncSha256)!=null?c:void 0,thumbnailHeight:(c=b.thumbnailHeight)!=null?c:void 0,thumbnailWidth:(c=b.thumbnailWidth)!=null?c:void 0,mediaKey:b.mediaKey,mediaKeyTimestamp:b.mediaKeyTimestamp});case d("WAWebMessageEditUtils").MsgEditType.CaptionEdit:return babelHelpers["extends"]({},a,{caption:b.caption,mentionedJidList:b.mentionedJidList,groupMentions:b.groupMentions,isCaptionByUser:!0});case d("WAWebMessageEditUtils").MsgEditType.EventEdit:return babelHelpers["extends"]({},a,{eventName:b.eventName,eventDescription:b.eventDescription,eventLocation:b.eventLocation,eventStartTime:b.eventStartTime,eventEndTime:b.eventEndTime,eventJoinLink:b.eventJoinLink,isEventCanceled:b.isEventCanceled});case d("WAWebMessageEditUtils").MsgEditType.RichResponseEdit:return babelHelpers["extends"]({},a,J(b),{richResponse:b.richResponse})}}function L(a){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMessageEditGatingUtils").receiveCaptionEditEnabled())return;var b=new Map(),c=new Map();for(a of a){var e=a.parentMsg,f=a.mentionOfMe,g=e.id.remote.toString();if(!f)continue;switch(f){case v.Removed:f=e.id.toString();var h=b.get(g);h||(h=[],b.set(g,h));h.push(f);break;case v.Added:h=c.get(g);h||(h=[],c.set(g,h));f={id:e.id.toString(),timestamp:e.t};h.push(f)}}b.size&&(d("WALogger").DEV(j()).devConsole(b),yield d("WAWebApiChat").removeUnreadMentionChat(b));c.size&&(d("WALogger").DEV(i()).devConsole(c),yield d("WAWebApiChat").addUnreadMentionChat(c))});return M.apply(this,arguments)}g.EditedMentionOfMe=v;g.processEditProtocolMsgs=a;g.updateMessageEditsLocally=x;g.generateMessageEdit=I}),98); __d("WAWebAssociationProcessorConstants",[],(function(a,b,c,d,e,f){a=Object.freeze({Regular:"Regular",WithDetachedMessages:"WithDetachedMessages"});f.AssociationProcessorType=a}),66); __d("WAWebCreateAssociationProcessor",["WAWebAssociationProcessorConstants"],(function(a,b,c,d,e,f,g){function a(a){return babelHelpers["extends"]({},a,{processorType:d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages})}g.createAssociationMsgProcessorWithDetachedMessages=a}),98); __d("WAWebAlbumAssociationProcessor",["WAWebCreateAssociationProcessor","WAWebMessageAssociation.flow","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a=d("WAWebCreateAssociationProcessor").createAssociationMsgProcessorWithDetachedMessages({type:d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM,viewMode:d("WAWebViewMode.flow").ViewModeType.MEDIA_ALBUM});b=a;g["default"]=b}),98); __d("WAWebBotPluginAssociationProcessor",["WAWebAssociationProcessorConstants","WAWebMessageAssociation.flow","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a={processorType:d("WAWebAssociationProcessorConstants").AssociationProcessorType.Regular,type:d("WAWebMessageAssociation.flow").MessageAssociationType.BOT_PLUGIN,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE};b=a;g["default"]=b}),98); __d("WAWebMediaPollAssociationProcessor",["WAWebMessageAssociation.flow","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a={processorType:"Regular",type:d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL,viewMode:d("WAWebViewMode.flow").ViewModeType.POLL_MEDIA};b=a;g["default"]=b}),98); __d("WAWebUnknownAssociationProcessor",["WAWebAssociationProcessorConstants","WAWebMessageAssociation.flow","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){a={type:d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN,viewMode:d("WAWebViewMode.flow").ViewModeType.HIDDEN,processorType:d("WAWebAssociationProcessorConstants").AssociationProcessorType.Regular};b=a;g["default"]=b}),98); __d("WAWebAssociationProcessor",["WAWebAlbumAssociationProcessor","WAWebBotPluginAssociationProcessor","WAWebMediaPollAssociationProcessor","WAWebUnknownAssociationProcessor"],(function(a,b,c,d,e,f,g){var h=[c("WAWebAlbumAssociationProcessor"),c("WAWebUnknownAssociationProcessor"),c("WAWebBotPluginAssociationProcessor"),c("WAWebMediaPollAssociationProcessor")];function a(a){var b=a.associationType;return(a=h.find(function(a){return a.type===b}))!=null?a:null}function b(a){var b;return(b=h.find(function(b){return b.type===a}))!=null?b:null}g.getAssociationProcessor=a;g.getAssociationProcessorByAssociationType=b}),98); __d("WAWebDBProcessMessage",["Promise","WALogger","WATimeUtils","WAWeb-dexie","WAWebApiGroupInviteV4Store","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebCommonMsgUtils","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBMessageBulkHelper","WAWebDBMessageSerialization","WAWebDBStoreMessage","WAWebDbEncryptionKey","WAWebFtsLightClient","WAWebHandlePlaceholderWam","WAWebLinkify","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebNoop","WAWebSchemaMessage","WAWebSyncGatingUtils","WAWebViewMode.flow","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["additional information ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error storing messages"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessages: store ",", for chat ",", isHistorySync: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateMessage: msgId::",", Previous row in message table is not a placeholder or futureproof"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["additional information ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error storing messages"]);n=function(){return a};return a}var o=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="DuplicateMessageError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),p=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="PreviousMsgNotUpdatableError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){f===void 0&&(f=!1);d("WALogger").DEV(k(),a.length,e,f);void d("WAWebDBMessageBulkHelper").logMissingGroupParticipantLids(a,f);d("WAWebCommonMsgUtils").logUndefinedMessage(a);yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey();return(h||(h=b("Promise"))).resolve(d("WAWebDBStoreMessage").storeMessageInTransaction(a,e,f)).then(function(){d("WAWebFtsLightClient").ftsLightClient.index()["catch"](c("WAWebNoop"))})["catch"](function(b){if(b instanceof c("WAWeb-dexie").BulkError||b instanceof c("WAWeb-dexie").ConstraintError)throw new o();else{d("WALogger").WARN(j()).devConsole(b);d("WALogger").DEV(i(),a.map(function(a){return a.id.toString()})).devConsole(b);throw b}})});return q.apply(this,arguments)}function e(a,e){var f,g=e==null?(f=a[0])==null?void 0:f.id.remote:e;if(g){f=a.map(function(a){var b=d("WAWebDBMessageSerialization").dbRowFromMessage(a);return d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:b,chatId:g.toString(),hasLink:d("WAWebLinkify").hasHttpLink(a),pendingReadReceipt:!1})});return(h||(h=b("Promise"))).resolve(d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(f)).then(function(){d("WAWebFtsLightClient").ftsLightClient.index()["catch"](c("WAWebNoop"))})["catch"](function(b){d("WALogger").WARN(n()).devConsole(b);d("WALogger").DEV(m(),a.map(function(a){return a.id.toString()})).devConsole(b);throw b})}return(h||(h=b("Promise"))).resolve()}function f(a){return d("WAWebCommonMsgUtils").isPlaceholderMsg(a.type)?(h||(h=b("Promise"))).resolve(a):d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=(yield b.get(a.id.toString()));if(!e)throw c("err")("[messaging] updateMessage: msgId::"+a.id.toString()+", Failed to find previous message row in message table");if(!d("WAWebCommonMsgUtils").isPlaceholderMsg(e.type)&&!d("WAWebCommonMsgUtils").isFutureproofMsg(e.type)){d("WALogger").LOG(l(),a.id.toString()).tags("messaging");throw new p()}var f=a.from,g=babelHelpers["extends"]({},a);e.t!=null&&(g.t=e.t);e.ack>a.ack&&(g.ack=e.ack);f=d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:d("WAWebDBMessageSerialization").dbRowFromMessage(g),chatId:f.toString(),hasLink:d("WAWebLinkify").hasHttpLink(g),rowId:void 0,inChatMsgId:void 0,pendingReadReceipt:e.pendingReadReceipt});f.rowId=e.rowId;f.internalId=e.internalId;if(f.rowId==null||f.internalId==null)throw c("err")("[messaging] updateMessage: msgId::"+a.id.toString()+", missing rowId or internalId");yield b.createOrReplace(f);d("WAWebCommonMsgUtils").isPlaceholderMsg(e.type)&&void d("WAWebHandlePlaceholderWam").populatePlaceholderWam([d("WAWebDBMessageSerialization").messageFromDbRow(e)]);d("WAWebFtsLightClient").ftsLightClient.index()["catch"](c("WAWebNoop"));return g});return function(a){return e.apply(this,arguments)}}())}function r(a){return d("WAWebSchemaMessage").getMessageTable().bulkGet(a).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[];a=a.filter(Boolean).map(function(a){var b={id:a.id,isStarred:d("WAWebSyncGatingUtils").shouldPopulateStarMessageWithTimestamp()?a.t:a.rowId},e=a.associationType;if(e!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var f=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(e);f&&f.processorType===d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages&&(c.push([a.id,e]),b=babelHelpers["extends"]({},b,{associationType:null,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,parentMsgKey:null}))}return b});a=[d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(a)];c.length&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&a.push(d("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeyAndAssociationType(c));yield (h||(h=b("Promise"))).all(a);return});return function(b){return a.apply(this,arguments)}}())}function s(a){return d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(a.map(function(a){return{id:a,isStarred:void 0}}))}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield (h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(a.id.toString(),{id:a.id.toString(),from:a.from.toString(),to:a.to.toString(),groupId:a.inviteGrp,expiration:parseInt(a.inviteCodeExp,10),expired:d("WATimeUtils").unixTime()>=parseInt(a.inviteCodeExp,10)})}));return h.resolve()});return u.apply(this,arguments)}g.DuplicateMessageError=o;g.PreviousMsgNotUpdatableError=p;g.storeMessages=a;g.updateExistingMessages=e;g.updateMessage=f;g.starMessages=r;g.unstarMessages=s;g.processGroupInviteMessages=t}),98); __d("WAWebLastAddOnDBSerialization",["WANullthrows"],(function(a,b,c,d,e,f,g){function a(a){switch(a.type){case"reaction":return{type:"reaction",msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,reactionText:a.reactionText,sender:a.sender,timestamp:a.timestamp};case"poll_vote":return{type:"poll_vote",msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.sender,timestamp:a.timestamp};case"comment":return{type:"comment",msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.sender,timestamp:a.timestamp};case"event_response":return{type:"event_response",msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.sender,timestamp:a.timestamp,eventResponse:a.eventResponse}}}function b(a){return{msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.senderUserJid,reactionText:a.reactionText,timestamp:a.timestamp,isOrphan:a.orphan===1,type:"reaction"}}function d(a,b){return{msgKey:a.msgKey.toString(),isOrphan:b,selectedOptionsCount:a.selectedOptionLocalIds.length,parentMsgKey:a.parentMsgKey.toString(),sender:a.sender.toString(),timestamp:a.senderTimestampMs,type:"poll_vote"}}function e(a){return{msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.sender,timestamp:a.t*1e3,isOrphan:!1,type:"comment"}}function f(a){return{msgKey:a.msgKey,parentMsgKey:a.parentMsgKey,sender:a.senderUserJid,timestamp:a.timestamp,reactionText:c("WANullthrows")(a.reactionText),type:"reaction"}}g.lastAddOnPreviewFromCandidate=a;g.lastAddOnPreviewCandidateFromReactionRowType=b;g.lastAddOnPreviewCandidateFromVoteData=d;g.lastAddOnPreviewCandidateFromCommentRowType=e;g.lastAddOnPreviewFromDeprecatedLastReactionPreview=f}),98); __d("WAWebDBProcessPollUpdateMsgs",["Promise","WAWebBackendApi","WAWebDBMarkFutureproofMessagesReparsed","WAWebDBPollsGetParentMessages","WAWebDBPollsUpsertVotes","WAWebDBStoreMessageOrphans","WAWebDBUpdateLastAddOnPreviewChat","WAWebLastAddOnDBSerialization","WAWebPollsExtractVotes","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return[];a=(yield d("WAWebDBPollsGetParentMessages").getParentMessages(a));var c=a.pollUpdateMsgsToParentMsgs,e=a.orphans;for(a of c.entries()){var f=a[0],g=a[1];g.pollInvalidated===!0&&c["delete"](f)}g=(yield (h||(h=b("Promise"))).all([b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(e.length===0)return;yield d("WAWebDBStoreMessageOrphans").storeMessageOrphans(e,function(a){return a.pollUpdateParentKey});var a=e.map(function(a){return a.id.toString()});yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a)})(),b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(c.size===0)return;var a=(yield d("WAWebDBPollsUpsertVotes").upsertVotesDb(yield d("WAWebPollsExtractVotes").extractVotes(c)));yield d("WAWebBackendApi").frontendSendAndReceive("upsertVotesModelCollection",{votes:a,votesToRemove:null,restoredFromDb:!1});var b=a.map(function(a){return a.msgKey.toString()});yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(b);b=(yield d("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates(a.map(function(a){return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromVoteData(a,!1)})));b.size>0&&(yield d("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(b),d("WAWebBackendApi").frontendFireAndForget("updateChatLastAddOnPreview",{chatMap:b}));return a})()]));f=g[1];return(a=f)!=null?a:[]});return i.apply(this,arguments)}g.processPollUpdateMsgs=a}),98); __d("WAWebDBProcessReplyMsgs",["WALogger","WANullthrows","WAWebDBMessageSerialization","WAWebDBMsgUtils","WAWebGroupType","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebModelStorageUtils","WAWebMsgGetters","WAWebMsgKey","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[reply-messages] updating reply messages with inconsistent quoted content"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[reply-messages] validating reply messages with editable quoted messages"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[reply-messages] found inconsistent quoted content"]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMessageEditGatingUtils").processReplyMessagesEnabled()||!a.length)return;var e=(yield d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var e=new Set();a.forEach(function(a){e.add(l(a).toString())});var f=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(Array.from(e.values()))).filter(function(a){a=d("WAWebMessageEditUtils").getMsgEditType(a.type);if(!a)return!1;switch(a){case d("WAWebMessageEditUtils").MsgEditType.TextEdit:return d("WAWebMessageEditGatingUtils").receiveTextEditEnabled();case d("WAWebMessageEditUtils").MsgEditType.CaptionEdit:return d("WAWebMessageEditGatingUtils").receiveCaptionEditEnabled();case d("WAWebMessageEditUtils").MsgEditType.EventEdit:case d("WAWebMessageEditUtils").MsgEditType.RichResponseEdit:return!0}}),g=new Map(f.map(function(a){return[a.id.toString(),a]}));f=a.filter(function(a){return g.has(l(a).toString())});if(!f.length)return;d("WALogger").DEV(i()).devConsole({replyMsgIds:f.map(function(a){return a.id.id}),quotedMsgIds:f.map(function(a){return a.quotedStanzaID})});var j=[];f.forEach(function(a){var b=c("WANullthrows")(g.get(l(a).toString()));a.quotedMsg==null?j.push(babelHelpers["extends"]({},a,{quotedMsg:b})):n(c("WANullthrows")(a.quotedMsg),b)&&j.push(babelHelpers["extends"]({},a,{quotedMsg:b}))});if(!j.length)return;d("WALogger").DEV(h()).devConsole({replyMsgIds:j.map(function(a){return a.id.id})});yield b.bulkCreateOrMerge(j.map(function(a){return d("WAWebDBMessageSerialization").dbRowFromMessage(a)}));return j});return function(a){return e.apply(this,arguments)}}()));(e==null?void 0:e.length)&&e.forEach(function(b){var d=c("WANullthrows")(a.find(function(a){return a.id.equals(b.id)}));d.quotedMsg=b.quotedMsg})});return k.apply(this,arguments)}function l(a){var b,e;b=(b=a.quotedParticipant)!=null?b:void 0;e=(e=a.quotedRemoteJid)!=null?e:a.id.remote;return new(c("WAWebMsgKey"))({id:c("WANullthrows")(a.quotedStanzaID),fromMe:d("WAWebUserPrefsMeUser").isMeAccount(b),remote:e,participant:d("WAWebMsgGetters").getIsGroupMsg(a)||(b==null?void 0:b.isBot())?b:void 0})}var m={inviteGrpType:d("WAWebGroupType").GroupType.DEFAULT,thumbnail:"",body:"",caption:"",interactiveAnnotations:[],scanLengths:[],staticUrl:"",pageCount:0};function n(a,b){var e,f=(e=c("lodash")).pickBy(a,function(a,b){return a!=null&&b!=="kind"}),g=e.pickBy(b,function(a,b){return Object.prototype.hasOwnProperty.call(f,b)&&b!=="kind"});e.defaults(f,m);e.defaults(g,m);if(c("lodash").isEqual(f,g))return!1;d("WALogger").DEV(j()).devConsole({expected:g,received:f,quotedMsgContent:a,originalQuotedMsg:b});return!0}g.processReplyMsgs=a;g.createQuotedMsgKey=l}),98); __d("WAWebHandleMessageTypes.flow",[],(function(a,b,c,d,e,f){a=Object.freeze({ReportingInfo:"reporting_info"});f.MsgAdditionalInfoType=a}),66); __d("WAWebDBReportingTokenUtils",["Promise","WALogger","WATimeUtils","WAWebGetMessageCache","WAWebHandleMessageTypes.flow","WAWebMessagingGatingUtils","WAWebMsgKey","WAWebSchemaReportingInfo","WAWebSchemaReportingToken","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error deleting reporting infos"]);i=function(){return a};return a}var j=-1;function k(a){var b,e=a.reportingTokenInfo;if(e==null)return null;var f=e.reportingTag;e=e.version;var g=a.t;if(f==null||g==null)return null;b=(b=(b=a.protocolMessageKey)==null?void 0:b.toString())!=null?b:a.id.toString();a={msgKey:b,stanzaId:c("WAWebMsgKey").from(b).id,msgTs:g,receivedTs:d("WATimeUtils").unixTimeMs(),reportingTag:f};e!=null&&(a.version=e);return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMessagingGatingUtils").isReportingTagSyncingEnabled()||a.length===0)return;a=a.map(function(a){return k(a)}).filter(Boolean);return d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkCreate(a)});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaReportingInfo").getReportingInfoTable().anyOf(["msgKey"],a)});return n.apply(this,arguments)}function e(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null||a<=j)return;if(a===0){yield (h||(h=b("Promise"))).all([d("WAWebSchemaReportingToken").getReportingTokenTable().clear(),d("WAWebSchemaReportingInfo").getReportingInfoTable().clear()]);return}a=d("WATimeUtils").unixTimeMs()-a*d("WATimeUtils").DAY_MILLISECONDS;var c=(yield d("WAWebSchemaReportingToken").getReportingTokenTable().lessThan(["ts"],a));a=(yield d("WAWebSchemaReportingInfo").getReportingInfoTable().lessThan(["receivedTs"],a));yield (h||(h=b("Promise"))).all([d("WAWebSchemaReportingToken").getReportingTokenTable().bulkRemove(c.map(function(a){return a.id})),d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkRemove(a.map(function(a){return a.id}))])});return o.apply(this,arguments)}function f(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a<=j)return;a=d("WATimeUtils").unixTimeMs()-a*d("WATimeUtils").DAY_MILLISECONDS;a=(yield d("WAWebSchemaReportingInfo").getReportingInfoTable().lessThan(["receivedTs"],a));a=a.map(function(a){return babelHelpers["extends"]({},a,{reportingToken:null,reportingTokenContentOpaqueData:null,version:null})});yield d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkCreateOrReplace(a)});return p.apply(this,arguments)}function q(a){var b=a.msgKey,c=a.stanzaId,e=a.msgTs;a=a.incomingMsgReportingTokenInfo;if(!d("WAWebMessagingGatingUtils").isReportingTokenReceivingEnabled())return;if(a==null)return;a=a.reportingTag;if(a==null)return;d("WAWebGetMessageCache").getMessageCache().addAdditionalInfo({type:d("WAWebHandleMessageTypes.flow").MsgAdditionalInfoType.ReportingInfo,data:{msgKey:b.toString(),stanzaId:c,reportingTag:a,msgTs:e,receivedTs:d("WATimeUtils").unixTimeMs()}},!0)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.sort(function(a,b){return((a=a.ts)!=null?a:0)-((a=b.ts)!=null?a:0)});var b=a.map(function(a){return a.id}),c=(yield d("WAWebSchemaReportingToken").getReportingTokenTable().bulkGet(b)),e=new Map(),f=new Set();a.forEach(function(a,b){b=c[b];if((b==null||b.reportingTag==null)&&!f.has(a.id))e.set(a.id,a);else{a.reportingTag;b=babelHelpers.objectWithoutPropertiesLoose(a,["reportingTag"]);e.set(a.id,babelHelpers["extends"]({},e.get(a.id),b))}f.add(a.id)});yield d("WAWebSchemaReportingToken").getReportingTokenTable().bulkCreateOrMerge(Array.from(e.values()))});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkCreate(a)});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{if(a.length===0)return;if(b.removeWholeRow)return d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkRemoveByIndex(["msgKey"],a);b=(yield d("WAWebSchemaReportingInfo").getReportingInfoTable().equals(["msgKey"],a));if(b.length===0)return;a=b.map(function(a){return babelHelpers["extends"]({},a,{reportingToken:null,reportingTokenContentOpaqueData:null,version:null})});yield d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkCreateOrReplace(a)}catch(a){d("WALogger").LOG(i()).devConsole(a)}});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var b=new Map();for(a of a){var c=a[0],e=a[1];b.set(c.toString(),e)}c=Array.from(b.keys());e=(yield m(c));if(e.length===0)return;var f=[];e.forEach(function(a){var c=b.get(a.msgKey);if(a.stanzaId===c)return;f.push(babelHelpers["extends"]({},a,{reportingToken:null,reportingTokenContentOpaqueData:null,version:null}))});yield d("WAWebSchemaReportingInfo").getReportingInfoTable().bulkCreateOrReplace(f)});return y.apply(this,arguments)}g.DEFAULT_RT_CLEANUP_OLDER_THAN_DAYS=j;g.msgToReportingInfoRow=k;g.handleHistorySyncedReportingInfo=a;g.getReportingInfosFromMsgKeys=m;g.cleanupReportingTable=e;g.cleanupReportingTokenAndContent=f;g.maybeStoreReportingTag=q;g.handleAddReportingTokenInfos=r;g.handleAddReportingInfos=t;g.handleDeleteReportingInfos=v;g.handleReportingInfosUpdateOnMessageEdit=x}),98); __d("WAPromiseMap",["Promise"],(function(a,b,c,d,e,f){"use strict";var g;function a(a,c){return(g||(g=b("Promise"))).resolve(a).then(function(a){return(g||(g=b("Promise"))).all(a.map(function(a,b){return c(a,b)}))})}f.promiseMap=a}),66); __d("WAWebDBStoreMessageAssociations",["Promise","WAWebSchemaMessageAssociation"],(function(a,b,c,d,e,f,g){var h;function i(a){return d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkCreate(a)}function a(a){a=a.map(function(a){var b=a.parentMsgKey,c=a.associationType,d=a.internalId;return b!=null&&c!=null&&d!=null?{msgKey:a.id.toString(),parentMsgKey:b,associationType:c,msgKeyInternalId:d}:null}).filter(Boolean);return a.length?i(a):(h||(h=b("Promise"))).resolve()}g.bulkStoreValidMessageAssociations=i;g.bulkStoreMessageAssociations=a}),98); __d("WAWebDBStoreMsgsUtils",[],(function(a,b,c,d,e,f){var g=1e9;function a(a,b){b===void 0&&(b=!1);return a.all({reverse:!b,limit:1,index:["rowId"],returnKeyType:"keys"}).then(function(a){return a.length===0?g:a[0]})}f.INLINE_MESSAGE_STARTING_INDEX=g;f.getLastRowId=a}),66); __d("WAWebDBStoreEncryptedMsgs",["Promise","WALogger","WAPromiseMap","WAWeb-dexie","WAWebDBMessageUtils","WAWebDBMsgUtils","WAWebDBStoreMessage","WAWebDBStoreMessageAssociations","WAWebDBStoreMsgsUtils","WAWebFtsLightClient","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebNoop","WAWebPostIncomingMessageDropMetric","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: failed to log bad message properties: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: message prop '","' is a function and cannot be cloned: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: failed to post db error metrics: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: all "," message(s) are already in the DB"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: dropping "," out of "," message(s): ",", due to DB error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: BulkError in bulkCreate for history sync msgs, retrying with bulk create or replace"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[storeEncryptedMessage][lastChatMsgId] lastInChatMsgIdMap with key "," is null or not a number with value "," before calculation"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: perform fallback for "," out of original "," messages"]);p=function(){return a};return a}function a(a,e,f,g){f===void 0&&(f=!1);g===void 0&&(g=!1);return d("WAWebModelStorageUtils").getStorage().lock(["message","message-association"],function(){var i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(i){var j=i[0];i[1];i=a;if(g){var k=(yield d("WAWebDBMsgUtils").getMsgsExistByMsgKey(a.map(function(a){a=a[0];return a.id.toString()})));i=a.filter(function(a,b){return!k[b]});d("WALogger").WARN(p(),i.length,a.length);if(i.length===0)return}var l=(yield d("WAWebDBStoreMsgsUtils").getLastRowId(j,f)),m=new Map();yield (h||(h=b("Promise"))).all(e.map(function(a){var b=d("WAWebWidFactory").createWid(a);a=d("WAWebDBMessageUtils").beginningOfChat(b);var c=d("WAWebDBMessageUtils").endOfChat(b);return j.between(["internalId"],a,c,{limit:1,reverse:!f,returnKeyType:"keys"}).then(function(a){a=a.length===0?d("WAWebDBStoreMsgsUtils").INLINE_MESSAGE_STARTING_INDEX:d("WAWebDBMessageUtils").getInChatMsgId(a[0]);m.set(b.toString(),a)})}));var t=f?-1:1;i=(yield d("WAPromiseMap").promiseMap(i,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a[0];a=a[1];f&&(e.isMdHistoryMsg=!0);var g=c("WAWebMsgKey").fromString(e.id),h=g.remote.toString();b=l+t*(b+1);var i=m.get(h);if(i==null||Number.isNaN(i)){d("WALogger").DEV(o(),h,i).sendLogs("history-sync-nanerror-check-lastinchatmsgidmap-lastChatMsgId");return}i=i+t*1;m.set(h,i);g=!f&&d("WAWebDBStoreMessage").isPendingUnreadReceipt(g,e);e=d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:e,chatId:h,hasLink:a,rowId:b,inChatMsgId:i,pendingReadReceipt:g});return e});return function(b,c){return a.apply(this,arguments)}}())).filter(Boolean);try{d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&(yield d("WAWebDBStoreMessageAssociations").bulkStoreMessageAssociations(i)),yield j.bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(i,!!f)}catch(b){if(f&&b instanceof c("WAWeb-dexie").BulkError)d("WALogger").ERROR(n()),yield j.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(i);else{(g||!q(a.length,b))&&(r(i,b),s(i));throw b}}return i});return function(a){return i.apply(this,arguments)}}()).then(function(a){a&&a.length>0&&c("WAWeb-dexie").ignoreTransaction(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebFtsLightClient").ftsLightClient.addToIndexingTable(a.map(function(a){return a.rowId!=null?String(a.rowId):null}).filter(Boolean)),d("WAWebFtsLightClient").ftsLightClient.index()["catch"](c("WAWebNoop"))}))})}function q(a,b){return a>1&&b instanceof c("WAWeb-dexie").BulkError}function r(a,e){c("WAWeb-dexie").ignoreTransaction(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=a;if(e instanceof c("WAWeb-dexie").BulkError){var f=a.map(function(a){a=a.id;return a.toString()}),g=(yield d("WAWebDBMsgUtils").getMsgsExistByMsgKey(f));b=a.filter(function(a,b){return!g[b]})}b.length>0?(d("WALogger").WARN(m(),b.length,a.length,b.map(function(a){a=a.id;return a}),e),d("WAWebPostIncomingMessageDropMetric").postIncomingMessageDropDBOperationFailedForMsgRows(b)):d("WALogger").WARN(l(),a.length)}))["catch"](function(a){d("WALogger").ERROR(k(),a).sendLogs("failed-to-post-db-error-metrics")})}function s(a){if(c("gkx")("26258"))return;var b=function(a){var b=new Set(),c=function a(c,e){Object.entries(c).forEach(function(c){var f=c[0];c=c[1];if(typeof c==="function"){var g=[].concat(e,[f]).join(".");d("WALogger").WARN(j(),g,c)}else if(c!=null&&typeof c==="object"){if(b.has(c))return;b.add(c);a(c,[].concat(e,[f]))}})};c(a,[])};try{a.forEach(b)}catch(a){d("WALogger").WARN(i(),a)}}g.storeEncryptedDBMessages=a;g.isEligibleForFallback=q}),98); __d("WAWebCurrentUser",["WAWebABProps","gkx"],(function(a,b,c,d,e,f,g){"use strict";function a(){return c("gkx")("26258")===!1||d("WAWebABProps").getABPropConfigValue("is_meta_employee_or_internal_tester")}g.isEmployee=a}),98); __d("WAWebMsgDataUtils",["WALogger","WANullthrows","WATimeUtils","WAWebAck","WAWebBizGatingUtils","WAWebBotTypes","WAWebChatGetters","WAWebCommonMsgUtils","WAWebCurrentUser","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["genOutgoingMsgData: generating key for group ",", has metadata: ",",\n isLidAddressingMode: ",", participant: ",""]);h=function(){return a};return a}function a(a){var b=a.type,e=a.subtype,f;b===d("WAWebMsgType").MSG_TYPE.GP2?e==="subject"?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:e==="add"||e==="invite"||e==="invite_auto_add"||e==="linked_group_join"||e==="community_invite_auto_add_rich"?a.recipients&&d("WAWebUserPrefsMeUser").isMePrimary(a.recipients[0])?f=d("WAWebCommonMsgUtils").EventType.SIGNIFICANT:f=d("WAWebCommonMsgUtils").EventType.IGNORE:e==="community_owner_update"?a.recipients&&d("WAWebUserPrefsMeUser").isMePrimary(a.recipients[0])?f=d("WAWebCommonMsgUtils").EventType.DEFAULT:f=d("WAWebCommonMsgUtils").EventType.IGNORE:e==="linked_group_promote"||e==="linked_group_demote"?c("WAWebWid").isGroup(a.id.remote)&&a.recipients&&d("WAWebUserPrefsMeUser").isMePrimary(a.recipients[0])&&!d("WAWebUserPrefsMeUser").isMeAccount(a.author)?f=d("WAWebCommonMsgUtils").EventType.SIGNIFICANT:f=d("WAWebCommonMsgUtils").EventType.IGNORE:e==="remove"?a.recipients&&d("WAWebUserPrefsMeUser").isMePrimary(a.recipients[0])?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:f=d("WAWebCommonMsgUtils").EventType.IGNORE:e==="create"||e==="empty_subgroup_create"||e==="general_chat_add"?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:e==="created_subgroup_suggestion"?f=d("WAWebCommonMsgUtils").EventType.DEFAULT:e==="parent_group_link"||e==="auto_add"||e==="default_sub_group_admin_add"||e==="community_participant_add_rich"||e==="subgroup_admin_triggered_auto_add"||e==="subgroup_admin_triggered_invite_auto_add"||e==="sibling_group_link"||e==="community_invite_rich"||e==="sub_group_participant_add_rich"||e==="sub_group_invite_rich"||e==="community_link_parent_group_rich"?f=d("WAWebCommonMsgUtils").EventType.SIGNIFICANT:e==="membership_approval_request"||e==="created_membership_requests"?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:e==="sibling_group_unlink"?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.BROADCAST_NOTIFICATION||b===d("WAWebMsgType").MSG_TYPE.NOTIFICATION||b===d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION?e==="create"?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&d("WAWebUserPrefsMeUser").isMePrimary(a.from)?f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.CALL_LOG?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:a.broadcast!=null?c("WAWebWid").isBroadcast(a.id.remote)?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.REVOKED?f=d("WAWebCommonMsgUtils").EventType.IGNORE:c("WAWebWid").isPSA(a.id.remote)?f=a.ack===d("WAWebAck").ACK.RECEIVED?d("WAWebCommonMsgUtils").EventType.DEFAULT:d("WAWebCommonMsgUtils").EventType.AMBIENT:b===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT||b===d("WAWebMsgType").MSG_TYPE.OVERSIZED?f=d("WAWebCommonMsgUtils").EventType.AMBIENT:b===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE?e==="sender_invite"||(e==="chat_assignment"||e==="chat_assignment_unassign")&&d("WAWebBizGatingUtils").shouldReorderChatOnAssignment(e==="chat_assignment_unassign")?f=d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&e==="ephemeral_setting"?f=d("WAWebCommonMsgUtils").EventType.IGNORE:b===d("WAWebMsgType").MSG_TYPE.REACTION?f=d("WAWebCommonMsgUtils").EventType.IGNORE:f=d("WAWebCommonMsgUtils").EventType.DEFAULT;return f}function e(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.id,f=d("WAWebUserPrefsMeUser").getMeUser(),g=c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLidUser()),i=a.id.isLid()?g:f,j=void 0;if(d("WAWebChatGetters").getIsGroup(a)){var k;i=((k=a.groupMetadata)==null?void 0:k.isLidAddressingMode)===!0?g:f;j=d("WAWebWidFactory").toUserWid(i);if(d("WAWebCurrentUser").isEmployee()){d("WALogger").LOG(h(),e.toString(),a.groupMetadata!=null,(k=a.groupMetadata)==null?void 0:k.isLidAddressingMode,j)}}else a.id.isStatus()&&(j=f);g=new(c("WAWebMsgKey"))({from:i,to:e,id:yield c("WAWebMsgKey").newId(),participant:j,selfDir:"out"});f=(k=a.contact.businessProfile)==null?void 0:k.automatedType;var l;if(f)switch(f){case d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P:l=d("WAWebBotTypes").BizBotType.BIZ_1P;break;case d("WAWebBotTypes").BizBotAutomatedType.FULL_3P:l=d("WAWebBotTypes").BizBotType.BIZ_3P;break;case d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN:l=null}return{id:g,from:c("WANullthrows")(i),to:e,type:b,t:d("WATimeUtils").unixTime(),viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,isNewMsg:!0,local:!0,ack:d("WAWebAck").ACK.CLOCK,bizBotType:l}});return i.apply(this,arguments)}g.eventTypeFromMsgType=a;g.genOutgoingMsgData=e}),98); __d("WAWebDBStoreMessage",["Promise","WAJids","WALogger","WAPromiseMap","WAWeb-dexie","WAWebCommonMsgUtils","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebDBMsgUtils","WAWebLinkify","WAWebModelStorageUtils","WAWebMsgDataUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebNewsletterDBUtils","WAWebSchemaFtsIndexingQueue","WAWebSyncGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": completed in ","ms"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": completed in ","ms"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": "," in ","ms"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": start"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[process-msg] craftMessageRangeIndex failed with error ",""]);m=function(){return a};return a}var n=1e9;function o(a){return a.some(function(a){return a.type!==d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE})}function a(a,e,f){f===void 0&&(f=!1);var g=e==null?a[0].id.remote:e,i=d("WAWebDBMessageUtils").beginningOfChat(g),j=d("WAWebDBMessageUtils").endOfChat(g),k=s("storeMessageInTransaction: "+a.length+" message(s), chat "+((g==null?void 0:g.toString())||"-"));return d("WAWebModelStorageUtils").getStorage().lock(["chat","message"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var e=c[0];c=c[1];k.addStage("got table lock");var l=(yield e.get(g.toString()));k.addStage("got chat");if(!g.isStatus()&&(l!=null||o(a))){l=q(l,a,g);yield e.createOrMerge(g.toString(),l)}k.addStage("got messages meta");e=c.all({reverse:!f,limit:1,index:["rowId"],returnKeyType:"keys"}).then(function(a){k.addStage("got boundary row id");return a.length===0?n:a[0]});l=c.between(["internalId"],i,j,{limit:1,reverse:!f,returnKeyType:"keys"}).then(function(a){k.addStage("got chat msg boundary id");return a.length===0?n:d("WAWebDBMessageUtils").getInChatMsgId(a[0])});e=(yield (h||(h=b("Promise"))).all([e,l]));l=e[0];e=e[1];k.addStage("got boundaries");var m=f?l-a.length:l+1,s=f?e-a.length:e+1,t=(yield d("WAPromiseMap").promiseMap(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebDBMessageSerialization").dbRowFromMessage(a),e=!f&&p(a.id,a);return r({msg:c,chatId:g.toString(),hasLink:d("WAWebLinkify").hasHttpLink(a),rowId:m+b,inChatMsgId:d("WAWebMsgGetters").getIsNewsletterMsg(a)?(c=a.serverId)!=null?c:yield d("WAWebNewsletterDBUtils").getTemporaryServerId(g):s+b,pendingReadReceipt:e})});return function(b,c){return a.apply(this,arguments)}}()));k.addStage("messages ready for storing in db");return c.bulkCreate(t).then(function(){return t})});return function(a){return c.apply(this,arguments)}}()).then(function(a){k.done(),c("WAWeb-dexie").ignoreTransaction(function(){d("WAWebSchemaFtsIndexingQueue").getFtsIndexingQueueTable().bulkCreateOrReplace(a.map(function(a){return{id:String(a.rowId)}}))})})}function p(a,b){if(a.fromMe||a.remote.isStatus())return!1;a=d("WAWebMsgDataUtils").eventTypeFromMsgType(b);return a===d("WAWebCommonMsgUtils").EventType.AMBIENT||a===d("WAWebCommonMsgUtils").EventType.DEFAULT}function q(a,b,c){var e,f=void 0,g=Math.max(0,(e=a==null?void 0:a.unreadCount)!=null?e:0),h=(e=a==null?void 0:a.unreadMentionsOfMe)!=null?e:[];b.forEach(function(a){var b=d("WAWebMsgDataUtils").eventTypeFromMsgType(a);if(b===d("WAWebCommonMsgUtils").EventType.IGNORE)return;a&&a.t!=null&&((f==null||a.t>f)&&(f=a.t));(b===d("WAWebCommonMsgUtils").EventType.AMBIENT||b===d("WAWebCommonMsgUtils").EventType.DEFAULT)&&!a.id.fromMe&&(g+=1);b=p(a.id,a);if(b&&d("WAWebMsgGetters").getIsImportantMessage(a)){b={id:a.id.toString(),timestamp:a.t};h.push(b)}});a&&a.t!=null&&((f==null||a.t>f)&&(f=a.t));return{id:c.toString(),unreadCount:g,t:f,unreadMentionsOfMe:h}}function r(a){var b=a.msg,e=a.chatId,f=a.hasLink,g=a.rowId,h=a.inChatMsgId;a=a.pendingReadReceipt;var i=[d("WAWebMsgType").MSG_TYPE.IMAGE,d("WAWebMsgType").MSG_TYPE.VIDEO,d("WAWebMsgType").MSG_TYPE.AUDIO].includes(b.type),j=d("WAWebSyncGatingUtils").shouldPopulateStarMessageWithTimestamp()?b.t:g;f=babelHelpers["extends"]({},b,{vcardWAids:b.vcardWAids||d("WAWebDBMessageUtils").getVcardWids(b),id:b.id.toString(),isStarred:b.star?j:void 0,hasLink:b.type==="chat"&&f?g:void 0,isMediaMsg:i?g:void 0,isDocMsg:b.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT?g:void 0,isCallLogMsg:b.type===d("WAWebMsgType").MSG_TYPE.CALL_LOG?b.t:void 0,isCarouselMsg:b.carouselCardsParsed!=null?g:void 0,isEventMsg:b.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION?g:void 0,expiredTimestamp:(j=d("WAWebMsgGetters").getEphemeralExpirationTimestamp(b))!=null?j:void 0});g!=null&&(f.rowId=g);h!=null&&(f.internalId=d("WAWebDBMessageUtils").craftInternalId(e,h));a&&e!==d("WAJids").STATUS_JID&&(f.pendingReadReceipt=d("WAWebDBMsgUtils").PendingReadReceiptType.Message);i=b.c2sTimestamp;if(b.id.fromMe){i=(j=b.c2sTimestamp)!=null?j:b.t}else i=b.t;try{b.type!==d("WAWebMsgType").MSG_TYPE.REACTION&&(f.messageRangeIndex=d("WAWebDBMessageUtils").craftMessageRangeIndex(e,!c("WAWebMsgKey").fromString(b.id).fromMe,d("WAWebMsgType").SYSTEM_MESSAGE_TYPES.includes(b.type),i))}catch(a){d("WALogger").ERROR(m(),a)}return f}function s(a){d("WALogger").DEV(l(),a);var b=5e3,c=Date.now(),e=[];return{addStage:function(a){e.push([a,Date.now()-c])},done:function(){if(Date.now()-c>b){for(var f of e){var g=f[0],h=f[1];d("WALogger").DEV(k(),a,g,h)}d("WALogger").WARN(j(),a,Date.now()-c)}else d("WALogger").DEV(i(),a,Date.now()-c)}}}g.storeMessageInTransaction=a;g.isPendingUnreadReceipt=p;g.addMsgMetadataToMsgRow=r}),98); __d("WAWebApiOrphanRevoke",["WANullthrows","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebSchemaOrphanRevoke","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new Map(),i=!1,j={reset:function(){h=new Map(),i=!1},bulkRemoveOrphans:function(a){a.forEach(function(a){h["delete"](a.msgKey)});return d("WAWebSchemaOrphanRevoke").getOrphanRevokeTable().bulkRemove(a.map(function(a){return a.msgKey}))},bulkCreateOrReplaceOrphanRevokes:function(a){a.forEach(function(a){h.has(a.msgKey)&&h["delete"](a.msgKey),h.set(a.msgKey,a)});return d("WAWebSchemaOrphanRevoke").getOrphanRevokeTable().bulkCreateOrReplace(a)},getAllOrphanRevokes:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!i){var a=(yield d("WAWebSchemaOrphanRevoke").getOrphanRevokeTable().all());h=new Map(a.map(function(a){return[a.msgKey,a]}));i=!0}return h});function c(){return a.apply(this,arguments)}return c}()};function a(a){return j.bulkCreateOrReplaceOrphanRevokes(a)}function e(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return j.getAllOrphanRevokes()});return k.apply(this,arguments)}function f(a){return j.bulkRemoveOrphans(a)}function l(a,b){var c;return{id:a.id,to:a.to,author:a.author,revokeSender:d("WAWebWidFactory").createWidFromWidLike((c=b.sender)!=null?c:d("WAWebMsgGetters").getSender(a)),type:d("WAWebMsgType").MSG_TYPE.REVOKED,kind:d("WAWebMsgType").MsgKind.RevokedMessage,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:b.subtype==="admin_revoke"?"admin":"sender",protocolMessageKey:a.id,from:a.from,t:a.t,broadcast:a.broadcast}}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j.getAllOrphanRevokes()),e=[],f=[];a.forEach(function(a){var g=a.id.toString();if(b.has(g)){g=c("WANullthrows")(b.get(g));f.push(babelHelpers["extends"]({},d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(a),{id:c("WAWebMsgKey").fromString(g.msgKey),type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.ProtocolRevoke,subtype:g.subtype==="admin_revoke"?"admin_revoke":"sender_revoke",protocolMessageKey:a.id,t:g.timestamp}));e.push(g)}});j.bulkRemoveOrphans(e);return f});return n.apply(this,arguments)}g.addOrphanRevokes=a;g.getOrphansRevokesCache=e;g.bulkRemoveOrphansUsingOrphansCache=f;g.createRevokeMsgFromOrphanRevoke=l;g.applyAddonRevokes=m}),98); __d("WAWebDBAssociatedMsgsAttachDetachAPI",["$InternalEnum","WALogger","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebBackendApi","WAWebDBGetAssociatedMsgsByParentMsgKey","WAWebMessageAssociationGatingUtils","WAWebSchemaMessage","WAWebViewMode.flow","asyncToGeneratorRuntime","nullthrows"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateViewModeOfAssociatedMsgsByParentMsgKeys: Found associated messages"]);h=function(){return a};return a}var i=b("$InternalEnum").Mirrored(["Attach","Detach"]);function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield k(a.map(function(a){return a.id})));a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a.map(function(a){return a.msgKey.toString()}),!1));a=m(a.filter(Boolean),i.Attach).filter(Boolean);yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(a);var b=new Map();a.forEach(function(a){var d=c("nullthrows")(a.viewMode);b.set(a.id,d)});d("WAWebBackendApi").frontendFireAndForget("updateViewModeForMsgs",{msgIdsViewModeMap:b})});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled())return[];a=(yield d("WAWebDBGetAssociatedMsgsByParentMsgKey").bulkGetMessagesByParentMsgKey(a));a.length&&d("WALogger").LOG(h()).devConsole({associatedMsgs:a});return a});return l.apply(this,arguments)}function e(a,b){var c=[];a.map(function(a){var e=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(a.associationType);if(e){var f=!0;b===i.Detach&&(f=(e==null?void 0:e.processorType)===d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages);e&&f&&c.push(a)}});return c}function m(a,b){return!d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()?[]:a.map(function(a){if(!a.associationType)return null;var c=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(a.associationType);return c==null?null:babelHelpers["extends"]({},a,{viewMode:b===i.Detach?d("WAWebViewMode.flow").ViewModeType.VISIBLE:c.viewMode})})}function f(a){return!d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()?[]:a.map(function(a){if(!a.associationType)return null;var b=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(a.associationType);return b==null?null:babelHelpers["extends"]({},a,{viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,parentMsgKey:void 0,associationType:void 0})})}g.ViewModeUpdateType=i;g.processOrphansFromAssociationsTableForNewMsg=a;g.getAssociatedMsgsByParentMsgKeyFromAssociationTable=k;g.getValidAssociatedMsgs=e;g.getDetachedForeverAssociatedMsgs=f}),98); __d("WAWebDBStoreRevokeMsgs",["Promise","WALogger","WAWebAddonProcessRevoke","WAWebApiChat","WAWebApiOrphanRevoke","WAWebBackendApi","WAWebBotGating","WAWebDBAssociatedMsgsAttachDetachAPI","WAWebDBReportingTokenUtils","WAWebFtsLightClient","WAWebLidMigrationUtils","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebNoop","WAWebSchemaMessage","WAWebSchemaMessageAssociation","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsg: revoke is orphan or an addon ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store Revoked Msg: delete associated carousel revoke failed with error: ",", stack: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store Revoked Msg: re-validate bot revoke failed with error: ",", stack: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: sending invalid revoke for secondary validation as bot invoker revoke"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: invalid revoke request ",", ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: admin revoke came for the different group than the original message was in"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: "," has not been revoked"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: admin revoke has to be sent to a group or newsletter chat"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRevokeMsgs: "," has not been revoked"]);q=function(){return a};return a}var r=20;function a(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=new Set(),f=[],g=[],r=new Map(),s=new Map(),u=[],v=[],w=a.filter(function(a){var b=a.revokeMsgKey,e=a.newMsgKey,f=a.subtype,g=!0;f==="admin_revoke"?!c("WAWebWid").isGroup(b.remote)&&!c("WAWebWid").isNewsletter(b.remote)?(g=!1,d("WALogger").LOG(q(),String(b)),d("WALogger").WARN(p()).sendLogs("process-admin-revoke-message")):c("WAWebWid").equals(b.remote,e.remote)||(g=!1,d("WALogger").LOG(o(),String(b)),d("WALogger").WARN(n()).sendLogs("process-admin-revoke-message")):(g=c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(b.remote,e.remote))&&c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(b.participant,e.participant))&&b.fromMe===e.fromMe,g||(d("WALogger").LOG(m(),String(b),String(e)),d("WAWebBotGating").isBotReceiveEnabled()&&(d("WALogger").LOG(l()),s.set(a.revokeMsgKey.id,a))));return g});if(d("WAWebBotGating").isBotReceiveEnabled()&&s.size>0)try{a=Array.from(s.entries());var x=a.map(function(a){return a[1].revokeMsgKey.toString()});a=a.map(function(a){return(a=d("WAWebLidMigrationUtils").getAlternateMsgKey(a[1].revokeMsgKey))==null?void 0:a.toString()});x=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet([].concat(x,a),!1));x.forEach(function(a){var b=!1;if(a==null)return;var e=c("WAWebMsgKey").from(a.id),f=s.get(e.id);if(f==null)return;var g=f.newMsgKey,h=f.subtype,i=f.sender;if(h==="admin_revoke")return;h=e.remote;e=a.botTargetSenderJid?d("WAWebWidFactory").createWidFromWidLike(a.botTargetSenderJid):null;if(e==null||h==null)return;var j=a.botPluginSearchUrl!=null&&a.botResponseTargetId!=null,k=!j&&a.botPluginMaybeParent===!0;h.isGroup()?c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(e,g.participant))&&(b=!0):h.isBot()||c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(e,i))&&(b=!0);if(b){u.push(f);g=a.internalId;h=a.botResponseTargetId;d("WAWebBotGating").isBotCarouselEnabled()&&(j||k)&&g!=null&&h!=null&&v.push({internalId:g,targetId:h})}});w.push.apply(w,u)}catch(a){d("WALogger").ERROR(k(),a.name,a.stack).devConsole(a).sendLogs("Re-validate revoke failed")}if(d("WAWebBotGating").isBotCarouselEnabled()&&v.length>0)try{yield t(v)}catch(a){d("WALogger").ERROR(j(),a.name,a.stack).devConsole(a).sendLogs("Plugin carousel delete revoke failed")}var y=[],z=[];a=(yield (h||(h=b("Promise"))).all([d("WAWebModelStorageUtils").getStorage().lock(["message","message-association"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var j=[].concat(w.map(function(a){return a.revokeMsgKey}),w.map(function(a){return d("WAWebLidMigrationUtils").getAlternateMsgKey(a.revokeMsgKey)}),w.map(function(a){return a.newMsgKey})),k=[];if(d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var l=(yield d("WAWebDBAssociatedMsgsAttachDetachAPI").getAssociatedMsgsByParentMsgKeyFromAssociationTable(j.filter(Boolean)));l=d("WAWebDBAssociatedMsgsAttachDetachAPI").getValidAssociatedMsgs(l,d("WAWebDBAssociatedMsgsAttachDetachAPI").ViewModeUpdateType.Detach);k=l.map(function(a){return a.msgKey})}l=[].concat(j.map(function(a){return a?a.toString():""}),k);j=(yield a.bulkGet(l,!1));var m=[];k=w.length;var n=j.slice(0,k),o=j.slice(k,k*2),p=j.slice(k*2,k*3);l=j.slice(k*3);var q=[];w.forEach(function(a,b){var h;h=(h=n[b])!=null?h:o[b];b=p[b];if(h==null){d("WALogger").LOG(i(),a.revokeMsgKey);m.push(a);return}e.add(h.id);g.push(String(h.rowId));h.associationType!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&z.push([h.id,h.associationType]);f.push({id:a.newMsgKey.toString(),to:h.to,author:h.author,type:d("WAWebMsgType").MSG_TYPE.REVOKED,subtype:a.subtype==="admin_revoke"?"admin":"sender",revokeSender:a.sender,protocolMessageKey:h.id,protocolMessageRowId:b==null?void 0:b.rowId,from:h.from,t:h.t,rowId:h.rowId,internalId:h.internalId,messageRangeIndex:h.messageRangeIndex,revokeTimestamp:a.revokeTimestamp,disappearingModeInitiator:a.disappearingModeInitiator,ephemeralDuration:a.ephemeralDuration,ephemeralSettingTimestamp:a.ephemeralSettingTimestamp,viewMode:(b=a.viewMode)!=null?b:h.viewMode});if(d("WAWebMsgGetters").getIsImportantMessage(h)){a=c("WAWebMsgKey").fromString(h.id);b=a.remote.toString();if(r.has(b)){a=(a=r.get(b))!=null?a:[];r.set(b,[].concat(a,[h.id]))}else r.set(b,[h.id])}});if(l!=null&&l.length){j=d("WAWebDBAssociatedMsgsAttachDetachAPI").getDetachedForeverAssociatedMsgs(l.filter(Boolean)).filter(Boolean);j.forEach(function(a){a!=null&&!e.has(a.id)&&q.push(a)});l.filter(Boolean).forEach(function(a){z.push([a.id,a.associationType])});d("WAWebBackendApi").frontendFireAndForget("detachAssociatedMsgsForever",{msgIds:j.map(function(a){return a.id})})}k=[];l=[];e.size>0&&k.push(a.bulkRemove(Array.from(e)));z.length>0&&k.push(d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkRemove(z));yield (h||(h=b("Promise"))).all(k);y.length>0&&l.push(d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkCreateOrReplace(y));(f.length>0||q.length>0)&&l.push(a.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY([].concat(f,q)));yield h.all(l);return m});return function(b){return a.apply(this,arguments)}}()),d("WAWebAddonProcessRevoke").processRevokeMsgs(w)]));x=a[0];var A=a[1];if(x.length>0){a=x.filter(function(a){return A.has(a.revokeMsgKey)}).map(function(a){return{msgKey:a.revokeMsgKey.toString(),sender:a.sender,timestamp:a.timestamp,subtype:(a=a.subtype)!=null?a:"sender_revoke"}});a.length>0&&(yield d("WAWebApiOrphanRevoke").addOrphanRevokes(a))}d("WAWebFtsLightClient").ftsLightClient.purge(g)["catch"](c("WAWebNoop"));void d("WAWebDBReportingTokenUtils").handleDeleteReportingInfos(e?Array.from(e):[],{removeWholeRow:!1});r.size>0&&d("WAWebApiChat").removeUnreadMentionChat(r)});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=[],f=[];a=a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield v(a));var b=a.pluginLinkMsgIds;a=a.pluginLinkMsgIdsRowIds;e=[].concat(e,b);f=[].concat(f,a);yield d("WAWebSchemaMessage").getMessageTable().bulkRemove(e)});return function(b){return a.apply(this,arguments)}}());yield (h||(h=b("Promise"))).all(a);d("WAWebFtsLightClient").ftsLightClient.purge(f)["catch"](c("WAWebNoop"));d("WAWebBackendApi").frontendFireAndForget("deleteAssociatedBotCarouselMsgs",{msgKeys:e})});return u.apply(this,arguments)}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[],c=[],e=a.internalId,f=a.targetId;a=e.split("_")[0];yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],e,a+"_g",{reverse:!1,limit:r,shouldDecrypt:!1},function(a){if(a.botResponseTargetId===f)b.push(a.id),c.push(String(a.rowId));else return!0;return!1});return{pluginLinkMsgIds:b,pluginLinkMsgIdsRowIds:c}});return w.apply(this,arguments)}g.processRevokeMsgs=a;g.findAndDeleteAssociatedPluginMsg=t;g.findAssociatedPluginMsgs=v}),98); __d("WAWebGraphQLServerError",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({INVALID_ACCESS_TOKEN:190});c=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this)||this;c.name="GraphQLServerError";c.source=b;return c}return b}(babelHelpers.wrapNativeSuper(Error));f.GraphQLErrorCode=a;f.GraphQLServerError=c}),66); __d("WAWebRelayClient",["Promise","WAWebGraphQLServerError","WAWebRelayEnvironment","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function a(a){throw c("err")("Invariant Violation")}function e(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=c===void 0?{}:c;var e=c.eventLogger,f=c.environmentType,g=c.accessToken,h=c.getInlineDataReader;c=babelHelpers.objectWithoutPropertiesLoose(c,["eventLogger","environmentType","accessToken","getInlineDataReader"]);var i=(yield d("WAWebRelayEnvironment").requireRelayRuntime()),j=i.fetchQuery;i=i.readInlineData;try{f=(yield d("WAWebRelayEnvironment").getEnvironment({environmentType:f,accessToken:g}));g=(yield j)(f,a,b,c).toPromise();e==null?void 0:e.success();h==null?void 0:h(i);return g}catch(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&(e==null?void 0:e.failure(a.source.errors));throw a}});return i.apply(this,arguments)}function f(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e=e===void 0?{}:e;var f=e.eventLogger,g=e.environmentType,i=e.accessToken,j=e.getInlineDataReader,k=babelHelpers.objectWithoutPropertiesLoose(e,["eventLogger","environmentType","accessToken","getInlineDataReader"]);e=(yield d("WAWebRelayEnvironment").requireRelayRuntime());var l=e.commitMutation,m=e.readInlineData;try{var n=(yield d("WAWebRelayEnvironment").getEnvironment({environmentType:g,accessToken:i}));return new(h||(h=b("Promise")))(function(b,d){l(n,babelHelpers["extends"]({mutation:a,variables:c},k,{onCompleted:function(a){f==null?void 0:f.success(),j==null?void 0:j(m),b(a)},onError:function(a){d(a)}}))})}catch(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&(f==null?void 0:f.failure(a.source.errors));throw a}});return j.apply(this,arguments)}g.graphql=a;g.fetchQuery=e;g.commitMutation=f}),98); __d("WAWebGraphQLConstants",[],(function(a,b,c,d,e,f){var g="https://graph.whatsapp.com/graphql/";function a(){return h("")}function b(){return h("catalog")}function h(a){return""+g+a}c="https://graph.facebook.com/graphql";d="WA|787118555984857|7bb1544a3599aa180ac9a3f7688ba243";e="WA|368348580915920|f740dc6ab59f4466ba09052010768cc1";f.whatsappGraphqlEndpointWWW=a;f.whatsappGraphqlEndpointCatalog=b;f.FACEBOOK_GRAPHQL_ENDPOINT=c;f.WHATSAPP_GRAPHQL_CATALOG_ACCESS_TOKEN=d;f.WHATSAPP_GRAPHQL_WWW_ACCESS_TOKEN=e}),66); __d("WAWebGraphQLPersistedQueries",[],(function(a,b,c,d,e,f){a={queryProductListCatalogQuery:"5127568407281377",WAWebAiAgentAutoReplyControlMutation:"9175037952515083",WAWebBizGetCustomUrlUserGraphqlQuery:"7942225995860428",WAWebBizGetProfileShimlinksQuery:"9506729392776543",WAWebBizGraphQLRefreshCartJobQuery:"8172715152844790",WAWebGraphQLProductCatalogGetPublicKeyJobQuery:"24765734146405491",WAWebGraphQLVerifyPostcodeJobQuery:"7573183149457062",WAWebReportProductJobMutation:"8473660082655001",WAWebGalaxyFlowsDrawerGetFlowDataQuery:"6848666948572627"};f.PersistedQueries=a}),66); __d("WAWebGraphQLRemapLocale",["WALogger","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid json locale mapping"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid json locale mapping"]);i=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["locale format should use underscore instead of hyphen"]);a=function(){return b};return b}b=function(a,b){try{var e=JSON.parse(b);if(!c("lodash").isPlainObject(e)){d("WALogger").WARN(i());return a}return Object.keys(e).find(function(b){b=e[b];return Array.isArray(b)?b.includes(a):!1})||a}catch(b){d("WALogger").WARN(h());return a}};g.graphQLRemapLocale=b}),98); __d("WAWebModernizr",[],(function(a,b,c,d,e,f){function a(){return self.Modernizr}f.getModernizr=a}),66); __d("WAWebMiscGatingUtils",["WAWebABProps","WAWebGroupType","WAWebMobilePlatforms","WAWebModernizr","WAWebPrimaryFeatures","WAWebUA"],(function(a,b,c,d,e,f,g){function a(){return!d("WAWebABProps").getABPropConfigValue("disable_auto_download")}function b(a){if(a>=d("WAWebABProps").getABPropConfigValue("pnh_cag_disable_reactions_group_size"))return!1;return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("parent_group_view_enabled_for_smb_on_web"):!0}function c(a){a===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?a=d("WAWebABProps").getABPropConfigValue("community_announcement_group_size_limit"):a=d("WAWebABProps").getABPropConfigValue("group_size_limit");return a}function e(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("recent_sticker")}function f(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("favorite_sticker")}function h(){var a=d("WAWebModernizr").getModernizr();return d("WAWebUA").UA.isGecko&&!(a==null?void 0:a.exiforientation)?!1:!0}function i(){return d("WAWebABProps").getABPropConfigValue("web_group_profile_editor")}function j(){return d("WAWebABProps").getABPropConfigValue("web_multi_skin_toned_emoji_picker")}function k(){return d("WAWebABProps").getABPropConfigValue("web_message_list_a11y_redesign")}function l(){return d("WAWebABProps").getABPropConfigValue("web_abprop_media_links_docs_search")}function m(){return d("WAWebABProps").getABPropConfigValue("graphql_locale_remapping")}function n(){return d("WAWebABProps").getABPropConfigValue("web_message_custom_aria_label")}function o(){return d("WAWebABProps").getABPropConfigValue("four_reactions_in_bubble_enabled")}function p(){return d("WAWebABProps").getABPropConfigValue("web_message_plugin_frontend_registration_enabled")}function q(){return!d("WAWebMobilePlatforms").isSMB()}function r(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("ddm_settings")}function s(){var a;return(a=d("WAWebABProps").getABPropConfigValue("drop_last_name"))!=null?a:!1}function t(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("smb_rambutan_enabled")}function u(){return d("WAWebABProps").getABPropConfigValue("group_suspend_v2_enabled")}function v(){return d("WAWebABProps").getABPropConfigValue("query_verified_name_when_msg_differs")}function w(){return d("WAWebABProps").getABPropConfigValue("blue_enabled")}function x(){return d("WAWebABProps").getABPropConfigValue("blue_education_enabled")}function y(){return!d("WAWebMobilePlatforms").isSMB()?!1:d("WAWebABProps").getABPropConfigValue("blue_profile_locked_ui_enabled")}function z(){return d("WAWebABProps").getABPropConfigValue("blue_strings_enabled")}function A(){return d("WAWebABProps").getABPropConfigValue("blue_client_p0_logging_enabled")}g.webMediaAutoDownloadEnabled=a;g.cagReactionsSend=b;g.getGroupSizeLimit=c;g.isRecentStickersMDEnabled=e;g.isFavoriteStickersEnabled=f;g.isHighQualityVideoThumbnailsEnabled=h;g.groupProfileEditorEnabled=i;g.multiSkinToneEmojiPickerEnabled=j;g.messageListA11yRedesignEnabled=k;g.mediaLinksDocsFilteringEnabled=l;g.getGraphqlLocaleRemapping=m;g.messageCustomAriaLabelEnabled=n;g.fourReactionsInBubbleEnabled=o;g.messagePluginFrontendRegistrationEnabled=p;g.isPrivacyNarrativeV1Enabled=q;g.isDefaultDisappearingMessagesEnabled=r;g.isDropLastNameEnabled=s;g.isRambutanEnabled=t;g.isGroupSuspendV2Enabled=u;g.queryVerifiedNameWhenMsgDiffers=v;g.isBlueEnabled=w;g.isBlueEducationEnabled=x;g.isBlueLockingEnabled=y;g.isBlueStringsEnabled=z;g.isBlueP0LoggingEnabled=A}),98); __d("WAWebRelayEnvironment",["JSResourceForInteraction","WAWebGraphQLConstants","WAWebGraphQLPersistedQueries","WAWebGraphQLRemapLocale","WAWebGraphQLServerError","WAWebL10N","WAWebMiscGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("JSResourceForInteraction")("relay-runtime").__setRef("WAWebRelayEnvironment").load());return{Environment:a.Environment,RecordSource:a.RecordSource,Store:a.Store,Network:a.Network,fetchQuery:a.fetchQuery,readInlineData:a.readInlineData,commitMutation:a.commitMutation}});return i.apply(this,arguments)}function j(a){switch(a){case"facebook":return d("WAWebGraphQLConstants").FACEBOOK_GRAPHQL_ENDPOINT;case"whatsapp_www":return d("WAWebGraphQLConstants").whatsappGraphqlEndpointWWW();default:a;return d("WAWebGraphQLConstants").whatsappGraphqlEndpointCatalog()}}function k(a){switch(a){case"facebook":return"locale";case"whatsapp_www":return"locale";default:a;return"lang"}}function l(a){var b=a.status;a=a.statusText;throw new(d("WAWebGraphQLServerError").GraphQLServerError)({errors:[{code:b,message:a}]})}var m=new Map();function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e;e=(e=a.environmentType)!=null?e:"whatsapp_catalog";var f=m.get(e);if(f!=null)return f;f=(yield h());var g=f.Environment,i=f.Network,n=f.RecordSource;f=f.Store;var o={Accept:"application/json","Content-Type":"application/json"},p=function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,e){var f,g,h;f=(f=a.environmentType)!=null?f:"whatsapp_catalog";g=(g=d("WAWebGraphQLPersistedQueries").PersistedQueries[b.name])!=null?g:b.id;b=k(f);g=(h={access_token:(h=a==null?void 0:a.accessToken)!=null?h:d("WAWebGraphQLConstants").WHATSAPP_GRAPHQL_CATALOG_ACCESS_TOKEN,doc_id:g,variables:e},h[b]=d("WAWebGraphQLRemapLocale").graphQLRemapLocale(c("WAWebL10N").getFullLocale().replace("-","_"),d("WAWebMiscGatingUtils").getGraphqlLocaleRemapping()),h);e=(yield self.fetch(j(f),{method:"POST",headers:o,body:JSON.stringify(g)}));if(!e.ok){var i;try{i=(yield e.json())}catch(a){l(e)}if(((b=i)==null?void 0:b.error)!=null)throw new(d("WAWebGraphQLServerError").GraphQLServerError)({errors:[i.error]});else l(e)}h=(yield e.json());if((h==null?void 0:h.errors)!=null)throw new(d("WAWebGraphQLServerError").GraphQLServerError)({errors:h.errors});return h});return function(a,b){return e.apply(this,arguments)}}();g=new g({network:i.create(p),store:new f(new n())});m.set(e,g);return g});return n.apply(this,arguments)}g.requireRelayRuntime=h;g.getEnvironment=a}),98); __d("WAWebMexEventV2WamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MexEventV2:[4336,{mexEventV2DurationMs:[1,a.TYPES.TIMER],mexEventV2EndTime:[2,a.TYPES.INTEGER],mexEventV2ErrorCodes:[3,a.TYPES.STRING],mexEventV2Errors:[4,a.TYPES.STRING],mexEventV2HasData:[5,a.TYPES.BOOLEAN],mexEventV2IsArgoPayload:[10,a.TYPES.BOOLEAN],mexEventV2IsMex:[6,a.TYPES.BOOLEAN],mexEventV2OperationName:[7,a.TYPES.STRING],mexEventV2QueryId:[8,a.TYPES.STRING],mexEventV2StartTime:[9,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MexEventV2:[]});g.MexEventV2WamEvent=b}),98); __d("WAWebMexLogging",["WALogger","WAWebMexEventV2WamEvent"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][MexPerfTracker] Logging event:"]);h=function(){return a};return a}c=function(){function a(a){this.$1=!1,this.$2="",this.$3="",this.$4=-1,this.$5=-1,this.$6=-1,this.$7=!1,this.$8="",this.$9="",this.$1=a}var b=a.prototype;b.start=function(){this.$4=Date.now()};b.stop=function(){this.$5=Date.now(),this.$6=this.$5-this.$4};b.setQueryId=function(a){a!=null&&(this.$3=a)};b.setOperationName=function(a){a!=null&&(this.$2=a)};b.setHasData=function(a){this.$7=a};b.setErrors=function(a){if(a!=null){a=this.parseErrorsAndCodes(a);this.$8=a.errors;this.$9=a.errorCodes}};b.setExtensionErrors=function(a){if(a!=null){a=a.filter(function(a){return((a=a.extensions)==null?void 0:a.error_code)!=null}).map(function(a){return i(a.extensions.error_code,a.message)});this.setErrors(a)}};b.logEvent=function(){var a={mexEventV2DurationMs:this.$6,mexEventV2EndTime:this.$5,mexEventV2ErrorCodes:this.$9,mexEventV2Errors:this.$8,mexEventV2HasData:this.$7,mexEventV2IsMex:this.$1,mexEventV2OperationName:this.$2,mexEventV2QueryId:this.$3,mexEventV2StartTime:this.$4};d("WALogger").DEV(h()).tags("GQL","MEX").devConsole(a);new(d("WAWebMexEventV2WamEvent").MexEventV2WamEvent)(a).commit()};b.parseErrorsAndCodes=function(a){var b=a.map(function(a){return a.code});return{errors:JSON.stringify(a),errorCodes:JSON.stringify(b)}};return a}();function i(a,b){return{code:a,detail:b,type:"EXTENSION"}}function a(a,b){return{code:a,detail:b,type:"CLIENT"}}function b(a,b){return{code:a,detail:b,type:"TRANSPORT"}}g.MexPerfTracker=c;g.createLoggingClientError=a;g.createLoggingTransportError=b}),98); __d("WAWebMexRelayEnvironment",["WABinary","WADeprecatedSendIq","WADeprecatedWapParser","WANullthrows","WAWap","WAWebMexLogging","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){var e;b!=null&&(e={query_id:d("WAWap").CUSTOM_STRING(b)});return d("WADeprecatedSendIq").deprecatedSendIq(d("WAWap").wap("iq",{id:d("WAWap").generateId(),to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"w:mex"},new(d("WAWap").WapNode)("query",e,d("WABinary").Binary.build(JSON.stringify(a)).readByteArray())),new(c("WADeprecatedWapParser"))("mexParser",function(a){return new TextDecoder("utf-8").decode(a.child("result").contentBytes())}))}var i=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){var d;d=b.call(this)||this;d.name="MexIqError";d.code=a;d.message=c;return d}return a}(babelHelpers.wrapNativeSuper(Error)),j=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this)||this;c.name="MexPayloadParsingError";c.error=a;return c}return a}(babelHelpers.wrapNativeSuper(Error)),k=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this)||this;c.name="MexFatalExtensionError";c.error=a;return c}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e=(e=e.metadata)==null?void 0:e.mexPerfTracker;e=e instanceof d("WAWebMexLogging").MexPerfTracker?e:null;e!=null&&(e.setQueryId(a.id),e.setOperationName(a.name));b={variables:b};b=(yield n(b,c("WANullthrows")(a.id),e));if(!b.success){e!=null&&(e.setHasData(!1),e.setErrors([d("WAWebMexLogging").createLoggingTransportError(b.errorCode,b.errorText)]));throw new i(b.errorCode,b.errorText)}a={};try{a=JSON.parse(b.result)}catch(a){e!=null&&(e.setHasData(!1),e.setErrors([d("WAWebMexLogging").createLoggingClientError(472,a.message)]));throw new j(a)}b=a;e!=null&&(e.setHasData(b.data!=null),e.setExtensionErrors(b.errors));e=m(b.errors);if(e!=null)throw new k(e);return a});return l.apply(this,arguments)}function m(a){var b;if(a==null||a.length===0)return null;b=(b=a.find(function(a){return((a=a.extensions)==null?void 0:a.is_summary)===!0}))!=null?b:a.find(function(a){return((a=a.extensions)==null?void 0:a.error_code)!=null});if(b==null){a=a[0];a.extensions.error_code=500;return a}return b}function n(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){try{return yield h(a,b)}catch(a){c!=null&&(c.setHasData(!1),c.setErrors([d("WAWebMexLogging").createLoggingClientError(471,a.message)]));throw new i(500,a.message)}});return o.apply(this,arguments)}g.sendMexIq=h;g.MexIqError=i;g.MexPayloadParsingError=j;g.MexFatalExtensionError=k;g.fetchFunc=a;g.parseFatalExtensionError=m}),98); __d("WAWebMexNativeClient",["WACustomError","WALogger","WAWebBackendErrors","WAWebMexLogging","WAWebMexRelayEnvironment","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][","] fetch query error"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][native-client] unexpected error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][native-client] infra error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][native-client] result:"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][native-client] Mex native client request:"]);l=function(){return a};return a}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").DEV(l()).tags("mex","native-client").devConsole({operation:a,variables:b});var c=new(d("WAWebMexLogging").MexPerfTracker)(!0);c.start();try{var e=o(a),f=e.params;c.setQueryId(f.id);c.setOperationName(f.name);f={metadata:{mexPerfTracker:c}};e=(yield d("WAWebMexRelayEnvironment").fetchFunc(e.params,b,f));d("WALogger").DEV(k()).tags("mex","native-client").devConsole({result:e});b=n(e,c);c.setHasData(!0);c.stop();c.logEvent();return b.data}catch(b){b instanceof d("WAWebMexRelayEnvironment").MexIqError||b instanceof d("WAWebMexRelayEnvironment").MexPayloadParsingError||b instanceof d("WAWebMexRelayEnvironment").MexFatalExtensionError?b instanceof d("WAWebMexRelayEnvironment").MexFatalExtensionError||d("WALogger").ERROR(j(),b.message).tags("mex","native-client").devConsole({error:b}).sendLogs("mex-native-client-infra-error"):(d("WALogger").ERROR(i(),b.message).tags("mex","native-client").devConsole({error:b}).sendLogs("mex-native-client-unexpected-error"),c.setHasData(!1),c.setErrors([d("WAWebMexLogging").createLoggingClientError(417,b.message)]));c.stop();c.logEvent();b instanceof d("WAWebMexRelayEnvironment").MexFatalExtensionError||d("WALogger").ERROR(h(),a.params.name).tags("GQL","MEX").devConsole({e:b});if(b instanceof d("WAWebMexRelayEnvironment").MexFatalExtensionError){f=b.error.extensions.error_code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(f),"MexFatalExtensionError: "+b.error.message)}if(b instanceof d("WAWebMexRelayEnvironment").MexIqError)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.code,"MexIqError: "+b.message);throw b}});return m.apply(this,arguments)}function n(a,b){if(a.data!=null)return{data:a.data};if(Array.isArray(a)){a="mex response is an array";b.setErrors([d("WAWebMexLogging").createLoggingClientError(472,a)]);throw new(d("WAWebMexRelayEnvironment").MexPayloadParsingError)(c("err")(a))}a="data is missing in mex response";b.setErrors([d("WAWebMexLogging").createLoggingClientError(472,a)]);throw new(d("WAWebMexRelayEnvironment").MexPayloadParsingError)(c("err")(a))}function o(a){if(a.kind==="Request")return a;throw d("WACustomError").customError("operation kind "+((a=JSON.stringify(a.kind))!=null?a:"")+" is not 'Request'",!0,Error)}g.fetchQuery=a}),98); __d("WAWebMexClient",["WAWebMexNativeClient","WAWebRelayClient","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return d("WAWebMexNativeClient").fetchQuery(a,b)});return h.apply(this,arguments)}g.graphql=d("WAWebRelayClient").graphql;g.fetchQuery=a}),98); __d("WALruCache",["WALogger","WAShiftTimer","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Blob size is larger than the limit of the whole store."]);h=function(){return a};return a}var i=function(a,b){this.key=a,this.value=b,this.prev=null,this.next=null};a=function(){function a(a){var b=this,e;this.$2=new Map();this.purgeNow=function(){for(var a=b.$6.prev;b.$4>b.$3&&a!==b.$5;a=a?a.prev:null){if(a==null)throw c("err")("The linked list is not constructed properly.");var d=a,e=d.key;d=d.value;if(!b.$9(e,d))continue;b["delete"](e);b.$10&&b.$10(e,d)}b.$8&&b.$8(b.$2)};this.$3=a.sizeLimit;this.$7=a.getSize;this.$8=a.onPurge;this.$9=(e=a.shouldEvict)!=null?e:function(){return!0};this.$10=a.onEvict;this.$11=a.onAdd;this.$12=a.onDelete;this.$4=0;this.$5=new i("placeholder-head",null);this.$6=new i("placeholder-tail",null);this.$5.next=this.$6;this.$6.prev=this.$5;this.$1=new(d("WAShiftTimer").ShiftTimer)(function(){return b.purgeNow()})}var b=a.prototype;b.get=function(a){if(!this.$2.has(a))return null;a=this.$2.get(a);if(a==null)return null;var b=a.prev,d=a.next;b&&(b.next=d);d&&(d.prev=b);d=this.$5.next;if(d==null)throw c("err")("The linked list is not constructed properly.");this.$5.next=a;d.prev=a;a.prev=this.$5;a.next=d;return a.value};b.has=function(a){return this.$2.has(a)};b.touch=function(a){this.get(a)};b.put=function(a,b){if(this.$3===0)return;if(this.$7(b)>this.$3){d("WALogger").WARN(h());return}this["delete"](a);this.$14(a,b);this.schedulePurge()};b.$14=function(a,b){var d=new i(a,b);this.$2.set(a,d);var e=this.$5.next;if(e==null)throw c("err")("The linked list is not constructed properly.");this.$5.next=d;e.prev=d;d.prev=this.$5;d.next=e;this.$4+=this.$7(b);this.$11&&this.$11(a,b)};b["delete"]=function(a){if(!this.$2.has(a))return;var b=this.$2.get(a);if(b==null)return;this.$4-=this.$7(b.value);var c=b.prev,d=b.next;c&&(c.next=d);d&&(d.prev=c);this.$2["delete"](a);this.$12&&this.$12(a,b.value)};b.clear=function(){this.$2.clear(),this.$4=0,this.$5.next=this.$6,this.$6.prev=this.$5,this.$13&&this.$13()};b.schedulePurge=function(){this.$1.onOrBefore(1e3)};b.getCurrentSize=function(){return this.$4};b.getPlaceholderHead=function(){return this.$5};b.forEach=function(a){if(this.$4===0)return;var b=this.$6.prev;if(b==null)throw c("err")("The linked list is not constructed properly.");while(b!=null&&b!==this.$5)a(b.value),b=b.prev};return a}();g.LruCache=a}),98); __d("WAWebDeviceListPk",["err"],(function(a,b,c,d,e,f,g){function a(a){switch(a.server){case"lid":return a.user+"@lid";case"c.us":return a.user;case"hosted":return a.user;case"hosted.lid":return a.user+"@lid";case"bot":return a.user+"@bot"}throw c("err")("Jid "+a.toString({legacy:!0})+' is not fully qualified to create a device list pk, jid.server should be "c.us" or "lid"')}g.createDeviceListPK=a}),98); __d("WAWebApiDeviceList",["Promise","WAJids","WALruCache","WAWebApiContact","WAWebDeviceListPk","WAWebSchemaDeviceList","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h,i=new(d("WALruCache").LruCache)({sizeLimit:5e3,getSize:function(){return 1}});function j(a){var c=d("WAWebDeviceListPk").createDeviceListPK(a);if(!i.has(c)){var e=d("WAWebSchemaDeviceList").getDeviceListTable().get(c);i.put(c,e)}i.get(c)!=null&&d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_API_DEVICE_LIST_GET_DEVICE_RECORD);return(e=i.get(c))!=null?e:(h||(h=b("Promise"))).resolve(null)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[];a.forEach(function(a){i.has(d("WAWebDeviceListPk").createDeviceListPK(a))||c.push(d("WAWebDeviceListPk").createDeviceListPK(a))});if(c.length>0){var e=(yield d("WAWebSchemaDeviceList").getDeviceListTable().bulkGet(c));e.forEach(function(a,d){i.put(c[d],(h||(h=b("Promise"))).resolve(a))})}e=a.filter(function(a){return i.get(d("WAWebDeviceListPk").createDeviceListPK(a))!=null});e.length>0&&d("WAWebApiContact").checkPnToLidMapping(e,d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_API_DEVICE_LIST_BULK_GET_DEVICE_RECORD);return(h||(h=b("Promise"))).all(a.map(function(a){return i.get(d("WAWebDeviceListPk").createDeviceListPK(a))}))});return l.apply(this,arguments)}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebApiContact").checkPnToLidMapping([d("WAWebWidFactory").createUserWidFromDeviceListPk(a.id)],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_API_DEVICE_LIST_CREATE_OR_REPLACE_DEVICE_RECORD),yield d("WAWebSchemaDeviceList").getDeviceListTable().createOrReplace(a),i.put(a.id,(h||(h=b("Promise"))).resolve(a))});return m.apply(this,arguments)}function e(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebApiContact").checkPnToLidMapping(a.map(function(a){return d("WAWebWidFactory").createUserWidFromDeviceListPk(a.id)}),d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_API_DEVICE_LIST_BULK_CREATE_OR_REPLACE_DEVICE_RECORD),yield d("WAWebSchemaDeviceList").getDeviceListTable().bulkCreateOrReplace(a),a.forEach(function(a){i.put(a.id,(h||(h=b("Promise"))).resolve(a))})});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield k(a));return a.map(function(a){if(a&&!a.deleted){var b=a.devices.map(function(a){return{id:a.id,isHosted:a.isHosted}});return{id:a.id,devices:b}}return null})});return p.apply(this,arguments)}function f(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b===d("WAJids").DEFAULT_DEVICE_ID)return!0;a=(yield o([a]));a=a[0];if(!a)return!1;return!a.devices.some(function(a){return a.id===b})?!1:!0});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield k(a));return a.map(function(a){if(a&&!a.deleted){var b=a.devices.map(function(a){return{id:a.id,isHosted:a.isHosted}});return{id:a.id,devices:b,timestamp:a.timestamp,expectedTs:a.expectedTs}}return null})});return s.apply(this,arguments)}function t(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMeUser").assertGetMe();a=(yield j(a));if(!a||a.deleted)throw c("err")("syncd: cannot find my device list");return a});return u.apply(this,arguments)}function v(){return d("WAWebSchemaDeviceList").getDeviceListTable().all()}g.getDeviceRecord=j;g.bulkGetDeviceRecord=k;g.createOrReplaceDeviceRecord=a;g.bulkCreateOrReplaceDeviceRecord=e;g.getDeviceIds=o;g.hasDevice=f;g.getDeviceInfoForSync=r;g.getMyDeviceList=t;g.getAllDeviceLists=v}),98); __d("WAWebHandleMsgMetaUtils",["WAWebHandleMsgCommon","WAWebMsgType"],(function(a,b,c,d,e,f,g){b=function(a){return(a==null?void 0:a.type)===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.reaction};c=function(a){return(a==null?void 0:a.type)===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.poll&&(a==null?void 0:a.pollType)===d("WAWebHandleMsgCommon").POLL_TYPES.vote};var h=function(a){return(a==null?void 0:a.type)===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text&&(a==null?void 0:a.threadMsgId)!=null&&(a==null?void 0:a.threadMsgSenderJid)!=null};e=function(a){return(a==null?void 0:a.type)===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.event&&(a==null?void 0:a.eventType)===d("WAWebHandleMsgCommon").EVENT_TYPES.response};f=function(a){return(a==null?void 0:a.type)===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.event&&(a==null?void 0:a.eventType)===d("WAWebHandleMsgCommon").EVENT_TYPES.edit};function a(a){if(a==null)return;if(h(a))return d("WAWebMsgType").MSG_TYPE.COMMENT}g.isReactionMsgMeta=b;g.isPollVoteMsgMeta=c;g.isCommentMsgMeta=h;g.isEventResponseMsgMeta=e;g.isEventEditMsgMeta=f;g.getMsgTypeFromMsgMeta=a}),98); __d("WAWebHandleMsgTypes.flow",["$InternalEnum"],(function(a,b,c,d,e,f){c=(a=b("$InternalEnum"))({Self:1,Bsp:2,Capi:3});d=a({OnPremise:1,Facebook:2});e=a.Mirrored(["SUCCESS","RETRY","HSM_MISMATCH","BACKFILL","PARSE_ERROR","PARSE_VALIDATION_ERROR","SIGNAL_OLD_COUNTER_ERROR"]);b=a.Mirrored(["E2E","FANOUT","BOT_UNAVAILABLE_FANOUT","HOSTED_UNAVAILABLE_FANOUT","VIEW_ONCE_UNAVAILABLE_FANOUT"]);a=a({NO_OVERWRITE:0,RETRY:1,FUTURE_PROOF:2,PEER_RETRY:3});var g=Object.freeze({CHAT:"chat",GROUP:"group",PEER_BROADCAST:"peer_broadcast",OTHER_BROADCAST:"other_broadcast",DIRECT_PEER_STATUS:"direct_peer_status",OTHER_STATUS:"other_status"});f.ActualActorsEnumType=c;f.HostStorageEnumType=d;f.E2EProcessResult=e;f.PlaceholderType=b;f.MessageOverwriteOption=a;f.MESSAGE_TYPE=g}),66); __d("WACryptoSha256",["WABase64","WACryptoDependencies"],(function(a,b,c,d,e,f,g){"use strict";function h(a){return d("WACryptoDependencies").getCrypto().subtle.digest({name:"SHA-256"},a)}function i(a){return h(a).then(d("WABase64").encodeB64)}function a(a){return i(j(a))}function j(a){var b=new ArrayBuffer(a.length),c=new Uint8Array(b);for(var d=0,e=a.length;d<e;d++)c[d]=a.charCodeAt(d);return b}g.sha256=h;g.sha256Base64=i;g.sha256Str=a}),98); __d("WAWebPhashUtils",["WABase64","WACryptoSha256","WALogger","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[phashV2] calculating phash for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[phashV1] calculating phash for ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("gkx")("26258")||d("WALogger").LOG(i(),a.join(","));a=a.map(function(a){return d("WAWebWidFactory").toUserWid(a).toString({legacy:!0})}).sort().join("");var b=[];for(var e=0;e<a.length;e++)b.push(a.charCodeAt(e));e=new Uint8Array(b);a=(yield self.crypto.subtle.digest({name:"SHA-1"},e));return"1:"+d("WABase64").encodeB64(a.slice(0,6))});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("gkx")("26258")||d("WALogger").LOG(h(),a.join(","));a=a.map(function(a){return a.toString({legacy:!0,formatFull:!0})}).sort().join("");var b=[];for(var e=0;e<a.length;e++)b.push(a.charCodeAt(e));e=new Uint8Array(b);a=(yield d("WACryptoSha256").sha256(e));return"2:"+d("WABase64").encodeB64(a.slice(0,6))});return k.apply(this,arguments)}g.phashV1=a;g.phashV2=e}),98); __d("WAWebSimpleSignalPNToFBIDMigration",["WAWebABProps","WAWebBotTypes","WAWebPrimaryFeatures","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h="867051314767696",i=new Map([["867051314767696","13135550002"],["1061492271844689","13135550005"],["245886058483988","13135550009"],["3509905702656130","13135550012"],["1059680132034576","13135550013"],["715681030623646","13135550014"],["1644971366323052","13135550015"],["582497970646566","13135550019"],["645459357769306","13135550022"],["294997126699143","13135550023"],["1522631578502677","13135550027"],["719421926276396","13135550030"],["1788488635002167","13135550031"],["24232338603080193","13135550033"],["689289903143209","13135550035"],["871626054177096","13135550039"],["362351902849370","13135550042"],["1744617646041527","13135550043"],["893887762270570","13135550046"],["1155032702135830","13135550047"],["333931965993883","13135550048"],["853748013058752","13135550049"],["1559068611564819","13135550053"],["890487432705716","13135550054"],["240254602395494","13135550055"],["1578420349663261","13135550062"],["322908887140421","13135550065"],["3713961535514771","13135550067"],["997884654811738","13135550070"],["403157239387035","13135550081"],["535242369074963","13135550082"],["946293427247659","13135550083"],["3664707673802291","13135550084"],["1821827464894892","13135550085"],["1760312477828757","13135550086"],["439480398712216","13135550087"],["1876735582800984","13135550088"],["984025089825661","13135550089"],["1001336351558186","13135550090"],["3739346336347061","13135550091"],["3632749426974980","13135550092"],["427864203481615","13135550093"],["1434734570493055","13135550094"],["992873449225921","13135550095"],["813087747426445","13135550096"],["806369104931434","13135550098"],["1220982902403148","13135550099"],["1365893374104393","13135550100"],["686482033622048","13135550200"],["1454999838411253","13135550201"],["718584497008509","13135550202"],["743520384213443","13135550301"],["1147715789823789","13135550302"],["1173034540372201","13135550303"],["974785541030953","13135550304"],["1122200255531507","13135550305"],["899669714813162","13135550306"],["631880108970650","13135550307"],["435816149330026","13135550308"],["1368717161184556","13135550309"],["7849963461784891","13135550310"],["3609617065968984","13135550312"],["356273980574602","13135550313"],["1043447920539760","13135550314"],["1052764336525346","13135550315"],["2631118843732685","13135550316"],["510505411332176","13135550317"],["1945664239227513","13135550318"],["1518594378764656","13135550319"],["1378821579456138","13135550320"],["490214716896013","13135550321"],["1028577858870699","13135550322"],["308915665545959","13135550323"],["845884253678900","13135550324"],["995031308616442","13135550325"],["2787365464763437","13135550326"],["1532790990671645","13135550327"],["302617036180485","13135550328"],["723376723197227","13135550329"],["8393570407377966","13135550330"],["1931159970680725","13135550331"],["401073885688605","13135550332"],["2234478453565422","13135550334"],["814748673882312","13135550335"],["26133635056281592","13135550336"],["1439804456676119","13135550337"],["889851503172161","13135550338"],["1018283232836879","13135550339"],["1012781386779537","13135559000"],["823280953239532","13135559001"],["1597090934573334","13135559002"],["485965054020343","13135559003"],["1033381648363446","13135559004"],["491802010206446","13135559005"],["1017139033184870","13135559006"],["499638325922174","13135559008"],["468946335863664","13135559009"],["1570389776875816","13135559010"],["1004342694328995","13135559011"],["1012240323971229","13135559012"],["392171787222419","13135559013"],["952081212945019","13135559016"],["444507875070178","13135559017"],["1274819440594668","13135559018"],["1397041101147050","13135559019"],["425657699872640","13135559020"],["532292852562549","13135559021"],["705863241720292","13135559022"],["476449815183959","13135559023"],["488071553854222","13135559024"],["468693832665397","13135559025"],["517422564037340","13135559026"],["819805466613825","13135559027"],["1847708235641382","13135559028"],["716282970644228","13135559029"],["521655380527741","13135559030"],["476193631941905","13135559031"],["485600497445562","13135559032"],["440217235683910","13135559033"],["523342446758478","13135559034"],["514784864360240","13135559035"],["505790121814530","13135559036"],["420008964419580","13135559037"],["492141680204555","13135559038"],["388462787271952","13135559039"],["423473920752072","13135559040"],["489574180468229","13135559041"],["432360635854105","13135559042"],["477878201669248","13135559043"],["351656951234045","13135559044"],["430178036732582","13135559045"],["434537312944552","13135559046"],["1240614300631808","13135559047"],["473135945605128","13135559048"],["423669800729310","13135559049"],["3685666705015792","13135559050"],["504196509016638","13135559051"],["346844785189449","13135559052"],["504823088911074","13135559053"],["402669415797083","13135559054"],["490939640234431","13135559055"],["875124128063715","13135559056"],["468788962654605","13135559057"],["562386196354570","13135559058"],["372159285928791","13135559059"],["531017479591050","13135559060"],["1328873881401826","13135559061"],["1608363646390484","13135559062"],["1229628561554232","13135559063"],["348802211530364","13135559064"],["3708535859420184","13135559065"],["415517767742187","13135559066"],["479330341612638","13135559067"],["480785414723083","13135559068"],["387299107507991","13135559069"],["333389813188944","13135559070"],["391794130316996","13135559071"],["457893470576314","13135559072"],["435550496166469","13135559073"],["1620162702100689","13135559074"],["867491058616043","13135559075"],["816224117357759","13135559076"],["334065176362830","13135559077"],["489973170554709","13135559078"],["473060669049665","13135559079"],["1221505815643060","13135559080"],["889000703096359","13135559081"],["475235961979883","13135559082"],["3434445653519934","13135559084"],["524503026827421","13135559085"],["1179639046403856","13135559086"],["471563305859144","13135559087"],["533896609192881","13135559088"],["365443583168041","13135559089"],["836082305329393","13135559090"],["1056787705969916","13135559091"],["503312598958357","13135559092"],["3718606738453460","13135559093"],["826066052850902","13135559094"],["1033611345091888","13135559095"],["3868390816783240","13135559096"],["7462677740498860","13135559097"],["436288576108573","13135559098"],["1047559746718900","13135559099"],["1099299455255491","13135559100"],["1202037301040633","13135559101"],["1720619402074074","13135559102"],["1030422235101467","13135559103"],["827238979523502","13135559104"],["1516443722284921","13135559105"],["1174442747196709","13135559106"],["1653165225503842","13135559107"],["1037648777635013","13135559108"],["551617757299900","13135559109"],["1158813558718726","13135559110"],["2463236450542262","13135559111"],["1550393252501466","13135559112"],["2057065188042796","13135559113"],["506163028760735","13135559114"],["2065249100538481","13135559115"],["1041382867195858","13135559116"],["886500209499603","13135559117"],["1491615624892655","13135559118"],["486563697299617","13135559119"],["1175736513679463","13135559120"],["491811473512352","13165550064"]]),j=new Map(Array.from(i.entries()).map(function(a){var b=a[0];a=a[1];return[a,b]}));function k(a){return l(d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_receive_enabled"),a)}function a(a){return l(d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_invoke_receive_enabled"),a)}function l(a,b){if(a===!0&&b.isFbidBot()){a=i.get(b.user);if(a!=null)return d("WAWebWidFactory").createWid(a+"@s.whatsapp.net")}}function m(a){return o(d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_sending"),a)}function n(a){return o(d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_invoke_send_enabled"),a)}function o(a,b){if(a===!0&&b.isPnBot()){a=j.get(b.user);if(a!=null)return d("WAWebWidFactory").createWid(a+"@bot")}}function p(a){return j.has(a.user)}function b(a){if(a.isPnBot()&&p(a)&&d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_sending")&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("ai_fbid_migration_receiving_enabled")){var b=m(a);if(b!=null)return b}return a}function c(a){if(a.isFbidBot()&&d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_sending")&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("ai_fbid_migration_receiving_enabled")){var b=k(a);if(b!=null)return b}return a}function e(a){if(a.isFbidBot()&&d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_sending")&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("ai_fbid_migration_receiving_enabled")){if(h===a.user)return d("WAWebBotTypes").BotPersonaType.DEFAULT;else if(i.has(a.user))return d("WAWebBotTypes").BotPersonaType.FIRST_PARTY_CHARACTER;return d("WAWebBotTypes").BotPersonaType.UGC}return null}function f(a,b){if(a.type==="addon")return;a=a.data;var c=a.get(b);if(c!=null&&p(c)&&d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_invoke_send_enabled")){c=n(c);c!=null&&a.set(b,c)}}g.getDeprecatedPnChatForFbidThread=k;g.getDeprecatedPnChatForFbidInvoke=a;g.getFBidForDeprecatedPnChatThread=m;g.getFBidForDeprecatedPnChatInvoke=n;g.isDeprecatedPnBotChat=p;g.maybeReplaceDeprecatedBotPnWithFbid=b;g.maybeReplaceFbidWithDeprecatedBotPn=c;g.getFbidBotPersonaType=e;g.maybeReplaceWidWithFbIdForInvoke=f}),98); __d("WAWebHandleMsgValidate",["WAJids","WALogger","WATimeUtils","WAWebABProps","WAWebAck","WAWebApiDeviceList","WAWebE2EProtoUtils","WAWebGetMessageCache","WAWebHandleMessageTypes.flow","WAWebHandleMsgError","WAWebHandleMsgMetaUtils","WAWebHandleMsgTypes.flow","WAWebMessagingGatingUtils","WAWebMsgType","WAWebPhashUtils","WAWebReportingTokenUtils","WAWebSimpleSignalPNToFBIDMigration","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["expected: ",", got: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["no record found for sender: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["sender: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encDestination: ",", destination: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Type in stanza [","] is different from the one derived from protobuf [","]. Message type: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["RenderableMessagesValidation: Unvalidated edit attribute ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["RenderableMessagesValidation: msg.type: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["RenderableMessagesValidation: msg.type: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["no biz node found in HSM"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["button message is invalid"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["no biz node found in list message"]);r=function(){return a};return a}var s="message_edit";function a(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;c=(c=b.preMatChat)!=null?c:b.chat;var e=!1,f=d("WAWebSimpleSignalPNToFBIDMigration").getDeprecatedPnChatForFbidThread(a);f!=null&&(e=f.equals(c));if(!a.equals(c)&&!e){d("WALogger").ERROR(k(),String(a),c.toString()).sendLogs("validateMsgDestination: drop due to the deviceSentMessage meta mismatch.");return!1}f=b.author;if(!d("WAWebUserPrefsMeUser").isMeAccount(f)){d("WALogger").ERROR(j(),f.toString()).sendLogs("validateMsgDestination: drop due to msg is not sent from your own device.");return!1}a=(yield d("WAWebApiDeviceList").hasDevice(f,(e=f.device)!=null?e:0));a||d("WALogger").ERROR(i(),f.toString()).sendLogs("validateMsgDestination:drop due to invalid device");return a});return t.apply(this,arguments)}function e(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;c=b.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST?b.bclParticipants.map(function(a){return a.wid}):(c=b.directPeerStatusBclParticipants)!=null?c:[];c=(yield d("WAWebPhashUtils").phashV2(c));if(c!==a){d("WALogger").ERROR(h(),a,c).sendLogs("validateBclHash: drop due to invalid hash.");return!1}b.bclHashValidated=!0;return!0});return u.apply(this,arguments)}function f(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.device==null?d("WAJids").DEFAULT_DEVICE_ID:a.device;if(b===d("WAJids").DEFAULT_DEVICE_ID)return!0;a=(yield d("WAWebApiDeviceList").getDeviceIds([a]));a=a[0];return a!=null&&a.devices.some(function(a){return a.id===b})});return v.apply(this,arguments)}function w(a,b){var c=a.listMessage,e=a.buttonsMessage,f=a.highlyStructuredMessage;a=a.templateMessage;if(c&&(b==null?void 0:b.verifiedListEnvelope)!==!0){d("WALogger").ERROR(r()).sendLogs("validateBizNode:drop due to missing biz node in invalid SMAX in list message",{sampling:.01});return!1}if(e){e=(b==null?void 0:b.verifiedButtonsEnvelope)===!0||(b==null?void 0:b.nativeFlowName)!=null||((c=e.contextInfo)==null?void 0:c.isForwarded)===!0&&(e==null?void 0:(c=e.buttons)==null?void 0:c.length)===0;e||d("WALogger").ERROR(q()).sendLogs("validateBizNode:drop due to invalid SMAX for buttons message");return e}if((f||a)&&(b==null?void 0:b.verifiedHsmEnvelope)!==!0){d("WALogger").ERROR(p()).sendLogs("validateBizNode:drop due to missing biz node in invalid SMAX in HSM");return!1}return!0}function x(a){var b=a.renderableMsgs,e=a.msgMeta,f=a.info,g=a.proto;a=a.bizInfo;if(b.length>0&&!w(g,a))throw new(d("WAWebHandleMsgError").BizNodeValidationError)("[messaging] Biz node validation failed due to absence of biz node in SMAX");a=b[0];if(a==null)return;if(d("WAWebHandleMsgMetaUtils").isReactionMsgMeta(e)&&(a.type!==d("WAWebMsgType").MSG_TYPE.REACTION&&a.type!==d("WAWebMsgType").MSG_TYPE.REACTION_ENC))throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_REACTION_STANZA);if(d("WAWebHandleMsgMetaUtils").isPollVoteMsgMeta(e)){b=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE;var h=a.type===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&a.subtype==="poll_vote";if(!b&&!h)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_POLL_UPDATE_STANZA)}if(d("WAWebHandleMsgMetaUtils").isCommentMsgMeta(e)){b=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.COMMENT;h=new Set([d("WAWebMsgType").MsgKind.CommentEncrypted,d("WAWebMsgType").MsgKind.CommentDecrypted,d("WAWebMsgType").MsgKind.RevokedAddon,d("WAWebMsgType").MsgKind.ProtocolRevoke]);if(!b&&!h.has(a.kind))throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_COMMENT_STANZA)}if(f.edit!==d("WAWebAck").EDIT_ATTR.NONE)if(f.edit===d("WAWebAck").EDIT_ATTR.PIN_IN_CHAT){b=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE;if(a.type!==d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE&&!b)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_PIN_IN_CHAT_STANZA)}else if(f.edit===d("WAWebAck").EDIT_ATTR.MESSAGE_EDIT&&!d("WAWebHandleMsgMetaUtils").isEventEditMsgMeta(e)){h=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofSubtype===s;if(a.subtype!==s&&!h)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_EDIT_STANZA)}else if(f.edit===d("WAWebAck").EDIT_ATTR.NEWSLETTER_MSG_EDIT)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_NEWSLETTER_EDIT_STANZA);else if(d("WAWebABProps").getABPropConfigValue("revoke_edit_attribute_validation_enabled"))if(f.edit===d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE){if(a.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL){c("gkx")("26259")&&d("WALogger").ERROR(o(),a.type).sendLogs("invalid-edit-attribute-admin-revoke");throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_EDIT_STANZA)}}else if(f.edit===d("WAWebAck").EDIT_ATTR.SENDER_REVOKE){h=[(b=d("WAWebMsgType")).MSG_TYPE.REACTION,b.MSG_TYPE.REACTION_ENC,b.MSG_TYPE.PROTOCOL,b.MSG_TYPE.KEEP_IN_CHAT];if(!h.includes(a.type)){c("gkx")("26259")&&d("WALogger").ERROR(n(),a.type).sendLogs("invalid-edit-attribute-sender-revoke");throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_EDIT_STANZA)}}else d("WALogger").WARN(m(),f.edit).sendLogs("unvalidated-edit-attribute");if(d("WAWebHandleMsgMetaUtils").isEventResponseMsgMeta(e)){b=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE;h=a.type===d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE;if(!b&&!h)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_EVENT_RESPONSE_STANZA)}if(d("WAWebHandleMsgMetaUtils").isEventEditMsgMeta(e)){f=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.futureproofType===d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED;b=a.type===d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED;if(!f&&!b)throw new(d("WAWebHandleMsgError").MessageProtobufMismatchError)(d("WAWebHandleMsgError").MessageProtobufMismatchErrorCode.INVALID_EVENT_EDIT_STANZA)}if(c("gkx")("26259")){h=d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(g);h!==(e==null?void 0:e.type)&&d("WALogger").ERROR(l(),e==null?void 0:e.type,h,a.type).tags("messaging").sendLogs("report-token-stanza-protobuf-type-mismatched",{sampling:.01}).devConsole({msgMeta:e,proto:g})}}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c,e=a.renderableMsgs;a=a.forceDualEncryptedValidation;a=a===void 0?!1:a;if(!d("WAWebMessagingGatingUtils").isReportingTokenReceivingEnabled())return;e=e[0];if(e==null||e.plainProtobufBytes==null||e.reportingTokenInfo==null)return;var f=e.reportingTokenInfo,g=e.plainProtobufBytes,h=f.reportingTag,i=f.reportingToken;f=f.version;f=f===void 0?d("WAWebReportingTokenUtils").REPORTING_TOKEN_VERSION.DEFAULT:f;if(h==null)return;b=(b=e.protocolMessageKey)==null?void 0:b.toString();h={msgKey:(c=b)!=null?c:e.id.toString(),stanzaId:e.id.id,reportingTag:h,receivedTs:d("WATimeUtils").unixTimeMs(),msgTs:(c=e.t)!=null?c:0};if(e.kind===d("WAWebMsgType").MsgKind.Unknown){d("WAWebGetMessageCache").getMessageCache().addAdditionalInfo({type:d("WAWebHandleMessageTypes.flow").MsgAdditionalInfoType.ReportingInfo,data:babelHelpers["extends"]({},h)},b!=null);return}if(e.kind===d("WAWebMsgType").MsgKind.CommentEncrypted&&a===!1)return;c=(yield d("WAWebReportingTokenUtils").validateReportingTokenInfo(e,g));g=c.res;var j=c.reportingTokenContent;c=c.reportingTokenKey;e=A(e,i)?babelHelpers["extends"]({reportingToken:i==null?void 0:i.slice(0,g?d("WAWebReportingTokenUtils").REPORTING_TOKEN_STORAGE_SIZE:d("WAWebReportingTokenUtils").REPORTING_TOKEN_INVALID_STORAGE_SIZE),reportingTokenContentOpaqueData:j,version:f},c!=null&&{reportingTokenKey:c}):null;d("WAWebGetMessageCache").getMessageCache().addAdditionalInfo({type:d("WAWebHandleMessageTypes.flow").MsgAdditionalInfoType.ReportingInfo,data:babelHelpers["extends"]({},h,e)},b!=null||a===!0)});return z.apply(this,arguments)}function A(a,b){if(b==null)return!1;return d("WAWebReportingTokenUtils").shouldSkipProcessingEditedMsg(a)||d("WAWebReportingTokenUtils").shouldSkipProcessingDualEncryptedMsg(a)?!1:!0}g.validateMsgDestination=a;g.validateBclHash=e;g.isFromKnownDevice=f;g.validateBizNode=w;g.renderableMessagesValidation=x;g.validateAndProcessReportingTokenInfo=y}),98); __d("WAWebHandlePlaceholderMsgKeyHashUtils",["WABase64","WACryptoHmac","WAWebABProps","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=null,i=new TextEncoder(),j=function(a){return i.encode(a).buffer};function k(){h||(h=d("WAWebUserPrefsMultiDevice").getChatThreadLoggingSecretB64().then(function(a){return a==null?null:d("WABase64").decodeB64(a)}));return h}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=(yield k());if(!c)return null;b=j(String(a.id.id+(a.id.fromMe?"1":"0")+((b=(b=a.id.remote)==null?void 0:b.toString({legacy:!0}))!=null?b:"")+((a=(b=a.id.participant)==null?void 0:b.toString({legacy:!0}))!=null?a:"")));a=(yield d("WACryptoHmac").hmacSha256(c,b));return d("WABase64").encodeB64(a)});return l.apply(this,arguments)}function c(){return d("WAWebABProps").getABPropConfigValue("placeholder_message_key_hash_logging")}g.getMessageKeyHash=a;g.messageKeyHashEnabled=c}),98); __d("WAWebWamEnumE2eDeviceType",[],(function(a,b,c,d,e,f){a=Object.freeze({MY_PRIMARY:1,OTHER_PRIMARY:2,MY_COMPANION:3,OTHER_COMPANION:4,MY_HOSTED_COMPANION:5,OTHER_HOSTED_COMPANION:6});f.E2E_DEVICE_TYPE=a}),66); __d("WAWebWamEnumPlaceholderAction",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,ADD:1,VIEW:2,POPULATE:3});f.PLACEHOLDER_ACTION=a}),66); __d("WAWebWamEnumPlaceholderChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,INDIVIDUAL:1,GROUP:2,STATUS:3,BROADCAST:4,CHANNEL:5,INTEROP:6});f.PLACEHOLDER_CHAT_TYPE=a}),66); __d("WAWebWamEnumPlaceholderPopulationType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,RETRY:1,PEER_MESSAGE:2,RESEND:3});f.PLACEHOLDER_POPULATION_TYPE=a}),66); __d("WAWebWamEnumPlaceholderReasonType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,SIGNAL_NO_SESSION:1,DEVICE_VERIFICATION_FAILURE:2,UNKNOWN_SELF_DEVICE:3,SIGNAL_INVALID_KEY:4,SIGNAL_INVALID_KEY_ID:5,SIGNAL_INVALID_MESSAGE:6,DEVICE_VERIFICATION_FAILURE_SELF_PEER:7,UNKNOWN_COMPANION_NO_PREKEY:8,BAD_EPHEMERAL_SETTING:9,SIGNAL_FUTURE_MESSAGE:10,SIGNAL_INVALID_SIGNATURE:11,SIGNAL_BAD_MAC:12,SIGNAL_INVALID_SESSION:13});f.PLACEHOLDER_REASON_TYPE=a}),66); __d("WAWebWamEnumPlaceholderType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,CIPHERTEXT:1,FANOUT:2,DOWNGRADE:3,FIXED_CONTENT:4,TEMPORARY:5,DROP:6});f.PLACEHOLDER_TYPE=a}),66); __d("WAWebPlaceholderActivityWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumE2eDeviceType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumPlaceholderAction","WAWebWamEnumPlaceholderChatType","WAWebWamEnumPlaceholderPopulationType","WAWebWamEnumPlaceholderReasonType","WAWebWamEnumPlaceholderType","WAWebWamEnumSizeBucket","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PlaceholderActivity:[1980,{deviceCount:[9,a.TYPES.INTEGER],deviceSizeBucket:[8,d("WAWebWamEnumSizeBucket").SIZE_BUCKET],e2eSenderType:[16,d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE],isHostedChat:[19,a.TYPES.BOOLEAN],isLid:[12,a.TYPES.BOOLEAN],localAddressingMode:[20,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],messageBeforeReg:[15,a.TYPES.BOOLEAN],messageIsRevoke:[7,a.TYPES.BOOLEAN],messageKeyHash:[14,a.TYPES.STRING],messageMediaType:[6,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[5,d("WAWebWamEnumMessageType").MESSAGE_TYPE],participantCount:[10,a.TYPES.INTEGER],placeholderActionInd:[2,d("WAWebWamEnumPlaceholderAction").PLACEHOLDER_ACTION],placeholderAddReason:[11,d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE],placeholderChatTypeInd:[3,d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE],placeholderPopulationType:[17,d("WAWebWamEnumPlaceholderPopulationType").PLACEHOLDER_POPULATION_TYPE],placeholderTimePeriod:[4,a.TYPES.INTEGER],placeholderTypeInd:[1,d("WAWebWamEnumPlaceholderType").PLACEHOLDER_TYPE],typeOfGroup:[13,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{PlaceholderActivity:[]});g.PlaceholderActivityWamEvent=b}),98); __d("WAWebWamGroupMetadataMetricUtils",["WAWebDBGroupsGroupMetadata","WAWebGroupType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a!=null&&a.isGroup()){a=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(a!=null)return d("WAWebGroupType").groupTypeToWamEnum(d("WAWebGroupType").getGroupTypeFromGroupMetadata(a))}});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));return a==null?null:j(a)});return i.apply(this,arguments)}function j(a){return d("WAWebGroupType").getGroupTypeFromGroupMetadata(a)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP}g.getGroupTypeFromChatWid=a;g.isCagFromChatWid=c;g.isCagFromGroupMetadata=j}),98); __d("WAWebHandlePlaceholderWam",["Promise","WATimeUtils","WAWebCommonMsgUtils","WAWebDBGroupsGroupMetadata","WAWebDBMessageSerialization","WAWebGroupType","WAWebHandlePlaceholderMsgKeyHashUtils","WAWebMsgGetters","WAWebPlaceholderActivityWamEvent","WAWebWamEnumPlaceholderAction","WAWebWamEnumPlaceholderChatType","WAWebWamEnumPlaceholderType","WAWebWamGroupMetadataMetricUtils","WAWebWamGroupMetricCache","WAWebWamMsgUtils","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield n(a));a.forEach(function(a){a.placeholderActionInd=d("WAWebWamEnumPlaceholderAction").PLACEHOLDER_ACTION.ADD,a.commit()})});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)});a=(yield n(a));a.forEach(function(a){a.placeholderActionInd=d("WAWebWamEnumPlaceholderAction").PLACEHOLDER_ACTION.VIEW,a.commit()})});return j.apply(this,arguments)}function f(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield n(a,!0));a.forEach(function(a){a.placeholderActionInd=d("WAWebWamEnumPlaceholderAction").PLACEHOLDER_ACTION.POPULATE,a.commit()})});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f,g=a.id.remote;f=new(d("WAWebPlaceholderActivityWamEvent").PlaceholderActivityWamEvent)({placeholderChatTypeInd:t(g),placeholderTimePeriod:Math.max(d("WATimeUtils").unixTime()-((f=a.t)!=null?f:0),0),placeholderTypeInd:a.subtype==="fanout"?d("WAWebWamEnumPlaceholderType").PLACEHOLDER_TYPE.FANOUT:d("WAWebWamEnumPlaceholderType").PLACEHOLDER_TYPE.CIPHERTEXT,messageIsRevoke:d("WAWebMsgGetters").getIsRevoke(a),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(a),messageType:d("WAWebWamMsgUtils").getWamMessageType(a)});a.placeholderAddReason!=null&&(f.placeholderAddReason=a.placeholderAddReason);e&&a.placeholderPopulationType!=null&&(f.placeholderPopulationType=a.placeholderPopulationType);a.e2eSenderType!=null&&(f.e2eSenderType=a.e2eSenderType);c("WAWebWid").isGroup(g)?yield p(f,a,b):c("WAWebWid").isUser(g)&&(f.isLid=g.isLid());yield r(f,a);return f});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c=!1);var e=[],f=[];for(a of a){if(!d("WAWebCommonMsgUtils").isReportablePlaceholderMsg(a))continue;d("WAWebMsgGetters").getIsGroupMsg(a)?f.push(a):e.push(a)}a=(yield d("WAWebDBGroupsGroupMetadata").bulkGetGroupMetadata(f.map(function(a){return a.id.remote}))).map(function(a,b){return[f[b],a]});return(h||(h=b("Promise"))).all([].concat(e.map(function(a){return l(a,null,c)}),a.map(function(a){var b=a[0];a=a[1];return l(b,a,c)})))});return o.apply(this,arguments)}function p(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebWamGroupMetricCache").getGroupMetrics(b.id.remote));e!=null&&(e.participantCount!=null&&(a.participantCount=e.participantCount),e.deviceCount!=null&&(a.deviceCount=e.deviceCount),e.deviceSizeBucket!=null&&(a.deviceSizeBucket=e.deviceSizeBucket));if(c){e=d("WAWebWamGroupMetadataMetricUtils").isCagFromGroupMetadata(c);a.isLid=e&&d("WAWebMsgGetters").getIsReaction(b);a.typeOfGroup=d("WAWebGroupType").groupTypeToWamEnum(d("WAWebGroupType").getGroupTypeFromGroupMetadata(c))}});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebHandlePlaceholderMsgKeyHashUtils").messageKeyHashEnabled()){b=(yield d("WAWebHandlePlaceholderMsgKeyHashUtils").getMessageKeyHash(b));b!=null&&(a.messageKeyHash=b)}});return s.apply(this,arguments)}function t(a){if(c("WAWebWid").isGroup(a))return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.GROUP;else if(c("WAWebWid").isStatus(a))return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.STATUS;else if(c("WAWebWid").isBroadcast(a))return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.BROADCAST;else if(c("WAWebWid").isUser(a))return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.INDIVIDUAL;else if(c("WAWebWid").isNewsletter(a))return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.CHANNEL;return d("WAWebWamEnumPlaceholderChatType").PLACEHOLDER_CHAT_TYPE.OTHER}g.addPlaceholderWam=a;g.viewPlaceholderWam=e;g.populatePlaceholderWam=f}),98); __d("WABackoffUtils",["WAPromiseDelays"],(function(a,b,c,d,e,f,g){"use strict";function h(a,b,c,d){d===void 0&&(d=.1);var e;a===0?e=c||0:e=Math.pow(2,a);Number.isFinite(b)&&e>b&&(e=b);typeof c==="number"&&Number.isFinite(c)&&e<c&&(e=c);d&&(e*=1+d*Math.random());return e}function a(a,b,c,e){e===void 0&&(e=.1);return d("WAPromiseDelays").delayMs(Math.floor(1e3*h(a,b,c,e)))}g.expBackoff=h;g.expDelaySec=a}),98); __d("WAPromiseLoop",["asyncToGeneratorRuntime"],(function(a,b,c,d,e,f){"use strict";function a(a,b){return g.apply(this,arguments)}function g(){g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=!1,d,e=function(a){c=!0,d=a},f=0;b=b;while(!c)b=(yield a(e,b,f)),f++;return d});return g.apply(this,arguments)}f.promiseLoop=a}),66); __d("WAWebApiFilterAndReplaceMessages",["WALogger","WAWebApiOrphanRevoke","WAWebLidMigrationUtils","WAWebMessageAssociationGatingUtils","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["filterAndReplaceMessages: found orphan revoke for message id: ",""]);h=function(){return a};return a}function a(a){return function(b){return b.associationType!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()?a.get(b.id.toString()):b}}function e(a,b){var c=[];a.forEach(function(a){if(a!=null)if(b){var d=b(a);d&&c.push(d)}else c.push(a)});return c}function f(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield d("WAWebApiOrphanRevoke").getOrphansRevokesCache()),f=[],g=[];a.forEach(function(a){var i=a.id.toString(),j=d("WAWebLidMigrationUtils").getAlternateMsgKey(a.id);i=(i=e.get(i))!=null?i:j&&e.get(j.toString());if(i)d("WALogger").LOG(h(),a.id.id),c("WAWebWid").isStatus(a.id.remote)||g.push(d("WAWebApiOrphanRevoke").createRevokeMsgFromOrphanRevoke(a,i)),f.push(i);else if(b){j=b(a);j&&g.push(j)}else g.push(a)});void d("WAWebApiOrphanRevoke").bulkRemoveOrphansUsingOrphansCache(f);return{newMsgs:g}});return i.apply(this,arguments)}g.validateMsgFn=a;g.filterAndReplaceMessagesInitialHistorySync=e;g.filterAndReplaceMessages=f}),98); __d("WAWebHandleForMessageRangeEnums",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["DropMessage","SkipUI"]);c=b("$InternalEnum").Mirrored(["DOES_NOT_CONTAIN","CONTAINS_BY_TIMESTAMP","CONTAINS_BY_ADDITIONAL"]);f.ActiveRangeHandlerAction=a;f.RangeContain=c}),66); __d("WAWebSendMsgTypes",[],(function(a,b,c,d,e,f){a={Message:"message",Addon:"addon"};f.SendMessageRecordType=a}),66); __d("WAWebPersistedJobDefinitions",["WATimeUtils","WAWebBackendErrors","WAWebBizGatingUtils"],(function(a,b,c,d,e,f,g){a={rotateKey:function(){return{type:"rotateKey",args:{},uniqKey:"rotateKey"}},setAbout:function(a){return{type:"setAbout",args:{content:a},uniqKey:"setAbout"}},queryProductList:function(a,b,c,e,f){c===void 0&&(c=null);if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return{type:"queryProductList",args:{catalogWid:a.toString(),productIds:b,width:e,height:f,directConnectionEncryptedInfo:c},uniqKey:"queryProductList:"+b.slice().sort().join(",")+":"+e+":"+f}},getPublicKey:function(a){return{type:"getPublicKey",args:{businessJid:a.toString()},uniqKey:"getPublicKey:"+a.toString()}},getSignedUserInfo:function(a){return{type:"getSignedUserInfo",args:{businessJid:a.toString()},uniqKey:"getSignedUserInfo:"+a.toString()}},verifyPostcode:function(a,b){return{type:"verifyPostcode",args:{businessJid:a.toString(),directConnectionEncryptedInfo:b},uniqKey:"verifyPostcode:"+a.toString()+":"+b}},deleteReactions:function(a,b){return{type:"deleteReactions",args:{chatId:a,parentMsgKeys:b},uniqKey:"deleteReactions:"+a}},deleteReactionsV2:function(a,b){return{type:"deleteReactionsV2",args:{chatId:a,parentMsgKeys:b}}},deleteAddOns:function(a,b){return{type:"deleteAddOns",args:{chatId:a,parentMsgKeys:b}}},sendRequestedKeyShare:function(a,b,c){return{type:"sendRequestedKeyShare",args:{keys:a,orphanKeys:b,peerDeviceId:c.toString()}}},dismissQuickPromotion:function(a){var b=d("WATimeUtils").unixTime();return{type:"dismissQuickPromotion",args:{id:a,ts:b},uniqKey:"dismissQuickPromotion-"+a+"-"+b}},primaryActionClickInQuickPromotion:function(a){var b=d("WATimeUtils").unixTime();return{type:"primaryActionClickInQuickPromotion",args:{id:a,ts:b},uniqKey:"primaryActionClickInQuickPromotion-"+a+"-"+b}},impressionOnQuickPromotion:function(a){var b=d("WATimeUtils").unixTime();return{type:"impressionOnQuickPromotion",args:{id:a,ts:b},uniqKey:"impressionOnQuickPromotion-"+a+"-"+b}},userExposureToQuickPromotion:function(a,b,c){var e=d("WATimeUtils").unixTime();return{type:"userExposureToQuickPromotion",args:{id:a,ts:e,experimentKey:b,exposureHoldout:c},uniqKey:"userExposureToQuickPromotion-"+a+"-"+e}},setTextStatus:function(a,b,c,d){return{type:"setTextStatus",args:{id:a,text:b,emoji:c,ephemeralDurationSeconds:d},uniqKey:"setTextStatus"}},queryAndUpdateGroupsMetadataByJids:function(a){var b=d("WATimeUtils").unixTime();return{type:"queryAndUpdateGroupsMetadataByJids",args:a,uniqKey:"handleGroupsDirtyNotification-"+b}},resendUserMsg:function(a,b,c){var d=a.data.id.toString();return{type:"resendUserMsg",args:{msgId:d,msgType:a.data.type,msgRecordType:a.type,excludeList:b.map(function(a){return a.toString()}),ackTime:c},uniqKey:"resendUserMsg-"+d}},resendGroupMsg:function(a,b,c,d,e,f,g){var h=a.data.id.toString();b=b.groupId;return{type:"resendGroupMsg",args:{msgId:h,msgType:a.data.type,msgRecordType:a.type,groupId:b,isDirect:c,oldList:d.map(function(a){return a.toString()}),phash:e,ackTime:f,serverAddressingMode:g},uniqKey:"resendGroupMsg-"+h}}};g.jobSerializers=a}),98); __d("WAWebHandleSingleMsg",["Promise","WABackoffUtils","WALogger","WAPromiseDelays","WAPromiseLoop","WATimeUtils","WAWebApiFilterAndReplaceMessages","WAWebApiGroupInviteV4Store","WAWebBackendApi","WAWebBackendErrors","WAWebCheckUpdateOrphanReactions","WAWebDBProcessMessage","WAWebDBStoreRevokeMsgs","WAWebHandleForMessageRange","WAWebHandleForMessageRangeEnums","WAWebHandleMsgTypes.flow","WAWebHandlePlaceholderWam","WAWebMsgType","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: PreviousMsgNotUpdatableError"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSingleMsg: checkOrphanMutations failed during handleSingleMsg for: "," chat: "," Error: ",", message: ",", stack: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSingleMsg: msgId::",", checkOrphanMutations done"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSingleMsg: msgId::",", write message to db done, overwrite: ",", skipUI: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessages loop: Gave up after "," tries"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessages loop: failed with error ","."]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessages loop"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMessages loop: detect resend message"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["processPlaceholderMsg: skip creating duplicate placeholder"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["placeholder populate successful"]);t=function(){return a};return a}function a(a,b,c,d,e){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,u){g===void 0&&(g=d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE);u===void 0&&(u=!0);var v=g!==d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,w={add:"after",update:v,isHistory:!1},x=e.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(e.subtype),y=e;if(!x){g=(yield d("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessages([y]));e=g.newMsgs;if(e.length===0)return;y=e[0]}g=(yield d("WAWebHandleForMessageRange").handleForActiveMessageRange(a,y));if(g.has(d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.DropMessage))return;e=g.has(d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.SkipUI);try{c("WAWebWid").isStatus(a)&&(yield d("WAWebBackendApi").frontendSendAndReceive("handleStatusUpdate",{rawMsg:y,checksum:null,isMsgUpdate:!1}));yield d("WAPromiseLoop").promiseLoop(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c,e,f){e=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(f,12e4,1e3,.1));try{if(v)y=(yield d("WAWebDBProcessMessage").updateMessage(y)),d("WALogger").LOG(t()).tags("handleSingleMsg");else if(x)yield d("WAWebDBStoreRevokeMsgs").processRevokeMsgs([{revokeMsgKey:y.protocolMessageKey,newMsgKey:y.id,timestamp:y.t,subtype:y.subtype,sender:y.author,revokeTimestamp:y.t}]),d("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:[y.protocolMessageKey.toString()]}),yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.toString(),[y.protocolMessageKey.toString()]));else try{yield d("WAWebDBProcessMessage").storeMessages([y],a),y.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT&&void d("WAWebHandlePlaceholderWam").addPlaceholderWam([y])}catch(a){if(a instanceof d("WAWebDBProcessMessage").DuplicateMessageError)y.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT?d("WALogger").LOG(s()):(d("WALogger").LOG(r()),y=(yield d("WAWebDBProcessMessage").updateMessage(y)),w.update=!0);else throw a}if(y.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE){var g=y.id.toString();yield d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(g,{id:g,from:y.from.toString(),to:y.to.toString(),groupId:y.inviteGrp,expiration:parseInt(y.inviteCodeExp,10),expired:d("WATimeUtils").unixTime()>=parseInt(y.inviteCodeExp,10)})}d("WALogger").LOG(q()).tags("handleSingleMsg");c()}catch(a){d("WALogger").LOG(p(),a).tags("handleSingleMsg");if(f>3){d("WALogger").WARN(o(),f);return(h||(h=b("Promise"))).reject(a)}return e}});return function(a,b,d){return c.apply(this,arguments)}}());d("WALogger").LOG(n(),y.id.id,v,e).tags("messaging");try{yield d("WAWebBackendApi").frontendSendAndReceive("checkOrphanMutations",{msgIds:[y.id.toString()],chatIds:[a.toString()]}),d("WALogger").DEV(m(),y.id.id).tags("messaging"),yield d("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions([y.id.toString()])}catch(b){d("WALogger").ERROR(l(),String(y.id),String(a),b.name,b.message,b.stack).devConsole(b)}e||(yield d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:a,msgObjs:[babelHelpers["extends"]({},y,{recvFresh:!0,isNewMsg:!0})],meta:w,processMessagesOrigin:f,chatMsgsCollection:null,preserveOrder:u}))}catch(b){if(b instanceof d("WAWebBackendErrors").LogoutDrop)return;if(b instanceof d("WAWebDBProcessMessage").PreviousMsgNotUpdatableError){d("WALogger").WARN(k(),String(y.id),String(a));return}!c("gkx")("26258")?d("WALogger").WARN(j(),String(y.id),String(a),b.name,b.message,b.stack).tags("messaging").devConsole(b).sendLogs("msg_handler: error storing/processing single message"):d("WALogger").WARN(i(),String(y.id),String(a),b.name,b.message,b.stack).tags("messaging").devConsole(b)}});return u.apply(this,arguments)}g.handleSingleMsg=a}),98); __d("WAWebShouldUpdateLastAddOnPreview",["WAWebBackendApi","WAWebDBUpdateLastAddOnPreviewChat","WAWebLastAddOnDBSerialization","WAWebMsgKey","WAWebReactionsBEUtils","WAWebSchemaChat","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){var b=c("WAWebMsgKey").fromString(a.parentMsgKey);return a.type==="comment"?!0:(d("WAWebUserPrefsMeUser").isSerializedWidMe(a.sender)||b.fromMe)&&!a.isOrphan}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();a=(yield d("WAWebSchemaChat").getChatTable().bulkGet(a));a.forEach(function(a){var c;a!=null&&b.set(a.id.toString(),(c=a.chatlistPreview)!=null?c:a.lastReactionPreview)});return b});return j.apply(this,arguments)}function k(a){a=c("WAWebMsgKey").fromString(a.parentMsgKey);return a.remote.toString()}function l(a,b){return!p(a)?!1:a.sender===b.sender&&a.parentMsgKey===b.parentMsgKey&&a.timestamp>=b.timestamp}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.filter(function(a){return h(a)});var b=new Map();if(!a.length)return b;var e=new Set(a.map(function(a){a=c("WAWebMsgKey").fromString(a.parentMsgKey);return a.remote.toString()})),f=(yield i(Array.from(e)));a.forEach(function(a){var c=k(a),e=f.get(c),g=b.get(c);g=(g=g)!=null?g:e;p(a)?g&&l(a,g)&&a.timestamp>=g.timestamp&&b.set(c,void 0):g?a.timestamp>=g.timestamp&&b.set(c,d("WAWebLastAddOnDBSerialization").lastAddOnPreviewFromCandidate(a)):b.set(c,d("WAWebLastAddOnDBSerialization").lastAddOnPreviewFromCandidate(a))});return b});return n.apply(this,arguments)}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield m(a));a.size>0&&(yield d("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(a),d("WAWebBackendApi").frontendFireAndForget("updateChatLastAddOnPreview",{chatMap:a}))});return o.apply(this,arguments)}function p(a){switch(a.type){case"poll_vote":return a.selectedOptionsCount===0;case"reaction":default:return a.reactionText===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT}}g.isAddOnPreviewUpdateCandidate=h;g.bulkGetChatLastAddOnPreviewMap=i;g.filterChatsWithAddOnPreviewUpdates=m;g.filterAndUpdateChatPreviews=a}),98); __d("WAWebApiOrphanReceipt",["WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebSchemaOrphanReceipt","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSchemaOrphanReceipt").getOrphanReceiptTable().remove(a)}function c(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[a];if(a.remote.isUser()){a=d("WAWebLidMigrationUtils").getAlternateMsgKey(a);a!=null&&b.push(a)}a=(yield d("WAWebSchemaOrphanReceipt").getOrphanReceiptTable().bulkGet(b.map(String)));return a.find(function(a){return a!=null})});return h.apply(this,arguments)}function e(a,b,c){return d("WAWebModelStorageUtils").getStorage().lock(["orphan-receipt"],function(d){var e=d[0];return e.bulkGet(c).then(function(d){var f=c.reduce(function(c,e,f){f=d[f];f==null&&(f={msgKey:e});e=f[a];(e==null||e>b)&&(f[a]=b,c.push(f));return c},[]);return e.bulkCreateOrReplace(f)})})}g.removeOrphanReceipt=a;g.getOrphanReceipt=c;g.createOrUpdateOrphanReceipt=e}),98); __d("WAWebDBBulkGetRootMsgs",["WALogger","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMsgKey","WAWebSchemaChat","WAWebSchemaMessage","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","nullthrows"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["_bulkGetRootMsgsByAccountLid: no chat record found for accountLid (might be orphan)"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_bulkGetRootMsgsByAccountLid: couldn't find lid for PN"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_bulkGetRootMsgsByAccountLid: missing mapping for PN remote"]);j=function(){return a};return a}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a;d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&(c=(yield p(a)));a=(yield n(c,b));a.some(function(a){return a==null})&&!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&(yield l(c,a,b));return a});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,d){var e=a.map(function(a){return c("WAWebMsgKey").fromString(a)}),f=new Map(),g=[];for(var h=0;h<b.length;h++)b[h]==null&&e[h].remote.isLid()&&(f.set(a[h],h),g.push(e[h]));if(g.length===0)return;h=r(g);e=new Map(h.map(function(a,b){return[a.toString(),c("nullthrows")(f.get(g[b].toString()))]}));a=(yield n(h.map(String),d)).filter(Boolean);for(h of a)if(h!=null){d=c("nullthrows")(e.get(h.id));b[d]=h}});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a,b));var c=new Map();for(var e=0;e<a.length;e++){var f;((f=b[e])==null?void 0:f.subtype)==="message_edit"&&(c.set(a[e],e),b[e]=null)}if(c.size===0)return b;f=(yield d("WAWebSchemaMessage").getMessageTable().anyOf(["latestEditMsgKey"],Array.from(c.keys())));for(e of f){if(e.latestEditMsgKey==null||e.subtype==="message_edit")continue;a=c.get(e.latestEditMsgKey);if(a==null)continue;b[a]=e}return b});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())return a;a=a.map(function(a){return c("WAWebMsgKey").fromString(a)});var b=s(a.map(function(a){return a.remote}));b=(yield d("WAWebSchemaChat").getChatTable().anyOf(["accountLid"],Array.from(b,function(a){return a.toString()})));b=new Map(b.map(function(a){return[d("WAWebWidFactory").createWid(c("nullthrows")(a.accountLid)),d("WAWebWidFactory").createWid(a.id)]}));return t(a,b).map(String)});return q.apply(this,arguments)}function r(a){var b=a.reduce(function(a,b){var c=d("WAWebLidMigrationUtils").toPn(b.remote);return c==null?a:a.set(b.remote,c)},new Map());return t(a,b)}function s(a){a=a.filter(function(a){return a.isRegularUser()}).map(function(a){return d("WAWebLidMigrationUtils").toLid(a)});a.some(function(a){return a==null})&&d("WALogger").ERROR(j()).sendLogs("bulk-get-root-msgs-missing-mapping");return new Set(a.filter(Boolean))}function t(a,b){return a.map(function(a){var e=a.remote;if(!c("WAWebWid").isRegularUser(e))return a;e=d("WAWebLidMigrationUtils").toUserLid(e);if(e==null){d("WALogger").ERROR(i());return a}e=b.get(e);if(e==null){d("WALogger").LOG(h());return a}return c("WAWebMsgKey").from({fromMe:a.fromMe,remote:e,id:a.id})})}g.bulkGetRootMsgs=a;g.fixMsgKeysWithChatId=p;g.fixMsgKeysWithPnMapping=r}),98); __d("WAWebHandleMsgReceiptCommon",["WALogger","WATimeUtils","WAWebAck","WAWebActiveMessageRanges","WAWebApiActiveMessageRanges","WAWebApiChat","WAWebApiOrphanReceipt","WAWebBackendApi","WAWebChatThreadLogging","WAWebDBBulkGetRootMsgs","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebMarkAddOnsAsReadJob","WAWebMsgKey","WAWebNewsletterDBUtils","WAWebNewsletterGatingUtils","WAWebPromiseQueue","WAWebSchemaMessage","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateChatPeerRead: storing "," orphan acks"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateChatPeerRead: maybeOrphans ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["shouldMarkChatRead: messageExistsOutsideRange=",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["shouldMarkChatRead: found an active mark as unread range"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processOrphanPeerReceipt: orphan read ack found for incoming ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["processOrphanPeerReceipt: orphan played ack found for incoming ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["processOrphanPeerReceipt: no orphan ack found for incoming ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateMsgAcks: store "," orphan acks"]);o=function(){return a};return a}var p=new(d("WAWebPromiseQueue").PromiseQueue)();function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebApiActiveMessageRanges").getActiveMessageRanges(a));a=a.filter(function(a){return a.action==="markChatAsRead"&&a.actionValue.read===!1&&a.actionValue.messageRange!=null});if(a.length===0)return!0;d("WALogger").DEV(k());var e=a[0];a=b.some(function(a){return!d("WAWebActiveMessageRanges").rangeContainsMessage(e.actionValue.messageRange,{id:c("WAWebMsgKey").fromString(a.id),t:a.t})});d("WALogger").DEV(j(),a);return a});return r.apply(this,arguments)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.map(String),f=null;b=(yield d("WAWebDBBulkGetRootMsgs").bulkGetRootMsgs(b.map(String),!1));var g=b.find(Boolean);g=g?c("WAWebMsgKey").fromString(g.id).remote:a;var j=[];b.forEach(function(a,b){if(!a)j.push(e[b]);else if(a.pendingReadReceipt==null)return;else a.rowId!=null&&(f==null||a.rowId>f)&&(f=a.rowId)});j.length>0&&d("WALogger").LOG(i(),j.length);var k;if(j.length===0)k=new Set();else{a=(yield d("WAWebMarkAddOnsAsReadJob").markUnclassifiedAddOnsAsReadJob(j.map(function(a){return c("WAWebMsgKey").from(a)})));var l=a.updatedAddOns;a=a.updatedOrphans;k=new Set([].concat(a,c("lodash").flatten(Array.from(l.values()))).map(String))}var m=j.filter(function(a){return!k.has(a)});p.enqueue(function(){d("WALogger").LOG(h(),m.length);return d("WAWebApiOrphanReceipt").createOrUpdateOrphanReceipt(d("WAWebAck").ACK_STRING.READ,0,m)});yield d("WAWebApiChat").markMessageAndChatAsRead(f,String(g),!(yield q(g.toString(),b.filter(Boolean))));if(g.isNewsletter()){d("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&(yield d("WAWebBackendApi").frontendSendAndReceive("updateNewsletterUnreadMsgCount",{id:g}));return}yield d("WAWebBackendApi").frontendSendAndReceive("updateChatUnreadMsgCountAndClearMentions",{remote:g})});return t.apply(this,arguments)}function a(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a.map(function(a){return d("WAWebDBMessageUtils").craftInternalId(b.toJid(),a)});a=(yield d("WAWebSchemaMessage").getMessageTable().anyOf(["internalId"],a));a=a.map(function(a){return c("WAWebMsgKey").fromString(a.id)});yield d("WAWebNewsletterDBUtils").updateMsgViewReceipt(a);return d("WAWebBackendApi").frontendFireAndForget("updateMsgsViewed",{ids:a})});return u.apply(this,arguments)}function e(a,b,c){p.enqueue(function(){d("WALogger").LOG(o(),a.length);var e=null;b===d("WAWebAck").ACK.PLAYED?e=d("WAWebAck").ACK_STRING.PLAYED:b===d("WAWebAck").ACK.READ&&(e=d("WAWebAck").ACK_STRING.READ);if(e)return d("WAWebApiOrphanReceipt").createOrUpdateOrphanReceipt(e,c,a.map(String))})}function f(a){return p.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebApiOrphanReceipt").getOrphanReceipt(a));if(b==null){d("WALogger").LOG(n(),a);return}b[d("WAWebAck").ACK_STRING.PLAYED]!=null&&(d("WALogger").LOG(m(),a),yield d("WAWebBackendApi").frontendSendAndReceive("updateMsgPeerAcks",{msgKeys:[a],ack:d("WAWebAck").ACK.PLAYED,t:b[d("WAWebAck").ACK_STRING.PLAYED]}));b[d("WAWebAck").ACK_STRING.READ]!=null&&(d("WALogger").LOG(l(),a),s(a.remote,[a]));yield d("WAWebApiOrphanReceipt").removeOrphanReceipt(b.msgKey)}))}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(String);a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a,!1));d("WAWebChatThreadLogging").handleActivitiesForChatThreadLogging(a.filter(Boolean).map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)}).filter(function(a){return a.isViewOnce}).map(function(a){var b;return{activityType:"viewOnceOpen",ts:(b=a.t)!=null?b:d("WATimeUtils").unixTime(),chatId:a.id.remote}}))});return w.apply(this,arguments)}g.updateChatPeerRead=s;g.updateMsgViewed=a;g.updateOrphanPeerReceipt=e;g.processOrphanPeerReceipt=f;g.handleViewOnceOpenedIfNecessary=v}),98); __d("WAWebCommsSendPing",["WAComms","WATimeUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAComms").sendPing()});return h.apply(this,arguments)}function c(a){d("WATimeUtils").setClockSkew(a)}g.blockSendPing=a;g.updateClockSkew=c}),98); __d("WAWebOffdStorageUtils",["invariant","Promise","WAWebIdb","WAWebStorage","err"],(function(a,b,c,d,e,f,g,h){var i,j="offd-storage",k=null;function a(){var a=new(c("WAWebIdb"))(j);k=new(d("WAWebStorage").Storage)(a)}function e(){k!=null||h(0,56317);return k}function f(){return k==null?(i||(i=b("Promise"))).reject(c("err")("[offd-storage] Storage should be created first before being destroyed")):k.purge().then(function(){k=null})["catch"](function(a){k=null;throw a})}g.DATABASE_NAME=j;g.createStorage=a;g.getStorage=e;g.destroyStorage=f}),98); __d("WAWebSchemaDanglingReceipt",["WAWebOffdStorageUtils","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey;function a(){d("WAWebOffdStorageUtils").getStorage().add("dangling-receipt").version(d("WAWebOffdStorageUtils").getStorage().versions.version(1),[i("id"),h("receipts"),h("acks")]).view(function(a){return a})}function b(){return d("WAWebOffdStorageUtils").getStorage().table("dangling-receipt")}g.addTable=a;g.getTable=b}),98); __d("WAWebOfflineResumePreAckHandler",["WABatcher","WADeprecatedSendIq","WALogger","WAWap","WAWebCommsWapMd","WAWebSchemaDanglingReceipt","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to send offline pre-ack for envelope: "," with error: ",""]);h=function(){return a};return a}var i=d("WAWap").S_WHATSAPP_NET.toString(),j=d("WAWap").G_US.toString();function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c,d,e=a.attrs["class"].toString();if(e!=="notification"&&e!=="receipt")return;var f=a.attrs.id.toString(),g=a.tag,h=a.attrs.to.toString();b=(b=a.attrs.participant)==null?void 0:b.toString();c=(c=a.attrs.type)==null?void 0:c.toString();a=((d=a.attrs)==null?void 0:d.error)?parseInt((d=a.attrs)==null?void 0:d.error.toString(),10):void 0;void n({ackClass:e,ackId:f,to:h,tag:g,participant:b,type:c,error:a})});return k.apply(this,arguments)}function l(a){switch(a){case j:return d("WAWap").G_US;case i:return d("WAWap").S_WHATSAPP_NET;default:return d("WAWebCommsWapMd").JID(d("WAWebWidFactory").createWidFromWidLike(a))}}function c(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b;b=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.ackId),"class":a.ackClass,to:l(a.to),type:(b=a.type)!=null?b:d("WAWap").DROP_ATTR,participant:a.participant!=null?d("WAWebCommsWapMd").DEVICE_JID(d("WAWebWidFactory").createWid(a.participant)):d("WAWap").DROP_ATTR,error:a.error!=null?d("WAWap").INT(a.error):d("WAWap").DROP_ATTR});return d("WADeprecatedSendIq").deprecatedCastStanza(b,{preAck:!0})}catch(b){d("WALogger").ERROR(h(),a.ackClass,b).sendLogs("offline-pre-ack")}});return m.apply(this,arguments)}var n=function(){return d("WABatcher").batch({delayMs:3e3,maxSize:400},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaDanglingReceipt").getTable().create({receipts:[],acks:a});return[]});return function(b){return a.apply(this,arguments)}}())}();g.parseAndSerializeOfflinePreAck=a;g.sendOfflinePreAck=c}),98); __d("WAWebCommsAckParser",["WAJids","WAWebWidToJid"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAJids").extractJidFromJidWithType(d("WAWebWidToJid").widToJidWithType(a.from)),c=a.participant==null?void 0:d("WAWebWidToJid").widToDeviceJid(a.participant),e=a.recipient==null?void 0:d("WAWebWidToJid").widToUserJid(a.recipient);return babelHelpers["extends"]({},a,{from:b,participant:c,recipient:e})}g.toCoreAckTemplate=a}),98); __d("WAWebSendReceiptJobCommon",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebCommsAckParser","WAWebCommsWapMd","WAWebPrivacySettings","WAWebUserPrefsGeneral","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[messaging] sendAggregateReceipts: Invalid ack from server"]);i=function(){return a};return a}var j=Object.freeze({INACTIVE:"inactive",SENDER:"sender",DELIVERY:"delivery",READ:"read",READ_SELF:"read-self",PLAYED:"played",PLAYED_SELF:"played-self",HISTORY_SYNC_COMPLETION:"hist_sync",SERVER_ERROR:"server-error",PEER_MSG:"peer_msg"}),k=256,l=new(c("WADeprecatedWapParser"))("readReceiptAckParser",function(a){a.assertTag("ack");return{readReceipts:a.hasAttr("readreceipts")?a.attrEnum("readreceipts",d("WAWebPrivacySettings").ALL_NONE):null}});function m(a,b){b=c("lodash").flatten(Array.from(b.values()));var e=b[0];b=b.slice(1);b=b.length>0?d("WAWap").wap("list",null,b.map(function(a){return d("WAWap").wap("item",{id:d("WAWap").CUSTOM_STRING(a)})})):null;e=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(e),to:d("WAWebCommsWapMd").JID(a),"class":d("WAWap").CUSTOM_STRING("message"),type:d("WAWap").CUSTOM_STRING("text")},b);return d("WADeprecatedSendIq").deprecatedCastStanza(e)}function n(a,b,c,e){var f=a[0];a=a.slice(1);a=a.length>0?d("WAWap").wap("list",null,a.map(function(a){return d("WAWap").wap("item",{id:d("WAWap").CUSTOM_STRING(a)})})):null;f=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(f),to:d("WAWebCommsWapMd").JID(b),recipient:c!=null?d("WAWebCommsWapMd").USER_JID(c):d("WAWap").DROP_ATTR,participant:e!=null?d("WAWebCommsWapMd").USER_JID(e):d("WAWap").DROP_ATTR,"class":d("WAWap").CUSTOM_STRING("message"),type:d("WAWap").CUSTOM_STRING("text")},a);return d("WADeprecatedSendIq").deprecatedCastStanza(f)}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.to,e=a.type,f=a.groupedReceipt,g=a.t,o=a.recipient;if(c.isNewsletter()&&e===j.DELIVERY)return m(c,f);var p=e===j.READ||e===j.PLAYED||e===j.READ_SELF||e===j.PLAYED_SELF||e===j.HISTORY_SYNC_COMPLETION;yield (h||(h=b("Promise"))).all(Array.from(f.keys()).map(function(a){var m=f.get(a);if(!m||m.length===0)return;var q=!c.isBot()&&a.isBot();if(e===j.DELIVERY&&q){var r,s;c.isUser()?(q=a,r=c):(q=c,s=a);n(m,q,r,s);return}var t=c.isUser()||c.isNewsletter()?null:a,u=c,v=o;v==null&&c.isUser()&&!c.isBot()&&a.isBot()&&(u=a,v=c);var w=[];q=function(){var a=m.splice(0,k),c=null;a.length>1&&(c=d("WAWap").wap("list",null,a.slice(1).map(function(a){return d("WAWap").wap("item",{id:d("WAWap").CUSTOM_STRING(a)})})));var f=void 0;t!=null&&(t.isPSA()?f=d("WAWebCommsWapMd").JID(t):f=d("WAWebCommsWapMd").DEVICE_JID(t));var h=d("WAWap").wap("receipt",{to:d("WAWebCommsWapMd").JID(u),type:e===j.DELIVERY?d("WAWap").DROP_ATTR:d("WAWap").CUSTOM_STRING(e),id:d("WAWap").CUSTOM_STRING(a[0]),t:g!=null?d("WAWap").CUSTOM_STRING(g):d("WAWap").DROP_ATTR,participant:(f=f)!=null?f:d("WAWap").DROP_ATTR,recipient:v?d("WAWebCommsWapMd").USER_JID(v):d("WAWap").DROP_ATTR},c);if(p){f=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b={id:a[0],from:u,"class":"receipt",type:e,participant:t,recipient:v};if(e===j.READ||e===j.READ_SELF){var c=(yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(h,d("WAWebCommsAckParser").toCoreAckTemplate(b)));c=l.parse(c);if(c.error)d("WALogger").ERROR(i()).sendLogs("Invalid-Receipt-Ack");else{c=c.success.readReceipts;c!=null&&d("WAWebUserPrefsGeneral").setUserPrivacySettings(babelHelpers["extends"]({},d("WAWebUserPrefsGeneral").getUserPrivacySettings(),{readReceipts:c}))}}else return d("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(h,d("WAWebCommsAckParser").toCoreAckTemplate(b))});return function(){return c.apply(this,arguments)}}();w.push(f())}else w.push(d("WADeprecatedSendIq").deprecatedCastStanza(h))};while(m.length>0)q();return(h||(h=b("Promise"))).all(w)}))});return o.apply(this,arguments)}g.RECEIPT_TYPE=j;g.sendBotInvokeResponseAcks=n;g.sendAggregateReceipts=a}),98); __d("WAWebGetAllModelStorageTableNames",[],(function(a,b,c,d,e,f){a=["abpropConfigs","abprop-event-sampling-configs","active-message-ranges","agent","blocklist","bot-profile","business-profile","cart","chat","chat-assignment","chat-thread-logging-pending-events","collection-version","comments","contact","ctwa-suggestion","device-list","direct-connection-keys","encrypted-mutations","favorite-stickers","fts-indexing-queue","group-invite-v4","group-metadata","history-sync-notification","in-app-banner","inactive-receipt","label","label-association","lid-chat-state","lid-display-name-mapping","lid-pn-mapping","message","message-history","message-info","message-orphans","missing-keys","newsletter-metadata","newsletter-my-votes","newsletter-polls-votes","newsletter-reactions","non-message-data-request","orphan-payment-notification","orphan-receipt","orphan-revoke","orphan-tc-token","participant","payment-backgrounds","peer-message","pending-membership-approval-request","pending-mutations","pinned-messages","poll-votes","premium-message","privacy-disallowed-list","profile-pic-thumb","quick-promotions","quick-reply","reactions","recent-stickers","reporting-token","self-addon-message-type","sticker-download","subgroup-suggestion","subgroup-suggestion-v2","subscription","sync-actions","sync-keys","syncd-logs","tasks-scheduled-time","unjoined-subgroup-metadata","user-prefs","verified-business-name"];f.allModelStorageTableNames=a}),66); __d("WAWebWamEnumOfflineResumeModes",[],(function(a,b,c,d,e,f){a=Object.freeze({RESUME_FROM_RESTART:1,RESUME_FROM_OPEN_TAB:2,UNKNOWN:3,CONNECT_REASON_USER:4,CONNECT_REASON_PUSH:5,CONNECT_REASON_BACKOFF:6});f.OFFLINE_RESUME_MODES=a}),66); __d("WAWebWamEnumOfflineResumeStages",[],(function(a,b,c,d,e,f){a=Object.freeze({PAGE_LOAD:1,SOCKET_CONNECT:2,PROCESS_COMPLETE:3,SCREEN_LOAD:4,OFFLINE_PREVIEW:5,OFFLINE_COMPLETE_RECEIVED:6,PREACKS_SENT:7});f.OFFLINE_RESUME_STAGES=a}),66); __d("WAWebOfflineResumeStageWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumOfflineResumeModes","WAWebWamEnumOfflineResumeStages"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({OfflineResumeStage:[3536,{attemptId:[13,a.TYPES.INTEGER],chatThreadCount:[4,a.TYPES.INTEGER],currentOfflineStage:[1,d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES],isResumeInForeground:[5,a.TYPES.BOOLEAN],isResumeStartedInForeground:[14,a.TYPES.BOOLEAN],lastPushTimestampMs:[12,a.TYPES.INTEGER],mailboxAge:[6,a.TYPES.INTEGER],offlineCallCount:[15,a.TYPES.INTEGER],offlineDecryptErrorCount:[7,a.TYPES.INTEGER],offlineMessageCount:[8,a.TYPES.INTEGER],offlineNotificationCount:[9,a.TYPES.INTEGER],offlineReceiptCount:[10,a.TYPES.INTEGER],offlineResumeMode:[11,d("WAWebWamEnumOfflineResumeModes").OFFLINE_RESUME_MODES],offlineSessionId:[2,a.TYPES.STRING],offlineSizeBytes:[16,a.TYPES.INTEGER],offlineStageTimestampMs:[3,a.TYPES.INTEGER],passiveModeT:[17,a.TYPES.TIMER]},[1,1,1],"regular"]},{OfflineResumeStage:[]});g.OfflineResumeStageWamEvent=b}),98); __d("WAWebWamEnumOfflineResumeResultType",[],(function(a,b,c,d,e,f){a=Object.freeze({COMPLETE:1,INCOMPLETE_UNKNOWN_ERROR:2,INCOMPLETE_DISCONNECT:3,INCOMPLETE_APP_RESTART:4});f.OFFLINE_RESUME_RESULT_TYPE=a}),66); __d("WAWebOfflineResumeWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumOfflineResumeResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({OfflineResume:[3112,{affectedBySleepMode:[35,a.TYPES.BOOLEAN],appContext:[49,a.TYPES.STRING],appContextBitfield:[50,a.TYPES.INTEGER],attemptNumber:[36,a.TYPES.INTEGER],chatThreadCount:[1,a.TYPES.INTEGER],dbDurationT:[39,a.TYPES.TIMER],dbMainThreadDurationT:[40,a.TYPES.TIMER],dbMainThreadReadsCount:[41,a.TYPES.INTEGER],dbMainThreadWritesCount:[42,a.TYPES.INTEGER],dbReadsCount:[43,a.TYPES.INTEGER],dbWritesCount:[44,a.TYPES.INTEGER],disconnected:[45,a.TYPES.BOOLEAN],expectedOfflineCallCount:[23,a.TYPES.INTEGER],expectedOfflineMessageCount:[17,a.TYPES.INTEGER],expectedOfflineNotificationCount:[18,a.TYPES.INTEGER],expectedOfflineReceiptCount:[19,a.TYPES.INTEGER],isOfflineCompleteMissed:[2,a.TYPES.BOOLEAN],isResumeInForeground:[13,a.TYPES.BOOLEAN],isResumeStartedInForeground:[37,a.TYPES.BOOLEAN],isRunningFromServiceExtension:[22,a.TYPES.BOOLEAN],lastStanzaT:[3,a.TYPES.TIMER],logoutSessionId:[38,a.TYPES.INTEGER],mailboxAge:[14,a.TYPES.INTEGER],mainScreenLoadT:[4,a.TYPES.TIMER],offlineCallCount:[24,a.TYPES.INTEGER],offlineDecryptErrorCount:[5,a.TYPES.INTEGER],offlineMessageCount:[6,a.TYPES.INTEGER],offlineNotificationCount:[7,a.TYPES.INTEGER],offlinePreviewT:[8,a.TYPES.TIMER],offlineProcessingT:[20,a.TYPES.TIMER],offlineReceiptCount:[9,a.TYPES.INTEGER],offlineResumeResult:[21,d("WAWebWamEnumOfflineResumeResultType").OFFLINE_RESUME_RESULT_TYPE],offlineSessionT:[46,a.TYPES.TIMER],offlineSizeBytes:[10,a.TYPES.INTEGER],onTrickleMode:[15,a.TYPES.BOOLEAN],pageLoadT:[11,a.TYPES.TIMER],passiveModeT:[25,a.TYPES.TIMER],preackCallCount:[26,a.TYPES.INTEGER],preackMessageCount:[27,a.TYPES.INTEGER],preackNotificationCount:[28,a.TYPES.INTEGER],preackReceiptCount:[29,a.TYPES.INTEGER],preacksCount:[47,a.TYPES.INTEGER],processedCallCount:[30,a.TYPES.INTEGER],processedMessageCount:[31,a.TYPES.INTEGER],processedNotificationCount:[32,a.TYPES.INTEGER],processedReceiptCount:[33,a.TYPES.INTEGER],runningTasks:[48,a.TYPES.STRING],socketConnectT:[12,a.TYPES.TIMER],transientOfflineSessionId:[34,a.TYPES.STRING]},[1,1,1],"regular"]},{OfflineResume:[]});g.OfflineResumeWamEvent=b}),98); __d("WAWebWamOfflineResumeReporter",["$InternalEnum","WALogger","WAQplTypes","WARandomHex","WATimeUtils","WAWebABProps","WAWebDBTableUsage","WAWebGetAllModelStorageTableNames","WAWebOfflineResumeStageWamEvent","WAWebOfflineResumeWamEvent","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsGeneral","WAWebUserPrefsMultiDevice","WAWebWamEnumOfflineResumeModes","WAWebWamEnumOfflineResumeStages","WAWebWamEnumWebScenarioCode","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] skip posting for offline resume without envelopes"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] skip posting for offline resume during initial sync"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] decryption error count exceeding product requirement, count ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] loading time exceeding product requirement, time ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] offline resume completes\n ============== offline resume perf ================\n count: ","\n messageCount: ","\n receiptCount: ","\n notificationCount: ","\n callCount: ","\n chatThreadCount: ","\n sizeBytes: ","\n decryptErrorCount: ","\n preackMessageCount: ","\n preackReceiptCount: ","\n lastStanzaT: ","\n pageLoadT: ","\n socketConnectT: ","\n passiveModeT: ","\n offlinePreviewT: ","\n mainScreenLoadT: ","\n offlineProcessingT: ","\n isResumeInForeground: ","\n isBlockingOfflineResume: ","\n mailboxAge: ","\n ==================================================="]);l=function(){return a};return a}var m=b("$InternalEnum").Mirrored(["ResumeFromRestart","ResumeFromOpentab"]),n=function(){function a(a){this._mode=a}var b=a.prototype;b.start=function(){if(!d("WAWebABProps").getABPropConfigValue("web_offline_resume_qpl_enabled"))return;this.drop();this._qplEvent=d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,{annotations:{string:{mode:m.getName(this._mode)}}})};b.end=function(){var a;(a=this._qplEvent)==null?void 0:a.end(d("WAQplTypes").QuickLogActionType.SUCCESS)};b.drop=function(){var a;(a=this._qplEvent)==null?void 0:a.drop();this._qplEvent=void 0};b._addPoint=function(a,b){var c;b=b!=null?{data:b}:{};(c=this._qplEvent)==null?void 0:c.addPoint(a,b)};b.markOfflinePreviewReceived=function(){this._addPoint("offlinePreviewReceived")};b.markMainScreenLoad=function(){this._addPoint("mainScreenLoad")};b.setAnnotations=function(a){var b;(b=this._qplEvent)==null?void 0:b.annotate(a)};return a}(),o=function(){function a(a,b){this._sessionId=b,this._offlineStartT=self.performance.now(),this._resumeMode=a}var b=a.prototype;b._commitOfflineStage=function(a){a=new(d("WAWebOfflineResumeStageWamEvent").OfflineResumeStageWamEvent)({offlineSessionId:this._sessionId,offlineResumeMode:this._resumeMode===m.ResumeFromOpentab?d("WAWebWamEnumOfflineResumeModes").OFFLINE_RESUME_MODES.RESUME_FROM_OPEN_TAB:d("WAWebWamEnumOfflineResumeModes").OFFLINE_RESUME_MODES.RESUME_FROM_RESTART,offlineStageTimestampMs:Math.floor(self.performance.now()-this._offlineStartT),currentOfflineStage:a});this._addOfflineMetadata(a);a.commit()};b.logOfflineStart=function(){this._offlineStartT=self.performance.now()};b.logSocketConnect=function(){this._commitOfflineStage(d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES.SOCKET_CONNECT)};b.logProcessComplete=function(){this._commitOfflineStage(d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES.PROCESS_COMPLETE)};b.logScreenLoad=function(){this._commitOfflineStage(d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES.SCREEN_LOAD)};b.logOfflinePreview=function(){this._commitOfflineStage(d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES.OFFLINE_PREVIEW)};b.logOfflineCount=function(a){var b;((b=this._offlineMessageCount)!=null?b:0)===0&&(this._offlineMessageCount=a.message);((b=this._offlineReceiptCount)!=null?b:0)===0&&(this._offlineReceiptCount=a.receipt);((b=this._offlineNotificationCount)!=null?b:0)===0&&(this._offlineNotificationCount=a.notification);((b=this._offlineCallCount)!=null?b:0)===0&&(this._offlineCallCount=a.call)};b.logOfflineDecryptionErrorCount=function(a){this._offlineDecryptErrorCount=a};b.logOfflineChatThreadCount=function(a){this._chatThreadCount=a};b.logOldestStanzaTime=function(a){(this._oldestStanzaTs==null||this._oldestStanzaTs>a)&&(this._oldestStanzaTs=a)};b.setLastPushCompleteTimestamp=function(){this._lastPushCompleteTimestampMs=d("WAWebUserPrefsGeneral").getLastPushCompleteTimestamp()};b._addOfflineMetadata=function(a){this._offlineMessageCount!=null&&(a.offlineMessageCount=this._offlineMessageCount),this._offlineReceiptCount!=null&&(a.offlineReceiptCount=this._offlineReceiptCount),this._offlineNotificationCount!=null&&(a.offlineNotificationCount=this._offlineNotificationCount),this._offlineCallCount!=null&&(a.offlineCallCount=this._offlineCallCount),this._oldestStanzaTs!=null&&(a.mailboxAge=r(this._oldestStanzaTs)),this._offlineDecryptErrorCount!=null&&(a.offlineDecryptErrorCount=this._offlineDecryptErrorCount),this._chatThreadCount!=null&&(a.chatThreadCount=q(this._chatThreadCount,10)),this._lastPushCompleteTimestampMs!=null&&a.currentOfflineStage===d("WAWebWamEnumOfflineResumeStages").OFFLINE_RESUME_STAGES.SOCKET_CONNECT&&(a.lastPushTimestampMs=this._lastPushCompleteTimestampMs,void d("WAWebUserPrefsGeneral").clearLastPushCompleteTimestamp(),this._lastPushCompleteTimestampMs=null)};return a}(),p=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.offlinePreviewCount=0,a)||babelHelpers.assertThisInitialized(c)}return a}(d("WAWebOfflineResumeWamEvent").OfflineResumeWamEvent);a=function(){function a(){var a=this;this.logResumeInBackground=function(){a.offlineResume!=null&&document.hidden&&(a.offlineResume.isResumeInForeground=!1)};this._initEvents(m.ResumeFromRestart)}var e=a.prototype;e._initEvents=function(a){this.isInitialSync=!1;this.oldestStanzaTs=0;this.offlineResume=new p();this.offlineResume.offlineMessageCount=0;this.offlineResume.offlineReceiptCount=0;this.offlineResume.offlineNotificationCount=0;this.offlineResume.offlineCallCount=0;this.offlineResume.offlineDecryptErrorCount=0;this.offlineResume.offlineSizeBytes=0;this.offlineResume.chatThreadCount=0;this.offlineResume.preackMessageCount=0;this.offlineResume.preackReceiptCount=0;this.offlineResume.isOfflineCompleteMissed=!1;this.qpl=new n(a);var b=this._generateOfflineSessionId();this.offlineStage=new o(a,b);this.endTableUsageMetric=d("WAWebDBTableUsage").beginDBTableUsage(d("WAWebWamEnumWebScenarioCode").WEB_SCENARIO_CODE.OFFLINE_RESUME,new Set(d("WAWebGetAllModelStorageTableNames").allModelStorageTableNames),b)};e.logOldestStanzaTime=function(a){this.offlineStage.logOldestStanzaTime(a);if(this.offlineResume==null)return;(this.oldestStanzaTs===0||this.oldestStanzaTs>a)&&(this.oldestStanzaTs=a)};e.logOfflineCount=function(a){var b;this.offlineStage.logOfflineCount(a);this.offlineStage.logOfflinePreview();if(!this.offlineResume)return;this.offlineResume.offlinePreviewCount=a.count;((b=this.offlineResume.offlineMessageCount)!=null?b:0)===0&&(this.offlineResume.offlineMessageCount=a.message);((b=this.offlineResume.offlineReceiptCount)!=null?b:0)===0&&(this.offlineResume.offlineReceiptCount=a.receipt);((b=this.offlineResume.offlineNotificationCount)!=null?b:0)===0&&(this.offlineResume.offlineNotificationCount=a.notification);((b=this.offlineResume.offlineCallCount)!=null?b:0)===0&&(this.offlineResume.offlineCallCount=a.call)};e.logOfflineDecryptionErrorCount=function(a){this.offlineStage.logOfflineDecryptionErrorCount(a);if(!this.offlineResume)return;this.offlineResume.offlineDecryptErrorCount=a};e.logAddOfflineSizeBytes=function(a){if(!this.offlineResume)return;this.offlineResume.offlineSizeBytes+=a};e.logOfflineChatThreadCount=function(a){this.offlineStage.logOfflineChatThreadCount(a);a=q(a,10);if(!this.offlineResume)return;this.offlineResume.chatThreadCount=a};e.logOfflinePreackCount=function(a,b){b===void 0&&(b=!1),this.offlineResume&&(b===!0?this.offlineResume.preackMessageCount+=a:this.offlineResume.preackReceiptCount+=a)};e.logOfflinePassiveT=function(){var a;if(((a=this.offlineResume)==null?void 0:a.passiveModeT)!=null)return;this._logPerformanceT("passiveModeT")};e._logPerformanceT=function(a){var b=Math.floor(self.performance.now());if(this.offlineResume==null)return;this.offlineResume[a]=b};e.logLastStanzaT=function(){var a;if(((a=this.offlineResume)==null?void 0:a.lastStanzaT)!=null)return;this._logPerformanceT("lastStanzaT");this.isInitialSync||this.offlineStage.logProcessComplete()};e.logMainScreenLoadT=function(){this._logPerformanceT("mainScreenLoadT"),this.qpl.markMainScreenLoad(),this.isInitialSync||this.offlineStage.logScreenLoad()};e.logOfflinePreviewT=function(){this._logPerformanceT("offlinePreviewT"),this.qpl.markOfflinePreviewReceived()};e.logOfflineStartT=function(){this._logPerformanceT("pageLoadT"),this.offlineStage.logOfflineStart(),window.document&&this.offlineResume&&(this.offlineResume.isResumeInForeground=!document.hidden,document.addEventListener("visibilitychange",this.logResumeInBackground))};e.logSocketConnectT=function(){this.qpl.start(),this._logPerformanceT("socketConnectT"),this.isInitialSync||this.offlineStage.logSocketConnect()};e.logMissedOfflineComplete=function(){if(!this.offlineResume)return;this.offlineResume.isOfflineCompleteMissed=!0};e.setIsInitialSync=function(){this.isInitialSync=!0};e.setLastPushCompleteTimestamp=function(){return this.offlineStage.setLastPushCompleteTimestamp()};e.isBlockingOfflineResume=function(a){if(a.lastStanzaT!=null&&a.mainScreenLoadT!=null)return a.lastStanzaT<a.mainScreenLoadT;else if(a.socketConnectT!=null&&a.lastStanzaT!=null&&a.mainScreenLoadT==null)return!0;else if(a.socketConnectT!=null&&a.lastStanzaT==null&&a.mainScreenLoadT!=null)return!1;return null};e.commit=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.offlineResume;if(!a)return;a.offlineSizeBytes=q(a.offlineSizeBytes,1e3);a.mailboxAge=r(this.oldestStanzaTs);yield d("WAWebUserPrefsMultiDevice").setRecentMailboxAgeDays(a.mailboxAge);var b=this.isBlockingOfflineResume(a);a.lastStanzaT!=null&&a.socketConnectT!=null&&(a.offlineProcessingT=a.lastStanzaT-a.socketConnectT);d("WALogger").LOG(l(),a.offlinePreviewCount,a.offlineMessageCount,a.offlineReceiptCount,a.offlineNotificationCount,a.offlineCallCount,a.chatThreadCount,a.offlineSizeBytes,a.offlineDecryptErrorCount,a.preackMessageCount,a.preackReceiptCount,a.lastStanzaT,a.pageLoadT,a.socketConnectT,a.passiveModeT,a.offlinePreviewT,a.mainScreenLoadT,a.offlineProcessingT,a.isResumeInForeground,b,a.mailboxAge);var e=a.offlinePreviewCount===0;if(!this.isInitialSync&&!e){a.commit();this.qpl.setAnnotations({"int":{messageCount:a.offlineMessageCount,receiptCount:a.offlineReceiptCount,notificationCount:a.offlineNotificationCount,chatThreadCount:a.chatThreadCount,sizeBytes:a.offlineSizeBytes,decryptErrorCount:a.offlineDecryptErrorCount,preackMessageCount:a.preackMessageCount,preackReceiptCount:a.preackReceiptCount},bool:{isResumeInForeground:a.isResumeInForeground,isBlockingOfflineResume:b}});this.qpl.end();this.endTableUsageMetric();if(!c("gkx")("26258")){b=3*60*1e3;var f=10,g=Math.max(a.mainScreenLoadT,a.lastStanzaT);g-a.socketConnectT>b&&d("WALogger").ERROR(k(),a.mainScreenLoadT).sendLogs("slow-offline-resume");a.offlineDecryptErrorCount>f&&d("WALogger").ERROR(j(),a.offlineDecryptErrorCount).sendLogs("slow-offline-resume")}}else this.isInitialSync?d("WALogger").LOG(i()):e&&d("WALogger").LOG(h()),this.qpl.drop();this.offlineResume=null;(g=window.document)==null?void 0:g.removeEventListener("visibilitychange",this.logResumeInBackground)});function e(){return a.apply(this,arguments)}return e}();e.resetEvent=function(){this.offlineResume==null&&(this._initEvents(m.ResumeFromOpentab),this.logOfflineStartT())};e._generateOfflineSessionId=function(){return""+d("WARandomHex").randomHex(4)+d("WATimeUtils").unixTimeWithoutClockSkewCorrection().toString(10)};return a}();function q(a,b){return c("gkx")("26258")?Math.round(a/b)*b:a}function r(a){if(a===0)return 0;a=d("WATimeUtils").unixTime()-a;return Math.round(a/d("WATimeUtils").DAY_SECONDS)}e=new a();g.roundUp=q;g.countDays=r;g.OfflineResumeReporter=e}),98); __d("WAWebClearDanglingReceipts",["Promise","WAAbortError","WALogger","WATimeUtils","WAWebCommsSendPing","WAWebNetworkStatus","WAWebOfflineResumePreAckHandler","WAWebSchemaDanglingReceipt","WAWebSendReceiptJobCommon","WAWebWamOfflineResumeReporter","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearDanglingReceipts: starting clean receipts"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearDanglingReceipts: starting sending ping"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] clearDanglingReceipts: skip due to offline."]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: complete"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: complete sending "," preAcks"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: complete sending "," receipts"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: starting sending "," receipts, "," preAcks"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: aborting receipts to signal.aborted"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAndClearDanglingReceipts: get "," danglingRecords"]);q=function(){return a};return a}function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield d("WAWebSchemaDanglingReceipt").getTable().all());d("WALogger").LOG(q(),c.length);if(a.aborted){d("WALogger").LOG(p());throw new(d("WAAbortError").AbortError)()}var e=new Map(),f=[],g=0;c.forEach(function(a){g+=a.receipts.length;var b=a.receipts;a=a.acks;b.forEach(function(a){var b=d("WAWebWidFactory").createWid(a.from),c=d("WAWebWidFactory").createWid(a.author),f=e.get(b);f||(f=new Map(),e.set(b,f));b=f.get(c);b||(b=[],f.set(c,b));b.push(a.externalId)});f=f.concat(a)});var i=String(d("WATimeUtils").unixTime());c=Array.from(e.keys()).map(function(b){var c=e.get(b);if(!c)return;return d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:b,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.DELIVERY,t:i,groupedReceipt:c,signal:a})});var j=f.map(function(a){return d("WAWebOfflineResumePreAckHandler").sendOfflinePreAck(a)});d("WALogger").LOG(o(),c.length,j.length);yield (h||(h=b("Promise"))).all(c);d("WALogger").LOG(n(),c.length);yield h.all(j);d("WALogger").LOG(m(),j.length);yield s();d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflinePreackCount(g);d("WALogger").LOG(l())});return r.apply(this,arguments)}function s(){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!c("WAWebNetworkStatus").online){d("WALogger").LOG(k());return(h||(h=b("Promise"))).resolve()}d("WALogger").LOG(j());yield d("WAWebCommsSendPing").blockSendPing();d("WALogger").LOG(i());yield d("WAWebSchemaDanglingReceipt").getTable().clear()});return t.apply(this,arguments)}g.sendAndClearDanglingReceipts=a;g.clearDanglingReceipts=s}),98); __d("WAWebHandleOfflineAbProps",["WAWebABProps","WAWebOfflineHandler","WAWebRuntimeEnvironmentUtils"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("web_non_blocking_offline_resume_max_message_count")}function b(){return d("WAWebABProps").getABPropConfigValue("web_offline_stage_manager_singleton_enabled")}function c(){return!d("WAWebRuntimeEnvironmentUtils").isServiceWorker()&&d("WAWebABProps").getABPropConfigValue("web_offline_dynamic_batch_size_enabled")}function e(){var a=JSON.parse(d("WAWebABProps").getABPropConfigValue("web_offline_dynamic_batch_config")),b=parseFloat(a.multiplier);a=a.version||"default";return{multiplier:Number.isNaN(b)?.2:b,version:a}}function f(){return d("WAWebABProps").getABPropConfigValue("web_offline_resume_max_batch_size_enabled")}function h(){var a=parseInt(d("WAWebABProps").getABPropConfigValue("web_offline_resume_max_batch_size"),10);return!Number.isNaN(a)&&a>0?a:d("WAWebOfflineHandler").DEFAULT_MAX_BATCH_SIZE}g.getNonBlockingOfflineResumeMaxMessageCount=a;g.isNonBlockingOfflineResumeExpEnabled=b;g.isOfflineDynamicBatchSizeEnabled=c;g.getOfflineDynamicBatchConfig=e;g.isOfflineResumeMaxBatchSizeEnabled=f;g.getOfflineResumeMaxBatchSize=h}),98); __d("WAWebOfflineDeviceCache",["WAComms","WADeprecatedSendIq","WALogger","WAShiftTimer","WAWebApiPendingDeviceSync","WAWebPromiseQueue","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][device-cache]: creating snapshot for pending devices ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][device-cache]: creating snapshot: schedule in "," ms"]);i=function(){return a};return a}var j=3e3;a=function(){function a(){var a=this;this.pendingDeviceCache=new Set();this.pendingAcks=[];this.snapshotTimer=new(d("WAShiftTimer").ShiftTimer)(function(){a.createSnapshot()});this.checkpointQueue=new(d("WAWebPromiseQueue").PromiseQueue)()}var c=a.prototype;c.addOfflinePendingDevice=function(a,b){this.pendingDeviceCache.add(a),b&&this.pendingAcks.push(b),this.snapshotTimer.isScheduled()||(d("WALogger").LOG(i(),j),this.snapshotTimer.onOrAfter(j))};c.createSnapshot=function(){this.snapshotTimer.isScheduled()&&this.snapshotTimer.cancel();var a=Array.from(this.pendingDeviceCache),c=this.pendingAcks;d("WALogger").LOG(h(),a.join(","));this.checkpointQueue.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync(a),c.forEach(function(a){return d("WADeprecatedSendIq").deprecatedCastStanza(a)}),d("WAComms").cancelDeadSocketTimer()}));this.pendingDeviceCache=new Set();this.pendingAcks=[]};return a}();c=new a();g.OfflinePendingDeviceCache=c}),98); __d("WASmaxOutOfflineBatchRequest",["WASmaxJsx","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=a.offlineBatchCount;a=d("WASmaxJsx").smax("ib",null,d("WASmaxJsx").smax("offline_batch",{count:d("WAWap").INT(a)}));return a}g.makeBatchRequest=a}),98); __d("WASmaxOfflineBatchRPC",["WAComms","WASmaxOutOfflineBatchRequest","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WASmaxOutOfflineBatchRequest").makeBatchRequest(a);yield d("WAComms").castSmaxStanza(a)});return h.apply(this,arguments)}g.sendBatchRPC=a}),98); __d("WAWebOfflineHandler",["invariant","WALogger","WASmaxOfflineBatchRPC","WAWebABProps","WAWebCmd","WAWebEventsWaitForReadyForOffline","WAWebHandleOfflineAbProps","WAWebOfflineResumeUtils","WAWebPageLoadLogging","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive] _maybeRequestMoreStanza: request next batch, pending message ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive] _maybeRequestMoreStanza: start request next batch"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive] _maybeRequestMoreStanza: skip, prevPending: ",", currentPending: ",", complete: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive][debounced] _maybeRequestMoreStanzaDebounced: start request next batch"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive][debounced] _maybeRequestMoreStanzaDebounced: skipDebouncing: ",", prevPending: ",", currentPending: ",", complete: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive][debounced] _maybeRequestMoreStanza: request next batch, pending message ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][adaptive] _endBatchCheck: done"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[resume-from-open-tab] restart client due to exceed the LIMIT, message: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[resume-from-open-tab][non-blocking] resume from current state of app"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] initState called more than once"]);r=function(){return a};return a}var s=200,t=10,u=200,v=100,w=new Map([[0,200],[1,100],[2,50],[3,10]]),x=a();c=function(){function a(){this.$2=!1,this.$3=0,this.$4=!1,this.$5=!1,this.$6=s,this.$7=0,this.$8=!1,this.$9=0}var c=a.prototype;c.initState=function(a){this.offlineResumeManager!=null&&d("WALogger").ERROR(r()),this.offlineResumeManager=a.getBlockingStageManager(),d("WAWebPageLoadLogging").addPageLoadQplAnnotation({blocking_resume:!0}),this.$1=a.getNonblockingStageManager};c.processOfflinePreviewIb=function(a){d("WAWebPageLoadLogging").addPageLoadQplPoint("offline_preview_received");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"OfflinePreviewReceived");this._resetBatchState();this.$8=d("WAWebHandleOfflineAbProps").isOfflineDynamicBatchSizeEnabled();if(this.$1!=null){var b=this.$1;d("WAWebCmd").Cmd.isMainStreamReadyMd&&this.isResumeFromRestartComplete()?z(a.message)?(d("WALogger").LOG(q()),this.offlineResumeManager=b({mainScreenLoaded:!0})):(d("WALogger").LOG(p(),a.message),d("WAWebOfflineResumeUtils").refreshWindow()):!this.$2&&!this.isResumeFromRestartComplete()&&z(a.message)&&(d("WAWebPageLoadLogging").addPageLoadQplAnnotation({blocking_resume:!1}),this.offlineResumeManager=b())}this.$2=!0;this.offlineResumeManager.processOfflinePreview(a)};c.processMessageDecryptResult=function(a){this.offlineResumeManager.processDecryptResult(a),this.$3-=1,void this._maybeRequestMoreStanza()};c.addOfflinePendingMessage=function(){this.isResumeFromRestartComplete()||(this.$3+=1)};c.newOfflineStanza=function(a,b,c){var e=this;this.$4=!1;this.$7=Math.max(this.$7,c);this._endBatchCheck==null&&(this._endBatchCheck=self.setTimeout(function(){e._maybeRequestMoreStanza(),e._endBatchCheck=null,d("WALogger").LOG(o())},0));return this.offlineResumeManager.newOfflineStanza(a,b,c)};c.offlineStanzaReceivedAfterComplete=function(){return this.offlineResumeManager.offlineStanzaReceivedAfterComplete()};c.getOfflineDeliveryProgress=function(){return this.offlineResumeManager.getOfflineDeliveryProgress()};c.getOfflineMessageCount=function(){return Math.max(this.offlineResumeManager.offlineMessagePreviewCounter,0)};c.isResumeOnSocketDisconnectInProgress=function(){return this.offlineResumeManager.isResumeOnSocketDisconnectInProgress()};c.isResumeFromRestartComplete=function(){return this.offlineResumeManager.isResumeFromRestartComplete()};c.isResumeComplete=function(){return this.offlineResumeManager.isResumeComplete()};c.getHasMessagesToDownload=function(){return this.offlineResumeManager.getHasMessagesToDownload()};c.getFinishedDownloading=function(){return this.getOfflineDeliveryProgress()===100};c.processOfflineIb=function(a){d("WAWebPageLoadLogging").addPageLoadQplPoint("offline_received");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"OfflineIbReceived");return this.offlineResumeManager.processOfflineSessionComplete(a)};c.shouldUseOfflineResumeScreen=function(){return this.offlineResumeManager.shouldUseOfflineResumeScreen()};c.getResumeUIProgressBarType=function(){return this.offlineResumeManager.getResumeUIProgressBarType()};c.hasInitOfflineResumeManager=function(){return this.offlineResumeManager!=null};c.getResumeType=function(){return this.offlineResumeManager.resumeType};c._resetBatchState=function(){this.$4=!1,this.$5=!1,this.$9=0};c._sendBatchRequestIBDebounced=function(a,b){var c=this;b===void 0&&(b=!1);b=b===!0||this.$9===0;this.$10!=null&&self.clearTimeout(this.$10);b?(d("WALogger").LOG(n(),this.$3),void d("WASmaxOfflineBatchRPC").sendBatchRPC({offlineBatchCount:a}),this.$9=Date.now(),this.$7=0,this.$4=!0,this.$5=!1):this.$10=self.setTimeout(function(){void c._maybeRequestMoreStanzaDebounced()},v)};c._maybeRequestMoreStanzaDebounced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);var b=Date.now()-this.$9;a=a||!this.isResumeComplete()&&this.$3<=s&&b>=v&&this.$4===!1&&this.$5===!0;if(this.isResumeComplete()||this.$4||this.$5){this.isResumeComplete()||d("WALogger").LOG(m(),a,this.$4,this.$5,this.isResumeComplete());if(a===!1)return}if(this.$3<=s){d("WALogger").LOG(l());this.$5=!0;yield d("WAWebEventsWaitForReadyForOffline").waitForOfflineProcessReady();s;b=x(this.$7,this.$6);this.$6=b;this._sendBatchRequestIBDebounced(b,a)}});function a(b){return a.apply(this,arguments)}return a}();c._maybeRequestMoreStanza=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);if(this.$8)return this._maybeRequestMoreStanzaDebounced(a);if(this.isResumeComplete()||this.$4||this.$5){this.isResumeComplete()||d("WALogger").LOG(k(),this.$4,this.$5,this.isResumeComplete());return}this.$3<=s&&(d("WALogger").LOG(j()),this.$5=!0,yield d("WAWebEventsWaitForReadyForOffline").waitForOfflineProcessReady(),void d("WASmaxOfflineBatchRPC").sendBatchRPC({offlineBatchCount:s}),this.$5=!1,this.$4=!0,d("WALogger").LOG(i(),this.$3))});function a(b){return a.apply(this,arguments)}return a}();return a}();function y(a,b,c,e){var f;e===void 0&&(e=.2);if(a===0){if(d("WAWebHandleOfflineAbProps").isOfflineResumeMaxBatchSizeEnabled()){if(b==null||b>0)return u;var g=d("WAWebHandleOfflineAbProps").getOfflineResumeMaxBatchSize();return Math.min(g,Math.floor(c*.45)+c)}return u}if(a>3)return t;g=null;f=a-((f=b)!=null?f:0);if(f===0){g=Math.floor(c*e)+c;((f=w.get(a-1))!=null?f:u)<=g&&(g=c)}else g=w.get(a);g!=null||h(0,75725,a,(e=b)!=null?e:"N/A",c);return(f=g)!=null?f:u}function a(){var a=null;return function(b,c){var e=d("WAWebHandleOfflineAbProps").getOfflineDynamicBatchConfig(),f=e.version;e=e.multiplier;var g=a;a=b;switch(f){case"progressive":return y(b,g,c,e);default:return u}}}function z(a){if(a<=200&&d("WAWebABProps").getABPropConfigValue("web_msg_sync_update_tunnel"))return!0;return a>=d("WAWebHandleOfflineAbProps").getNonBlockingOfflineResumeMaxMessageCount()?!1:!0}e=new c();g.DEFAULT_MAX_BATCH_SIZE=u;g.OfflineMessageHandlerImpl=c;g.OfflineMessageHandler=e}),98); __d("WAWebWebcMessageProcessingPerfWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMessageProcessingPerf:[5790,{dbStoringT:[7,a.TYPES.INTEGER],decryptionT:[1,a.TYPES.INTEGER],isOffline:[2,a.TYPES.BOOLEAN],lidProcessingT:[8,a.TYPES.INTEGER],parsingT:[3,a.TYPES.INTEGER],postProcessingT:[4,a.TYPES.INTEGER],preProcessingT:[5,a.TYPES.INTEGER],processingT:[6,a.TYPES.INTEGER],reportTokenValidationT:[9,a.TYPES.INTEGER]},[1,1,100],"regular"]},{WebcMessageProcessingPerf:[]});g.WebcMessageProcessingPerfWamEvent=b}),98); __d("WAWebOfflineResumeMsgProcessReporter",["$InternalEnum","WALogger","WAWebEventsWaitForOfflineDeliveryEnd","WAWebRuntimeEnvironmentUtils","WAWebWebcMessageProcessingPerfWamEvent"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Reporter is already triggered"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Reporter must be active to commit"]);i=function(){return a};return a}var j=b("$InternalEnum")({Decryption:0,Parsing:1,PreProcessing:2,Processing:3,PostProcessing:4,ProcessReportingTokenInfo:5,DBStoring:6}),k={ACTIVE:!1,CACHE:[]};function l(){var a={dbStoringT:0,decryptionT:0,lidProcessingT:0,parsingT:0,postProcessingT:0,preProcessingT:0,processingT:0,reportTokenValidationT:0};k.CACHE.forEach(function(b){var c=b[0];b=b[1];switch(c){case j.DBStoring:a.dbStoringT+=b;break;case j.Decryption:a.decryptionT+=b;break;case j.ProcessReportingTokenInfo:a.reportTokenValidationT+=b;break;case j.Parsing:a.parsingT+=b;break;case j.PostProcessing:a.postProcessingT+=b;break;case j.PreProcessing:a.preProcessingT+=b;break;case j.Processing:a.processingT+=b;break}});Object.entries(a).forEach(function(b){var c=b[0];b=b[1];typeof b==="number"&&(a[c]=Math.round(b))});return a}function c(b){if(!k.ACTIVE)return;var c=a.performance.now();return function(){var d=a.performance.now();k.CACHE.push([b,d-c])}}function m(){k.ACTIVE=!0;var a=!1;void d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(function(){if(!a){if(!k.ACTIVE){d("WALogger").ERROR(i()).sendLogs("msg_process_reporter_not_active");return}a=!0;new(d("WAWebWebcMessageProcessingPerfWamEvent").WebcMessageProcessingPerfWamEvent)(babelHelpers["extends"]({},l(),{isOffline:!0})).commit();k={ACTIVE:!1,CACHE:[]}}else d("WALogger").ERROR(h()).sendLogs("msg_process_reporter_already_triggered")})}e={stage:j,startMarker:c,activate:function(a){if(d("WAWebRuntimeEnvironmentUtils").isWorker())return;a.message>5;if(a.message<=100)return;m()}};g.msgProcessReporter=e}),98); __d("WAWebDBProcessGroupInviteMsgs",["WALogger","WATimeUtils","WAWebApiGroupInviteV4Store","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] incoming invite has fields with the following addressing mode: from = ",", to = ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] failed to get lid mapping for "," ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] isLidMigrated: ",", validMsgAuthor: ",", isPeerMsg: ",""]);k=function(){return a};return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){return m(a)});yield d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msgs(a)});return l.apply(this,arguments)}function m(a){var b=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated(),c=b?d("WAWebLidMigrationUtils").toLid(a.from):a.from,e=b?d("WAWebLidMigrationUtils").toLid(a.to):a.to;if(!c||!e){var f=d("WAWebUserPrefsMeUser").isMeAccount(a.author);d("WALogger").LOG(k(),b,a.author!=null,f);d("WALogger").ERROR(j(),c?"":"msg.from &",e?"":"msg.to");b="[group-invites] failed to get lid mapping for *incoming* group invite";d("WALogger").ERROR(i(),b).sendLogs(b)}f=d("WAWebLidMigrationUtils").getAddressingModeString(c==null?void 0:c.isLid());b=d("WAWebLidMigrationUtils").getAddressingModeString(e==null?void 0:e.isLid());d("WALogger").LOG(h(),f,b);return{id:a.id.toString(),from:c==null?void 0:c.toString(),to:e==null?void 0:e.toString(),groupId:a.inviteGrp,expiration:parseInt(a.inviteCodeExp,10),expired:d("WATimeUtils").unixTime()>=parseInt(a.inviteCodeExp,10)}}g.processGroupInviteMessages=a}),98); __d("WAWebDBReplaceUnknownAssociations",["WAWebMessageAssociation.flow","WAWebSchemaMessageAssociation"],(function(a,b,c,d,e,f,g){function a(a){var b=[];if(a.length){var c=a.map(function(a){return[a.msgKey,d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN]});b.push(d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkRemove(c));b.push(d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkCreateOrReplace(a))}return b}g.replaceUnknownAssociations=a}),98); __d("WAWebMessageAssociationUIUpdateFromStorage",["WAWebBackendApi","WAWebHandleMsgTypes.flow"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a.forEach(function(a){void d("WAWebBackendApi").frontendFireAndForget("updateMessageUI",{chatId:a.id.remote,msg:a,messageOverwriteOption:d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,preserveOrder:!0})})}g.updateAssociatedMsgsUIFromStorage=a}),98); __d("WAWebStoreMsgs",["Promise","WALogger","WAWebAddonGatingUtils","WAWebAddonProcessMsgs","WAWebAddonProcessMsgsUtils","WAWebApiFilterAndReplaceMessages","WAWebApiOrphanRevoke","WAWebBackendApi","WAWebBizCoexGatingUtils","WAWebBotGating","WAWebCastToReactionMsg","WAWebCheckUpdateOrphanReactions","WAWebCmd","WAWebCommonMsgUtils","WAWebDBAddOnProviders","WAWebDBMessageBulkHelper","WAWebDBMessageSerialization","WAWebDBProcessEditProtocolMsgs","WAWebDBProcessGroupInviteMsgs","WAWebDBProcessPaymentMessages","WAWebDBProcessPollUpdateMsgs","WAWebDBProcessReactionsMsgs","WAWebDBProcessReplyMsgs","WAWebDBReplaceUnknownAssociations","WAWebDBStoreMessage","WAWebDBStoreRevokeMsgs","WAWebHandleForMessageRange","WAWebHandlePlaceholderWam","WAWebLinkify","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationUIUpdateFromStorage","WAWebMsgGetters","WAWebMsgType","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebProcessMessageAssociationMessages","WAWebSchemaMessage","WAWebStoreOrphans","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs] [classify-msgs]: skip for "," duplicate messages, with id ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMsgs: skipping unhandled message with type "," and subtype ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMsgs: receive a protocol message with a type ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs]: classifyMsgs got "," existing message(s)"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs]: classifyMsgs got "," message(s)"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs] Error: ",", message: ",", stack: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs] Error: ",", message: ",", stack: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs] done: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeMsgs: checkOrphanMutations failed during handleSingleMsg for: "," chat: "," Error: ",", message: ",", stack: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[store-msgs] start: ",""]);r=function(){return a};return a}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaMessage").getMessageTable().bulkRemove(a.map(function(a){return a.id.toString()}))});return t.apply(this,arguments)}function a(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;try{var e=(yield x(a)),f=Object.entries(e).map(function(a){var b=a[0];a=a[1];return Array.isArray(a)&&a.length>0&&b+": "+a.length}).filter(Boolean).join(", ");d("WALogger").LOG(r(),f);var g=[],i=e.newMsgsMap,j=e.newAssociatedMsgs,k=e.replaceMsgs,l=e.revokeMsgs,m=e.paymentMsgs,t=e.reactionMsgs,u=e.groupInviteMsgs,y=e.chatsWithNewOfflineMsg,z=e.pollUpdateMsgs,A=e.removedPlaceholders,B=e.keepInChatMessages,C=e.editProtocolMsgs,D=e.replyMsgs,E=e.newsletterMsgs,F=e.unifiedAddons,G=e.botInvokeSystemMsgs;e=e.replaceCommentMsgs;j=(yield d("WAWebProcessMessageAssociationMessages").classifyAssociatedMsgsUsingExistingParentsCache(j,i));i=Array.from(i.values());if(Boolean(j==null?void 0:j.orphanAssociatedMsgs.length)){var H;g=g.concat((H=j==null?void 0:j.orphanAssociatedMsgs)!=null?H:[])}var I;j&&(I=d("WAWebApiFilterAndReplaceMessages").validateMsgFn(j==null?void 0:j.validAssociatedMsgs));H=(yield d("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessages(i,I));H=H.newMsgs;yield d("WAWebDBMessageBulkHelper").persistNewMessagesInBulk(H,y);yield d("WAWebDBMessageBulkHelper").persistNewNewsletterMessagesInBulk(E);H=[d("WAWebSchemaMessage").getMessageTable().bulkCreateOrReplace(k)];var J=[];k.forEach(function(a){a.associationType!=null&&a.parentMsgKey!=null&&a.internalId!=null&&J.push({msgKey:a.id,parentMsgKey:a.parentMsgKey,associationType:a.associationType,msgKeyInternalId:a.internalId})});J.length>0&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&H.push.apply(H,d("WAWebDBReplaceUnknownAssociations").replaceUnknownAssociations(J));yield (h||(h=b("Promise"))).all(H);yield s(e);E=(yield d("WAWebAddonProcessMsgs").processMsgsAndGetOrphans(F));k=E.orphans;Boolean(k.length)&&(g=g.concat(k));g.length!==0&&(yield d("WAWebStoreOrphans").storeOrphans(g));H=(yield d("WAWebApiOrphanRevoke").applyAddonRevokes(F));if(H.length>0)for(e of H)l.push(e);yield w(l);yield d("WAWebDBProcessPaymentMessages").processPaymentMessages(m);yield d("WAWebDBProcessReactionsMsgs").processReactionMsgs(t);yield d("WAWebDBProcessGroupInviteMsgs").processGroupInviteMessages(u);(j==null?void 0:j.detachedAssociatedMsgs.length)&&d("WAWebMessageAssociationUIUpdateFromStorage").updateAssociatedMsgsUIFromStorage(j==null?void 0:j.detachedAssociatedMsgs);yield d("WAWebBackendApi").frontendSendAndReceive("processKeepInChatMessages",{keepInChatMessages:B,allowNotification:!1});yield d("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(C);yield d("WAWebDBProcessReplyMsgs").processReplyMsgs(D);yield d("WAWebDBProcessPollUpdateMsgs").processPollUpdateMsgs(z);yield d("WAWebHandleForMessageRange").handleOfflineForMessageRange(a);if(d("WAWebBotGating").isBotReceiveEnabled()&&G.length>0){var K=new Set();G.forEach(function(a){if(K.has(a.id.remote.toString()))return;K.add(a.id.remote.toString());void d("WAWebBackendApi").frontendFireAndForget("updateBotInvokeSystemMsgCreated",{chatId:a.id.remote})})}E=a.map(function(a){return a.id.toString()});try{yield d("WAWebBackendApi").frontendSendAndReceive("checkOrphanMutations",{msgIds:E,chatIds:y}),yield d("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions(E)}catch(b){d("WALogger").ERROR(q(),String(E.join(" ")),String(a[0].id.remote),b.name,b.message,b.stack).devConsole(b)}v(i,A);d("WALogger").LOG(p(),f)}catch(a){c("gkx")("26258")?d("WALogger").ERROR(o(),a.name,a.message,a.stack).sendLogs("storeMsgs-error",{sampling:.01}):d("WALogger").ERROR(n(),a.name,a.message,a.stack).devConsole(a).sendLogs("storeMsgs-error: "+a.message)}});return u.apply(this,arguments)}function v(a,b){a=a.filter(function(a){return d("WAWebCommonMsgUtils").isPlaceholderMsg(a.type)&&a.type!==d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER});a.length>0&&void d("WAWebHandlePlaceholderWam").addPlaceholderWam(a);b.length>0&&void d("WAWebHandlePlaceholderWam").populatePlaceholderWam(b)}function w(a){var c=[];a.forEach(function(a){a.protocolMessageKey&&c.push({revokeMsgKey:a.protocolMessageKey,newMsgKey:a.id,timestamp:a.t,subtype:a.subtype,sender:d("WAWebMsgGetters").getSender(a),revokeTimestamp:a.t,disappearingModeInitiator:a.disappearingModeInitiator,ephemeralDuration:a.ephemeralDuration,ephemeralSettingTimestamp:a.ephemeralSettingTimestamp,viewMode:a.viewMode})});return d("WAWebDBStoreRevokeMsgs").processRevokeMsgs(c).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(c.length>0){var b=[],e=new Set();c.forEach(function(a){b.push(a.revokeMsgKey.toString());a=a.revokeMsgKey.remote.toString();e.add(a)});yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(Array.from(e.values()).join(","),b))}return a});return function(b){return a.apply(this,arguments)}}())}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(m(),a.length);var b=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a.map(function(a){return String(a.id)}),!1));d("WALogger").DEV(l(),b.filter(function(a){return a!=null}).length);var c=[],e=[],f=[],g=[],h=[],n=[],o=[],p=[],q=[],r=[],s=[],t=[],u=new Set(),v=new Map(),w=new Map(),x=[],y=[],B=[];a.forEach(function(a,i){var l=a,m=String(a.id);i=b[i];if(i!=null&&A(a,i)){if(a.type===d("WAWebMsgType").MSG_TYPE.COMMENT){var C=d("WAWebAddonProcessMsgsUtils").castToAddonMsgData(l);d("WAWebAddonGatingUtils").isUnifiedInfraEnabled(a)&&C!=null&&t.push(C);y.push(a)}else{var D;C=d("WAWebDBMessageSerialization").dbRowFromMessage(l);C.t=i.t;C.internalId=i.internalId;C.rowId=i.rowId;C.pendingReadReceipt=i.pendingReadReceipt;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&i.placeholderCreatedWhenAccountIsHosted===!1&&C.senderOrRecipientAccountTypeHosted===!0&&((D=a.id)==null?void 0:(D=D.remote)==null?void 0:D.isUser())&&(C.hostedBizEncStateMismatch=!0,d("WAWebCmd").Cmd.isMainStreamReadyMd&&d("WAWebBackendApi").frontendFireAndForget("updateMsgModelHostedBizEncStateMismatchFlagToTrue",{msgId:a.id}));D=d("WAWebDBStoreMessage").isPendingUnreadReceipt(l.id,l);C=d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:C,chatId:l.id.remote.toString(),hasLink:d("WAWebLinkify").hasHttpLink(l),pendingReadReceipt:D});e.push(C)}d("WAWebCommonMsgUtils").isPlaceholderMsg(i.type)&&w.set(m,l)}else if(i&&!(d("WAWebCommonMsgUtils").isFutureproofMsg(i.type)&&z(a)))c.push(a.id.id);else{D=v.get(m);C=D!=null&&!d("WAWebCommonMsgUtils").isPlaceholderMsg(D.type);if(C)c.push(a.id.id);else{a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="bot_invoke_disclaimer"&&x.push(l);if(d("WAWebMsgGetters").getIsNewsletterMsg(a)&&a.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.subtype!=="admin_revoke")s.push(l);else if(d("WAWebAddonGatingUtils").isUnifiedInfraEnabled(a)&&d("WAWebAddonProcessMsgsUtils").castToAddonMsgData(l)!=null){i=d("WAWebAddonProcessMsgsUtils").castToAddonMsgData(l);i!=null&&t.push(i)}else a.type===d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT?o.push(l):d("WAWebCastToReactionMsg").castToReactionMsgData(l)!=null?g.push(d("WAWebCastToReactionMsg").assertReactionMsgData(l)):a.kind===d("WAWebMsgType").MsgKind.PollVoteEncrypted?n.push(a):a.kind===d("WAWebMsgType").MsgKind.ProtocolRevoke?f.push(a):["sender_revoke","admin_revoke"].includes(a.subtype)?(f.push(a),d("WALogger").ERROR(k(),a.type).tags("messaging").sendLogs("storeMsgs-protocol",{sampling:.01})):a.type===d("WAWebMsgType").MSG_TYPE.PAYMENT&&a.subtype==="send"||a.subtype==="payment_action_request_declined"||a.subtype==="payment_transaction_request_cancelled"?(h.push(l),v.set(m,l),u.add(String(a.id.remote))):a.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE?(p.push(l),v.set(m,l),u.add(String(a.id.remote))):a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.subtype==="message_edit"?q.push(l):a.quotedMsg||a.quotedStanzaID!=null?(r.push(l),v.set(m,l),u.add(String(a.id.remote))):a.associationType!=null?(v.set(m,l),B.push(a),u.add(String(a.id.remote))):a.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL?(v.set(m,l),u.add(String(a.id.remote))):d("WALogger").WARN(j(),a.type,a.subtype)}}});c.length>0&&d("WALogger").LOG(i(),c.length,c);return{newMsgsMap:v,newAssociatedMsgs:B,chatsWithNewOfflineMsg:Array.from(u),removedPlaceholders:Array.from(w.values()),replaceMsgs:e,revokeMsgs:f,paymentMsgs:h,reactionMsgs:g,pollUpdateMsgs:n,keepInChatMessages:o,groupInviteMsgs:p,editProtocolMsgs:q,replyMsgs:r,newsletterMsgs:s,unifiedAddons:t,botInvokeSystemMsgs:x,replaceCommentMsgs:y}});return y.apply(this,arguments)}function z(a){return d("WAWebAddonGatingUtils").isUnifiedInfraEnabled(a)?!0:Boolean(d("WAWebDBAddOnProviders").getAddOnProviderForMsg(a))}function A(a,b){return d("WAWebCommonMsgUtils").isPlaceholderMsg(b.type)&&!d("WAWebCommonMsgUtils").isPlaceholderMsg(a.type)||d("WAWebCommonMsgUtils").isFutureproofMsg(b.type)&&!d("WAWebCommonMsgUtils").isFutureproofMsg(a.type)&&!z(a)||d("WAWebCommonMsgUtils").isRichResponseMsg(b.type)&&d("WAWebCommonMsgUtils").isSomewhatParsedRichResponseMsg(a)}g.storeMsgs=a;g.classifyMsgs=x}),98); __d("WAWebStoreOrphans",["WALogger","WAWebAddonProcessMsgsUtils","WAWebDBStoreMessageOrphans","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[orphans-infra]: processed "," orphan(s)"]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;yield d("WAWebDBStoreMessageOrphans").storeMessageOrphans(a,function(a){return d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a)});d("WALogger").DEV(h(),a.length)});return i.apply(this,arguments)}g.storeOrphans=a}),98); __d("WAWebDirectConnectionUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a}function b(a){return a}f.stringToCertificateString=a;f.certificateStringToString=b}),66); __d("WAWebGraphQLProductCatalogGetPublicKeyJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetPublicKeyResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_public_key",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"public_key_certificate_pem",storageKey:null},{alias:null,args:null,concreteType:"XWAPublicKeyWithSignature",kind:"LinkedField",name:"public_key_with_signature",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"public_key_pem",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"public_key_signature",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebGraphQLProductCatalogGetPublicKeyJobQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebGraphQLProductCatalogGetPublicKeyJobQuery",selections:b},params:{id:"WAWebGraphQLProductCatalogGetPublicKeyJobQuery",metadata:{},name:"WAWebGraphQLProductCatalogGetPublicKeyJobQuery",operationKind:"query",text:null}}}();a.hash="e072c0e33a10dd8a876a1c37c2ec40a5";e.exports=a}),null); __d("WAWebGraphQLProductCatalogGetPublicKeyJob",["WAWebDirectConnectionUtils","WAWebGraphQLProductCatalogGetPublicKeyJobQuery.graphql","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i=h!==void 0?h:h=b("WAWebGraphQLProductCatalogGetPublicKeyJobQuery.graphql");function a(a){return d("WAWebRelayClient").fetchQuery(i,{request:{public_key:{biz_jid:a.toJid()}}}).then(function(a){a=a==null?void 0:(a=a.xwa_product_catalog_get_public_key)==null?void 0:a.public_key_certificate_pem;return{certificate:a!=null?d("WAWebDirectConnectionUtils").stringToCertificateString(a):null}})}g.getPublicKey=a}),98); __d("WAWebGraphQLVerifyPostcodeJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetVerifyPostcodeResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_verify_postcode",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogGetVerifyPostcodeResponseSuccessPostcodeVerificationResult",kind:"LinkedField",name:"postcode_verification_result",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"result_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"encrypted_location_name",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebGraphQLVerifyPostcodeJobQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebGraphQLVerifyPostcodeJobQuery",selections:b},params:{id:"WAWebGraphQLVerifyPostcodeJobQuery",metadata:{},name:"WAWebGraphQLVerifyPostcodeJobQuery",operationKind:"query",text:null}}}();a.hash="7154b35b1d03a7c8ff2e0600cc3ac8c0";e.exports=a}),null); __d("WAWebMaybeThrowCatalogErrors",["errorCode","$InternalEnum","WALogger","WAWebBackendErrors"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeThrowLocalErrorForCatalogQuery: unknown error code ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeThrowLocalErrorForCatalogQuery: error code ",""]);j=function(){return a};return a}var k=b("$InternalEnum").Mirrored(["GET_PRODUCT_CATALOG_OWNER_GRAPHQL"]);function a(a,b){var c=a.source.errors||[];c=c[0];c=c==null?void 0:c.code;if(c==null)return;d("WALogger").ERROR(j(),c);if(b===k.GET_PRODUCT_CATALOG_OWNER_GRAPHQL&&c===2498052)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(404,a.message);switch(c){case 2498052:case 2498049:case 2498050:case 2498051:case 2498053:case 2498056:throw new(d("WAWebBackendErrors").ServerStatusCodeError)(400,a.message);case 2498048:throw new(d("WAWebBackendErrors").E451)();case 2498054:throw new(d("WAWebBackendErrors").ServerStatusCodeError)(421);case 2498103:case 2498102:throw new(d("WAWebBackendErrors").CollectionReorderError)()}d("WALogger").WARN(i(),c)}g.ErrorSourceForCatalogQuery=k;g.maybeThrowLocalErrorForCatalogQuery=a}),98); __d("WAWebGraphQLVerifyPostcodeJob",["WAWebGraphQLServerError","WAWebGraphQLVerifyPostcodeJobQuery.graphql","WAWebMaybeThrowCatalogErrors","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i=h!==void 0?h:h=b("WAWebGraphQLVerifyPostcodeJobQuery.graphql");function a(a,b){return d("WAWebRelayClient").fetchQuery(i,{request:{verify_postcode:{biz_jid:a.toJid(),direct_connection_encrypted_info:b}}}).then(function(a){a=(a=a==null?void 0:(a=a.xwa_product_catalog_get_verify_postcode)==null?void 0:a.postcode_verification_result)!=null?a:{};var b=a.result_code;a=a.encrypted_location_name;return{encryptedLocationName:a,resultCode:j(b)}})["catch"](function(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a);throw a})}function j(a){switch(a){case"RESULT_CODE_SUCCESS":return"success";case"RESULT_CODE_UNSERVICEABLE_LOCATION":return"unserviceable_location";default:a;return"invalid_postcode"}}g.verifyPostcode=a;g.mapResultCodeToStrong=j}),98); __d("WAJobRequirement",["Promise","WALogger"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["JobRequirement[","] blocker errored ",""]);i=function(){return a};return a}c=function(){function a(a){var c=this;this.$1=(h||(h=b("Promise"))).resolve();this.$2=!0;this.$3=null;this.$4=function(){var a=c.$3;if(a!=null){c.$3=null;return(h||(h=b("Promise"))).all(a).then(c.$4)}c.$2=!0};this.name=a}var c=a.prototype;c.addBlocker=function(a){var c=this;a=a["catch"](function(a){d("WALogger").ERROR(i(),c.name,a).sendLogs("job-blocker-rejected")});if(this.$2)this.$2=!1,this.$1=(h||(h=b("Promise"))).all([this.$1,a]).then(this.$4);else{var e=this.$3;e!=null?e.push(a):this.$3=[a]}};c.waitUntilSatisfied=function(){return this.$1};c.isSatisfied=function(){return this.$2};c.isSatisfiable=function(){return!0};return a}();e=function(a){babelHelpers.inheritsLoose(c,a);function c(c){c=a.call(this,c)||this;a.prototype.addBlocker.call(babelHelpers.assertThisInitialized(c),new(h||(h=b("Promise")))(function(){}));return c}var d=c.prototype;d.addBlocker=function(){};d.isSatisfiable=function(){return!1};return c}(c);function a(a,c){var d=a.filter(function(a){return!a.isSatisfiable()});if(d.length>0){var e=d.map(function(a){return a.name});return function(a){c==null?void 0:c("unsatisfiable",e,a);return d[0].waitUntilSatisfied()}}var f=a.map(function(){return(h||(h=b("Promise"))).resolve()}),g=(h||(h=b("Promise"))).resolve(),i=null,j=function c(){if(f.every(function(b,c){return b===a[c].waitUntilSatisfied()})){i=null;return}var d=[],e=a.map(function(a){var b=a.waitUntilSatisfied();a.isSatisfied()||(d.push(a.name),void b.then(function(){var b=d.indexOf(a.name);d.splice(b,1)}));return b});f=e;i=d;return(h||(h=b("Promise"))).all(e).then(c)};return function(a){if(i==null){var b=j();b!=null&&(g=g.then(function(){return b}))}c==null?void 0:c(i==null?"satisfied":"unsatisfied",i,a);return g}}g.JobRequirement=c;g.UnsatisfiableJobRequirement=e;g.joinRequirements=a}),98); __d("WAPersistedJobManager",["Promise","WAJobRequirement","WALogger","WAPromiseBackoffs","WATimeUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose([""," waiting on ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," halting because of ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["waitUntilCompletedNonPersisted not implemented in PersistedJobManager"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fireAndForgetNonPersisted not implemented in PersistedJobManager"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose([""," has been loaded and is marked as deprecated"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["addPersistedJobImplementation called twice for ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["onJobStarted for "," threw exception ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": "," step not found"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose([""," failed with error ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["onJobFinished for "," threw exception ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": finished job"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": Unhandled exception: ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": Unhandled exception. Tried "," times"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": RetryOnBackoff"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": requires page"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": delaying until ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": trim wait from "," to ",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["No implementation for ",".",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": removing completed, expired job from db"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": skew detected, adjusting accordingly"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["Running deprecated job ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["No implementation for deprecated ",", job deleted"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["No implementation for ",". Maybe it should have been put to the deprecated list?"]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": InterruptJob"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": running step"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted job missing for given ID"]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["No entry for job ",""]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": restarting"]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": stuck on the step ",", aborting the job"]);K=function(){return a};return a}var L=1,M=function(){function a(a){this.feature=a}var b=a.prototype;b.toString=function(){return"RequiresPage: "+this.feature};return a}(),N=function(){function a(a){this.backoffOptions=a}var b=a.prototype;b.toString=function(){return"RetryOnBackoff"};return a}();a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.toString=function(){return"NonRetryableError"};return b}(babelHelpers.wrapNativeSuper(Error));var O=function(a){this.result=a},P="$unstarted",Q="$finished";c=function(){function a(a){var c=this,e=a.isRestartAfterCrash,f=a.accessors,g=a.unfinishedJobEntries,i=new Map();g=g.then(function(a){var g=[],j=[];a.forEach(function(a){a.stepHardStartCountAfterTimeout>=5?g.push(a):j.push(a)});return(h||(h=b("Promise"))).all(g.map(function(a){d("WALogger").ERROR(K(),S(a),a.step).devConsole(R(a)).sendLogs("job-stuck-"+a.type);return f.deletePersistedJob(a.jobId)})).then(function(){j.forEach(function(a){if(i.has(a.jobId))return;d("WALogger").LOG(J(),R(a));i.set(a.jobId,c.$1(a,e))})})});this.implementationLoaders=new Map();this.implementations=new Map();this.stepBlockers=new WeakMap();this.accessors=f;this.activeJobs=i;this.initialJobsPromise=g;this.listeners=a.listeners;this.deprecatedJobs=a.deprecatedJobs}var c=a.prototype;c.loadAndRunJobFromId=function(a){var b=this.activeJobs.get(a);if(b!=null)return b;b=this.$2(a);this.activeJobs.set(a,b);return b};c.$2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this.initialJobsPromise,c=this.accessors;yield b;b=(yield c.readPersistedJob(a));if(!b){d("WALogger").DEV(I(),a);d("WALogger").WARN(H());return null}return this.$1(b,!1)});function c(b){return a.apply(this,arguments)}return c}();c.$3=function(a){var b=this.implementations,c=this.implementationLoaders,d=b.get(a);if(d)return d;d=c.get(a);if(!d)return null;c=d();b.set(a,c);return c};c.$4=function(a,c){if(c==null||c.length===0)return(h||(h=b("Promise"))).resolve();var e=this.stepBlockers,f=e.get(c);f==null&&(f=d("WAJobRequirement").joinRequirements(c.map(function(a){return a()}),U),e.set(c,f));return f(a)};c.$5=function(a,b,c,e){var f=this;c===void 0&&(c=!1);var g=a.step,h=b.findIndex(function(a){return a.stepName===g}),i=b[h].info(a.current,a.original,V(a,c)),j=i.requirements,k=i.code;i=this.$4(a,j);e&&(i=i.then(e));return i.then(function(){d("WALogger").LOG(G(),T(a));return k(a.current,a.original,V(a,c))}).then(function(e){if(e instanceof O){d("WALogger").LOG(F(),T(a));return e.result}var g=h+1;if(g>=b.length)return e;g=b[g];a.step=g.stepName;a.current=e;a.stepHardStartCountAfterTimeout=0;a.stepFirstStartTime=d("WATimeUtils").unixTime();a.stepUnexpectedErrorCount=0;a.waitUntil=null;a.backedOffCount=0;return f.accessors.updatePersistedJob(a).then(function(){return f.$5(a,b,c)})})};c.$1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=this,f=this.accessors,g=this.activeJobs,i=this.deprecatedJobs,j=this.listeners,k=j.onJobFinished;j=j.onJobStarted;var l=(yield this.$3(a.type));i=i[a.type];if(!l){if(!i){d("WALogger").ERROR(E(),a.type).sendLogs("missing-job-implementation");yield f.deletePersistedJob(a.jobId);return null}else if(i==="NOOP"){d("WALogger").WARN(D(),a.type);yield f.deletePersistedJob(a.jobId);return null}l=(yield i())}var m=l;i&&d("WALogger").LOG(C(),a.type);var n=(i=a.stepFirstStartTime)!=null?i:d("WATimeUtils").unixTime();a.stepFirstStartTime=n;a.stepUnexpectedErrorCount=a.stepUnexpectedErrorCount||0;a.backedOffCount=a.backedOffCount||0;if(a.step===Q){i=a.waitUntil;var F=d("WATimeUtils").secondsUntil(n);i!=null&&d("WATimeUtils").isInFuture(i)&&F>0&&(d("WALogger").LOG(B(),R(a)),i=d("WATimeUtils").castToUnixTime(i-F),d("WATimeUtils").isInFuture(i)&&(a.stepFirstStartTime=d("WATimeUtils").castToUnixTime(n-F),a.waitUntil=i,yield this.accessors.updatePersistedJob(a)));(i==null||!d("WATimeUtils").isInFuture(i))&&(d("WALogger").LOG(A(),R(a)),yield f.deletePersistedJob(a.jobId));g["delete"](a.jobId);return a.current}F=a.step!==P?l.find(function(b){return b.stepName===a.step}):l[0];if(!F){d("WALogger").ERROR(z(),a.type,a.step).sendLogs("missing-job-step");yield f.deletePersistedJob(a.jobId);return null}a.step=F.stepName;i=function f(){var g=a.waitUntil,i=(h||(h=b("Promise"))).resolve();if(g!=null){var j=d("WATimeUtils").futureUnixTime(d("WATimeUtils").DAY_SECONDS);g>j?(d("WALogger").LOG(y(),T(a),g,j),a.waitUntil=j,i=e.accessors.updatePersistedJob(a).then(function(){return d("WATimeUtils").delayUntil(j)})):(d("WALogger").LOG(x(),T(a),g),i=d("WATimeUtils").delayUntil(g))}return i.then(function(){var g=function(){a.waitUntil=null;d("WATimeUtils").happenedWithin(n,d("WATimeUtils").DAY_SECONDS)||a.stepHardStartCountAfterTimeout++;return e.accessors.updatePersistedJob(a)};return e.$5(a,m,c,g)["catch"](function(c){if(c instanceof M){d("WALogger").LOG(w(),T(a));a.stepHardStartCountAfterTimeout>0&&(--a.stepHardStartCountAfterTimeout,e.accessors.updatePersistedJob(a));return new(h||(h=b("Promise")))(function(){})}else if(c instanceof N){d("WALogger").LOG(v(),T(a));var g=d("WAPromiseBackoffs").getDelay(++a.backedOffCount,c.backoffOptions);a.waitUntil=d("WATimeUtils").futureUnixTime(Math.ceil(g/1e3));a.stepHardStartCountAfterTimeout>0&&--a.stepHardStartCountAfterTimeout;return e.accessors.updatePersistedJob(a).then(f)}else if(a.stepUnexpectedErrorCount<L){d("WALogger").WARN(u(),T(a),a.stepUnexpectedErrorCount);d("WALogger").WARN(t(),T(a),c);a.stepUnexpectedErrorCount++;return e.accessors.updatePersistedJob(a).then(f)}throw c})})};var G=i();l=G.then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){d("WALogger").LOG(s(),T(a));var c=null;try{c=k(a.jobId,a.type,a.original,b)}catch(b){d("WALogger").ERROR(r(),a.type,b).sendLogs("onJobFinished-threw")}c!=null&&c>0?(a.waitUntil=d("WATimeUtils").futureUnixTime(Math.ceil(c/1e3)),a.step=Q,a.current=b,a.stepFirstStartTime=d("WATimeUtils").unixTime(),yield e.accessors.updatePersistedJob(a)):(yield f.deletePersistedJob(a.jobId),g["delete"](a.jobId))});return function(a){return c.apply(this,arguments)}}(),function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){d("WALogger").ERROR(q(),a.type,b).sendLogs("job-threw-exception-"+a.type);b=m.find(function(b){return b.stepName===a.step});if(!b)d("WALogger").ERROR(p(),a.type,a.step);else{b=b.info(a.current,a.original,V(a,c));b.stopRetryIf!=null&&(yield b.stopRetryIf.onStopRetry(a.current,a.original,V(a,c)))}yield f.deletePersistedJob(a.jobId);g["delete"](a.jobId)});return function(a){return e.apply(this,arguments)}}());try{j(a.jobId,a.type,a.original)}catch(b){d("WALogger").ERROR(o(),a.type,b).sendLogs("onJobStarted-threw")}return l.then(function(){return G})});function c(b,c){return a.apply(this,arguments)}return c}();c.addPersistedJobImplementation=function(a,b){var c=this.implementationLoaders,e=this.deprecatedJobs;if(c.has(a)){d("WALogger").ERROR(n(),a).sendLogs("repeat-job-loader");return}e&&e[a]&&d("WALogger").DEV(m(),a);c.set(a,b)};c.fireAndForget=function(a){var b=this;this.accessors.maybeCreateJob(a).then(function(a){a=a.id;return b.loadAndRunJobFromId(a)})};c.waitUntilPersisted=function(a){var b=this;return this.accessors.maybeCreateJob(a).then(function(a){a=a.id;b.loadAndRunJobFromId(a)})};c.waitUntilCompleted=function(a){var b=this;return this.accessors.maybeCreateJob(a).then(function(a){a=a.id;return b.loadAndRunJobFromId(a)})};c.fireAndForgetNonPersisted=function(a){d("WALogger").LOG(l())};c.waitUntilCompletedNonPersisted=function(a){return(h||(h=b("Promise"))).resolve(function(){return d("WALogger").LOG(k())})};return a}();function R(a){return"Job["+a.jobId+"] ("+a.type+")"}function S(a){return"[Job "+a.type+"] "}function T(a){return"Job["+a.jobId+"] ("+a.type+"."+a.step+")"}function U(a,b,c){a==="unsatisfiable"?d("WALogger").LOG(j(),T(c),b):a==="unsatisfied"?d("WALogger").LOG(i(),T(c),b):a}function V(a,b){b===void 0&&(b=!1);return{jobStartTime:a.startTime,afterCrash:b,interruptJob:W}}function W(a){return new O(a)}g.RequiresPage=M;g.RetryOnBackoff=N;g.NonRetryableError=a;g.InterruptJob=O;g.UNSTARTED_JOB=P;g.FINISHED_JOB=Q;g.PersistedJobManager=c}),98); __d("WAJobBuilder",["Promise","WAPersistedJobManager","WATimeUtils"],(function(a,b,c,d,e,f,g){"use strict";var h,i=function(){function a(a){this.steps=a}var b=a.prototype;b.step=function(a,b){return this.$1(a,typeof b==="function"?{code:b}:b)};b.$1=function(b,c){var e=c.stopRetryIf,f=c.requirements;c=c.code;f=k(f,c,e);if(e){var g=e.timePassedSeconds;c=e.appCrashed;var h=e.onStopRetry;h=k(null,l(h),e);g!=null&&(f=j(function(a,b,c){a=c.jobStartTime;return d("WATimeUtils").happenedWithin(a,g)},f,h));c&&(f=j(function(a,b,c){a=c.afterCrash;return!a},f,h))}return new a([].concat(this.steps,[{stepName:b,info:f}]))};b.finalStep=function(a,b){var c=this.step(a,b);return{end:function(){return c.steps}}};return a}();function a(){return new i([])}function j(a,b,c){return function(d,e,f){return a(d,e,f)?b(d,e,f):c(d,e,f)}}function k(a,b,c){var d={requirements:a,code:b,stopRetryIf:c};return function(){return d}}function l(a){return function(c,e,f){return(h||(h=b("Promise"))).resolve(a(c,e,f)).then(function(a){return a instanceof d("WAPersistedJobManager").InterruptJob?a:new(d("WAPersistedJobManager").InterruptJob)(a)})}}g.JobBuilder=i;g.definePersistedJob=a}),98); __d("WAWebDefinePersistedJob",["WAJobBuilder"],(function(a,b,c,d,e,f,g){function a(){return d("WAJobBuilder").definePersistedJob()}g.defineWebPersistedJob=a}),98); __d("WAWebQueryGetPublicKeyJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizGatingUtils","WAWebCommsWapMd","WAWebDefinePersistedJob","WAWebDirectConnectionUtils","WAWebGraphQLProductCatalogGetPublicKeyJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("getPublicKeyResponse",function(a){a.assertTag("iq");a.assertFromServer();a=(a=a.maybeChild("public_key"))==null?void 0:(a=a.maybeChild("pem"))==null?void 0:a.contentString();a=a!=null?d("WAWebDirectConnectionUtils").stringToCertificateString(a):null;return{certificate:a}});a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendStanza",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.businessJid;a=d("WAWebWidFactory").createWid(a);if(d("WAWebBizGatingUtils").isGraphQLForGetPublicKeyEnabled())return d("WAWebGraphQLProductCatalogGetPublicKeyJob").getPublicKey(a);a=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"get",smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").BizGetPublicKey),xmlns:"w:biz:catalog",id:d("WAWap").generateId()},d("WAWap").wap("public_key",{jid:d("WAWebCommsWapMd").USER_JID(a)}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);else return a.result});return function(b){return a.apply(this,arguments)}}()).end();g.QueryGetPublicKey=a}),98); __d("WAWebVerifyPostcodeJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizGatingUtils","WAWebCommsWapMd","WAWebDefinePersistedJob","WAWebGraphQLVerifyPostcodeJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("productResponse",function(a){a.assertTag("iq");a.assertFromServer();var b=a.child("result_code");a=a.maybeChild("encrypted_location_name");a=a==null?void 0:a.contentString();b=b.contentString();if(b!=="invalid_postcode"&&b!=="unserviceable_location"&&b!=="success")throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500);return{resultCode:b,encryptedLocationName:a}});a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendStanza",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.businessJid;a=a.directConnectionEncryptedInfo;b=d("WAWebWidFactory").createWid(b);if(d("WAWebBizGatingUtils").isGraphQLForVerifyPostcodeEnabled())return d("WAWebGraphQLVerifyPostcodeJob").verifyPostcode(b,a);b=d("WAWap").wap("iq",{id:d("WAWap").generateId(),xmlns:"w:biz:catalog",type:"get",to:d("WAWap").S_WHATSAPP_NET,smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogVerifyPostcode)},d("WAWap").wap("verify_postcode",{biz_jid:d("WAWebCommsWapMd").USER_JID(b)},d("WAWap").wap("direct_connection_encrypted_info",null,a)));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);else return a.result});return function(b){return a.apply(this,arguments)}}()).end();g.VerifyPostcode=a}),98); __d("WAWebBizCartConstants",[],(function(a,b,c,d,e,f){a=99;f.CART_ITEM_MAX_QUANTITY=a}),66); __d("WAWebBizParseProductGraphql_product.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},h=[b,g];return{argumentDefinitions:[],kind:"Fragment",metadata:{mask:!1},name:"WAWebBizParseProductGraphql_product",selections:[a,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},b,c,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[a,e,f],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:h,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[b,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[g,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[a,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},e,f],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:h,storageKey:null}],storageKey:null}],type:"XWACatalogProduct",abstractKey:null}}();e.exports=a}),null); __d("WAWebProductTypes.flow",["$InternalEnum"],(function(a,b,c,d,e,f){var g=b("$InternalEnum")({IN_STOCK:"in stock",OUT_OF_STOCK:"out of stock",AVAILABLE_FOR_ANOTHER_POSTCODE:"available for another postcode",UNKNOWN:"unknown"}),h=[g.OUT_OF_STOCK,g.AVAILABLE_FOR_ANOTHER_POSTCODE],i=6;b=b("$InternalEnum")({Default:"DEFAULT",CountryOriginExempt:"COUNTRY_ORIGIN_EXEMPT"});function a(a){if(a==="APPROVED"||a==="PENDING"||a==="REJECTED")return a}function c(a){if(a==null)return;switch(a){case"TRUE":return"ISHIDDEN_TRUE";case"FALSE":return"ISHIDDEN_FALSE";default:a;return a}}function d(a){if(a==null)return;switch(a){case"COUNTRY_ORIGIN_EXEMPT":return"COMPLIANCECATEGORY_COUNTRYORIGINEXEMPT";case"DEFAULT":return"COMPLIANCECATEGORY_DEFAULT";default:a;return a}}function e(a){if(a==null)return;switch(a){case"STATUS_APPROVED":return"APPROVED";case"STATUS_PENDING":return"PENDING";case"STATUS_REJECTED":return"REJECTED";default:a}}f.ProductAvailability=g;f.PRODUCT_AVAILABILITY_UNAVAILABLE_VALUES=h;f.PRODUCT_PAGE_SIZE=i;f.ProductComplianceCategory=b;f.asProductReviewType=a;f.mapIsHiddenToWASchema=c;f.mapComplianceCategoryToWASchema=d;f.mapCollectionReviewStatusToWASchema=e}),66); __d("WAWebSignedShimmedUrl",[],(function(a,b,c,d,e,f){function a(a){return a}f.asSignedShimmedUrl=a}),66); __d("WAWebSyntheticCountryCode",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({NotApplicable:"NOT_APPLICABLE"});f.SyntheticCountryCode=a}),66); __d("WAWebBizParseProductGraphql",["WANullthrows","WAWebBizCartConstants","WAWebBizGatingUtils","WAWebBizParseProductGraphql_product.graphql","WAWebProductTypes.flow","WAWebSignedShimmedUrl","WAWebSyntheticCountryCode"],(function(a,b,c,d,e,f,g){var h,i={AVAILABLE_FOR_ANOTHER_POSTCODE:d("WAWebProductTypes.flow").ProductAvailability.AVAILABLE_FOR_ANOTHER_POSTCODE,IN_STOCK:d("WAWebProductTypes.flow").ProductAvailability.IN_STOCK,OUT_OF_STOCK:d("WAWebProductTypes.flow").ProductAvailability.OUT_OF_STOCK};function a(a){var b,e,f=a.status_info,g=a.sale_price,h=a.product_availability,j=a.compliance_info;a=babelHelpers.objectWithoutPropertiesLoose(a,["status_info","sale_price","product_availability","compliance_info"]);b=(b=(b=a.media)==null?void 0:b.images)!=null?b:[];var k=b[0];b=b.slice(1);e=babelHelpers["extends"]({id:c("WANullthrows")(a.id),retailer_id:(e=a.retailer_id)!=null?e:"",name:c("WANullthrows")(a.name),description:(e=a.description)!=null?e:"",url:(e=a.url)!=null?e:"",currency:a.currency,price:a.price,is_hidden:a.is_hidden==="ISHIDDEN_TRUE",is_sanctioned:(e=a.is_sanctioned)!=null?e:!1,max_available:(e=a.max_available)!=null?e:d("WAWebBizCartConstants").CART_ITEM_MAX_QUANTITY,availability:h&&h in i?i[h]:d("WAWebProductTypes.flow").ProductAvailability.UNKNOWN},(g==null?void 0:g.price)!=null?babelHelpers["extends"]({sale_price:g.price},g.start_date!=null&&g.end_date!=null?{sale_start_date:g.start_date,sale_end_date:g.end_date}:null):null,{checkmark:a.belongs_to==="true",image_hashes_for_whatsapp:((h=(e=a.media)==null?void 0:e.images)!=null?h:[]).map(function(a){return c("WANullthrows")(a.id)}),image_cdn_urls:k?[{key:"requested",value:c("WANullthrows")(k.request_image_url)},{key:"full",value:c("WANullthrows")(k.original_image_url)}]:[],additional_image_cdn_urls:b.map(function(a){return[{key:"requested",value:c("WANullthrows")(a.request_image_url)},{key:"full",value:c("WANullthrows")(a.original_image_url)}]}),whatsapp_product_can_appeal:(f==null?void 0:f.can_appeal)==="true",capability_to_review_status:[{key:"WHATSAPP",value:(g=f==null?void 0:f.status)!=null?g:"APPROVED"}],videos:(e=a.media)==null?void 0:(h=e.videos)==null?void 0:h.map(function(a){return{id:c("WANullthrows")(a.id),original_video_url:c("WANullthrows")(a.original_video_url),thumbnail_url:c("WANullthrows")(a.thumbnail_url)}}),variant_info:a.variant_info!=null?{listing_details:a.variant_info.listing_details?{description:a.variant_info.listing_details.description,multi_price:a.variant_info.listing_details.multi_price,lowest_price:a.variant_info.listing_details.lowest_price}:void 0,availability:a.variant_info.availability?{listing:a.variant_info.availability.listing.map(function(a){return{is_available:a.is_available,options:a.options.map(function(a){return{name:a.name,value:a.value}}),product_id:a.product_id}})}:void 0,types:(b=(k=a.variant_info)==null?void 0:k.types.map(function(a){return{name:a.name,options:a.options.map(function(a){var b;a.thumbnail_media&&(b={id:a.thumbnail_media.id,original_dimensions:a.thumbnail_media.original_dimensions?{height:a.thumbnail_media.original_dimensions.height,width:a.thumbnail_media.original_dimensions.width}:void 0,original_image_url:a.thumbnail_media.original_image_url,request_image_url:a.thumbnail_media.request_image_url});return{value:a.value,thumbnail_media:b}})}}))!=null?b:[],variant_properties:(g=(f=a.variant_info)==null?void 0:f.variant_properties.map(function(a){return{name:a.name,value:a.value}}))!=null?g:[]}:void 0});if(a.compliance_category==="COMPLIANCECATEGORY_COUNTRYORIGINEXEMPT")if(j!=null&&j.country_code_origin!=null&&j.importer_address==null&&d("WAWebBizGatingUtils").isCountryOfOriginEnabled()){e.compliance_info={country_code_origin:(h=j.country_code_origin)!=null?h:void 0};e.importer_information_exempt=!0}else j==null&&d("WAWebBizGatingUtils").isCountryOfOriginEnabled()?e.importer_information_exempt=!0:e.compliance_info={country_code_origin:d("WAWebSyntheticCountryCode").SyntheticCountryCode.NotApplicable};else if(j!=null){k=j.importer_address;if(!k){e.compliance_info={country_code_origin:(b=j.country_code_origin)!=null?b:void 0,importer_name:(f=j.importer_name)!=null?f:void 0,importer_address:void 0}}else{e.compliance_info={country_code_origin:(g=j.country_code_origin)!=null?g:void 0,importer_name:(h=j.importer_name)!=null?h:void 0,importer_address:{street1:c("WANullthrows")(k==null?void 0:k.street1),street2:(b=k==null?void 0:k.street2)!=null?b:void 0,postal_code:(f=k==null?void 0:k.postal_code)!=null?f:void 0,city:c("WANullthrows")(k==null?void 0:k.city),region:(g=k==null?void 0:k.region)!=null?g:void 0,country_code:c("WANullthrows")(k==null?void 0:k.country_code)}}}}a.shimmed_url!=null&&(e.signedShimmedUrl=d("WAWebSignedShimmedUrl").asSignedShimmedUrl(a.shimmed_url));return e}g.parseProductGraphQL=a}),98); __d("WAWebBizCatalogParseProduct",["WAWap","WAWebBizCartConstants","WAWebProductTypes.flow","WAWebSignedShimmedUrl","WAWebSyntheticCountryCode"],(function(a,b,c,d,e,f,g){b=function(a){var b,c,e=a.child("id").contentString(),f=a.maybeChild("url"),g="";f&&f.hasContent()&&(g=f.contentString());f=a.child("name").contentString();b=(b=a.maybeAttrString("availability"))!=null?b:d("WAWebProductTypes.flow").ProductAvailability.UNKNOWN;var h=d("WAWebBizCartConstants").CART_ITEM_MAX_QUANTITY,j=a.maybeAttrString("max_available");j!=null&&(h=Number(j));j=a.maybeChild("max_available");j=j==null?void 0:j.contentString();j!=null&&(h=Number(j));j=a.maybeChild("description");j=j?j.contentString():"";var l=a.maybeChild("belongs_to");l=(l==null?void 0:l.contentString())==="true"||!1;var m=[],n=[],o=[],p=a.child("media"),q=!0;p.forEachChildWithTag("image",function(a){if(q)q=!1,m.push({key:"requested",value:a.child("request_image_url").contentString()}),m.push({key:"full",value:a.child("original_image_url").contentString()}),o.push(a.child("id").contentString());else{var b=[];b.push({key:"requested",value:a.child("request_image_url").contentString()});b.push({key:"full",value:a.child("original_image_url").contentString()});n.push(b);o.push(a.child("id").contentString())}});var r=[];p.forEachChildWithTag("video",function(a){var b=a.maybeChild("id"),c=a.child("original_video_url").contentString();a=a.maybeChild("thumbnail_url");b=(b==null?void 0:b.contentString())||"";a=(a==null?void 0:a.contentString())||"";r.push({id:b,original_video_url:c,thumbnail_url:a})});p=a.maybeChild("status_info");var s=(p==null?void 0:p.child("status").contentString())||"APPROVED";p=p==null?void 0:(p=p.maybeChild("can_appeal"))==null?void 0:p.contentString();s=[{key:"WHATSAPP",value:s}];var t=a.maybeChild("currency");t=t?t.contentString():void 0;var u=a.maybeChild("price");u=u==null?void 0:u.contentString();var v=a.maybeChild("retailer_id");v=v?v.contentString():"";var w=a.hasAttr("is_hidden")?a.attrString("is_hidden")==="true":!1,x=a.hasAttr("compliance_category")?d("WAWebProductTypes.flow").ProductComplianceCategory.cast(a.attrString("compliance_category")):d("WAWebProductTypes.flow").ProductComplianceCategory.Default,y=a.maybeChild("sale_price");c=y?babelHelpers["extends"]({sale_price:(c=y.maybeChild("price"))==null?void 0:c.contentString()},y.hasChild("start_date")&&y.hasChild("end_date")?{sale_start_date:y.child("start_date").contentString(),sale_end_date:y.child("end_date").contentString()}:null):null;y=a.maybeAttrString("is_sanctioned")==="true";e=babelHelpers["extends"]({id:e,is_hidden:w,is_sanctioned:y,url:g,name:f,description:j,availability:b,max_available:h,additional_image_cdn_urls:n,image_cdn_urls:m,capability_to_review_status:s,whatsapp_product_can_appeal:p==="true",image_hashes_for_whatsapp:o,currency:t,price:u,retailer_id:v,checkmark:l,videos:r,variant_info:null},c);w=a.maybeChild("compliance_info");x===d("WAWebProductTypes.flow").ProductComplianceCategory.CountryOriginExempt?e.compliance_info=k():w&&(e.compliance_info=i(w));y=a.maybeChild("shimmed_url");if(y!=null){g=y.contentString();g!==""&&(e.signedShimmedUrl=d("WAWebSignedShimmedUrl").asSignedShimmedUrl(g))}return e};function a(a){var b,c,e,f=a.id?d("WAWap").wap("id",null,a.id.toString()):void 0,g=a.description?d("WAWap").wap("description",null,a.description):void 0,i=a.url?d("WAWap").wap("url",null,a.url):void 0,j=a.retailerId?d("WAWap").wap("retailer_id",null,a.retailerId):void 0,k=a.priceAmount1000!=null?d("WAWap").wap("currency",null,a.currency):void 0,l=a.priceAmount1000!=null?d("WAWap").wap("price",null,a.priceAmount1000.toString()):void 0,m=a.salePriceAmount1000!=null?d("WAWap").wap("sale_price",null,a.salePriceAmount1000.toString()):void 0;b=[d("WAWap").wap("image",null,d("WAWap").wap("url",null,a.imageCdnUrl))].concat((b=a.additionalImageCdnUrl)==null?void 0:b.map(function(a){return d("WAWap").wap("image",null,d("WAWap").wap("url",null,a))}));c=(c=a.videos)==null?void 0:c.map(function(a){return d("WAWap").wap("video",null,d("WAWap").wap("url",null,a.original_video_url))});var n=h(a.complianceInfo),o;(((e=a.complianceInfo)==null?void 0:e.countryCodeOrigin)===String(d("WAWebSyntheticCountryCode").SyntheticCountryCode.NotApplicable)||a.importerInformationExempt)&&(o=d("WAWebProductTypes.flow").ProductComplianceCategory.CountryOriginExempt);e=babelHelpers["extends"]({is_hidden:a.isHidden?"true":"false"},o?{compliance_category:o}:void 0);return d("WAWap").wap("product",e,f,d("WAWap").wap("name",null,a.name),g,i,j,d("WAWap").wap("media",null,b.concat(c)),l,m,k,n)}function h(a){var b=j(a),c=b.isExempt,e=b.hasCountryCodeOrigin,f=b.hasImporterName;b=b.hasImporterAddress;return!c&&(e||f||b)?d("WAWap").wap("compliance_info",null,e?d("WAWap").wap("country_code_origin",null,a==null?void 0:a.countryCodeOrigin):void 0,f?d("WAWap").wap("importer_name",null,a==null?void 0:a.importerName):void 0,b?d("WAWap").wap("importer_address",null,(a==null?void 0:(c=a.importerAddress)==null?void 0:c.street1)?d("WAWap").wap("street1",null,a.importerAddress.street1):void 0,(a==null?void 0:(e=a.importerAddress)==null?void 0:e.street2)?d("WAWap").wap("street2",null,a.importerAddress.street2):void 0,(a==null?void 0:(f=a.importerAddress)==null?void 0:f.city)?d("WAWap").wap("city",null,a.importerAddress.city):void 0,(a==null?void 0:(b=a.importerAddress)==null?void 0:b.region)?d("WAWap").wap("region",null,a.importerAddress.region):void 0,(a==null?void 0:(c=a.importerAddress)==null?void 0:c.postalCode)?d("WAWap").wap("postal_code",null,a.importerAddress.postalCode):void 0,(a==null?void 0:(e=a.importerAddress)==null?void 0:e.countryCode)?d("WAWap").wap("country_code",null,a.importerAddress.countryCode):void 0):void 0):void 0}function i(a){var b,c=a.child("country_code_origin").contentString();b=(b=a.maybeChild("importer_name"))==null?void 0:b.contentString();a=a.maybeChild("importer_address");c={country_code_origin:c,importer_name:b};if(a){c.importer_address={street1:a.child("street1").contentString(),street2:(b=a.maybeChild("street2"))==null?void 0:b.contentString(),postal_code:(b=a.maybeChild("postal_code"))==null?void 0:b.contentString(),city:a.child("city").contentString(),region:(b=a.maybeChild("region"))==null?void 0:b.contentString(),country_code:a.child("country_code").contentString()}}return c}function j(a){var b=(a==null?void 0:a.countryCodeOrigin)===String(d("WAWebSyntheticCountryCode").SyntheticCountryCode.NotApplicable),c=!b&&(a==null?void 0:a.countryCodeOrigin)!==void 0,e=!b&&(a==null?void 0:a.importerName)!==void 0;a=!b&&(a==null?void 0:a.importerAddress)!==void 0&&[a.importerAddress.street1,a.importerAddress.street2,a.importerAddress.city,a.importerAddress.region,a.importerAddress.postalCode,a.importerAddress.countryCode].some(function(a){return a});return{isExempt:b,hasImporterAddress:a,hasImporterName:e,hasCountryCodeOrigin:c}}function k(){return{country_code_origin:String(d("WAWebSyntheticCountryCode").SyntheticCountryCode.NotApplicable)}}g.parseProductNode=b;g.productModelToNode=a;g.scanComplianceInfoForMissingData=j}),98); __d("WAWebWamEnumBusinessType",[],(function(a,b,c,d,e,f){a=Object.freeze({SMB:1,API_DC:2,API:3});f.BUSINESS_TYPE=a}),66); __d("WAWebWamEnumGraphqlCatalogEndpoint",[],(function(a,b,c,d,e,f){a=Object.freeze({GET_CATALOG:1,GET_PRODUCT:2,GET_PRODUCT_LIST:3,GET_COLLECTIONS:4,GET_SINGLE_COLLECTION:5,GET_CATEGORIES:6,GET_VARIANTS:7,GET_PROMOTIONS:8,CREATE_COLLECTION:9,GET_PUBLIC_KEY:10,VERIFY_POSTCODE:11});f.GRAPHQL_CATALOG_ENDPOINT=a}),66); __d("WAWebWamEnumGraphqlRequestResult",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,FAILURE:2});f.GRAPHQL_REQUEST_RESULT=a}),66); __d("WAWebGraphqlCatalogRequestWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBusinessType","WAWebWamEnumGraphqlCatalogEndpoint","WAWebWamEnumGraphqlRequestResult"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({GraphqlCatalogRequest:[3206,{businessJid:[4,d("WAWebWamCodegenUtils").TYPES.STRING],businessType:[5,d("WAWebWamEnumBusinessType").BUSINESS_TYPE],graphqlCatalogEndpoint:[1,d("WAWebWamEnumGraphqlCatalogEndpoint").GRAPHQL_CATALOG_ENDPOINT],graphqlErrorCode:[3,d("WAWebWamCodegenUtils").TYPES.INTEGER],graphqlRequestResult:[2,d("WAWebWamEnumGraphqlRequestResult").GRAPHQL_REQUEST_RESULT]},[1,1,1],"private",0]},{GraphqlCatalogRequest:[]});g.GraphqlCatalogRequestWamEvent=a}),98); __d("WAWebCatalogEventLogger",["WAWebGraphqlCatalogRequestWamEvent","WAWebWamEnumGraphqlCatalogEndpoint","WAWebWamEnumGraphqlRequestResult"],(function(a,b,c,d,e,f,g){a=function(a){var b=new(d("WAWebGraphqlCatalogRequestWamEvent").GraphqlCatalogRequestWamEvent)({graphqlCatalogEndpoint:a});return{success:function(){b.set({graphqlErrorCode:-1,graphqlRequestResult:d("WAWebWamEnumGraphqlRequestResult").GRAPHQL_REQUEST_RESULT.SUCCESS}),b.commit()},failure:function(a){a=a[0];b.set({graphqlErrorCode:a.code,graphqlRequestResult:d("WAWebWamEnumGraphqlRequestResult").GRAPHQL_REQUEST_RESULT.FAILURE});b.commit()}}};g.GRAPHQL_CATALOG_ENDPOINT=d("WAWebWamEnumGraphqlCatalogEndpoint").GRAPHQL_CATALOG_ENDPOINT;g.createCatalogEventLogger=a}),98); __d("WAWebProductMessageListConstant",[],(function(a,b,c,d,e,f){a="DELETED";f.INVALID_PRODUCT_TOKEN=a}),66); __d("WAWebQueryProductListCatalogJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},i=[c,h];e=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetProductListResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_product_list",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogGetProductListResponseSuccessProductList",kind:"LinkedField",name:"product_list",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},c,d,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},e,{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[b,f,g],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:i,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:i,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryProductListCatalogJobQuery",selections:e,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryProductListCatalogJobQuery",selections:e},params:{id:"9950845091602150",metadata:{},name:"WAWebQueryProductListCatalogJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("filterNulls",[],(function(a,b,c,d,e,f){"use strict";function a(a){var b=[];for(a of a)a!=null&&b.push(a);return b}f["default"]=a}),66); __d("WAWebQueryProductListCatalogJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WANullthrows","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizCatalogManagementFetchProductList","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebCommsWapMd","WAWebDefinePersistedJob","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebProductMessageListConstant","WAWebQueryProductListCatalogJobQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","filterNulls"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryProductListGraphQLByOwner: error handling flow not implemented for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_product_list query. Falling back to IQ."]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("productListResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_list");var b=[];a.forEachChildWithTag("product",function(a){var c=a.maybeChild("id");if(!c)return;var e=a.maybeChild("status");(e==null?void 0:e.contentString())===d("WAWebProductMessageListConstant").INVALID_PRODUCT_TOKEN?b.push({id:c.contentString(),status:d("WAWebProductMessageListConstant").INVALID_PRODUCT_TOKEN}):b.push(d("WAWebBizCatalogParseProduct").parseProductNode(a))});return b}),l=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=a.catalogWid,f=a.productIds,g=a.width,h=a.height;a=a.directConnectionEncryptedInfo;e=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"get",smax_id:b.SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogGetProductList),xmlns:"w:biz:catalog",id:b.generateId()},b.wap("product_list",{jid:d("WAWebCommsWapMd").USER_JID(d("WAWebWidFactory").createWid(e))},f.map(function(a){return d("WAWap").wap("product",null,d("WAWap").wap("id",null,a))}).concat(c("filterNulls")([b.wap("width",null,g.toString()),b.wap("height",null,h.toString()),a!=null?d("WAWap").wap("direct_connection_encrypted_info",null,a):null]))));f=(yield d("WADeprecatedSendIq").deprecatedSendIq(e,k));if(!f.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(f.errorCode);else return f.result});return function(b){return a.apply(this,arguments)}}(),m=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var e=a.catalogWid,f=a.productIds,g=a.width,i=a.height,k=a.directConnectionEncryptedInfo;e=(yield d("WAWebRelayClient").fetchQuery(h!==void 0?h:h=b("WAWebQueryProductListCatalogJobQuery.graphql"),{request:{product_list:{jid:e.toString(),products:f.map(function(a){return{id:a}}),width:String(g),height:String(i),direct_connection_encrypted_info:k}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_PRODUCT_LIST)}));return c("WANullthrows")(e==null?void 0:(f=e.xwa_product_catalog_get_product_list)==null?void 0:(g=f.product_list)==null?void 0:g.products.map(d("WAWebBizParseProductGraphql").parseProductGraphQL))}catch(b){b instanceof d("WAWebGraphQLServerError").GraphQLServerError&&d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b);d("WALogger").WARN(j());return l(a)}});return function(b){return a.apply(this,arguments)}}(),n=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.catalogWid,c=a.productIds,e=a.width,f=a.height,g=a.directConnectionEncryptedInfo;b=(yield d("WAWebBizCatalogManagementFetchProductList").fetchProductList({product_list:{jid:b.toString(),products:c.map(function(a){return{id:a}}),width:String(e),height:String(f),direct_connection_encrypted_info:g}}));if(b.type==="success")return b.productsResult;else b.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error):b.type;d("WALogger").WARN(i(),JSON.stringify(b));return l(a)});return function(b){return a.apply(this,arguments)}}();a=function(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();return b!=null&&b.equals(d("WAWebWidFactory").createWid(a.catalogWid))?d("WAWebBizGatingUtils").graphQLForGetProductListEnabled()?n(a):l(a):d("WAWebBizGatingUtils").graphQLForCatalogM1Enabled()?m(a):l(a)};e=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendStanza",a).end();g.QueryProductListCatalog=e}),98); __d("WAWebGroupConstants",[],(function(a,b,c,d,e,f){a={ANNOUNCEMENT:"announcement",RESTRICT:"restrict",NO_FREQUENTLY_FORWARDED:"no_frequently_forwarded",EPHEMERAL:"ephemeral",MEMBERSHIP_APPROVAL_MODE:"membership_approval_mode",REPORT_TO_ADMIN_MODE:"report_to_admin_mode",ALLOW_NON_ADMIN_SUB_GROUP_CREATION:"allow_non_admin_sub_group_creation",MEMBER_ADD_MODE:"member_add_mode"};b=60;f.GROUP_SETTING_TYPE=a;f.PAST_PARTICIPANT_EXPIRATION_DAYS=b}),66); __d("WAWebApiParticipantStore",["WALogger","WATimeUtils","WAWebApiContact","WAWebBackendApi","WAWebGroupConstants","WAWebModelStorageUtils","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebWamGroupMetricCache","WAWebWidFactory","asyncToGeneratorRuntime","gkx","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getGroupSenderKeyList: missed "," sender key(s) for primary devices"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getGroupSenderKeyList: include "," because its primary doesn't have sender key"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["pruneExpiredPastParticipants: Pruning expired past participants from participant DB"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["markForgetSenderKey: group participant info missing for group ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["markHasSenderKey: group participant info missing for group ",""]);l=function(){return a};return a}var m=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="GroupUnSyncedError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.toString();b=(yield d("WAWebSchemaParticipant").getParticipantTable().get(b));return o(a,b)});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=[],f=[];if(!b)return{skDistribList:e,skList:f,rotateKey:!1};var g=b.senderKey,j=b.rotateKey,k=0;g.forEach(function(a,b){if(b.includes("hosted"))return;var c=d("WAWebWidFactory").createWid(b),h=d("WAWebWidFactory").toUserWid(c);h=(h=g.get(h.toString()))!=null?h:!1;a&&h?f.push(c):(e.push(c),c.isCompanion()&&a&&!h&&(d("WALogger").WARN(i(),b),k++))});c("gkx")("26258")||k>0&&d("WALogger").WARN(h(),k).sendLogs("missing-sender-key-on-primary");yield r(a,g.size);d("WAWebWamGroupMetricCache").cacheGroupMetrics(b);return j?{skDistribList:[].concat(e,f),skList:[],rotateKey:j}:{skDistribList:e,skList:f,rotateKey:j}});return p.apply(this,arguments)}function e(a,c){var e=a.toString();return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(e));if(!b){d("WALogger").LOG(l(),e);return}yield a.createOrReplace(q(b,c,!0))});return function(b){return a.apply(this,arguments)}}())}function f(a,c){var e=a.toString();return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(e));if(!b){d("WALogger").LOG(k(),e);return}yield a.createOrReplace(q(b,c,!1))});return function(b){return a.apply(this,arguments)}}())}function q(a,b,c){var e=new Map(a.senderKey),f=!1;b.forEach(function(a){if(d("WAWebUserPrefsMeUser").isMeDevice(a))return;var b=String(a);e.has(b)?e.set(b,c):a.isLid()||(f=!0)});return{groupId:a.groupId,senderKey:e,participants:a.participants,pastParticipants:a.pastParticipants,admins:a.admins,superAdmins:a.superAdmins,rotateKey:f,deviceSyncComplete:a.deviceSyncComplete}}function r(a,b){return d("WAWebBackendApi").frontendSendAndReceive("updateCachedDeviceCount",{groupWid:a,deviceCount:b})}function s(a,b,e){if(e!=="add")return b;var f=new Set(b.map(function(a){return a.id.toString()}));a.forEach(function(a){f.has(a)&&f["delete"](a);a=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").createUserWid(a));a=a==null?void 0:a.toString();!c("isStringNullOrEmpty")(a)&&f.has(a)&&f["delete"](a)});e=b.filter(function(a){return f.has(a.id.toString())});return e}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.map(function(a){return a.id.toString()}),e=(yield d("WAWebSchemaParticipant").getParticipantTable().bulkGet(c));c=a.map(function(a,c){c=e[c];if(!c)return a;var f=c.pastParticipants.map(function(a){var b=a.jid,c=a.leaveTs;a=a.leaveReason;return{id:d("WAWebWidFactory").createWid(b),leaveTs:c,leaveReason:a}});c=s(c.participants,f,b);return babelHelpers["extends"]({},a,{pastParticipants:c})});return c});return u.apply(this,arguments)}function v(){return d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield d("WAWebSchemaParticipant").getParticipantTable().all()),c=[],e=d("WATimeUtils").DAY_SECONDS*d("WAWebGroupConstants").PAST_PARTICIPANT_EXPIRATION_DAYS;b.forEach(function(a){var b=a.pastParticipants.filter(function(a){a=d("WATimeUtils").castToUnixTime(a.leaveTs);a=d("WATimeUtils").happenedWithin(a,e);return a});if(b.length!==a.pastParticipants.length){a=babelHelpers["extends"]({},a,{pastParticipants:b});c.push(a)}});c.length>0&&d("WALogger").DEV(j());return a.bulkCreateOrReplace(c)});return function(b){return a.apply(this,arguments)}}())}var w=new Map();function x(a,b){w.set(a,b)}function y(a){a!=null?w["delete"](a):w.clear()}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=w.get(a);if(b==null){var c=(yield d("WAWebSchemaParticipant").getParticipantTable().get(a));c=!!c&&c.admins.includes((c=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:c.toString());w.set(a,c);return c}return b});return A.apply(this,arguments)}g.GroupUnSyncedError=m;g.getGroupSenderKeyList=a;g.getGroupSenderKeyListFromParticipantRecord=o;g.markHasSenderKey=e;g.markForgetSenderKey=f;g.injectPastParticipantsFromDB=t;g.pruneExpiredPastParticipants=v;g.setAdminshipCache=x;g.clearAdminshipCache=y;g.isCurrentUserGroupAdmin=z}),98); __d("WAWebChatConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:0,COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:1,INCOMPLETE:2,NOT_INCLUDED_IN_HIST_SYNC:3,COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY:4});c=60*5*1e3;f.ConversationEndOfHistoryTransferModelPropType=a;f.FTS_TTL=c}),66); __d("WAJobOrchestratorTypes",["$InternalEnum"],(function(a,b,c,d,e,f){"use strict";a=b("$InternalEnum")({SKIP:"SKIP_PRIORITIZATION",UI_ACTION:"UI_ACTION",LOW:"LOW",HIGH:"HIGH",OFFLINE:"OFFLINE",HISTORY_SYNC:"HISTORY_SYNC",BEST_EFFORT:"BEST_EFFORT"});c=1;d=a.LOW;e=10*1e3;f.JOB_PRIORITY=a;f.DEFAULT_CONCURRENCY=c;f.DEFAULT_JOB_PRIORITY=d;f.DEFAULT_JOB_TIMEOUT_MS=e}),66); __d("WAJobPriorityBucket",["WAJobOrchestratorTypes","WALogger"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed::markJobTaskDone found jobId: "," in scheduled tasks"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed::markJobTaskPending found jobId: "," in pending tasks"]);i=function(){return a};return a}a=function(){function a(a){this.tasks=[];this.pendingTasks=[];this.lastJobStartedTimestampMs=null;this.jobMaxConcurrency=(a=a.jobMaxConcurrencyMap)!=null?a:{}}var b=a.prototype;b.updateConfig=function(a){this.jobMaxConcurrency=(a=a.jobMaxConcurrencyMap)!=null?a:{}};b.getStats=function(){return[].concat(this.tasks,this.pendingTasks).reduce(function(a,b){var c;c=(c=a[b.jobName])!=null?c:0;a[b.jobName]=c+1;return a},{})};b.next=function(){var a=this;if(this.tasks.length===0)return null;var b=this.pendingTasks.reduce(function(a,b){var c;c=(c=a.get(b.jobName))!=null?c:0;a.set(b.jobName,c+1);return a},new Map()),c=this.tasks.filter(function(c){var e;return((e=b.get(c.jobName))!=null?e:0)<((e=a.jobMaxConcurrency[c.jobName])!=null?e:d("WAJobOrchestratorTypes").DEFAULT_CONCURRENCY)});return c.length>0?[c[0]]:null};b.add=function(a,b,c,d){c={jobId:c,jobInfo:b,jobName:a,run:d};this.tasks.push(c);return c};b.markJobTaskPending=function(a){this.pendingTasks.includes(function(b){return b.jobId===a.jobId})&&d("WALogger").ERROR(i(),a.jobId).sendLogs("JobOrchestrator::markJobTaskPending"),this.lastJobStartedTimestampMs=Date.now(),this.pendingTasks.push(a),this.tasks=this.tasks.filter(function(b){return b.jobId!==a.jobId})};b.markJobTaskDone=function(a){this.pendingTasks=this.pendingTasks.filter(function(b){return b.jobId!==a}),this.tasks.includes(function(b){return b.jobId===a})&&d("WALogger").ERROR(h(),a).sendLogs("JobOrchestrator::markJobTaskDone")};b.count=function(){return this.tasks.length};b.pendingCount=function(){return this.pendingTasks.length};b.clearWaitingTasks=function(){this.tasks=[]};b.clear=function(){this.tasks=[],this.pendingTasks=[]};b.getLastJobStartedTimestamp=function(){return this.lastJobStartedTimestampMs};return a}();b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.next=function(){var a=this,b,c;if(this.tasks.length===0)return null;var d=this.pendingTasks.reduce(function(a,b){var c;c=(c=a.get(b.jobName))!=null?c:0;a.set(b.jobName,c+1);return a},new Map()),e=this.tasks.filter(function(b){var c;return((c=d.get(b.jobName))!=null?c:0)<((c=a.jobMaxConcurrency[b.jobName])!=null?c:1)});if(e.length===0)return null;b=(b=this.jobMaxConcurrency[e[0].jobName])!=null?b:1;c=(c=d.get(e[0].jobName))!=null?c:0;if(b>1&&c<b){var f=e.filter(function(a){return a.jobName===e[0].jobName});b=Math.min(f.length,b-c);return f.slice(0,b)}return[e[0]]};return b}(a);g.BaseJobBucket=a;g.LowJobBucket=b}),98); __d("WAMetrics",["Promise","WATimeUtils"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(){var a=d("WATimeUtils").performanceAbsoluteNow();return new(h||(h=b("Promise")))(function(b){setTimeout(function(){b(d("WATimeUtils").performanceAbsoluteNow()-a)},0)})}g.getEventLoopDelay=a}),98); __d("WAConcurrentBucketJobQueue",["Promise","WABase64","WACustomError","WAJobOrchestratorTypes","WAJobPriorityBucket","WALogger","WAMetrics","WANullthrows","WAPromiseTimeout","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[job-orchestator]: "," exceeding the timeout, release the thread."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[job-orchestator]: updated WAConcurrentBucketJobQueue config"]);j=function(){return a};return a}var k=30,l=new Map([[d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH,5],[d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW,1]]);a=function(){function a(){this.$1=!1,this.$2=0,this.$3=0,this.$4=0,this.$5=new Map(),this.$6=new Map(),this.$7=new Map(),this.$9=0}var e=a.prototype;e.init=function(a,b){var e,f,g;if(this.$1)throw c("err")("WAConcurrentBucketJobQueue has already initialized");this.$4=(e=a==null?void 0:a.bestEffortWaitTimeoutSec)!=null?e:k;this.$2=a.maxConcurrency;this.$3=a.maxConcurrency;this.$8=b;this.$7=this.$11(a==null?void 0:a.jobPrioritiesQuota);this.$6=new Map(this.$7);this.$5=new Map();this.$9=Date.now();b=new(d("WAJobPriorityBucket").BaseJobBucket)({jobMaxConcurrencyMap:(e=a.maxConcurrencyPerJob)!=null?e:{}});e=new(d("WAJobPriorityBucket").LowJobBucket)({jobMaxConcurrencyMap:(e=a.maxConcurrencyPerJob)!=null?e:{}});f=new(d("WAJobPriorityBucket").LowJobBucket)({jobMaxConcurrencyMap:(f=a.maxConcurrencyPerJob)!=null?f:{}});g=new(d("WAJobPriorityBucket").BaseJobBucket)({jobMaxConcurrencyMap:(g=a.maxConcurrencyPerJob)!=null?g:{}});a=new(d("WAJobPriorityBucket").BaseJobBucket)({jobMaxConcurrencyMap:(a=a.maxConcurrencyPerJob)!=null?a:{}});this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION,b);this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH,b);this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.OFFLINE,g);this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC,a);this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW,e);this.$5.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,f);this.$1=!0};e.updateConfig=function(a){this.$3+=a.maxConcurrency-this.$2,this.$2=a.maxConcurrency,this.$5.forEach(function(b){return b.updateConfig({jobMaxConcurrencyMap:(b=a.maxConcurrencyPerJob)!=null?b:{}})}),this.$7=this.$11(a==null?void 0:a.jobPrioritiesQuota),d("WALogger").LOG(j())};e.isInitialized=function(){return this.$1};e.clearQueue=function(){if(!this.$1)throw c("err")("WAConcurrentBucketJobQueue not initialized");this.$5.forEach(function(a){return a.clear()})};e.clearQueueByPriority=function(a){if(!this.$1)throw c("err")("WAConcurrentBucketJobQueue not initialized");(a=this.$5.get(a))==null?void 0:a.clearWaitingTasks()};e.getIntStats=function(){var a=this,b=function(b){var c;b=a.$5.get(b);return((c=b==null?void 0:b.count())!=null?c:0)+((c=b==null?void 0:b.pendingCount())!=null?c:0)};return{highPriorityBucketSize:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH),lowPriorityBucketSize:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW),bestEffortPriorityBucketSize:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT)}};e.getStringStats=function(){var a=this,b=function(b){var c=(b=(b=a.$5.get(b))==null?void 0:b.getStats())!=null?b:{};b=Object.keys(c).reduce(function(a,b){var d=a[0];a=a[1];var e=c[b];return e>d?[e,b]:[d,a]},[0,null]);b=b[1];return b};return{highPriorityMaxJob:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH),lowPriorityMaxJob:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW),bestEffortPriorityMaxJob:b(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT)}};e.enqueue=function(a,e,f,g){var i,j=this;if(!this.$1)return(h||(h=b("Promise"))).reject(c("err")("WAConcurrentBucketJobQueue not initialized"));var k,l,m=new(h||(h=b("Promise")))(function(a,b){k=a,l=b}),n=babelHelpers["extends"]({priority:d("WAJobOrchestratorTypes").DEFAULT_JOB_PRIORITY},f),o=this.getJobBucketByType(n.priority);if(!o)return(h||(h=b("Promise"))).reject(c("err")("WAConcurrentBucketJobQueue no bucket for job with name "+a+" was found."));void d("WAMetrics").getEventLoopDelay().then(function(a){(g==null?void 0:g.isActive())&&(g==null?void 0:g.addPoint("measure_event_loop_delay",{"int":{eventLoopDelay:a}}))});g==null?void 0:g.addPoint("scheduling_job",{string:babelHelpers["extends"]({},this.getStringStats(),{priority:n.priority}),"int":babelHelpers["extends"]({},this.getIntStats(),{maxTimeoutMs:(i=f==null?void 0:f.maxTimeoutMs)!=null?i:0})});var p=n.priority+"-"+a+"-"+((i=f==null?void 0:f.jobId)!=null?i:d("WABase64").randomBase64(8));i=o.add(a,n,p,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{j.$8.logJobStarted(p);var a=(yield j.$12(e(),f==null?void 0:f.maxTimeoutMs));j.$8.logJobCompleted(p);k(a)}catch(a){a instanceof d("WACustomError").TimeoutError?j.$8.logJobTimeout(p):j.$8.logJobError(p),l(a)}}));this.$8.logJobCreated({jobId:p,jobName:a,jobPriority:n.priority,pendingJobsCount:o.count()});f&&f.priority===d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION&&void this.$13(i);this.$14();return m};e.getAvailableThreadsCount=function(){return this.$3};e.getJobQuotaConfig=function(){return this.$7};e.getRemainingJobCountMap=function(){return this.$6};e.getJobBucketByType=function(a){return this.$5.get(a)};e.getSnapshot=function(a){a=this.getJobBucketByType(a);return!a?null:a.getStats()};e.$11=function(a){var b;!a?b=new Map(l):b=new Map(a);b.set(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,0);return b};e.$15=function(a){return(a=this.$6.get(a))!=null?a:0};e.$16=function(){this.$6=new Map(this.$7)};e.$17=function(a){var b=this;a===void 0&&(a=!0);var c=0,e=null,f=0;this.$5.forEach(function(a,d){c+=a==null?void 0:a.count();f+=b.$15(d);if(e!=null)return;a.count()>0&&b.$15(d)>0&&(e=a)});var g=e==null||f===0;g&&this.$16();if(this.$18(c,g))return this.getJobBucketByType(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT);return e==null&&a?this.$17(!1):e};e.$18=function(a,b){var c=this;function e(a,b){var c=Date.now();return a>c?!1:c-a<b*1e3}function f(a,b){a=Math.ceil(a-Date.now())+b*1e3;return a>0?a:0}var g=this.getJobBucketByType(d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT);a=a-((a=g==null?void 0:g.count())!=null?a:0);var h=g==null?void 0:g.getLastJobStartedTimestamp();if((g==null?void 0:g.count())===0)return!1;if(h==null&&e(this.$9,this.$4)){if(this.$10==null){g=f(this.$9,this.$4);this.$10=setTimeout(function(){c.$14(),c.$10=null},g)}return!1}return a>0&&h!=null&&e(h,this.$4)?!1:b};e.$19=function(a){a=this.$20(a);return c("WANullthrows")(this.$5.get(a))};e.$20=function(a){var b=a.split("-")[0];b=d("WAJobOrchestratorTypes").JOB_PRIORITY.cast(b);if(!b)throw c("err")("ConcurrentBucketQueue cannot extract known job priority type from id: "+a);return b};e.$21=function(a){a=this.$20(a);this.$15(a)>0?this.$6.set(a,this.$15(a)-1):this.$6.set(a,0)};e.$14=function(){var a=this;while(this.$3>0){var b=this.$17();b=b==null?void 0:b.next();if(b==null)break;b.forEach(function(b){a.$21(b.jobId),void a.$13(b)})}};e.$12=function(a,b){return b!==void 0?d("WAPromiseTimeout").promiseTimeout(a,b):a};e.$13=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=this.$19(a.jobId);this.$3--;c.markJobTaskPending(a);var e=a.run,f=a.jobId,g=a.jobName;try{yield this.$12(e(),((e=a.jobInfo)==null?void 0:e.maxTimeoutMs)===void 0?d("WAJobOrchestratorTypes").DEFAULT_JOB_TIMEOUT_MS:void 0)}catch(a){if(a instanceof d("WACustomError").TimeoutError)this.$8.logJobTimeout(f),d("WALogger").LOG(i(),g);else throw a}finally{this.$3++,c.markJobTaskDone(f),this.$3>0&&setTimeout(function(){return b.$14()},0)}});function c(b){return a.apply(this,arguments)}return c}();return a}();g.WAConcurrentBucketJobQueue=a}),98); __d("WADefaultJobNoQueue",["WAJobOrchestratorTypes","WARandomHex","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(){this.$2=!1}var e=a.prototype;e.init=function(a,b){if(this.$2)throw c("err")("DefaultNoQueue has already initialized");this.$1=b;this.$2=!0};e.updateConfig=function(a){};e.isInitialized=function(){return this.$2};e.clearQueue=function(){};e.clearQueueByPriority=function(a){};e.getSnapshot=function(){throw c("err")("getSnapshot is not implemented for DefaultNoQueue")};e.enqueue=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;e=(e=c==null?void 0:c.jobId)!=null?e:d("WARandomHex").randomHex(8).substr(0,64);this.$1.logJobCreated({jobId:e,jobName:a,jobPriority:(a=c==null?void 0:c.priority)!=null?a:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW,pendingJobsCount:0});try{this.$1.logJobStarted(e);c=(yield b());this.$1.logJobCompleted(e);return c}catch(a){this.$1.logJobError(e);throw a}});function c(b,c,d){return a.apply(this,arguments)}return c}();return a}();g.WADefaultJobNoQueue=a}),98); __d("WAWebJobOrchestratorHelper",[],(function(a,b,c,d,e,f){function g(a,b){return b instanceof Map||b instanceof Set?Array.from(b):b}function a(a,b){var c;if(a.maxConcurrency!==b.maxConcurrency)return!0;if(((c=a.jobPrioritiesQuota)==null?void 0:c.size)!==((c=b.jobPrioritiesQuota)==null?void 0:c.size))return!0;return Object.keys((c=a.maxConcurrencyPerJob)!=null?c:{}).length!==Object.keys((c=b.maxConcurrencyPerJob)!=null?c:{}).length?!0:JSON.stringify(a,g)!==JSON.stringify(b,g)}f.hasConfigChanged=a}),66); __d("WAWebOrchestratorJobInfoEvent",[],(function(a,b,c,d,e,f){a=function(){function a(a,b,c,d){this.jobName=a,this.scenario=d,this.pendingJobsCount=c,this.jobPriority=b}var b=a.prototype;b.logJobAdded=function(){this.webcJobAddedT=Date.now()};b.logJobStarted=function(){this.webcJobStartedT=Date.now()};b.logJobCompleted=function(a){this.webcJobCompletedT=Date.now(),this.jobResultType=a};return a}();f.JobInfoEvent=a}),66); __d("WAWebWamEnumWebcJobResultTypeCode",[],(function(a,b,c,d,e,f){a=Object.freeze({COMPLETED:0,ERROR:1,TIMEOUT:2,ABORTED:3});f.WEBC_JOB_RESULT_TYPE_CODE=a}),66); __d("WAWebWebcJobInfoWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcJobResultTypeCode","WAWebWamEnumWebcScenarioType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcJobInfo:[3054,{jobName:[1,a.TYPES.STRING],jobPriority:[2,a.TYPES.STRING],jobResultType:[5,d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE],pendingJobsCount:[4,a.TYPES.INTEGER],scenario:[3,d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE],webcJobAddedT:[6,a.TYPES.INTEGER],webcJobCompletedT:[8,a.TYPES.INTEGER],webcJobStartedT:[7,a.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcJobInfo:[]});g.WebcJobInfoWamEvent=b}),98); __d("WAWebOrchestratorJobStatsLogger",["WALogger","WAWebBrokerGlobalAppState","WAWebOrchestratorJobInfoEvent","WAWebWamEnumWebcJobResultTypeCode","WAWebWamEnumWebcScenarioType","WAWebWebcJobInfoWamEvent","cr:4324","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[job-orchestrator] "," execution time: "," ms, waiting time: "," ms, success: ",""]);h=function(){return a};return a}a=function(){function a(){this.$1=new Map()}var e=a.prototype;e.logJobCreated=function(a){if(c("gkx")("26258"))return;var b=a.jobName,e=a.jobId,f=a.jobPriority;a=a.pendingJobsCount;var g=c("WAWebBrokerGlobalAppState").getCurrentScenario();b=new(d("WAWebOrchestratorJobInfoEvent").JobInfoEvent)(b,f,a,g);b.logJobAdded();this.$1.set(e,b)};e.logJobStarted=function(a){if(c("gkx")("26258"))return;a=this.$1.get(a);a==null?void 0:a.logJobStarted()};e.logJobCompleted=function(a){this.$2(a,d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE.COMPLETED)};e.logJobError=function(a){this.$2(a,d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE.ERROR)};e.logJobTimeout=function(a){this.$2(a,d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE.TIMEOUT)};e.logJobAborted=function(a){this.$2(a,d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE.ABORTED)};e.$2=function(a,b){if(c("gkx")("26258"))return;var d=this.$1.get(a);d==null?void 0:d.logJobCompleted(b);this.$3(d);this.$1["delete"](a)};e.$3=function(a){if(!a)return;var c=a.jobName,e=a.webcJobCompletedT,f=a.webcJobStartedT,g=a.webcJobAddedT,i=a.jobResultType;e=e-f;f=f-g;g=i===d("WAWebWamEnumWebcJobResultTypeCode").WEBC_JOB_RESULT_TYPE_CODE.COMPLETED;d("WALogger").LOG(h(),c,e,f,g);i=new(d("WAWebWebcJobInfoWamEvent").WebcJobInfoWamEvent)({jobName:a.jobName,jobPriority:a.jobPriority,jobResultType:a.jobResultType,pendingJobsCount:a.pendingJobsCount,scenario:a.scenario,webcJobAddedT:a.webcJobAddedT,webcJobCompletedT:a.webcJobCompletedT,webcJobStartedT:a.webcJobStartedT});if(i.scenario===d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE){f=(e=b("cr:4324")==null?void 0:b("cr:4324").JOB_EVENT_SAMPLING_RATE[c])!=null?e:1;i.weight=f}i.commit()};return a}();g.JobStatsLogger=a}),98); __d("WAWebJobOrchestrator",["WAConcurrentBucketJobQueue","WADefaultJobNoQueue","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebBrokerGlobalAppState","WAWebJobOrchestratorHelper","WAWebOrchestratorJobStatsLogger","WAWebWamEnumWebcScenarioType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[job-orchestrator] config changed "]);h=function(){return a};return a}var i={maxConcurrency:1,bestEffortWaitTimeoutSec:d("WATimeUtils").FIVE_MINUTES,jobPrioritiesQuota:new Map([[(b=d("WAJobOrchestratorTypes")).JOB_PRIORITY.HIGH,5],[b.JOB_PRIORITY.LOW,1],[b.JOB_PRIORITY.OFFLINE,3],[b.JOB_PRIORITY.HISTORY_SYNC,1]])},j={maxConcurrency:1,bestEffortWaitTimeoutSec:d("WATimeUtils").FIVE_MINUTES,jobPrioritiesQuota:new Map([[b.JOB_PRIORITY.HIGH,5],[b.JOB_PRIORITY.LOW,1],[b.JOB_PRIORITY.OFFLINE,1],[b.JOB_PRIORITY.HISTORY_SYNC,1]])},k="default",l="bucket";function m(){var a=c("WAWebBrokerGlobalAppState").getCurrentScenario();if(a===d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE)return i;return a===d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.OFFLINE_RESUME?j:i}var n=i,o;function p(){o||(o=new(d("WAWebOrchestratorJobStatsLogger").JobStatsLogger)());return o}var q={};function a(a){a===void 0&&(a=!1);a=a?k:l;var b=m(),c;if(q[a]){d("WAWebJobOrchestratorHelper").hasConfigChanged(n,b)&&(d("WALogger").LOG(h()),n=b,q[a].updateConfig(b));return q[a]}switch(a){case"bucket":c=new(d("WAConcurrentBucketJobQueue").WAConcurrentBucketJobQueue)();break;default:c=new(d("WADefaultJobNoQueue").WADefaultJobNoQueue)();break}c.init(b,p());q[a]=c;n=b;return c}g.getInstance=a}),98); __d("WAWebOrchestratorNonPersistedJob",["WAJobOrchestratorTypes","WAWebJobOrchestrator","err"],(function(a,b,c,d,e,f,g){function a(a,b,e){if(typeof b!=="function")throw c("err")("getNonPersistJob got invalid function param");var f=d("WAWebJobOrchestrator").getInstance((e==null?void 0:e.priority)===d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP);return{fireAndForget:function(){var c=arguments;f.enqueue(a,function(){return b.apply(null,c)},e)},waitUntilCompleted:function(){var c=arguments,d=f.enqueue(a,function(){return b.apply(null,c)},e);return d}}}g.createNonPersistedJob=a}),98); __d("WAWebGroupDatabaseJob",["WAJobOrchestratorTypes","WAWebDBGroupParticipant","WAWebDBGroupsGroupMetadata","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateGroupMetadataTable",function(a){return d("WAWebDBGroupsGroupMetadata").updateGroupMetadataTable(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({groupInfos:a})}function b(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateGroupParticipantTableWithoutDeviceSync",function(a){return d("WAWebDBGroupParticipant").updateGroupParticipantTableWithoutDeviceSync(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({groupInfos:a})}function c(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("markGroupParticipantStale",function(a){return d("WAWebDBGroupParticipant").markGroupParticipantStale(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({group:a})}function e(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("bulkMarkGroupParticipantStale",function(a){return d("WAWebDBGroupParticipant").bulkMarkGroupParticipantStale(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({groupIds:a})}function f(a,b,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("modifyGroupParticipant",function(a){return d("WAWebDBGroupParticipant").modifyGroupParticipant(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({group:a,oldId:b,newId:c})}function h(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getGroupMetadata",function(a){return d("WAWebDBGroupsGroupMetadata").getGroupMetadataUNSAFE(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({groupWid:a})}function i(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getGroupParticipant",function(a){return d("WAWebDBGroupParticipant").getGroupParticipant(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({groupWid:a})}g.updateGroupMetadataTableJob=a;g.updateGroupParticipantTableWithoutDeviceSyncJob=b;g.markGroupParticipantStaleJob=c;g.bulkMarkGroupParticipantStaleJob=e;g.modifyGroupParticipantJob=f;g.getGroupMetadataJob=h;g.getGroupParticipantJob=i}),98); __d("WAWebUserPrefsModelStorage",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.INITIAL_GROUP_PHASH,JSON.stringify(a))}function b(a){var b=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.INITIAL_GROUP_PHASH);try{return JSON.parse(b)[a]}catch(a){return null}}function e(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.INITIAL_GROUP_PHASH);try{return JSON.parse(a)}catch(a){return null}}g.setInitialGroupPhash=a;g.getInitialGroupPhash=b;g.getInitialGroupPhashMap=e}),98); __d("WAWebQueryAndUpdateGroupMetadataJob",["Promise","WALogger","WATimeUtils","WAWebApiChat","WAWebApiParticipantStore","WAWebBackendApi","WAWebChatConstants","WAWebCreateOrReplaceDisplayNamesAndLidPnMappingsJob","WAWebGroupDatabaseJob","WAWebGroupQueryJob","WAWebGroupSystemMsg","WAWebHandleSingleMsg","WAWebPhashUtils","WAWebQueryAndUpdateSubgroupSuggestionsJob","WAWebSchemaChat","WAWebUserPrefsModelStorage","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Completed updateGroupEndOfHistorySyncFlag"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["One ore more chat create failed for group not synced in initial sync with error: "," "]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Start updateGroupEndOfHistorySyncFlag"]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a===void 0&&(a=!1);if(c!=null){c=(yield d("WAWebGroupQueryJob").queryGroupsById(c,"per_group_dirty_recovery"));if(c==null||c.length===0)return}else{c=(yield d("WAWebGroupQueryJob").queryAllGroups());if(c.length===0)return}c=(yield d("WAWebApiParticipantStore").injectPastParticipantsFromDB(c));c=(yield d("WAWebApiChat").injectAdditionalEphemeralInfoFromDB(c));var e=[],f=[];c.forEach(function(b){d("WAWebBackendApi").frontendFireAndForget("createOrUpdateGroupMetadataFromQuery",{groupInfo:b}),a&&void o(b),e.push(d("WAWebGroupQueryJob").maybeQueryAndUpdateMembershipApprovalRequests(b))});var g=[];c.forEach(function(a){a.participants.forEach(function(a){var b=a.id,c=a.lid,e=a.phoneNumber;a=a.displayName;g.push({id:d("WAWebWidFactory").toUserWid(b),lid:c?d("WAWebWidFactory").toUserWid(c):null,phoneNumber:e?d("WAWebWidFactory").toUserWid(e):null,displayName:a})})});yield d("WAWebCreateOrReplaceDisplayNamesAndLidPnMappingsJob").createOrReplaceDisplayNamesAndLidPnMappingsInBatches(g,!0);yield d("WAWebGroupDatabaseJob").updateGroupMetadataTableJob(c);yield d("WAWebGroupDatabaseJob").updateGroupParticipantTableWithoutDeviceSyncJob(c);a&&(yield m(c));c.forEach(function(a){f.push(d("WAWebQueryAndUpdateSubgroupSuggestionsJob").maybeQueryAndUpdateSubgroupSuggestions(a))});yield (h||(h=b("Promise"))).all(e)});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(k()).tags("history-sync","groups");var b=d("WAWebUserPrefsModelStorage").getInitialGroupPhashMap(),c=[];for(a of a){var e=(yield d("WAWebApiChat").getChatRecord(a.id));if(e)continue;e=b==null?void 0:b[a.id.toString()];if(e!=null)continue;c.push({unreadCount:0,muteExpiration:0,isAutoMuted:!1,id:a.id,endOfHistoryTransferType:d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.NOT_INCLUDED_IN_HIST_SYNC})}yield d("WAWebBackendApi").frontendSendAndReceive("chatCollectionAdd",{things:c,options:{merge:!0}});yield d("WAWebSchemaChat").getChatTable().bulkCreate(c.map(function(a){var b=a.endOfHistoryTransferType;a=a.id;b={endOfHistoryTransferType:b,id:a.toString(),unreadCount:0,muteExpiration:0,isAutoMuted:!1};return b}))["catch"](function(a){d("WALogger").LOG(j(),a.message).tags("history-sync","groups")});d("WALogger").LOG(i()).tags("history-sync","groups")});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsModelStorage").getInitialGroupPhash(a.id.toString());if(b==null)return;var c=(yield d("WAWebPhashUtils").phashV1(a.participants.map(function(a){return a.id}))),e=c.substring(2);b!=null&&b!==c&&b!==e&&a.defaultSubgroup!==!0&&d("WAWebHandleSingleMsg").handleSingleMsg(a.id,d("WAWebGroupSystemMsg").genInitialPhashMismatchMsg(a.id,d("WATimeUtils").unixTime()),"pHashMismatchMsg")});return p.apply(this,arguments)}g.queryAndUpdateAllGroupMetadata=a}),98); __d("WAWebQueryAndUpdateGroupsMetadataByJidsJob",["WALogger","WAWebDefinePersistedJob","WAWebQueryAndUpdateGroupMetadataJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryAndUpdateGroupsMetadataByJidsJob: started persisted job"]);h=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("queryAndUpdateGroupsMetadataByJids",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(h()),yield d("WAWebQueryAndUpdateGroupMetadataJob").queryAndUpdateAllGroupMetadata(!1,a)});return function(b){return a.apply(this,arguments)}}()).end();g.queryAndUpdateGroupsMetadataByJidsJob=a}),98); __d("WAWebApiSubgroupSuggestionStore",["Promise","WABatcher","WALogger","WAWebSchemaSubgroupSuggestionV2","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeSubgroupSuggestionsBatched: aggregating "," changes"]);i=function(){return a};return a}c=3e3;e=function(a){return d("WAWebSchemaSubgroupSuggestionV2").getSubgroupSuggestionTable().equals(["parentGroupId"],a.toString()).then(function(a){return a.map(function(a){var b=a.id,c=a.parentGroupId,e=a.subject,f=a.desc,g=a.owner,h=a.t,i=a.isExistingGroup,j=a.participantCount;a=a.hiddenSubgroup;return{id:d("WAWebWidFactory").createWid(b),parentGroupId:d("WAWebWidFactory").createWid(c),subject:e,desc:f,owner:d("WAWebWidFactory").createWid(g),t:h,isExistingGroup:i,participantCount:j,hiddenSubgroup:a}})})};var j=function(a,b){b=b.map(function(b){var c=b.id,d=b.subject,e=b.desc,f=b.owner,g=b.t,h=b.isExistingGroup,i=b.participantCount;b=b.hiddenSubgroup;return{id:c.toString(),parentGroupId:a.toString(),subject:d,desc:e,owner:f.toString(),t:g,isExistingGroup:h,participantCount:i,hiddenSubgroup:b}});return d("WAWebSchemaSubgroupSuggestionV2").getSubgroupSuggestionTable().bulkCreateOrReplace(b)};f=function(a,c,e,f){var g=function(){var g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var g=(yield (h||(h=b("Promise"))).all(c.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=(yield d("WAWebSchemaSubgroupSuggestionV2").getSubgroupSuggestionTable().get([a.toString(),b.toString(),e.toString()]));return b});return function(a){return c.apply(this,arguments)}}())));g=g.filter(Boolean);var i=g.map(function(a){return babelHelpers["extends"]({},a,{owner:f,parentGroupId:d("WAWebWidFactory").createWid(a.parentGroupId),id:d("WAWebWidFactory").createWid(a.id)})});yield k(g.map(function(b){b=b.id;return{parentGroupId:a,id:d("WAWebWidFactory").createWid(b),owner:e}}));yield j(a,i)});return function(){return g.apply(this,arguments)}}();return g()};var k=function(a){return d("WAWebSchemaSubgroupSuggestionV2").getSubgroupSuggestionTable().bulkRemove(a.map(function(a){var b=a.parentGroupId,c=a.id;a=a.owner;return[b.toString(),c.toString(),a.toString()]}))},l=function(a){return d("WAWebSchemaSubgroupSuggestionV2").getSubgroupSuggestionTable().bulkRemoveByIndex(["parentGroupId"],[a.toString()])},m=d("WABatcher").batch({delayMs:c},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i(),a.length).devConsole(a);a=a.reduce(function(a,b){a.push.apply(a,b.suggestionsRowKeys);return a},[]);yield k(a);return[]});return function(b){return a.apply(this,arguments)}}());function a(a){var b=a.subgroupSuggestions;a=a.isOffline;return a===!0?m({suggestionsRowKeys:b}):k(b)}g.getSubgroupSuggestions=e;g.addSubgroupSuggestions=j;g.updateOwnerInSubgroupSuggestions=f;g.removeSubgroupSuggestions=k;g.removeAllSubgroupSuggestions=l;g.removeSubgroupSuggestionsWithOfflineOption=a}),98); __d("WAWebCommunityGatingUtils",["WAWebABProps","WAWebGroupType","WAWebMobilePlatforms"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("parent_group_create_enabled_for_smb_on_web"):!0}function b(){return d("WAWebABProps").getABPropConfigValue("parent_group_link_limit")+1}function c(){return d("WAWebABProps").getABPropConfigValue("parent_group_link_limit_community_creation")+1}function e(){return d("WAWebABProps").getABPropConfigValue("community_admin_promotion_one_time_prompt")}function f(){return d("WAWebABProps").getABPropConfigValue("parent_group_create_privacy")}function h(){return d("WAWebABProps").getABPropConfigValue("parent_group_subgroup_filter")}function i(){return d("WAWebABProps").getABPropConfigValue("group_mentions_in_subgroups")}function j(){return d("WAWebABProps").getABPropConfigValue("parent_group_allow_member_added_groups_m1")}function k(){return d("WAWebABProps").getABPropConfigValue("parent_group_allow_member_added_groups_m2")}function l(a){return a==null?!1:(a.groupType===d("WAWebGroupType").GroupType.LINKED_SUBGROUP||a.groupType===d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP)&&a.getParentGroupChat()!=null}function m(){return d("WAWebABProps").getABPropConfigValue("community_general_chat_UI_enabled")}function n(){return d("WAWebABProps").getABPropConfigValue("community_general_chat_create_enabled")}function o(){return d("WAWebABProps").getABPropConfigValue("parent_group_allow_member_suggest_existing_m3_receiver")}function p(){return d("WAWebABProps").getABPropConfigValue("parent_group_allow_member_suggest_existing_m3_sender")}function q(){return d("WAWebABProps").getABPropConfigValue("web_communities_general_chat_v_2")}function r(){return d("WAWebABProps").getABPropConfigValue("enable_community_suspend_and_appeals")}function s(){return d("WAWebABProps").getABPropConfigValue("replies_in_cag_m2_album")}function t(){return d("WAWebABProps").getABPropConfigValue("improve_subgroup_activation_subgroup_poll_interval")}g.communitiesCreationEnabled=a;g.getParentGroupLinkLimit=b;g.getParentGroupLinkLimitCommunityCreation=c;g.communityAdminPromotionOneTimePromptEnabled=e;g.communityCreatePrivacyEnabled=f;g.subgroupFilterEnabled=h;g.groupMentionsInSubgroupsEnabled=i;g.memberAddedGroupsM1Enabled=j;g.memberSuggestedGroupsEnabled=k;g.shouldShowNewSubgroupIdentity=l;g.communityGeneralChatUIEnabled=m;g.communityGeneralChatCreateEnabled=n;g.memberSuggestedGroupsM3ReceiverEnabled=o;g.memberSuggestedGroupsM3SenderEnabled=p;g.communityGeneralChatV2Enabled=q;g.isCommunitySuspendAppealEnabled=r;g.repliesInCAGForAlbumsEnabled=s;g.communityPollIntervalTimeInSeconds=t}),98); __d("WAWebQueryAndUpdateSubgroupSuggestionsJob",["WAWebApiSubgroupSuggestionStore","WAWebBackendApi","WAWebCommunityGatingUtils","WAWebDBCommunity","WAWebMexFetchSubgroupSuggestionsJob","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebMexFetchSubgroupSuggestionsJob").mexFetchSubgroupSuggestions(a,b,"INTERACTIVE"));b=(yield d("WAWebApiSubgroupSuggestionStore").getSubgroupSuggestions(a));b=b.filter(function(a){return!c.some(function(b){return b.id.equals(a.id)&&b.owner.equals(a.owner)})});yield d("WAWebApiSubgroupSuggestionStore").removeSubgroupSuggestions(b.map(function(b){var c=b.id;b=b.owner;return{parentGroupId:a,id:c,owner:b}}));yield d("WAWebApiSubgroupSuggestionStore").addSubgroupSuggestions(a,c);d("WAWebBackendApi").frontendFireAndForget("createOrUpdateSubgroupSuggestions",{parentGroupId:a,subgroupSuggestions:c})});return i.apply(this,arguments)}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.isParentGroup===!0&&a.allowNonAdminSubGroupCreation===!1&&a.participants.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(a.id)&&a.isAdmin})&&d("WAWebCommunityGatingUtils").memberSuggestedGroupsEnabled()){var b=(yield d("WAWebDBCommunity").getJoinedSubgroups(a.id));if(b.length)return h(a.id,b[0])}});return j.apply(this,arguments)}g.queryAndUpdateSubgroupSuggestions=h;g.maybeQueryAndUpdateSubgroupSuggestions=a}),98); __d("WASmaxInInAppCommsIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInInAppCommsIQErrorRequestTimeoutMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","request-timeout");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",408);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRequestTimeoutMixin=a}),98); __d("WASmaxInInAppCommsIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInInAppCommsEventErrorTypes",["WAResultOrError","WASmaxInInAppCommsIQErrorInternalServerErrorMixin","WASmaxInInAppCommsIQErrorRequestTimeoutMixin","WASmaxInInAppCommsIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInInAppCommsIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInInAppCommsIQErrorRequestTimeoutMixin").parseIQErrorRequestTimeoutMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorRequestTimeout",value:c.value});var e=d("WASmaxInInAppCommsIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);return e.success?d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorRequestTimeout","IQErrorServiceUnavailable"],[b,c,e])}g.parseEventErrorTypes=a}),98); __d("WASmaxInInAppCommsIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInInAppCommsEventResponseError",["WAResultOrError","WASmaxInInAppCommsEventErrorTypes","WASmaxInInAppCommsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInInAppCommsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInInAppCommsEventErrorTypes").parseEventErrorTypes(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorEventErrorTypes:b.value}))}g.parseEventResponseError=a}),98); __d("WASmaxInInAppCommsIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInInAppCommsEventResponseSuccess",["WASmaxInInAppCommsIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInInAppCommsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseEventResponseSuccess=a}),98); __d("WASmaxOutInAppCommsBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutInAppCommsEventRequest",["WASmaxJsx","WASmaxOutInAppCommsBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b,c=a.eventPromotionId,e=a.eventType,f=a.eventTimestampSec;a=a.eventLogdata;c=d("WASmaxOutInAppCommsBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"w:comms",to:(b=d("WAWap")).S_WHATSAPP_NET},d("WASmaxJsx").smax("event",{promotion_id:b.CUSTOM_STRING(c),type:b.CUSTOM_STRING(e),timestamp_sec:b.INT(f),logdata:b.CUSTOM_STRING(a)})));return c}g.makeEventRequest=a}),98); __d("WASmaxParsingFailure",[],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this,"SmaxParsingFailure: "+b)||this;c.name="SmaxParsingFailure";c.reason=b;return c}var c=b.prototype;c.toString=function(){return"SmaxParsingFailure: "+this.reason};return b}(babelHelpers.wrapNativeSuper(Error));f.SmaxParsingFailure=a}),66); __d("WASmaxRpcUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=Object.keys(b).map(function(a){var c=a==="Request"?"<request>":'<response name="'+a+'">';return"Tried "+c+", but failed with "+b[a].error+"."}).join(" ");return'Failed to parse incoming stanza of <rpc name="'+a+'">. '+c}f.errorMessageRpcParsing=a}),66); __d("WASmaxInAppCommsEventRPC",["WAComms","WASmaxInInAppCommsEventResponseError","WASmaxInInAppCommsEventResponseSuccess","WASmaxOutInAppCommsEventRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutInAppCommsEventRequest").makeEventRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInInAppCommsEventResponseSuccess").parseEventResponseSuccess(b,a);if(c.success)return{name:"EventResponseSuccess",value:c.value};b=d("WASmaxInInAppCommsEventResponseError").parseEventResponseError(b,a);if(b.success)return{name:"EventResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("Event",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendEventRPC=a}),98); __d("WAWebJobUserExposureToQuickPromotion",["WALogger","WASmaxInAppCommsEventRPC","WAWebDefinePersistedJob","WAWebModelStorageUtils","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["userExposureToQuickPromotion: unable to log"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["userExposureToQuickPromotion: skipping comms step: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["userExposureToQuickPromotion: missing experiment key"]);j=function(){return a};return a}function a(a){var c=a.id,e=a.experimentKey,f=a.exposureHoldout;if(e.length===0){d("WALogger").ERROR(j()).sendLogs("user-exposure-quick-promotion-missing-exp-key");return"missing-key"}return d("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(c));if(b==null)return"not-found";if(f==null)return"old-job";b=b.tracking;var d=b.lastLoggedExposure;if(d!=null&&(d.experimentKey===e&&d.exposureHoldout===f))return"deduped";d=babelHelpers["extends"]({},b,{lastLoggedExposure:{experimentKey:e,exposureHoldout:f}});yield a.merge(c,{tracking:d});return"updated"});return function(b){return a.apply(this,arguments)}}()).then(function(a){return a==="updated"?d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("loadQuickPromotions",{trigger:"user-action"}).then(function(){return a}):a})}function c(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.id,e=b.ts;b=b.experimentKey;if(a!=="updated"&&a!=="old-job"){d("WALogger").WARN(i(),a);return}a=(yield d("WASmaxInAppCommsEventRPC").sendEventRPC({eventType:"exposure",eventPromotionId:c,eventTimestampSec:e,eventLogdata:b}));a.name!=="EventResponseSuccess"&&(a.name,d("WALogger").ERROR(h()).devConsole(a.value))});return k.apply(this,arguments)}e=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("saveToDb",a).finalStep("reportToComms",c).end();g.userExposureToQuickPromotion=e}),98); __d("WAWebQueryGetSignedUserInfoJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommsWapMd","WAWebDefinePersistedJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){return a==null?void 0:(a=a.maybeChild(b))==null?void 0:a.contentString()}var i=new(c("WADeprecatedWapParser"))("getSignedUserInfoResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.maybeChild("signed_user_info");return{phoneNumber:h(a,"phone_number"),phoneNumberSignatureExpiration:h(a,"ttl_timestamp"),phoneNumberSignature:h(a,"phone_number_signature"),businessDomain:h(a,"business_domain")}});a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendStanza",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.businessJid;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:b.generateId()},b.wap("signed_user_info",{biz_jid:d("WAWebCommsWapMd").USER_JID(d("WAWebWidFactory").createWid(a))}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,i));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);return a.result});return function(b){return a.apply(this,arguments)}}()).end();g.QueryGetSignedUserInfo=a}),98); __d("WAWebResendGroupMsgJob",["WALogger","WAWebDefinePersistedJob","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsgJob: failed to resend message: ",""]);h=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("resendUserGroupMsg",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgId,c=a.msgType,e=a.msgRecordType,f=a.groupId,g=a.isDirect,i=a.oldList,j=a.phash,k=a.ackTime;a=a.serverAddressingMode;try{b=(yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("resendGroupMsg",{msgId:b,msgType:c,msgRecordType:e,groupId:f,isDirect:g,oldList:i,phash:j,ackTime:k,serverAddressingMode:a}));return b}catch(a){d("WALogger").ERROR(h(),a).tags("messaging").sendLogs("persisted-group-message-resend-failed")}});return function(b){return a.apply(this,arguments)}}()).end();g.resendGroupMsgJob=a}),98); __d("WAWebResendUserMsgJob",["WALogger","WAWebDefinePersistedJob","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsgJob: failed to resend message: ",""]);h=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("resendUserMsg",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgId,c=a.msgType,e=a.msgRecordType,f=a.excludeList;a=a.ackTime;try{b=(yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("resendUserMsg",{msgId:b,msgType:c,msgRecordType:e,excludeList:f,ackTime:a}));return b}catch(a){d("WALogger").ERROR(h(),a).tags("messaging").sendLogs("persisted-message-resend-failed")}});return function(b){return a.apply(this,arguments)}}()).end();g.resendUserMsgJob=a}),98); __d("WAWebSendRequestedKeyShareJob",["WALogger","WAWebDefinePersistedJob","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end sendRequestedKeyShare job"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: starting sendRequestedKeyShare job"]);i=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendRequestedKeyShare",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.keys,c=a.orphanKeys;a=a.peerDeviceId;d("WALogger").DEV(i());b={type:"missing_key",keys:b,orphanKeys:c,peerDeviceId:d("WAWebWidFactory").createWid(a)};yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("sendAppStateSyncKeyShare",{keyShare:b});d("WALogger").DEV(h())});return function(b){return a.apply(this,arguments)}}()).end();g.sendRequestedKeyShare=a}),98); __d("WAWebSetAboutJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebDefinePersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("aboutResponse",function(a){a.assertAttr("type","result");return{id:a.attrInt("id")}});a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendStanza",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.content;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"set",xmlns:"status",id:b.generateId()},b.wap("status",null,a));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));return!a.success?{status:a.errorCode}:{status:200}});return function(b){return a.apply(this,arguments)}}()).end();g.setAbout=a}),98); __d("WAWebPersistedJob",["Promise","WAWebDeleteAddonsJob","WAWebDeleteReactionsJob","WAWebJobDismissQuickPromotion","WAWebJobImpressionOnQuickPromotion","WAWebJobPrimaryActionClickInQuickPromotion","WAWebJobUserExposureToQuickPromotion","WAWebQueryAndUpdateGroupsMetadataByJidsJob","WAWebQueryGetPublicKeyJob","WAWebQueryGetSignedUserInfoJob","WAWebQueryProductListCatalogJob","WAWebResendGroupMsgJob","WAWebResendUserMsgJob","WAWebRotateKeyJob","WAWebSendRequestedKeyShareJob","WAWebSetAboutJob","WAWebSetTextStatusJob","WAWebVerifyPostcodeJob"],(function(a,b,c,d,e,f,g){var h;function a(a){i(a,{rotateKey:function(){return(h||(h=b("Promise"))).resolve(d("WAWebRotateKeyJob").rotateKey)},setAbout:function(){return(h||(h=b("Promise"))).resolve(d("WAWebSetAboutJob").setAbout)},setTextStatus:function(){return(h||(h=b("Promise"))).resolve(d("WAWebSetTextStatusJob").setTextStatus)},queryProductList:function(){return(h||(h=b("Promise"))).resolve(d("WAWebQueryProductListCatalogJob").QueryProductListCatalog)},getPublicKey:function(){return(h||(h=b("Promise"))).resolve(d("WAWebQueryGetPublicKeyJob").QueryGetPublicKey)},getSignedUserInfo:function(){return(h||(h=b("Promise"))).resolve(d("WAWebQueryGetSignedUserInfoJob").QueryGetSignedUserInfo)},verifyPostcode:function(){return(h||(h=b("Promise"))).resolve(d("WAWebVerifyPostcodeJob").VerifyPostcode)},deleteReactions:function(){return(h||(h=b("Promise"))).resolve(d("WAWebDeleteReactionsJob").deleteReactions)},deleteReactionsV2:function(){return(h||(h=b("Promise"))).resolve(d("WAWebDeleteAddonsJob").deleteReactionsV2)},deleteAddOns:function(){return(h||(h=b("Promise"))).resolve(d("WAWebDeleteAddonsJob").deleteAddOns)},sendRequestedKeyShare:function(){return(h||(h=b("Promise"))).resolve(d("WAWebSendRequestedKeyShareJob").sendRequestedKeyShare)},dismissQuickPromotion:function(){return(h||(h=b("Promise"))).resolve(d("WAWebJobDismissQuickPromotion").dismissQuickPromotion)},primaryActionClickInQuickPromotion:function(){return(h||(h=b("Promise"))).resolve(d("WAWebJobPrimaryActionClickInQuickPromotion").primaryActionClickInQuickPromotion)},impressionOnQuickPromotion:function(){return(h||(h=b("Promise"))).resolve(d("WAWebJobImpressionOnQuickPromotion").impressionOnQuickPromotion)},userExposureToQuickPromotion:function(){return(h||(h=b("Promise"))).resolve(d("WAWebJobUserExposureToQuickPromotion").userExposureToQuickPromotion)},queryAndUpdateGroupsMetadataByJids:function(){return(h||(h=b("Promise"))).resolve(d("WAWebQueryAndUpdateGroupsMetadataByJidsJob").queryAndUpdateGroupsMetadataByJidsJob)},resendUserMsg:function(){return(h||(h=b("Promise"))).resolve(d("WAWebResendUserMsgJob").resendUserMsgJob)},resendGroupMsg:function(){return(h||(h=b("Promise"))).resolve(d("WAWebResendGroupMsgJob").resendGroupMsgJob)}})}function i(a,b){Object.keys(b).forEach(function(c){Object.prototype.hasOwnProperty.call(b,c)&&a.addPersistedJobImplementation(c,b[c])})}g["default"]=a}),98); __d("WAWebJobsStorageUtils",["invariant","Promise","WAWebIdb","WAWebStorage","err"],(function(a,b,c,d,e,f,g,h){var i,j="jobs-storage",k=null;function a(){var a=new(c("WAWebIdb"))(j);k=new(d("WAWebStorage").Storage)(a)}function e(){k!=null||h(0,56369);return k}function f(){return k==null?(i||(i=b("Promise"))).reject(c("err")("[jobs-storage] Storage should be created first before being destroyed")):k.purge().then(function(){k=null})["catch"](function(a){k=null;throw a})}g.DATABASE_NAME=j;g.createStorage=a;g.getStorage=e;g.destroyStorage=f}),98); __d("WAWebJobsStorageVersions",["WAWebJobsStorageUtils"],(function(a,b,c,d,e,f,g){c=1;function a(){return d("WAWebJobsStorageUtils").getStorage().versions.version(0)}function b(){return d("WAWebJobsStorageUtils").getStorage().versions.version(1)}g.versionToRollout=c;g.jobsCreateV1Table=a;g.jobsCreateV2Table=b}),98); __d("WAWebSchemaJobs",["WAWebJobsStorageUtils","WAWebJobsStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey,j=c.addIndex,k=c.removeColumn;function a(){d("WAWebJobsStorageUtils").getStorage().add("jobs-store").version(d("WAWebJobsStorageVersions").jobsCreateV1Table(),[i("jobId"),h("type"),h("uniqKey"),j("uniqKey"),h("original"),h("current"),h("step"),h("startTime"),h("endTime"),h("stepHardStartCountAfterTimeout"),h("stepFirstStartTime"),h("waitUntil"),h("backedOffCount"),h("version")]).version(d("WAWebJobsStorageVersions").jobsCreateV2Table(),[h("stepUnexpectedErrorCount"),k("endTime")]).view(function(a){return{jobId:a.jobId,type:a.type,uniqKey:a.uniqKey,original:a.original,current:a.current,step:a.step,startTime:a.startTime,stepHardStartCountAfterTimeout:a.stepHardStartCountAfterTimeout,stepFirstStartTime:a.stepFirstStartTime,waitUntil:a.waitUntil,backedOffCount:a.backedOffCount,version:a.version,stepUnexpectedErrorCount:a.stepUnexpectedErrorCount}})}function b(){return d("WAWebJobsStorageUtils").getStorage().table("jobs-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebJobsStorage",["WALogger","WAWeb-dexie","WAWebDbRolloutUtil","WAWebDexieCastTypes","WAWebJobsStorageUtils","WAWebSchemaJobs","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);h=function(){return a};return a}var i;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){i==null&&(yield d("WAWebDbRolloutUtil").loadSchemaVersions(),d("WAWebJobsStorageUtils").createStorage(),d("WAWebSchemaJobs").addTable(),i=d("WAWebJobsStorageUtils").getStorage().initialize()["catch"](function(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("Failed to initialize jobs storage",{sendLogsType:d("WALogger").SendLogsType.CRASH_OR_UNRECOVERABLE_ERROR_SAD});throw a}));return i});return j.apply(this,arguments)}function e(){return d("WAWebJobsStorageUtils").destroyStorage()["catch"](function(){return d("WAWebDexieCastTypes").dexieCastToPromise(new(c("WAWeb-dexie"))(d("WAWebJobsStorageUtils").DATABASE_NAME)["delete"]())})["finally"](function(){i=null})}g.initialize=a;g.destroy=e}),98); __d("WAWebPersistedJobManager",["Promise","WAPersistedJobManager","WARandomHex","WATimeUtils","WAWebJobsStorage","WAWebNoop","WAWebPersistedJob","WAWebSchemaJobs","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h,i=null;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebJobsStorage").initialize();var a=d("WAWebSchemaJobs").getTable();i=new(d("WAPersistedJobManager").PersistedJobManager)({accessors:k(),unfinishedJobEntries:a.all(),isRestartAfterCrash:!1,listeners:{onJobStarted:c("WAWebNoop"),onJobFinished:function(){return null}},deprecatedJobs:{}});c("WAWebPersistedJob")(i)});return j.apply(this,arguments)}function k(){return{deletePersistedJob:function(a){var b=d("WAWebSchemaJobs").getTable();return b.remove(a)},updatePersistedJob:function(a){var b=d("WAWebSchemaJobs").getTable();return b.createOrReplace(a)},readPersistedJob:function(a){var b=d("WAWebSchemaJobs").getTable();return b.get(a)},loadAllJobs:function(){var a=d("WAWebSchemaJobs").getTable();return a.all()},maybeCreateJob:l}}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c,e=d("WAWebSchemaJobs").getTable();c=JSON.stringify([a.type,(c=a.uniqKey)!=null?c:d("WARandomHex").randomHex(32)]);c={type:a.type,uniqKey:c,startTime:d("WATimeUtils").unixTime(),version:(c=a.version)!=null?c:1,original:a.args,current:a.args,step:d("WAPersistedJobManager").UNSTARTED_JOB,waitUntil:null,stepFirstStartTime:null,stepHardStartCountAfterTimeout:0,stepUnexpectedErrorCount:0,backedOffCount:0};if(a.uniqKey==null)return e.createOrReplace(c).then(function(a){return{id:a,newlyCreated:!0}});a=(yield e.equals(["uniqKey"],[a.uniqKey]));if(a.length===0)return e.createOrReplace(c).then(function(a){return{id:a,newlyCreated:!0}});var f=[],g=null;for(a of a)a.step!==d("WAPersistedJobManager").FINISHED_JOB?g=a:f.push(e.remove(a.jobId));yield (h||(h=b("Promise"))).all(f);return g!=null?{id:g.jobId,newlyCreated:!1}:e.createOrReplace(c).then(function(a){return{id:a,newlyCreated:!0}})});return m.apply(this,arguments)}function e(){if(i==null)throw c("err")("jobs manager has not been initialized");return i}g.startWebPersistedJobManager=a;g.maybeCreateJob=l;g.getJobManager=e}),98); __d("WAWebDBDeleteReactions",["WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var c=[];return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var d=(yield b.equals(["parentMsgKey"],a));d.forEach(function(a){return c.push([a.parentMsgKey,a.senderUserJid])});return b.bulkRemove(c)});return function(a){return d.apply(this,arguments)}}())}function c(a){var c=[];return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var d=(yield b.anyOf(["parentMsgKey"],a));d.forEach(function(a){return c.push([a.parentMsgKey,a.senderUserJid])});yield b.bulkRemove(c);return d.map(function(a){return a.msgKey})});return function(a){return d.apply(this,arguments)}}())}function e(a){return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];yield b.bulkRemove(a)});return function(a){return c.apply(this,arguments)}}())}g.deleteReactionsByParentMessageKey=a;g.deleteReactionsByParentMessageKeys=c;g.deleteReactionsByRecords=e}),98); __d("WAWebDeleteAddonsJob",["Promise","WALogger","WAWebAddonDeleteMsgs","WAWebAddonGatingUtils","WAWebDBDeleteReactions","WAWebDBGetReactions","WAWebDBMessageDelete","WAWebDBPollsDeleteVotes","WAWebDefinePersistedJob","WAWebDeleteLastAddOnsPreview","WAWebMsgKey","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deletePollVotes job finished for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deletePollVotes job started for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deleteReactionsV2 finished"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Reactions table"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Msg table"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deleteReactionsV2 finished, no reactionsMsgKeys"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deleteReactionsV2 persisted job started for ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteAddons job finished for ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteAddons job started for ",""]);q=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("deleteAddOns",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.chatId;a=a.parentMsgKeys;d("WALogger").LOG(q(),c);var e=[d("WAWebAddonDeleteMsgs").deleteAddonMsgsByParentKeys({parentMsgKeys:a})];d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(d("WAWebMsgType").MSG_TYPE.REACTION)||e.push(r({chatId:c,parentMsgKeys:a}));d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(d("WAWebMsgType").MSG_TYPE.POLL_UPDATE)||e.push(t({chatId:c,parentMsgKeys:a}));a=(yield (h||(h=b("Promise"))).allSettled(e));d("WALogger").LOG(p(),c);for(e of a)if(e.status==="rejected")throw e.reason});return function(b){return a.apply(this,arguments)}}()).end();e=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("deleteReactionsV2",function(a){var b=a.chatId;a=a.parentMsgKeys;return r({chatId:b,parentMsgKeys:a})}).end();function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId;a=a.parentMsgKeys;d("WALogger").LOG(o(),b);b=(yield d("WAWebDBGetReactions").getAllReactionsFromParentMsgs(a));var e=b.map(function(a){return a.msgKey});if(e.length===0){d("WALogger").LOG(n());return}var f=[];e.forEach(function(a){c("WAWebMsgKey").fromString(a).fromMe&&f.push(a)});f.length>0&&(d("WALogger").DEV(m()),yield d("WAWebDBMessageDelete").removeMessagesFromHistory(f,{deleteAssociatedMsgs:!1}));e=b.map(function(a){return[a.parentMsgKey,a.senderUserJid]});d("WALogger").DEV(l());yield d("WAWebDBDeleteReactions").deleteReactionsByRecords(e);yield d("WAWebDeleteLastAddOnsPreview").deleteLastAddOnsPreview(a);d("WALogger").LOG(k())});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId;a=a.parentMsgKeys;d("WALogger").LOG(j(),b);yield d("WAWebDBPollsDeleteVotes").deleteVotesByParentMsgKeys(a);d("WALogger").LOG(i(),b)});return u.apply(this,arguments)}g.deleteAddOns=a;g.deleteReactionsV2=e}),98); __d("WAWebMarkAddOnsAsReadJob",["Promise","WAJobOrchestratorTypes","WAWebAddOnsMarkAddOnsAsReadDb","WAWebAddonMarkAsReadUtils","WAWebBackendApi","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("markAddOnsAsRead",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebAddOnsMarkAddOnsAsReadDb").markAddOnsAsReadDb(a.updates),d("WAWebBackendApi").frontendFireAndForget("markAddOnsAsReadUi",{updatedMsgKeys:a.updates})});return function(b){return a.apply(this,arguments)}}(),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted({updates:a})});return i.apply(this,arguments)}function c(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("markAddOnsAsReadUsingAddonInfra",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebAddonMarkAsReadUtils").processMarkAsRead(a.addons)});return function(b){return a.apply(this,arguments)}}(),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted({addons:a})});return j.apply(this,arguments)}function e(a){return a.length===0?(h||(h=b("Promise"))).resolve({updatedAddOns:new Map(),updatedOrphans:[]}):d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("markUnclassifiedAddOnsAsRead",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebAddOnsMarkAddOnsAsReadDb").markUnclassifiedAddOnsAsReadDb(a.msgKeys));d("WAWebBackendApi").frontendFireAndForget("markAddOnsAsReadUi",{updatedMsgKeys:a.updatedAddOns});return a});return function(b){return a.apply(this,arguments)}}(),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({msgKeys:a})}g.markAddOnsAsReadJob=a;g.markAddOnsAsReadUsingAddonInfraJob=c;g.markUnclassifiedAddOnsAsReadJob=e}),98); __d("WAWebGroupParticipantsJob",["WAJobOrchestratorTypes","WAWebGroupsParticipantsApi","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateParticipants",function(a){return d("WAWebGroupsParticipantsApi").updateParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function b(a,b,c,e){a={group:a,participants:b,isOffline:c,reason:e};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("addParticipants",function(a){return d("WAWebGroupsParticipantsApi").addParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function c(a,b,c,e,f,g,h){a={group:a,participants:b,timestamp:c,author:e,reason:f,groupMetadata:g,isOffline:h};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("removeParticipants",function(a){return d("WAWebGroupsParticipantsApi").removeParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function e(a,b,c,e){a={group:a,participants:b,groupMetadata:c,isOffline:e};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("demoteParticipants",function(a){return d("WAWebGroupsParticipantsApi").demoteParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function f(a,b,c,e){a={group:a,participants:b,groupMetadata:c,isOffline:e};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("promoteParticipants",function(a){return d("WAWebGroupsParticipantsApi").promoteParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function h(a,b){a={group:a,newSuperAdmin:b};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("setGroupSuperAdmin",function(a){return d("WAWebGroupsParticipantsApi").setGroupSuperAdmin(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function i(a,b,c){a={group:a,participants:b,isOffline:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("promoteCommunityParticipants",function(a){return d("WAWebGroupsParticipantsApi").promoteCommmunityParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function j(a,b,c){a={group:a,participants:b,isOffline:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("demoteCommunityParticipants",function(a){return d("WAWebGroupsParticipantsApi").demoteCommmunityParticipants(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}g.updateParticipantsJob=a;g.addParticipantsJob=b;g.removeParticipantsJob=c;g.demoteParticipantsJob=e;g.promoteParticipantsJob=f;g.setGroupSuperAdminJob=h;g.promoteCommunityParticipantsJob=i;g.demoteCommunityParticipantsJob=j}),98); __d("WAWebGroupQueryGroupJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebApiChat","WAWebApiParticipantStore","WAWebCreateOrReplaceDisplayNamesAndLidPnMappingsJob","WAWebDBGroupsGroupMetadata","WAWebEnvironment","WAWebGroupsParticipantsApi","WAWebLimitSharingModelUtils","WAWebMexFetchGroupInfoJob","WAWebOrchestratorNonPersistedJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["groupQueryJob: group "," does not exist"]);i=function(){return a};return a}function a(a,e,f){f={groupWid:a,request:e,phash:f};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("queryGroup",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var c=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(c!=null&&c.terminated){d("WALogger").DEV(i(),a);return}c=(yield d("WAWebMexFetchGroupInfoJob").mexGetGroupInfo(a.toString(),e));var f=c==null?void 0:c.groupInfo;c=c==null?void 0:c.participantPhashMatch;if(f==null?void 0:f.id){var g=f.participants.map(function(a){return{id:d("WAWebWidFactory").toUserWid(a.id),lid:a.lid?d("WAWebWidFactory").toUserWid(a.lid):null,displayName:a.displayName,phoneNumber:a.phoneNumber?d("WAWebWidFactory").toUserWid(a.phoneNumber):null}}),j=f.owner,k=f.creatorPn,l=f.subjectOwner,m=f.subjectOwnerPn;j&&k&&g.push({id:d("WAWebWidFactory").toUserWid(j),lid:d("WAWebWidFactory").toUserWid(j),phoneNumber:d("WAWebWidFactory").toUserWid(k)});l&&m&&g.push({id:d("WAWebWidFactory").toUserWid(l),lid:d("WAWebWidFactory").toUserWid(l),phoneNumber:d("WAWebWidFactory").toUserWid(m)});j=(yield d("WAWebApiChat").injectAdditionalEphemeralInfoFromDB([f]));k=j[0];yield (h||(h=b("Promise"))).all([d("WAWebDBGroupsGroupMetadata").updateGroupMetadataTable({groupInfos:[k]}),c!==!0&&d("WAWebGroupsParticipantsApi").updateParticipants({group:f.id,participants:f.participants,groupInfo:f}),d("WAWebCreateOrReplaceDisplayNamesAndLidPnMappingsJob").createOrReplaceDisplayNamesAndLidPnMappings(g,!0)]);d("WAWebApiParticipantStore").clearAdminshipCache(f.id.toString());void d("WAWebLimitSharingModelUtils").genLimitSharingSystemMessageOnPersistedChat({chatWID:a,sharingLimited:k.limitSharingEnabled})}return f}),c("WAWebEnvironment").isWindows?{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH}:null).waitUntilCompleted(f)}g.queryGroupJob=a}),98); __d("WASmaxInGroupsIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInGroupsIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInGroupsBatchGetGroupInfoClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);return c.success?d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorRateOverlimit"],[b,c])}g.parseBatchGetGroupInfoClientErrors=a}),98); __d("WASmaxInGroupsIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInGroupsBatchGetGroupInfoResponseClientError",["WAResultOrError","WASmaxInGroupsBatchGetGroupInfoClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsBatchGetGroupInfoClientErrors").parseBatchGetGroupInfoClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorBatchGetGroupInfoClientErrors:b.value}))}g.parseBatchGetGroupInfoResponseClientError=a}),98); __d("WASmaxInGroupsIQErrorFallbackServerMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"text");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"code",500,599);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFallbackServerMixin=a}),98); __d("WASmaxInGroupsIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInGroupsIQErrorPartialServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","partial-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",530);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorPartialServerErrorMixin=a}),98); __d("WASmaxInGroupsIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInGroupsServerErrors",["WAResultOrError","WASmaxInGroupsIQErrorFallbackServerMixin","WASmaxInGroupsIQErrorInternalServerErrorMixin","WASmaxInGroupsIQErrorPartialServerErrorMixin","WASmaxInGroupsIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInGroupsIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:c.value});var e=d("WASmaxInGroupsIQErrorPartialServerErrorMixin").parseIQErrorPartialServerErrorMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorPartialServerError",value:e.value});var f=d("WASmaxInGroupsIQErrorFallbackServerMixin").parseIQErrorFallbackServerMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackServer",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorServiceUnavailable","IQErrorPartialServerError","IQErrorFallbackServer"],[b,c,e,f])}g.parseServerErrors=a}),98); __d("WASmaxInGroupsBaseServerErrorMixin",["WAResultOrError","WASmaxInGroupsIQErrorResponseMixin","WASmaxInGroupsServerErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsServerErrors").parseServerErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorServerErrors:b.value}))}g.parseBaseServerErrorMixin=a}),98); __d("WASmaxInGroupsBatchGetGroupInfoResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseBatchGetGroupInfoResponseServerError=a}),98); __d("WASmaxInGroupsEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={304:"304",419:"419"};b={403:"403",404:"404",406:"406",419:"419"};c={404:"404",406:"406"};e={404:"404",419:"419"};f={406:"406",500:"500"};var h={accept:"accept",auto_add:"auto_add",default_sub_group_admin_add:"default_sub_group_admin_add",general_chat_auto_add:"general_chat_auto_add",invite:"invite",invite_auto_add:"invite_auto_add",linked_group_join:"linked_group_join",sub_group_suggestion_approved:"sub_group_suggestion_approved"},i={accept:"accept",default_sub_group_promote:"default_sub_group_promote",invite:"invite",invite_auto_add:"invite_auto_add",linked_group_join:"linked_group_join"},j={admin:"admin",creator:"creator"},k={admin:"admin",superadmin:"superadmin"},l={approved:"approved",cancelled:"cancelled",rejected:"rejected"},m={deactivate_general_chat:"deactivate_general_chat",delete_capi:"delete_capi",delete_parent:"delete_parent",integrity_delete_parent:"integrity_delete_parent"},n={deactivate_group:"deactivate_group",delete_parent:"delete_parent",integrity_delete_parent:"integrity_delete_parent",unlink_group:"unlink_group"},o={e2ee_migration:"e2ee_migration",regular:"regular",rtc:"rtc"},p={"false":"false","true":"true"},q={group:"group",user:"user"},r={image:"image",preview:"preview"},s={invite_link:"invite_link",linked_group_join:"linked_group_join",non_admin_add:"non_admin_add"},t={lid:"lid",pn:"pn"},u={parent_group:"parent_group",sibling_group:"sibling_group",sub_group:"sub_group"};d={validators:[d("WAJids").validateDomainJid,d("WAJids").validateGroupJid],typeName:"DomainJid|GroupJid"};g.ENUM_304_419=a;g.ENUM_403_404_406_419=b;g.ENUM_404_406=c;g.ENUM_404_419=e;g.ENUM_406_500=f;g.ENUM_ACCEPT_AUTOADD_DEFAULTSUBGROUPADMINADD_GENERALCHATAUTOADD_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN_SUBGROUPSUGGESTIONAPPROVED=h;g.ENUM_ACCEPT_DEFAULTSUBGROUPPROMOTE_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN=i;g.ENUM_ADMIN_CREATOR=j;g.ENUM_ADMIN_SUPERADMIN=k;g.ENUM_APPROVED_CANCELLED_REJECTED=l;g.ENUM_DEACTIVATEGENERALCHAT_DELETECAPI_DELETEPARENT_INTEGRITYDELETEPARENT=m;g.ENUM_DEACTIVATEGROUP_DELETEPARENT_INTEGRITYDELETEPARENT_UNLINKGROUP=n;g.ENUM_E2EEMIGRATION_REGULAR_RTC=o;g.ENUM_FALSE_TRUE=p;g.ENUM_GROUP_USER=q;g.ENUM_IMAGE_PREVIEW=r;g.ENUM_INVITELINK_LINKEDGROUPJOIN_NONADMINADD=s;g.ENUM_LID_PN=t;g.ENUM_PARENTGROUP_SIBLINGGROUP_SUBGROUP=u;g.DOMAINJID_GROUPJID=d}),98); __d("WASmaxInGroupsDedupAttrsMixin",["WAResultOrError","WASmaxInGroupsEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").attrString(a,"key");if(!b.success)return b;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,a,"create_ctx",d("WASmaxInGroupsEnums").ENUM_E2EEMIGRATION_REGULAR_RTC);return!a.success?a:d("WAResultOrError").makeResult({key:b.value,createCtx:a.value})}g.parseDedupAttrsMixin=a}),98); __d("WASmaxInGroupsGroupForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"error","403");return!a.success?a:d("WAResultOrError").makeResult({id:b.value,error:a.value})}g.parseGroupForbiddenMixin=a}),98); __d("WASmaxInGroupsGroupAddressingModeMixin",["WAResultOrError","WASmaxInGroupsEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrStringEnum(a,"addressing_mode",d("WASmaxInGroupsEnums").ENUM_LID_PN);return!a.success?a:d("WAResultOrError").makeResult({addressingMode:a.value})}g.parseGroupAddressingModeMixin=a}),98); __d("WASmaxInGroupsGroupCreatorPhoneNumberMixin",["WAResultOrError","WASmaxParseJid"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseJid").attrUserJid(a,"creator_pn");return!a.success?a:d("WAResultOrError").makeResult({creatorPn:a.value})}g.parseGroupCreatorPhoneNumberMixin=a}),98); __d("WASmaxInGroupsNamedSubjectMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrString(a,"subject");return!a.success?a:d("WAResultOrError").makeResult({subject:a.value})}g.parseNamedSubjectMixin=a}),98); __d("WASmaxInGroupsUnnamedSubjectFallbackMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"subject");return!a.success?a:d("WAResultOrError").makeResult({subject:a.value})}g.parseUnnamedSubjectFallbackMixin=a}),98); __d("WASmaxInGroupsNamedSubjectOrUnnamedSubjectFallbackMixinGroup",["WAResultOrError","WASmaxInGroupsNamedSubjectMixin","WASmaxInGroupsUnnamedSubjectFallbackMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsNamedSubjectMixin").parseNamedSubjectMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"NamedSubject",value:b.value});var c=d("WASmaxInGroupsUnnamedSubjectFallbackMixin").parseUnnamedSubjectFallbackMixin(a);return c.success?d("WAResultOrError").makeResult({name:"UnnamedSubjectFallback",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["NamedSubject","UnnamedSubjectFallback"],[b,c])}g.parseNamedSubjectOrUnnamedSubjectFallbackMixinGroup=a}),98); __d("WASmaxInGroupsSubjectOwnerPhoneNumberMixin",["WAResultOrError","WASmaxParseJid"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseJid").attrUserJid(a,"s_o_pn");return!a.success?a:d("WAResultOrError").makeResult({sOPn:a.value})}g.parseSubjectOwnerPhoneNumberMixin=a}),98); __d("WASmaxInGroupsGroupInfoAttributesMixin",["WAResultOrError","WASmaxInGroupsGroupAddressingModeMixin","WASmaxInGroupsGroupCreatorPhoneNumberMixin","WASmaxInGroupsNamedSubjectOrUnnamedSubjectFallbackMixinGroup","WASmaxInGroupsSubjectOwnerPhoneNumberMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"creator");if(!c.success)return c;var e=d("WASmaxParseUtils").attrIntRange(a,"creation",0,void 0);if(!e.success)return e;var f=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"p_v_id");if(!f.success)return f;var g=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"a_v_id");if(!g.success)return g;var h=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"s_t",0,void 0);if(!h.success)return h;var i=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"s_o");if(!i.success)return i;var j=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"open_thread_id");if(!j.success)return j;var k=d("WASmaxInGroupsGroupAddressingModeMixin").parseGroupAddressingModeMixin(a),l=d("WASmaxInGroupsSubjectOwnerPhoneNumberMixin").parseSubjectOwnerPhoneNumberMixin(a),m=d("WASmaxInGroupsGroupCreatorPhoneNumberMixin").parseGroupCreatorPhoneNumberMixin(a);a=d("WASmaxInGroupsNamedSubjectOrUnnamedSubjectFallbackMixinGroup").parseNamedSubjectOrUnnamedSubjectFallbackMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult({id:b.value,creator:c.value,creation:e.value,pVId:f.value,aVId:g.value,sT:h.value,sO:i.value,openThreadId:j.value,groupAddressingModeMixin:k.success?k.value:null,subjectOwnerPhoneNumberMixin:l.success?l.value:null,groupCreatorPhoneNumberMixin:m.success?m.value:null,namedSubjectOrUnnamedSubjectFallbackMixinGroup:a.value})}g.parseGroupInfoAttributesMixin=a}),98); __d("WASmaxInGroupsGroupInfoDescriptionMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"description");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"body");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"id");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"participant");if(!e.success)return e;var f=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"participant_pn");if(!f.success)return f;a=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!a.success)return a;b=d("WASmaxParseUtils").contentString(b.value);return!b.success?b:d("WAResultOrError").makeResult({id:c.value,participant:e.value,participantPn:f.value,t:a.value,bodyElementValue:b.value})}g.parseGroupInfoDescriptionMixin=a}),98); __d("WASmaxInGroupsParticipantWithJidMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");return!b.success?b:d("WAResultOrError").makeResult({jid:b.value})}g.parseParticipantWithJidMixin=a}),98); __d("WASmaxInGroupsParticipantWithLidMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"lid");return!b.success?b:d("WAResultOrError").makeResult({lid:b.value})}g.parseParticipantWithLidMixin=a}),98); __d("WASmaxInGroupsParticipantWithJidAndLidMixin",["WAResultOrError","WASmaxInGroupsParticipantWithJidMixin","WASmaxInGroupsParticipantWithLidMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsParticipantWithJidMixin").parseParticipantWithJidMixin(a);if(!b.success)return b;a=d("WASmaxInGroupsParticipantWithLidMixin").parseParticipantWithLidMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,a.value))}g.parseParticipantWithJidAndLidMixin=a}),98); __d("WASmaxInGroupsPhoneNumberMixin",["WAResultOrError","WASmaxParseJid"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseJid").attrUserJid(a,"phone_number");return!a.success?a:d("WAResultOrError").makeResult({phoneNumber:a.value})}g.parsePhoneNumberMixin=a}),98); __d("WASmaxInGroupsParticipantWithJidAndPnMixin",["WAResultOrError","WASmaxInGroupsParticipantWithJidMixin","WASmaxInGroupsPhoneNumberMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsParticipantWithJidMixin").parseParticipantWithJidMixin(a);if(!b.success)return b;a=d("WASmaxInGroupsPhoneNumberMixin").parsePhoneNumberMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,a.value))}g.parseParticipantWithJidAndPnMixin=a}),98); __d("WASmaxInGroupsDisplayNameMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrString(a,"display_name");return!a.success?a:d("WAResultOrError").makeResult({displayName:a.value})}g.parseDisplayNameMixin=a}),98); __d("WASmaxInGroupsParticipantWithJidLidAndDisplayNameMixin",["WAResultOrError","WASmaxInGroupsDisplayNameMixin","WASmaxInGroupsParticipantWithJidAndLidMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsParticipantWithJidAndLidMixin").parseParticipantWithJidAndLidMixin(a);if(!b.success)return b;a=d("WASmaxInGroupsDisplayNameMixin").parseDisplayNameMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,a.value))}g.parseParticipantWithJidLidAndDisplayNameMixin=a}),98); __d("WASmaxInGroupsGroupInfoParticipantAdminMixins",["WAResultOrError","WASmaxInGroupsParticipantWithJidAndLidMixin","WASmaxInGroupsParticipantWithJidAndPnMixin","WASmaxInGroupsParticipantWithJidLidAndDisplayNameMixin","WASmaxInGroupsParticipantWithJidMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsParticipantWithJidLidAndDisplayNameMixin").parseParticipantWithJidLidAndDisplayNameMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidLidAndDisplayName",value:b.value});var c=d("WASmaxInGroupsParticipantWithJidAndLidMixin").parseParticipantWithJidAndLidMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidAndLid",value:c.value});var e=d("WASmaxInGroupsParticipantWithJidAndPnMixin").parseParticipantWithJidAndPnMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidAndPn",value:e.value});var f=d("WASmaxInGroupsParticipantWithJidMixin").parseParticipantWithJidMixin(a);return f.success?d("WAResultOrError").makeResult({name:"ParticipantWithJid",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["ParticipantWithJidLidAndDisplayName","ParticipantWithJidAndLid","ParticipantWithJidAndPn","ParticipantWithJid"],[b,c,e,f])}g.parseGroupInfoParticipantAdminMixins=a}),98); __d("WASmaxInGroupsGroupInfoParticipantAdminMixin",["WAResultOrError","WASmaxInGroupsEnums","WASmaxInGroupsGroupInfoParticipantAdminMixins","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInGroupsEnums").ENUM_ADMIN_SUPERADMIN);if(!b.success)return b;a=d("WASmaxInGroupsGroupInfoParticipantAdminMixins").parseGroupInfoParticipantAdminMixins(a);return!a.success?a:d("WAResultOrError").makeResult({type:b.value,groupInfoParticipantAdminMixins:a.value})}g.parseGroupInfoParticipantAdminMixin=a}),98); __d("WASmaxInGroupsParticipantWithJidContainingLidAndDisplayNameMixin",["WAResultOrError","WASmaxInGroupsDisplayNameMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;a=d("WASmaxInGroupsDisplayNameMixin").parseDisplayNameMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({jid:b.value},a.value))}g.parseParticipantWithJidContainingLidAndDisplayNameMixin=a}),98); __d("WASmaxInGroupsParticipantMixins",["WAResultOrError","WASmaxInGroupsParticipantWithJidAndLidMixin","WASmaxInGroupsParticipantWithJidAndPnMixin","WASmaxInGroupsParticipantWithJidContainingLidAndDisplayNameMixin","WASmaxInGroupsParticipantWithJidLidAndDisplayNameMixin","WASmaxInGroupsParticipantWithJidMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsParticipantWithJidLidAndDisplayNameMixin").parseParticipantWithJidLidAndDisplayNameMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidLidAndDisplayName",value:b.value});var c=d("WASmaxInGroupsParticipantWithJidContainingLidAndDisplayNameMixin").parseParticipantWithJidContainingLidAndDisplayNameMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidContainingLidAndDisplayName",value:c.value});var e=d("WASmaxInGroupsParticipantWithJidAndLidMixin").parseParticipantWithJidAndLidMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidAndLid",value:e.value});var f=d("WASmaxInGroupsParticipantWithJidAndPnMixin").parseParticipantWithJidAndPnMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"ParticipantWithJidAndPn",value:f.value});var g=d("WASmaxInGroupsParticipantWithJidMixin").parseParticipantWithJidMixin(a);return g.success?d("WAResultOrError").makeResult({name:"ParticipantWithJid",value:g.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["ParticipantWithJidLidAndDisplayName","ParticipantWithJidContainingLidAndDisplayName","ParticipantWithJidAndLid","ParticipantWithJidAndPn","ParticipantWithJid"],[b,c,e,f,g])}g.parseParticipantMixins=a}),98); __d("WASmaxInGroupsParticipantMixin",["WAResultOrError","WASmaxInGroupsParticipantMixins","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsParticipantMixins").parseParticipantMixins(a);return!b.success?b:d("WAResultOrError").makeResult({participantMixins:b.value})}g.parseParticipantMixin=a}),98); __d("WASmaxInGroupsGroupInfoParticipantNonAdminMixin",["WASmaxInGroupsParticipantMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsParticipantMixin").parseParticipantMixin(a);return!b.success?b:b}g.parseGroupInfoParticipantNonAdminMixin=a}),98); __d("WASmaxInGroupsGroupInfoParticipantMixins",["WAResultOrError","WASmaxInGroupsGroupInfoParticipantAdminMixin","WASmaxInGroupsGroupInfoParticipantNonAdminMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsGroupInfoParticipantAdminMixin").parseGroupInfoParticipantAdminMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"GroupInfoParticipantAdmin",value:b.value});var c=d("WASmaxInGroupsGroupInfoParticipantNonAdminMixin").parseGroupInfoParticipantNonAdminMixin(a);return c.success?d("WAResultOrError").makeResult({name:"GroupInfoParticipantNonAdmin",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["GroupInfoParticipantAdmin","GroupInfoParticipantNonAdmin"],[b,c])}g.parseGroupInfoParticipantMixins=a}),98); __d("WASmaxInGroupsGroupInfoParticipantMixin",["WAResultOrError","WASmaxInGroupsGroupInfoParticipantMixins","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsGroupInfoParticipantMixins").parseGroupInfoParticipantMixins(a);return!b.success?b:d("WAResultOrError").makeResult({groupInfoParticipantMixins:b.value})}g.parseGroupInfoParticipantMixin=a}),98); __d("WASmaxInGroupsAdminAddModeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"member_add_mode");if(!b.success)return b;b=d("WASmaxParseUtils").literalContent(d("WASmaxParseUtils").contentString,a,"admin_add");return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}g.parseAdminAddModeMixin=a}),98); __d("WASmaxInGroupsAllMembersAddModeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"member_add_mode");if(!b.success)return b;b=d("WASmaxParseUtils").literalContent(d("WASmaxParseUtils").contentString,a,"all_member_add");return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}g.parseAllMembersAddModeMixin=a}),98); __d("WASmaxInGroupsUnknownAddModeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"member_add_mode");if(!b.success)return b;b=d("WASmaxParseUtils").contentString(a);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}g.parseUnknownAddModeMixin=a}),98); __d("WASmaxInGroupsAdminOrAllMembersOrUnknownAddModeMixinGroup",["WAResultOrError","WASmaxInGroupsAdminAddModeMixin","WASmaxInGroupsAllMembersAddModeMixin","WASmaxInGroupsUnknownAddModeMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsAdminAddModeMixin").parseAdminAddModeMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"AdminAddMode",value:b.value});var c=d("WASmaxInGroupsAllMembersAddModeMixin").parseAllMembersAddModeMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"AllMembersAddMode",value:c.value});var e=d("WASmaxInGroupsUnknownAddModeMixin").parseUnknownAddModeMixin(a);return e.success?d("WAResultOrError").makeResult({name:"UnknownAddMode",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["AdminAddMode","AllMembersAddMode","UnknownAddMode"],[b,c,e])}g.parseAdminOrAllMembersOrUnknownAddModeMixinGroup=a}),98); __d("WASmaxInGroupsGroupMemberAddModeMixin",["WAResultOrError","WASmaxInGroupsAdminOrAllMembersOrUnknownAddModeMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").flattenedChildWithTag(a,"member_add_mode");if(!a.success)return a;a=d("WASmaxInGroupsAdminOrAllMembersOrUnknownAddModeMixinGroup").parseAdminOrAllMembersOrUnknownAddModeMixinGroup(a.value);return!a.success?a:d("WAResultOrError").makeResult({memberAddModeAdminOrAllMembersOrUnknownAddModeMixinGroup:a.value})}g.parseGroupMemberAddModeMixin=a}),98); __d("WASmaxInGroupsGroupJoinMembershipApprovalModeEnabledMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group_join");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"state","on");return!b.success?b:d("WAResultOrError").makeResult({state:b.value})}g.parseGroupJoinMembershipApprovalModeEnabledMixin=a}),98); __d("WASmaxInGroupsMembershipApprovalGroupJoinModeEnabledMixin",["WASmaxInGroupsGroupJoinMembershipApprovalModeEnabledMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_mode");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"group_join");if(!b.success)return b;a=d("WASmaxInGroupsGroupJoinMembershipApprovalModeEnabledMixin").parseGroupJoinMembershipApprovalModeEnabledMixin(b.value);return!a.success?a:a}g.parseMembershipApprovalGroupJoinModeEnabledMixin=a}),98); __d("WASmaxInGroupsParentGroupDefaultMembershipApprovalModeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"parent");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"default_membership_approval_mode","request_required");return!b.success?b:d("WAResultOrError").makeResult({defaultMembershipApprovalMode:b.value})}g.parseParentGroupDefaultMembershipApprovalModeMixin=a}),98); __d("WASmaxInGroupsParticipantNotAddressableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"addressable","false");return!b.success?b:d("WAResultOrError").makeResult({addressable:b.value})}g.parseParticipantNotAddressableMixin=a}),98); __d("WASmaxInGroupsGroupInfoMixin",["WAResultOrError","WASmaxInGroupsGroupInfoAttributesMixin","WASmaxInGroupsGroupInfoDescriptionMixin","WASmaxInGroupsGroupInfoParticipantMixin","WASmaxInGroupsGroupMemberAddModeMixin","WASmaxInGroupsMembershipApprovalGroupJoinModeEnabledMixin","WASmaxInGroupsParentGroupDefaultMembershipApprovalModeMixin","WASmaxInGroupsParticipantNotAddressableMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsGroupInfoParticipantMixin").parseGroupInfoParticipantMixin(a);if(!b.success)return b;a=d("WASmaxInGroupsParticipantNotAddressableMixin").parseParticipantNotAddressableMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{participantNotAddressableMixin:a.success?a.value:null}))}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"description");if(!b.success)return b;b=d("WASmaxInGroupsGroupInfoDescriptionMixin").parseGroupInfoDescriptionMixin(a);return d("WAResultOrError").makeResult({groupInfoDescriptionMixin:b.success?b.value:null})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"parent");if(!b.success)return b;b=d("WASmaxInGroupsParentGroupDefaultMembershipApprovalModeMixin").parseParentGroupDefaultMembershipApprovalModeMixin(a);return d("WAResultOrError").makeResult({parentGroupDefaultMembershipApprovalModeMixin:b.success?b.value:null})}function k(a){var b=d("WASmaxParseUtils").assertTag(a,"ephemeral");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"expiration",0,2147483647);if(!b.success)return b;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"trigger",0,20);return!a.success?a:d("WAResultOrError").makeResult({expiration:b.value,trigger:a.value})}function l(a){var b=d("WASmaxParseUtils").assertTag(a,"growth_locked");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","invite");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"expiration",0,void 0);return!a.success?a:d("WAResultOrError").makeResult({type:b.value,expiration:a.value})}function m(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_mode");if(!b.success)return b;b=d("WASmaxInGroupsMembershipApprovalGroupJoinModeEnabledMixin").parseMembershipApprovalGroupJoinModeEnabledMixin(a);return d("WAResultOrError").makeResult({membershipApprovalGroupJoinModeEnabledMixin:b.success?b.value:null})}function n(a){var b=d("WASmaxParseUtils").assertTag(a,"linked_parent");if(!b.success)return b;b=d("WASmaxParseJid").attrGroupJid(a,"jid");return!b.success?b:d("WAResultOrError").makeResult({jid:b.value})}function o(a){var b=d("WASmaxParseUtils").assertTag(a,"evolution_version");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"value",0,100);return!b.success?b:d("WAResultOrError").makeResult({value:b.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"description",i);if(!b.success)return b;var c=d("WASmaxParseUtils").optionalChild(a,"locked");if(!c.success)return c;var e=d("WASmaxParseUtils").optionalChild(a,"announcement");if(!e.success)return e;var f=d("WASmaxParseUtils").optionalChildWithTag(a,"parent",j);if(!f.success)return f;var g=d("WASmaxParseUtils").optionalChild(a,"no_frequently_forwarded");if(!g.success)return g;var p=d("WASmaxParseUtils").optionalChild(a,"support");if(!p.success)return p;var q=d("WASmaxParseUtils").optionalChildWithTag(a,"ephemeral",k);if(!q.success)return q;var r=d("WASmaxParseUtils").optionalChild(a,"suspended");if(!r.success)return r;var s=d("WASmaxParseUtils").optionalChildWithTag(a,"growth_locked",l);if(!s.success)return s;var t=d("WASmaxParseUtils").optionalChild(a,"default_sub_group");if(!t.success)return t;var u=d("WASmaxParseUtils").optionalChildWithTag(a,"membership_approval_mode",m);if(!u.success)return u;var v=d("WASmaxParseUtils").optionalChild(a,"incognito");if(!v.success)return v;var w=d("WASmaxParseUtils").optionalChild(a,"allow_admin_reports");if(!w.success)return w;var x=d("WASmaxParseUtils").optionalChild(a,"allow_non_admin_sub_group_creation");if(!x.success)return x;var y=d("WASmaxParseUtils").optionalChild(a,"general_chat");if(!y.success)return y;var z=d("WASmaxParseUtils").optionalChild(a,"auto_add_disabled");if(!z.success)return z;var A=d("WASmaxParseUtils").optionalChild(a,"group_history");if(!A.success)return A;var B=d("WASmaxParseUtils").optionalChildWithTag(a,"linked_parent",n);if(!B.success)return B;var C=d("WASmaxParseUtils").optionalChild(a,"hidden_group");if(!C.success)return C;var D=d("WASmaxParseUtils").optionalChild(a,"capi");if(!D.success)return D;var E=d("WASmaxParseUtils").optionalChildWithTag(a,"evolution_version",o);if(!E.success)return E;var F=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,a,"ack","false");if(!F.success)return F;var G=d("WASmaxInGroupsGroupInfoAttributesMixin").parseGroupInfoAttributesMixin(a);if(!G.success)return G;var H=d("WASmaxInGroupsGroupMemberAddModeMixin").parseGroupMemberAddModeMixin(a);a=d("WASmaxParseUtils").mapChildrenWithTag(a,"participant",0,19999,h);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({ack:F.value},G.value,{groupMemberAddModeMixin:H.success?H.value:null,description:b.value,hasLocked:c.value!=null,hasAnnouncement:e.value!=null,parent:f.value,hasNoFrequentlyForwarded:g.value!=null,hasSupport:p.value!=null,ephemeral:q.value,hasSuspended:r.value!=null,growthLocked:s.value,hasDefaultSubGroup:t.value!=null,membershipApprovalMode:u.value,hasIncognito:v.value!=null,hasAllowAdminReports:w.value!=null,hasAllowNonAdminSubGroupCreation:x.value!=null,hasGeneralChat:y.value!=null,hasAutoAddDisabled:z.value!=null,hasGroupHistory:A.value!=null,linkedParent:B.value,hasHiddenGroup:C.value!=null,hasCapi:D.value!=null,evolutionVersion:E.value,participant:a.value}))}g.parseGroupInfoParticipant=h;g.parseGroupInfoDescription=i;g.parseGroupInfoParent=j;g.parseGroupInfoEphemeral=k;g.parseGroupInfoGrowthLocked=l;g.parseGroupInfoMembershipApprovalMode=m;g.parseGroupInfoLinkedParent=n;g.parseGroupInfoEvolutionVersion=o;g.parseGroupInfoMixin=a}),98); __d("WASmaxInGroupsGroupNotExistMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"error","404");return!a.success?a:d("WAResultOrError").makeResult({id:b.value,error:a.value})}g.parseGroupNotExistMixin=a}),98); __d("WASmaxInGroupsTruncatedGroupInfoMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"truncated","true");if(!c.success)return c;a=d("WASmaxParseUtils").attrIntRange(a,"size",0,19999);return!a.success?a:d("WAResultOrError").makeResult({id:b.value,truncated:c.value,size:a.value})}g.parseTruncatedGroupInfoMixin=a}),98); __d("WASmaxInGroupsGroupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup",["WAResultOrError","WASmaxInGroupsGroupForbiddenMixin","WASmaxInGroupsGroupInfoMixin","WASmaxInGroupsGroupNotExistMixin","WASmaxInGroupsTruncatedGroupInfoMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsGroupInfoMixin").parseGroupInfoMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"GroupInfo",value:b.value});var c=d("WASmaxInGroupsTruncatedGroupInfoMixin").parseTruncatedGroupInfoMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"TruncatedGroupInfo",value:c.value});var e=d("WASmaxInGroupsGroupForbiddenMixin").parseGroupForbiddenMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"GroupForbidden",value:e.value});var f=d("WASmaxInGroupsGroupNotExistMixin").parseGroupNotExistMixin(a);return f.success?d("WAResultOrError").makeResult({name:"GroupNotExist",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["GroupInfo","TruncatedGroupInfo","GroupForbidden","GroupNotExist"],[b,c,e,f])}g.parseGroupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup=a}),98); __d("WASmaxInGroupsBatchGetGroupInfoResponseSuccess",["WAResultOrError","WASmaxInGroupsDedupAttrsMixin","WASmaxInGroupsGroupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxInGroupsDedupAttrsMixin").parseDedupAttrsMixin(a);a=d("WASmaxInGroupsGroupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup").parseGroupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult({dedupAttrsMixin:b.success?b.value:null,groupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"groups");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"group",1,1e4,h);return!b.success?b:d("WAResultOrError").makeResult({type:e.value,groupsGroup:b.value})}g.parseBatchGetGroupInfoResponseSuccessGroupsGroup=h;g.parseBatchGetGroupInfoResponseSuccess=a}),98); __d("WASmaxAttrs",["WAWap"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){if(b==null)return d("WAWap").DROP_ATTR;else return a(b)}function b(a,b){if(b)return a;else return d("WAWap").DROP_ATTR}g.OPTIONAL=a;g.OPTIONAL_LITERAL=b}),98); __d("WASmaxChildren",["WADeepEquals"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){if(b==null)return null;else return a(b)}function b(a,b){if(b==null)return null;else if(b)return a()}function c(a,b){if(b)for(var c=1;c<b.length;c++)if(!d("WADeepEquals").deepEqual(b[c],b[0]))throw new Error("expected all homogeneous children to be equal, but they were not");c=h(a,b,0,Infinity);return c}function e(a,b){return i(a,b,0,Infinity)}function h(a,b,c,d){if(b==null){if(c>0)throw new Error("expected at least "+c+" children, but none provided");return[]}var e=b.length;if(e<c)throw new Error("expected at least "+c+" children, but found "+e);else if(e>d)throw new Error("expected at most "+d+" children, but found "+e);return b.map(function(b){return a(b)})}function i(a,b,c,d){if(b===0){if(c>0)throw new Error("expected at least "+c+" children, but none provided");return[]}if(b<c)throw new Error("expected at least "+c+" children, but found "+b);else if(b>d)throw new Error("expected at most "+d+" children, but found "+b);c=[];for(d=0;d<b;d++)c.push(a());return c}g.OPTIONAL_CHILD=a;g.HAS_OPTIONAL_CHILD=b;g.HOMOGENEOUS_CHILD=c;g.HOMOGENEOUS_CHILD_COUNT=e;g.REPEATED_CHILD=h;g.REPEATED_CHILD_COUNT=i}),98); __d("WASmaxOutGroupsBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutGroupsBaseGetServerMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutGroupsBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutGroupsBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").G_US,xmlns:"w:g2"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseGetServerMixin=a}),98); __d("WASmaxOutGroupsBatchGetGroupInfoRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxOutGroupsBaseGetServerMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.groupJid;a=d("WASmaxJsx").smax("group",{jid:d("WAWap").GROUP_JID(a)});return a}function a(a){var b=a.groupArgs;a=a.queryContext;a=d("WASmaxOutGroupsBaseGetServerMixin").mergeBaseGetServerMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("query",{context:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a)},d("WASmaxChildren").REPEATED_CHILD(h,b,1,1e4))));return a}g.makeBatchGetGroupInfoRequestQueryGroup=h;g.makeBatchGetGroupInfoRequest=a}),98); __d("WASmaxGroupsBatchGetGroupInfoRPC",["WAComms","WASmaxInGroupsBatchGetGroupInfoResponseClientError","WASmaxInGroupsBatchGetGroupInfoResponseServerError","WASmaxInGroupsBatchGetGroupInfoResponseSuccess","WASmaxOutGroupsBatchGetGroupInfoRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsBatchGetGroupInfoRequest").makeBatchGetGroupInfoRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsBatchGetGroupInfoResponseSuccess").parseBatchGetGroupInfoResponseSuccess(b,a);if(c.success)return{name:"BatchGetGroupInfoResponseSuccess",value:c.value};var e=d("WASmaxInGroupsBatchGetGroupInfoResponseClientError").parseBatchGetGroupInfoResponseClientError(b,a);if(e.success)return{name:"BatchGetGroupInfoResponseClientError",value:e.value};b=d("WASmaxInGroupsBatchGetGroupInfoResponseServerError").parseBatchGetGroupInfoResponseServerError(b,a);if(b.success)return{name:"BatchGetGroupInfoResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("BatchGetGroupInfo",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendBatchGetGroupInfoRPC=a}),98); __d("WASmaxInGroupsIQErrorFallbackClientMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"text");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"code",400,499);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFallbackClientMixin=a}),98); __d("WASmaxInGroupsIQErrorGoneMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","gone");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",410);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorGoneMixin=a}),98); __d("WASmaxInGroupsIQErrorGrowthLockedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"growth_locked");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","invite");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"expiration",0,void 0);return!a.success?a:d("WAResultOrError").makeResult({type:b.value,expiration:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"growth_locked",h);if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","growth-locked");if(!c.success)return c;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",436);return!a.success?a:d("WAResultOrError").makeResult({text:c.value,code:a.value,growthLocked:b.value})}g.parseIQErrorGrowthLockedGrowthLocked=h;g.parseIQErrorGrowthLockedMixin=a}),98); __d("WASmaxInGroupsIQErrorItemNotFoundMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","item-not-found");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",404);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorItemNotFoundMixin=a}),98); __d("WASmaxInGroupsIQErrorLockedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","locked");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",423);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorLockedMixin=a}),98); __d("WASmaxInGroupsIQErrorNotAcceptableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"field");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"reason");return!a.success?a:d("WAResultOrError").makeResult({name:b.value,reason:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"field",h);if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-acceptable");if(!c.success)return c;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",406);return!a.success?a:d("WAResultOrError").makeResult({text:c.value,code:a.value,field:b.value})}g.parseIQErrorNotAcceptableField=h;g.parseIQErrorNotAcceptableMixin=a}),98); __d("WASmaxInGroupsIQErrorNotAuthorizedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-authorized");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",401);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAuthorizedMixin=a}),98); __d("WASmaxInGroupsIQErrorParentGroupSuspendedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","parent-group-suspended");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",416);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorParentGroupSuspendedMixin=a}),98); __d("WASmaxInGroupsGetInviteGroupInfoClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorGoneMixin","WASmaxInGroupsIQErrorGrowthLockedMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorLockedMixin","WASmaxInGroupsIQErrorNotAcceptableMixin","WASmaxInGroupsIQErrorNotAuthorizedMixin","WASmaxInGroupsIQErrorParentGroupSuspendedMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:c.value});var e=d("WASmaxInGroupsIQErrorGoneMixin").parseIQErrorGoneMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorGone",value:e.value});var f=d("WASmaxInGroupsIQErrorNotAuthorizedMixin").parseIQErrorNotAuthorizedMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAuthorized",value:f.value});var g=d("WASmaxInGroupsIQErrorNotAcceptableMixin").parseIQErrorNotAcceptableMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAcceptable",value:g.value});var h=d("WASmaxInGroupsIQErrorLockedMixin").parseIQErrorLockedMixin(a);if(h.success)return d("WAResultOrError").makeResult({name:"IQErrorLocked",value:h.value});var i=d("WASmaxInGroupsIQErrorGrowthLockedMixin").parseIQErrorGrowthLockedMixin(a);if(i.success)return d("WAResultOrError").makeResult({name:"IQErrorGrowthLocked",value:i.value});var j=d("WASmaxInGroupsIQErrorParentGroupSuspendedMixin").parseIQErrorParentGroupSuspendedMixin(a);if(j.success)return d("WAResultOrError").makeResult({name:"IQErrorParentGroupSuspended",value:j.value});var k=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return k.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:k.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorItemNotFound","IQErrorGone","IQErrorNotAuthorized","IQErrorNotAcceptable","IQErrorLocked","IQErrorGrowthLocked","IQErrorParentGroupSuspended","IQErrorFallbackClient"],[b,c,e,f,g,h,i,j,k])}g.parseGetInviteGroupInfoClientErrors=a}),98); __d("WASmaxInGroupsGetInviteGroupInfoResponseClientError",["WAResultOrError","WASmaxInGroupsGetInviteGroupInfoClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsGetInviteGroupInfoClientErrors").parseGetInviteGroupInfoClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorGetInviteGroupInfoClientErrors:b.value}))}g.parseGetInviteGroupInfoResponseClientError=a}),98); __d("WASmaxInGroupsGetInviteGroupInfoResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseGetInviteGroupInfoResponseServerError=a}),98); __d("WASmaxInGroupsInviteLinkGroupInfoMixin",["WAResultOrError","WASmaxInGroupsGroupInfoAttributesMixin","WASmaxInGroupsGroupInfoDescriptionMixin","WASmaxInGroupsGroupInfoParticipantMixin","WASmaxInGroupsMembershipApprovalGroupJoinModeEnabledMixin","WASmaxInGroupsNamedSubjectMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"participant");if(!b.success)return b;b=d("WASmaxInGroupsGroupInfoParticipantMixin").parseGroupInfoParticipantMixin(a);return!b.success?b:b}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"parent");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"num_sub_groups",1,1e3);return!b.success?b:d("WAResultOrError").makeResult({numSubGroups:b.value})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"linked_parent");if(!b.success)return b;b=d("WASmaxParseJid").attrGroupJid(a,"jid");if(!b.success)return b;a=d("WASmaxInGroupsNamedSubjectMixin").parseNamedSubjectMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({jid:b.value},a.value))}function k(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_mode");if(!b.success)return b;b=d("WASmaxInGroupsMembershipApprovalGroupJoinModeEnabledMixin").parseMembershipApprovalGroupJoinModeEnabledMixin(a);return!b.success?b:b}function l(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_request");if(!b.success)return b;b=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,a,"error","304");return!b.success?b:d("WAResultOrError").makeResult({error:b.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"description");if(!b.success)return b;var c=d("WASmaxParseUtils").optionalChildWithTag(a,"parent",i);if(!c.success)return c;var e=d("WASmaxParseUtils").optionalChildWithTag(a,"linked_parent",j);if(!e.success)return e;var f=d("WASmaxParseUtils").optionalChild(a,"hidden_group");if(!f.success)return f;var g=d("WASmaxParseUtils").optionalChild(a,"default_sub_group");if(!g.success)return g;var m=d("WASmaxParseUtils").optionalChild(a,"general_chat");if(!m.success)return m;var n=d("WASmaxParseUtils").optionalChildWithTag(a,"membership_approval_mode",k);if(!n.success)return n;var o=d("WASmaxParseUtils").optionalChildWithTag(a,"membership_approval_request",l);if(!o.success)return o;var p=d("WASmaxParseUtils").attrIntRange(a,"size",0,19999);if(!p.success)return p;b=d("WASmaxInGroupsGroupInfoDescriptionMixin").parseGroupInfoDescriptionMixin(b.value);var q=d("WASmaxInGroupsGroupInfoAttributesMixin").parseGroupInfoAttributesMixin(a);if(!q.success)return q;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"participant",0,19999,h);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({size:p.value,descriptionGroupInfoDescriptionMixin:b.success?b.value:null},q.value,{parent:c.value,linkedParent:e.value,hasHiddenGroup:f.value!=null,hasDefaultSubGroup:g.value!=null,hasGeneralChat:m.value!=null,membershipApprovalMode:n.value,membershipApprovalRequest:o.value,participant:a.value}))}g.parseInviteLinkGroupInfoParticipant=h;g.parseInviteLinkGroupInfoParent=i;g.parseInviteLinkGroupInfoLinkedParent=j;g.parseInviteLinkGroupInfoMembershipApprovalMode=k;g.parseInviteLinkGroupInfoMembershipApprovalRequest=l;g.parseInviteLinkGroupInfoMixin=a}),98); __d("WASmaxInGroupsGetInviteGroupInfoResponseSuccess",["WAResultOrError","WASmaxInGroupsInviteLinkGroupInfoMixin","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"group");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").attrIntRange(c.value,"size",0,19999);if(!b.success)return b;a=d("WASmaxInGroupsInviteLinkGroupInfoMixin").parseInviteLinkGroupInfoMixin(c.value);return!a.success?a:d("WAResultOrError").makeResult({type:e.value,groupSize:b.value,groupInviteLinkGroupInfoMixin:a.value})}g.parseGetInviteGroupInfoResponseSuccess=a}),98); __d("WASmaxOutGroupsGetInviteGroupInfoRequest",["WASmaxJsx","WASmaxOutGroupsBaseGetServerMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=a.inviteCode;a=d("WASmaxOutGroupsBaseGetServerMixin").mergeBaseGetServerMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("invite",{code:d("WAWap").CUSTOM_STRING(a)})));return a}g.makeGetInviteGroupInfoRequest=a}),98); __d("WASmaxGroupsGetInviteGroupInfoRPC",["WAComms","WASmaxInGroupsGetInviteGroupInfoResponseClientError","WASmaxInGroupsGetInviteGroupInfoResponseServerError","WASmaxInGroupsGetInviteGroupInfoResponseSuccess","WASmaxOutGroupsGetInviteGroupInfoRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsGetInviteGroupInfoRequest").makeGetInviteGroupInfoRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsGetInviteGroupInfoResponseSuccess").parseGetInviteGroupInfoResponseSuccess(b,a);if(c.success)return{name:"GetInviteGroupInfoResponseSuccess",value:c.value};var e=d("WASmaxInGroupsGetInviteGroupInfoResponseClientError").parseGetInviteGroupInfoResponseClientError(b,a);if(e.success)return{name:"GetInviteGroupInfoResponseClientError",value:e.value};b=d("WASmaxInGroupsGetInviteGroupInfoResponseServerError").parseGetInviteGroupInfoResponseServerError(b,a);if(b.success)return{name:"GetInviteGroupInfoResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetInviteGroupInfo",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetInviteGroupInfoRPC=a}),98); __d("WASmaxInGroupsIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:c.value});var e=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return e.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorRateOverlimit","IQErrorFallbackClient"],[b,c,e])}g.parseIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup=a}),98); __d("WASmaxInGroupsGetParticipatingGroupsResponseClientError",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup").parseIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup:b.value}))}g.parseGetParticipatingGroupsResponseClientError=a}),98); __d("WASmaxInGroupsGetParticipatingGroupsResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseGetParticipatingGroupsResponseServerError=a}),98); __d("WASmaxInGroupsGroupInfoOrTruncatedGroupInfoGroupInfoMixinGroup",["WAResultOrError","WASmaxInGroupsGroupInfoMixin","WASmaxInGroupsTruncatedGroupInfoMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsGroupInfoMixin").parseGroupInfoMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"GroupInfo",value:b.value});var c=d("WASmaxInGroupsTruncatedGroupInfoMixin").parseTruncatedGroupInfoMixin(a);return c.success?d("WAResultOrError").makeResult({name:"TruncatedGroupInfo",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["GroupInfo","TruncatedGroupInfo"],[b,c])}g.parseGroupInfoOrTruncatedGroupInfoGroupInfoMixinGroup=a}),98); __d("WASmaxInGroupsGetParticipatingGroupsResponseSuccess",["WAResultOrError","WASmaxInGroupsDedupAttrsMixin","WASmaxInGroupsGroupInfoOrTruncatedGroupInfoGroupInfoMixinGroup","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxInGroupsDedupAttrsMixin").parseDedupAttrsMixin(a);a=d("WASmaxInGroupsGroupInfoOrTruncatedGroupInfoGroupInfoMixinGroup").parseGroupInfoOrTruncatedGroupInfoGroupInfoMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult({dedupAttrsMixin:b.success?b.value:null,groupInfoOrTruncatedGroupInfoGroupInfoMixinGroup:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"groups");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"group",0,1e4,h);return!b.success?b:d("WAResultOrError").makeResult({type:e.value,groupsGroup:b.value})}g.parseGetParticipatingGroupsResponseSuccessGroupsGroup=h;g.parseGetParticipatingGroupsResponseSuccess=a}),98); __d("WASmaxOutGroupsGetParticipatingGroupsRequest",["WASmaxChildren","WASmaxJsx","WASmaxOutGroupsBaseGetServerMixin"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("participants",null);return a}function i(){var a=d("WASmaxJsx").smax("description",null);return a}function a(a){var b=a.hasParticipants;a=a.hasDescription;b=d("WASmaxOutGroupsBaseGetServerMixin").mergeBaseGetServerMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("participating",null,d("WASmaxChildren").HAS_OPTIONAL_CHILD(h,b),d("WASmaxChildren").HAS_OPTIONAL_CHILD(i,a))));return b}g.makeGetParticipatingGroupsRequestParticipatingParticipants=h;g.makeGetParticipatingGroupsRequestParticipatingDescription=i;g.makeGetParticipatingGroupsRequest=a}),98); __d("WASmaxGroupsGetParticipatingGroupsRPC",["WAComms","WASmaxInGroupsGetParticipatingGroupsResponseClientError","WASmaxInGroupsGetParticipatingGroupsResponseServerError","WASmaxInGroupsGetParticipatingGroupsResponseSuccess","WASmaxOutGroupsGetParticipatingGroupsRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsGetParticipatingGroupsRequest").makeGetParticipatingGroupsRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsGetParticipatingGroupsResponseSuccess").parseGetParticipatingGroupsResponseSuccess(b,a);if(c.success)return{name:"GetParticipatingGroupsResponseSuccess",value:c.value};var e=d("WASmaxInGroupsGetParticipatingGroupsResponseClientError").parseGetParticipatingGroupsResponseClientError(b,a);if(e.success)return{name:"GetParticipatingGroupsResponseClientError",value:e.value};b=d("WASmaxInGroupsGetParticipatingGroupsResponseServerError").parseGetParticipatingGroupsResponseServerError(b,a);if(b.success)return{name:"GetParticipatingGroupsResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetParticipatingGroups",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetParticipatingGroupsRPC=a}),98); __d("WASmaxInGroupsIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorForbiddenMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorLockedMixin","WASmaxInGroupsIQErrorNotAuthorizedMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:c.value});var e=d("WASmaxInGroupsIQErrorNotAuthorizedMixin").parseIQErrorNotAuthorizedMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAuthorized",value:e.value});var f=d("WASmaxInGroupsIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:f.value});var g=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:g.value});var h=d("WASmaxInGroupsIQErrorLockedMixin").parseIQErrorLockedMixin(a);if(h.success)return d("WAResultOrError").makeResult({name:"IQErrorLocked",value:h.value});var i=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return i.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:i.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorItemNotFound","IQErrorNotAuthorized","IQErrorForbidden","IQErrorRateOverlimit","IQErrorLocked","IQErrorFallbackClient"],[b,c,e,f,g,h,i])}g.parseGetMembershipApprovalRequestsClientErrors=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsResponseClientError",["WAResultOrError","WASmaxInGroupsGetMembershipApprovalRequestsClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsGetMembershipApprovalRequestsClientErrors").parseGetMembershipApprovalRequestsClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorGetMembershipApprovalRequestsClientErrors:b.value}))}g.parseGetMembershipApprovalRequestsResponseClientError=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseGetMembershipApprovalRequestsResponseServerError=a}),98); __d("WASmaxInGroupsMembershipRequestMethodAttributeMixin",["WAResultOrError","WASmaxInGroupsEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrStringEnum(a,"request_method",d("WASmaxInGroupsEnums").ENUM_INVITELINK_LINKEDGROUPJOIN_NONADMINADD);return!a.success?a:d("WAResultOrError").makeResult({requestMethod:a.value})}g.parseMembershipRequestMethodAttributeMixin=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsMembershipApprovalRequestMixin",["WAResultOrError","WASmaxInGroupsMembershipRequestMethodAttributeMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_request");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"requestor");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"requestor_pn");if(!e.success)return e;var f=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrGroupJid,a,"parent_group_jid");if(!f.success)return f;var g=d("WASmaxParseUtils").attrIntRange(a,"request_time",0,void 0);if(!g.success)return g;a=d("WASmaxInGroupsMembershipRequestMethodAttributeMixin").parseMembershipRequestMethodAttributeMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({jid:b.value,requestor:c.value,requestorPn:e.value,parentGroupJid:f.value,requestTime:g.value},a.value))}g.parseGetMembershipApprovalRequestsMembershipApprovalRequestMixin=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsRequestorFetchMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"requestor_fetch","true");return!a.success?a:d("WAResultOrError").makeResult({requestorFetch:a.value})}g.parseGetMembershipApprovalRequestsRequestorFetchMixin=a}),98); __d("WASmaxInGroupsIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInGroupsGetMembershipApprovalRequestsResponseSuccess",["WAResultOrError","WASmaxInGroupsGetMembershipApprovalRequestsMembershipApprovalRequestMixin","WASmaxInGroupsGetMembershipApprovalRequestsRequestorFetchMixin","WASmaxInGroupsGroupAddressingModeMixin","WASmaxInGroupsIQResultResponseMixin","WASmaxInGroupsPhoneNumberMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"membership_approval_request");if(!b.success)return b;b=d("WASmaxInGroupsGetMembershipApprovalRequestsMembershipApprovalRequestMixin").parseGetMembershipApprovalRequestsMembershipApprovalRequestMixin(a);if(!b.success)return b;a=d("WASmaxInGroupsPhoneNumberMixin").parsePhoneNumberMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{phoneNumberMixin:a.success?a.value:null}))}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"membership_approval_requests");if(!c.success)return c;var e=d("WASmaxInGroupsGetMembershipApprovalRequestsRequestorFetchMixin").parseGetMembershipApprovalRequestsRequestorFetchMixin(c.value);b=d("WASmaxInGroupsIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!b.success)return b;a=d("WASmaxInGroupsGroupAddressingModeMixin").parseGroupAddressingModeMixin(a);c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"membership_approval_request",0,19999,h);return!c.success?c:d("WAResultOrError").makeResult(babelHelpers["extends"]({membershipApprovalRequestsGetMembershipApprovalRequestsRequestorFetchMixin:e.success?e.value:null},b.value,{groupAddressingModeMixin:a.success?a.value:null,membershipApprovalRequestsMembershipApprovalRequest:c.value}))}g.parseGetMembershipApprovalRequestsResponseSuccessMembershipApprovalRequestsMembershipApprovalRequest=h;g.parseGetMembershipApprovalRequestsResponseSuccess=a}),98); __d("WASmaxOutGroupsBaseGetGroupMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutGroupsBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iqTo;a=d("WASmaxOutGroupsBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").GROUP_JID(a),xmlns:"w:g2"}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseGetGroupMixin=a}),98); __d("WASmaxOutGroupsGetMembershipApprovalRequestsRequestorFetchMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("smax$any",{requestor_fetch:"true"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeGetMembershipApprovalRequestsRequestorFetchMixin=a}),98); __d("WASmaxOutGroupsGetMembershipApprovalRequestsRequest",["WASmaxJsx","WASmaxMixins","WASmaxOutGroupsBaseGetGroupMixin","WASmaxOutGroupsGetMembershipApprovalRequestsRequestorFetchMixin"],(function(a,b,c,d,e,f,g){function a(a){var b=a.hasGetMembershipApprovalRequestsRequestorFetch;b=d("WASmaxOutGroupsBaseGetGroupMixin").mergeBaseGetGroupMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsGetMembershipApprovalRequestsRequestorFetchMixin").mergeGetMembershipApprovalRequestsRequestorFetchMixin,d("WASmaxJsx").smax("membership_approval_requests",null),b)),a);return b}g.makeGetMembershipApprovalRequestsRequest=a}),98); __d("WASmaxGroupsGetMembershipApprovalRequestsRPC",["WAComms","WASmaxInGroupsGetMembershipApprovalRequestsResponseClientError","WASmaxInGroupsGetMembershipApprovalRequestsResponseServerError","WASmaxInGroupsGetMembershipApprovalRequestsResponseSuccess","WASmaxOutGroupsGetMembershipApprovalRequestsRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsGetMembershipApprovalRequestsRequest").makeGetMembershipApprovalRequestsRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsGetMembershipApprovalRequestsResponseSuccess").parseGetMembershipApprovalRequestsResponseSuccess(b,a);if(c.success)return{name:"GetMembershipApprovalRequestsResponseSuccess",value:c.value};var e=d("WASmaxInGroupsGetMembershipApprovalRequestsResponseClientError").parseGetMembershipApprovalRequestsResponseClientError(b,a);if(e.success)return{name:"GetMembershipApprovalRequestsResponseClientError",value:e.value};b=d("WASmaxInGroupsGetMembershipApprovalRequestsResponseServerError").parseGetMembershipApprovalRequestsResponseServerError(b,a);if(b.success)return{name:"GetMembershipApprovalRequestsResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetMembershipApprovalRequests",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetMembershipApprovalRequestsRPC=a}),98); __d("WAWebRequestMethodType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["NonAdminAdd","InviteLink","LinkedGroupJoin"]);f.RequestMethod=a}),66); __d("WAWebGroupGetMembershipApprovalRequestsJob",["Promise","WALogger","WASmaxGroupsGetMembershipApprovalRequestsRPC","WAWebApiMembershipApprovalRequestStore","WAWebBackendApi","WAWebBackendErrors","WAWebJidToWid","WAWebRequestMethodType","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryMembershipApprovalRequests failed: ",":",""]);i=function(){return a};return a}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WASmaxGroupsGetMembershipApprovalRequestsRPC").sendGetMembershipApprovalRequestsRPC({iqTo:d("WAWebWidToJid").widToGroupJid(a)}));switch(a.name){case"GetMembershipApprovalRequestsResponseSuccess":return a.value.membershipApprovalRequestsMembershipApprovalRequest.map(function(a){var b=d("WAWebJidToWid").userJidToUserWid(a.jid);return{id:b,t:a.requestTime,addedBy:a.requestor!=null?d("WAWebJidToWid").userJidToUserWid(a.requestor):b,requestMethod:l(a.requestMethod),parentGroupId:a.parentGroupJid!=null?d("WAWebJidToWid").groupJidToWid(a.parentGroupJid):void 0}});case"GetMembershipApprovalRequestsResponseClientError":var b=a.value.errorGetMembershipApprovalRequestsClientErrors;return m(b.value);default:a.name;return m(a.value.errorServerErrors.value)}});return k.apply(this,arguments)}function l(a){switch(a){case"invite_link":return d("WAWebRequestMethodType").RequestMethod.InviteLink;case"linked_group_join":return d("WAWebRequestMethodType").RequestMethod.LinkedGroupJoin;case"non_admin_add":return d("WAWebRequestMethodType").RequestMethod.NonAdminAdd}}function m(a){var c=a.code;a=a.text;d("WALogger").LOG(i(),c,a);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),a))}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j(a)),c=(yield d("WAWebApiMembershipApprovalRequestStore").getMembershipApprovalRequests(a));c=c.filter(function(a){return!b.some(function(b){return b.id.equals(a.id)})});yield d("WAWebApiMembershipApprovalRequestStore").removeMembershipApprovalRequests(a,c.map(function(a){return a.id}));yield d("WAWebApiMembershipApprovalRequestStore").addMembershipApprovalRequests(a,b);d("WAWebBackendApi").frontendFireAndForget("removeMembershipApprovalRequests",{groupId:a,requestIds:c.map(function(a){return a.id})});d("WAWebBackendApi").frontendFireAndForget("addMembershipApprovalRequests",{groupId:a,requests:b})});return n.apply(this,arguments)}g.queryAndUpdateGroupMembershipApprovalRequests=a}),98); __d("WAWebGroupsQueryApi",["WALogger","WATimeUtils","WAWebJidToWid","WAWebSchemaGroupMetadata","WAWebWidFactory","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseBatchGroupInfoSmax: unexpected truncated group info received from server when querying dirty groups metadata"]);h=function(){return a};return a}function i(a){if(!a)return null;var b=a.bodyElementValue,c=a.id,e=a.participant;a=a.t;return{desc:b,descId:c,descOwner:e!=null?d("WAWebJidToWid").userJidToUserWid(e):void 0,descTime:d("WATimeUtils").castToUnixTime(a)}}function j(a){if(!a)return null;a=a.expiration;return{ephemeralDuration:a}}function k(a){if(a==null)return null;var b=a.expiration;a=a.type;return{growthLockExpiration:b,growthLockType:a}}function l(a){return a==null?null:{parentGroup:d("WAWebJidToWid").groupJidToWid(a.jid),parentGroupSubject:a.subject}}function m(a){return a.map(function(a){if(a.groupInfoParticipantMixins.name==="GroupInfoParticipantAdmin"){var b=a.groupInfoParticipantMixins.value,c=b.type;b=b.groupInfoParticipantAdminMixins;var e=c==="admin"||c==="superadmin";c=c==="superadmin";if(b.name==="ParticipantWithJid")return{isAdmin:e,isSuperAdmin:c,id:d("WAWebJidToWid").userJidToUserWid(b.value.jid),displayName:null,lid:null,phoneNumber:null};else if(b.name==="ParticipantWithJidAndPn")return{isAdmin:e,isSuperAdmin:c,id:d("WAWebJidToWid").userJidToUserWid(b.value.jid),displayName:null,lid:null,phoneNumber:d("WAWebJidToWid").userJidToUserWid(b.value.phoneNumber)};else if(b.name==="ParticipantWithJidAndLid")return{isAdmin:e,isSuperAdmin:c,id:d("WAWebJidToWid").userJidToUserWid(b.value.jid),lid:d("WAWebJidToWid").userJidToUserWid(b.value.lid),displayName:null};b.name;return{isAdmin:e,isSuperAdmin:c,id:d("WAWebJidToWid").userJidToUserWid(b.value.jid),lid:d("WAWebJidToWid").userJidToUserWid(b.value.lid),displayName:b.value.displayName}}a.groupInfoParticipantMixins.name;e=a.groupInfoParticipantMixins.value.participantMixins;if(e.name==="ParticipantWithJid")return{isAdmin:!1,isSuperAdmin:!1,id:d("WAWebJidToWid").userJidToUserWid(e.value.jid),displayName:null,lid:null};else if(e.name==="ParticipantWithJidAndPn")return{isAdmin:!1,isSuperAdmin:!1,id:d("WAWebJidToWid").userJidToUserWid(e.value.jid),displayName:null,lid:null,phoneNumber:d("WAWebJidToWid").userJidToUserWid(e.value.phoneNumber)};else if(e.name==="ParticipantWithJidAndLid")return{isAdmin:!1,isSuperAdmin:!1,id:d("WAWebJidToWid").userJidToUserWid(e.value.jid),lid:d("WAWebJidToWid").userJidToUserWid(e.value.lid),displayName:null};else if(e.name==="ParticipantWithJidContainingLidAndDisplayName")return{isAdmin:!1,isSuperAdmin:!1,id:d("WAWebJidToWid").userJidToUserWid(e.value.jid),displayName:e.value.displayName,lid:null,phoneNumber:null};e.name;return{isAdmin:!1,isSuperAdmin:!1,id:d("WAWebJidToWid").userJidToUserWid(e.value.jid),lid:d("WAWebJidToWid").userJidToUserWid(e.value.lid),displayName:e.value.displayName,phoneNumber:null}})}function a(a,b){var c=[];b.forEach(function(b){b=b.groupInfoOrTruncatedGroupInfoOrGroupForbiddenOrGroupNotExistMixinGroup;a==="per_group_dirty_recovery"&&b.name==="TruncatedGroupInfo"&&d("WALogger").WARN(h()).sendLogs("unexpected-truncated-group-info-for-dirty-group-request");(b.name==="GroupInfo"||b.name==="TruncatedGroupInfo")&&c.push(n(b.value))});return c}function n(a){var b,e=a.groupAddressingModeMixin,f=a.creator,g=a.creation,h=a.id,n=a.hasLocked,o=a.hasAnnouncement,p=a.hasNoFrequentlyForwarded,q=a.hasSupport,r=a.hasSuspended,s=a.parent,t=a.hasCapi,u=a.hasDefaultSubGroup,v=a.hasGeneralChat,w=a.hasIncognito,x=a.membershipApprovalMode,y=a.membershipApprovalRequest,z=a.hasAllowAdminReports,A=a.ephemeral,B=a.growthLocked,C=a.linkedParent,D=a.description,E=a.descriptionGroupInfoDescriptionMixin,F=a.namedSubjectOrUnnamedSubjectFallbackMixinGroup,G=a.participant,H=a.sT,I=a.size,J=a.groupMemberAddModeMixin,K=a.hasAllowNonAdminSubGroupCreation;a=a.hasAutoAddDisabled;if(h==null)throw c("err")("parseGroupSmax: invalid group id");F=F==null?void 0:F.value.subject;if(F==null)throw c("err")("parseGroupSmax: invalid group subject");G=G!=null?m(G):[];b=(b=x==null?void 0:(b=x.membershipApprovalGroupJoinModeEnabledMixin)==null?void 0:b.state)!=null?b:x==null?void 0:x.state;J=d("WAWebSchemaGroupMetadata").MemberAddMode.cast(J==null?void 0:(x=J.memberAddModeAdminOrAllMembersOrUnknownAddModeMixinGroup)==null?void 0:x.value.elementValue);D=(x=D==null?void 0:D.groupInfoDescriptionMixin)!=null?x:E;E=babelHelpers["extends"]({id:d("WAWebWidFactory").createWid(h+"@g.us"),owner:f!=null?d("WAWebJidToWid").userJidToUserWid(f):void 0,creation:g,restrict:Boolean(n),announce:Boolean(o),noFrequentlyForwarded:Boolean(p),support:q,suspended:r,isParentGroup:s!=null,numSubgroups:s==null?void 0:s.numSubGroups,participants:G,isParentGroupClosed:(s==null?void 0:(x=s.parentGroupDefaultMembershipApprovalModeMixin)==null?void 0:x.defaultMembershipApprovalMode)==="request_required",defaultSubgroup:u,generalSubgroup:v,incognito:w,membershipApprovalMode:b==="on",reportToAdminMode:z,membershipApprovalRequest:y,isLidAddressingMode:(e==null?void 0:e.addressingMode)==="lid",memberAddMode:J,allowNonAdminSubGroupCreation:K},D&&i(D),A&&j(A),k(B),l(C),{subject:F,subjectTime:H,size:I,generalChatAutoAddDisabled:Boolean(a),hasCapi:t});return E}function b(a){a=a.maybeChild("linked_parent");var b=a==null?void 0:a.maybeAttrGroupJid("jid");return b==null?null:{parentGroup:d("WAWebJidToWid").groupJidToWid(b),parentGroupSubject:a==null?void 0:a.maybeAttrString("subject")}}g.parseBatchGroupInfoSmax=a;g.parseGroupSmax=n;g.extractLinkedParent=b}),98); __d("WAWebGroupQueryJob",["Promise","WALogger","WASmaxGroupsBatchGetGroupInfoRPC","WASmaxGroupsGetInviteGroupInfoRPC","WASmaxGroupsGetParticipatingGroupsRPC","WAWebABProps","WAWebApiChat","WAWebApiParticipantStore","WAWebBackendApi","WAWebBackendErrors","WAWebGroupDatabaseJob","WAWebGroupGetMembershipApprovalRequestsJob","WAWebGroupQueryGroupJob","WAWebGroupsQueryApi","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupsById failed: ",":",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupsById failed: ",":",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupsById: successfully received batch group info for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryAndUpdateGroupMetadataById: skip update due to phash match"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryAndUpdateGroupMetadataById: unable to query group ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInvite failed: ",":",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInvite failed: ",":",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryAllGroups failed: ",":",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryAllGroups failed: ",":",""]);q=function(){return a};return a}function a(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebApiParticipantStore").clearAdminshipCache();var a=(yield d("WASmaxGroupsGetParticipatingGroupsRPC").sendGetParticipatingGroupsRPC({hasParticipants:!0,hasDescription:!0}));switch(a.name){case"GetParticipatingGroupsResponseSuccess":return a.value.groupsGroup.map(function(a){a=a.groupInfoOrTruncatedGroupInfoGroupInfoMixinGroup;return d("WAWebGroupsQueryApi").parseGroupSmax(a.value)});case"GetParticipatingGroupsResponseClientError":var c=a.value.errorIQErrorBadRequestOrRateOverlimitOrFallbackClientMixinGroup.value,e=c.code;c=c.text;d("WALogger").LOG(q(),e,c);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),c));case"GetParticipatingGroupsResponseServerError":e=a.value.errorServerErrors.value;c=e.code;a=e.text;d("WALogger").LOG(p(),c,a);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),a))}});return r.apply(this,arguments)}function c(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WASmaxGroupsGetInviteGroupInfoRPC").sendGetInviteGroupInfoRPC({inviteCode:a}));switch(a.name){case"GetInviteGroupInfoResponseSuccess":return d("WAWebGroupsQueryApi").parseGroupSmax(a.value.groupInviteLinkGroupInfoMixin);case"GetInviteGroupInfoResponseClientError":var c=a.value.errorGetInviteGroupInfoClientErrors.value,e=c.code;c=c.text;d("WALogger").LOG(o(),e,c);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),c));case"GetInviteGroupInfoResponseServerError":e=a.value.errorServerErrors.value;c=e.code;a=e.text;d("WALogger").LOG(n(),c,a);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),a))}});return s.apply(this,arguments)}function e(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.id,c=a.request;a=a.actionType;c=(yield d("WAWebGroupQueryGroupJob").queryGroupJob(b,c));if(c==null){d("WALogger").DEV(m(),b);return}if(c.phashMatch){d("WALogger").LOG(l());return}b=(yield d("WAWebApiParticipantStore").injectPastParticipantsFromDB([c],a));c=b[0];a=(yield d("WAWebApiChat").injectAdditionalEphemeralInfoFromDB([c]));b=a[0];yield d("WAWebGroupDatabaseJob").updateGroupParticipantTableWithoutDeviceSyncJob([b]);d("WAWebBackendApi").frontendFireAndForget("createOrUpdateGroupMetadataFromQuery",{groupInfo:b});yield u(b)});return t.apply(this,arguments)}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.membershipApprovalMode&&a.participants.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(a.id)&&a.isAdmin})&&d("WAWebABProps").getABPropConfigValue("group_join_request_m2")){var b=(yield d("WAWebApiChat").getChatRecord(a.id));if(!b)return;return d("WAWebGroupGetMembershipApprovalRequestsJob").queryAndUpdateGroupMembershipApprovalRequests(a.id)}});return v.apply(this,arguments)}function f(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield d("WASmaxGroupsBatchGetGroupInfoRPC").sendBatchGetGroupInfoRPC({queryContext:c,groupArgs:a.map(function(a){return{groupJid:a}})}));switch(e.name){case"BatchGetGroupInfoResponseSuccess":d("WALogger").LOG(k(),a.length);return d("WAWebGroupsQueryApi").parseBatchGroupInfoSmax(c,e.value.groupsGroup);case"BatchGetGroupInfoResponseClientError":a=e.value.errorBatchGetGroupInfoClientErrors.value;c=a.code;a=a.text;d("WALogger").LOG(j(),c,a);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),a));case"BatchGetGroupInfoResponseServerError":c=e.value.errorServerErrors.value;a=c.code;e=c.text;d("WALogger").LOG(i(),a,e);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),e))}});return w.apply(this,arguments)}g.queryAllGroups=a;g.queryGroupInvite=c;g.queryAndUpdateGroupMetadataById=e;g.maybeQueryAndUpdateMembershipApprovalRequests=u;g.queryGroupsById=f}),98); __d("WAWebSignalConst",[],(function(a,b,c,d,e,f){a={REG_ID:"signal_reg_id",STATIC_PUBKEY:"signal_static_pubkey",STATIC_PRIVKEY:"signal_static_privkey",NEXT_PK_ID:"signal_next_pk_id",LAST_SPK_ID:"signal_last_spk_id",FIRST_UNUPLOAD_PK_ID:"signal_first_unupload_pk_id",SERVER_HAS_KEY:"signal_sever_has_pre_keys",ADV_SIGNED_IDENTITY:"adv_signed_identity"};f.META_KEYS=a}),66); __d("WAWebSignalStorageUtils",["invariant","Promise","WAWebIdb","WAWebStorage","err"],(function(a,b,c,d,e,f,g,h){var i,j="signal-storage",k=null;function a(){var a=new(c("WAWebIdb"))(j);k=new(d("WAWebStorage").Storage)(a)}function e(){k!=null||h(0,56356);return k}function f(){return k==null?(i||(i=b("Promise"))).reject(c("err")("[signal-storage] Storage should be created first before being destroyed")):k.purge().then(function(){k=null})["catch"](function(a){k=null;throw a})}g.DATABASE_NAME=j;g.createStorage=a;g.getStorage=e;g.destroyStorage=f}),98); __d("WAWebSignalStorageVersions",["WAWebSignalStorageUtils"],(function(a,b,c,d,e,f,g){var h=6;function a(){return d("WAWebSignalStorageUtils").getStorage().versions.version(0)}function b(){return d("WAWebSignalStorageUtils").getStorage().versions.version(1)}function c(){return d("WAWebSignalStorageUtils").getStorage().versions.version(2)}function e(){return d("WAWebSignalStorageUtils").getStorage().versions.version(3)}function f(){return d("WAWebSignalStorageUtils").getStorage().versions.version(4)}function i(){return d("WAWebSignalStorageUtils").getStorage().versions.version(5)}function j(){return d("WAWebSignalStorageUtils").getStorage().versions.version(6)}g.versionToRollout=h;g.identityCreateTable=a;g.metaCreateTable=b;g.preKeyCreateTable=c;g.sessionCreateTable=e;g.signedPreKeyCreateTable=f;g.baseKeyCreateTable=i;g.senderKeyCreateTable=j}),98); __d("WAWebSchemaBasekey",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey,j=c.addCompositeIndex;function a(){d("WAWebSignalStorageUtils").getStorage().add("baseKey-store").version(d("WAWebSignalStorageVersions").baseKeyCreateTable(),[i("id"),h("address"),h("originalMsgId"),h("baseKey"),j(["address","originalMsgId"])]).view(function(a){return{id:a.id,address:a.address,originalMsgId:a.originalMsgId,baseKey:a.baseKey}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("baseKey-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaIdentity",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addUserDefinedPrimaryKey;function a(){d("WAWebSignalStorageUtils").getStorage().add("identity-store").version(d("WAWebSignalStorageVersions").identityCreateTable(),[i("identifier"),h("identityKey"),h("rowId"),h("sentAddonRowId")]).view(function(a){return{identifier:a.identifier,identityKey:a.identityKey,rowId:a.rowId,sentAddonRowId:a.sentAddonRowId}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("identity-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaMeta",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addUserDefinedPrimaryKey;function a(){d("WAWebSignalStorageUtils").getStorage().add("signal-meta-store").version(d("WAWebSignalStorageVersions").metaCreateTable(),[i("key"),h("value")]).view(function(a){return{key:a.key,value:a.value}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("signal-meta-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaPrekey",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey;function a(){d("WAWebSignalStorageUtils").getStorage().add("prekey-store").version(d("WAWebSignalStorageVersions").preKeyCreateTable(),[i("keyId"),h("keyPair"),h("isDirectDistribution")]).view(function(a){return{keyId:a.keyId,keyPair:a.keyPair,isDirectDistribution:a.isDirectDistribution}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("prekey-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaSenderkey",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addUserDefinedPrimaryKey,j=c.addIndex;function a(){d("WAWebSignalStorageUtils").getStorage().add("senderkey-store").version(d("WAWebSignalStorageVersions").senderKeyCreateTable(),[i("senderKeyName"),h("senderKey"),h("senderId"),j("senderId")]).view(function(a){return{senderKeyName:a.senderKeyName,senderKey:a.senderKey,senderId:a.senderId}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("senderkey-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaSession",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addUserDefinedPrimaryKey;function a(){d("WAWebSignalStorageUtils").getStorage().add("session-store").version(d("WAWebSignalStorageVersions").sessionCreateTable(),[i("address"),h("session")]).view(function(a){return{address:a.address,session:a.session}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("session-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSchemaSignedPrekey",["WAWebSignalStorageUtils","WAWebSignalStorageVersions","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey;function a(){d("WAWebSignalStorageUtils").getStorage().add("signed-prekey-store").version(d("WAWebSignalStorageVersions").signedPreKeyCreateTable(),[i("keyId"),h("keyPair"),h("signature")]).view(function(a){return{keyId:a.keyId,keyPair:a.keyPair,signature:a.signature}})}function b(){return d("WAWebSignalStorageUtils").getStorage().table("signed-prekey-store")}g.addTable=a;g.getTable=b}),98); __d("WAWebSignalStorage",["WALogger","WAWeb-dexie","WAWebDbRolloutUtil","WAWebDexieCastTypes","WAWebSchemaBasekey","WAWebSchemaIdentity","WAWebSchemaMeta","WAWebSchemaPrekey","WAWebSchemaSenderkey","WAWebSchemaSession","WAWebSchemaSignedPrekey","WAWebSignalStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);h=function(){return a};return a}var i;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){i==null&&(yield d("WAWebDbRolloutUtil").loadSchemaVersions(),d("WAWebSignalStorageUtils").createStorage(),d("WAWebSchemaBasekey").addTable(),d("WAWebSchemaIdentity").addTable(),d("WAWebSchemaMeta").addTable(),d("WAWebSchemaPrekey").addTable(),d("WAWebSchemaSenderkey").addTable(),d("WAWebSchemaSession").addTable(),d("WAWebSchemaSignedPrekey").addTable(),i=d("WAWebSignalStorageUtils").getStorage().initialize()["catch"](function(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("Failed to initialize signal storage",{sendLogsType:d("WALogger").SendLogsType.CRASH_OR_UNRECOVERABLE_ERROR_SAD});throw a}));return i});return j.apply(this,arguments)}function e(){return d("WAWebSignalStorageUtils").destroyStorage()["catch"](function(){return d("WAWebDexieCastTypes").dexieCastToPromise(new(c("WAWeb-dexie"))(d("WAWebSignalStorageUtils").DATABASE_NAME)["delete"]())})["finally"](function(){i=null})}g.getBaseKeyTable=d("WAWebSchemaBasekey").getTable;g.getIdentityTable=d("WAWebSchemaIdentity").getTable;g.getMetaTable=d("WAWebSchemaMeta").getTable;g.getPreKeyTable=d("WAWebSchemaPrekey").getTable;g.getSenderKeyTable=d("WAWebSchemaSenderkey").getTable;g.getSessionTable=d("WAWebSchemaSession").getTable;g.getSignedPreKeyTable=d("WAWebSchemaSignedPrekey").getTable;g.initialize=a;g.destroy=e}),98); __d("WAWebSignalStoreApi",["Promise","WALogger","WAWebNoop","WAWebSignalCommonUtils","WAWebSignalConst","WAWebSignalStorage","WAWebSignalStorageUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPreKeys: no prekey needs to be generated, available: ",", need: ",""]);i=function(){return a};return a}var j=1;a=function(){function a(){this.idToSignedPreKey=new Map()}var e=a.prototype;e.getMeta=function(a){var b=d("WAWebSignalStorage").getMetaTable();return b.get(a).then(function(a){return a?a.value:null})};e.putMeta=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebSignalStorage").getMetaTable();a=a.map(function(a){return c.createOrReplace(a)});yield (h||(h=b("Promise"))).all(a)});function c(b){return a.apply(this,arguments)}return c}();e.setServerHasPreKeys=function(a){this.putMeta([{key:d("WAWebSignalConst").META_KEYS.SERVER_HAS_KEY,value:a}])};e.getServerHasPreKeys=function(){return this.getMeta(d("WAWebSignalConst").META_KEYS.SERVER_HAS_KEY)};e.putADVSignedIdentity=function(a){return this.putMeta([{key:d("WAWebSignalConst").META_KEYS.ADV_SIGNED_IDENTITY,value:a}])};e.getADVSignedIdentity=function(){return this.getMeta(d("WAWebSignalConst").META_KEYS.ADV_SIGNED_IDENTITY)};e.getPreKeysByRange=function(a,b){var c=d("WAWebSignalStorage").getPreKeyTable();return c.greaterThan(["keyId"],a-1,{limit:b})};e.getPreKeyById=function(a){var b=d("WAWebSignalStorage").getPreKeyTable();return b.get(a)};e.removePreKeyById=function(a){var b=d("WAWebSignalStorage").getPreKeyTable();return b.remove(a)};e.bulkRemovePreKey=function(a){var b=d("WAWebSignalStorage").getPreKeyTable();return b.bulkRemove(a)};e.putPreKeys=function(a){var b=d("WAWebSignalStorage").getPreKeyTable();return b.bulkCreateOrReplace(a)};e.markPreKeyAsDirectDistribution=function(a){var b=d("WAWebSignalStorage").getPreKeyTable();return b.merge(a,{isDirectDistribution:1})};e.getSignedPreKey=function(){var a=this;return this.getMeta(d("WAWebSignalConst").META_KEYS.LAST_SPK_ID).then(function(b){return a.getSignedPreKeyById(b)})};e.getSignedPreKeyById=function(a){var c=this;if(this.idToSignedPreKey.has(a))return(h||(h=b("Promise"))).resolve(this.idToSignedPreKey.get(a));var e=d("WAWebSignalStorage").getSignedPreKeyTable();return e.get(a).then(function(b){c.idToSignedPreKey.set(a,b);return b})};e.putSignedPreKeys=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=d("WAWebSignalStorage").getSignedPreKeyTable();a=a.map(function(a){var b=a.keyId,d=a.keyPair,f=a.signature;return e.get(b).then(function(a){if(a)throw c("err")("signed preKey id "+b+" already exists");else{a={keyId:b,keyPair:d,signature:f};return e.create(a)}})});yield (h||(h=b("Promise"))).all(a)});function e(b){return a.apply(this,arguments)}return e}();e.putSession=function(a,b){var c=d("WAWebSignalStorage").getSessionTable();return c.createOrReplace({address:a,session:b})};e.bulkPutSession=function(a){var b=d("WAWebSignalStorage").getSessionTable();return b.bulkCreateOrReplace(a)};e.removeSession=function(a){var b=d("WAWebSignalStorage").getSessionTable();return b.remove(a)};e.bulkRemoveSession=function(a){var b=d("WAWebSignalStorage").getSessionTable();return b.bulkRemove(a)};e.getSession=function(a){var b=d("WAWebSignalStorage").getSessionTable();return b.get(a).then(function(a){return a?a.session:null})};e.bulkGetSession=function(a){var b=d("WAWebSignalStorage").getSessionTable();return b.bulkGet(a).then(function(a){return a.map(function(a){return a?a.session:null})})};e.putIdentity=function(a,b){var c=d("WAWebSignalStorage").getIdentityTable();return c.createOrReplace({identifier:a,identityKey:b})};e.bulkPutIdentity=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.bulkCreateOrReplace(a)};e.bulkGetIdentity=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.bulkGet(a).then(function(a){return a.map(function(a){return a?a.identityKey:null})})};e.getIdentity=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.get(a).then(function(a){return a?a.identityKey:null})};e.removeIdentity=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.remove(a)};e.bulkRemoveIdentity=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.bulkRemove(a)};e.getIdentityKeyWithRowId=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.get(a).then(function(a){return a?{identityKey:a.identityKey,rowId:a.rowId,sentAddonRowId:a.sentAddonRowId}:null})};e.bulkGetIdentityKeyWithRowId=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.bulkGet(a).then(function(a){return a.map(function(a){return a?{identityKey:a.identityKey,rowId:a.rowId}:null})})};e.bulkPutIdentityKeyWithRowId=function(a){var b=d("WAWebSignalStorage").getIdentityTable();return b.bulkCreateOrReplace(a)};e.saveBaseKey=function(a,b,c){var e=d("WAWebSignalStorage").getBaseKeyTable();return e.createOrReplace({address:a,originalMsgId:b,baseKey:c})};e.loadBaseKey=function(a,b){var c=d("WAWebSignalStorage").getBaseKeyTable();return c.equals(["address","originalMsgId"],[a,b]).then(function(a){return a&&a.length!==0?a[0].baseKey:null})};e.deleteBaseKey=function(a,b){var c=d("WAWebSignalStorage").getBaseKeyTable();return c.equals(["address","originalMsgId"],[a,b]).then(function(a){if(a&&a.length!==0)return c.remove(a[0].id)})};e.putSenderKey=function(a,b,c){var e=d("WAWebSignalStorage").getSenderKeyTable();return e.createOrReplace({senderKeyName:a,senderId:b,senderKey:c})};e.bulkPutSenderKey=function(a){var b=d("WAWebSignalStorage").getSenderKeyTable();return b.bulkCreateOrReplace(a)};e.removeSenderKey=function(a){var b=d("WAWebSignalStorage").getSenderKeyTable();return b.remove(a)};e.getSenderKey=function(a){var b=d("WAWebSignalStorage").getSenderKeyTable();return b.get(a).then(function(a){return a?a.senderKey:null})};e.removeSenderKeyBySenderId=function(a){var b=d("WAWebSignalStorage").getSenderKeyTable();return b.equals(["senderId"],a).then(function(a){return b.bulkRemove(a.map(function(a){return a.senderKeyName}))})};e.clearCredential=function(){var a;a=[(a=d("WAWebSignalStorage")).getIdentityTable(),a.getMetaTable(),a.getPreKeyTable(),a.getSessionTable(),a.getSignedPreKeyTable()];return(h||(h=b("Promise"))).all(a.map(function(a){return a.clear()})).then(c("WAWebNoop"))};e.getRegistrationInfo=function(){var a=this;return this.registrationInfo!=null?(h||(h=b("Promise"))).resolve(this.registrationInfo):(h||(h=b("Promise"))).all([this.getMeta(d("WAWebSignalConst").META_KEYS.REG_ID),this.getMeta(d("WAWebSignalConst").META_KEYS.STATIC_PUBKEY),this.getMeta(d("WAWebSignalConst").META_KEYS.STATIC_PRIVKEY)]).then(function(c){var e=c[0],f=c[1];c=c[2];if(!e||!f||!c)return;return(h||(h=b("Promise"))).all([d("WAWebSignalCommonUtils").decryptRegistrationMaterial(f),d("WAWebSignalCommonUtils").decryptRegistrationMaterial(c)]).then(function(b){var c=b[0];b=b[1];a.registrationInfo={registrationId:e,identityKeyPair:{pubKey:c,privKey:b}};return a.registrationInfo})})};e.setRegistrationInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this;yield (h||(h=b("Promise"))).all([d("WAWebSignalCommonUtils").encryptRegistrationMaterial(a.identityKeyPair.pubKey),d("WAWebSignalCommonUtils").encryptRegistrationMaterial(a.identityKeyPair.privKey)]).then(function(e){var f=e[0];e=e[1];return(h||(h=b("Promise"))).all([c.putMeta([{key:d("WAWebSignalConst").META_KEYS.REG_ID,value:a.registrationId},{key:d("WAWebSignalConst").META_KEYS.STATIC_PUBKEY,value:f},{key:d("WAWebSignalConst").META_KEYS.STATIC_PRIVKEY,value:e}])])})});function c(b){return a.apply(this,arguments)}return c}();e.getOrGenPreKeys=function(a,c){var e=this;return d("WAWebSignalStorageUtils").getStorage().lock(["signal-meta-store","prekey-store"],function(){return(h||(h=b("Promise"))).all([e.getMeta(d("WAWebSignalConst").META_KEYS.FIRST_UNUPLOAD_PK_ID),e.getMeta(d("WAWebSignalConst").META_KEYS.NEXT_PK_ID)]).then(function(f){var g=f[0];f=f[1];var l=g?g:j;g=f?f:j;f=g-l;var m=a-f;if(m<=0){d("WALogger").LOG(i(),f,a);return e.getPreKeysByRange(l,a)}f=k(g,g+m).map(function(a){return c(a)});return(h||(h=b("Promise"))).all(f).then(function(a){return e.savePreKeys(a)}).then(function(){return e.getPreKeysByRange(l,a)})})})};e.getOrGenSinglePreKey=function(a){return this.getOrGenPreKeys(1,a).then(function(a){if(a.length!==1)throw c("err")("Expected to get exactly one key but got "+a.length);return a[0]})};e.savePreKeys=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var c=a[a.length-1];yield (h||(h=b("Promise"))).all([this.putMeta([{key:d("WAWebSignalConst").META_KEYS.NEXT_PK_ID,value:c.keyId+1}]),this.putPreKeys(a)])});function c(b){return a.apply(this,arguments)}return c}();e.markKeyAsUploaded=function(a){var e=this;return(h||(h=b("Promise"))).all([this.getMeta(d("WAWebSignalConst").META_KEYS.FIRST_UNUPLOAD_PK_ID),this.getMeta(d("WAWebSignalConst").META_KEYS.NEXT_PK_ID)]).then(function(b){var f=b[0];b=b[1];if(a<0||!b||a>=b)throw c("err")("markKeyAsUploaded: key "+a+" is out of boundary.");b=f?Math.max(f,a+1):a+1;return e.putMeta([{key:d("WAWebSignalConst").META_KEYS.FIRST_UNUPLOAD_PK_ID,value:b}])})};e.rotateSignedPreKey=function(a,b){var c=this;return d("WAWebSignalStorageUtils").getStorage().lock(["signal-meta-store","signed-prekey-store"],function(){return c.getMeta(d("WAWebSignalConst").META_KEYS.LAST_SPK_ID).then(function(e){var f=e==null?j:e+1;return b(a,f).then(function(a){c.putSignedPreKeys([a]);c.putMeta([{key:d("WAWebSignalConst").META_KEYS.LAST_SPK_ID,value:f}]);return a})})})};return a}();function k(a,b){var c=[];for(a=a;a<b;a++)c.push(a);return c}e=new a();g.waSignalStore=e}),98); __d("WAWebDigestKeyJob",["Promise","WABase64","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebSignalStoreApi","WAWebUploadPreKeysJob","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateLocalKeyBundle: success"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["digestKey: validate key bundle failed, upload prekeys again"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["digestKey: server error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["digestKey: service unavailable"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["digestKey: malformed request"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["digestKey: no record found for current user"]);n=function(){return a};return a}var o=32,p=new(c("WADeprecatedWapParser"))("digestResponseParser",function(a){a=a.child("digest");var b=a.child("skey");return{regId:a.child("registration").contentUint(4),type:a.child("type").contentUint(1),identity:a.child("identity").contentBytes(32),skey:{id:b.child("id").contentUint(3),pubkey:b.child("value").contentBytes(32),signature:b.child("signature").contentBytes(64)},keys:a.child("list").mapChildren(function(a){return a.contentUint(3)}),hash:a.child("hash").contentBytes(20)}});function a(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;a=(a=d("WAWap")).wap("iq",{xmlns:"encrypt",type:"get",to:a.S_WHATSAPP_NET,id:a.generateId()},a.wap("digest",null));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,p));var b;if(a.success)try{yield r(a.result),b=!1}catch(a){b=!1}else{a=a.errorCode;a===404?(d("WALogger").WARN(n()),b=!0):a===406?(d("WALogger").WARN(m()),b=!1):a===503?(d("WALogger").WARN(l()),b=!1):(d("WALogger").WARN(k(),a),b=!1)}if(b!=null&&b){d("WALogger").LOG(j());return d("WAWebUploadPreKeysJob").uploadPreKeys()}});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo(),d("WAWebSignalStoreApi").waSignalStore.getSignedPreKey()])),f=e[0];e=e[1];if(!f||!e)throw c("err")("validateLocalKeyBundle: No registration info is available");if(a.regId!==f.registrationId)throw c("err")("validateLocalKeyBundle: registation id mismatch");f=f.identityKeyPair.pubKey;var g=e.keyPair.pubKey,j=f.byteLength+g.byteLength+e.signature.byteLength+a.keys.length*o,k=new Uint8Array(j),l=0;[f,g,e.signature].forEach(function(a){k.set(new Uint8Array(a),l),l+=a.byteLength});j=a.keys.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSignalStoreApi").waSignalStore.getPreKeyById(a));if(!b)throw c("err")("validateLocalKeyBundle: missing prekey record for id "+a);return b.keyPair.pubKey});return function(b){return a.apply(this,arguments)}}());f=(yield h.all(j));f.forEach(function(a){k.set(new Uint8Array(a),l),l+=a.byteLength});g=(yield self.crypto.subtle.digest("SHA-1",k));e=d("WABase64").encodeB64(g);j=d("WABase64").encodeB64(a.hash);if(e!==j)throw c("err")("validateLocalKeyBundle: hash mismatch remote:"+j+" local:"+e);d("WALogger").LOG(i())});return s.apply(this,arguments)}g.digestKey=a}),98); __d("WAWebGetIdentityKeysJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebCommsWapMd","WAWebCryptoCurve25519","WAWebJidToWid","WAWebSignalCommonUtils","WAWebSignalProtocolStore","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getAndStoreIdentityKeys: query "," missing keys for "," contacts"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getAndStoreIdentityKeys: got 0 missing keys"]);i=function(){return a};return a}var j=new(c("WADeprecatedWapParser"))("identityKeysParser",function(a){return a.child("list").mapChildren(function(a){if(a.hasChild("error")){var b=a.child("error"),e=b.attrInt("code");b=b.attrString("text");throw c("err")("identityKeysParser bad response: "+e+" "+b)}else return{type:a.child("type").contentBytes(1),identity:a.child("identity").contentBytes(32),user:d("WAWebJidToWid").deviceJidToDeviceWid(a.attrDeviceJid("jid"))}})});function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkLoadIdentityKey(a.map(function(a){return String(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a))}))),c=a.filter(function(a,c){return b[c]==null});if(c.length===0){d("WALogger").LOG(i());return}d("WALogger").LOG(h(),c.length,a.length);a=(yield l(c));c=a.map(function(a){var b=a.identity;b=d("WAWebCryptoCurve25519").toSignalCurvePubKey(b.buffer.slice(b.byteOffset,b.byteLength+b.byteOffset));b=d("WAWebSignalCommonUtils").bufferToStr(b);a=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a.user);return{identityKey:b,identifier:a.toString()}});return d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkCreateIdentity(c)});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.map(function(a){return d("WAWap").wap("user",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)})});b=(b=d("WAWap")).wap("iq",{xmlns:"encrypt",type:"get",to:b.S_WHATSAPP_NET,id:b.generateId()},b.wap("identity",null,a));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,j));if(!a.success)throw c("err")("getIdentityKeys bad response "+String(a));return a.result});return m.apply(this,arguments)}g.getAndStoreIdentityKeys=a}),98); __d("WAWebRotateKeyJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebCryptoCurve25519","WAWebDefinePersistedJob","WAWebDigestKeyJob","WAWebSignalKeyApi","WAWebSignalStoreApi","WAWebSignalUtilsApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["rotateKey unrecognized error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["rotateKey server error ",", wait a day"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["skey does not pass server validation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["rotateKey generated bad key"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["rotateKey: signedPreKey uploading"]);l=function(){return a};return a}var m=new(c("WADeprecatedWapParser"))("rotateKeyResponseParser",function(a){a.assertFromServer()});a=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("uploadKeys",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo().then(function(a){if(!a)throw c("err")("No registration info is available");return d("WAWebSignalStoreApi").waSignalStore.rotateSignedPreKey(d("WAWebCryptoCurve25519").toSignalCurveKeyPair(a.identityKeyPair),d("WAWebSignalKeyApi").generateSignedKeyPair)}));d("WALogger").LOG(l());a=(a=d("WAWap")).wap("iq",{xmlns:"encrypt",type:"set",to:a.S_WHATSAPP_NET,id:a.generateId()},a.wap("rotate",null,d("WAWebSignalUtilsApi").xmppSignedPreKey(b)));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,m));if(b.success)return{shouldDigestKey:!1};a=!1;b=b.errorCode;b===406?d("WALogger").WARN(k()):b===409?(d("WALogger").WARN(j()),a=!0):b>=500?d("WALogger").LOG(i(),b):(d("WALogger").LOG(h(),b),a=!0);return{shouldDigestKey:a}})).finalStep("maybeDigestKey",function(a){a=a.shouldDigestKey;if(a)return d("WAWebDigestKeyJob").digestKey()}).end();g.rotateKey=a}),98); __d("WAWebUploadPreKeysJob",["Promise","WAComms","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAPromiseRetryLoop","WAWap","WAWebConstantsDeprecated","WAWebSignalKeyApi","WAWebSignalStoreApi","WAWebSignalUtilsApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: disconnected, unclear if on server: "," (count: ",", size: ","b)"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: unrecognized error "," (count: ",", size: ","b)"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: uploaded invalid keys (count: ",", size: ","b)"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: server requested backoff "," (count: ",", size: ","b)"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: "," keys uploaded, raw stanza size: ","b"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadPreKeys: retrying (after delay)"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadPreKeys: done"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadPreKeys: running"]);p=function(){return a};return a}var q=812,r={error:!1,result:!0},s=new(c("WADeprecatedWapParser"))("uploadPreKeyResParser",function(a){a.assertTag("iq");a.assertFromServer();var b=a.attrEnum("type",r);if(b)return{success:!0};b=a.child("error");return{errorCode:b.attrInt("code"),errorText:b.hasAttr("text")?b.attrString("text"):""}});function t(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo(),d("WAWebSignalStoreApi").waSignalStore.getSignedPreKey()])),e=a[0],f=a[1];if(!e||!f)throw c("err")("No signal info is available");var g=e.registrationId,n=e.identityKeyPair;a=(yield d("WAWebSignalStoreApi").waSignalStore.getOrGenPreKeys(q,d("WAWebSignalKeyApi").generatePreKeyPair).then(function(a){if(a.length===0)throw c("err")("No preKey is available");return[d("WAWap").wap("iq",{id:d("WAWap").generateId(),xmlns:"encrypt",type:"set",to:d("WAWap").S_WHATSAPP_NET},d("WAWap").wap("registration",null,d("WAWap").BIG_ENDIAN_CONTENT(g)),d("WAWap").wap("type",null,c("WAWebConstantsDeprecated").KEY_BUNDLE_TYPE),d("WAWap").wap("identity",null,n.pubKey),d("WAWap").wap("list",null,a.map(d("WAWebSignalUtilsApi").xmppPreKey)),d("WAWebSignalUtilsApi").xmppSignedPreKey(f)),a[a.length-1].keyId]}));var o=a[0],p=a[1];try{e=(yield d("WAComms").waitForConnection().then(function(){return d("WAWebSignalStoreApi").waSignalStore.markKeyAsUploaded(p)}).then(function(){return d("WADeprecatedSendIq").deprecatedSendIqWithoutRetry(o,s)}));if(e.success){d("WAWebSignalStoreApi").waSignalStore.setServerHasPreKeys(!0);d("WALogger").LOG(m(),q,o.toString().length);return{success:!0}}a=e.errorCode;a>=500?d("WALogger").WARN(l(),a,q,o.toString().length):a===406?d("WALogger").WARN(k(),q,o.toString().length):d("WALogger").WARN(j(),a,q,o.toString().length);return{errorCode:e.errorCode,errorText:e.errorText}}catch(a){d("WALogger").WARN(i(),a,q,o.toString().length);return}});return u.apply(this,arguments)}var v={algo:{type:"fibonacci",first:1e3,second:2e3},max:61e4};function a(){var a=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"uploadPreKeys",timer:v,code:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(p());var b=(yield t());(b==null?void 0:b.success)===!0?(d("WALogger").LOG(o()),a()):d("WALogger").LOG(n())});function c(b){return a.apply(this,arguments)}return c}()});a.start();return a.promise()}g.UPLOAD_KEYS_COUNT=q;g.uploadPreKeyResParser=s;g.uploadPreKeys=a}),98); __d("WAWebSendAggregateDeliveryReceipts",["$InternalEnum","Promise","WAWebBackendApi","WAWebCmd","WAWebDBMsgUtils","WAWebHandleMsgMetaUtils","WAWebMsgProcessingApiUtils","WAWebPollsVotesSchema","WAWebSchemaReactions","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=b("$InternalEnum").Mirrored(["Message","Reaction","PollVote","NotSupportedAddon"]),j=function(a){if(a.hasHideFailEnc){if(d("WAWebHandleMsgMetaUtils").isPollVoteMsgMeta(a.msgMeta))return i.PollVote;return d("WAWebHandleMsgMetaUtils").isReactionMsgMeta(a.msgMeta)?i.Reaction:i.NotSupportedAddon}return i.Message};function k(a){var b=new Map();a.forEach(function(a){var c,d=j(a);c=(c=b.get(d))!=null?c:b.set(d,[]).get(d);c==null?void 0:c.push(a)});return b}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=a.map(function(a){a=a.msgInfo;return d("WAWebMsgProcessingApiUtils").messageInfoToKey(a)});b=d("WAWebCmd").Cmd.isMainStreamReadyMd?yield b(a):a.map(function(){return!1});var e=new Set(),f=[];for(b of b.entries()){var g=b[0],h=b[1];h?e.add(a[g].toString()):f.push(a[g].toString())}if(f.length===0)return e;h=(yield c(f));return new Set([].concat(Array.from(e),Array.from(h)))});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){switch(a){case i.Message:return l(c,function(a){return d("WAWebBackendApi").frontendSendAndReceive("hasMsgsInCollection",{msgKeys:a})},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set();return d("WAWebDBMsgUtils").getMsgsExistByMsgKey(a).then(function(c){for(c of c.entries()){var d=c[0],e=c[1];e&&b.add(a[d])}return b})});return function(b){return a.apply(this,arguments)}}());case i.Reaction:return l(c,function(a){return d("WAWebBackendApi").frontendSendAndReceive("hasReactionsInCollection",{msgKeys:a})},function(a){var b=new Set();return d("WAWebSchemaReactions").getReactionsTable().anyOf(["msgKey"],a).then(function(a){for(a of a)b.add(a.msgKey);return b})});case i.PollVote:return l(c,function(a){return d("WAWebBackendApi").frontendSendAndReceive("hasPollVotesInCollection",{msgKeys:a})},function(a){return d("WAWebPollsVotesSchema").getTable().anyOf(["msgKey"],a,{shouldDecrypt:!1}).then(function(a){var b=new Set();for(a of a)b.add(a.msgKey);return b})});case i.NotSupportedAddon:a=new Set();for(c of c){var e=c.msgInfo;a.add(d("WAWebMsgProcessingApiUtils").messageInfoToKey(e).toString())}return a}});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a=a[1];var c=[],e=[];for(a of a)a.msgReceivedTimes>1?c.push({isInDB:!0,receipt:a}):e.push(a);if(e.length>0){var f=(yield n(b,e));c=c.concat(e.map(function(a){return{isInDB:f.has(d("WAWebMsgProcessingApiUtils").messageInfoToKey(a.msgInfo).toString()),receipt:a}}))}return c});return q.apply(this,arguments)}function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;a=k(a);a=(yield (h||(h=b("Promise"))).all(Array.from(a.entries()).map(p)));return(c=[]).concat.apply(c,a)});return r.apply(this,arguments)}g.aggregateDeliveryReceipts=a}),98); __d("WAWebUnknownStanzaWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({UnknownStanza:[3448,{unknownStanzaTag:[1,d("WAWebWamCodegenUtils").TYPES.STRING],unknownStanzaType:[2,d("WAWebWamCodegenUtils").TYPES.STRING]},[1,1,1],"regular"]},{UnknownStanza:[]});g.UnknownStanzaWamEvent=a}),98); __d("WAWebPostUnknownStanzaMetric",["WAWebUnknownStanzaWamEvent"],(function(a,b,c,d,e,f,g){function a(a){new(d("WAWebUnknownStanzaWamEvent").UnknownStanzaWamEvent)({unknownStanzaTag:a.tag,unknownStanzaType:(a=a.attrs.type)==null?void 0:a.toString()}).commit()}g.postUnknownStanzaMetric=a}),98); __d("WAWebCreateNackFromStanza",["$InternalEnum","WALogger","WAWap","WAWebPostUnknownStanzaMetric"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendNack called with unsupported stanza tag: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["createNackFromStanza: failed with unhandled reason: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["createNackFromStanza: failed for class: '","' type: '","' id: '","' reason: '","'"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["createNackFromStanza: failed: 'id' or 'form' is null for class: '","' type: '","' reason: '","'"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["createNackFromStanza: class: '","' type: '","' id: '","' reason: '","'"]);l=function(){return a};return a}var m=b("$InternalEnum")({StaleGroupAddressingMode:421,ParsingError:487,UnrecognizedStanza:488,UnrecognizedStanzaClass:489,UnrecognizedStanzaType:490,InvalidProtobuf:491,InvalidHostedCompanionStanza:493,MissingMessageSecret:495,SignalErrorOldCounter:496,MessageDeletedOnPeer:499,UnhandledError:500,UnsupportedAdminRevoke:550,UnsupportedLIDGroup:551,DBOperationFailed:552});function a(a,b){var c,e,f=a==null?void 0:a.tag;c=a==null?void 0:(c=a.attrs)==null?void 0:c.id;e=a==null?void 0:(e=a.attrs)==null?void 0:(e=e.type)==null?void 0:e.toString();var g=m.getName(b);try{var h;d("WALogger").LOG(l(),f,e,c,g);if(c!=null&&(a==null?void 0:(h=a.attrs)==null?void 0:h.from)!=null)return n(a,b);d("WALogger").ERROR(k(),f,e,g);d("WAWebPostUnknownStanzaMetric").postUnknownStanzaMetric(a)}catch(a){d("WALogger").ERROR(j(),f,e,c,g);d("WALogger").ERROR(i(),(h=a.message)!=null?h:a).sendLogs("send-nack-exception")}return"NO_ACK"}function n(a,b){var c=a.attrs;if(b===m.UnrecognizedStanza)return d("WAWap").wap("ack",{"class":a.tag,id:c.id,to:c.from,type:c.type||d("WAWap").DROP_ATTR,participant:c.participant||d("WAWap").DROP_ATTR,error:d("WAWap").INT(b)});switch(a.tag){case"notification":return d("WAWap").wap("ack",{"class":"notification",id:c.id,to:c.from,type:c.type||d("WAWap").DROP_ATTR,participant:c.participant||d("WAWap").DROP_ATTR,error:d("WAWap").INT(b)});case"message":return d("WAWap").wap("ack",{"class":"message",id:c.id,to:c.from,type:c.type||d("WAWap").DROP_ATTR,participant:c.participant||d("WAWap").DROP_ATTR,error:d("WAWap").INT(b)});case"receipt":return d("WAWap").wap("ack",{"class":"receipt",id:c.id,to:c.from,type:c.type||d("WAWap").DROP_ATTR,participant:c.participant||d("WAWap").DROP_ATTR,error:d("WAWap").INT(b)});default:d("WALogger").WARN(h(),a.tag).sendLogs("unsupported-nack");d("WAWebPostUnknownStanzaMetric").postUnknownStanzaMetric(a);return"NO_ACK"}}g.NackReason=m;g.createNackFromStanza=a}),98); __d("WAWebHandleMsgSendAck",["WADeprecatedSendIq","WALogger","WAWap","WAWebABProps","WAWebCommsWapMd","WAWebCreateNackFromStanza","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendNack: InvalidProtobuf error is missing e2eFailureReason"]);h=function(){return a};return a}function a(a,b,c,e){d("WADeprecatedSendIq").deprecatedCastStanza(d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a),"class":"message",from:d("WAWebCommsWapMd").DEVICE_JID(d("WAWebUserPrefsMeUser").assertGetMe()),to:b?d("WAWebCommsWapMd").JID(b):d("WAWap").DROP_ATTR,participant:e?d("WAWebCommsWapMd").DEVICE_JID(e):d("WAWap").DROP_ATTR,type:(a=c)!=null?a:d("WAWap").DROP_ATTR}))}function b(a,b,c,e,f,g){var i=null;d("WAWebABProps").getABPropConfigValue("send_invalid_protobuf_nack_failure_reason")&&f===d("WAWebCreateNackFromStanza").NackReason.InvalidProtobuf&&(g!=null?i=d("WAWap").wap("meta",{failure_reason:d("WAWap").INT(g)}):d("WALogger").ERROR(h()).sendLogs("invalid-protobuf-nack-missing-failure-reason"));d("WADeprecatedSendIq").deprecatedCastStanza(d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a),"class":"message",from:d("WAWebCommsWapMd").DEVICE_JID(d("WAWebUserPrefsMeUser").assertGetMe()),to:b?d("WAWebCommsWapMd").JID(b):d("WAWap").DROP_ATTR,participant:e?d("WAWebCommsWapMd").DEVICE_JID(e):d("WAWap").DROP_ATTR,type:(g=c)!=null?g:d("WAWap").DROP_ATTR,error:d("WAWap").INT(f)},i))}g.sendAck=a;g.sendNack=b}),98); __d("WAWebPendingMessageKey",[],(function(a,b,c,d,e,f){function a(a,b,c){c=c.map(function(a){return String(a.e2eType)+":"+a.retryCount}).join(",");return a.toString()+"_"+b.toString()+"_"+c}f.createPendingMessageKey=a}),66); __d("WAWebMessageDedupUtils",["WALogger","WAWebABProps","WAWebPendingMessageKey"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-dedup] message cache cleared, total: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-dedup] message "," is pending, total: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-dedup] add message: ",", total: ",""]);j=function(){return a};return a}var k=new Map();function a(){return d("WAWebABProps").getABPropConfigValue("web_pending_message_cache_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("web_message_dedup_enabled")}function c(a,b,c){a=d("WAWebPendingMessageKey").createPendingMessageKey(a,b,c);c=((b=k.get(a))!=null?b:0)+1;k.set(a,c);d("WALogger").LOG(j(),a,c);return c}function e(a,b,c){a=d("WAWebPendingMessageKey").createPendingMessageKey(a,b,c);b=k.get(a);if(b==null)return!1;d("WALogger").LOG(i(),a,b);return!0}function f(a){a===0&&(k.size>0&&d("WALogger").LOG(h(),k.size),k.clear())}g.isPengingMessageCacheEnabled=a;g.isMessageDedupEnabled=b;g.addPendingMessage=c;g.hasPendingMessage=e;g.maybeClearPendingMessages=f}),98); __d("WAWebSendOfflineDeliveryReceiptJob",["Promise","WAComms","WALogger","WATimeUtils","WAWebCreateNackFromStanza","WAWebHandleMsgSendAck","WAWebMessageDedupUtils","WAWebPostIncomingMessageDropMetric","WAWebSchemaDanglingReceipt","WAWebSendAggregateDeliveryReceipts","WAWebSendReceiptJobCommon","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAggregateOfflineReceipts: duplicate message does not exist in the db: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAggregateOfflineReceipts: duplicate message exists in the db: ",""]);j=function(){return a};return a}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];if(a.length===0)return b;a=(yield d("WAWebSendAggregateDeliveryReceipts").aggregateDeliveryReceipts(a));for(a of a){var c=a.receipt,e=a.isInDB,f=c.externalId,g=c.from,h=c.author,k=c.msgMeta,l=c.msgInfo;c=c.enc;var m=g.isUser()||g.isNewsletter()?null:h;e?(d("WALogger").LOG(j(),f),void d("WAWebPostIncomingMessageDropMetric").postIncomingMessageDropDuplicateMessage({msgMeta:k,msgInfo:l,enc:c}),d("WAWebMessageDedupUtils").isPengingMessageCacheEnabled()?d("WAWebHandleMsgSendAck").sendAck(f,g,k.type,m):b.push({externalId:f,from:g,author:h})):(d("WALogger").LOG(i(),f),void d("WAWebPostIncomingMessageDropMetric").postIncomingMessageDropOldCounter({msgMeta:k,msgInfo:l,enc:c}),d("WAWebHandleMsgSendAck").sendNack(f,g,k.type,m,d("WAWebCreateNackFromStanza").NackReason.SignalErrorOldCounter))}return b});return l.apply(this,arguments)}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[],e=[];for(a of a){var f=a.receiptInfo,g=a.duplicateMsgReceiptInfo;g!=null&&e.push(g);f!=null&&c.push(f)}c=c.concat(yield k(e));var i=new Map(),j=[];c.forEach(function(a){var b=a.from,c=a.author;a=a.externalId;var d=i.get(b);d||(d=new Map(),i.set(b,d));var e=d.get(c);e||(e=[],d.set(c,e));e.push(a);j.push({from:String(b),author:String(c),externalId:a})});var l=String(d("WATimeUtils").unixTime());void (h||(h=b("Promise"))).all(Array.from(i.keys()).map(function(a){var b=i.get(a);if(!b)return;var c=a.isUser()&&d("WAWebUserPrefsMeUser").isMeAccount(a);return d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a,type:c?d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.SENDER:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.DELIVERY,t:l,groupedReceipt:b,recipient:c?a:null})}));d("WAComms").cancelDeadSocketTimer();j.length>0&&(yield d("WAWebSchemaDanglingReceipt").getTable().create({receipts:j,acks:[]}))});return m.apply(this,arguments)}g.handleDuplicateMsgReceipts=k;g.sendAggregateOfflineReceipts=a}),98); __d("WAWebWamEnumReportingTokenValidationFailureReason",[],(function(a,b,c,d,e,f){a=Object.freeze({MISSING_MESSAGE_SECRET:0,EMPTY_REPORTING_TOKEN_CONTENT:1,MISMATCH_REPORTING_TOKEN:2,UNSUPPORTED_VERSION:3});f.REPORTING_TOKEN_VALIDATION_FAILURE_REASON=a}),66); __d("WAWebReportingTokenUtils",["WABase64","WABinary","WACryptoHkdf","WACryptoHmac","WACryptoUtils","WAJids","WALogger","WATimeUtils","WAUseCaseSecret","WAWap","WAWebApiContact","WAWebCreateNackFromStanza","WAWebDBMessageSerialization","WAWebHandleMsgTypes.flow","WAWebLidMigrationUtils","WAWebMessageInsertDebugPlaceholder","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessageSecretErrorsWamEvent","WAWebMessagingGatingUtils","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebReportingTokenConfig","WAWebReportingTokenContent","WAWebSchemaMessage","WAWebUserPrefsMeUser","WAWebWamEnumMessageSecretAllowedType","WAWebWamEnumMessageSecretErrorType","WAWebWamEnumReportingTokenValidationFailureReason","WAWebWamMsgUtils","WAWebWamReportingTokenMismatchReporter","WAWebWid","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","encodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["reporting token content cannot be empty for validating reporting token info. Message: ","-",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["remoteJid cannot be null for validating reporting token info. isAlternateChecking: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["senderWid cannot be null for validating reporting token info. isAlternateChecking: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["unexpected exception in validating reporting token info: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Franking tag doesn't match for message ",": ","-",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateReportingTokenInfo: validation failed, try to use alternate sender and remote"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["message secret cannot be null for validating reporting token info"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["unexpected exception in generating reporting token body: ",""]);o=function(){return a};return a}var p=16,q=32,r=6,s=7,t={DEFAULT:1,HISTORY_SYNC:-1},u={sampling:.01},v={sampling:1};function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.messageSecret,c=a.stanzaId,e=a.senderJid;a=a.remoteJid;c=d("WABinary").Binary.build(c,e,a,d("WAUseCaseSecret").UseCaseSecretModificationType.REPORT_TOKEN).readBuffer();return d("WACryptoHkdf").extractAndExpand(b instanceof ArrayBuffer?new Uint8Array(b):b,c,q)});return x.apply(this,arguments)}function y(a){return d("WAJids").extractFromJid(d("WAWebWidToJid").widToJidWithType(C(a)))}function z(a){return d("WAJids").extractFromJid(d("WAWebWidToJid").widToJidWithType(D(a)))}function A(a){a=d("WAWebWidToJid").widToJidWithType(a.id.remote);return{jidType:a.jidType,remoteJid:d("WAJids").extractFromJid(a)}}function a(a){var b;if(a.encFilehash==null&&a.caption==null)return null;b=new Uint8Array(d("WABase64").decodeB64((b=a.encFilehash)!=null?b:""));a=new TextEncoder().encode((a=a.caption)!=null?a:"");var c=new Uint8Array(b.length+a.length);c.set(b);c.set(a,b.length);return self.crypto.getRandomValues(new Uint8Array(c.length))}function e(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c;if(!(d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&d("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(a.type,a.subtype)))return null;c=(c=b.messageContextInfo)==null?void 0:c.messageSecret;var e=d("WAWebMsgGetters").getSender(a),f=A(a),g=f.jidType;f=f.remoteJid;if(g==="interopUser")return null;if(c==null){new(d("WAWebMessageSecretErrorsWamEvent").MessageSecretErrorsWamEvent)({messageSecretAllowedList:d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_REPORTING_TOKEN,messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(a),messageSecretError:d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.MISSING_MESSAGE_SECRET}).commit();return null}if(e==null||f==null)return null;g=d("WAWebMessagingGatingUtils").getSenderReportingTokenVersion();c=(yield w({messageSecret:c,stanzaId:a.id.id,senderJid:d("WAWebWidToJid").widToUserJid(e),remoteJid:f}));if(a.reportingTokenContent!=null)e=a.reportingTokenContent;else{f=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,b);e=new(d("WAWebReportingTokenContent").ReportingTokenContentCalculator)(f.readByteArray(),d("WAWebReportingTokenConfig").getReportingTokenConfig(g)).getReportingTokenContent()}if(e==null||e.length===0)return null;b=(yield d("WACryptoHmac").hmacSha256(new Uint8Array(c),(a=e)!=null?a:new Uint8Array(0),p));return d("WAWap").wap("reporting",null,d("WAWap").wap("reporting_token",{v:d("WAWap").CUSTOM_STRING(String(g))},new Uint8Array(b)))}catch(a){d("WALogger").WARN(o(),a).tags("messaging","wa-ice","report-token").sendLogs("report-token-unexpected-exception",u);return null}});return B.apply(this,arguments)}function C(a){var b=d("WAWebMsgGetters").getBroadcastId(a);if(b!=null)return b;b=a.id.remote;if(!c("WAWebWid").isRegularUser(b))return b;return c("WAWebWid").isLid(b)?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser()}function D(a){var b=d("WAWebMsgGetters").getBroadcastId(a);if(b!=null)return b;b=a.id.remote;if(!c("WAWebWid").isRegularUser(b))return b;return c("WAWebWid").isLid(b)?d("WAWebUserPrefsMeUser").getMeUser():d("WAWebUserPrefsMeUser").getMeLidUser()}function E(a){return d("WAWebMsgGetters").getIsEdited(a)&&!d("WAWebMessagingGatingUtils").isReportingTokenEditReceiveEnabled()}function F(a){return a.kind===d("WAWebMsgType").MsgKind.CommentEncrypted&&!d("WAWebMessagingGatingUtils").isDualEncryptedReportingTokenReceiveEnabled()}function f(a,b){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c;if(!d("WAWebMessagingGatingUtils").isReportingTokenReceivingEnabled())return{res:!0,reportingTokenContent:null,reportingTokenKey:null};var e=a.reportingTokenInfo;if(e==null||Object.keys(e).length===0)return{res:!0,reportingTokenContent:null,reportingTokenKey:null};if(e.reportingTag==null)return{res:!0,reportingTokenContent:null,reportingTokenKey:null};var f=e.reportingToken;e=(e=e.version)!=null?e:t.DEFAULT;var g={msg:a,reportingTokenVersion:e};if(f==null)return{res:!0,reportingTokenContent:null,reportingTokenKey:null};if(!d("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(a.type,a.subtype))return{res:!0,reportingTokenContent:null,reportingTokenKey:null};if(E(a)||F(a))return{res:!0,reportingTokenContent:null,reportingTokenKey:null};var h;d("WAWebMsgGetters").getIsEdited(a)&&(h=(yield L(a.protocolMessageKey)));h=(c=h)!=null?c:a.messageSecret;if(h==null){d("WALogger").ERROR(n()).tags("messaging","wa-ice","report-token").sendLogs("report-token-null-message-secret",v);d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent(babelHelpers["extends"]({},g,{reason:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.MISSING_MESSAGE_SECRET}));return{res:!1,reportingTokenContent:null,reportingTokenKey:null}}c=(yield H({messageSecret:h,commonLoggingProps:g,msg:a,plainProtobufBytes:b,receivedVersion:e,receivedReportingToken:f,isAlternateChecking:!1}));if(c.res===!0)return c;d("WALogger").LOG(m());c=(yield H({messageSecret:h,commonLoggingProps:g,msg:a,plainProtobufBytes:b,receivedVersion:e,receivedReportingToken:f,isAlternateChecking:!0}));if(!c.res){d("WALogger").ERROR(l(),a.id.toString(),a.type,a.subtype).tags("messaging","wa-ice","report-token").sendLogs("report-token-mismatch",v);e>d("WAWebMessagingGatingUtils").getSenderReportingTokenVersion()?d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent({msg:a,reason:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.UNSUPPORTED_VERSION,reportingTokenVersion:e}):d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent({msg:a,reason:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.MISMATCH_REPORTING_TOKEN,reportingTokenVersion:e});if(J(e)){g=K(a);d("WAWebMessageInsertDebugPlaceholder").maybeInsertDebugPlaceholder({externalId:g.externalId,nackReason:d("WAWebCreateNackFromStanza").NackReason.ParsingError,msgInfo:g,offline:!1,additionalInfo:"reporting token validation failed for msg "+a.id.toString()})}}return c}catch(a){d("WALogger").ERROR(k(),a).tags("messaging","wa-ice","report-token").sendLogs("report-token-unexpected-exception",u);return{res:!1,reportingTokenContent:null,reportingTokenKey:null}}});return G.apply(this,arguments)}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.messageSecret,e=a.commonLoggingProps,f=a.msg,g=a.plainProtobufBytes,k=a.receivedVersion,l=a.receivedReportingToken;a=a.isAlternateChecking;var m=d("WAWebMsgGetters").getSender(f);if(a&&m!=null)if(c("WAWebWid").isLid(m))m=d("WAWebLidMigrationUtils").toPn(m);else if(f.preMatChat!=null)m=f.preMatChat;else{var n=(yield d("WAWebApiContact").getAccountLidFromChat(d("WAWebWidFactory").toUserWid(m)));m=n!=null?d("WAWebWidFactory").createWid(n.toString()):null}n=a?z(f):y(f);if(m==null){d("WALogger").ERROR(j(),a).tags("messaging","wa-ice","report-token").sendLogs("report-token-null-sender",v);d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent(babelHelpers["extends"]({},e,{reason:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.MISSING_MESSAGE_SECRET}));return{res:!1,reportingTokenContent:null,reportingTokenKey:null}}if(n==null){d("WALogger").ERROR(i(),a).tags("messaging","wa-ice","report-token").sendLogs("report-token-null-remote",v);d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent(babelHelpers["extends"]({},e,{reason:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.MISSING_MESSAGE_SECRET}));return{res:!1,reportingTokenContent:null,reportingTokenKey:null}}a=new Uint8Array(yield w({messageSecret:b,stanzaId:f.id.id,senderJid:d("WAWebWidToJid").widToUserJid(m),remoteJid:n}));b=new(d("WAWebReportingTokenContent").ReportingTokenContentCalculator)(g,d("WAWebReportingTokenConfig").getReportingTokenConfig(k)).getReportingTokenContent();if(b.length===0){d("WALogger").ERROR(h(),f.type,f.subtype).tags("messaging","wa-ice","report-token").sendLogs("report-token-empty-reporting-token-content",v);d("WAWebWamReportingTokenMismatchReporter").logReportingTokenValidationEvent(babelHelpers["extends"]({},e,{reason:k>d("WAWebMessagingGatingUtils").getSenderReportingTokenVersion()?d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.UNSUPPORTED_VERSION:d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON.EMPTY_REPORTING_TOKEN_CONTENT}));return{res:!1,reportingTokenContent:null,reportingTokenKey:a}}n=new Uint8Array(yield d("WACryptoHmac").hmacSha256(a,(m=b)!=null?m:new Uint8Array(0),p));f=d("WACryptoUtils").uint8ArraysEqual(n,(g=l.subarray(0,32))!=null?g:new Uint8Array(0));return{res:f,reportingTokenContent:b,reportingTokenKey:a}});return I.apply(this,arguments)}function J(a){return a>d("WAWebMessagingGatingUtils").getSenderReportingTokenVersion()?!1:d("WAWebMessagingGatingUtils").isReportingTokenValidationFailureDebugPlaceholderEnabled()}function K(a){var b,e=a.id.id+"DEBUG",f=a.id.remote;e={author:(b=d("WAWebMsgGetters").getSender(a))!=null?b:a.from,chat:f,count:null,edit:-1,isHsm:!1,externalId:e,pushname:"Debug",ts:d("WATimeUtils").castToUnixTime(((b=a.t)!=null?b:0)+1)};return c("WAWebWid").isGroup(f)?babelHelpers["extends"]({},e,{type:d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.GROUP,isDirect:!1}):babelHelpers["extends"]({},e,{type:d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.CHAT})}function L(a){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return null;a=(yield d("WAWebSchemaMessage").getMessageTable().get(a.toString()));if(a==null)return null;a=d("WAWebDBMessageSerialization").messageFromDbRow(a);return a.messageSecret});return M.apply(this,arguments)}g.REPORTING_TOKEN_KEY_SIZE=q;g.REPORTING_TOKEN_STORAGE_SIZE=r;g.REPORTING_TOKEN_INVALID_STORAGE_SIZE=s;g.REPORTING_TOKEN_VERSION=t;g.genReportingTokenKeyFromMessageSecret=w;g.getRemoteJidOnReceiverSide=y;g.getAlternateRemoteJidOnReceiverSide=z;g.getRemoteJidOnSenderSide=A;g.getMediaReportingTokenContent=a;g.genReportingTokenBody=e;g.getReportingTokenRemoteWid=C;g.getAlternateReportingTokenRemoteWid=D;g.shouldSkipProcessingEditedMsg=E;g.shouldSkipProcessingDualEncryptedMsg=F;g.validateReportingTokenInfo=f;g.showDebugPlaceholderForReportingTokenMismatch=J}),98); __d("WAWebMexUpdateTextStatusJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"text_status_input",variableName:"input"}],concreteType:"XWA2TextStatusMutationResponse",kind:"LinkedField",name:"xwa2_update_text_status",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"result",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexUpdateTextStatusJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexUpdateTextStatusJobMutation",selections:b},params:{id:"6995196977195668",metadata:{},name:"WAWebMexUpdateTextStatusJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebTextStatusParseUtils",["WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h=0;function a(a){var b;return{id:d("WAWebWidFactory").createWid(a.jid),textStatusString:a.text,textStatusEmoji:(b=a.emoji)==null?void 0:b.content,textStatusEphemeralDuration:a.ephemeral_duration_sec,textStatusLastUpdateTime:a.last_update_time!=null?Number(a.last_update_time):void 0}}function b(a){return{jid:a.id.toJid(),last_update_time:(a=a.textStatusLastUpdateTime)==null?void 0:a.toString()}}function c(a){var b=a.textStatusString;a.textStatusString===""&&(b=null);var c=a.textStatusEphemeralDuration;c==null&&(c=h);b==null&&a.textStatusEmoji==null&&c!==h&&(c=h);var d;a.textStatusEmoji!=null&&(d={content:a.textStatusEmoji});return{text:b,emoji:d,ephemeral_duration_sec:c}}g.parseTextStatusServerResponse=a;g.createTextStatusObjectForGetRequest=b;g.createTextStatusObjectForUpdateRequest=c}),98); __d("WAWebMexUpdateTextStatusJob",["WALogger","WAWebMexClient","WAWebMexUpdateTextStatusJobMutation.graphql","WAWebTextStatusParseUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][TEXTSTATUS] Updated text status via mex"]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=h!==void 0?h:h=b("WAWebMexUpdateTextStatusJobMutation.graphql");a=d("WAWebTextStatusParseUtils").createTextStatusObjectForUpdateRequest({textStatusString:a,textStatusEmoji:c,textStatusEphemeralDuration:e});c={input:a};e=(yield d("WAWebMexClient").fetchQuery(f,c));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:e});return e});return j.apply(this,arguments)}g.mexUpdateTextStatus=a}),98); __d("WAWebMexUsyncQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"include_about_status"},b={defaultValue:null,kind:"LocalArgument",name:"include_username"},c={defaultValue:null,kind:"LocalArgument",name:"input"},d=[{kind:"Variable",name:"input",variableName:"input"}],e={alias:null,args:null,kind:"ScalarField",name:"jid",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},h={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],type:"XWA2ResponseStatus",abstractKey:null},i={condition:"include_username",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"username_info",plural:!1,selections:[f,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"state",storageKey:null},g,{alias:null,args:null,kind:"ScalarField",name:"pin",storageKey:null}],type:"XWA2Username",abstractKey:null},h],storageKey:null}]};g={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},g],type:"XWA2AboutStatus",abstractKey:null};return{fragment:{argumentDefinitions:[a,b,c],kind:"Fragment",metadata:null,name:"WAWebMexUsyncQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"xwa2_fetch_wa_users",plural:!0,selections:[e,i,{condition:"include_about_status",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"about_status_info",plural:!1,selections:[g,h],storageKey:null}]}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,b,a],kind:"Operation",name:"WAWebMexUsyncQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"xwa2_fetch_wa_users",plural:!0,selections:[f,e,i,{condition:"include_about_status",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"about_status_info",plural:!1,selections:[f,g,h],storageKey:null}]},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"XWA2User",abstractKey:null}],storageKey:null}]},params:{id:"8278324862279817",metadata:{},name:"WAWebMexUsyncQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexUsync",["WAWebMexClient","WAWebMexRelayEnvironment","WAWebMexUsyncQuery.graphql","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h,i=h!==void 0?h:h=b("WAWebMexUsyncQuery.graphql");function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=a.users.filter(function(a){a=a.jid;return d("WAWebWidFactory").createWid(a).isUser()});if(b.length){b=(yield d("WAWebMexClient").fetchQuery(i,{input:{query_input:b,telemetry:a.telemetry},include_username:a.fetch.username===!0,include_about_status:a.fetch.about_status===!0}));if(b.xwa2_fetch_wa_users!=null)return{response:b.xwa2_fetch_wa_users,error:null}}throw c("err")("[MEX][USYNC] xwa2_fetch_wa_users null")}catch(a){if(a instanceof d("WAWebMexRelayEnvironment").MexIqError)return{response:null,error:{code:a.code,text:"MexIqError:"+a.message}};if(a instanceof d("WAWebMexRelayEnvironment").MexFatalExtensionError)return{response:null,error:{code:a.error.extensions.error_code,text:"MexFatalExtensionError:"+a.error.message}};throw a}});return j.apply(this,arguments)}g.mexUsyncQuery=a}),98); __d("WAWebMexFetchGroupInfoJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"query_context"}],b=[{fields:[{kind:"Variable",name:"group_id",variableName:"id"},{kind:"Variable",name:"query_context",variableName:"query_context"}],kind:"ObjectValue",name:"group_input"}],c={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"announcement_version",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"lid",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"pn",storageKey:null},h={alias:null,args:null,concreteType:"XWA2User",kind:"LinkedField",name:"creator",plural:!1,selections:[c,f,g],storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"state",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},k={alias:null,args:null,concreteType:"XWA2GroupSubject",kind:"LinkedField",name:"subject",plural:!1,selections:[h,e,j],storageKey:null};j={alias:null,args:null,concreteType:"XWA2GroupDescription",kind:"LinkedField",name:"description",plural:!1,selections:[c,e,h,j],storageKey:null};f={alias:null,args:null,concreteType:"XWA2GroupParticipantsConnection",kind:"LinkedField",name:"participants",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2GroupParticipantEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2User",kind:"LinkedField",name:"node",plural:!1,selections:[c,f,g,{alias:null,args:null,kind:"ScalarField",name:"display_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"role",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"participants_phash_match",storageKey:null}],storageKey:null};g={alias:null,args:null,kind:"ScalarField",name:"total_participants_count",storageKey:null};var l={alias:null,args:null,kind:"ScalarField",name:"ack",storageKey:null},m={alias:null,args:null,concreteType:"XWA2GroupEphemeralSetting",kind:"LinkedField",name:"ephemeral",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"expiration_time_in_sec",storageKey:null}],storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"locked",storageKey:null},o={alias:null,args:null,concreteType:"XWA2GroupGrowthLocked",kind:"LinkedField",name:"growth_locked2",plural:!1,selections:[n],storageKey:null},p={alias:null,args:null,concreteType:"XWA2GroupLIDMigrationState",kind:"LinkedField",name:"lid_migration_state",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"addressing_mode",storageKey:null}],storageKey:null},q={alias:null,args:null,kind:"ScalarField",name:"member_add_mode",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"parent_group_jid",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"group_safety_check",storageKey:null},t={alias:null,args:null,concreteType:"XWA2GroupLimitSharingSetting",kind:"LinkedField",name:"limit_sharing",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"limit_sharing_enabled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"limit_sharing_trigger",storageKey:null}],storageKey:null},u={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"XWA2CommunityDefaultSubGroupProperties",kind:"LinkedField",name:"properties",plural:!1,selections:[l,m,o,p,q,r,s,t],storageKey:null}],type:"XWA2CommunityDefaultSubGroup",abstractKey:null},v={alias:null,args:null,kind:"ScalarField",name:"allow_admin_reports",storageKey:null},w={alias:null,args:null,kind:"ScalarField",name:"announcement",storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"membership_approval_mode_enabled",storageKey:null};r={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"membership_approval_request",storageKey:null},{alias:null,args:null,concreteType:"XWA2CommunitySubGroupProperties",kind:"LinkedField",name:"properties",plural:!1,selections:[l,v,w,m,o,p,n,q,x,r,{alias:null,args:null,kind:"ScalarField",name:"general_chat",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"auto_add_disabled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hidden_group",storageKey:null},s,t],storageKey:null}],type:"XWA2CommunitySubGroup",abstractKey:null};var y={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"num_sub_groups",storageKey:null},{alias:null,args:null,concreteType:"XWA2CommunityProperties",kind:"LinkedField",name:"properties",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"allow_non_admin_sub_group_creation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"closed_by_membership_approval_mode",storageKey:null},t],storageKey:null}],type:"XWA2CommunityGroup",abstractKey:null};l={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"XWA2GroupRegularGroupProperties",kind:"LinkedField",name:"properties",plural:!1,selections:[l,v,w,{alias:null,args:null,kind:"ScalarField",name:"capi",storageKey:null},m,o,p,{alias:null,args:null,kind:"ScalarField",name:"internal",storageKey:null},n,q,x,{alias:null,args:null,kind:"ScalarField",name:"support",storageKey:null},s,t],storageKey:null}],type:"XWA2GroupRegularGroup",abstractKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchGroupInfoJobQuery",selections:[{alias:null,args:b,concreteType:null,kind:"LinkedField",name:"xwa2_group_query_by_id",plural:!1,selections:[c,d,e,h,i,k,j,f,g,u,r,y,l],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchGroupInfoJobQuery",selections:[{alias:null,args:b,concreteType:null,kind:"LinkedField",name:"xwa2_group_query_by_id",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},c,d,e,h,i,k,j,f,g,u,r,y,l],storageKey:null}]},params:{id:"24043375628598326",metadata:{},name:"WAWebMexFetchGroupInfoJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexGetTypename",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a==null?void 0:a.__typename}f.getTypename=a}),66); __d("WAWebMexGroupParseUtils",["WAWebBackendErrors","WAWebMexGetTypename","WAWebSchemaGroupMetadata","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h="XWA2CommunityGroup",i="XWA2CommunityDefaultSubGroup",j="XWA2CommunitySubGroup",k="LID";function a(a){var b,c,e,f,g,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;a=a.xwa2_group_query_by_id;if(a==null)return null;var F=a.id,G=a.creation_time,H=a.creator;b=(b=a.creator)==null?void 0:b.pn;var I=a.description;c=(c=a.participants)==null?void 0:c.edges;e=(e=a.properties)==null?void 0:e.allow_admin_reports;f=(f=a.properties)==null?void 0:f.allow_non_admin_sub_group_creation;g=(g=a.properties)==null?void 0:g.announcement;o=(o=a.properties)==null?void 0:(o=o.ephemeral)==null?void 0:o.expiration_time_in_sec;p=((p=a.properties)==null?void 0:(p=p.lid_migration_state)==null?void 0:p.addressing_mode)===k;q=(q=a.properties)==null?void 0:q.locked;r=(r=a.properties)==null?void 0:r.member_add_mode;s=(s=a.properties)==null?void 0:s.membership_approval_mode_enabled;t=(t=a.properties)==null?void 0:t.support;var J=a.state,K=a.subject;u=(u=a.subject)==null?void 0:(u=u.creator)==null?void 0:u.pn;var L=a.total_participants_count;v=(v=a.participants)==null?void 0:v.participants_phash_match;w=(w=a.properties)==null?void 0:w.closed_by_membership_approval_mode;x=(x=a.properties)==null?void 0:x.general_chat;y=a==null?void 0:(y=a.properties)==null?void 0:(y=y.growth_locked2)==null?void 0:y.locked;z=a==null?void 0:(z=a.properties)==null?void 0:z.auto_add_disabled;A=a==null?void 0:(A=a.properties)==null?void 0:A.parent_group_jid;B=a==null?void 0:(B=a.properties)==null?void 0:B.capi;C=a==null?void 0:(C=a.properties)==null?void 0:C.hidden_group;D=a==null?void 0:(D=a.properties)==null?void 0:D.group_safety_check;E=a==null?void 0:(E=a.properties)==null?void 0:E.limit_sharing;if(F!=null&&G!=null&&(K==null?void 0:K.value)!=null){var M=d("WAWebMexGetTypename").getTypename(a);q=babelHelpers["extends"]({id:d("WAWebWidFactory").createWid(F),owner:(H==null?void 0:H.id)!=null?d("WAWebWidFactory").createWid(H==null?void 0:H.id):void 0,creatorPn:b!=null?d("WAWebWidFactory").createWid(b):void 0,subject:K.value,creation:Number(G),participants:n(v,c),subjectTime:Number(K==null?void 0:K.creation_time),subjectOwner:(K==null?void 0:(F=K.creator)==null?void 0:F.id)!=null?d("WAWebWidFactory").createWid(K==null?void 0:(H=K.creator)==null?void 0:H.id):void 0,subjectOwnerPn:u!=null?d("WAWebWidFactory").createWid(u):void 0,allowNonAdminSubGroupCreation:(b=f)!=null?b:!1,generalChatAutoAddDisabled:M===j&&z!=null?z:!1,restrict:q===!0,announce:M===i||g===!0,support:(G=t)!=null?G:!1,desc:(c=I==null?void 0:I.value)!=null?c:void 0,descId:(F=I==null?void 0:I.id)!=null?F:void 0,descOwner:(I==null?void 0:(K=I.creator)==null?void 0:K.id)!=null?d("WAWebWidFactory").createWid(I==null?void 0:(H=I.creator)==null?void 0:H.id):void 0,descTime:(I==null?void 0:I.creation_time)!=null?Number(I==null?void 0:I.creation_time):void 0,size:L,noFrequentlyForwarded:!1,incognito:M===i,ephemeralDuration:(u=o)!=null?u:void 0,membershipApprovalMode:(f=s)!=null?f:!1,memberAddMode:m(r),suspended:J===l.SUSPENDED,terminated:J===l.TERMINATED?!0:void 0,isLidAddressingMode:p,reportToAdminMode:(b=e)!=null?b:!1,isParentGroupClosed:w===!0,isParentGroup:M===h,parentGroup:A!=null?d("WAWebWidFactory").createWid(A):void 0,generalSubgroup:x===!0,defaultSubgroup:M===i},(M===j||M===i)&&{parentGroupSubject:null},{numSubgroups:0,membershipApprovalRequest:a.membership_approval_request===!0,growthLockType:y===!0?"invite":void 0,hasCapi:B===!0,hiddenSubgroup:C!=null?C:void 0,groupSafetyCheck:D!=null?D:void 0,limitSharingEnabled:(z=E==null?void 0:E.limit_sharing_enabled)!=null?z:void 0});return{groupInfo:q,participantPhashMatch:v}}}var l={ACTIVE:"ACTIVE",TERMINATED:"NON_EXISTENT",SUSPENDED:"SUSPENDED"};function b(a){switch(a){case"interactive":return"INTERACTIVE";case"phash":return"PHASH";case"prefetch":return"PRE_FETCH";default:return"UNKNOWN"}}function m(a){switch(a){case"ADMIN_ADD":return d("WAWebSchemaGroupMetadata").MemberAddMode.ADMIN_ADD;case"ALL_MEMBER_ADD":return d("WAWebSchemaGroupMetadata").MemberAddMode.ALL_MEMBER_ADD;default:return d("WAWebSchemaGroupMetadata").MemberAddMode.ADMIN_ADD}}function n(a,b){if(a===!0)return[];if(b==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing participants in group info participant response");a=b.map(function(a){var b=a.node;a=a.role;var c,e,f;if(b.id==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing id in group info participant response");else c=d("WAWebWidFactory").createWid(b.id);b.lid!=null&&(e=d("WAWebWidFactory").createWid(b.lid));b.pn!=null&&(f=d("WAWebWidFactory").createWid(b.pn));return{id:c,lid:e,phoneNumber:(c=f)!=null?c:null,displayName:(c=b.display_name)!=null?c:null,isAdmin:a==="ADMIN_MEMBER"||a==="SUPERADMIN_MEMBER",isSuperAdmin:a==="SUPERADMIN_MEMBER"}});return a}g.parseMexGroupResponse=a;g.toMexQueryContext=b}),98); __d("WARetryPromise",["Promise","WAAbortError","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,e){return new(h||(h=b("Promise")))(function(f,g){var i=0,j,k=!1;if(e){var l=function a(){e.removeEventListener("abort",a),k=!0,j!=null&&clearTimeout(j),g(new(d("WAAbortError").AbortError)())};if(e.aborted){l();return}e.addEventListener("abort",l)}function m(){var d=!1,e=!1;j=null;try{var l=a({retry:function(a){if(k||e)return;d=!0;i++;if(a==null)return m();j=setTimeout(m,a)},failCount:i});if(!(l instanceof(h||(h=b("Promise")))))throw c("err")("TypeError: task must return a promise");l.then(function(a){if(k||d)return;e=!0;f(a)})["catch"](function(a){if(k||d)return;e=!0;g(a)})}catch(a){if(k||d)return;g(a)}}m()})}g["default"]=a}),98); __d("WARetryableError",["WACustomError"],(function(a,b,c,d,e,f,g){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this,"see error at this.source")||this;c.source=b;return c}return b}(d("WACustomError").customError("RetryableError"));g["default"]=a}),98); __d("WABackoff",["Promise","WARetryPromise","WARetryableError"],(function(a,b,c,d,e,f,g){"use strict";var h,i=Object.freeze({timeoutIncludesTaskDuration:!0});function a(a,d){a=babelHelpers["extends"]({},i,a);var e=a.signal,f=a.timeoutIterator,g=a.timeoutIncludesTaskDuration;return c("WARetryPromise")(function(a){var e=a.retry,i=a.failCount;return new(h||(h=b("Promise")))(function(a,j){var k=Date.now();try{d(l,i).then(a)["catch"](m)}catch(a){m(a);return}function l(a){return(h||(h=b("Promise"))).reject(new(c("WARetryableError"))(a))}function m(a){if(!(a instanceof c("WARetryableError")))return void j(a);var b=f.next();if(b.done)return void j(a.source);a=Date.now()-k;a=g?Math.max(b.value-a,0):b.value;e(a)}})},e)}g.defaults=i;g.backoff=a}),98); __d("WAExponentialIterator",[],(function(a,b,c,d,e,f){"use strict";function* a(a){var b=1;while(!0)yield b,b*=a}f["default"]=a}),66); __d("WAExponentialBackoffIterator",["WAExponentialIterator"],(function(a,b,c,d,e,f,g){"use strict";var h={factor:2,jitter:0,maxTimeout:Infinity};function* a(a){a=babelHelpers["extends"]({},h,a);var b=a.factor,d=a.jitter,e=a.maxTimeout,f=a.minTimeout;a=a.retries;var g=0;for(b of c("WAExponentialIterator")(b)){g++;if(g>a)return;var i=1+(Math.random()*d*2-d);yield Math.min(f*b*i,e)}}g.defaults=h;g.exponentialBackoffIterator=a}),98); __d("WAExponentialBackoff",["WABackoff","WAExponentialBackoffIterator"],(function(a,b,c,d,e,f,g){"use strict";var h=babelHelpers["extends"]({},d("WAExponentialBackoffIterator").defaults,d("WABackoff").defaults);function a(a,b){a=babelHelpers["extends"]({},h,a);var c=a.signal,e=a.timeoutIncludesTaskDuration;a=babelHelpers.objectWithoutPropertiesLoose(a,["signal","timeoutIncludesTaskDuration"]);a=d("WAExponentialBackoffIterator").exponentialBackoffIterator(a);return d("WABackoff").backoff({signal:c,timeoutIterator:a,timeoutIncludesTaskDuration:e},b)}g.exponentialBackoff=a}),98); __d("WAWebNewsletterRpcUtils",["WAExponentialBackoff","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h={minTimeout:1e3,retries:3},i=new Set([429,500]);function a(a,c){c=c===void 0?{retryableErrorCodes:i}:c;var e=c.retryableErrorCodes;c=new AbortController();c=c.signal;return d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},h,{signal:c}),function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){try{return yield a()}catch(a){if(!(a instanceof d("WAWebBackendErrors").ServerStatusCodeError))throw a;var f=e.has(a.statusCode);if(f&&c<h.retries)return b(a);throw a}});return function(a,b){return c.apply(this,arguments)}}())}g.runWithBackoff=a}),98); __d("WAWebMexFetchGroupInfoJob",["WALogger","WAWebMexClient","WAWebMexFetchGroupInfoJobQuery.graphql","WAWebMexGroupParseUtils","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][GROUP] fetched get group info for ",""]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexFetchGroupInfoJobQuery.graphql");function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){return d("WAWebNewsletterRpcUtils").runWithBackoff(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebMexClient").fetchQuery(j,{id:a,query_context:c}));d("WALogger").LOG(i(),a).tags("GQL","MEX").devConsole({response:b});return b}))});return l.apply(this,arguments)}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebMexGroupParseUtils").toMexQueryContext(b);a=(yield k(a,b));if(a==null)return;return d("WAWebMexGroupParseUtils").parseMexGroupResponse(a)});return m.apply(this,arguments)}g.mexGetGroupInfo=a}),98); __d("WAWebMexFetchSubgroupSuggestionsJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"group_id"},b={defaultValue:null,kind:"LocalArgument",name:"query_context"},c={defaultValue:null,kind:"LocalArgument",name:"sub_group_hint_id"},d=[{fields:[{kind:"Variable",name:"group_id",variableName:"group_id"},{kind:"Variable",name:"query_context",variableName:"query_context"},{kind:"Variable",name:"sub_group_hint",variableName:"sub_group_hint_id"}],kind:"ObjectValue",name:"group_input"}],e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},g=[f],h={alias:null,args:null,concreteType:"XWA2GroupSubject",kind:"LinkedField",name:"subject",plural:!1,selections:g,storageKey:null},i={alias:null,args:null,concreteType:"XWA2User",kind:"LinkedField",name:"creator",plural:!1,selections:[e],storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"total_participants_count",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"is_existing_group",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"hidden_group",storageKey:null};return{fragment:{argumentDefinitions:[a,b,c],kind:"Fragment",metadata:null,name:"WAWebMexFetchSubgroupSuggestionsJobQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"xwa2_group_query_by_id",plural:!1,selections:[e,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestionConnection",kind:"LinkedField",name:"sub_group_suggestions",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestion",kind:"LinkedField",name:"node",plural:!1,selections:[e,h,{alias:null,args:null,concreteType:"XWA2GroupDescription",kind:"LinkedField",name:"description",plural:!1,selections:g,storageKey:null},i,j,k,l,m],storageKey:null}],storageKey:null}],storageKey:null}],type:"XWA2CommunityGroup",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,c,b],kind:"Operation",name:"WAWebMexFetchSubgroupSuggestionsJobQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"xwa2_group_query_by_id",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},e,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestionConnection",kind:"LinkedField",name:"sub_group_suggestions",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2CommunitySubGroupSuggestion",kind:"LinkedField",name:"node",plural:!1,selections:[e,h,{alias:null,args:null,concreteType:"XWA2GroupDescription",kind:"LinkedField",name:"description",plural:!1,selections:[f,e],storageKey:null},i,j,k,l,m],storageKey:null}],storageKey:null}],storageKey:null}],type:"XWA2CommunityGroup",abstractKey:null}],storageKey:null}]},params:{id:"8049169471838505",metadata:{},name:"WAWebMexFetchSubgroupSuggestionsJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchSubgroupSuggestionsJob",["Promise","WALogger","WAWebBackendErrors","WAWebMexClient","WAWebMexFetchSubgroupSuggestionsJobQuery.graphql","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][COMMUNITY] Fetched subgroup suggestions for ",""]);j=function(){return a};return a}var k=h!==void 0?h:h=b("WAWebMexFetchSubgroupSuggestionsJobQuery.graphql");function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e={group_id:a.toString(),query_context:e,sub_group_hint_id:c.toString()};try{c=(yield d("WAWebMexClient").fetchQuery(k,e));e=(e=c.xwa2_group_query_by_id)==null?void 0:(e=e.sub_group_suggestions)==null?void 0:e.edges;if(e==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing edges in response");e=e.map(function(b){b=b.node;if(b!=null)return m(a,b);throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"null node in sub_group_suggestions")});d("WALogger").DEV(j(),a.toString()).tags("GQL","MEX").devConsole({result:c});return e}catch(a){return a instanceof d("WAWebBackendErrors").ServerStatusCodeError?(i||(i=b("Promise"))).reject(a):(i||(i=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a.code),a.message))}});return l.apply(this,arguments)}function m(a,b){var e,f,g;if(b.is_existing_group==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing is_existing_group in response");else g=b.is_existing_group;if(b.id==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing id in response");else e=new(c("WAWebWid"))(b.id,{intentionallyUsePrivateConstructor:!0});if(b.creator.id==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"missing creator.id in response");else f=new(c("WAWebWid"))(b.creator.id,{intentionallyUsePrivateConstructor:!0});return{id:e,parentGroupId:a,subject:(a=(e=b.subject)==null?void 0:e.value)!=null?a:"",desc:(e=b.description)==null?void 0:e.value,owner:f,t:parseInt(b.creation_time,10),isExistingGroup:g,participantCount:b.total_participants_count,hiddenSubgroup:b.hidden_group}}g.mexFetchSubgroupSuggestions=a}),98); __d("WAWebMexLogNewsletterExposureJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2NewsletterLogExposureResponse",kind:"LinkedField",name:"xwa2_newsletter_log_exposure",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexLogNewsletterExposureJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexLogNewsletterExposureJobMutation",selections:b},params:{id:"7853928111369979",metadata:{},name:"WAWebMexLogNewsletterExposureJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebCommonNewsletterEnums",["$InternalEnum"],(function(a,b,c,d,e,f){c=(a=b("$InternalEnum"))({Subscriber:"subscriber",Admin:"admin",Guest:"guest",Owner:"owner"});d=a({Public:"public",Private:"private"});e=a({Active:"active",Suspended:"suspended",GeoSuspended:"geosuspended"});b=a({All:0,Basic:1,Blocklist:2,None:3});var g=a.Mirrored(["ALERT_BANNER","INFO_DRAWER"]),h=a.Mirrored(["GEOSUSPEND","SUSPEND","VIOLATING_MSG","PROFILE_PICTURE_DELETION","SUSPEND_INFORM","GEOSUSPEND_INFORM"]),i=a.Mirrored(["SUSPENDED_DETAILED_SCREEN","DELETE_NEWSLETTER","VIOLATING_MESSAGES_SCREEN","PROFILE_PICTURE_DELETION_SCREEN","GEOSUSPENDED_COUNTRY_DETAILED_SCREEN","MULTIPLE_ALERTS_LIST_SCREEN","NO_ALERTS_SCREEN","REQUEST_REVIEW_DESCRIPTION_SCREEN","REQUEST_REVIEW_REASON_SCREEN","APPEAL_OUTCOME_SCREEN","REMEDIATION_OPTIONS_SCREEN","DSB_STEP1_SCREEN","DSB_STEP2_SCREEN","DSB_STEP3_SCREEN","CONTACT_IP_REPORTER_STEP1_SCREEN","CONTACT_IP_REPORTER_STEP2_SCREEN","SUSPEND_INFORM_SCREEN","RM_REQUEST_REVIEW_SCREEN_STEP1_SCREEN","RM_REQUEST_REVIEW_SCREEN_STEP2_SCREEN","RM_REQUEST_REVIEW_SCREEN_STEP3_SCREEN","GEOSUSPEND_INFORM_SCREEN"]),j=a.Mirrored(["IP_SRT_VIOLATION","GENERIC_VIOLATION","RM_COPS","RM_PRODUCT_RESTRICTION"]),k=a.Mirrored(["All","Unread","MyChannels"]),l=a({Insights:0,PhotoPolls:1,QUESTIONS:2});a=a.Mirrored(["ACTIVE","INACTIVE"]);f.NewsletterMembershipType=c;f.NewsletterPrivacy=d;f.NewsletterState=e;f.NewsletterReactionCodesSetting=b;f.AlertEntryPoint=g;f.EnforcementType=h;f.AlertScreen=i;f.NewsletterDSADecisionModalCategory=j;f.NewsletterInboxFilterTypes=k;f.NewsletterCapability=l;f.WamoSubStatus=a}),66); __d("WAWebNewsletterQueryUtils",["WAJids","WAWebCommonNewsletterEnums","WAWebWid"],(function(a,b,c,d,e,f,g){function h(a){if(a==null)return"guest";switch(a){case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin:return"admin";case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner:return"owner";case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber:return"subscriber";default:return"guest"}}function a(a,b,e){e=j(e);if(c("WAWebWid").isNewsletter(a))return{queryPayloadsArgs:{jidQueryIQPayload:{anyJid:d("WAJids").toNewsletterJid(a),anyViewRole:h(b),allNewsletterMetadataIQRequestPayloadMixinArgs:e}}};e.hasNewsletterMembershipField;e.hasNewsletterMutedField;e.newsletterPictureFieldMixinArgs;e=babelHelpers.objectWithoutPropertiesLoose(e,["hasNewsletterMembershipField","hasNewsletterMutedField","newsletterPictureFieldMixinArgs"]);return{queryPayloadsArgs:{inviteQueryIQPayload:babelHelpers["extends"]({anyKey:a,anyViewRole:h(b)},e,{newsletterPreviewTypePictureFieldMixinArgs:{baseNewsletterPictureFieldMixinArgs:{}}})}}}function i(){return{pictureArgs:[{pictureType:"image"},{pictureType:"preview"}]}}function j(a){return a==null?{hasNewsletterCreationTimeField:!0,hasNewsletterNameField:!0,newsletterPictureFieldMixinArgs:i(),hasNewsletterDescriptionField:!0,hasNewsletterInviteLinkField:!0,hasNewsletterHandleField:!0,hasNewsletterSubscribersField:!0,hasNewsletterPrivacyField:!0,hasNewsletterVerificationField:!0,hasNewsletterLinkedAccountsField:!0,hasNewsletterMembershipField:!0,hasNewsletterMutedField:!0,hasNewsletterStateField:!0}:{hasNewsletterCreationTimeField:a.creationTime,hasNewsletterNameField:a.name,newsletterPictureFieldMixinArgs:a.picture===!0?i():void 0,hasNewsletterDescriptionField:a.description,hasNewsletterInviteLinkField:a.inviteLink,hasNewsletterHandleField:a.handle,hasNewsletterSubscribersField:a.subscribers,hasNewsletterPrivacyField:a.privacy,hasNewsletterVerificationField:a.verification,hasNewsletterLinkedAccountsField:a.linkedAccounts,hasNewsletterMembershipField:a.membership,hasNewsletterMutedField:a.membership,hasNewsletterStateField:a.state}}function b(a){return c("WAWebWid").isNewsletter(a)?{queryNewsletterJIDParams:{anyJid:d("WAJids").toNewsletterJid(a)}}:{queryNewsletterInviteParams:{anyKey:a}}}function e(a){switch(a){case d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights:return"INSIGHTS";case d("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls:return"PHOTO_POLLS";case d("WAWebCommonNewsletterEnums").NewsletterCapability.QUESTIONS:return"QUESTIONS"}}g.getNewsletterMetadataQueryParamArgs=a;g.getNewsletterMetadataArgs=j;g.getNewsletterMessagesQueryParams=b;g.getNewsletterCapabilityFromEnum=e}),98); __d("WAWebMexLogNewsletterExposureJob",["WALogger","WAWebMexClient","WAWebMexLogNewsletterExposureJobMutation.graphql","WAWebNewsletterQueryUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] logged newsletter capability exposure"]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexLogNewsletterExposureJobMutation.graphql");function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c={input:{newsletter_id:a,capability:d("WAWebNewsletterQueryUtils").getNewsletterCapabilityFromEnum(b)}};c=(yield d("WAWebMexClient").fetchQuery(j,c));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({newsletterJid:a,capability:b,response:c})});return k.apply(this,arguments)}g.mexLogNewsletterExposure=a}),98); __d("WAWebMexSetUsernameJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"username",variableName:"input"}],concreteType:"XWA2UsernameSetMutationResponse",kind:"LinkedField",name:"xwa2_username_set",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"result",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexSetUsernameJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexSetUsernameJobMutation",selections:b},params:{id:"7107616276002412",metadata:{},name:"WAWebMexSetUsernameJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexSetUsernameJob",["WALogger","WAWebMexClient","WAWebMexSetUsernameJobMutation.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][USERNAME] Successfully fetched set username mutation via mex"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c={input:a},e=h!==void 0?h:h=b("WAWebMexSetUsernameJobMutation.graphql");e=(yield d("WAWebMexClient").fetchQuery(e,a!=null?c:{}));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:e});return((a=e.xwa2_username_set)==null?void 0:a.result)==="SUCCESS"});return j.apply(this,arguments)}g.mexSetUsernameQueryJob=a}),98); __d("WAWebMexUsersGetUsername",["WAWebMexUsync","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebMexUsync").mexUsyncQuery({users:a.map(function(a){return{jid:a.toJid()}}),telemetry:{context:"INTERACTIVE"},fetch:{username:!0}}));a=a.response;if(a!=null)return a.map(function(a){return a.username_info==null?{error:!0,username:null}:{username:(a=a.username_info)==null?void 0:a.username}})});return i.apply(this,arguments)}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield h([a]));return a==null?void 0:a[0].username});return j.apply(this,arguments)}g.getMexUserUsername=a}),98); __d("WAWebUpdateLidMetadataApi",["WAWebApiContact","WAWebBackendApi","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.updates;var b=a.map(function(a){var b=a.lid;a=a.data;return{lid:d("WAWebWidFactory").toUserWid(b),shareOwnPn:(b=a.shareOwnPn)!=null?b:null,displayNameLID:(b=a.displayNameLID)!=null?b:null,requestedPnTimestamp:(b=a.requestedPnTimestamp)!=null?b:null,username:(b=a.username)!=null?b:null}});yield d("WAWebBackendApi").frontendSendAndReceive("bulkUpdateLidContactState",{lidContactDataMappings:b});yield d("WAWebApiContact").updateLidMetadata(a)});return h.apply(this,arguments)}g.updateLidMetadata=a}),98); __d("WAWebCreateOrReplaceDisplayNamesAndLidPnMappingsJob",["Promise","WAWebDBCreateLidPnMappings","WAWebEnvironment","WAWebRunInBatches","WAWebUpdateLidMetadataApi","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){c("WAWebEnvironment").isWindows?yield d("WAWebRunInBatches").runInBatches(a,function(a){return j(a,b)}):yield j(a,b)});return i.apply(this,arguments)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=[],g=[];for(a of a){if(a==null)continue;var i=a.id,j=d("WAWebWidFactory").toUserWid(i);if(c("WAWebWid").isUserLid(j)){var k=a.displayName,l=a.phoneNumber;k!=null&&f.push({lid:j,data:{displayNameLID:k}});l!=null&&g.push({lid:j,pn:d("WAWebWidFactory").toUserWid(l)})}else{k=a.lid;k!=null&&g.push({lid:d("WAWebWidFactory").toUserLidOrThrow(k),pn:d("WAWebWidFactory").toUserWid(i)})}}yield (h||(h=b("Promise"))).all([f.length>0?d("WAWebUpdateLidMetadataApi").updateLidMetadata({updates:f}):null,g.length>0?d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:g,flushImmediately:e,learningSource:"other"}):null].filter(Boolean))});return k.apply(this,arguments)}g.createOrReplaceDisplayNamesAndLidPnMappingsInBatches=a;g.createOrReplaceDisplayNamesAndLidPnMappings=j}),98); __d("WAWebSetPrivacyTokensJob",["$InternalEnum","WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommsWapMd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("setPrivacyTokensParser",function(a){a={stanzaId:a.attrString("id")};return a});e=b("$InternalEnum")({TrustedContact:"trusted_contact"});function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;b=b.map(function(b){return d("WAWap").wap("token",{jid:d("WAWebCommsWapMd").USER_JID(a),t:d("WAWap").CUSTOM_STRING(String(c)),type:d("WAWap").CUSTOM_STRING(b)})});e=(yield d("WADeprecatedSendIq").deprecatedSendIq((e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,type:"set",xmlns:"privacy",id:e.generateId()},e.wap("tokens",null,b)),h));if(!e.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e.errorCode,e.errorText)});return i.apply(this,arguments)}g.TokenType=e;g.issuePrivacyToken=a}),98); __d("WAWebTrustedContactsUtils",["$InternalEnum","WATimeUtils","WAWebABProps"],(function(a,b,c,d,e,f,g){var h=6*30*24*60*60,i=b("$InternalEnum")({Sender:"sender",Receiver:"receiver"});function j(a){a=a===i.Receiver?"tctoken_duration":"tctoken_duration_sender";return Math.min(d("WAWebABProps").getABPropConfigValue(a),h)}function a(a,b){return a<k(b)}function k(a){var b=a===i.Receiver?"tctoken_num_buckets":"tctoken_num_buckets_sender";b=d("WAWebABProps").getABPropConfigValue(b);a=j(a);var c=Math.floor(d("WATimeUtils").unixTime()/a);c=c-(b-1);return d("WATimeUtils").castToUnixTime(c*a)}function c(a){if(a==null)return!0;var b=d("WAWebABProps").getABPropConfigValue("tctoken_duration_sender"),c=Math.floor(d("WATimeUtils").unixTime()/b);a=Math.floor(a/b);return c>a}g.TcTokenMode=i;g.getTcTokenDuration=j;g.isTokenExpired=a;g.tokenExpirationCutoff=k;g.shouldSendNewToken=c}),98); __d("WAWebSendTcTokenWhenDeviceIdentityChange",["WALogger","WATimeUtils","WAWebABProps","WAWebApiChat","WAWebBackendApi","WAWebRuntimeEnvironmentUtils","WAWebSetPrivacyTokensJob","WAWebTrustedContactsUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendTcTokenWhenDeviceIdentityChange failed - ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;d("WAWebRuntimeEnvironmentUtils").isWorker()||d("WAWebABProps").getABPropConfigValue("web_tc_token_db_read_enabled")?b=(yield d("WAWebApiChat").getChatRecord(a)):b=(yield d("WAWebBackendApi").frontendSendAndReceive("getChat",{chatId:a}));if(b==null)return;b=b.tcTokenSenderTimestamp;if(b==null)return;if(d("WAWebTrustedContactsUtils").isTokenExpired(b,d("WAWebTrustedContactsUtils").TcTokenMode.Sender))return;try{yield d("WAWebSetPrivacyTokensJob").issuePrivacyToken(a,[d("WAWebSetPrivacyTokensJob").TokenType.TrustedContact],d("WATimeUtils").castToUnixTime(b))}catch(a){d("WALogger").WARN(h(),a).verbose().devConsole(a).sendLogs("send-tc-token-device-identity-change-failed")}});return i.apply(this,arguments)}g.sendTcTokenWhenDeviceIdentityChange=a}),98); __d("WAWebUsernameGatingUtils",["WAWebABProps","WAWebPrimaryFeatures"],(function(a,b,c,d,e,f,g){function a(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_change"))}function h(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_contact_display"))}function i(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_usync"))}function j(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_1on1_chat"))}function k(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_creation"))}function b(){return h()&&j()&&i()}function c(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("username_supported")&&k()}function e(){return Boolean(d("WAWebABProps").getABPropConfigValue("username_security_code_verification"))}function f(){return!1}function l(){return Boolean(d("WAWebABProps").getABPropConfigValue("mex_usync_username_query"))}g.usernameChangeEnabled=a;g.usernameDisplayedEnabled=h;g.usernameUsyncEnabled=i;g.username1on1ChatCreationEnabled=j;g.usernameCreationEnabled=k;g.usernameContactlessChatEnabled=b;g.usernameSupported=c;g.usernameSecurityCodeVerificationEnabled=e;g.shouldLogUnknownNumberError=f;g.mexUsyncUsernameQueryEnabled=l}),98); __d("WAWebUsyncBackoff",["Promise","WALogger"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["usync: "," protocol: ","ms backoff ended"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["usync: "," protocol: ","ms backoff started"]);j=function(){return a};return a}var k=new Map();function a(a,c){d("WALogger").LOG(j(),a,c),k.set(a,new(h||(h=b("Promise")))(function(a){return self.setTimeout(a,c)}).then(function(){d("WALogger").LOG(i(),a,c)}))}function c(a){return!l(a)?(h||(h=b("Promise"))).resolve():(h||(h=b("Promise"))).all(a.protocols.map(function(a){return k.get(a.getName())}))}function l(a){if(a.context==="interactive")return!1;var b=a.protocols.map(function(a){return a.getName()});return b.includes("devices")&&(a.context==="message"||a.context==="voip")?!1:!0}g.setProtocolBackoffMs=a;g.waitForBackoff=c}),98); __d("WAWebUsyncBotProfile",["WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b;a.assertTag("bot");var c=a.maybeChild("error");if(c)return{errorCode:c.attrInt("code"),errorText:c.attrString("text")};c=a.child("profile");a=c.child("name");a=a.contentString();var d=c.child("attributes");d=d.contentString();var e=c.child("description");e=e.contentString();var f=c.child("category");f=f.contentString();var g=c.maybeChild("default");g=(g==null?void 0:g.contentString())==="true";var j=c.maybeChild("prompts");j=h(j);b=(b=c.maybeAttrString("persona_id"))!=null?b:"";var k=c.maybeChild("commands");k=i(k);var l=k.commands;k=k.commandsDescription;var m,n=c.maybeChild("is_meta_created");n&&(m=(n==null?void 0:n.contentString())==="true");var o,p;n=c.maybeChild("creator");if(n){o=(c=n.maybeChild("name"))==null?void 0:c.contentString();p=(c=n.maybeChild("profile_url"))==null?void 0:c.contentString()}return{name:a,attributes:d,description:e,category:f,isDefault:g,prompts:j,personaId:b,commands:l,commandsDescription:k,isMetaCreated:m,creatorName:o,creatorProfileUrl:p}}function h(a){if(a==null)return[];var b=[];a.forEachChildWithTag("prompt",function(a){var c=a.maybeChild("emoji");c=(c=c==null?void 0:c.contentString())!=null?c:"";a=a.maybeChild("text");a=(a=a==null?void 0:a.contentString())!=null?a:"";b.push({emoji:c,text:a})});return b}function i(a){if(a==null)return{commands:[],commandsDescription:""};var b=[],c=a.maybeChild("description");c=(c=c==null?void 0:c.contentString())!=null?c:"";a.forEachChildWithTag("command",function(a){var c=a.maybeChild("name");c=(c=c==null?void 0:c.contentString())!=null?c:"";a=a.maybeChild("description");a=(a=a==null?void 0:a.contentString())!=null?a:"";b.push({name:c,description:a})});return{commands:b,commandsDescription:c}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"bot"};b.getQueryElement=function(){return d("WAWap").wap("bot",null,d("WAWap").wap("profile",{v:"1"}))};b.getUserElement=function(a){a=a.getPersonaId();return d("WAWap").wap("bot",null,d("WAWap").wap("profile",{persona_id:a!=null?d("WAWap").CUSTOM_STRING(a):d("WAWap").DROP_ATTR}))};return a}();g.botProfileParser=a;g.USyncBotProfileProtocol=b}),98); __d("WAWebProtobufsVnameCert.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){c=(a=b("$InternalEnum"))({ENTERPRISE:0});e=a({ON_PREMISE:0,FACEBOOK:1});f=a({SELF:0,BSP:1});b=a({ON_PREMISE:0,FACEBOOK:1});a=a({UNKNOWN:0,LOW:1,HIGH:2});var h={},i={},j={},k={},l={},m={};h.internalSpec={lg:[1,(d=d("WAProtoConst")).TYPES.STRING],lc:[2,d.TYPES.STRING],verifiedName:[3,d.TYPES.STRING]};i.internalSpec={details:[1,d.TYPES.BYTES],signature:[2,d.TYPES.BYTES],serverSignature:[3,d.TYPES.BYTES]};j.internalSpec={serial:[1,d.TYPES.UINT64],issuer:[2,d.TYPES.STRING],verifiedName:[4,d.TYPES.STRING],localizedNames:[8,d.FLAGS.REPEATED|d.TYPES.MESSAGE,h],issueTime:[10,d.TYPES.UINT64]};k.internalSpec={vnameCert:[1,d.TYPES.MESSAGE,i],bizAcctLinkInfo:[2,d.TYPES.BYTES]};l.internalSpec={whatsappBizAcctFbid:[1,d.TYPES.UINT64],whatsappAcctNumber:[2,d.TYPES.STRING],issueTime:[3,d.TYPES.UINT64],hostStorage:[4,d.TYPES.ENUM,e],accountType:[5,d.TYPES.ENUM,c]};m.internalSpec={vlevel:[1,d.TYPES.ENUM,a],vnameCert:[2,d.TYPES.MESSAGE,i],signed:[3,d.TYPES.BOOL],revoked:[4,d.TYPES.BOOL],hostStorage:[5,d.TYPES.ENUM,b],actualActors:[6,d.TYPES.ENUM,f],privacyModeTs:[7,d.TYPES.UINT64],featureControls:[8,d.TYPES.UINT64]};g.BizAccountLinkInfo$AccountType=c;g.BizAccountLinkInfo$HostStorageType=e;g.BizIdentityInfo$ActualActorsType=f;g.BizIdentityInfo$HostStorageType=b;g.BizIdentityInfo$VerifiedLevelValue=a;g.LocalizedNameSpec=h;g.VerifiedNameCertificateSpec=i;g.VerifiedNameCertificate$DetailsSpec=j;g.BizAccountPayloadSpec=k;g.BizAccountLinkInfoSpec=l;g.BizIdentityInfoSpec=m}),98); __d("WAWebValidateBusinessCertificate",["WAWebProtobufsVnameCert.pb","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h="ent:wa",i="smb:wa";function a(a){return{serial:a.serial,name:a.verifiedName,isApi:a.issuer===h,isSmb:a.issuer===i}}function b(a){if(!a)return null;a=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsVnameCert.pb").VerifiedNameCertificateSpec,a);if(!a.details)throw c("err")("verifyCertificate cert missing details");var b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsVnameCert.pb").VerifiedNameCertificate$DetailsSpec,a.details);return{cert:a,details:b}}g.extractCertificateDetailsParams=a;g.getParsedProtoObjects=b}),98); __d("WAWebCommonParsersVerifiedName",["WAWebHandleMsgCommon","WAWebHandleMsgTypes.flow","WAWebNonEmptyString","WAWebValidateBusinessCertificate"],(function(a,b,c,d,e,f,g){function h(a){a=d("WAWebValidateBusinessCertificate").getParsedProtoObjects(a);if(a==null?void 0:a.details){a=d("WAWebValidateBusinessCertificate").extractCertificateDetailsParams(a.details);var b=a.name,c=a.serial,e=a.isApi;a=a.isSmb;return{name:b,serial:String(c),isApi:e,isSmb:a}}}function a(a){var b=a.attrEnum("verified_level",d("WAWebHandleMsgCommon").MSG_VERIFIED_LEVEL),c=a.hasContent()?a.contentBytes():null,e=d("WAWebNonEmptyString").asMaybeNonEmptyString(a.maybeAttrString("serial"));c=c&&h(c)||{};var f=c.serial,g=c.name,i=c.isApi;c=c.isSmb;var j=d("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(a.maybeAttrInt("actual_actors")),k=d("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(a.maybeAttrInt("host_storage"));a=a.maybeAttrInt("privacy_mode_ts");j=j!=null&&k!=null&&a!=null?{actualActors:j,hostStorage:k,privacyModeTs:a}:null;return{level:b,serial:e!=null?e:f,name:g,isApi:i===!0,isSmb:c===!0,privacyMode:j}}g["default"]=a}),98); __d("WAWebUsyncBusiness",["WAWap","WAWebCommonParsersVerifiedName"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("business");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};b=a.maybeChild("verified_name");a=b?c("WAWebCommonParsersVerifiedName")(b):null;return{verifiedName:a}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"business"};b.getQueryElement=function(){return d("WAWap").wap("business",null,d("WAWap").wap("verified_name",null))};b.getUserElement=function(a){return null};return a}();g.businessParser=a;g.USyncBusinessProtocol=b}),98); __d("WAWebUsyncContact",["WAWap","WAWebCommsWapMd"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("contact");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};b={type:a.attrString("type")};var c=a.hasAttr("username");c&&(b.username=a.attrString("username"));return b}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"contact"};b.getQueryElement=function(){return d("WAWap").wap("contact",null)};b.getUserElement=function(a){var b=a.getPhone(),c=a.getUsername(),e=a.getType(),f=a.getPin();a=a.getLid();if(b!=null)return d("WAWap").wap("contact",null,b);else if(c!=null)return d("WAWap").wap("contact",{username:d("WAWap").CUSTOM_STRING(c),pin:f!=null?d("WAWap").CUSTOM_STRING(f):d("WAWap").DROP_ATTR,lid:a!=null?d("WAWebCommsWapMd").USER_JID(a):d("WAWap").DROP_ATTR});else if(e!=null)return d("WAWap").wap("contact",{type:d("WAWap").CUSTOM_STRING(e)});return null};return a}();g.contactParser=a;g.USyncContactProtocol=b}),98); __d("WAWebUsyncDevice",["WAWap","WAWebBizCoexGatingUtils"],(function(a,b,c,d,e,f,g){var h=2;function a(a){a.assertTag("devices");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};b=a.maybeChild("key-index-list");a=a.maybeChild("device-list");b=b==null?null:{ts:b.attrTime("ts"),signedKeyIndexBytes:b.hasContent()?b.contentBytes():null,expectedTs:b.hasAttr("expected_ts")?b.attrTime("expected_ts"):void 0};a=a==null?void 0:a.mapChildrenWithTag("device",function(a){var b={id:a.attrInt("id"),keyIndex:a.hasAttr("key-index")?a.attrInt("key-index"):null};d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(a.hasAttr("is_hosted")&&a.attrString("is_hosted")==="true"&&(b.isHosted=!0));return b});return{deviceList:a,keyIndex:b}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"devices"};b.getQueryElement=function(){return d("WAWap").wap("devices",{version:d("WAWap").CUSTOM_STRING(String(h))})};b.getUserElement=function(a){var b=a.getDeviceHash(),c=a.getTs();a=a.getExpectedTs();return!b&&c==null&&a==null?null:d("WAWap").wap("devices",{device_hash:b?d("WAWap").CUSTOM_STRING(b):d("WAWap").DROP_ATTR,ts:c!=null?d("WAWap").INT(c):d("WAWap").DROP_ATTR,expected_ts:a!=null?d("WAWap").INT(a):d("WAWap").DROP_ATTR})};return a}();g.deviceParser=a;g.USyncDeviceProtocol=b}),98); __d("WAWebUsyncDisappearingMode",["WAWap"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("disappearing_mode");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};b=a.attrInt("duration",0);a=a.attrInt("t");return{duration:b,t:a}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"disappearing_mode"};b.getQueryElement=function(){return d("WAWap").wap("disappearing_mode",null)};b.getUserElement=function(a){return null};return a}();g.disappearingModeParser=a;g.USyncDisappearingModeProtocol=b}),98); __d("WAWebUsyncFeature",["WAWap","err"],(function(a,b,c,d,e,f,g){var h={document:(b=d("WAWap")).wap("document",null),encrypt:b.wap("encrypt",null),encrypt_blist:b.wap("encrypt_blist",null),encrypt_contact:b.wap("encrypt_contact",null),encrypt_group_gen2:b.wap("encrypt_group_gen2",null),encrypt_image:b.wap("encrypt_image",null),encrypt_location:b.wap("encrypt_location",null),encrypt_url:b.wap("encrypt_url",null),encrypt_v2:b.wap("encrypt_v2",null),voip:b.wap("voip",null),multi_agent:b.wap("multi_agent",null)};function a(a){a.assertTag("feature");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};var c={};Object.keys(h).forEach(function(b){var d=a.maybeChild(b);d&&(c[b]=d.attrString("value"))});return c}e=function(){var a=b.prototype;a.getName=function(){return"feature"};function b(a){this.queries=a;if(a.length===0)throw c("err")("must specify at least one query")}a.getQueryElement=function(){return d("WAWap").wap("feature",null,this.queries&&this.queries.map(function(a){return h[a]}))};a.getUserElement=function(a){return null};return b}();g.featureParser=a;g.USyncFeaturesProtocol=e}),98); __d("WAWebUsyncLid",["WAWap","WAWebCommsWapMd"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("lid");var b=a.maybeChild("error");return b?{errorCode:b.attrInt("code"),errorText:b.attrString("text")}:a.maybeAttrLidUserJid("val")}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"lid"};b.getQueryElement=function(){return d("WAWap").wap("lid",null)};b.getUserElement=function(a){a=a.getLid();return!a?null:d("WAWap").wap("lid",{jid:a?d("WAWebCommsWapMd").USER_JID(a):d("WAWap").DROP_ATTR})};return a}();g.lidParser=a;g.USyncLidProtocol=b}),98); __d("WAWebUsyncPicture",["WAWap"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("picture");var b=a.maybeChild("error");return b?{errorCode:b.attrInt("code"),errorText:b.attrString("text")}:{id:a.attrInt("id")}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"picture"};b.getQueryElement=function(){return d("WAWap").wap("picture",null)};b.getUserElement=function(a){return null};return a}();g.pictureParser=a;g.USyncPictureProtocol=b}),98); __d("WAWebUsyncStatus",["WAWap"],(function(a,b,c,d,e,f,g){var h=null;function a(a){a.assertTag("status");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};return!a.hasContent()?a.hasAttr("code")&&a.attrInt("code")===401?"":h:a.contentString().length!==0?a.contentString():h}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"status"};b.getQueryElement=function(){return d("WAWap").wap("status",null)};b.getUserElement=function(a){return null};return a}();g.statusParser=a;g.USyncStatusProtocol=b}),98); __d("WAWebUsyncTextStatus",["WAWap"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("text_status");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};b=a.hasAttr("text")?a.attrString("text"):void 0;var c=a.hasChild("emoji")?a.child("emoji"):void 0;c=(c==null?void 0:c.hasAttr("content"))?c==null?void 0:c.attrString("content"):void 0;var d=a.hasAttr("ephemeral_duration_sec")?a.attrInt("ephemeral_duration_sec"):void 0;a=a.hasAttr("last_update_time")?a.attrString("last_update_time"):void 0;return{text:b,emoji:c,ephemeralDurationSeconds:d,lastUpdateTime:a}}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"text_status"};b.getQueryElement=function(){return d("WAWap").wap("text_status",null)};b.getUserElement=function(a){return null};return a}();g.textStatusParser=a;g.USyncTextStatusProtocol=b}),98); __d("WAWebUsyncUsername",["WAWap"],(function(a,b,c,d,e,f,g){function a(a){a.assertTag("username");var b=a.maybeChild("error");if(b)return{errorCode:b.attrInt("code"),errorText:b.attrString("text")};return a.hasContent()?a.contentString():null}b=function(){function a(){}var b=a.prototype;b.getName=function(){return"username"};b.getQueryElement=function(){return d("WAWap").wap("username",null)};b.getUserElement=function(a){return null};return a}();g.usernameParser=a;g.USyncUsernameProtocol=b}),98); __d("WAWebUsync",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebApiContact","WAWebCommsWapMd","WAWebJidToWid","WAWebUsyncBackoff","WAWebUsyncBotProfile","WAWebUsyncBusiness","WAWebUsyncContact","WAWebUsyncDevice","WAWebUsyncDisappearingMode","WAWebUsyncFeature","WAWebUsyncLid","WAWebUsyncPicture","WAWebUsyncStatus","WAWebUsyncTextStatus","WAWebUsyncUsername","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Usync success:"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["usync: ready to query for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Usync warning: a usync query must have at least one user"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["usync query success!"]);k=function(){return a};return a}var l={FEATURE:"feature",DEVICE:"devices",CONTACT:"contact",PICTURE:"picture",STATUS:"status",BUSINESS:"business",DISAPPEARING_MODE:"disappearing_mode",LID:"lid",BOT:"bot",USERNAME:"username",TEXT_STATUS:"text_status"},m={feature:d("WAWebUsyncFeature").featureParser,devices:d("WAWebUsyncDevice").deviceParser,contact:d("WAWebUsyncContact").contactParser,picture:d("WAWebUsyncPicture").pictureParser,status:d("WAWebUsyncStatus").statusParser,business:d("WAWebUsyncBusiness").businessParser,disappearing_mode:d("WAWebUsyncDisappearingMode").disappearingModeParser,lid:d("WAWebUsyncLid").lidParser,bot:d("WAWebUsyncBotProfile").botProfileParser,username:d("WAWebUsyncUsername").usernameParser,text_status:d("WAWebUsyncTextStatus").textStatusParser};function n(a){var b=[];a.forEachChildWithTag("user",function(a){var c={},e=a.maybeChild(l.CONTACT);if(!a.hasAttr("jid")&&e==null)return;Object.keys(l).forEach(function(b){b=l[b];var d=a.maybeChild(b);d&&m[b]&&(c[b]=m[b](d))});a.hasAttr("jid")&&(c.id=d("WAWebJidToWid").deviceJidToUserWid(a.attrDeviceJid("jid")));b.push(c)});return b}var o=new(c("WADeprecatedWapParser"))("usyncParser",function(a){a.assertAttr("type","result");var b={error:{},refresh:{},list:[],sideList:[]};a=a.child("usync");var c=a.child("result"),e=a.child("list");a=a.maybeChild("side_list");Object.keys(l).forEach(function(a){a=l[a];var d=c.maybeChild(a);if(d){var e=d.maybeChild("error");e?b.error[a]={errorCode:e.attrInt("code"),errorText:e.attrString("text"),errorBackoff:e.attrInt("backoff")}:d.hasAttr("refresh")&&(b.refresh[a]=d.attrInt("refresh",0))}});b.list=n(e);a&&(b.sideList=n(a));d("WALogger").LOG(k());return b});a=function(){function a(){this.context="interactive",this.mode="query",this.protocols=[],this.users=[],this.$1=!1}var e=a.prototype;e.withMode=function(a){this.mode=a;return this};e.withContext=function(a){this.context=a;return this};e.withContactProtocol=function(){this.protocols.push(new(d("WAWebUsyncContact").USyncContactProtocol)());return this};e.withBusinessProtocol=function(){this.protocols.push(new(d("WAWebUsyncBusiness").USyncBusinessProtocol)());return this};e.withDeviceProtocol=function(){this.protocols.push(new(d("WAWebUsyncDevice").USyncDeviceProtocol)());return this};e.withDisappearingModeProtocol=function(){this.protocols.push(new(d("WAWebUsyncDisappearingMode").USyncDisappearingModeProtocol)());return this};e.withPictureProtocol=function(){this.protocols.push(new(d("WAWebUsyncPicture").USyncPictureProtocol)());return this};e.withStatusProtocol=function(){this.protocols.push(new(d("WAWebUsyncStatus").USyncStatusProtocol)());return this};e.withTextStatusProtocol=function(){this.protocols.push(new(d("WAWebUsyncTextStatus").USyncTextStatusProtocol)());return this};e.withFeaturesProtocol=function(a){this.protocols.push(new(d("WAWebUsyncFeature").USyncFeaturesProtocol)(a));return this};e.withLidProtocol=function(){this.$1||(this.protocols.push(new(d("WAWebUsyncLid").USyncLidProtocol)()),this.$1=!0);return this};e.withBotProfileProtocol=function(){this.protocols.push(new(d("WAWebUsyncBotProfile").USyncBotProfileProtocol)());return this};e.withUser=function(a,b){b===void 0&&(b=!1);var c=a.getId();b&&this.$1&&c!=null&&(c.isLid()?a.withLid(c):c.isRegularUserPn()&&this.$2(a,d("WAWebWidFactory").toUserWid(c)));this.users.push(a);return this};e.$2=function(a,b){b=d("WAWebApiContact").getCurrentLid(b);b!=null&&a.withLid(b)};e.withUsernameProtocol=function(){this.protocols.push(new(d("WAWebUsyncUsername").USyncUsernameProtocol)());return this};e.$3=function(){var a=this;if(this.protocols.length===0)throw c("err")("a usync query must have at least one protocol");var b=this.users.filter(function(a){var b=a.getId();return b&&c("WAWebWid").isServer(b)?!1:a.validate()});b.length===0&&d("WALogger").WARN(j());var e=d("WAWap").wap("query",null,this.protocols.map(function(a){return a.getQueryElement()}));b=b.map(function(b){var c=b.getId();return d("WAWap").wap("user",{jid:c?d("WAWebCommsWapMd").USER_JID(c):d("WAWap").DROP_ATTR},a.protocols.map(function(a){return a.getUserElement(b)}))});b=d("WAWap").wap("list",null,b);return d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"usync",type:"get",id:d("WAWap").generateId()},d("WAWap").wap("usync",{sid:d("WAWap").generateId(),index:"0",last:"true",mode:d("WAWap").CUSTOM_STRING(this.mode),context:d("WAWap").CUSTOM_STRING(this.context)},e,b))};e.execute=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.$3();d("WALogger").DEV(i(),this.protocols.map(function(a){return a.getName()}));yield d("WAWebUsyncBackoff").waitForBackoff(this);a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,o));if(a.success){d("WALogger").DEV(h()).devConsole(a.result);p(a.result);return a.result}return{error:{all:{errorCode:a.errorCode,errorText:a.errorText,errorType:a.errorType}},refresh:{},list:[]}});function c(){return a.apply(this,arguments)}return c}();return a}();function p(a){Object.keys(l).forEach(function(b){b=l[b];var c=a.error[b];if(c==null)return;c.errorBackoff!=null&&d("WAWebUsyncBackoff").setProtocolBackoffMs(b,c.errorBackoff*1e3)})}g.USyncQuery=a}),98); __d("WAWebUsyncUser",["WALogger","WAWebBizCoexGatingUtils","WAWebWidValidator","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["USync user created with invalid jid: ",""]);h=function(){return a};return a}a=function(){function a(){}var b=a.prototype;b.withId=function(a){this.$1=a;return this};b.withLid=function(a){this.$2=a;return this};b.withDeviceHash=function(a){this.$4=a;return this};b.withTs=function(a){this.$5=a;return this};b.withExpectedTs=function(a){this.$6=a;return this};b.withPhone=function(a){this.$3=a;return this};b.withPersonaId=function(a){this.$7=a;return this};b.withUsername=function(a){this.$8=a;return this};b.withPin=function(a){this.$9=a;return this};b.withType=function(a){this.$10=a;return this};b.getDeviceHash=function(){return this.$4};b.getPhone=function(){return this.$3};b.getId=function(){return this.$1};b.getLid=function(){return this.$2};b.getTs=function(){return this.$5};b.getExpectedTs=function(){return this.$6};b.getPersonaId=function(){return this.$7};b.getUsername=function(){return this.$8};b.getPin=function(){return this.$9};b.getType=function(){return this.$10};b.validate=function(){if(this.$1==null&&this.$3==null&&this.$8==null)throw c("err")("user must have an id, phone or a username");else if(this.$1){var a=d("WAWebWidValidator").validateWid(this.$1.toString(),d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled());if(!a){var b;d("WALogger").WARN(h(),(b=this.$1)==null?void 0:b.toString())}return a}return!0};return a}();g.USyncUser=a}),98); __d("WAWebQueryExistsJob",["WALogger","WAPhoneFindCC","WAWebABProps","WAWebApiContact","WAWebBackendErrors","WAWebDBCreateLidPnMappings","WAWebMexUsersGetUsername","WAWebSetUsernameJob","WAWebUsernameGatingUtils","WAWebUsync","WAWebUsyncUser","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] username info response"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] querying username: "," for contact info"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] username info response"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] querying contact: "," for username info"]);k=function(){return a};return a}function a(a){var b=a.isLid()?"":"+"+a.toString();return a.isLid()?l({type:"lid",wid:a}):l({type:"phone",phone:b})}function e(a){return l({type:"phone",phone:a})}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type==="lid"&&!a.wid.isLid())throw c("err")("queryExist is provided with invalid lid");var b=new(d("WAWebUsyncUser").USyncUser)(),e=new(d("WAWebUsync").USyncQuery)();a.type==="phone"?(e.withContactProtocol(),b.withPhone(a.phone)):b.withId(a.wid);e.withLidProtocol();if(a.type==="phone"){var f=d("WAPhoneFindCC").extractDigits(a.phone)+"@c.us";if(c("WAWebWid").isWid(f)){f=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").createUserWid(f));f&&b.withLid(f)}}e.withUser(b);e.withBusinessProtocol();e.withDisappearingModeProtocol();d("WAWebUsernameGatingUtils").usernameUsyncEnabled()&&e.withUsernameProtocol();f=(yield e.execute());b=f.error.all||f.error.contact;if(b)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode,b.errorText);e=f.list;if(e.length!==1)return null;b=e[0];f=b.id;e=b.contact;var g=b.business,h=b.disappearing_mode,i=b.lid;b=b.username;if(a.type==="phone"&&(e==null?void 0:e.type)!=="in")return null;a={wid:f,biz:g!=null,bizInfo:g};h&&(a.disappearingMode={duration:h.duration,settingTimestamp:h.t});i!=null&&(yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:[{pn:f,lid:d("WAWebWidFactory").createUserWid(i,"lid")}],flushImmediately:!0,learningSource:"usync"}));if(d("WAWebUsernameGatingUtils").usernameUsyncEnabled()){e={userId:f};b!=null&&(e.username=b);yield d("WAWebSetUsernameJob").setUsernamesJob([e])}return a});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(k(),a).devConsole({wid:a});var b=new(d("WAWebUsyncUser").USyncUser)(),c=new(d("WAWebUsync").USyncQuery)();b.withId(a);c.withUser(b);c.withUsernameProtocol();a=(yield c.execute());b=a.error.all||a.error.contact;d("WALogger").LOG(j()).devConsole({res:a,error:b});if(b)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode,b.errorText);c=a.list;if(c.length!==1)return null;b=c[0];if(b.id!=null)return{id:b.id,username:b.username,shouldDelete:!Object.prototype.hasOwnProperty.call(b,"username")}});return o.apply(this,arguments)}function f(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isLid())return;var b,c,e;if(d("WAWebABProps").getABPropConfigValue("mex_usync_username_query")){var f=d("WAWebWidFactory").createUserWid(a.toString()),g=(yield d("WAWebMexUsersGetUsername").getMexUserUsername(f));g!=null?(b=g,c=f):e=!0}else{g=(yield n(a));g!=null&&(b=g.username,c=g.id,e=g.shouldDelete)}if(c==null)return;b!=null?yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:c,username:b}]):e===!0&&(yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:c,username:void 0}]));return b});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(i(),a).devConsole({queryUsername:a});var b=new(d("WAWebUsyncUser").USyncUser)(),c=new(d("WAWebUsync").USyncQuery)();c.withUser(b);c.withContactProtocol();b.withUsername(a);b=(yield c.execute());a=b.error.all||b.error.contact;d("WALogger").LOG(h()).devConsole({res:b,error:a});if(a)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText);c=b.list;if(c.length!==1)return null;a=c[0];b=a.id;c=a.contact;a=c.username;c=c.type;if(c==="out")return null;a!=null?yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:b,username:a}]):yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:b,username:void 0}]);c={wid:b,username:a,biz:!1};return c});return r.apply(this,arguments)}g.queryWidExists=a;g.queryPhoneExists=e;g.queryExist=l;g.queryWidUsernameExists=f;g.queryUsernameExists=q}),98); __d("WAWebSetTextStatusJob",["WAWebDefinePersistedJob","WAWebUpdateTextStatusJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=d("WAWebDefinePersistedJob").defineWebPersistedJob().finalStep("sendMex",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.id,c=a.text,e=a.emoji;a=a.ephemeralDurationSeconds;b=(yield d("WAWebUpdateTextStatusJob").updateTextStatus(b,c,e,a));return b});return function(b){return a.apply(this,arguments)}}()).end();g.setTextStatus=a}),98); __d("WAWebMexEventWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MexEvent:[3782,{isMex:[1,a.TYPES.BOOLEAN],mexEventData:[2,a.TYPES.STRING],mexEventDurationT:[12,a.TYPES.TIMER],mexEventEndTime:[3,a.TYPES.INTEGER],mexEventEnvelopeResponseStatus:[13,a.TYPES.INTEGER],mexEventOperation:[7,a.TYPES.STRING],mexEventPayloadResponseStatus:[14,a.TYPES.INTEGER],mexEventRequestSize:[8,a.TYPES.INTEGER],mexEventResponseSize:[9,a.TYPES.INTEGER],mexEventRetries:[10,a.TYPES.INTEGER],mexEventStartTime:[11,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MexEvent:[]});g.MexEventWamEvent=b}),98); __d("WAWebMexExperiment",["WAWebABProps","WAWebMexEventWamEvent"],(function(a,b,c,d,e,f,g){a=function(){function a(b){this.$1=!1,this.$2="not provided",this.$3=-1,this.$4=-1,this.$2=b,this.$1=a.isGraphQLenabled()}var b=a.prototype;b.toUseGraphQL=function(){return this.$1};b.start=function(){this.$3=Date.now()};b.stop=function(){this.$4=Date.now()};b.logEvent=function(b){var c=b.envelopeResponseStatus;b=b.payloadResponseStatus;if(!a.isExperimentEnabled())return;new(d("WAWebMexEventWamEvent").MexEventWamEvent)({isMex:this.$1,mexEventOperation:this.$2,mexEventStartTime:this.$3,mexEventEndTime:this.$4,mexEventPayloadResponseStatus:b,mexEventEnvelopeResponseStatus:c,mexEventRequestSize:1}).commit()};a.isExperimentEnabled=function(){return d("WAWebABProps").getABPropConfigValue("mex_phase3_enabled")};a.isGraphQLenabled=function(){return a.isExperimentEnabled()&&a.isGraphQLFlagSet()};a.isGraphQLFlagSet=function(){return a.isFlagSet(1)};a.isFlagSet=function(a){var b=d("WAWebABProps").getABPropConfigValue("mex_phase3_status_flags");return(b&a)===a};return a}();g.GraphQlPerfTracker=a}),98); __d("WAWebUpdateTextStatusJob",["WALogger","WAWebMexExperiment","WAWebMexUpdateTextStatusJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateTextStatus:",""]);h=function(){return a};return a}function a(a,b,c,d){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=new(d("WAWebMexExperiment").GraphQlPerfTracker)("update-text-status");f.start();f.toUseGraphQL();b=(yield d("WAWebMexUpdateTextStatusJob").mexUpdateTextStatus(b,c,e));e=(c=b.xwa2_update_text_status)==null?void 0:c.result;f.stop();d("WALogger").LOG(h(),a.toString()).devConsole(b);return{id:a,result:e}});return i.apply(this,arguments)}g.updateTextStatus=a}),98); __d("WAWebSetUsernameJob",["WAJobOrchestratorTypes","WALogger","WAWebApiContact","WAWebBackendApi","WAWebMexSetUsernameJob","WAWebOrchestratorNonPersistedJob","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[username] ",": deleting username in db + collection"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[username] ",": updating "," username in db + collection"]);i=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("setUsernameQueryJob",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebMexSetUsernameJob").mexSetUsernameQueryJob(a));if(b){b=d("WAWebUserPrefsMeUser").getMeUser();yield j([{userId:b,username:(b=a)!=null?b:void 0}]);return!0}return!1}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){var b=a.userId;a=a.username;var c=b.toJid();d("WALogger").LOG(i(),b.toLogString(),a==null||a===""?"empty":"non-empty");return{id:c,username:a}});yield d("WAWebApiContact").bulkUpdateUsernamesInDb(a);yield d("WAWebBackendApi").frontendSendAndReceive("bulkUpdateUsernames",{usernameUpdates:a})});return k.apply(this,arguments)}function c(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){var b=a.userId;a=a.displayNameLID;var c=b.toJid();d("WALogger").LOG(h(),b.toLogString());return{id:c,username:void 0,displayNameLID:a}});yield d("WAWebApiContact").bulkUpdateUsernamesInDb(a);yield d("WAWebBackendApi").frontendSendAndReceive("bulkUpdateUsernames",{usernameUpdates:a})});return l.apply(this,arguments)}g.setUsernameQueryJob=a;g.setUsernamesJob=j;g.deleteUsernamesJob=c}),98); __d("WAWebSyncDeviceAdvDeviceListJob",["WAJobOrchestratorTypes","WAWebAdvSyncDeviceListApi","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a,b,c){a={wids:a,context:b,phash:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncDeviceList",function(a){return d("WAWebAdvSyncDeviceListApi").syncDeviceList(a)}).waitUntilCompleted(a)}function b(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncMyDeviceList",function(a){return d("WAWebAdvSyncDeviceListApi").syncMyDeviceList()},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted()}g.syncDeviceListJob=a;g.syncMyDeviceListJob=b}),98); __d("WAWebBackendJobs.flow",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({Skmsg:"skmsg",Pkmsg:"pkmsg",Msg:"msg",Msmsg:"msmsg"});c=b("$InternalEnum")({Image:"image",Video:"video",Ptv:"ptv",Audio:"audio",Ptt:"ptt",Location:"location",VCard:"vcard",Document:"document",Url:"url",Call:"call",Gif:"gif",Future:"future",ContactArray:"contact_array",LiveLocation:"livelocation",ProfilePic:"profile_pic",Sticker:"sticker",StickerPack:"sticker_pack",Hsm:"hsm",ProductImage:"product_image",Template:"template",MdAppState:"md_app_state",MdHistorySync:"md_history_sync",List:"list",ListResponse:"list_response",Button:"button",ButtonResponse:"button_response",Order:"order",Product:"product",NativeFlowResponse:"native_flow_response"});d=b("$InternalEnum")({Hide:"hide",Show:"show"});f.CiphertextType=a;f.EncMediaType=c;f.DecryptFailType=d}),66); __d("WAWebSignalCommonErrors",["WACustomError"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WACustomError").customError("SignalDecryptionError"));b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WACustomError").customError("SignalMessageCounterError"));g.SignalDecryptionError=a;g.SignalMessageCounterError=b}),98); __d("WAWebVerifyProtobufMsgObjectKeys",["$InternalEnum","WALogger","WAWebCurrentUser","WAWebHandleMsgError","WAWebMsgType","WAWebProtobufsE2E.pb","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Protobuf message keys validation failed: ",""]);h=function(){return a};return a}var i=b("$InternalEnum")({Buttons:1,Template:2,SenderKeyDistribution:3,UnknownMessageKey:4});function j(a,b){switch(a){case"$$unknownFieldCount":return b[a]===0?null:d("WAWebMsgType").MSG_TYPE.UNKNOWN;case"messageContextInfo":return null;case"contactMessage":return d("WAWebMsgType").MSG_TYPE.VCARD;case"contactsArrayMessage":return d("WAWebMsgType").MSG_TYPE.MULTI_VCARD;case"conversation":case"extendedTextMessage":return d("WAWebMsgType").MSG_TYPE.CHAT;case"imageMessage":return d("WAWebMsgType").MSG_TYPE.IMAGE;case"locationMessage":case"liveLocationMessage":return d("WAWebMsgType").MSG_TYPE.LOCATION;case"documentMessage":return d("WAWebMsgType").MSG_TYPE.DOCUMENT;case"audioMessage":return d("WAWebMsgType").MSG_TYPE.AUDIO;case"videoMessage":return d("WAWebMsgType").MSG_TYPE.VIDEO;case"protocolMessage":return d("WAWebMsgType").MSG_TYPE.PROTOCOL;case"highlyStructuredMessage":return d("WAWebMsgType").MSG_TYPE.PROTOCOL;case"statusNotificationMessage":return d("WAWebMsgType").MSG_TYPE.STATUS_NOTIFICATION;case"sendPaymentMessage":case"requestPaymentMessage":case"paymentInviteMessage":return d("WAWebMsgType").MSG_TYPE.PAYMENT;case"declinePaymentRequestMessage":case"cancelPaymentRequestMessage":return d("WAWebMsgType").MSG_TYPE.UNKNOWN;case"stickerMessage":return d("WAWebMsgType").MSG_TYPE.STICKER;case"groupInviteMessage":return d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE;case"templateButtonReplyMessage":return d("WAWebMsgType").MSG_TYPE.TEMPLATE_BUTTON_REPLY;case"productMessage":return d("WAWebMsgType").MSG_TYPE.PRODUCT;case"listMessage":return d("WAWebMsgType").MSG_TYPE.LIST;case"orderMessage":return d("WAWebMsgType").MSG_TYPE.ORDER;case"listResponseMessage":return d("WAWebMsgType").MSG_TYPE.LIST_RESPONSE;case"buttonsResponseMessage":return d("WAWebMsgType").MSG_TYPE.BUTTONS_RESPONSE;case"interactiveMessage":return d("WAWebMsgType").MSG_TYPE.INTERACTIVE;case"interactiveResponseMessage":return d("WAWebMsgType").MSG_TYPE.INTERACTIVE_RESPONSE;case"reactionMessage":return d("WAWebMsgType").MSG_TYPE.REACTION;case"encReactionMessage":return d("WAWebMsgType").MSG_TYPE.REACTION_ENC;case"encCommentMessage":return d("WAWebMsgType").MSG_TYPE.COMMENT;case"pinInChatMessage":return d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE;case"pollCreationMessage":case"pollCreationMessageV2":case"pollCreationMessageV3":return d("WAWebMsgType").MSG_TYPE.POLL_CREATION;case"pollUpdateMessage":return d("WAWebMsgType").MSG_TYPE.POLL_UPDATE;case"keepInChatMessage":return d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT;case"requestPhoneNumberMessage":return d("WAWebMsgType").MSG_TYPE.REQUEST_PHONE_NUMBER;case"ptvMessage":return d("WAWebMsgType").MSG_TYPE.PTV;case"callLogMesssage":return d("WAWebMsgType").MSG_TYPE.CALL_LOG;case"buttonsMessage":return i.Buttons;case"templateMessage":return i.Template;case"senderKeyDistributionMessage":case"fastRatchetKeySenderKeyDistributionMessage":return i.SenderKeyDistribution;case"newsletterAdminInviteMessage":return d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE;case"eventMessage":return d("WAWebMsgType").MSG_TYPE.EVENT_CREATION;case"encEventResponseMessage":return d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE;case"secretEncryptedMessage":return((b=b[a])==null?void 0:b.secretEncType)===d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT?d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED:i.UnknownMessageKey;case"albumMessage":return d("WAWebMsgType").MSG_TYPE.ALBUM;case"stickerPackMessage":return d("WAWebMsgType").MSG_TYPE.STICKER_PACK;case"pollResultSnapshotMessage":return d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT;case"richResponseMessage":return d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE;default:a;return i.UnknownMessageKey}}function k(a){if(a!=null&&typeof a==="object"&&"message"in a){a=a.message;if(a!=null&&typeof a==="object")return a}return null}function a(a){n(a);var b;for(var c of Object.keys(a)){var d=k(a[c]);if(d!=null){var e=l(d);for(e of e){var f=e[0];e[1];typeof f!=="number"&&(b=d)}}else{f=j(c,a);f!=null&&(b=a)}if(b!=null)break}return b}function l(a){var b=[];for(var c of Object.keys(a)){var e=k(a[c]);if(e!=null){var f=l(e);f.length===0?b.push([d("WAWebMsgType").MSG_TYPE.UNKNOWN,c]):b.push.apply(b,l(e))}else{f=j(c,a);f!=null&&b.push([f,c])}}return b}function m(a){return Boolean(a.find(function(a){a=a[0];return typeof a==="number"&&a===i.SenderKeyDistribution}))}function n(a){a=l(a);var b=a.length===1||a.length===2&&m(a);if(!b){d("WAWebCurrentUser").isEmployee()&&d("WALogger").ERROR(h(),a.join()).sendLogs("protobuf-msg-keys-validation-failed-intern");throw new(d("WAWebHandleMsgError").MessageProtobufInvalidMessageTypes)(a.map(function(a){a[0];a=a[1];return a}))}}function o(a){var b=new Set();for(a of l(a)){var d=a[0];a[1];if(typeof d!=="number")b.add(d);else if(i.cast(d)!=null&&(d===i.Buttons||d===i.Template))throw c("err")("Undeclared message types")}return b}function e(a,b){return o(a).has(b)}g.UndeclaredMessageType=i;g.getUnwrappedProtobufMessage=a;g.getProtobufMessageTypesToKeys=l;g.verifyProtobufMessageObjectKeys=n;g.getProtobufMessageTypesSet=o;g.isProtobufHasMessageType=e}),98); __d("WAWebWamEnumE2eCiphertextType",[],(function(a,b,c,d,e,f){a=Object.freeze({MESSAGE:0,PREKEY_MESSAGE:1,SENDER_KEY_MESSAGE:2,MESSAGE_SECRET_MESSAGE:3});f.E2E_CIPHERTEXT_TYPE=a}),66); __d("WAWebWamEnumE2eDestination",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:0,GROUP:1,LIST:2,STATUS:3,CHANNEL:4,INTEROP:5});f.E2E_DESTINATION=a}),66); __d("WAWebBackendJobsCommon",["WAJobOrchestratorTypes","WALogger","WAWap","WAWebAck","WAWebBackendJobs.flow","WAWebHandleMsgCommon","WAWebHandleMsgError","WAWebSendMsgCommonApi","WAWebSignalCommonErrors","WAWebVerifyProtobufMsgObjectKeys","WAWebWamEnumE2eCiphertextType","WAWebWamEnumE2eDestination","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumPlaceholderReasonType","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPlaceholderAddReason Other reason"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPlaceholderAddReason SignalBadMac reason"]);i=function(){return a};return a}var j=2;function a(a){switch(a){case d("WAWebBackendJobs.flow").CiphertextType.Skmsg:return d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE.SENDER_KEY_MESSAGE;case d("WAWebBackendJobs.flow").CiphertextType.Pkmsg:return d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE.PREKEY_MESSAGE;case d("WAWebBackendJobs.flow").CiphertextType.Msg:return d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE.MESSAGE;case d("WAWebBackendJobs.flow").CiphertextType.Msmsg:return d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE.MESSAGE_SECRET_MESSAGE}}function b(a){var b=a.encMediaType,c=a.msgType;a=a.msgPollType;if(c===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.reaction)return d("WAWebWamEnumMediaType").MEDIA_TYPE.REACTION;else if(c===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.medianotify)return d("WAWebWamEnumMediaType").MEDIA_TYPE.MEDIA_EXPRESS_NOTIFY;else if(a===d("WAWebHandleMsgCommon").POLL_TYPES.creation)return d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_CREATE;else if(a===d("WAWebHandleMsgCommon").POLL_TYPES.vote)return d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_VOTE;else if(b)switch(b){case d("WAWebBackendJobs.flow").EncMediaType.Image:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PHOTO;case d("WAWebBackendJobs.flow").EncMediaType.Video:return d("WAWebWamEnumMediaType").MEDIA_TYPE.VIDEO;case d("WAWebBackendJobs.flow").EncMediaType.Ptv:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PUSH_TO_VIDEO;case d("WAWebBackendJobs.flow").EncMediaType.Audio:return d("WAWebWamEnumMediaType").MEDIA_TYPE.AUDIO;case d("WAWebBackendJobs.flow").EncMediaType.Ptt:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PTT;case d("WAWebBackendJobs.flow").EncMediaType.Location:return d("WAWebWamEnumMediaType").MEDIA_TYPE.LOCATION;case d("WAWebBackendJobs.flow").EncMediaType.VCard:return d("WAWebWamEnumMediaType").MEDIA_TYPE.CONTACT;case d("WAWebBackendJobs.flow").EncMediaType.Document:return d("WAWebWamEnumMediaType").MEDIA_TYPE.DOCUMENT;case d("WAWebBackendJobs.flow").EncMediaType.Url:return d("WAWebWamEnumMediaType").MEDIA_TYPE.URL;case d("WAWebBackendJobs.flow").EncMediaType.Call:return d("WAWebWamEnumMediaType").MEDIA_TYPE.CALL;case d("WAWebBackendJobs.flow").EncMediaType.Gif:return d("WAWebWamEnumMediaType").MEDIA_TYPE.GIF;case d("WAWebBackendJobs.flow").EncMediaType.Future:return d("WAWebWamEnumMediaType").MEDIA_TYPE.FUTURE;case d("WAWebBackendJobs.flow").EncMediaType.ContactArray:return d("WAWebWamEnumMediaType").MEDIA_TYPE.CONTACT_ARRAY;case d("WAWebBackendJobs.flow").EncMediaType.LiveLocation:return d("WAWebWamEnumMediaType").MEDIA_TYPE.LIVE_LOCATION;case d("WAWebBackendJobs.flow").EncMediaType.ProfilePic:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PROFILE_PIC;case d("WAWebBackendJobs.flow").EncMediaType.Sticker:return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER;case d("WAWebBackendJobs.flow").EncMediaType.StickerPack:return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER_PACK;case d("WAWebBackendJobs.flow").EncMediaType.Hsm:return d("WAWebWamEnumMediaType").MEDIA_TYPE.HSM;case d("WAWebBackendJobs.flow").EncMediaType.ProductImage:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_IMAGE;case d("WAWebBackendJobs.flow").EncMediaType.Template:return d("WAWebWamEnumMediaType").MEDIA_TYPE.TEMPLATE;case d("WAWebBackendJobs.flow").EncMediaType.MdAppState:return d("WAWebWamEnumMediaType").MEDIA_TYPE.MD_APP_STATE;case d("WAWebBackendJobs.flow").EncMediaType.MdHistorySync:return d("WAWebWamEnumMediaType").MEDIA_TYPE.MD_HISTORY_SYNC;case d("WAWebBackendJobs.flow").EncMediaType.List:return d("WAWebWamEnumMediaType").MEDIA_TYPE.LIST;case d("WAWebBackendJobs.flow").EncMediaType.ListResponse:return d("WAWebWamEnumMediaType").MEDIA_TYPE.LIST_REPLY;case d("WAWebBackendJobs.flow").EncMediaType.Button:return d("WAWebWamEnumMediaType").MEDIA_TYPE.BUTTON_MESSAGE;case d("WAWebBackendJobs.flow").EncMediaType.ButtonResponse:return d("WAWebWamEnumMediaType").MEDIA_TYPE.BUTTON_RESPONSE_MESSAGE;case d("WAWebBackendJobs.flow").EncMediaType.Order:return d("WAWebWamEnumMediaType").MEDIA_TYPE.ORDER;case d("WAWebBackendJobs.flow").EncMediaType.Product:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_IMAGE;case d("WAWebBackendJobs.flow").EncMediaType.NativeFlowResponse:return d("WAWebWamEnumMediaType").MEDIA_TYPE.INTERACTIVE_RESPONSE_NFM}return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE}function k(a){if(a.deviceSentMessage){var b=a.deviceSentMessage.message;return b?k(b):null}else if(a.ephemeralMessage){b=a.ephemeralMessage.message;return b?k(b):null}else if(a.groupMentionedMessage){b=a.groupMentionedMessage.message;return b?k(b):null}else if(a.viewOnceMessageV2Extension){b=a.viewOnceMessageV2Extension.message;return b?k(b):null}else if(a.viewOnceMessage){b=a.viewOnceMessage.message;return b?k(b):null}else if(a.documentWithCaptionMessage){b=a.documentWithCaptionMessage.message;return b?k(b):null}else if(a.botInvokeMessage){b=a.botInvokeMessage.message;return b?k(b):null}else if(a.associatedChildMessage){b=a.associatedChildMessage.message;return b?k(b):null}else if(a.pollCreationOptionImageMessage){b=a.pollCreationOptionImageMessage.message;return b?k(b):null}else if(a.imageMessage)return d("WAWebBackendJobs.flow").EncMediaType.Image;else if(a.stickerMessage)return d("WAWebBackendJobs.flow").EncMediaType.Sticker;else if(a.stickerPackMessage)return d("WAWebBackendJobs.flow").EncMediaType.StickerPack;else if(a.lottieStickerMessage)return d("WAWebBackendJobs.flow").EncMediaType.Sticker;else if(a.locationMessage)return a.locationMessage.isLive===!0?d("WAWebBackendJobs.flow").EncMediaType.LiveLocation:d("WAWebBackendJobs.flow").EncMediaType.Location;else if(a.contactMessage)return d("WAWebBackendJobs.flow").EncMediaType.VCard;else if(a.contactsArrayMessage)return d("WAWebBackendJobs.flow").EncMediaType.ContactArray;else if(a.documentMessage)return d("WAWebBackendJobs.flow").EncMediaType.Document;else if(a.audioMessage)return a.audioMessage.ptt===!0?d("WAWebBackendJobs.flow").EncMediaType.Ptt:d("WAWebBackendJobs.flow").EncMediaType.Audio;else if(a.videoMessage)return a.videoMessage.gifPlayback===!0?d("WAWebBackendJobs.flow").EncMediaType.Gif:d("WAWebBackendJobs.flow").EncMediaType.Video;else if(a.ptvMessage)return d("WAWebBackendJobs.flow").EncMediaType.Ptv;else if(a.buttonsMessage)return d("WAWebBackendJobs.flow").EncMediaType.Button;else if(a.buttonsResponseMessage)return d("WAWebBackendJobs.flow").EncMediaType.ButtonResponse;else if(a.listMessage)return d("WAWebBackendJobs.flow").EncMediaType.List;else if(a.listResponseMessage)return d("WAWebBackendJobs.flow").EncMediaType.ListResponse;else if(a.orderMessage)return d("WAWebBackendJobs.flow").EncMediaType.Order;else if(a.productMessage)return d("WAWebBackendJobs.flow").EncMediaType.Product;else if(a.groupInviteMessage)return d("WAWebBackendJobs.flow").EncMediaType.Url;else if(a.interactiveResponseMessage)return d("WAWebBackendJobs.flow").EncMediaType.NativeFlowResponse;else if(((b=a.extendedTextMessage)==null?void 0:b.matchedText)!=null&&a.extendedTextMessage.matchedText.trim()!=="")return d("WAWebBackendJobs.flow").EncMediaType.Url;return null}function e(a){var b=function(){switch(a){case d("WAWebBackendJobs.flow").EncMediaType.Image:return"image";case d("WAWebBackendJobs.flow").EncMediaType.Video:return"video";case d("WAWebBackendJobs.flow").EncMediaType.Ptv:return"ptv";case d("WAWebBackendJobs.flow").EncMediaType.Audio:return"audio";case d("WAWebBackendJobs.flow").EncMediaType.Ptt:return"ptt";case d("WAWebBackendJobs.flow").EncMediaType.VCard:return"vcard";case d("WAWebBackendJobs.flow").EncMediaType.Document:return"document";case d("WAWebBackendJobs.flow").EncMediaType.Gif:return"gif";case d("WAWebBackendJobs.flow").EncMediaType.ContactArray:return"contact_array";case d("WAWebBackendJobs.flow").EncMediaType.Location:return"location";case d("WAWebBackendJobs.flow").EncMediaType.LiveLocation:return"livelocation";case d("WAWebBackendJobs.flow").EncMediaType.Sticker:return"sticker";case d("WAWebBackendJobs.flow").EncMediaType.List:return"list";case d("WAWebBackendJobs.flow").EncMediaType.ListResponse:return"list_response";case d("WAWebBackendJobs.flow").EncMediaType.ButtonResponse:return"buttons_response";case d("WAWebBackendJobs.flow").EncMediaType.Order:return"order";case d("WAWebBackendJobs.flow").EncMediaType.Product:return"product";case d("WAWebBackendJobs.flow").EncMediaType.Url:return"url";case d("WAWebBackendJobs.flow").EncMediaType.NativeFlowResponse:return"native_flow_response";case d("WAWebBackendJobs.flow").EncMediaType.StickerPack:return"sticker_pack";default:return null}};b=b();if(b)return d("WAWap").CUSTOM_STRING(b);throw c("err")("Unsupported type")}function f(a){return function(b){return b==null?d("WAWap").DROP_ATTR:a(b)}}e=f(e);function l(a){switch(a){case d("WAWebBackendJobs.flow").DecryptFailType.Show:return d("WAWap").DROP_ATTR;case d("WAWebBackendJobs.flow").DecryptFailType.Hide:return d("WAWap").CUSTOM_STRING("hide")}}function m(a){if(a.isUser())return d("WAWebWamEnumE2eDestination").E2E_DESTINATION.INDIVIDUAL;else if(a.isGroup())return d("WAWebWamEnumE2eDestination").E2E_DESTINATION.GROUP;else if(a.isStatus())return d("WAWebWamEnumE2eDestination").E2E_DESTINATION.STATUS;else if(a.isBroadcast())return d("WAWebWamEnumE2eDestination").E2E_DESTINATION.LIST;else if(a.isNewsletter())return d("WAWebWamEnumE2eDestination").E2E_DESTINATION.CHANNEL}function n(a){if(a instanceof d("WAWebHandleMsgError").UnknownDeviceMessageError)return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.UNKNOWN_COMPANION_NO_PREKEY;if(a instanceof d("WAWebSignalCommonErrors").SignalDecryptionError){var b=c("gkx")("26258")?.001:.01;switch(a.message){case"errSignalNoSession":case"errLoadSenderKeySession":return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.SIGNAL_NO_SESSION;case"errSignalInvalidMsg":return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.SIGNAL_INVALID_MESSAGE;case"errSignalInvalidKey":case"errSignalInvalidOneTimeKey":case"errSignalInvalidSignedPreKey":return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.SIGNAL_INVALID_KEY;case"errSignalTooManyMessagesInFuture":case"errSignalGrpTooManyMessagesInFuture":return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.SIGNAL_FUTURE_MESSAGE;case"errInvalidMacWithDecryptedPlaintext":case"errInvalidMacInvalidCipherKey":case"errInvalidMacInvalidCipherKeyNewChain":var e="MsgPlaceholderBadMac-"+a.message;d("WALogger").ERROR(i()).sendLogs(e,{sampling:b});return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.SIGNAL_BAD_MAC}e="MsgPlaceholderOther-"+a.message;d("WALogger").ERROR(h()).sendLogs(e,{sampling:b});return d("WAWebWamEnumPlaceholderReasonType").PLACEHOLDER_REASON_TYPE.OTHER}}function o(a){if(a.interactiveResponseMessage){return(a=a.interactiveResponseMessage.nativeFlowResponseMessage)==null?void 0:a.name}return null}f=f(function(a){return d("WAWap").CUSTOM_STRING(a)});function p(a){switch(a){case d("WAWebAck").EDIT_ATTR.SENDER_REVOKE:return d("WAWebWamEnumEditType").EDIT_TYPE.SENDER_REVOKE;case d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE:return d("WAWebWamEnumEditType").EDIT_TYPE.ADMIN_REVOKE;case d("WAWebAck").EDIT_ATTR.MESSAGE_EDIT:return d("WAWebWamEnumEditType").EDIT_TYPE.EDITED;default:return d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED}}function q(a,b){var c;c=(c=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(a))!=null?c:a;return d("WAWebSendMsgCommonApi").isRevokeMsg(c)?b.subtype==="admin_revoke"?d("WAWebWamEnumEditType").EDIT_TYPE.ADMIN_REVOKE:d("WAWebWamEnumEditType").EDIT_TYPE.SENDER_REVOKE:d("WAWebSendMsgCommonApi").isEditMsg(c)?d("WAWebWamEnumEditType").EDIT_TYPE.EDITED:d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED}function r(a){return a?d("WAJobOrchestratorTypes").JOB_PRIORITY.OFFLINE:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}g.CIPHERTEXT_VERSION=j;g.getMetricE2eCiphertextType=a;g.getMetricMediaType=b;g.mediaTypeFromProtobuf=k;g.encodeMaybeMediaType=e;g.encodeMaybeDecryptFail=l;g.getMetricE2eDestination=m;g.getPlaceholderAddReason=n;g.nativeFlowNameTypeFromProtobuf=o;g.encodeMaybeNativeFlowName=f;g.getMetricEditType=p;g.getMetricEditTypeFromMsg=q;g.getNonCriticalNotificationPriority=r}),98); __d("WAWebAddOnsMarkAddOnsAsReadDb",["Promise","WANullthrows","WAWebDBAddOnProviders","WAWebDBMarkAsReadForTable","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).allSettled(Array.from(a.entries()).map(function(a){var b=a[0];a=a[1];b=c("WANullthrows")(d("WAWebDBAddOnProviders").getProviderForAddOnType(b));return b.markAsRead==null?void 0:b.markAsRead(a)})));for(a of a)if(a.status==="rejected")throw a.reason});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=new Map(),e=d("WAWebDBAddOnProviders").addOnProviders.map(function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var d=(yield b.markAsRead==null?void 0:b.markAsRead(a));c.set(b.type,(b=d)!=null?b:[])});return function(a){return d.apply(this,arguments)}}()),f=[],g=d("WAWebDBMarkAsReadForTable").markAsReadForTable("message-orphans",a.map(String)).then(function(a){f.push.apply(f,a)});e=(yield (h||(h=b("Promise"))).allSettled([].concat(e,[g])));for(g of e)if(g.status==="rejected")throw g.reason;return{updatedAddOns:c,updatedOrphans:f}});return j.apply(this,arguments)}g.markAddOnsAsReadDb=a;g.markUnclassifiedAddOnsAsReadDb=e}),98); __d("WAWebApiTasksScheduledTime",["WAWebModelStorageUtils","WAWebSchemaTasksScheduledTime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSchemaTasksScheduledTime").getTasksScheduledTimeTable().get(a).then(function(a){return a==null?void 0:a.time})}function b(a,b){return d("WAWebModelStorageUtils").getStorage().lock(["tasks-scheduled-time"],function(c){c=c[0];var d={taskName:a,time:b};return c.createOrReplace(d)})}g.getTaskScheduledTime=a;g.updateTaskScheduledTime=b}),98); __d("WAWebLastADVCheckTimeApi",["Promise","WAWebApiTasksScheduledTime"],(function(a,b,c,d,e,f,g){var h,i;function a(){i==null&&(i=d("WAWebApiTasksScheduledTime").getTaskScheduledTime("advDeviceInfoCheck"));return i}function c(a){i=(h||(h=b("Promise"))).resolve(a)}g.getLastADVDeviceInfoCheckTime=a;g.setLastADVDeviceInfoCheckTime=c}),98); __d("WAWebAdvHandlerApi",["Promise","WALogger","WAWebApiDeviceList","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebCryptoCurve25519","WAWebDeviceListPk","WAWebHandleAdvForMessageApi","WAWebHandleAdvForUsyncApi","WAWebIdentityUpdateDeviceTableApi","WAWebLastADVCheckTimeApi","WAWebProtobufsAdv.pb","WAWebSignalCommonUtils","WAWebSignalProtocolStore","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleADVDeviceSyncResultImpl: start to handling "," updates"]);i=function(){return a};return a}function a(a,b,c,d,e,f,g){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h){g===void 0&&(g=!1);var i=(yield d("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime());return d("WAWebHandleAdvForMessageApi").handleADVDeviceUpdateForMessage(a,b,c,e,f,g,i,h)});return j.apply(this,arguments)}function e(a){var d=a.wid,e=a.devices;a=a.type;return a==null?(h||(h=b("Promise"))).reject(c("err")("handleADVDeviceNotification: notification without type")):k(d,e,a)}function f(a){return m(a)}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=null;if(c==="add"){var f=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().loadIdentityKey(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString()));e=f!=null?d("WAWebCryptoCurve25519").toCurveKeyPubKey(d("WAWebSignalCommonUtils").strToBuffer(f)):null;if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&b.deviceList!=null){b.deviceList=(f=b.deviceList)==null?void 0:f.filter(function(a){return a.id!==d("WAWebBizCoexUtils").HOSTED_DEVICE_ID})}}f=(yield d("WAWebApiDeviceList").getDeviceRecord(a));var g=(yield d("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime());c=d("WAWebHandleAdvForUsyncApi").handleDeviceNotification(a,c,b,e,f,g);if(c){if(c.clearRecord){yield d("WAWebIdentityUpdateDeviceTableApi").clearDeviceRecord(a,(f==null?void 0:f.devices)||[],!1,f==null?void 0:f.advAccountType,c==null?void 0:(b=c.update)==null?void 0:b.advAccountType)}return d("WAWebIdentityUpdateDeviceTableApi").bulkApplyDeviceUpdate([{wid:a,update:c.update,currentRecord:f}])}});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()||a.forEach(function(a){var b;if((a==null?void 0:(b=a.devices)==null?void 0:b.deviceList)==null)return;a.devices.deviceList=(b=a.devices.deviceList)==null?void 0:b.filter(function(a){return a.id!==d("WAWebBizCoexUtils").HOSTED_DEVICE_ID})});d("WALogger").LOG(i(),a.length).devConsole(a);var c=a.map(function(a){return a.wid}),e=a.filter(function(a){return(a=a.devices.keyIndex)==null?void 0:a.signedKeyIndexBytes}),f=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkLoadIdentityKey(e.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a.wid).toString()}))),g=new Map();e.forEach(function(a,b){b=f[b];b!=null&&g.set(d("WAWebDeviceListPk").createDeviceListPK(a.wid),b)});var j=(yield d("WAWebApiDeviceList").bulkGetDeviceRecord(c)),k=[],l=[];e=!1;var m=[];a.forEach(function(a,b){var c=g.get(d("WAWebDeviceListPk").createDeviceListPK(a.wid));c=c!=null?d("WAWebCryptoCurve25519").toCurveKeyPubKey(d("WAWebSignalCommonUtils").strToBuffer(c)):null;b=j[b];c=d("WAWebHandleAdvForUsyncApi").handleADVSyncResult(a.wid,a.devices,c,b);if(c==null)return;c.identityUpdatePromise&&m.push(c.identityUpdatePromise);if(c.clearRecord){var f;k.push({wid:a.wid,currentList:(b==null?void 0:b.devices)||[],currentAdvAccountType:b==null?void 0:b.advAccountType,incomingAdvAccountType:(f=c.update)==null?void 0:f.advAccountType});l.push({wid:a.wid,currentRecord:{id:d("WAWebDeviceListPk").createDeviceListPK(a.wid),deleted:!0},update:c.update})}else{if((c==null?void 0:c.fromHandleOmittedResult)===!0){(b==null?void 0:b.advAccountType)===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(c==null?void 0:(f=c.update)==null?void 0:f.advAccountType)===d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE&&(e=!0)}l.push({wid:a.wid,currentRecord:b,update:c.update})}});m.length>0&&(yield (h||(h=b("Promise"))).all(m));yield (h||(h=b("Promise"))).all(k.map(function(a){var b=a.wid,c=a.currentList,e=a.currentAdvAccountType;a=a.incomingAdvAccountType;return d("WAWebIdentityUpdateDeviceTableApi").clearDeviceRecord(b,c,!1,e,a)}));yield d("WAWebIdentityUpdateDeviceTableApi").bulkApplyDeviceUpdate(l,!1,e)});return n.apply(this,arguments)}g.handleADVDeviceUpdateForMessage=a;g.handleADVDeviceNotification=e;g.handleADVDeviceSyncResult=f}),98); __d("WAByteArray",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){b=b;var c=new Uint8Array(a);for(a=a-1;a>=0;a--)c[a]=b&255,b>>>=8;return c}function b(a){return a.buffer.slice(a.byteOffset,a.byteLength+a.byteOffset)}function c(a,b){if(!a||!b)return!1;a=new Uint8Array(a);b=new Uint8Array(b);var c=a.length,d=b.length;if(c!==d)return!1;for(d=0;d<c;d++)if(a[d]!==b[d])return!1;return!0}f.intToBytes=a;f.uint8ArrayToBuffer=b;f.compareArrayBuffer=c}),66); __d("WAWebAdvSignatureApi",["invariant","Promise","WABase64","WABinary","WAByteArray","WALogger","WAWebAdvHandlerApi","WAWebBackendJobs.flow","WAWebBizCoexGatingUtils","WAWebBizCoexHostedAddVerification","WAWebCryptoCurve25519","WAWebProtobufsAdv.pb","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebSignalStoreApi","WAWebSignalUtilsApi","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf","err"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVwithEncs: failed ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVwithEncs: start validate prekey msg "]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: failed"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: successfully verified accountSignature and deviceSignature"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: process adv device identity failed"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: add to coex cache for ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: invalid device signature"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["validateADVIdentity: invalid account signature"]);q=function(){return a};return a}function r(a,b,c,d){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e===void 0&&(e=!1);var f=!1;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(f=a.isHosted());try{var g=d("WAWebWidFactory").toUserWid(a);c=d("WAByteArray").uint8ArrayToBuffer(c);var i=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().loadIdentityKey(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString()));if(i!=null){i=d("WAWebCryptoCurve25519").toCurveKeyPubKey(d("WAWebSignalCommonUtils").strToBuffer(i));if(d("WAWebSignalCommonUtils").bufferEqual(i,c))return!0}i=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,b);i!=null||h(0,56342);b=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().loadIdentityKey(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(g).toString()));g=b!=null?d("WAWebCryptoCurve25519").toCurveKeyPubKey(d("WAWebSignalCommonUtils").strToBuffer(b)):null;if(!E(i,c,g)){d("WALogger").WARN(q());return!1}if(!K(i,c,g,f)){d("WALogger").WARN(p());return!1}b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVDeviceIdentitySpec,i.details);b!=null||h(0,56341);f=i.accountSignatureKey;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(b.accountType===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(o(),a==null?void 0:a.toLogString()),d("WAWebBizCoexHostedAddVerification").addToCoexHostedVerificationCache(a)),f=f&&f.byteLength>0?f:void 0);try{yield d("WAWebAdvHandlerApi").handleADVDeviceUpdateForMessage(a,b,g,f,c,e,b.accountType)}catch(a){d("WALogger").WARN(n()).devConsole(a);return!1}d("WALogger").LOG(m());return!0}catch(a){d("WALogger").WARN(l()).devConsole(a);return!1}});return s.apply(this,arguments)}function a(a,b,c,d){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e===void 0&&(e=!1);c=c.find(function(a){return a.e2eType===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg});if(!c)return!0;d("WALogger").LOG(k());try{a!=null||h(0,56346);c=d("WAWebSignalUtilsApi").extractIdentityKey(c.ciphertext);c!=null||h(0,56345);a=(yield r(a,b,new Uint8Array(c),e));yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();return a}catch(a){d("WALogger").WARN(j(),a);return!1}});return t.apply(this,arguments)}var u=new Uint8Array([6,5]),v=new Uint8Array([6,6]),w=new Uint8Array([6,0]),x=new Uint8Array([6,1]),y=new Uint8Array([6,2]);function e(){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=new Uint8Array(32);self.crypto.getRandomValues(a);a=d("WABase64").encodeB64(a);yield d("WAWebUserPrefsMultiDevice").setADVSecretKey(a);return a});return z.apply(this,arguments)}function f(){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsMultiDevice").getADVSecretKey());if(a==null)throw c("err")("secretKey is null or undefined");return a});return A.apply(this,arguments)}function B(a){if(a==null)return(i||(i=b("Promise"))).reject(c("err")("advSignedDeviceIdentity is null or undefined"));return a.deviceSignature==null?(i||(i=b("Promise"))).reject(c("err")("advSignedDeviceIdentity is missing deviceSignature")):d("WAWebSignalStoreApi").waSignalStore.putADVSignedIdentity(a)}function C(){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSignalStoreApi").waSignalStore.getADVSignedIdentity());if(a==null)throw c("err")("advSignedDeviceIdentity is null or undefined");if(a.deviceSignature==null)throw c("err")("advSignedDeviceIdentity is missing deviceSignature");return d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,a).readByteArray()});return D.apply(this,arguments)}function E(a,b,c){a=G(a,c);c=a.accountSignatureKey;var d=a.accountSignature;a=a.advDeviceIdentityDetails;return F(a,d,b,c)}function F(a,b,c,e){var f=w;if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){var g=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVDeviceIdentitySpec,a);g.deviceType===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(f=u)}e!=null||h(0,56344);b!=null||h(0,56295);g=d("WABinary").Binary.build(f,a,c).readByteArray();return d("WAWebCryptoCurve25519").verifySignature(new Uint8Array(e),g,new Uint8Array(b))}function G(a,b){var c=a.details,e=a.accountSignatureKey||b;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(e=e&&e.byteLength>0?e:b);e!=null||h(0,56344);b=a.accountSignature;b!=null||h(0,56295);c!=null||h(0,70451);return{accountSignatureKey:e,accountSignature:b,advDeviceIdentityDetails:c}}function H(a,b,c){a=a.details;a=d("WABinary").Binary.build(x,a,b.pubKey,c).readByteArray().buffer;return d("WAWebCryptoCurve25519").calculateSignature(b,a)}function I(a,b,c,e,f){var g=x;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(c===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(g=v));c=d("WABinary").Binary.build(g,a,b,f).readByteArray();return d("WAWebCryptoCurve25519").verifySignature(new Uint8Array(b),c,new Uint8Array(e))}function J(a,b){var c=a.details,e=a.deviceSignature;e!=null||h(0,56343);a=a.accountSignatureKey||b;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(a=a&&a.byteLength>0?a:b);a!=null||h(0,56344);c!=null||h(0,70451);return{accountSignatureKey:a,deviceSignature:e,advDeviceIdentityDetails:c}}function K(a,b,c,e){e===void 0&&(e=!1);a=J(a,c);c=a.accountSignatureKey;var f=a.deviceSignature;a=a.advDeviceIdentityDetails;var g=d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(e&&(g=d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED));return I(a,b,g,f,c)}function L(){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebUserPrefsMultiDevice").setADVSecretKey(void 0)});return M.apply(this,arguments)}function N(a,b){var c=a.details;a=a.accountSignature;a!=null||h(0,56295);c=d("WABinary").Binary.build(y,c).readByteArray();return d("WAWebCryptoCurve25519").verifySignature(new Uint8Array(b),c,new Uint8Array(a))}g.validateADVwithIdentityKey=r;g.validateADVwithEncs=a;g.ADV_HOSTED_PREFIX_DEVICE_IDENTITY_ACCOUNT_SIGNATURE=u;g.generateADVSecretKey=e;g.getADVSecretKey=f;g.setADVSignedIdentity=B;g.getADVEncodedIdentity=C;g.verifyDeviceIdentityAccountSignature=E;g.generateDeviceSignature=H;g.clearADVSecretKey=L;g.verifyKeyIndexListAccountSignature=N}),98); __d("WAWebHandleAdvForMessageApi",["invariant","WAJids","WAWebApiDeviceList","WAWebHandleAdvListResetApi","WAWebHandleAdvNoListResetApi","WAWebSignalCommonUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function a(a,b,c,d,e,f,g,h){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,i,j){g===void 0&&(g=!1);var k=b.rawId,l=b.timestamp;b=b.keyIndex;k!=null||h(0,56258);l!=null||h(0,56257);b!=null||h(0,56256);l={rawId:k,timestamp:l,keyIndex:b};b=a.device;b!=null&&b!==d("WAJids").DEFAULT_DEVICE_ID||h(0,56259);b=d("WAWebWidFactory").toUserWid(a);b=(yield d("WAWebApiDeviceList").getDeviceRecord(b));c=c==null||e!=null&&!d("WAWebSignalCommonUtils").bufferEqual(c,e);return!b||b.deleted||b.rawId!==k||c?d("WAWebHandleAdvListResetApi").handleListReset(a,l,c?e:null,f,b,g,i,j):d("WAWebHandleAdvNoListResetApi").handleNoListReset(a,l,f,b,g,i,j)});return i.apply(this,arguments)}g.handleADVDeviceUpdateForMessage=a}),98); __d("WAWebAdvExpectedTsApi",["WATimeUtils"],(function(a,b,c,d,e,f,g){function a(a,b,c){var d=b==null?void 0:b.timestamp;if(d==null)return{expectedTs:void 0,expectedTsLastDeviceJobTs:void 0,expectedTsUpdateTs:void 0};var e,f,g;b!=null&&!b.deleted&&(e=b.expectedTs,f=b.expectedTsLastDeviceJobTs,g=b.expectedTsUpdateTs);return h(a,d,c,e,f,g)}function h(a,b,c,e,f,g){f={expectedTs:e,expectedTsLastDeviceJobTs:f,expectedTsUpdateTs:g};if(b>=a||e!=null&&e>=a)return f;f.expectedTs=a;f.expectedTsLastDeviceJobTs=(g=c)!=null?g:void 0;(e==null||b>=e)&&(f.expectedTsUpdateTs=d("WATimeUtils").unixTimeWithoutClockSkewCorrection());return f}function b(a,b,c,d){if(c==null||c.deleted)return!1;if(c.expectedTs==null)return!1;if(a>=c.expectedTs)return!0;return a<c.expectedTs&&b===c.expectedTs&&d!=null&&(c.expectedTsLastDeviceJobTs==null||d>c.expectedTsLastDeviceJobTs)?!0:!1}g.computeExpectedTsForDeviceRecord=a;g.computeNewExpectedTs=h;g.shouldClearExpectedTs=b}),98); __d("WAWebHandleAdvListResetApi",["invariant","WAJids","WALongInt","WATimeUtils","WAWebABProps","WAWebAdvExpectedTsApi","WAWebBizCoexGatingUtils","WAWebCryptoCurve25519","WAWebDeviceListPk","WAWebIdentityUpdateDeviceTableApi","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){function a(a,b,c,d,e,f,g,h){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,i,j,k){var l;i===void 0&&(i=!1);var m=b.rawId,n=b.timestamp;b=b.keyIndex;n=d("WALongInt").numberOrThrowIfTooLarge(n);var o=a.device;o!=null&&o!==d("WAJids").DEFAULT_DEVICE_ID||h(0,56259);var p=d("WAWebWidFactory").toUserWid(a),q=0;q=(l=g==null?void 0:g.timestamp)!=null?l:d("WATimeUtils").pastUnixTime((d("WAWebABProps").getABPropConfigValue("num_days_key_index_list_expiration")-1)*d("WATimeUtils").DAY_SECONDS);if(g!=null&&!g.deleted){if(g.timestamp>n)throw c("err")("handleADVDeviceIdentity: out-of-order timestamp detected");yield d("WAWebIdentityUpdateDeviceTableApi").clearDeviceRecord(p,g.devices,i)}e&&(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(p).toString(),d("WAWebCryptoCurve25519").toSignalCurvePubKey(e)));l={id:d("WAWebDeviceListPk").createDeviceListPK(a),rawId:m,timestamp:q,devices:[{id:o,keyIndex:b},{id:d("WAJids").DEFAULT_DEVICE_ID,keyIndex:0}],validIndexes:null,currentIndex:null,deleted:!1};g=d("WAWebAdvExpectedTsApi").computeExpectedTsForDeviceRecord(n,l,j);l.expectedTs=g.expectedTs;l.expectedTsLastDeviceJobTs=g.expectedTsLastDeviceJobTs;l.expectedTsUpdateTs=g.expectedTsUpdateTs;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(k!=null&&(l.advAccountType=k));yield d("WAWebIdentityUpdateDeviceTableApi").bulkApplyDeviceUpdate([{wid:p,update:l,currentRecord:null}],i);yield d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString(),d("WAWebCryptoCurve25519").toSignalCurvePubKey(f))});return i.apply(this,arguments)}g.handleListReset=a}),98); __d("WAWebHandleAdvNoListResetApi",["invariant","WAJids","WALongInt","WAWebAdvExpectedTsApi","WAWebBizCoexGatingUtils","WAWebCryptoCurve25519","WAWebIdentityUpdateDeviceTableApi","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){function a(a,b,c,d,e,f,g){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,i,j){g===void 0&&(g=!1);var k=b.timestamp;b=b.keyIndex;k=d("WALongInt").numberOrThrowIfTooLarge(k);var l=a.device;l!=null&&l!==d("WAJids").DEFAULT_DEVICE_ID||h(0,56259);if(f.timestamp>=k&&f.validIndexes&&!f.validIndexes.includes(b))throw c("err")("handleADVDeviceIdentity: out-of-order timestamp detected");var m=new Map(f.devices.map(function(a){return[a.id,a.keyIndex]}));if(!m.has(l)||m.get(l)!==b){m.set(l,b);l=Array.from(m.entries()).map(function(a){var b=a[0];a=a[1];return{id:b,keyIndex:a}});b=babelHelpers["extends"]({},f,{devices:l,deleted:!1});m=d("WAWebAdvExpectedTsApi").computeExpectedTsForDeviceRecord(k,b,i);b.expectedTs=m.expectedTs;b.expectedTsLastDeviceJobTs=m.expectedTsLastDeviceJobTs;b.expectedTsUpdateTs=m.expectedTsUpdateTs;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(b.advAccountType=j);yield d("WAWebIdentityUpdateDeviceTableApi").bulkApplyDeviceUpdate([{wid:d("WAWebWidFactory").toUserWid(a),update:b,currentRecord:f}],g,!0);yield d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString(),d("WAWebCryptoCurve25519").toSignalCurvePubKey(e))}});return i.apply(this,arguments)}g.handleNoListReset=a}),98); __d("WAWebHandleAdvDeviceNotificationApi",["WAJids","WALogger","WALongInt","WAWebAdvExpectedTsApi","WAWebBizCoexGatingUtils","WAWebBizCoexHostedAddVerification","WAWebBizCoexUtils","WAWebDeviceListPk","WAWebHandleAdvDeviceNotificationUtils","WAWebProtobufsAdv.pb"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Clear record due to mismatch between local ADV account type and incoming ADV account type of "," for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDeviceAddNotification: add to coex cache for ",""]);i=function(){return a};return a}function a(a,b,c,e,f,g,j){if(!g||g.deleted){d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&d("WAWebBizCoexUtils").triggerUsyncForCoexDeviceAdd(b,a);return null}if(c<g.timestamp)return null;if(f==null)return null;f=d("WAWebHandleAdvDeviceNotificationUtils").decodeSignedKeyIndexBytes(f,e);if(!f)return null;e=f.rawId;var k=d("WALongInt").numberOrThrowIfTooLarge(f.timestamp),l=null;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(l=f.accountType,l===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(i(),a==null?void 0:a.toLogString()),d("WAWebBizCoexHostedAddVerification").addToCoexHostedVerificationCache(a)));if(k!==c)return null;c=!1;var m=null,n=g.timestamp;g.rawId!==e?c=!0:m=g.devices;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(g.advAccountType!=null&&(g.advAccountType!==l&&(c=!0,d("WALogger").LOG(h(),l,a==null?void 0:a.toLogString()))));var o=new Set(f.validIndexes),p=f.currentIndex||0,q=m==null?[]:m.filter(function(a){return a.id!==d("WAJids").DEFAULT_DEVICE_ID&&(o.has(a.keyIndex)||a.keyIndex>p)});b.forEach(function(a){var b=a.id;a=a.keyIndex;b!==d("WAJids").DEFAULT_DEVICE_ID&&a!=null&&o.has(a)&&q.push({id:b,keyIndex:a})});q.push({id:d("WAJids").DEFAULT_DEVICE_ID,keyIndex:0});g={id:d("WAWebDeviceListPk").createDeviceListPK(a),rawId:e,timestamp:n,validIndexes:Array.from(o),devices:q,currentIndex:f.currentIndex,deleted:!1};m=d("WAWebAdvExpectedTsApi").computeExpectedTsForDeviceRecord(k,g,j);g.expectedTs=m.expectedTs;g.expectedTsLastDeviceJobTs=m.expectedTsLastDeviceJobTs;g.expectedTsUpdateTs=m.expectedTsUpdateTs;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(l!=null&&(g.advAccountType=l));return{update:g,clearRecord:c}}function b(a,b,c){if(c==null||c.deleted)return null;if(b<c.timestamp)return null;var e=new Map(a.map(function(a){return[a.id,a.keyIndex]}));b=c.devices.filter(function(a){if(a.id!==d("WAJids").DEFAULT_DEVICE_ID){var b=e.get(a.id);return b==null||b!==a.keyIndex}return!1});b.push({id:d("WAJids").DEFAULT_DEVICE_ID,keyIndex:0});return{update:babelHelpers["extends"]({},c,{devices:b}),clearRecord:!1}}g.handleDeviceAddNotification=a;g.handleDeviceRemoveNotification=b}),98); __d("WAWebHandleAdvDeviceNotificationUtils",["WALogger","WAWebAdvSignatureApi","WAWebCryptoCurve25519","WAWebProtobufsAdv.pb","WAWebSignalCommonUtils","WAWebSignalProtocolStore","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["rawId is null"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["timestamp is null"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["decode failed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["account signature verification failed"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["accountSignatureKey is null"]);l=function(){return a};return a}function a(a,b){var c;try{c=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedKeyIndexListSpec,b)}catch(a){return null}if(!d("WAWebAdvSignatureApi").verifyKeyIndexListAccountSignature(c,a))return null;var e;try{e=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVKeyIndexListSpec,c.details)}catch(a){return null}b=e;a=b.timestamp;var f=b.rawId,g=b.validIndexes,h=b.currentIndex;b=b.accountType;if(a==null)return null;return f==null?null:{timestamp:a,rawId:f,validIndexes:g,currentIndex:h,accountType:b}}function b(a,b){var c;try{c=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedKeyIndexListSpec,b)}catch(a){return null}b=c.accountSignatureKey;if(b==null){d("WALogger").LOG(l()).tags("verifySKeyIndexWithAccSigKey");return null}if(!d("WAWebAdvSignatureApi").verifyKeyIndexListAccountSignature(c,b)){d("WALogger").LOG(k()).tags("verifySKeyIndexWithAccSigKey");return null}var e;try{e=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVKeyIndexListSpec,c.details)}catch(a){d("WALogger").LOG(j()).tags("verifySKeyIndexWithAccSigKey");return null}var f=e,g=f.timestamp,m=f.rawId,n=f.validIndexes,o=f.currentIndex;f=f.accountType;if(g==null){d("WALogger").LOG(i()).tags("verifySKeyIndexWithAccSigKey");return null}if(m==null){d("WALogger").LOG(h()).tags("verifySKeyIndexWithAccSigKey");return null}a=d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString(),d("WAWebCryptoCurve25519").toSignalCurvePubKey(b));return{timestamp:g,rawId:m,validIndexes:n,currentIndex:o,accountType:f,identityUpdatePromise:a}}g.decodeSignedKeyIndexBytes=a;g.verifySKeyIndexWithAccSigKey=b}),98); __d("WAWebHandleAdvOmittedResultApi",["WAJids","WAWebAdvExpectedTsApi","WAWebProtobufsAdv.pb"],(function(a,b,c,d,e,f,g){function a(a,b,c,e){if(!b||b.deleted)return null;if(a!=null&&a<b.timestamp)return null;var f=babelHelpers["extends"]({},b);a!=null&&(f.timestamp=a,d("WAWebAdvExpectedTsApi").shouldClearExpectedTs(a,c,b,e)&&(f.expectedTs=void 0,f.expectedTsLastDeviceJobTs=void 0,f.expectedTsUpdateTs=void 0));f.devices=[{id:d("WAJids").DEFAULT_DEVICE_ID,keyIndex:0}];b.advAccountType===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(f.advAccountType=d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE);return{update:f,clearRecord:!1,fromHandleOmittedResult:!0}}g.handleOmittedResult=a}),98); __d("WAWebHandleAdvForUsyncApi",["invariant","WAJids","WALogger","WAWebHandleAdvDeviceNotificationApi","WAWebHandleAdvKeyIndexResultApi","WAWebHandleAdvOmittedResultApi"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processADVSyncResult: drop response with companion device but no keyIndexbytes"]);i=function(){return a};return a}function a(a,b,c,e,f){var g=b.deviceList;b=b.keyIndex;if(b==null||b.signedKeyIndexBytes==null){if(g!=null&&g.some(function(a){return a.id!==d("WAJids").DEFAULT_DEVICE_ID})){d("WALogger").LOG(i());return}return d("WAWebHandleAdvOmittedResultApi").handleOmittedResult(b==null?void 0:b.ts,e,b==null?void 0:b.expectedTs,f)}var h=b.ts,j=b.expectedTs;b=b.signedKeyIndexBytes;return d("WAWebHandleAdvKeyIndexResultApi").handleKeyIndexResult(a,g,h,b,c,e,f,j)}function b(a,b,c,e,f,g){var i=c.deviceList;c=c.keyIndex;i!=null||h(0,75739,b);c!=null||h(0,75740,b);var j=c.ts,k=c.signedKeyIndexBytes;if(b==="add"){k!=null||h(0,75741,b);return d("WAWebHandleAdvDeviceNotificationApi").handleDeviceAddNotification(a,i,j,k,e,f,g)}if(b==="remove")return d("WAWebHandleAdvDeviceNotificationApi").handleDeviceRemoveNotification(i,c.ts,f)}g.handleADVSyncResult=a;g.handleDeviceNotification=b}),98); __d("WAWebHandleAdvKeyIndexResultApi",["invariant","WAJids","WALogger","WALongInt","WAWebAdvExpectedTsApi","WAWebBizCoexGatingUtils","WAWebBizCoexHostedAddVerification","WAWebDeviceListPk","WAWebHandleAdvDeviceNotificationUtils","WAWebProtobufsAdv.pb"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Clear record to force hosted notification update"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Clear record due to mismatch between local ADV account type and incoming ADV account type of "," for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleKeyIndexResult: add to coex cache for ",""]);k=function(){return a};return a}var l=99;function a(a,b,c,e,f,g,m,n){if((g==null?void 0:g.timestamp)!=null&&c<g.timestamp)return null;var o=null;if(d("WAWebBizCoexGatingUtils").hostedOverrideAdvAccountSignatureKeyEnabled()&&b!=null&&b.some(function(a){return!!a.isHosted})){o=d("WAWebHandleAdvDeviceNotificationUtils").verifySKeyIndexWithAccSigKey(a,e);if(!o)return null}else{if(f==null)return null;o=d("WAWebHandleAdvDeviceNotificationUtils").decodeSignedKeyIndexBytes(f,e);if(!o)return null}f=o.rawId;e=d("WALongInt").numberOrThrowIfTooLarge(o.timestamp);var p=null;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(p=o.accountType,p===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(k(),a==null?void 0:a.toLogString()),d("WAWebBizCoexHostedAddVerification").addToCoexHostedVerificationCache(a)));if(e!==c)return null;c=!1;var q=null;b=b;if(g&&!g.deleted){b==null&&(b=g.devices);g.rawId!==f?c=!0:q=g.devices;if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){var r=g.advAccountType!=null&&g.advAccountType!==p||g!=null&&p===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&p!==(g==null?void 0:g.advAccountType);r&&(c=!0,d("WALogger").LOG(j(),p,a==null?void 0:a.toLogString()))}}else if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){r=p===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(g==null?void 0:g.deletedChangedToHost)!==!0;r&&(c=!0,d("WALogger").DEV(i()))}var s=new Map(),t=new Set(o.validIndexes),u=o.currentIndex||0;b&&b.forEach(function(a){var b=a.keyIndex;b!=null&&t.has(b)&&(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(a.id===l&&(a.isHosted===!0||h(0,76137))),s.set(a.id,b))});q!=null&&q.forEach(function(a){a.keyIndex>u&&s.set(a.id,a.keyIndex)});s.set(d("WAJids").DEFAULT_DEVICE_ID,0);r=Array.from(s.entries()).map(function(a){var b=a[0];a=a[1];return d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&b===l?{id:b,keyIndex:a,isHosted:!0}:{id:b,keyIndex:a}});b=e;q={id:d("WAWebDeviceListPk").createDeviceListPK(a),rawId:f,timestamp:b,validIndexes:Array.from(t),devices:r,currentIndex:o.currentIndex,deleted:!1,advAccountType:p};!c&&!d("WAWebAdvExpectedTsApi").shouldClearExpectedTs(e,n,g,m)&&(g&&!g.deleted&&(q.expectedTs=g.expectedTs,q.expectedTsLastDeviceJobTs=g.expectedTsLastDeviceJobTs,q.expectedTsUpdateTs=g.expectedTsUpdateTs));return o.identityUpdatePromise?{update:q,clearRecord:c,identityUpdatePromise:o.identityUpdatePromise}:{update:q,clearRecord:c}}g.handleKeyIndexResult=a}),98); __d("WAWebGroupsParticipantsApi",["WAWebAdvSyncDeviceListApi","WAWebDBGroupParticipant","WAWebDBParticipantTypes","WAWebGroupType","WAWebOfflineDeviceCache","WAWebPnhCagIncognito","WAWebSchemaGroupMetadata","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.group,c=a.participants,e=a.isOffline,f=a.groupInfo;a=a.skipDeviceSync;a=a===void 0?!1:a;var g=[],h=[];c.forEach(function(a){a.isAdmin&&g.push(a.id),a.isSuperAdmin&&h.push(a.id)});var i=g.some(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(a)}),j=!1;f!=null&&(j=Boolean(f.incognito)&&Boolean(f.defaultSubgroup));j=j?d("WAWebPnhCagIncognito").augmentedCagGroupParticipantList(i,c):c.map(function(a){a=a.id;return a});a?i=j:i=(yield q(j,e));return d("WAWebDBGroupParticipant").replaceParticipants({group:b,participants:c,admins:g,superAdmins:h,deviceIds:i,groupInfo:f})});return h.apply(this,arguments)}function e(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.group,e=a.participants,f=a.isOffline;a=a.reason;var g=b.toString(),h=!1,i=[],j=d("WAWebUserPrefsMeUser").getMeUser(),k=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(g));if(k==null)throw c("err")("addParticipants: groupMetadataRecord is null");var l=Boolean(k.defaultSubgroup),m=k.isLidAddressingMode===!0,n=e.some(function(a){return a.id.isLid()});g=(yield d("WAWebSchemaParticipant").getParticipantTable().get(g));g!=null&&(i=g.admins.map(function(a){return d("WAWebWidFactory").createWid(a)}),h=i.some(function(a){return j&&j.equals(a)})||a===d("WAWebGroupType").ADD_REASON.DEFAULT_SUBGROUP_PROMOTE);if(n&&!l&&!m)return;g=e.map(function(a){a=a.id;return a});l&&(g=a===d("WAWebGroupType").ADD_REASON.DEFAULT_SUBGROUP_PROMOTE?[].concat(i,g,[j]):d("WAWebPnhCagIncognito").augmentedCagGroupParticipantList(h,e));n=(yield q(g,f));return d("WAWebDBGroupParticipant").updateDBParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.ADD,participants:e,deviceIds:n},k,f)});return i.apply(this,arguments)}function f(a){var b=a.group,c=a.participants,e=a.timestamp,f=a.author,g=a.reason,h=a.groupMetadata;a=a.isOffline;return d("WAWebDBGroupParticipant").updateDBParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.REMOVE,participants:c,timestamp:e,author:f,reason:g},h,a)}function j(a){var b=a.group,c=a.participants,e=a.groupMetadata;a=a.isOffline;return d("WAWebDBGroupParticipant").updateDBParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.DEMOTE,participants:c},e,a)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.group,c=a.participants,e=a.groupMetadata;a=a.isOffline;var f=b.toString(),g=d("WAWebUserPrefsMeUser").getMeUser(),h=c.some(function(a){return g.equals(a.id)}),i;if(h){h=(yield d("WAWebSchemaParticipant").getParticipantTable().get(f));if(h!=null){f=Boolean(e.defaultSubgroup);f&&(f=h.admins.map(function(a){return d("WAWebWidFactory").createWid(a)}),i=(yield q([].concat(f,[g]),a)))}}return d("WAWebDBGroupParticipant").updateDBParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.PROMOTE,participants:c,deviceIds:i},e,a)});return l.apply(this,arguments)}function m(a){var b=a.group,c=a.participants;a=a.isOffline;return d("WAWebDBGroupParticipant").updateCommunityParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE,participants:c},a)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.group;a=a.newSuperAdmin;return d("WAWebDBGroupParticipant").setDBGroupSuperAdmin(b,a)});return o.apply(this,arguments)}function p(a){var b=a.group,c=a.participants;a=a.isOffline;return d("WAWebDBGroupParticipant").updateCommunityParticipants(b,{action:d("WAWebDBParticipantTypes").PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE,participants:c},a)}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);if(b===!0){a.forEach(function(a){d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(String(a))});return a}b=(yield d("WAWebAdvSyncDeviceListApi").syncAndGetDeviceList(a));var c=[];b.forEach(function(b,e){if(!b)c.push(a[e]);else{var f=b.id;e=b.devices;c=c.concat(e.map(function(a){return d("WAWebWidFactory").createDeviceWidFromDeviceListPk(f,a.id,a.isHosted)}))}});return c});return r.apply(this,arguments)}function s(a){return d("WAWebSchemaParticipant").getParticipantTable().bulkGet(a.map(function(a){return a.toString()}))}function t(a){return d("WAWebSchemaParticipant").getParticipantTable().get(a.toString())}function u(a){a=a==null?void 0:a.participants;if(a==null)return!1;var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b!=null&&a.includes(b.toString()))return!0;b=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();return b!=null&&a.includes(b.toString())?!0:!1}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return u(yield t(a))});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield s(a)).map(u)});return y.apply(this,arguments)}g.updateParticipants=a;g.addParticipants=e;g.removeParticipants=f;g.demoteParticipants=j;g.promoteParticipants=k;g.promoteCommmunityParticipants=m;g.setGroupSuperAdmin=n;g.demoteCommmunityParticipants=p;g.bulkGetParticipants=s;g.getParticipants=t;g.checkMyMembership=v;g.bulkCheckMyMembership=x}),98); __d("WAWebApiUnjoinedSubgroupMetadataStore",["WAWebSchemaUnjoinedSubgroupMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().remove(a.toString())}function h(a){var b={},c=a.defaultSubgroup,d=a.generalSubgroup,e=a.parentGroupId,f=babelHelpers.objectWithoutPropertiesLoose(a,["defaultSubgroup","generalSubgroup","parentGroupId"]);c!=null&&(b.defaultSubgroup=c);d!=null&&(b.generalSubgroup=d);e!=null&&(b.parentGroup=e.toString());return babelHelpers["extends"]({},f,b,{id:a.id.toString(),hiddenSubgroup:(c=a.hiddenSubgroup)!=null?c:!1,membershipApprovalMode:(d=a.membershipApprovalMode)!=null?d:!1,membershipApprovalRequest:(e=a.membershipApprovalRequest)!=null?e:!1})}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.unjoinedSubgroups,c=a.parentGroupId;a=a.link;if(!a){yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkRemove(b.map(function(a){return a.id.toString()}));return}a=[];var e=(yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkGet(b.map(function(a){return a.id.toString()})));a=b.map(function(a,b){b=e[b];var d={subject:a.subject,subjectTime:a.subjectTime||0};if(b){var f=b.subjectTime||0;f>d.subjectTime&&(d={subject:b.subject,subjectTime:f})}return h(babelHelpers["extends"]({},a,d,{parentGroupId:c}))});yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkCreateOrMerge(a)});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.unjoinedSubgroupIds;a=a.parentGroupId;a=(yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().equals(["parentGroup"],a.toString()));a=a.map(function(a){return a.id});var c=b.map(function(a){return a.toString()});b=a.filter(function(a){return!c.includes(a)});yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkRemoveByIndex(["id"],b)});return j.apply(this,arguments)}function f(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().get(a.toString()));if(a!=null){a=babelHelpers["extends"]({},a,{membershipApprovalRequest:b});yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkCreateOrMerge([a])}});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkGet(a.map(function(a){return a.id.toString()}))),c=[];a.forEach(function(a,d){d=b[d];d&&c.push(babelHelpers["extends"]({},d,{size:a.participantCount}))});yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().bulkCreateOrMerge(c)});return m.apply(this,arguments)}g.removeUnjoinedSubgroupMetadataFromStorage=a;g.updateUnjoinedSubgroups=c;g.cleanUnjoinedSubgroups=e;g.updateMembershipApprovalRequestinDB=f;g.updateSizeInDB=l}),98); __d("WAWebGroupUnjoinedSubgroupJob",["WAJobOrchestratorTypes","WAWebApiUnjoinedSubgroupMetadataStore","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a,b,c){c===void 0&&(c=!0);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateUnjoinedSubgroups",function(a){return d("WAWebApiUnjoinedSubgroupMetadataStore").updateUnjoinedSubgroups(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({unjoinedSubgroups:a,parentGroupId:b,link:c})}function b(a,b){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("cleanUnjoinedSubgroups",function(a){return d("WAWebApiUnjoinedSubgroupMetadataStore").cleanUnjoinedSubgroups(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({unjoinedSubgroupIds:a,parentGroupId:b})}g.updateUnjoinedSubgroupsJob=a;g.cleanUnjoinedSubgroupsJob=b}),98); __d("WAWebUpdateDbForCommunityAction",["Promise","WAWebDBCommunity","WAWebDBGroupsGroupMetadata","WAWebGroupUnjoinedSubgroupJob","WAWebGroupsParticipantsApi","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(a,b){return l(a,b,!1)}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){a=(yield (h||(h=b("Promise"))).all([d("WAWebDBCommunity").getJoinedSubgroupsMetadata(d("WAWebWidFactory").createWid(a.id)).then(function(a){return a.filter(function(a){return!d("WAWebWidFactory").createWid(a.id).equals(c)})}),d("WAWebDBCommunity").getUnjoinedSubgroupsMetadata(d("WAWebWidFactory").createWid(a.id))]));var f=a[0];a=a[1];f=f.concat(a).map(function(a){var b=a.id;a=a.subject;return{id:d("WAWebWidFactory").createWid(b),subject:a}});return i(e,f)});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b.forEach(function(b){b.parentGroupId=c?a:void 0,b.generalSubgroup=c?b.generalSubgroup:void 0,b.hiddenSubgroup=c?b.hiddenSubgroup:void 0});b=p(b,yield n(b.map(function(a){return a.id})));var e=b.joinedSubgroups;b=b.unjoinedSubgroups;e=e.map(function(b){return d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(b.id,{parentGroup:c?a.toString():void 0,generalSubgroup:c?b.generalSubgroup:void 0,hiddenSubgroup:c?b.hiddenSubgroup:void 0})});b=d("WAWebGroupUnjoinedSubgroupJob").updateUnjoinedSubgroupsJob(b,a,c);return[].concat(e,[b])});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map((yield d("WAWebGroupsParticipantsApi").bulkGetParticipants(a)).filter(Boolean).map(function(a){return[a.groupId,a.participants]})),c=d("WAWebUserPrefsMeUser").getMeUser().toString();return function(a){return(a=(a=b.get(a.toString()))==null?void 0:a.includes(c))!=null?a:!1}});return o.apply(this,arguments)}function p(a,b){return a.reduce(function(a,c){b(c.id)?a.joinedSubgroups=a.joinedSubgroups.concat(c):a.unjoinedSubgroups=a.unjoinedSubgroups.concat(c);return a},{joinedSubgroups:[],unjoinedSubgroups:[]})}function a(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=[],e=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if((e==null?void 0:e.isParentGroup)!==!0)return c;var f={suspended:!0,terminated:!0};c.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(a,f,b));var g=(yield d("WAWebDBCommunity").getDefaultSubgroup(a));g!=null&&(yield d("WAWebGroupsParticipantsApi").checkMyMembership(g))&&c.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,f,b));f=(yield j(e,g,a));c.push.apply(c,f);return c});return q.apply(this,arguments)}function r(a){var b=[];b.push(d("WAWebSchemaGroupMetadata").getGroupMetadataTable().remove(a.toString()));b.push(d("WAWebSchemaChat").getChatTable().remove(a.toString()));return b}function c(a,b,c){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=[];a=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(a==null||a.defaultSubgroup!==!0)return e;a=a.parentGroup;a!=null&&e.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(d("WAWebWidFactory").createWid(a),{suspended:b},c));return e});return s.apply(this,arguments)}function e(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=[],e=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(e==null||e.isParentGroup!==!0)return c;var f=(yield d("WAWebDBCommunity").getDefaultSubgroup(a));f!=null&&(yield d("WAWebGroupsParticipantsApi").checkMyMembership(f))&&c.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(f,{terminated:!0,parentGroup:void 0},b));b=(yield j(e,f,a));c.push.apply(c,b);c.push.apply(c,r(a));return c});return t.apply(this,arguments)}function f(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];if(!a)return b;var c=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(!c||c.isParentGroup!==!0)return b;var e=(yield d("WAWebDBCommunity").getDefaultSubgroup(a));c=e==null?[]:yield j(c,e,a);b.push.apply(b,c);b.push.apply(b,r(a));return b});return u.apply(this,arguments)}g.databaseUpdatesForSubgroupUnlink=i;g.partitionSubgroups=p;g.databaseUpdatesForIntegrityDeactivateCommunity=a;g.maybeUpdateCommunitySuspendedStatus=c;g.databaseUpdatesForDeactivateCommunity=e;g.databaseUpdatesForExitedCommunity=f}),98); __d("WAWebEphemeralityUtils",["WAWebEphemeralityTypes","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:return 1;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange:return 3;default:return null}}function b(a,b){return b==null?a>0?1:null:a===b?2:1}function c(a){switch(a){case 1:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;case 2:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;case 3:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange;default:return null}}function e(a){switch(a){case"1":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;case"2":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;case"3":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange;default:return null}}function f(a){switch(a){case"chat_settings":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;case"account_settings":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;case"bulk_change":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange;case"biz_supports_fb_hosting":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting;case"unknown_groups":return d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups;case"unknown":default:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown}}function h(a){switch(a){case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.CHAT_SETTING:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.ACCOUNT_SETTING:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BULK_CHANGE:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BIZ_SUPPORTS_FB_HOSTING:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN_GROUPS:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups;default:return}}g.getGroupEphemeralTrigger=a;g.getEphemeralTriggerForGroupCreation=b;g.getDisappearingModeTrigger=c;g.getDisappearingModeTriggerString=e;g.getDisappearingModeTriggerFromString=f;g.getDisappearingModeTriggerFromProtobuf=h}),98); __d("WAWebDBGroupMembeshipApprovalRequest",["WABatcher","WALogger","WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeMembershipApprovalRequestsBatched: aggregating "," changes"]);h=function(){return a};return a}var i=3e3,j=function(){return d("WABatcher").batch({delayMs:i},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(h(),a.length).devConsole(a);var b=a.flatMap(function(a){var b=a.id.toString();return a.requests.map(function(a){return[b,a.toString()]})});yield d("WAWebModelStorageUtils").getStorage().lock(["pending-membership-approval-request"],function(a){a=a[0];return a.bulkRemove(b)});return b.map(function(a){return void 0})});return function(b){return a.apply(this,arguments)}}())}();function a(a,b,c){c===void 0&&(c=!1);if(c)return j({id:a,requests:b});var e=a.toString();return d("WAWebModelStorageUtils").getStorage().lock(["pending-membership-approval-request"],function(a){a=a[0];return a.bulkRemove(b.map(function(a){return[e,a.toString()]}))})}g.removeMembershipApprovalRequests=a}),98); __d("WAWebGroupsMembershipApprovalRequestsApi",["WAWebDBGroupMembeshipApprovalRequest"],(function(a,b,c,d,e,f,g){function a(a){var b=a.group,c=a.requests;a=a.isOffline;return d("WAWebDBGroupMembeshipApprovalRequest").removeMembershipApprovalRequests(b,c,a)}g.removeMembershipApprovalRequests=a}),98); __d("WAWebGroupMembershipApprovalRequestsJob",["WAJobOrchestratorTypes","WAWebGroupsMembershipApprovalRequestsApi","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a,b,c){a={group:a,requests:b,isOffline:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("removeMembershipApprovalRequests",function(a){return d("WAWebGroupsMembershipApprovalRequestsApi").removeMembershipApprovalRequests(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}g.removeMembershipApprovalRequestsJob=a}),98); __d("WAWebGroupSafetyCheckGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebABProps").getABPropConfigValue("fgx_update_h2_2024")}function b(){return d("WAWebABProps").getABPropConfigValue("group_safety_check_enabled")}function c(){return d("WAWebABProps").getABPropConfigValue("is_group_chat_open_logging_enabled")}function e(){return d("WAWebABProps").getABPropConfigValue("is_part_of_gsc_experiment")}g.groupSafetyCheckEnabled=a;g.groupSafetyCheckM2Enabled=b;g.groupSafetyCheckLoggingEnabled=c;g.groupSafetyCheckIsPartOfExperiment=e}),98); __d("WAWebDBBulkPersistContact",["WABatcher","WALogger","WAWebLidAwareContactsDB","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkPersistContactChanges: persisting "," records"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkPersistContactChanges: processing "," records"]);i=function(){return a};return a}var j=d("WABatcher").batch({delayMs:3e3},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield k(a);return a.map(function(a){return void 0})});return function(b){return a.apply(this,arguments)}}());function a(a,b){return j(babelHelpers["extends"]({},b,{id:a.toJid()}))}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i(),a.length);b=b();d("WALogger").DEV(h(),a.length);yield c("WAWebLidAwareContactsDB").bulkCreateOrMerge(b);function b(){return Array.from(a.reduce(function(a,b){var c;a.set(b.id,babelHelpers["extends"]({},(c=a.get(b.id))!=null?c:{},b));return a},new Map()).values())}});return l.apply(this,arguments)}g.persistContactUpdateBatched=a}),98); __d("WAWebHandlePushnameUpdate",["WALogger","WAWebBackendApi","WAWebDBBulkPersistContact","WAWebPromiseQueue","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updatePushName: set pushname for ",""]);h=function(){return a};return a}var i=new(d("WAWebPromiseQueue").PromiseQueue)();function j(a,b){return d("WAWebBackendApi").frontendSendAndReceive("updatePushname",{contactId:a,pushname:b})}function a(a,c,e){e===void 0&&(e=!1);var f=d("WAWebWidFactory").toUserWid(a);return i.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=void 0;e||(a=(yield j(f,c)));(a===!0||a===void 0)&&(d("WALogger").LOG(h(),f.toLogString()),void d("WAWebDBBulkPersistContact").persistContactUpdateBatched(f,{pushname:c}))}))}g.updatePushname=a}),98); __d("WAWebNux",["$InternalEnum"],(function(a,b,c,d,e,f){var g={SAFARI_LIMITED_SUPPORT:"safari_limited_support",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX:"revoke_legal_disclaimer_nux",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX_NEW:"sender_revoke_legal_disclaimer_nux",ADMIN_REVOKE_LEGAL_DISCLAIMER_NUX:"admin_revoke_legal_disclaimer_nux",EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",COMMUNITY:"community",COMMUNITY_HOME:"community_home",STATUS_QUICK_REPLIES:"status_quick_replies",KEEP_IN_CHAT:"keep_in_chat",CHAT_ASSIGNMENT:"chat_assignment",TOOLTIP_AD_CREATION:"tooltip_ad_creation",DESKTOP_UPSELL:"desktop_upsell",FORWARD_MEDIA_WITH_CAPTION:"forward_media_with_caption",MESSAGE_EDIT:"message_edit",ORDER_REQUEST_EDUCATION:"order_request_education",NEWSLETTER_MULTI_ADMIN:"newsletter_multi_admin",SUPPORT_AI:"support_ai",EVENT_CREATE:"event_create",TOOLTIP_STATUS_ENTRY_POINT:"tooltip_status_entry_point",CAPI_GROUP_ABOUT_MODAL:"capi_group_about_modal",STATUS_PRIVATE_MENTIONS:"status_private_mentions",MESSAGE_LABEL_DEPRECATION_MIGRATED_PERMANENT:"message_label_deprecation_migrated_permanent",CAG_EVENTS_AWARENESS_BANNER:"cag_events_awareness_banner",ADD_TO_LISTS:"add_to_lists",WEB_UI_REFRESH:"web_ui_refresh"};function a(a){return"community_admin_promote_"+a}function c(a){return a.startsWith("community_admin_promote_")}function d(a){return"chat_auto_muted_"+a}function e(a){return a.startsWith("chat_auto_muted_")}function h(a){return"membership_approval_requests_banner_"+a}function i(a){return"newsletter_alerts_"+a}function j(a){return"subgroup_suggestions_banner_"+a}b=b("$InternalEnum")({EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",ARCHIVE:"archive",STATUS_QUICK_REPLIES:"status_quick_replies",COMMUNITY:"community",COMMUNITY_HOME:"community_home",KEEP_IN_CHAT:"keep_in_chat",FORWARD_MEDIA_WITH_CAPTION:"forward_media_with_caption",MESSAGE_EDIT:"message_edit",NEWSLETTER_MULTI_ADMIN:"newsletter_multi_admin",SUPPORT_AI:"support_ai",EVENT_CREATE:"event_create",TOOLTIP_STATUS_ENTRY_POINT:"tooltip_status_entry_point",STATUS_PRIVATE_MENTIONS:"status_private_mentions",MESSAGE_LABEL_DEPRECATION_MIGRATED:"message_label_deprecation_migrated",ADD_TO_LISTS:"add_to_lists",WEB_UI_REFRESH:"web_ui_refresh"});var k={COOL_OFF_NUX:{INCOMPLETE_BUSINESS_PROFILE_BANNER:"incomplete_business_profile_banner",PRODUCT_CATALOG_BANNER:"product_catalog_banner",COLLECTIONS:"collections_banner",CTWA_SUGGESTION:"ctwa_suggestion",ORDER_EXPANSION:"order_expansion",MESSAGE_LABEL_DEPRECATION_MIGRATED_CHAT_LIST:"message_label_deprecation_migrated_chat_list"},VIEW_COUNT_NUX:{SAFARI_LIMITED_SUPPORT:"safari_limited_support",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX:"revoke_legal_disclaimer_nux",ADMIN_REVOKE_LEGAL_DISCLAIMER_NUX:"admin_revoke_legal_disclaimer_nux",EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",COMMUNITY:"community",COMMUNITY_HOME:"community_home",KEEP_IN_CHAT:"keep_in_chat",CHAT_ASSIGNMENT:"chat_assignment",TOOLTIP_AD_CREATION:"tooltip_ad_creation",DESKTOP_UPSELL:"desktop_upsell",FORWARD_MEDIA_WITH_CAPTION:"forward_media_with_caption",MESSAGE_EDIT:"message_edit",ORDER_REQUEST_EDUCATION:"order_request_education",NEWSLETTER_MULTI_ADMIN:"newsletter_multi_admin",SUPPORT_AI:"support_ai",TOOLTIP_STATUS_ENTRY_POINT:"tooltip_status_entry_point",CAPI_GROUP_ABOUT_MODAL:"capi_group_about_modal",STATUS_PRIVATE_MENTIONS:"status_private_mentions",MESSAGE_LABEL_DEPRECATION_MIGRATED_PERMANENT:"message_label_deprecation_migrated_permanent",CAG_EVENTS_AWARENESS_BANNER:"cag_events_awareness_banner",ADD_TO_LISTS:"add_to_lists",WEB_UI_REFRESH:"web_ui_refresh"}},l={DEFAULT:"default_cool_off_banners_key",CATALOG:"catalog_banners_key",CTWA_SUGGESTION:"ctwa_suggestion_banners_key",ORDER_EXPANSION:"order_expansion_banner_key",MESSAGE_LABEL_DEPRECATION_MIGRATED_CHAT_LIST:"message_label_deprecation_migrated_chat_list_key"};function m(a){return a+"_cool_off"}f.NUX=g;f.getCommunityAdminPromotionNuxKey=a;f.isCommunityAdminPromotionNuxKey=c;f.getChatAutoMutedNuxKey=d;f.isChatAutoMutedNuxKey=e;f.getMembershipApprovalRequestsBannerNuxKey=h;f.getNewsletterAlertsBannerNuxKey=i;f.getSubgroupSuggestionsBannerNuxKey=j;f.NuxSyncKey=b;f.NuxKeyTypes=k;f.CoolOffPeriodKeys=l;f.asCoolOffNuxType=m}),66); __d("WAWebSubgroupSuggestionsJob",["WAJobOrchestratorTypes","WAWebApiSubgroupSuggestionStore","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a,b){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("removeSubgroupSuggestions",function(a){return d("WAWebApiSubgroupSuggestionStore").removeSubgroupSuggestionsWithOfflineOption(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({subgroupSuggestions:a,isOffline:b})}g.removeSubgroupSuggestionsJob=a}),98); __d("WAWebUpdateDbForGroupActionApi",["Promise","WAFilteredCatch","WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebApiContact","WAWebApiMembershipApprovalRequestStore","WAWebApiParticipantStore","WAWebApiSubgroupSuggestionStore","WAWebBackendApi","WAWebCommunityGatingUtils","WAWebDBCommunity","WAWebDBCommunityTypes","WAWebDBGroupsGroupMetadata","WAWebDBParticipantTypes","WAWebDBRevokeInviteV4","WAWebEphemeralityUtils","WAWebGroupDatabaseJob","WAWebGroupMembershipApprovalRequestsJob","WAWebGroupParticipantsJob","WAWebGroupQueryBridge","WAWebGroupSafetyCheckGatingUtils","WAWebGroupType","WAWebHandlePushnameUpdate","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebNux","WAWebQueryAndUpdateSubgroupSuggestionsJob","WAWebSubgroupSuggestionsJob","WAWebUpdateDbForCommunityAction","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["finished all storageTasks"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["unhandled group notif action in handleGroupActionMD for action ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["communityOwnerUpdate: out-of-sync group notification"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["modifyGroupParticipant: out-of-sync group notification"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["_handleGroupActionMD: participants length should be 1, but is ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] isLidMigrated: ",", revoke request sent from another user -- author is not me"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Received group invite revokation from ",", but user not in participants list"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Received revoke without an admin jid ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMaybeMeUser returned null, can't process action ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["linkedGroupDemote: out-of-sync group notification"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["linkedGroupPromote: out-of-sync group notification"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeParticipants: out-of-sync group notification"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeParticipants: out-of-sync group notification"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeParticipants: out-of-sync group notification"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["addParticipants: out-of-sync group notification"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["inside _handleGroupActionMD"]);y=function(){return a};return a}function a(a,b,c){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){f===void 0&&(f=!1);d("WALogger").LOG(y()).tags("groups");var g=a.chatId,z=a.author,B=a.pushname,E=a.ts,F=E===void 0?Date.now()/1e3:E;z&&!c("isStringNullOrEmpty")(B)&&d("WAWebHandlePushnameUpdate").updatePushname(z,B,f);E=[];switch(e.actionType){case d("WAWebGroupType").GROUP_ACTIONS.ADD:E.push(d("WAWebGroupParticipantsJob").addParticipantsJob(g,e.participants,f,e.reason)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(x()),C(g,f)})));d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&E.push(d("WAWebGroupMembershipApprovalRequestsJob").removeMembershipApprovalRequestsJob(a.chatId,e.participants.map(function(a){return a.id}),f));d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckM2Enabled()&&E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{groupAdder:z==null?void 0:z.toString()}));break;case d("WAWebGroupType").GROUP_ACTIONS.REMOVE:B=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(g));if(B==null)break;var G=e.reason!==d("WAWebGroupType").REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE&&e.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&(yield d("WAWebDBCommunity").isLastJoinedSubgroup(B)),H=function(b,c){return d("WAWebGroupParticipantsJob").removeParticipantsJob(b,e.participants,F,a.author,e.reason,c,f)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(w()),void C(b,f)}))};E.push(H(g,B));if(B.defaultSubgroup===!0&&B.parentGroup!=null){var I=d("WAWebWidFactory").createWid(B.parentGroup),J=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(I));J&&E.push(H(I,J))}e.participants.find(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&(d("WAWebUserPrefsGeneral").removeUserSentMessageToChat(g),d("WAWebApiParticipantStore").setAdminshipCache(g.toString(),!1));if(G){H=B==null?void 0:B.parentGroup;I=(yield d("WAWebUpdateDbForCommunityAction").databaseUpdatesForExitedCommunity(H!=null?d("WAWebWidFactory").createWid(H):null));E.push.apply(E,I)}break;case d("WAWebGroupType").GROUP_ACTIONS.DEMOTE:J=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(g));if(J==null)break;e.participants.find(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&(d("WAWebApiParticipantStore").setAdminshipCache(g.toString(),!1),d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&E.push(d("WAWebApiMembershipApprovalRequestStore").removeAllMembershipApprovalRequests(g)),yield A(J,g));E.push(d("WAWebGroupParticipantsJob").demoteParticipantsJob(g,e.participants,J,f)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(v()),C(g,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.PROMOTE:G=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(g));if(G==null)break;if(e.participants.find(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})){if(d("WAWebCommunityGatingUtils").communityAdminPromotionOneTimePromptEnabled()&&G!=null&&d("WAWebGroupType").getGroupTypeFromGroupMetadata(G)===d("WAWebGroupType").GroupType.COMMUNITY){B=d("WAWebNux").getCommunityAdminPromotionNuxKey(G.id.toString());D(B)}d("WAWebApiParticipantStore").setAdminshipCache(g.toString(),!0);yield A(G,g)}E.push(d("WAWebGroupParticipantsJob").promoteParticipantsJob(g,e.participants,G,f)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(u()),C(g,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_PROMOTE:if(!e.jid)break;var K=e.jid;H=(yield d("WAWebApiParticipantStore").isCurrentUserGroupAdmin(K.toString()));H||E.push(d("WAWebGroupParticipantsJob").promoteCommunityParticipantsJob(K,e.participants,f)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(t()),C(K,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_DEMOTE:if(!e.jid)break;var L=e.jid;I=(yield d("WAWebApiParticipantStore").isCurrentUserGroupAdmin(L.toString()));I||E.push(d("WAWebGroupParticipantsJob").demoteCommunityParticipantsJob(L,e.participants,f)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(s()),C(L,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.REVOKE_INVITE:J=d("WAWebUserPrefsMeUser").getMeUser().toString();B=d("WAWebUserPrefsMeUser").getMeLidUser().toString();if(J==null||B==null){d("WALogger").WARN(r(),e);return}var M=z==null?void 0:z.toString();if(c("isStringNullOrEmpty")(M)||z==null){d("WALogger").WARN(q(),e);return}G=d("WAWebUserPrefsMeUser").isMeAccount(z);H=[];if(G)H=e.participants.map(function(a){return{from:M,to:a.id.toString(),groupId:g.toString(),expiration:a.expiration}});else{var N;I=e.participants.find(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(a.id)});if(!I){d("WALogger").ERROR(p(),M).sendLogs("bad-revoke");return}G=z.isLid();var O=d("WAWebWidFactory").toUserWid(z);N=G?(N=d("WAWebApiContact").getPhoneNumber(O))==null?void 0:N.toString():M;O=G?M:(G=d("WAWebLidMigrationUtils").toLid(O))==null?void 0:G.toString();if(c("isStringNullOrEmpty")(O)){G=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();d("WALogger").LOG(o(),G);G="[group-invites] failed to get lid mapping for *incoming* group invite *revoke*";d("WALogger").ERROR(n(),G).sendLogs(G)}H=[{from:(G=N)!=null?G:"",to:J,groupId:g.toString(),expiration:I.expiration},{from:(N=O)!=null?N:"",to:B,groupId:g.toString(),expiration:I.expiration}]}yield (h||(h=b("Promise"))).all(H.map(function(a){return d("WAWebDBRevokeInviteV4").revokeGroupInviteV4(a.from,a.to,a.groupId,a.expiration)}));break;case d("WAWebGroupType").GROUP_ACTIONS.MODIFY:if(e.participants.length!==1){d("WALogger").WARN(m(),e.participants.length);break}E.push(d("WAWebGroupDatabaseJob").modifyGroupParticipantJob(g,c("WANullthrows")(z),e.participants[0].id)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(l()),C(g,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.SUBJECT:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{subject:e.subject},f));break;case d("WAWebGroupType").GROUP_ACTIONS.DESC_ADD:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{desc:e.desc,descId:e.descId,descTime:e.descTime,descOwner:z==null?void 0:z.toString()},f));break;case d("WAWebGroupType").GROUP_ACTIONS.DESC_REMOVE:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{desc:void 0,descId:void 0,descTime:void 0,descOwner:void 0},f));break;case d("WAWebGroupType").GROUP_ACTIONS.RESTRICT:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{restrict:!!e.value},f));break;case d("WAWebGroupType").GROUP_ACTIONS.SUSPEND:G=!!e.value;E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{suspended:G},f));J=(yield d("WAWebUpdateDbForCommunityAction").maybeUpdateCommunitySuspendedStatus(g,G,f));E.push.apply(E,J);break;case d("WAWebGroupType").GROUP_ACTIONS.ANNOUNCE:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{announce:!!e.value},f));break;case d("WAWebGroupType").GROUP_ACTIONS.NO_FORWARD:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{noFrequentlyForwarded:!!e.value},f));break;case d("WAWebGroupType").GROUP_ACTIONS.EPHEMERAL:if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")){O=d("WAWebEphemeralityUtils").getDisappearingModeTrigger(e.trigger);E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{ephemeralDuration:e.duration,disappearingModeTrigger:O!=null?O:void 0,disappearingModeInitiatedByMe:e.initiatedByMe},f))}else E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{ephemeralDuration:e.duration},f));break;case d("WAWebGroupType").GROUP_ACTIONS.INVITE_CODE:break;case d("WAWebGroupType").GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK:break;case d("WAWebGroupType").GROUP_ACTIONS.DELETE:if(e.reason===d("WAWebGroupType").DELETE_REASON.INTEGRITY_DELETE_PARENT){N=(yield d("WAWebUpdateDbForCommunityAction").databaseUpdatesForIntegrityDeactivateCommunity(g,f));E.push.apply(E,N)}else if(e.reason===d("WAWebGroupType").DELETE_REASON.DELETE_PARENT){B=(yield d("WAWebUpdateDbForCommunityAction").databaseUpdatesForDeactivateCommunity(g,f));E.push.apply(E,B)}else E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{terminated:!0},f));break;case d("WAWebGroupType").GROUP_ACTIONS.GROWTH_UNLOCKED:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{growthLockExpiration:void 0,growthLockType:void 0},f));break;case d("WAWebGroupType").GROUP_ACTIONS.GROWTH_LOCKED:e.type==="invite"&&E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{growthLockExpiration:e.expiration,growthLockType:e.type},f));break;case d("WAWebGroupType").GROUP_ACTIONS.PARENT_GROUP_LINK:I=e.groupDatas[0].id;E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{parentGroup:I.toString()},f));break;case d("WAWebGroupType").GROUP_ACTIONS.SUB_GROUP_LINK:E.push(d("WAWebDBCommunity").persistCommunityLink(g,e.groupDatas,d("WAWebDBCommunityTypes").CommunityLinkOperation.SubGroupLink,f),d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{lastActivityTimestamp:d("WATimeUtils").unixTime()},f));break;case d("WAWebGroupType").GROUP_ACTIONS.SIBLING_GROUP_LINK:E.push(d("WAWebDBCommunity").persistCommunityLink(g,e.groupDatas,d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupLink,f));break;case d("WAWebGroupType").GROUP_ACTIONS.PARENT_GROUP_UNLINK:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{parentGroup:void 0},f));break;case d("WAWebGroupType").GROUP_ACTIONS.SUB_GROUP_UNLINK:E.push(d("WAWebDBCommunity").persistCommunityLink(g,e.groupDatas,d("WAWebDBCommunityTypes").CommunityLinkOperation.SubGroupUnlink,f));break;case d("WAWebGroupType").GROUP_ACTIONS.SIBLING_GROUP_UNLINK:E.push(d("WAWebDBCommunity").persistCommunityLink(g,e.groupDatas,d("WAWebDBCommunityTypes").CommunityLinkOperation.SiblingGroupUnlink,f));break;case d("WAWebGroupType").GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE:d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&(E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{membershipApprovalMode:e.value},f)),e.value||E.push(d("WAWebApiMembershipApprovalRequestStore").removeAllMembershipApprovalRequests(g)));break;case d("WAWebGroupType").GROUP_ACTIONS.MEMBERSHIP_APPROVAL_REQUEST:if(d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&!d("WAWebABProps").getABPropConfigValue("group_join_request_m3")){E.push(d("WAWebApiMembershipApprovalRequestStore").addMembershipApprovalRequests(a.chatId,[{id:c("WANullthrows")(z),t:F,addedBy:c("WANullthrows")(z),requestMethod:e.requestMethod,parentGroupId:e.parentGroupId}]));H=d("WAWebNux").getMembershipApprovalRequestsBannerNuxKey(a.chatId.toString());D(H)}break;case d("WAWebGroupType").GROUP_ACTIONS.ALLOW_ADMIN_REPORTS:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,babelHelpers["extends"]({reportToAdminMode:e.value},!e.value&&{lastReportToAdminTimestamp:null}),f));break;case d("WAWebGroupType").GROUP_ACTIONS.ADMIN_REPORT_RECIEVED:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{lastReportToAdminTimestamp:e.value},f));break;case d("WAWebGroupType").GROUP_ACTIONS.CREATED_MEMBERSHIP_REQUESTS:if(d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&d("WAWebABProps").getABPropConfigValue("group_join_request_m3")){E.push(d("WAWebApiMembershipApprovalRequestStore").addMembershipApprovalRequests(a.chatId,e.requests.map(function(a){return{id:a,t:F,addedBy:c("WANullthrows")(z),requestMethod:e.requestMethod,parentGroupId:e.parentGroupId}})));G=d("WAWebNux").getMembershipApprovalRequestsBannerNuxKey(a.chatId.toString());D(G)}break;case d("WAWebGroupType").GROUP_ACTIONS.REVOKED_MEMBERSHIP_REQUESTS:d("WAWebABProps").getABPropConfigValue("group_join_request_m2")&&E.push(d("WAWebGroupMembershipApprovalRequestsJob").removeMembershipApprovalRequestsJob(a.chatId,e.requests,f));break;case d("WAWebGroupType").GROUP_ACTIONS.ALLOW_NON_ADMIN_SUB_GROUP_CREATION:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{allowNonAdminSubGroupCreation:!!e.value},f));break;case d("WAWebGroupType").GROUP_ACTIONS.CREATED_SUBGROUP_SUGGESTION:E.push(d("WAWebApiSubgroupSuggestionStore").addSubgroupSuggestions(a.chatId,[{id:e.id,parentGroupId:e.parentGroupId,subject:e.subject,desc:e.description,owner:e.owner,t:e.t,isExistingGroup:(J=e.isExistingGroup)!=null?J:!1,participantCount:e.participantCount,hiddenSubgroup:e.hiddenSubgroup}]));O=d("WAWebNux").getSubgroupSuggestionsBannerNuxKey(a.chatId.toString());void D(O);break;case d("WAWebGroupType").GROUP_ACTIONS.REVOKED_SUB_GROUP_SUGGESTIONS:E.push(d("WAWebSubgroupSuggestionsJob").removeSubgroupSuggestionsJob(e.subgroupSuggestions.map(function(a){var b=a.id;a=a.owner;return{parentGroupId:e.parentGroupId,id:b,owner:a}}),f));break;case d("WAWebGroupType").GROUP_ACTIONS.SUBGROUP_SUGGESTIONS_CHANGE_NUMBER:E.push(d("WAWebApiSubgroupSuggestionStore").updateOwnerInSubgroupSuggestions(e.parentGroupId,e.subgroupSuggestions,e.oldOwner,e.newOwner));break;case d("WAWebGroupType").GROUP_ACTIONS.MEMBER_ADD_MODE:d("WAWebABProps").getABPropConfigValue("web_anyone_can_add_group_setting_enabled")&&E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{memberAddMode:e.memberAddMode},f));break;case d("WAWebGroupType").GROUP_ACTIONS.GENERAL_CHAT_AUTO_ADD_DISABLED:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{generalChatAutoAddDisabled:!0},f));break;case d("WAWebGroupType").GROUP_ACTIONS.COMMUNITY_OWNER_UPDATE:E.push(d("WAWebGroupParticipantsJob").setGroupSuperAdminJob(g,e.newOwner)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDBParticipantTypes").GroupUnSyncedError,function(){d("WALogger").WARN(k()),void C(g,f)})));break;case d("WAWebGroupType").GROUP_ACTIONS.HIDDEN_GROUP:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{hiddenSubgroup:!!e.value}));break;case d("WAWebGroupType").GROUP_ACTIONS.GROUP_SAFETY_CHECK:E.push(d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(g,{groupSafetyCheck:!!e.value}));break;default:d("WALogger").ERROR(j(),JSON.stringify(e)).tags("groups");break}yield (h||(h=b("Promise"))).all(E);d("WALogger").LOG(i()).tags("groups")});return z.apply(this,arguments)}function A(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.isParentGroup===!0&&a.allowNonAdminSubGroupCreation!==!0&&d("WAWebCommunityGatingUtils").memberSuggestedGroupsEnabled()){a=(yield d("WAWebDBCommunity").getJoinedSubgroups(b));a[0]&&void d("WAWebQueryAndUpdateSubgroupSuggestionsJob").queryAndUpdateSubgroupSuggestions(b,a[0])}});return B.apply(this,arguments)}function C(a,b){return b===!0?d("WAWebGroupDatabaseJob").markGroupParticipantStaleJob(a):d("WAWebGroupQueryBridge").sendQueryGroup(a)}function D(a){d("WAWebBackendApi").frontendFireAndForget("resetNux",{key:a})}function e(a,b){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));e!=null&&(e.disappearingModeTrigger=c,yield d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(a,{disappearingModeTrigger:c}));return(h||(h=b("Promise"))).resolve()});return E.apply(this,arguments)}g.updateDBForGroupAction=a;g.syncDisappearingModeTriggerToDB=e}),98); __d("WAWebABPropsSaga",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("saga_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("saga_copy")}function c(){return d("WAWebABProps").getABPropConfigValue("saga_v1_enabled")}function e(){return d("WAWebABProps").getABPropConfigValue("saga_v1_reengagement_enabled")}function f(){return d("WAWebABProps").getABPropConfigValue("saga_v1_carousel")}function h(){return d("WAWebABProps").getABPropConfigValue("saga_v1_carousel_no_exposure")}function i(){return d("WAWebABProps").getABPropConfigValue("saga_protobuf_show_sysmsg_web")}function j(){return d("WAWebABProps").getABPropConfigValue("saga_protobuf_ai_stardust_web")}function k(){return d("WAWebABProps").getABPropConfigValue("saga_v1_nux_enabled")}function l(){return d("WAWebABProps").getABPropConfigValue("support_message_feedback_enabled")}function m(){return d("WAWebABProps").getABPropConfigValue("chat_with_support_cta")}g.getIsSagaEnabled=a;g.getIsSagaCopyEnabled=b;g.getIsSagaV1Enabled=c;g.getIsSagaV1ReengagementEnabled=e;g.getIsSagaV1CarouselEnabled=f;g.getIsSagaV1CarouselNoExposureEnabled=h;g.getIsSagaProtobufSystemMessageEnabled=i;g.getIsSagaProtobufAIStardustEnabled=j;g.getIsSagaV1NuxEnabled=k;g.getSagaFeedbackEnabled=l;g.getChatWithSupportTextEnabled=m}),98); __d("WAWebMmsMediaTypes",["WAWebInteractiveMessageHeaderMediaType","WAWebMsgGetters","WAWebMsgType","err","lodash"],(function(a,b,c,d,e,f,g){var h=Object.freeze({AUDIO:"audio",DOCUMENT:"document",GIF:"gif",IMAGE:"image",NATIVE_FLOW:"native_flow",PPIC:"ppic",PRODUCT:"product",PTT:"ptt",STICKER:"sticker",VIDEO:"video",PTV:"ptv",TEMPLATE:"template",THUMBNAIL_DOCUMENT:"thumbnail-document",THUMBNAIL_IMAGE:"thumbnail-image",THUMBNAIL_VIDEO:"thumbnail-video",THUMBNAIL_LINK:"thumbnail-link",HISTORY_SYNC:"md-msg-hist",MD_APP_STATE:"md-app-state",PRODUCT_CATALOG_IMAGE:"product-catalog-image",PAYMENT_BG_IMAGE:"payment-bg-image",BIZ_COVER_PHOTO:"biz-cover-photo",PREVIEW:"preview",NEWSLETTER_AUDIO:"newsletter-audio",NEWSLETTER_DOCUMENT:"newsletter-document",NEWSLETTER_IMAGE:"newsletter-image",NEWSLETTER_GIF:"newsletter-gif",NEWSLETTER_PTT:"newsletter-ptt",NEWSLETTER_PTV:"newsletter-ptv",NEWSLETTER_STICKER:"newsletter-sticker",NEWSLETTER_THUMBNAIL_LINK:"newsletter-thumbnail-link",NEWSLETTER_VIDEO:"newsletter-video",NATIVE_AD_IMAGE:"ads-image",STICKER_PACK:"sticker-pack",THUMBNAIL_STICKER_PACK:"thumbnail-sticker-pack",MUSIC_ARTWORK:"music-artwork"});e=c("lodash").values(h);function a(a){var b;if(a==null)b=h.DOCUMENT;else if(a in h)b=h[a];else throw c("err")("castToV4: unexpected mmsv3 type "+a);return b}function i(a){var b=a.type,e=a.isGif,f=a.interactiveHeader;a=a.isNewsletter;switch(b){case d("WAWebMsgType").MSG_TYPE.IMAGE:return a?h.NEWSLETTER_IMAGE:h.IMAGE;case d("WAWebMsgType").MSG_TYPE.VIDEO:return a?e===!0?h.NEWSLETTER_GIF:h.NEWSLETTER_VIDEO:e===!0?h.GIF:h.VIDEO;case d("WAWebMsgType").MSG_TYPE.AUDIO:return a?h.NEWSLETTER_AUDIO:h.AUDIO;case d("WAWebMsgType").MSG_TYPE.PTT:return a?h.NEWSLETTER_PTT:h.PTT;case d("WAWebMsgType").MSG_TYPE.PTV:return a?h.NEWSLETTER_PTV:h.PTV;case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return h.DOCUMENT;case d("WAWebMsgType").MSG_TYPE.STICKER_PACK:return h.STICKER_PACK;case d("WAWebMsgType").MSG_TYPE.STICKER:return a?h.NEWSLETTER_STICKER:h.STICKER;case d("WAWebMsgType").MSG_TYPE.PRODUCT:return h.PRODUCT;case d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW:return h.NATIVE_FLOW;case d("WAWebMsgType").MSG_TYPE.INTERACTIVE:if((f==null?void 0:f.mediaType)!=null)switch(f.mediaType){case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT:return h.DOCUMENT;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO:return h.VIDEO;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE:return h.IMAGE;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.PRODUCT:return h.PRODUCT}break}throw c("err")("msg is not a media msg: "+b+", isGif="+String(e))}function b(a){return i({type:a.type,interactiveHeader:a.interactiveHeader,isGif:a.type===d("WAWebMsgType").MSG_TYPE.VIDEO?a.isGif:!1,isNewsletter:d("WAWebMsgGetters").getIsNewsletterMsg(a)})}g.MEDIA_TYPES=h;g.MEDIA_TYPE_VALUES=e;g.castToV4=a;g.msgToMediaType=i;g.getMsgMediaType=b}),98); __d("WAWebMediaCryptoEligibilityUtils",["WAWebChatGetters","WAWebMmsMediaTypes","WAWebMsgGetters"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebChatGetters").getIsNewsletter(a)?!1:!0}function b(a){return d("WAWebMsgGetters").getIsNewsletterMsg(a)?!1:!0}var h=new Set([(f=d("WAWebMmsMediaTypes")).MEDIA_TYPES.NEWSLETTER_AUDIO,f.MEDIA_TYPES.NEWSLETTER_DOCUMENT,f.MEDIA_TYPES.NEWSLETTER_GIF,f.MEDIA_TYPES.NEWSLETTER_IMAGE,f.MEDIA_TYPES.NEWSLETTER_PTT,f.MEDIA_TYPES.NEWSLETTER_PTV,f.MEDIA_TYPES.NEWSLETTER_STICKER,f.MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK,f.MEDIA_TYPES.NEWSLETTER_VIDEO]);function i(a){return h.has(a)}function c(a){return i(a)?!1:!0}function e(a){return i(a)?!1:!0}g.isMediaCryptoExpectedForChat=a;g.isMediaCryptoExpectedForMsg=b;g.isMediaCryptoExpectedForMediaType=c;g.isRmrSupportedForMediaType=e}),98); __d("WAWebE2EProtoParserApi",["WABase64","WALogger","WAWebGroupType","WAWebMediaCryptoEligibilityUtils","WAWebProtobufsE2E.pb","WAWebWid","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mediaKey is missing from msg type ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["url(deprecatedMms3Url) is missing from msg type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fileEncSha256 missing from msg type ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["directPath missing from msg type ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["directPath and fileEncSha256 missing from msg type ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["directPath missing from msg type ",""]);m=function(){return a};return a}function a(a){switch(a){case d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.PARENT:return d("WAWebGroupType").GroupType.COMMUNITY;case d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.SUB:return d("WAWebGroupType").GroupType.LINKED_SUBGROUP;case d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT_SUB:return d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP;default:return d("WAWebGroupType").GroupType.DEFAULT}}function b(a){return a!=null&&!a.includes("/u/")?a:void 0}function e(a){return a?d("WABase64").encodeB64(a):void 0}function f(a,b){if(!n(a,b))return;var c=a.type;if(!d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(a)){b.directPath==null&&d("WALogger").LOG(m(),c).sendLogs(c+"-unencrypted-message-missing-direct-path");return}b.directPath==null&&b.fileEncSha256==null?d("WALogger").LOG(l(),c).sendLogs(c+"-message-missing-direct-path-and-file-enc"):b.directPath==null?d("WALogger").LOG(k(),c).sendLogs(c+"-message-missing-direct-path"):b.fileEncSha256==null&&d("WALogger").LOG(j(),c).sendLogs(c+"-message-missing-file-enc");b.url==null&&d("WALogger").LOG(i(),c).sendLogs(c+"-message-missing-mms3-url");b.mediaKey==null&&d("WALogger").LOG(h(),c).sendLogs(c+"-message-missing-media-key")}function n(a,b){var d;if(c("gkx")("26258")&&Math.random()>.001)return!1;if(!a.id)return!1;return((d=a.id.remote)==null?void 0:d.user)==="status"&&c("WAWebWid").isPSA(a.author)&&b.staticUrl==null?!1:!0}g.parseInviteGrpType=a;g.decodeUrl=b;g.decodeBytes=e;g.validateRequiredMediaProperties=f;g.shouldLogE2eProtoValidation=n}),98); __d("WAWebEphemeralKeepInChat",["WANullthrows","WAWebEphemeralKeepInChatUtils","WAWebMsgKey","WAWebWidFactory","err"],(function(a,b,c,d,e,f,g){function a(a){a=a.keepInChat;if(a!=null&&a.key!=null){var b=a.key,e=b.id,f=b.remoteJid,g=b.participant;b=b.fromMe;var h=a.keepType;a=a.serverTimestampMs;if(e==null||h==null||a==null||f==null)throw c("err")("parseKeepInChatHistorySyncMessage: malformed KIC WebMessageInfo");h=d("WAWebEphemeralKeepInChatUtils").parseKeepTypeToKicState(h);if(h==null)throw c("err")("parseKeepInChatHistorySyncMessage: KeepType has unsupported value");return{kicKey:new(c("WAWebMsgKey"))({fromMe:c("WANullthrows")(b),id:c("WANullthrows")(e),remote:c("WANullthrows")(d("WAWebWidFactory").createWidFromWidLike(f)),participant:g!=null?d("WAWebWidFactory").createWidFromWidLike(g):void 0}),kicState:h,kicTimestampMs:parseInt(a,10)}}}g.parseKeepInChatHistorySyncMessage=a}),98); __d("WAWebParseWebMessageInfoApi",["WAJids","WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebABPropsSaga","WAWebBizCoexGatingUtils","WAWebBotTypes","WAWebE2EProtoParser","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebEphemeralKeepInChat","WAWebLimitSharingProtoUtils","WAWebMessagingGatingUtils","WAWebMsgKey","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebProtobufsWeb.pb","WAWebReportingTokenUtils","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProtocolParser: admin revoke came without admin JID"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseWebMessageInfo: KIC fields are malformed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["drop: broadcast"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["drop: cannot create MsgKey: ",""]);k=function(){return a};return a}function l(a,b){var e=d("WAWebE2EProtoUtils").decodeJid(b.remoteJid),f=d("WAWebE2EProtoUtils").decodeJid(b.participant),g=a.originalSelfAuthorUserJidString==null?d("WAWebUserPrefsMeUser").getMaybeMeUser():d("WAWebE2EProtoUtils").decodeJid(a.originalSelfAuthorUserJidString),h=d("WAWebE2EProtoUtils").decodeJid(a.participant);f==null&&e!=null&&c("WAWebWid").isWid(e)&&e===d("WAWebWidFactory").createWid(d("WAJids").PSA_JID)&&(f=d("WAWebWidFactory").createWid(d("WAJids").PSA_JID));(c("WAWebWid").isGroup(e)||c("WAWebWid").isStatus(e))&&(f==null&&(b.fromMe===!0?f=g:a.participant!=null&&(f=d("WAWebE2EProtoUtils").decodeJid(a.participant))),h=h!=null?h:f);try{g=new(c("WAWebMsgKey"))({fromMe:c("WANullthrows")(b.fromMe),remote:e,id:c("WANullthrows")(b.id),participant:f});return{msgKey:g,author:h}}catch(a){d("WALogger").WARN(k(),a.stack);return}}function a(a){var b=a.key,e=d("WAWebE2EProtoUtils").decodeJid(b.remoteJid),f=d("WAWebUserPrefsMeUser").getMaybeMeUser(),g=b.fromMe===!0?e:f,h=b.fromMe===!0?f:e,k=l(a,b);if(k==null)return;var n=k.msgKey;k=k.author;var o="in";f!=null&&e!=null&&e instanceof c("WAWebWid")&&d("WAWebUserPrefsMeUser").isMeAccount(e)&&(o=b.fromMe===!0?"out":"in");if(g==="broadcast"){d("WALogger").WARN(j()).devConsole(a);return}f=!1;f=a.reactions.some(function(a){return a.text!=null});b={id:n,from:h,to:g,self:o,participant:n.participant,type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.Unknown,t:(e=a.messageTimestamp)!=null?e:0,ack:a.status-1,author:k,invis:!!a.ignore,star:!!a.starred,broadcast:b.fromMe===!0&&a.broadcast,notifyName:a.pushName||"",encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(a.mediaCiphertextSha256),shareDuration:a.duration,labels:a.labels,ephemeralStartTimestamp:a.ephemeralStartTimestamp,ephemeralOutOfSync:a.ephemeralOutOfSync,bizPrivacyStatus:a.bizPrivacyStatus,verifiedBizName:a.verifiedBizName,reactions:a.reactions,hasReaction:f,agentId:a.agentId,revokeTimestamp:a.revokeMessageTimestamp,kicKey:void 0,kicState:void 0,pollInvalidated:((h=a.pollAdditionalMetadata)==null?void 0:h.pollInvalidated)===!0,eventInvalidated:((g=a.eventAdditionalMetadata)==null?void 0:g.isStale)===!0,replyCount:(o=a.commentMetadata)==null?void 0:o.replyCount,originalSelfAuthor:d("WAWebE2EProtoUtils").decodeJid(a.originalSelfAuthorUserJidString),kicTimestampMs:void 0,pinInChat:a.pinInChat,pmCampaignId:(e=a.premiumMessageInfo)==null?void 0:e.serverCampaignId,bizSource:((k=a.premiumMessageInfo)==null?void 0:k.serverCampaignId)!=null?"smb_promo":void 0,bizBotType:a.is1PBizBotMessage===!0?d("WAWebBotTypes").BizBotType.BIZ_1P:null,botTargetSenderJid:a.botMessageInvokerJid!=null?d("WAWebE2EProtoUtils").decodeJid(a.botMessageInvokerJid):null};c("WAWebWid").isCAPISupportAccount(n.remote)&&(a.isSupportAiMessage!=null&&d("WAWebABPropsSaga").getIsSagaProtobufAIStardustEnabled()&&(b.isSupportAIMessage=a.isSupportAiMessage),a.supportAiCitations!=null&&a.supportAiCitations.length>0&&(b.supportCitations=a.supportAiCitations));if(d("WAWebMessagingGatingUtils").isReportingTagSyncingEnabled()){b.reportingTokenInfo=a.reportingTokenInfo!=null?{reportingTag:(f=a.reportingTokenInfo)==null?void 0:f.reportingTag,version:d("WAWebReportingTokenUtils").REPORTING_TOKEN_VERSION.HISTORY_SYNC}:null}if(a.keepInChat!=null)try{h=d("WAWebEphemeralKeepInChat").parseKeepInChatHistorySyncMessage(a);h!=null&&Object.assign(b,h)}catch(a){d("WALogger").WARN(i()).devConsole(a)}if(a.message)return d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:a.message,message:b,msgContext:"history",paymentInfo:a.paymentInfo,finalLocation:a.finalLiveLocation,quotedPaymentInfo:a.quotedPaymentInfo,bizSource:b.bizSource});void d("WAWebLimitSharingProtoUtils").parseLimitSharingFromProtocolHistorySyncMessage(a,b);return m(a,b)}function m(a,b){if(a.messageStubType==null)return;var c=d("WAWebProtobufsWeb.pb").WebMessageInfo$StubType;switch(a.messageStubType){case c.REVOKE:b.type="revoked";b.subtype="sender";b.kind=d("WAWebMsgType").MsgKind.RevokedMessage;var e=a.messageStubParameters;e=e!=null&&e.length>0?e[0]:null;if(e!=null){b.protocolMessageKey=(e=l(a,babelHelpers["extends"]({},a.key,{id:e})))==null?void 0:e.msgKey}return b;case c.CIPHERTEXT:b.type="ciphertext";b.kind=d("WAWebMsgType").MsgKind.Ciphertext;return b;case c.OVERSIZED:b.type="oversized";b.kind=d("WAWebMsgType").MsgKind.Oversized;return b;case c.FUTUREPROOF:b.kind=d("WAWebMsgType").MsgKind.Unknown;b.subtype="phone";return b;case c.CAPI_GROUP_NE2EE_SYSTEM_MESSAGE:b.type="notification_template";b.subtype="is_capi_hosted_group";return b;default:return n(a,b)}}function n(a,b){var e;if(a.messageStubType==null)return;var f=d("WAWebProtobufsWeb.pb").WebMessageInfo$StubType;b.type="notification_template";b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.templateParams=Array.isArray(a.messageStubParameters)?a.messageStubParameters.map(function(b){return a.messageStubType===f.GROUP_CREATE||a.messageStubType===f.GROUP_CHANGE_SUBJECT?b:d("WAWebE2EProtoUtils").decodeJid(b)}):void 0;if(a.messageStubType==null){b.templateParams=void 0;return b}switch(a.messageStubType){case f.NON_VERIFIED_TRANSITION:b.subtype="non_verified_transition";break;case f.UNVERIFIED_TRANSITION:b.subtype="unverified_transition";break;case f.VERIFIED_TRANSITION:b.subtype="verified_transition";break;case f.VERIFIED_LOW_UNKNOWN:b.subtype="verified_low_unknown";break;case f.VERIFIED_HIGH:b.subtype="verified_high";break;case f.VERIFIED_INITIAL_UNKNOWN:b.subtype="verified_initial_unknown";break;case f.VERIFIED_INITIAL_LOW:b.subtype="verified_initial_low";break;case f.VERIFIED_INITIAL_HIGH:b.subtype="verified_initial_high";break;case f.VERIFIED_TRANSITION_ANY_TO_NONE:b.subtype="verified_transition_any_to_none";break;case f.VERIFIED_TRANSITION_ANY_TO_HIGH:b.subtype="verified_transition_any_to_high";break;case f.VERIFIED_TRANSITION_HIGH_TO_LOW:b.subtype="verified_transition_high_to_low";break;case f.VERIFIED_TRANSITION_HIGH_TO_UNKNOWN:b.subtype="verified_transition_high_to_unknown";break;case f.VERIFIED_TRANSITION_UNKNOWN_TO_LOW:b.subtype="verified_transition_unknown_to_low";break;case f.VERIFIED_TRANSITION_LOW_TO_UNKNOWN:b.subtype="verified_transition_low_to_unknown";break;case f.VERIFIED_TRANSITION_NONE_TO_LOW:b.subtype="verified_transition_none_to_low";break;case f.VERIFIED_TRANSITION_NONE_TO_UNKNOWN:b.subtype="verified_transition_none_to_unknown";break;case f.GROUP_CREATE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="create";b.body=b.templateParams[0];b.templateParams=void 0;break;case f.REPORT_TO_ADMIN_ENABLED_STATUS:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="allow_admin_reports";break;case f.GROUP_DELETE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="delete";b.templateParams=void 0;break;case f.GROUP_CHANGE_SUBJECT:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="subject";b.body=b.templateParams[0];b.templateParams=void 0;break;case f.GROUP_CHANGE_ICON:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="picture";b.body=b.templateParams[0];b.templateParams=void 0;break;case f.GROUP_CHANGE_INVITE_LINK:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="revoke_invite";break;case f.GROUP_CHANGE_DESCRIPTION:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="description";b.body=b.templateParams[0];break;case f.GROUP_CHANGE_RESTRICT:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="restrict";b.body=b.templateParams[0];break;case f.GROUP_CHANGE_ANNOUNCE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="announce";b.body=b.templateParams[0];break;case f.GROUP_CHANGE_NO_FREQUENTLY_FORWARDED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="no_frequently_forwarded";b.body=b.templateParams[0];break;case f.GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="announce_msg_bounce";b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_ADD:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="add";b.recipients=b.templateParams;b.templateParams=void 0;Array.isArray(b.recipients)&&b.recipients.length===1&&b.author===b.recipients[0]&&(b.author=void 0);break;case f.GROUP_PARTICIPANT_REMOVE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="remove";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_PROMOTE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="promote";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_DEMOTE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="demote";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_INVITE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="invite";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_LEAVE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="leave";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_CHANGE_NUMBER:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="modify";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_V4_ADD_INVITE_SENT:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="v4_add_invite_sent";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="v4_add_invite_join";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GROUP_INVITE_LINK_GROWTH_LOCKED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype=b.templateParams[0]==="true"?"growth_locked":"growth_unlocked";b.body="invite";b.templateParams=void 0;break;case f.GROUP_PARTICIPANT_LINKED_GROUP_JOIN:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="linked_group_join";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.BROADCAST_CREATE:b.type="broadcast_notification";b.kind=d("WAWebMsgType").MsgKind.BroadcastNotification;b.subtype="create";b.body=(e=b.templateParams[0])!=null?e:"0";b.templateParams=void 0;break;case f.BROADCAST_ADD:b.type="broadcast_notification";b.kind=d("WAWebMsgType").MsgKind.BroadcastNotification;b.subtype="add";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.BROADCAST_REMOVE:b.type="broadcast_notification";b.kind=d("WAWebMsgType").MsgKind.BroadcastNotification;b.subtype="remove";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.GENERIC_NOTIFICATION:b.type="notification";b.kind=d("WAWebMsgType").MsgKind.Notification;b.body=b.templateParams[0];b.templateParams=void 0;break;case f.E2E_IDENTITY_CHANGED:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="identity";b.body=b.templateParams[0]instanceof c("WAWebWid")?b.templateParams[0].toString():b.templateParams[0];b.templateParams=void 0;break;case f.E2E_IDENTITY_UNAVAILABLE:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="e2e_identity_unavailable";break;case f.CHAT_PSA:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="chat_psa";break;case f.E2E_DEVICE_CHANGED:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="device";b.body=b.templateParams[0]instanceof c("WAWebWid")?b.templateParams[0].toString():b.templateParams[0];b.devicesAdded=parseInt(b.templateParams[1],10);b.devicesRemoved=parseInt(b.templateParams[2],10);b.templateParams=void 0;break;case f.E2E_ENCRYPTED:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="encrypt";break;case f.E2E_ENCRYPTED_NOW:b.type="e2e_notification";b.kind=d("WAWebMsgType").MsgKind.E2eNotification;b.subtype="encrypt_now";break;case f.CALL_MISSED_VOICE:b.type="call_log";b.kind=d("WAWebMsgType").MsgKind.CallLog;b.subtype="miss";break;case f.CALL_MISSED_VIDEO:b.type="call_log";b.kind=d("WAWebMsgType").MsgKind.CallLog;b.subtype="miss_video";break;case f.CALL_MISSED_GROUP_VOICE:b.type="call_log";b.kind=d("WAWebMsgType").MsgKind.CallLog;b.subtype="miss_group";break;case f.CALL_MISSED_GROUP_VIDEO:b.type="call_log";b.kind=d("WAWebMsgType").MsgKind.CallLog;b.subtype="miss_group_video";break;case f.SILENCED_UNKNOWN_CALLER_AUDIO:case f.SILENCED_UNKNOWN_CALLER_VIDEO:b.type="call_log";b.kind=d("WAWebMsgType").MsgKind.CallLog;b.subtype="silence";break;case f.INDIVIDUAL_CHANGE_NUMBER:b.subtype="change_number";break;case f.SENDER_INVITE:b.subtype="sender_invite";break;case f.RECEIVER_INVITE:b.subtype="receiver_invite";break;case f.MASKED_THREAD_CREATED:b.subtype="masked_thread_created";break;case f.CAG_MASKED_THREAD_CREATED:b.subtype="cag_masked_thread_created";break;case f.CHANGE_EPHEMERAL_SETTING:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="ephemeral";b.author=b.templateParams[1];break;case f.PAYMENT_CIPHERTEXT:b.type="payment";b.kind=d("WAWebMsgType").MsgKind.Payment;b.subtype="ciphertext";if(a.paymentInfo!=null){e=d("WAWebE2EProtoUtils").parseMsgPaymentInfo(a.paymentInfo);b.paymentStatus=e.paymentStatus;b.paymentTxnStatus=e.paymentTxnStatus;b.paymentCurrency=e.paymentCurrency;b.paymentAmount1000=e.paymentAmount1000;b.paymentMessageReceiverJid=e.paymentMessageReceiverJid;b.paymentExpiryTimestamp=e.paymentExpiryTimestamp;b.paymentTransactionTimestamp=e.paymentTransactionTimestamp}break;case f.PAYMENT_FUTUREPROOF:b.type="payment";b.kind=d("WAWebMsgType").MsgKind.Payment;b.subtype="futureproof";if(a.paymentInfo!=null){e=d("WAWebE2EProtoUtils").parseMsgPaymentInfo(a.paymentInfo);b.paymentStatus=e.paymentStatus;b.paymentTxnStatus=e.paymentTxnStatus;b.paymentCurrency=e.paymentCurrency;b.paymentAmount1000=e.paymentAmount1000;b.paymentMessageReceiverJid=e.paymentMessageReceiverJid;b.paymentExpiryTimestamp=e.paymentExpiryTimestamp;b.paymentTransactionTimestamp=e.paymentTransactionTimestamp}break;case f.PAYMENT_ACTION_REQUEST_CANCELLED:b.subtype="payment_transaction_request_cancelled";break;case f.PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED:b.subtype="payment_transaction_status_update_failed";break;case f.PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED:b.subtype="payment_transaction_status_update_refunded";break;case f.PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED:b.subtype="payment_transaction_status_update_refund_failed";break;case f.PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP:b.subtype="payment_transaction_status_receiver_pending_setup";break;case f.PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP:b.subtype="payment_transaction_status_receiver_success_after_hiccup";break;case f.PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER:b.subtype="payment_action_account_setup_reminder";break;case f.PAYMENT_ACTION_SEND_PAYMENT_REMINDER:b.subtype="payment_action_send_payment_reminder";break;case f.PAYMENT_ACTION_SEND_PAYMENT_INVITATION:b.subtype="payment_action_send_payment_invitation";break;case f.PAYMENT_ACTION_REQUEST_DECLINED:b.subtype="payment_action_request_declined";break;case f.PAYMENT_ACTION_REQUEST_EXPIRED:b.subtype="payment_action_request_expired";break;case f.BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM:b.subtype="biz_verified_transition_top_to_bottom";break;case f.BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP:b.subtype="biz_verified_transition_bottom_to_top";break;case f.BIZ_INTRO_TOP:b.subtype="biz_intro_top";break;case f.BIZ_INTRO_BOTTOM:b.subtype="biz_intro_bottom";break;case f.BIZ_NAME_CHANGE:b.subtype="biz_name_change";break;case f.BIZ_MOVE_TO_CONSUMER_APP:b.subtype="biz_move_to_consumer_app";break;case f.BIZ_TWO_TIER_MIGRATION_TOP:b.subtype="biz_two_tier_migration_top";break;case f.BIZ_TWO_TIER_MIGRATION_BOTTOM:b.subtype="biz_two_tier_migration_bottom";break;case f.BLUE_MSG_BSP_FB_TO_BSP_PREMISE:b.subtype="blue_msg_bsp_fb_to_bsp_premise";break;case f.BLUE_MSG_BSP_FB_TO_SELF_FB:b.subtype="blue_msg_bsp_fb_to_self_fb";break;case f.BLUE_MSG_BSP_FB_TO_SELF_PREMISE:b.subtype="blue_msg_bsp_fb_to_self_premise";break;case f.BLUE_MSG_BSP_FB_UNVERIFIED:b.subtype="blue_msg_bsp_fb_unverified";break;case f.BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:b.subtype="blue_msg_bsp_fb_unverified_to_bsp_premise_verified";break;case f.BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED:b.subtype="blue_msg_bsp_fb_unverified_to_self_fb_verified";break;case f.BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:b.subtype="blue_msg_bsp_fb_unverified_to_self_premise_verified";break;case f.BLUE_MSG_BSP_FB_VERIFIED:b.subtype="blue_msg_bsp_fb_verified";break;case f.BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:b.subtype="blue_msg_bsp_fb_verified_to_bsp_premise_unverified";break;case f.BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED:b.subtype="blue_msg_bsp_fb_verified_to_self_fb_unverified";break;case f.BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:b.subtype="blue_msg_bsp_fb_verified_to_self_premise_unverified";break;case f.BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE:b.subtype="blue_msg_bsp_premise_to_self_premise";break;case f.BLUE_MSG_BSP_PREMISE_UNVERIFIED:b.subtype="blue_msg_bsp_premise_unverified";break;case f.BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:b.subtype="blue_msg_bsp_premise_unverified_to_self_premise_verified";break;case f.BLUE_MSG_BSP_PREMISE_VERIFIED:b.subtype="blue_msg_bsp_premise_verified";break;case f.BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:b.subtype="blue_msg_bsp_premise_verified_to_self_premise_unverified";break;case f.BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED:b.subtype="blue_msg_consumer_to_bsp_fb_unverified";break;case f.BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED:b.subtype="blue_msg_consumer_to_bsp_premise_unverified";break;case f.BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED:b.subtype="blue_msg_consumer_to_self_fb_unverified";break;case f.BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED:b.subtype="blue_msg_consumer_to_self_premise_unverified";break;case f.BLUE_MSG_SELF_FB_TO_BSP_PREMISE:b.subtype="blue_msg_self_fb_to_bsp_premise";break;case f.BLUE_MSG_SELF_FB_TO_SELF_PREMISE:b.subtype="blue_msg_self_fb_to_self_premise";break;case f.BLUE_MSG_SELF_FB_UNVERIFIED:b.subtype="blue_msg_self_fb_unverified";break;case f.BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:b.subtype="blue_msg_self_fb_unverified_to_bsp_premise_verified";break;case f.BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:b.subtype="blue_msg_self_fb_unverified_to_self_premise_verified";break;case f.BLUE_MSG_SELF_FB_VERIFIED:b.subtype="blue_msg_self_fb_verified";break;case f.BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:b.subtype="blue_msg_self_fb_verified_to_bsp_premise_unverified";break;case f.BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:b.subtype="blue_msg_self_fb_verified_to_self_premise_unverified";break;case f.BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE:b.subtype="blue_msg_self_premise_to_bsp_premise";break;case f.BLUE_MSG_SELF_PREMISE_UNVERIFIED:b.subtype="blue_msg_self_premise_unverified";break;case f.BLUE_MSG_SELF_PREMISE_VERIFIED:b.subtype="blue_msg_self_premise_verified";break;case f.BLUE_MSG_TO_BSP_FB:b.subtype="blue_msg_to_bsp_fb";break;case f.BLUE_MSG_TO_CONSUMER:b.subtype="blue_msg_to_consumer";break;case f.BLUE_MSG_TO_SELF_FB:b.subtype="blue_msg_to_self_fb";break;case f.BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED:b.subtype="blue_msg_unverified_to_bsp_fb_verified";break;case f.BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:b.subtype="blue_msg_unverified_to_bsp_premise_verified";break;case f.BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED:b.subtype="blue_msg_unverified_to_self_fb_verified";break;case f.BLUE_MSG_UNVERIFIED_TO_VERIFIED:b.subtype="blue_msg_unverified_to_verified";break;case f.BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED:b.subtype="blue_msg_verified_to_bsp_fb_unverified";break;case f.BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:b.subtype="blue_msg_verified_to_bsp_premise_unverified";break;case f.BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED:b.subtype="blue_msg_verified_to_self_fb_unverified";break;case f.BLUE_MSG_VERIFIED_TO_UNVERIFIED:b.subtype="blue_msg_verified_to_unverified";break;case f.BIZ_PRIVACY_MODE_INIT_FB:b.subtype="biz_privacy_mode_init_fb";((e=b.id)==null?void 0:(e=e.remote)==null?void 0:e.isBot())&&(b.subtype="bot_init");break;case f.BIZ_PRIVACY_MODE_INIT_BSP:b.subtype="biz_privacy_mode_init_bsp";break;case f.BIZ_PRIVACY_MODE_TO_FB:b.subtype="biz_privacy_mode_to_fb";((e=b.id)==null?void 0:(e=e.remote)==null?void 0:e.isBot())&&(b.subtype="bot_init");break;case f.BIZ_PRIVACY_MODE_TO_BSP:b.subtype="biz_privacy_mode_to_bsp";break;case f.DISAPPEARING_MODE:b.subtype="disappearing_mode";break;case f.BLOCK_CONTACT:b.subtype="block_contact";break;case f.ADMIN_REVOKE:b.type="revoked";b.subtype="admin";b.kind=d("WAWebMsgType").MsgKind.RevokedMessage;b.revokeSender=b.templateParams[1]instanceof c("WAWebWid")?b.templateParams[1]:void 0;b.revokeSender||d("WALogger").LOG(h()).devConsole(b.templateParams);e=b.templateParams[0];b.protocolMessageKey=(e=l(a,{remoteJid:a.key.remoteJid,fromMe:d("WAWebUserPrefsMeUser").isMeAccount(b.from),id:e,participant:a.key.participant}))==null?void 0:e.msgKey;b.templateParams=void 0;break;case f.COMMUNITY_LINK_PARENT_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="parent_group_link";break;case f.COMMUNITY_LINK_SIBLING_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sibling_group_link";break;case f.COMMUNITY_LINK_SUB_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sub_group_link";break;case f.COMMUNITY_CREATE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_create";break;case f.COMMUNITY_UNLINK_PARENT_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="parent_group_unlink";break;case f.INTEGRITY_UNLINK_PARENT_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="integrity_parent_group_unlink";break;case f.COMMUNITY_UNLINK_SIBLING_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sibling_group_unlink";break;case f.COMMUNITY_UNLINK_SUB_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sub_group_unlink";break;case f.COMMUNITY_PARTICIPANT_PROMOTE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="linked_group_promote";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.COMMUNITY_PARTICIPANT_DEMOTE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="linked_group_demote";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.EPHEMERAL_KEEP_IN_CHAT:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="ephemeral_keep_in_chat";break;case f.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="membership_approval_mode";break;case f.GROUP_MEMBER_ADD_MODE:if(!d("WAWebABProps").getABPropConfigValue("web_anyone_can_add_group_setting_enabled")){b.templateParams=void 0;break}b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="member_add_mode";break;case f.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.recipients=b.templateParams;b.subtype="created_membership_requests";break;case f.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="membership_approval_request";break;case f.GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="auto_add";break;case f.COMMUNITY_PARENT_GROUP_DELETED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="delete_parent_group";break;case f.BIZ_CHAT_ASSIGNMENT:b.subtype="chat_assignment";break;case f.BIZ_CHAT_ASSIGNMENT_UNASSIGN:b.subtype="chat_assignment_unassign";break;case f.COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="subject";b.body=b.templateParams[1];break;case f.CAG_INVITE_AUTO_ADD:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="invite_auto_add";b.recipients=[d("WAWebUserPrefsMeUser").getMaybeMeUser()];break;case f.CAG_INVITE_AUTO_JOINED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="invite_auto_add";b.recipients=b.templateParams;b.templateParams=void 0;break;case f.COMMUNITY_PARTICIPANT_ADD_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_participant_add_rich";break;case f.SUB_GROUP_PARTICIPANT_ADD_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sub_group_participant_add_rich";break;case f.SUB_GROUP_INVITE_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="sub_group_invite_rich";b.author=void 0;break;case f.COMMUNITY_INVITE_AUTO_ADD_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_invite_auto_add_rich";b.author=void 0;break;case f.COMMUNITY_INVITE_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_invite_rich";b.author=void 0;break;case f.COMMUNITY_LINK_PARENT_GROUP_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_link_parent_group_rich";break;case f.COMMUNITY_CHANGE_DESCRIPTION:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="parent_group_description";b.body=b.templateParams[0];break;case f.PINNED_MESSAGE_IN_CHAT:b.type="pinned_message";b.kind=d("WAWebMsgType").MsgKind.PinnedMessage;break;case f.COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="allow_non_admin_sub_group_creation";break;case f.EMPTY_SUBGROUP_CREATE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="empty_subgroup_create";break;case f.SUGGESTED_SUBGROUP_ANNOUNCE:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="created_subgroup_suggestion";break;case f.SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="subgroup_admin_triggered_auto_add";break;case f.GENERAL_CHAT_ADD:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="general_chat_add";break;case f.GENERAL_CHAT_AUTO_ADD_DISABLED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="general_chat_auto_add_disabled";break;case f.BIZ_BOT_1P_MESSAGING_ENABLED:b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_bot_1p_disclosure";break;case f.BIZ_BOT_3P_MESSAGING_ENABLED:b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_bot_3p_disclosure";break;case f.CHANGE_USERNAME:b.subtype="change_username";break;case f.BIZ_COEX_PRIVACY_INIT_SELF:if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){b.templateParams=void 0;break}b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_me_account_type_is_hosted";break;case f.BIZ_COEX_PRIVACY_TRANSITION_SELF:if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){b.templateParams=void 0;break}b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_me_account_type_is_hosted_transition";break;case f.BIZ_COEX_PRIVACY_INIT:if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){b.templateParams=void 0;break}b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_account_type_is_hosted";break;case f.BIZ_COEX_PRIVACY_TRANSITION:if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){b.templateParams=void 0;break}b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="biz_account_type_changed_to_hosted";break;case f.SUPPORT_AI_EDUCATION:b.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE;b.kind=d("WAWebMsgType").MsgKind.NotificationTemplate;b.subtype="saga_init";break;case f.EVENT_CANCELED:case f.EVENT_UPDATED:e=babelHelpers["extends"]({},d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(b),{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,subtype:"event_edit_decrypted",kind:d("WAWebMsgType").MsgKind.ProtocolEventEdit,eventName:b.templateParams[0],eventStartTime:d("WATimeUtils").unixTime(),isEventCanceled:a.messageStubType===f.EVENT_CANCELED,protocolMessageKey:c("WANullthrows")((e=l(a,c("WANullthrows")(a.targetMessageId)))==null?void 0:e.msgKey,"Error: buildMsgKey or targetMessageId is null or missing for event edit system message history sync parsing"),editMsgType:d("WAWebMsgType").MSG_TYPE.EVENT_CREATION,latestEditMsgKey:void 0,latestEditSenderTimestampMs:void 0});return e;case f.COMMUNITY_OWNER_UPDATED:b.type="gp2";b.kind=d("WAWebMsgType").MsgKind.Gp2;b.subtype="community_owner_update";break;case f.COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN:b.templateParams[0]==="on"&&(b.type="gp2",b.kind=d("WAWebMsgType").MsgKind.Gp2,b.subtype="community_hidden_group");break;default:b.templateParams=void 0;break}return b}g.buildMsgKey=l;g.parseWebMessageInfo=a;g.parseMsgStubProto=m}),98); __d("WAWebAdvUpdateParticipantApi",["WAJids","WALogger","WAWebPostSenderKeyExpiredMetric","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebWamEnumExpiryReason","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkUpdateGroupParticipantsInTransaction: error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateGroupParticipantsInTransaction: error: ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;try{e=(yield d("WAWebSchemaParticipant").getParticipantTable().equals(["participants"],String(a)))}catch(a){a.toString().includes("Failed to read large IndexedDB value")&&d("WALogger").ERROR(i(),a).sendLogs("indexeddb-participant-read-large-value");throw a}var f=e.map(function(e){var f=e.rotateKey,g=new Map(e.senderKey);c.forEach(function(b){var c;b=String(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(a.user,a.server,b));f=f||((c=g.get(b))!=null?c:!1);g["delete"](b)});f&&g.forEach(function(a,b){return g.set(b,!1)});b.forEach(function(b){g.set(String(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(a.user,a.server,b)),!1)});l(a,f,e,b,c);return babelHelpers["extends"]({},e,{senderKey:g,rotateKey:f})});return d("WAWebSchemaParticipant").getParticipantTable().bulkCreateOrReplace(f)});return j.apply(this,arguments)}function c(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var b;try{b=(yield d("WAWebSchemaParticipant").getParticipantTable().anyOf(["participants"],a.map(function(a){return String(a.wid)})))}catch(a){a.toString().includes("Failed to read large IndexedDB value")&&d("WALogger").ERROR(h(),a).sendLogs("indexeddb-participant-bulk-read-large-value");throw a}if(b.length===0)return;var c=new Map();a.forEach(function(a){c.set(String(a.wid),a)});a=b.map(function(a){var b=a.rotateKey,e=new Map(a.senderKey);a.participants.forEach(function(f){var g=c.get(f);if(!g)return;f=g.wid;var h=g.added,i=g.removed;i.forEach(function(a){var c;a=String(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(g.wid.user,g.wid.server,a));b=b||((c=e.get(a))!=null?c:!1);e["delete"](a)});b&&e.forEach(function(a,b){return e.set(b,!1)});h.forEach(function(a){e.set(String(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(g.wid.user,g.wid.server,a)),!1)});l(f,b,a,h,i)});return babelHelpers["extends"]({},a,{senderKey:e,rotateKey:b})});return d("WAWebSchemaParticipant").getParticipantTable().bulkCreateOrReplace(a)});return k.apply(this,arguments)}function l(a,b,c,e,f){if(b&&!c.rotateKey){f.includes(d("WAJids").DEFAULT_DEVICE_ID)&&e.includes(d("WAJids").DEFAULT_DEVICE_ID)?b=d("WAWebWamEnumExpiryReason").EXPIRY_REASON.IDENTITY_CHANGE:((f=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:f.equals(a))?b=d("WAWebWamEnumExpiryReason").EXPIRY_REASON.PEER_COMPANION_UNPAIR:b=d("WAWebWamEnumExpiryReason").EXPIRY_REASON.OTHER_DEVICE_UNPAIR;d("WAWebPostSenderKeyExpiredMetric").postSenderKeyExpiredMetric({chatId:c.groupId,deviceCount:c.senderKey.size,expiryReason:b})}}g.updateGroupParticipantsInTransaction=a;g.bulkUpdateGroupParticipantsInTransaction=c}),98); __d("WAWebFMXUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("fmx_ctwa_kill_switch")}g.fmxCTWAKillSwitchEnabled=a}),98); __d("WAWebContactSystemMsg",["WATimeUtils","WAWebApiContact","WAWebBizGatingUtils","WAWebFMXUtils","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(a,b){var e=d("WAWebUserPrefsMeUser").getMeUser(),f=new(c("WAWebMsgKey"))({fromMe:d("WAWebUserPrefsMeUser").isMeAccount(b),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:f,t:d("WATimeUtils").unixTime(),type:"e2e_notification",kind:d("WAWebMsgType").MsgKind.E2eNotification,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"identity",from:a,to:e,body:b.toString()}}function e(a,b){b===void 0&&(b="encrypt");return l(a,{type:"e2e_notification",kind:d("WAWebMsgType").MsgKind.E2eNotification,subtype:b,templateParams:[]})}function f(a,b,c){c===void 0&&(c=[]);return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:b,templateParams:c})}function h(a,b,e){var f=e?d("WAWebUserPrefsMeUser").getMeUser():a;if(f==null)throw c("err")("Cannot set null initiator for DDM system message: "+a.toString()+" / "+String(e));return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"disappearing_mode",templateParams:[],ephemeralDuration:b,ephemeralSettingUser:f})}function i(a,b,c){return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"disappearing_mode_update",templateParams:[],ephemeralDuration:b,ephemeralSettingUser:c})}function j(a,b){return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"change_username",templateParams:b!=null?[b]:[""]})}function k(a){return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"disappearing_mode_unsupported",templateParams:[]})}function l(a,b){var e=d("WAWebUserPrefsMeUser").getMaybeMeLid(),f=d("WAWebUserPrefsMeUser").getMeUser(),g=new(c("WAWebMsgKey"))({fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});return babelHelpers["extends"]({id:g,t:d("WATimeUtils").unixTime(),from:a,to:a.isLid()&&e!=null?e:f},b)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.isEnterprise&&!d("WAWebBizGatingUtils").getFmxAgmEnabled())return null;if(b.isEnterprise&&!b.isFMXCtWA&&d("WAWebBizGatingUtils").getFmxAgmEnabled())return null;if(!a.isUser()||b.isWASupportStartingChat||b.iAmStartingChat&&!b.isFMXCtWA||b.isFromCTWA&&!b.isFMXCtWA&&d("WAWebFMXUtils").fmxCTWAKillSwitchEnabled())return null;if(a.isBot())return null;b=(yield d("WAWebApiContact").isAddressBookContact(a.toJid()));return b?null:l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"contact_info_card",templateParams:[a]})});return n.apply(this,arguments)}function o(a,b){return l(a,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"limit_sharing_system_message",limitSharing:b,templateParams:[]})}g.genSecurityCodeNotificationMsg=a;g.genEncryptNotificationMsg=e;g.genNonE2ENotificationMsg=f;g.genDefaultDisappearingModeSystemMsg=h;g.genDisappearingModeUpdateSystemMsg=i;g.genUsernameChangeSystemMsg=j;g.genDisappearingModeUnsupportedSystemMsg=k;g.genNotificationMsg=l;g.genContactInfoCardMsg=m;g.genLimitSharingUpdateSystemMsg=o}),98); __d("WAWebIdentityChangeApi",["Promise","WAJids","WANullthrows","WAWebAdvUpdateParticipantApi","WAWebApiContact","WAWebApiDeviceList","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebContactSystemMsg","WAWebDeviceListPk","WAWebHandleMsgTypes.flow","WAWebHandleSingleMsg","WAWebModelStorageUtils","WAWebMsgType","WAWebOfflineDeviceCache","WAWebProtobufsAdv.pb","WAWebSchemaChat","WAWebSecurityCodeApi","WAWebSendTcTokenWhenDeviceIdentityChange","WAWebSignal","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;c=(c=a.device)!=null?c:d("WAJids").DEFAULT_DEVICE_ID;a=d("WAWebWidFactory").toUserWid(a);if(c===d("WAJids").DEFAULT_DEVICE_ID){yield j({wid:a});c=(yield d("WAWebSecurityCodeApi").addSecurityCodeChangedNotifications({user:a,offline:b}));void d("WAWebSendTcTokenWhenDeviceIdentityChange").sendTcTokenWhenDeviceIdentityChange(a);return c}});return i.apply(this,arguments)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.wid,f=a.stanzaLid;a=a.offline;var g=[d("WAJids").DEFAULT_DEVICE_ID],i=[d("WAJids").DEFAULT_DEVICE_ID],j=!1;if(a===!0)d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(String(e),null),yield d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){return d("WAWebAdvUpdateParticipantApi").updateGroupParticipantsInTransaction(e,i,g)});else{a=(yield d("WAWebApiDeviceList").getDeviceRecord(e));a&&!a.deleted&&(a.devices.forEach(function(a){a.id!==d("WAJids").DEFAULT_DEVICE_ID&&g.push(a.id)}),d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&a.advAccountType===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(j=!0));(h||(h=b("Promise"))).all(g.map(function(a){return a===d("WAJids").DEFAULT_DEVICE_ID?(h||(h=b("Promise"))).resolve():d("WAWebSignal").Session.deleteRemoteInfo(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(e.user,e.server,a))}));yield h.all([d("WAWebModelStorageUtils").getStorage().lock(["participant"],function(){return d("WAWebAdvUpdateParticipantApi").updateGroupParticipantsInTransaction(e,i,g)}),d("WAWebApiDeviceList").createOrReplaceDeviceRecord({id:d("WAWebDeviceListPk").createDeviceListPK(e),deleted:!0})]);if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&j===!0){yield d("WAWebApiContact").updateContactAdvHostedType(e,d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE);a=[e.toString()];if(e.isLid()){j=d("WAWebApiContact").getPnIfLidIsLatestMapping(d("WAWebWidFactory").toUserWid(e));j!=null&&a.push(j.toString())}else f!=null&&a.push(f.toString());j=(yield d("WAWebSchemaChat").getChatTable().bulkGet(a,!1));f=j.find(Boolean);if(f!=null){a=d("WAWebWidFactory").createWid(f.id);j=d("WAWebContactSystemMsg").genNotificationMsg(a,{type:"e2e_notification",kind:d("WAWebMsgType").MsgKind.E2eNotification,subtype:"encrypt_now",templateParams:[]});yield d("WAWebHandleSingleMsg").handleSingleMsg(c("WANullthrows")(j.from),j,"bizStateChangeNotification",d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE)}void d("WAWebBizCoexUtils").triggerUsyncForCoexUpdate(e)}}});return k.apply(this,arguments)}g.handleNewIdentity=a;g.clearDeviceRecordForIdentityChange=j}),98); __d("WAWebAdvHostedAccountTypeSystemMsg",["WATimeUtils","WAWebBizCoexGatingUtils","WAWebMsgKey","WAWebMsgType","WAWebProtobufsAdv.pb","WAWebUserPrefsMeUser","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){function a(a,b,e,f){f===void 0&&(f=!1);if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){if(!a.isUser())return null;var g=d("WAWebUserPrefsMeUser").getMeUser();b=new(c("WAWebMsgKey"))({fromMe:b.equals(g),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});if(e===d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE)return{id:b,t:d("WATimeUtils").unixTime(),type:"e2e_notification",kind:d("WAWebMsgType").MsgKind.E2eNotification,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:f&&d("WAWebBizCoexGatingUtils").hostedOverrideAdvAccountSignatureKeyEnabled()?"encrypt_now":"encrypt",from:a,to:g};else if(e===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED)return{id:b,t:d("WATimeUtils").unixTime(),type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"biz_account_type_changed_to_hosted",from:a,to:g}}return null}function b(a,b){if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){if(!a.isUser())return null;var e=d("WAWebUserPrefsMeUser").getMeUser();b=new(c("WAWebMsgKey"))({fromMe:b.equals(e),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:b,t:d("WATimeUtils").unixTime(),type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"biz_me_account_type_is_hosted",from:a,to:e}}return null}function e(a,b){if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){if(!a.isUser())return null;var e=d("WAWebUserPrefsMeUser").getMeUser();b=new(c("WAWebMsgKey"))({fromMe:b.equals(e),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:b,t:d("WATimeUtils").unixTime(),type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"biz_account_type_is_hosted",from:a,to:e}}return null}function f(a,b){if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&d("WAWebBizCoexGatingUtils").smbHostedLazySystemMsgInsertInHistorySyncEnabled()&&a.isUser()){var e=d("WAWebUserPrefsMeUser").getMeUser();b=new(c("WAWebMsgKey"))({fromMe:b.equals(e),remote:a,id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:b,t:d("WATimeUtils").unixTime(),type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"biz_me_account_type_is_hosted_transition",from:a,to:e}}return null}g.genAdvAccountTypeChangeNotificationMsg=a;g.genAdvMeAccountIsHostedNotificationMsg=b;g.genAdvAccountTypeInitialSysMsg=e;g.genAdvAccountTypeSelfTransitionToCoexNotificationMsg=f}),98); __d("WAWebAdvDeviceNotificationApi",["Promise","WALogger","WAWebAdvHostedAccountTypeSystemMsg","WAWebBizCoexGatingUtils","WAWebBizCoexHostedAddVerification","WAWebProtobufsAdv.pb","WAWebSchemaChat","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["get chats failed during generateAdvAccountTypeChangeNotifications"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["accountTypeChangeNotification: check coex cache for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["SMB unexpected self adv system msg"]);k=function(){return a};return a}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e={notifications:[],chatIds:[]};if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){var f=[];if(a.equals(d("WAWebUserPrefsMeUser").getMeUser()))d("WALogger").ERROR(k()).tags("generateAdvAccountTypeChangeNotifications");else{b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(j(),a==null?void 0:a.toLogString()),d("WAWebBizCoexHostedAddVerification").assertThrowsWidAdvTypeFromVerificationCache(a));try{var g=(yield d("WAWebSchemaChat").getChatTable().get(String(a),!1));g&&f.push(d("WAWebWidFactory").createWid(g.id))}catch(a){d("WALogger").DEV(i()).verbose().devConsole(a);throw c("err")("get chays failed")}}g=f.map(function(c){return d("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeChangeNotificationMsg(c,a,b,!0)}).filter(Boolean);e.notifications=g;e.chatIds=f.map(String);return e}return e});return m.apply(this,arguments)}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled())throw c("err")("hosted system msg gen: unexpected env");var e=[],f=new Set();a=(yield (h||(h=b("Promise"))).all(a.map(function(a){var c=a.wid;a=a.newAdvAccountType;return a!=null?l(c,a):(h||(h=b("Promise"))).resolve(null)})));a.forEach(function(a){a&&(e=e.concat(a.notifications),a.chatIds.forEach(function(a){return f.add(a)}))});return e.length>0?{notifications:e,chatIds:Array.from(f)}:{notifications:[],chatIds:[]}});return n.apply(this,arguments)}g.bulkGenerateDeviceAndAdvAccountTypeChangeNotifications=a}),98); __d("WAWebApiGetDeviceUpdateLock",["WAWebBizCoexGatingUtils","WAWebModelStorageUtils"],(function(a,b,c,d,e,f,g){function a(a,b,c,e){c===void 0&&(c=!1);e===void 0&&(e=!1);var f=["participant","device-list"];b&&(f=[].concat(f,["message","message-association"]));c&&(f=[].concat(f,["missing-keys"]));d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(e&&(f=[].concat(f,["contact"])));return d("WAWebModelStorageUtils").getStorage().lock(f,function(){return a()})}g.getDeviceUpdateLock=a}),98); __d("WAWebCollectionVersionStore",["WAWebSchemaCollectionVersion"],(function(a,b,c,d,e,f,g){a=function(){function a(){}var b=a.prototype;b.get=function(a){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().get(a)};b.bulkGet=function(a){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().bulkGet(a)};b.getAll=function(){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().all()};b.update=function(a,b){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().createOrMerge(a,babelHelpers["extends"]({collection:a},b))};b.bulkUpdate=function(a){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().bulkCreateOrMerge(a)};b.clear=function(){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().clear()};return a}();a.locks=["collection-version"];g.WAWebCollectionVersionStore=a}),98); __d("WAWebSyncdDb",["WALogger","WASyncAction.pb","WASyncdKeyTypes","WAWebABProps","WAWebSchemaCollectionVersion","WAWebSchemaMissingKeys","WAWebSchemaPendingMutations","WAWebSchemaSyncActions","WAWebSchemaSyncKeys","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: adding pending mutations:\n ",""]);h=function(){return a};return a}function a(){return d("WAWebSchemaPendingMutations").getPendingMutationsTable().all()}function c(a,b){return d("WAWebSchemaPendingMutations").getPendingMutationsTable().equals(a,b)}function e(a,b){return d("WAWebSchemaPendingMutations").getPendingMutationsTable().equals(a,b)}function f(a){d("WALogger").DEV(h(),JSON.stringify(a.map(function(a){return{operation:a.operation,index:a.index,value:d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction)}}),null,2));return d("WAWebSchemaPendingMutations").getPendingMutationsTable().bulkCreate(a)}function i(a){return d("WAWebSchemaPendingMutations").getPendingMutationsTable().bulkRemove(a)}function j(a,b,c){return d("WAWebSchemaCollectionVersion").getCollectionVersionTable().createOrMerge(a,{collection:a,version:b,ltHash:c})}function k(a){return d("WAWebSchemaSyncActions").getSyncActionsTable().get(a)}function l(a,b){return d("WAWebSchemaSyncActions").getSyncActionsTable().anyOf(a,b)}function m(a){return d("WAWebSchemaSyncActions").getSyncActionsTable().createOrReplace(a)}function n(a){return d("WAWebSchemaSyncActions").getSyncActionsTable().bulkCreateOrReplace(a)}function o(a){return d("WAWebSchemaSyncActions").getSyncActionsTable().bulkCreateOrMerge(a.map(function(a){return babelHelpers["extends"]({},a)}))}function p(a){return d("WAWebSchemaSyncActions").getSyncActionsTable().bulkRemove(a)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaSyncKeys").getSyncKeysTable().get(new Uint8Array(d("WASyncdKeyTypes").fromSyncKeyId(a))));return a==null?a:d("WAWebSchemaSyncKeys").convertToSyncKeyFromRow(a)});return r.apply(this,arguments)}function s(){return d("WAWebSchemaSyncKeys").getSyncKeysTable().all().then(function(a){return a.map(d("WAWebSchemaSyncKeys").convertToSyncKeyFromRow)})}function t(a){return d("WAWebABProps").getABPropConfigValue("enable_override_syncd_key")?d("WAWebSchemaSyncKeys").getSyncKeysTable().createOrReplace(d("WAWebSchemaSyncKeys").convertFromSyncKeyToRow(a)).then(function(a){return d("WASyncdKeyTypes").toSyncKeyId(a.buffer)}):d("WAWebSchemaSyncKeys").getSyncKeysTable().create(d("WAWebSchemaSyncKeys").convertFromSyncKeyToRow(a)).then(function(a){return d("WASyncdKeyTypes").toSyncKeyId(a.buffer)})}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaSyncKeys").getSyncKeysTable().equals(["keyEpoch"],a));a.forEach(function(a){return d("WAWebSchemaSyncKeys").getSyncKeysTable().merge({keyId:a.keyId},{timestamp:0})})});return v.apply(this,arguments)}function w(){return d("WAWebSchemaMissingKeys").getMissingKeysTable().count()}function x(a){return d("WAWebSchemaMissingKeys").getMissingKeysTable().bulkGet(a).then(function(a){return a.map(function(a){return a==null?null:d("WAWebSchemaMissingKeys").convertToMissingKeyFromRow(a)})})}function y(){return d("WAWebSchemaMissingKeys").getMissingKeysTable().all().then(function(a){return a.map(d("WAWebSchemaMissingKeys").convertToMissingKeyFromRow)})}function z(a){return d("WAWebSchemaMissingKeys").getMissingKeysTable().bulkRemove(a)}function A(a){return d("WAWebSchemaMissingKeys").getMissingKeysTable().bulkCreateOrMerge(a.map(d("WAWebSchemaMissingKeys").convertFromMissingKeyToRow))}g.getAllPendingMutationsRows=a;g.getPendingMutationsRows=c;g.getPendingMutationsRowsByIndex=e;g.appendPendingMutationsRows=f;g.bulkRemovePendingMutations=i;g.setCollectionVersion=j;g.getSyncAction=k;g.getSyncActionsRows=l;g.setSyncAction=m;g.setSyncActionRows=n;g.updateSyncActionRows=o;g.deleteSyncActionRows=p;g.getSyncKey=q;g.getAllSyncKeys=s;g.createSyncKey=t;g.expireSyncKey=u;g.getMissingKeyCount=w;g.bulkGetMissingKeys=x;g.getAllMissingKeys=y;g.bulkRemoveMissingKeys=z;g.createOrUpdateMissingKeys=A}),98); __d("WAWebMissingKeyStore",["WAWebSchemaMissingKeys","WAWebSyncdDb"],(function(a,b,c,d,e,f,g){a=function(){function a(){}var b=a.prototype;b.getAll=function(){return d("WAWebSyncdDb").getAllMissingKeys()};b.bulkGet=function(a){return d("WAWebSyncdDb").bulkGetMissingKeys(a)};b.count=function(){return d("WAWebSyncdDb").getMissingKeyCount()};b.bulkUpdate=function(a){return d("WAWebSyncdDb").createOrUpdateMissingKeys(a)};b.bulkRemove=function(a){return d("WAWebSyncdDb").bulkRemoveMissingKeys(a)};b.clear=function(){return d("WAWebSchemaMissingKeys").getMissingKeysTable().clear()};return a}();a.locks=["missing-keys"];g.WAWebMissingKeyStore=a}),98); __d("WAWebPendingMutationStore",["WAWebNoop","WAWebSchemaPendingMutations","WAWebSyncdDb","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(){function a(){}var e=a.prototype;e.getByCollection=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getPendingMutationsRows(["collection"],a));return a.map(d("WAWebSchemaPendingMutations").convertToPendingMutationFromRow)});function c(b){return a.apply(this,arguments)}return c}();e.getAll=function(){return d("WAWebSyncdDb").getAllPendingMutationsRows()};e.bulkCreate=function(a){return d("WAWebSyncdDb").appendPendingMutationsRows(a).then(c("WAWebNoop"))};e.bulkRemove=function(a){return d("WAWebSyncdDb").bulkRemovePendingMutations(a)};e.clear=function(){return d("WAWebSchemaPendingMutations").getPendingMutationsTable().clear()};return a}();a.locks=["pending-mutations"];g.WAWebPendingMutationStore=a}),98); __d("WAWebSyncActionStore",["Promise","WAWebABProps","WAWebSchemaSyncActions","WAWebSyncdDb","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(){function a(){}var c=a.prototype;c.count=function(){return d("WAWebSchemaSyncActions").getSyncActionsTable().count()};c.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getSyncAction(a));return a==null?null:d("WAWebSchemaSyncActions").convertToSyncActionFromRow(a)});function c(b){return a.apply(this,arguments)}return c}();c.getByCollections=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getSyncActionsRows(["collection"],a.map(function(a){return a})));return a.map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)});function c(b){return a.apply(this,arguments)}return c}();c.getByIndexMacs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebABProps").getABPropConfigValue("web_syncd_query_index_mac_using_multiple_queries")&&a.length<7?this.getByIndexMacsMultiQuery(a):this.getByIndexMacsSingleQuery(a)});function c(b){return a.apply(this,arguments)}return c}();c.getByIndexMacsMultiQuery=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebSyncdDb").getSyncActionsRows(["indexMac"],[a])})));return a.flat().map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)});function c(b){return a.apply(this,arguments)}return c}();c.getByIndexMacsSingleQuery=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getSyncActionsRows(["indexMac"],a.map(function(a){return a})));return a.map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)});function c(b){return a.apply(this,arguments)}return c}();c.getByActionStates=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getSyncActionsRows(["actionState"],a.map(function(a){return a})));return a.map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)});function c(b){return a.apply(this,arguments)}return c}();c.getByModelInfos=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdDb").getSyncActionsRows(["modelId","modelType","actionState"],a.map(function(a){return a})));return a.map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)});function c(b){return a.apply(this,arguments)}return c}();c.getAll=function(){return d("WAWebSchemaSyncActions").getSyncActionsTable().all().then(function(a){return a.map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow)})};c.bulkSet=function(a){return d("WAWebSyncdDb").setSyncActionRows(a.map(d("WAWebSchemaSyncActions").convertFromSyncActionToRow))};c.bulkUpdate=function(a){return d("WAWebSyncdDb").updateSyncActionRows(a.map(d("WAWebSchemaSyncActions").convertFromSyncActionToRow))};c.bulkRemove=function(a){return d("WAWebSyncdDb").deleteSyncActionRows(a)};c.clear=function(){return d("WAWebSchemaSyncActions").getSyncActionsTable().clear()};return a}();a.locks=["sync-actions"];g.WAWebSyncActionStore=a}),98); __d("WAWebSyncKeyStore",["WAWebNoop","WAWebSchemaSyncKeys","WAWebSyncdDb"],(function(a,b,c,d,e,f,g){a=function(){function a(){}var b=a.prototype;b.get=function(a){return d("WAWebSyncdDb").getSyncKey(a)};b.getAll=function(){return d("WAWebSyncdDb").getAllSyncKeys()};b.set=function(a){return d("WAWebSyncdDb").createSyncKey(a).then(c("WAWebNoop"))};b.expire=function(a){return d("WAWebSyncdDb").expireSyncKey(a)};b.clear=function(){return d("WAWebSchemaSyncKeys").getSyncKeysTable().clear()};return a}();a.locks=["sync-keys"];g.WAWebSyncKeyStore=a}),98); __d("WAWebRunInTransaction",["Promise","WAWeb-dexie","WAWebCollectionVersionStore","WAWebMissingKeyStore","WAWebModelStorageUtils","WAWebPendingMutationStore","WAWebSyncActionStore","WAWebSyncKeyStore","err"],(function(a,b,c,d,e,f,g){var h,i={SyncActionStore:d("WAWebSyncActionStore").WAWebSyncActionStore,CollectionVersionStore:d("WAWebCollectionVersionStore").WAWebCollectionVersionStore,PendingMutationStore:d("WAWebPendingMutationStore").WAWebPendingMutationStore,MissingKeyStore:d("WAWebMissingKeyStore").WAWebMissingKeyStore,SyncKeyStore:d("WAWebSyncKeyStore").WAWebSyncKeyStore};a=function(a,e){if(c("WAWeb-dexie").currentTransaction!=null)return(h||(h=b("Promise"))).reject(c("err")("Calling runInTransaction recursively. This is not allowed."));var f=Object.keys(a);a=f.flatMap(function(a){return i[a].locks});return d("WAWebModelStorageUtils").getStorage().lock(a,function(){var a={};for(var b of f)a[b]=new i[b]();return e(a)})};g.runInTransaction=a}),98); __d("WAWebGetMissingKey",["WAWebRunInTransaction"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(a){a=a.MissingKeyStore;return a.getAll()})}function b(a){return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(b){b=b.MissingKeyStore;return b.bulkGet(a)})}function c(){return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(a){a=a.MissingKeyStore;return a.count()})}function e(a){return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(b){b=b.MissingKeyStore;return b.bulkUpdate(a)})}g.getAllMissingKeysInTransaction=a;g.bulkGetMissingKeysInTransaction=b;g.getMissingKeyCountTransaction=c;g.bulkUpdateMissingKeysInTransaction=e}),98); __d("WAWebGetSyncKey",["WAWebRunInTransaction"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return d("WAWebRunInTransaction").runInTransaction({SyncKeyStore:!0},function(b){b=b.SyncKeyStore;return b.get(a)})}function b(){return d("WAWebRunInTransaction").runInTransaction({SyncKeyStore:!0},function(a){a=a.SyncKeyStore;return a.getAll()})}function c(a){return d("WAWebRunInTransaction").runInTransaction({SyncKeyStore:!0},function(b){b=b.SyncKeyStore;return b.set(a)})}function e(a){return d("WAWebRunInTransaction").runInTransaction({SyncKeyStore:!0},function(b){b=b.SyncKeyStore;return b.expire(a)})}g.getSyncKeyInTransaction_DO_NOT_USE=a;g.getAllSyncKeysInTransaction=b;g.setSyncKeyInTransaction=c;g.expireSyncKeyInTransaction=e}),98); __d("WAWebSyncdCryptoUtils",["WACryptoUtils","WASyncdKeyTypes","err"],(function(a,b,c,d,e,f,g){"use strict";function a(a){if(a.length===0)throw c("err")("buffers length is zero");if(a.length===1)return a[0];var b=a.map(function(a){return a.byteLength});b=b.reduce(function(a,b){return a+b});b=new Uint8Array(b);var d=0,e;for(e=0;e<a.length;e++)b.set(new Uint8Array(a[e]),d),d+=a[e].byteLength;return b.buffer}function b(a,b,d){if(b<0||d<0)throw c("err")("buffers length is zero");var e=new Array(3);a=new Uint8Array(a);e[0]=a.slice(0,b).buffer;e[1]=a.slice(b,b+d).buffer;e[2]=a.slice(b+d).buffer;return e}function e(a){return Uint8Array.from(a.split(" ").map(function(a){return parseInt(a,16)}))}function f(a){return Array.from(new Uint8Array(d("WASyncdKeyTypes").fromSyncKeyId(a))).map(function(a){return a.toString(16)}).toString().replace(/,/g," ")}function h(a){return Array.from(new Uint8Array(a)).map(function(a){return a.toString(16).padStart(2,"0")}).join("")}function i(a){var b=new ArrayBuffer(8);new DataView(b).setUint32(4,a,!1);return b}function j(a,b){return d("WACryptoUtils").arrayBuffersEqual(d("WASyncdKeyTypes").fromSyncKeyId(a),d("WASyncdKeyTypes").fromSyncKeyId(b))}g.combine=a;g.split=b;g.hexToUint8Array=e;g.syncKeyIdToHex=f;g.arrayBufferToHexPadded=h;g.to64BitNetworkOrder=i;g.syncKeyIdsEqual=j}),98); __d("WAWebSyncdGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("syncd_key_max_use_days")}function b(){return d("WAWebABProps").getABPropConfigValue("syncd_sentinel_timeout_seconds")}function c(){return d("WAWebABProps").getABPropConfigValue("syncd_inline_mutations_max_count")}function e(){return d("WAWebABProps").getABPropConfigValue("syncd_patch_protobuf_max_size")}function f(){return d("WAWebABProps").getABPropConfigValue("syncd_wait_for_key_timeout_days")}g.getSyncdKeyMaxUseDays=a;g.getSyncdSentinelTimeoutSeconds=b;g.getSyncdInlineMutationsMaxCount=c;g.getSyncdPatchProtobufMaxSize=e;g.getSyncdWaitForKeyTimeoutDays=f}),98); __d("WAPREList",["$InternalEnum"],(function(a,b,c,d,e,f){"use strict";a=b("$InternalEnum")({APP_STATE_SYNC_DAILY:"app_state_sync_daily",CREATE_GROUP:"create_group",DECRYPT_MESSAGE_FINAL:"decrypt_message_final",DELETE_THREAD:"delete_thread",DOWNLOAD_AND_DECRYPT:"download_and_decrypt",EB_RESTORE_WITH_HIM:"eb_restore_with_him",EBDB_INIT:"ebdb_init",FRANKING_VALIDATION:"franking_validation",GET_DEVICES:"get_devices",ICDC_ERROR:"icdc_error",MEDIA_DOWNLOAD:"media_download",MEDIA_UPLOAD:"media_upload",MEDIA_VALIDATE:"media_validate",MESSAGE_DECRYPTION:"message_decryption",MESSAGE_ENCRYPTION:"message_encryption",OFFLINE_QUEUE:"offline_queue",OFFLINE_RETRY:"offline_retry",ONE_QUEUE:"one_queue",QUERY_GROUP:"query_group",QUERY_GROUPS:"query_groups",RECEIVE_MESSAGE:"receive_message",REMOVE_PARTICIPANTS:"remove_participants",SEND_MESSAGE:"send_message",STANZA_QUEUE_MESSAGE_CONSUMER:"stanza_queue_message_consumer",SYNCD:"syncd",SYNCD_BOOTSTRAP_APP_STATE_DOWNLOAD:"syncd_bootstrap_app_state_download",SYNCD_BOOTSTRAP_DATA_APPLIED:"syncd_bootstrap_data_applied",SYNCD_CRITICAL_BOOTSTRAP_STAGE:"syncd_critical_bootstrap_stage",SYNCD_CRITICAL_EVENT:"syncd_critical_event",SYNCD_DECRYPT_MUTATIONS:"syncd_decrypt_mutations",SYNCD_FATAL_ERROR:"syncd_fatal_error",SYNCD_KEY_ROTATION:"syncd_key_rotation",WA_DISCONNECT:"wa_disconnect",WA_FAIL_STANZA_QUEUE_ITEM:"stanza_queue_item_failure",WA_JOB_MANAGER:"wa_job_manager",WA_JOBS_ORCHESTRATOR:"wa_jobs_orchestrator",WA_NO_SIGNED_PRE_KEY:"wa_no_signed_pre_key",WORM:"worm"});f.PRE_METRIC=a}),66); __d("WAPREMetrics",["WALogger","WAPREList"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[PRE][","] EventFlow still active during garbage collection"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[PRE] There are no subscribers to PRE events "," ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Removing all listeners from PRE_METRICS"]);j=function(){return a};return a}c=6e4;e=18e4;f=10*60*1e3;var k=0;function a(){var c=[];function e(a){c.push(a)}function b(){d("WALogger").WARN(j()),c.length=0}function a(a){c.length===0&&d("WALogger").WARN(i(),a.name,a.stage),c.forEach(function(b){b(a)})}return{subscribe:e,notify:a,clear:b}}a=a();var l=a.notify,m=a.clear;a=a.subscribe;var n;"FinalizationRegistry"in self&&"WeakRef"in self&&(n=new FinalizationRegistry(function(a){var b=a.event;a=a.eventFlow;if(a.isActive())try{d("WALogger").ERROR(h(),b)}catch(a){}}));var o=new Set([d("WAPREList").PRE_METRIC.SEND_MESSAGE,d("WAPREList").PRE_METRIC.MEDIA_DOWNLOAD]);function b(a,b,c,d){var e;c==null&&k++;var f=(e=c)!=null?e:k,g="open";c==null?l({name:a,stage:"START",instanceKey:f,annotations:b,timeoutInMs:d}):l({name:a,stage:"RESUME",instanceKey:f,annotations:b});var h;function i(){if(h!=null){var a=h.deref();if(a!=null){var b;(b=n)==null?void 0:b.unregister(a)}}}e={addPoint:function(c,b){l({name:a,stage:"POINT",reason:c,instanceKey:f,annotations:b})},addAnnotations:function(b){l({name:a,stage:"ANNOTATE",instanceKey:f,annotations:b})},endSuccess:function(b){l({name:a,stage:"SUCCESS",instanceKey:f,annotations:b}),g="closed",i()},endCancel:function(b){l({name:a,stage:"CANCEL",instanceKey:f,annotations:b}),i()},endFail:function(c,b){l({name:a,stage:"FAIL",reason:c,instanceKey:f,annotations:b}),g="closed",i()},getFlowDetails:function(){return{name:a,instanceKey:f}},isActive:function(){return g==="open"}};n&&!o.has(a)&&c==null&&(n.register(e,{event:a,eventFlow:{endCancel:e.endCancel,isActive:e.isActive}}),h=new WeakRef(e));return e}g.QPL_DEFAULT_TIMEOUT_IN_MS=c;g.QPL_RECEIVE_MESSAGE_TIMEOUT_IN_MS=e;g.QPL_MEDIA_DOWNLOAD_TIMEOUT_IN_MS=f;g.clear=m;g.subscribe=a;g.startMetric=b}),98); __d("WASyncdConst",["$InternalEnum","WATimeUtils"],(function(a,b,c,d,e,f,g){"use strict";a=1e3;c=1e3*60*60;e=2;f=d("WATimeUtils").DAY_MILLISECONDS*2;d=100;var h=2e3,i=10,j=100,k=0,l=3,m=7,n=(b=b("$InternalEnum"))({Star:"star",Contact:"contact",Mute:"mute",PinDEPRECATED:"pin",Pin:"pin_v1",SettingPushName:"setting_pushName",LabelEdit:"label_edit",LabelMessage:"label_message",LabelJid:"label_jid",QuickReply:"quick_reply",LocaleSetting:"setting_locale",Archive:"archive",MarkChatAsRead:"markChatAsRead",ClearChat:"clearChat",DeleteMessageForMe:"deleteMessageForMe",Sentinel:"sentinel",UnarchiveChatsSetting:"setting_unarchiveChats",DeleteChat:"deleteChat",AndroidUnsupportedActions:"android_unsupported_actions",PrimaryFeature:"primary_feature",Subscription:"subscription",Nux:"nux",Agent:"deviceAgent",TimeFormat:"time_format",UserStatusMute:"userStatusMute",PrimaryVersion:"primary_version",RemoveRecentSticker:"removeRecentSticker",ChatAssignment:"agentChatAssignment",ChatAssignmentOpenedStatus:"agentChatAssignmentOpenedStatus",FavoriteSticker:"favoriteSticker",PnForLidChat:"pnForLidChat",ShareOwnPn:"shareOwnPn",ExternalWebBeta:"external_web_beta",MarketingMessage:"marketingMessage",MarketingMessageBroadcast:"marketingMessageBroadcast",StatusPrivacy:"status_privacy",BotWelcomeRequest:"bot_welcome_request",LabelReordering:"label_reordering",PaymentInfo:"payment_info",CustomPaymentMethods:"custom_payment_methods",LockChat:"lock",ChatLockSettings:"setting_chatLock",DeviceCapabilities:"device_capabilities",DisableLinkPreviews:"setting_disableLinkPreviews",NoteEdit:"note_edit",Favorites:"favorites",MerchantPaymentPartner:"merchant_payment_partner",VoipRelayAllCalls:"setting_relayAllCalls",CallLog:"call_log",WaffleAccountLinkState:"waffle_account_link_state"}),o=b({Regular:"regular",RegularLow:"regular_low",RegularHigh:"regular_high",CriticalBlock:"critical_block",CriticalUnblockLow:"critical_unblock_low"}),p=b.Mirrored(["Success","SuccessHasMore","Conflict","ConflictHasMore","ErrorRetry","ErrorFatal","Blocked"]),q=b.Mirrored(["UpToDate","Dirty","FailingFiniteRetry","Fatal","Blocked"]),r=b.Mirrored(["Success","Malformed","Orphan","Unsupported","Skipped","Failed"]),s=b.Mirrored(["Msg","Chat","Agent","ChatAssignment","UserStatusMute","Account"]),t=b.Mirrored(["ApplyRemoteAndDropLocal","SkipRemote","SkipRemoteAndDropLocal"]);b=b.Mirrored(["Patch","Snapshot","Local"]);g.BACKOFF_MIN_TIMEOUT=a;g.BACKOFF_MAX_TIMEOUT=c;g.BACKOFF_BASE=e;g.FINITE_FAILURE_EXPIRY_DURATION=f;g.MIN_INLINE_MUTATIONS=d;g.MAX_INLINE_MUTATIONS=h;g.MIN_PATCH_SIZE=i;g.MAX_PATCH_SIZE=j;g.DEFAULT_COLLECTION_VERSION=k;g.LABEL_ASSOCIATION_SYNC_VERSION=l;g.CHAT_ASSIGNMENT_SYNC_VERSION=m;g.Actions=n;g.CollectionName=o;g.CollectionState=p;g.CollectionSyncState=q;g.SyncActionState=r;g.SyncModelType=s;g.ConflictResolutionState=t;g.SyncDataType=b}),98); __d("WAWebSyncdMetricFatalError",["$InternalEnum","WALogger","WAPREList","WAPREMetrics","WASyncdConst"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown error code: "," for syncd fatal error"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing error code for syncd fatal error"]);i=function(){return a};return a}var j=b("$InternalEnum").Mirrored(["PATCH_PROTOBUF_SERIALIZATION_FAILED","MUTATIONS_PROTOBUF_SERIALIZATION_FAILED","ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED","ENCRYPTION_FAILED","MISSING_SNAPSHOT_VERSION","MISSING_SNAPSHOT_MAC","MISSING_SNAPSHOT_KEY_ID","MISSING_PATCH_VERSION","PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS","MISSING_PATCH_SNAPSHOT_MAC","MISSING_PATCH_MAC","MISSING_PATCH_KEY_ID","MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY","MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH","MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256","MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256","MISSING_MUTATION_OPERATION","MISSING_MUTATION_RECORD","MISSING_MUTATION_INDEX","MISSING_MUTATION_VALUE","MISSING_MUTATION_KEY_ID","EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED","SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED","PATCH_PROTOBUF_DESERIALIZATION_FAILED","MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED","ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED","MISSING_ACTION_INDEX","MISSING_ACTION_VERSION","SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT","SNAPSHOT_MAC_MISMATCH_IN_PATCH","MAC_MISMATCH_PATCH","DECRYPTION_FAILED","DUPLICATE_PATCH_VERSION_IN_COLLECTION","SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH","SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT","MISSING_ACTION_VALUE","MISSING_ACTION_TIMESTAMP","XMPP_BAD_REQUEST_FOR_COLLECTION","XMPP_NOT_FOUND_FOR_COLLECTION","CYCLIC_MUTATION_DEPENDENCY_IN_PATCH","SERVER_DID_NOT_SEND_ALL_PATCHES","TERMINAL_PATCH_MISSING_DATA","TERMINAL_PATCH_DESERIALIZATION_ERROR","TERMINAL_PATCH_UNKNOWN","INVALID_ACTION_INDEX","XMPP_BAD_REQUEST_GLOBAL_ERROR","XMPP_NOT_FOUND_GLOBAL_ERROR","XMPP_BAD_METHOD_GLOBAL_ERROR","XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR","TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D","TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY","MISSING_KEY_ON_ALL_CLIENTS"]);function a(a,b,c,e,f,g,h,i,j,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_FATAL_ERROR).endFail("syncd fatal error: "+a,k({type:a,collection:b,patchSnapshotMutationCount:c,patchVersion:e,isFatal:f,isLtHashConsistent:g,macFatalCollectionNameMismatch:h,macFatalCurrentLthashMismatch:i,macFatalNewLthashMismatch:j,macFatalPatchVersionMismatch:l,macFatalNewLthashSubtractMismatch:m,macFatalNumberHasOverrideMutation:n,macFatalNumberNumAddMutation:o,macFatalNumberNumRemoveMutation:p,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:q,isPatchSenderPrimary:r,macFatalDidUseMacFetchFallback:s,macFatalHasMissingRemove:t,macFatalNumberAddMismatch:u,macFatalNumberRemoveMismatch:v,macFatalDidPreviousPatchFailPostSaveValidation:w,macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:x,isPreviousPatchAnIncomingPatch:y,isLastPatchSenderAPrimaryDevice:z,isSenderIndexSameAsPreviousSenderIndex:A,didBootstrapFromSnapshot:B,isThereAnotherSyncdCompanion:C}))}function k(a){var b=a.type,c=a.collection,d=a.patchSnapshotMutationCount,e=a.patchVersion,f=a.isFatal,g=a.isLtHashConsistent,h=a.macFatalCollectionNameMismatch,i=a.macFatalCurrentLthashMismatch,j=a.macFatalNewLthashMismatch,k=a.macFatalPatchVersionMismatch,l=a.macFatalNewLthashSubtractMismatch,m=a.macFatalNumberHasOverrideMutation,n=a.macFatalNumberNumAddMutation,o=a.macFatalNumberNumRemoveMutation,p=a.macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch,q=a.isPatchSenderPrimary,r=a.macFatalDidUseMacFetchFallback,s=a.macFatalHasMissingRemove,t=a.macFatalNumberAddMismatch,u=a.macFatalNumberRemoveMismatch,v=a.macFatalDidPreviousPatchFailPostSaveValidation,w=a.macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash,x=a.isPreviousPatchAnIncomingPatch,y=a.isLastPatchSenderAPrimaryDevice,z=a.isSenderIndexSameAsPreviousSenderIndex,A=a.didBootstrapFromSnapshot;a=a.isThereAnotherSyncdCompanion;return{string:{errorCode:b,collection:c==null?null:c},"int":{patchSnapshotMutationCount:d,patchVersion:e,macFatalNumberNumAddMutation:n,macFatalNumberNumRemoveMutation:o},bool:{isFatal:f,isLtHashConsistent:g,macFatalCollectionNameMismatch:h,macFatalCurrentLthashMismatch:i,macFatalNewLthashMismatch:j,macFatalPatchVersionMismatch:k,macFatalNewLthashSubtractMismatch:l,macFatalNumberHasOverrideMutation:m,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:p,isPatchSenderPrimary:q,macFatalDidUseMacFetchFallback:r,macFatalHasMissingRemove:s,macFatalNumberAddMismatch:t,macFatalNumberRemoveMismatch:u,macFatalDidPreviousPatchFailPostSaveValidation:v,macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:w,isPreviousPatchAnIncomingPatch:x,isLastPatchSenderAPrimaryDevice:y,isSenderIndexSameAsPreviousSenderIndex:z,didBootstrapFromSnapshot:A,isThereAnotherSyncdCompanion:a}}}function c(a){var b;b=a==null?void 0:(b=a.string)==null?void 0:b.errorCode;if(b==null){d("WALogger").ERROR(i());return null}var c=j.cast(b);if(c==null){d("WALogger").ERROR(h(),b);return null}return{type:c,collection:d("WASyncdConst").CollectionName.cast(a==null?void 0:(b=a.string)==null?void 0:b.collection),patchSnapshotMutationCount:a==null?void 0:(c=a["int"])==null?void 0:c.patchSnapshotMutationCount,patchVersion:a==null?void 0:(b=a["int"])==null?void 0:b.patchVersion,isFatal:a==null?void 0:(c=a.bool)==null?void 0:c.isFatal,isLtHashConsistent:a==null?void 0:(b=a.bool)==null?void 0:b.isLtHashConsistent,macFatalCollectionNameMismatch:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalCollectionNameMismatch,macFatalCurrentLthashMismatch:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalCurrentLthashMismatch,macFatalNewLthashMismatch:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalNewLthashMismatch,macFatalPatchVersionMismatch:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalPatchVersionMismatch,macFatalNewLthashSubtractMismatch:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalNewLthashSubtractMismatch,macFatalNumberHasOverrideMutation:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalNumberHasOverrideMutation,macFatalNumberNumAddMutation:a==null?void 0:(c=a["int"])==null?void 0:c.macFatalNumberNumAddMutation,macFatalNumberNumRemoveMutation:a==null?void 0:(b=a["int"])==null?void 0:b.macFatalNumberNumRemoveMutation,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch,isPatchSenderPrimary:a==null?void 0:(b=a.bool)==null?void 0:b.isPatchSenderPrimary,macFatalDidUseMacFetchFallback:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalDidUseMacFetchFallback,macFatalHasMissingRemove:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalHasMissingRemove,macFatalNumberAddMismatch:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalNumberAddMismatch,macFatalNumberRemoveMismatch:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalNumberRemoveMismatch,macFatalDidPreviousPatchFailPostSaveValidation:a==null?void 0:(c=a.bool)==null?void 0:c.macFatalDidPreviousPatchFailPostSaveValidation,macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:a==null?void 0:(b=a.bool)==null?void 0:b.macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash,isPreviousPatchAnIncomingPatch:a==null?void 0:(c=a.bool)==null?void 0:c.isPreviousPatchAnIncomingPatch,isLastPatchSenderAPrimaryDevice:a==null?void 0:(b=a.bool)==null?void 0:b.isLastPatchSenderAPrimaryDevice,isSenderIndexSameAsPreviousSenderIndex:a==null?void 0:(c=a.bool)==null?void 0:c.isSenderIndexSameAsPreviousSenderIndex,didBootstrapFromSnapshot:a==null?void 0:(b=a.bool)==null?void 0:b.didBootstrapFromSnapshot,isThereAnotherSyncdCompanion:a==null?void 0:(c=a.bool)==null?void 0:c.isThereAnotherSyncdCompanion}}g.SyncdFatalErrorType=j;g.reportSyncdFatalError=a;g.convertSyncdFatalErrorFromAnnotations=c}),98); __d("WAWebSyncdStoreMissingKeys",["Promise","WAAsyncSleep","WALogger","WATimeUtils","WAWebBackendApi","WAWebGetMissingKey","WAWebGetSyncKey","WAWebRunInTransaction","WAWebSyncdCryptoUtils","WAWebSyncdGatingUtils","WAWebSyncdMetricFatalError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: missing key on all clients"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: expired keys: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: actually missing keys: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing keys: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: all keys: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: check if has expired keys"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: timeout while waiting for missing key"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _timeoutWhileWaitingForMissingKey: no expired keys"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _timeoutWhileWaitingForMissingKey"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: earliest missing key: ",", timestamp=",", timeoutMs=",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _setMissingKeyTimeout: missing keys: ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: updateMissingKeys: finish updating missing keys from device ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: updateMissingKeys: begin updating missing keys from device ","\n \tmissingKeys: [","]"],["syncd: updateMissingKeys: begin updating missing keys from device ","\n \\tmissingKeys: [","]"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: updateMissingKeys from device ","\n \tkeys with keyData: ","\n \tkeys without keyData: ",""],["syncd: updateMissingKeys from device ","\n \\tkeys with keyData: ","\n \\tkeys without keyData: ",""]);v=function(){return a};return a}var w;function a(){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebBackendApi").frontendSendAndReceive("getDeviceFingerprint",{})).deviceIndexes;return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){c=c.MissingKeyStore;var d=(yield c.getAll());if(d.length===0)return(h||(h=b("Promise"))).resolve();d.forEach(function(b){var c=b.deviceResponses;c.forEach(function(c,d){a.includes(d)||b.deviceResponses["delete"](d)})});yield c.bulkUpdate(d);yield F({MissingKeyStore:c})});return function(a){return c.apply(this,arguments)}}())});return x.apply(this,arguments)}function c(a,c){var e=[],f=[];a.forEach(function(a){var b=a.keyData;a=d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId);b?e.push(a):f.push(a)});d("WALogger").LOG(v(),c,e,f);return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.MissingKeyStore;e.length>0&&(yield a.bulkRemove(e),yield z({MissingKeyStore:a}));if(f.length>0){var b=(yield a.bulkGet(f)).filter(Boolean);b.forEach(function(a){return a.deviceResponses.set(c,!1)});d("WALogger").LOG(u(),c,f);yield a.bulkUpdate(b);d("WALogger").LOG(t(),c);yield F({MissingKeyStore:a})}});return function(b){return a.apply(this,arguments)}}())}function y(){return d("WAWebRunInTransaction").runInTransaction({MissingKeyStore:!0},function(a){a=a.MissingKeyStore;return z({MissingKeyStore:a})})}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.MissingKeyStore;clearTimeout(w);w=null;a=(yield a.getAll());if(a.length===0)return;d("WALogger").LOG(s(),a.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)}));a=a.reduce(function(a,b){return a.timestamp<b.timestamp?a:b});var b=d("WAWebSyncdGatingUtils").getSyncdWaitForKeyTimeoutDays()*d("WATimeUtils").DAY_MILLISECONDS-(-a.timestamp+d("WATimeUtils").unixTimeMs());d("WALogger").LOG(r(),d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId),a.timestamp,b);w=setTimeout(B,b)});return A.apply(this,arguments)}function B(){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(q());if(!(yield D())){d("WALogger").LOG(p());return}d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY);d("WALogger").ERROR(o()).sendLogs("syncd fatal error: timeout while waiting for missing key");void d("WAWebBackendApi").frontendFireAndForget("handleSyncdFatal",{})});return C.apply(this,arguments)}function D(){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;(a=d("WALogger")).LOG(n());var b=(yield d("WAWebGetSyncKey").getAllSyncKeysInTransaction()).map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)});a.LOG(m(),b);var c=(yield d("WAWebGetMissingKey").getAllMissingKeysInTransaction());a.LOG(l(),c.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)}));var e=c.filter(function(a){return!b.includes(a.keyHex)});a.LOG(k(),c.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)}));c=e.filter(function(a){return d("WAWebSyncdGatingUtils").getSyncdWaitForKeyTimeoutDays()*d("WATimeUtils").DAY_MILLISECONDS<d("WATimeUtils").unixTimeMs()-a.timestamp});a.LOG(j(),c.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)}));return c.length>0});return E.apply(this,arguments)}function F(a){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.MissingKeyStore;a=(yield a.getAll());for(a of a){var b=!0;for(var c of a.deviceResponses.values())if(c==null){b=!1;break}if(b){d("WALogger").ERROR(i()).sendLogs("syncd: fatal error: missing key on all clients");d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_KEY_ON_ALL_CLIENTS);yield d("WAAsyncSleep").asyncSleep(5e3);void d("WAWebBackendApi").frontendFireAndForget("handleSyncdFatal",{});return}}});return G.apply(this,arguments)}function e(a,b){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=function(){var a=new Map();b.forEach(function(b){return a.set(b,null)});return a};a=a.map(function(a){return{keyHex:d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a),keyId:a,timestamp:d("WATimeUtils").unixTimeMs(),deviceResponses:c()}});yield d("WAWebGetMissingKey").bulkUpdateMissingKeysInTransaction(a);yield y()});return H.apply(this,arguments)}g.updateMissingKeyDevices=a;g.updateMissingKeys=c;g.setMissingKeyTimeoutInTransaction=y;g.hasExpiredKeys=D;g.addMissingKeys=e}),98); __d("WAWebIdentityUpdateDeviceTableApi",["Promise","WAJids","WALogger","WAWebAdvDeviceNotificationApi","WAWebAdvUpdateParticipantApi","WAWebApiContact","WAWebApiDeviceList","WAWebApiGetDeviceUpdateLock","WAWebBackendApi","WAWebBizCoexGatingUtils","WAWebBizCoexHostedAddVerification","WAWebBizCoexUtils","WAWebDBEncryptMultipleMsgs","WAWebDBStoreEncryptedMsgs","WAWebDeviceListPk","WAWebGetMessageCache","WAWebProtobufsAdv.pb","WAWebSignalSessionApi","WAWebSyncdStoreMissingKeys","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime","err","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDevicesNotification: failed to clean the signal info for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: updateMissingKeyDevices failed with error:\n ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkCreateOrReplace into device list table failed"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkApplyDeviceUpdates: check coex cache for ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["remove from device list table failed"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearDeviceRecord: check coex cache for ",""]);n=function(){return a};return a}function o(a,b){if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()){if(a==null)return b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED?b:null;switch(a){case d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED:return b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE?b:null;case d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE:return b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED?b:null}}if(b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED)throw c("err")("Unexpected account type");return null}function a(a,b,c,d,e){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){f===void 0&&(f=!1);yield (h||(h=b("Promise"))).all(e.filter(function(a){return a.id!==d("WAJids").DEFAULT_DEVICE_ID}).map(function(b){return t(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(a.user,a.server,b.id))}));var j=[],k=e.map(function(a){return a.id}).filter(function(a){return a!==d("WAJids").DEFAULT_DEVICE_ID}),l=o(g,i);d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&l===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(n(),a==null?void 0:a.toLogString()),d("WAWebBizCoexHostedAddVerification").assertThrowsWidAdvTypeFromVerificationCache(a),yield d("WAWebUserPrefsMultiDevice").setHaveProcessedCoexAdv());e=(yield r([{wid:a,added:j,removed:k,isNewRecord:!1,newAdvAccountType:l}],f,l!=null));var p=e.encryptedNotifications,q=e.chatIds;yield d("WAWebApiGetDeviceUpdateLock").getDeviceUpdateLock(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=p.length>0?d("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(p,[],q,!1):(h||(h=b("Promise"))).resolve(),f=d("WAWebAdvUpdateParticipantApi").updateGroupParticipantsInTransaction(a,j,k),g={id:d("WAWebDeviceListPk").createDeviceListPK(a),deleted:!0};d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&l===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(g.deletedChangedToHost=!0);g=d("WAWebApiDeviceList").createOrReplaceDeviceRecord(g)["catch"](function(a){d("WALogger").ERROR(m()).verbose().devConsole(a).sendLogs("remove from device list table failed when clearing device record");throw c("err")("remove from device list table failed")});var i=(h||(h=b("Promise"))).resolve();d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(l!=null&&(i=d("WAWebApiContact").updateContactAdvHostedType(a,l)));yield h.all([e,f,g,i])}),p.length>0,!1,l!=null);d("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgInsertSuccess(p)});return p.apply(this,arguments)}function e(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){e===void 0&&(e=!1);f===void 0&&(f=!1);var g=[],i=[],m=!1,n=!1,p=!1;a.forEach(function(a){var b=a.wid,e=a.update;a=a.currentRecord;var f=e.devices;f=f.map(function(a){return a.id});var h=a&&!a.deleted?a.devices.map(function(a){return a.id}):[],j=c("lodash").difference(f,h).filter(function(a){return a!==d("WAJids").DEFAULT_DEVICE_ID});h=c("lodash").difference(h,f).filter(function(a){return a!==d("WAJids").DEFAULT_DEVICE_ID});f=a==null;a=d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?o(a==null?void 0:a.advAccountType,e==null?void 0:e.advAccountType):null;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&a===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(d("WALogger").LOG(l(),b==null?void 0:b.toLogString()),d("WAWebBizCoexHostedAddVerification").assertThrowsWidAdvTypeFromVerificationCache(b));d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(a!=null&&(n=!0),a===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(p=!0));g.push({wid:b,added:j,removed:h,isNewRecord:f,newAdvAccountType:a});h.forEach(function(a){i.push(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(b.user,b.server,a))});d("WAWebDeviceListPk").createDeviceListPK(b)===d("WAWebDeviceListPk").createDeviceListPK(d("WAWebUserPrefsMeUser").getMeUser())&&h.length>0&&(m=!0)});d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&p===!0&&(yield d("WAWebUserPrefsMultiDevice").setHaveProcessedCoexAdv());e=(yield r(g,e,(e||f)&&n));var q=e.encryptedNotifications,s=e.chatIds;(h||(h=b("Promise"))).all(i.map(function(a){return t(a)}));var u=d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(q==null?void 0:q.length)>0;yield d("WAWebApiGetDeviceUpdateLock").getDeviceUpdateLock(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=q.length>0?d("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(q,[],s,!1):(h||(h=b("Promise"))).resolve(),f=d("WAWebAdvUpdateParticipantApi").bulkUpdateGroupParticipantsInTransaction(g),i=d("WAWebApiDeviceList").bulkCreateOrReplaceDeviceRecord(a.map(function(a){return a.update}))["catch"](function(a){d("WALogger").ERROR(k()).verbose().devConsole(a).sendLogs("bulkCreateOrReplace into device list table failed when applying device update");throw c("err")("bulkCreateOrReplace into device list table failed")}),l=m?i.then(function(){return d("WAWebSyncdStoreMissingKeys").updateMissingKeyDevices()["catch"](function(a){d("WALogger").WARN(j(),a)})}):(h||(h=b("Promise"))).resolve(),n=[];d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&u&&g.forEach(function(a){var b=a.wid;a=a.newAdvAccountType;a!=null&&n.push(d("WAWebApiContact").updateContactAdvHostedType(b,a))});yield (h||(h=b("Promise"))).all([e,f,i,l].concat(n))}),q.length>0,m,u);d("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgInsertSuccess(q)});return q.apply(this,arguments)}function r(a,b,c){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=!1);c=d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&c;a=c===!0?yield d("WAWebAdvDeviceNotificationApi").bulkGenerateDeviceAndAdvAccountTypeChangeNotifications(a):{notifications:[],chatIds:[]};var e=a.notifications;a=a.chatIds;c=c&&e.some(function(a){return d("WAWebBizCoexUtils").isCoexSystemMsgType(a.subtype)});if(!b||c){b=(yield d("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(e));v(e);return{chatIds:a,encryptedNotifications:b}}d("WAWebGetMessageCache").getMessageCache().addMessages(e.map(function(a){return{msg:a}}),!1);return{chatIds:[],encryptedNotifications:[]}});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{yield (h||(h=b("Promise"))).all([d("WAWebSignalSessionApi").deleteRemoteInfo(a),d("WAWebSignalSessionApi").deleteDeviceSenderKey(a)])}catch(b){d("WALogger").LOG(i(),a.user)}});return u.apply(this,arguments)}function v(a){return(h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:a.from,msgObjs:[babelHelpers["extends"]({},a,{recvFresh:!0,isNewMsg:!0})],meta:{add:"after",isHistory:!1},processMessagesOrigin:"updateDeviceTableApi"})}))}g.clearDeviceRecord=a;g.bulkApplyDeviceUpdate=e}),98); __d("WAWebWamEnumPushNotificationInteractions",[],(function(a,b,c,d,e,f){a=Object.freeze({SHOWN:1,CLICKED:2});f.PUSH_NOTIFICATION_INTERACTIONS=a}),66); __d("WAWebWamEnumWebNotificationSettingType",[],(function(a,b,c,d,e,f){a=Object.freeze({ALLOWED:1,BLOCKED:2,UNKNOWN:3});f.WEB_NOTIFICATION_SETTING_TYPE=a}),66); __d("WAWebWamEnumOffboardSources",[],(function(a,b,c,d,e,f){a=Object.freeze({IN_APP_SETTING:1,OS_SETTING:2});f.OFFBOARD_SOURCES=a}),66); __d("WAWebWamEnumOnboardSources",[],(function(a,b,c,d,e,f){a=Object.freeze({DEFAULT:1,BACKGROUND_SYNC_BUTTERBAR:2,WEB_NOTIFICATION_BUTTERBAR:3,IN_APP_SETTING:4,AUTO_ENABLE:5});f.ONBOARD_SOURCES=a}),66); __d("WAWebWebcBackgroundSyncAdoptionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumOffboardSources","WAWebWamEnumOnboardSources","WAWebWamEnumPushNotificationInteractions","WAWebWamEnumWebNotificationSettingType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcBackgroundSyncAdoption:[5302,{offboardSource:[1,d("WAWebWamEnumOffboardSources").OFFBOARD_SOURCES],onboardSource:[2,d("WAWebWamEnumOnboardSources").ONBOARD_SOURCES],pushNotificationInteraction:[3,d("WAWebWamEnumPushNotificationInteractions").PUSH_NOTIFICATION_INTERACTIONS],webOsNotificationSetting:[4,d("WAWebWamEnumWebNotificationSettingType").WEB_NOTIFICATION_SETTING_TYPE]},[1,1,1],"regular"]},{WebcBackgroundSyncAdoption:[]});g.WebcBackgroundSyncAdoptionWamEvent=a}),98); __d("WAWebBackgroundSyncReporter",["WAWebUserPrefsGeneral","WAWebWamEnumPushNotificationInteractions","WAWebWamEnumWebNotificationSettingType","WAWebWebcBackgroundSyncAdoptionWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h=null;function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b=(yield d("WAWebUserPrefsGeneral").getOfflineNotificationEngagement());a=((a=b==null?void 0:b.totalNotifShown)!=null?a:0)>0;b=((b=b==null?void 0:b.totalNotifTapToOpen)!=null?b:0)>0;b?h=d("WAWebWamEnumPushNotificationInteractions").PUSH_NOTIFICATION_INTERACTIONS.CLICKED:a&&(h=d("WAWebWamEnumPushNotificationInteractions").PUSH_NOTIFICATION_INTERACTIONS.SHOWN)});return i.apply(this,arguments)}function c(a){var b,c=a.offboardSource;a=a.onboardSource;var e=d("WAWebWamEnumWebNotificationSettingType").WEB_NOTIFICATION_SETTING_TYPE.UNKNOWN;((b=window.Notification)==null?void 0:b.permission)==="granted"?e=d("WAWebWamEnumWebNotificationSettingType").WEB_NOTIFICATION_SETTING_TYPE.ALLOWED:((b=window.Notification)==null?void 0:b.permission)==="denied"&&(e=d("WAWebWamEnumWebNotificationSettingType").WEB_NOTIFICATION_SETTING_TYPE.BLOCKED);b=new(d("WAWebWebcBackgroundSyncAdoptionWamEvent").WebcBackgroundSyncAdoptionWamEvent)();b.set({offboardSource:c,onboardSource:a,pushNotificationInteraction:h,webOsNotificationSetting:e});b.commit()}g.setPushNotificationInteractionStatus=a;g.logBackgroundSyncAdoptionEvent=c}),98); __d("WAWebNotificationConstants",[],(function(a,b,c,d,e,f){a="granted";b="default";c="denied";f.PERMISSION_ALLOWED=a;f.PERMISSION_DEFAULT=b;f.PERMISSION_DENIED=c}),66); __d("WAWebUserPrefsNotifications",["WATimeUtils","WAWebBackgroundSyncReporter","WAWebEnvironment","WAWebNotificationConstants","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebWamEnumOnboardSources","cr:5151"],(function(a,b,c,d,e,f,g){function a(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_SOUNDS)!==!0}function e(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_SOUNDS,!a)}function f(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_CALL_RINGTONE)!==!0}function h(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_CALL_RINGTONE,!a)}function i(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_NOTIFICATIONS);if(typeof a!=="boolean"){var b;return c("WAWebEnvironment").isWindows?!0:((b=window.Notification)==null?void 0:b.permission)===d("WAWebNotificationConstants").PERMISSION_ALLOWED}return!a}function j(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_NOTIFICATIONS,!a)}function k(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED);if(typeof a!=="boolean"){var b;b=((b=window.Notification)==null?void 0:b.permission)===d("WAWebNotificationConstants").PERMISSION_ALLOWED;b&&d("WAWebBackgroundSyncReporter").logBackgroundSyncAdoptionEvent({offboardSource:null,onboardSource:d("WAWebWamEnumOnboardSources").ONBOARD_SOURCES.DEFAULT});return b}return a}function l(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED,a)}function m(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.SECURITY_NOTIFICATIONS)!==!0}function n(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.SECURITY_NOTIFICATIONS,!a)}var o={isDismissed:!1,firstSeenTime:null};function p(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.WEB_NOTIFICATIONS_BB_STATUS);if(a==null)return o;if(typeof a!=="object"||a instanceof Array)return o;a={isDismissed:a.isDismissed===!0,firstSeenTime:typeof a.firstSeenTime==="number"?d("WATimeUtils").castToUnixTime(a.firstSeenTime):null};return a}function q(a){var b,e=p();e=e.firstSeenTime;e=e===void 0?null:e;b=(b=a.firstSeenTime)!=null?b:e;c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.WEB_NOTIFICATIONS_BB_STATUS,{isDismissed:a.isDismissed,firstSeenTime:b})}var r={isDismissed:!1,firstSeenTime:null,isLongResumeTime:!1};function s(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.OFFLINE_NOTIFICATIONS_BB_STATUS);if(a==null||typeof a!=="object"||a instanceof Array)return r;a={isDismissed:a.isDismissed===!0,firstSeenTime:typeof a.firstSeenTime==="number"?d("WATimeUtils").castToUnixTime(a.firstSeenTime):null,isLongResumeTime:a.isLongResumeTime===!0};return a}function t(a){var b,e=s(),f=e.isDismissed;f=f===void 0?!1:f;var g=e.firstSeenTime;g=g===void 0?null:g;e=e.isLongResumeTime;e=e===void 0?!1:e;b=(b=a.isDismissed)!=null?b:f;f=(f=a.firstSeenTime)!=null?f:g;a=(g=a.isLongResumeTime)!=null?g:e;c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.OFFLINE_NOTIFICATIONS_BB_STATUS,{isDismissed:b,firstSeenTime:f,isLongResumeTime:a})}function u(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_PREVIEWS);return typeof a!=="boolean"&&c("WAWebEnvironment").isWindows?!0:a!==!0}function v(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_MUTE_PREVIEWS,!a)}function w(){return b("cr:5151")?c("WAWebUserPrefsStore").getUser(b("cr:5151").IGNORE_NONDIRECT_GROUP_MSG)===!0:!1}function x(a){b("cr:5151")&&c("WAWebUserPrefsStore").setUser(b("cr:5151").IGNORE_NONDIRECT_GROUP_MSG,a)}function y(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.OUTGOING_MESSAGE_SOUND)===!0}function z(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.OUTGOING_MESSAGE_SOUND,a)}function A(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_COLLAPSE_MUTED)===!0}function B(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_COLLAPSE_MUTED,a)}function C(){return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED_ONCE)===!0}function D(){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED_ONCE,!0)}g.getGlobalSounds=a;g.setGlobalSounds=e;g.getGlobalCallRingtone=f;g.setGlobalCallRingtone=h;g.getGlobalNotifications=i;g.setGlobalNotifications=j;g.getGlobalOfflineNotifications=k;g.setGlobalOfflineNotifications=l;g.getGlobalSecurityNotifications=m;g.setGlobalSecurityNotifications=n;g.DEFAULT_NOTIFICATION_BB_STATUS=o;g.getWebNotificationsBBStatus=p;g.setWebNotificationsBBStatus=q;g.DEFAULT_OFFLINE_NOTIFICATION_BB_STATUS=r;g.getOfflineNotificationsBBStatus=s;g.setOfflineNotificationsBBStatus=t;g.getGlobalPreviews=u;g.setGlobalPreviews=v;g.getIgnoreNondirectGroupMsg=w;g.setIgnoreNondirectGroupMsg=x;g.getOutgoingMessageSound=y;g.setOutgoingMessageSound=z;g.getCollapseMuted=A;g.setCollapseMuted=B;g.getOfflineNotificationsEnabledOnce=C;g.setOfflineNotificationsEnabledOnce=D}),98); __d("WAWebSecurityCodeApi",["WALogger","WAWebApiContact","WAWebBackendApi","WAWebContactSystemMsg","WAWebDBEncryptMultipleMsgs","WAWebDBStoreEncryptedMsgs","WAWebGetMessageCache","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebSchemaParticipant","WAWebUserPrefsNotifications","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["get chats failed"]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.user,c=a.stanzaLid;a=a.offline;if(b.isBot())return;var e=null;b.isLid()?e=d("WAWebApiContact").getPnIfLidIsLatestMapping(d("WAWebWidFactory").toUserWid(b)):b.isRegularUser()&&c!=null&&(e=c);c=(yield j(b,e));b=c.notifications;e=c.chatIds;if(b.length===0)return;if(!a){b=b.map(function(a){return babelHelpers["extends"]({},a,{recvFresh:!0,isNewMsg:!0})});for(a of b)d("WAWebBackendApi").frontendFireAndForget("processMultipleMessages",{chatId:a.from,msgObjs:[a],meta:{add:"after",isHistory:!1},processMessagesOrigin:"securityCodeApi"});a=(yield d("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(b));yield d("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(a,e,!1);return c}d("WAWebGetMessageCache").getMessageCache().addMessages(b.map(function(a){return{msg:a}}),!1);return c});return i.apply(this,arguments)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e={notifications:[],chatIds:[]};b=b==null?[a]:[a,b];if(!d("WAWebUserPrefsNotifications").getGlobalSecurityNotifications())return e;var f=[];try{var g=(yield d("WAWebSchemaChat").getChatTable().bulkGet(b.map(function(a){return a.toString()}),!1)).filter(Boolean);f.push.apply(f,g.map(function(a){return{chatId:d("WAWebWidFactory").createWid(a.id),codeChangedUser:d("WAWebWidFactory").createUserWid(a.id)}}));g=(yield d("WAWebSchemaParticipant").getParticipantTable().anyOf(["participants"],b.map(String)));var i=new Map();if(g.length>0){b=g.map(function(a){return a.groupId});(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().bulkGet(b)).forEach(function(a){a!=null&&i.set(a.id,a)})}g.forEach(function(b){var c=i.get(b.groupId);if(Boolean(c==null?void 0:c.defaultSubgroup)===!0&&a.isLid())return;f.push({chatId:d("WAWebWidFactory").createWid(b.groupId),codeChangedUser:a})})}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("get chats failed when creating device notification");throw c("err")("get chats failed")}b=f.map(function(a){var b=a.chatId;a=a.codeChangedUser;return d("WAWebContactSystemMsg").genSecurityCodeNotificationMsg(b,a)});e.notifications=b;e.chatIds=f.map(function(a){a=a.chatId;return a.toString()});return e});return k.apply(this,arguments)}g.addSecurityCodeChangedNotifications=a;g.generateSecurityCodeChangedNotifications=j}),98); __d("WAWebDeviceSentMessageProtoUtils",[],(function(a,b,c,d,e,f){function a(a,b){var c={deviceSentMessage:{destinationJid:b.toString({legacy:!0}),message:a}},d=a==null?void 0:a.messageContextInfo;return d==null?c:{messageContextInfo:babelHelpers["extends"]({},d),deviceSentMessage:{destinationJid:b.toString({legacy:!0}),message:babelHelpers["extends"]({},a,{messageContextInfo:void 0})}}}function b(a){var b,c;b=a==null?void 0:(b=a.deviceSentMessage)==null?void 0:b.message;if(b==null)return null;a=babelHelpers["extends"]({},b.messageContextInfo,{messageSecret:(c=b==null?void 0:(c=b.messageContextInfo)==null?void 0:c.messageSecret)!=null?c:a==null?void 0:(c=a.messageContextInfo)==null?void 0:c.messageSecret,messageAssociation:(c=b==null?void 0:(c=b.messageContextInfo)==null?void 0:c.messageAssociation)!=null?c:a==null?void 0:(c=a.messageContextInfo)==null?void 0:c.messageAssociation,limitSharingV2:a==null?void 0:(c=a.messageContextInfo)==null?void 0:c.limitSharingV2});return babelHelpers["extends"]({},b,{messageContextInfo:a})}f.wrapDeviceSentMessage=a;f.unwrapDeviceSentMessage=b}),66); __d("WAWebProtobufsEphemeral.pb",["WAProtoConst"],(function(a,b,c,d,e,f,g){a={};a.internalSpec={duration:[1,d("WAProtoConst").TYPES.SFIXED32],timestamp:[2,d("WAProtoConst").TYPES.SFIXED64]};g.EphemeralSettingSpec=a}),98); __d("WAWebEphemeralDecodeBroadcastSetting",["WABase64","WABinary","WATimeUtils","WAWebProtobufsEphemeral.pb","asyncToGeneratorRuntime","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h=new Uint8Array(32);function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield self.crypto.subtle.importKey("raw",a,"HKDF",!1,["deriveKey"]));b=(yield self.crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:h,info:b},a,{name:"HMAC",hash:"SHA-256"},!0,["verify"]));return self.crypto.subtle.exportKey("raw",b)});return j.apply(this,arguments)}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var d=a.slice(0,12);a=a.slice(12,44);a=(yield self.crypto.subtle.importKey("raw",a,"AES-GCM",!1,["decrypt"]));return self.crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(d),additionalData:c},a,b)});return l.apply(this,arguments)}function a(a,b,c,d,e){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){a=a.toString({legacy:!0});b=b.toString({legacy:!0});e=e.toString({legacy:!0});b="Ephemeral "+b+" "+a;a=d("WABinary").Binary.build(b).readByteArray();b=new Uint8Array(g);g=d("WABase64").decodeB64(f);f=d("WABinary").Binary.build(e).readBuffer();e=(yield i(b,a));b=(yield k(e,g,f));a=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsEphemeral.pb").EphemeralSettingSpec,b);e=a.duration;g=a.timestamp;if(e==null||g==null)throw c("err")("ephSetting decoded into malformed proto");return{ephemeralDuration:e,ephemeralSettingTimestamp:d("WATimeUtils").castLongIntToUnixTime(g)}});return m.apply(this,arguments)}g.decodeBroadcastEphemeralSetting=a}),98); __d("WAWebFutureproofingEdit",["WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){return babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"message_edit",futureproofType:d("WAWebMsgType").MSG_TYPE.PROTOCOL,futureproofSubtype:"message_edit"})}g.futureproofEdit=a}),98); __d("WAWebGroupMsgReceiveUtils",["WAWebGroupType","WAWebMessageEditGatingUtils","WAWebSchemaGroupMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(a.toString()));if(!a)return!1;a=d("WAWebGroupType").getGroupTypeFromGroupMetadata(a);return a===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?!d("WAWebMessageEditGatingUtils").receiveCagMsgEditEnabled():!1});return h.apply(this,arguments)}g.futureproofEditInCAG=a}),98); __d("WAWebMarketingMessagesUserFeedbackGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("mm_message_level_feedback_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("mm_message_level_feedback_not_interested_menu_enabled")}function c(){return d("WAWebABProps").getABPropConfigValue("mm_opt_out_enabled")}function e(){return d("WAWebABProps").getABPropConfigValue("mm_opt_out_list_server_sync_enabled")}function f(){return d("WAWebABProps").getABPropConfigValue("mm_message_level_feedback_analytics_enabled")}function h(){d("WAWebABProps").getABPropConfigValue("mm_user_controls_exposure")}function i(){return d("WAWebABProps").getABPropConfigValue("mm_opt_out_fmx_stop_for_high_trust")}function j(){var a=d("WAWebABProps").getABPropConfigValue("mm_user_controls_exception_number_prefixes");return a===""?[]:a.split(",").map(function(a){return a.trim()})}function k(a){if(a==null)return!1;var b=j();return b.some(function(b){return a.toString().startsWith(b)})}g.isMMMessageLevelFeedbackEnabled=a;g.isMMMessageLevelFeedbackNotInterestedMenuEnabled=b;g.isMMOptOutEnabled=c;g.isMMOptOutListServerSyncEnabled=e;g.isMMMessageLevelFeedbackAnalyticsEnabled=f;g.triggerExposureMMUserControls=h;g.isMMStopInFMXEnabled=i;g.getMMUserControlsExceptionNumberPrefixes=j;g.isMMUserControlsExceptionNumberPrefixMatch=k}),98); __d("WAWebCtwaAGMUtils",["WALogger","WAWebBizGatingUtils"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["drop: cannot parse CtWA CTA payload: ",""]);h=function(){return a};return a}c={URL:"url",CALL:"call",CATALOG:"catalog",FLOW:"flow"};var i={FACEBOOK:"facebook",INSTAGRAM:"instagram",WHATSAPP:"whatsapp"};function a(a){if(a.ctaPayload==null)return null;try{a=JSON.parse(a.ctaPayload);return{ctaType:a.cta_type,ctaText:a.cta_text,ctaPayload:(a=a.cta_payload)!=null?a:null}}catch(a){d("WALogger").WARN(h(),a.stack);return null}}function b(a){var b=d("WAWebBizGatingUtils").getFmxAgmEnabled();return d("WAWebBizGatingUtils").getWamoAgmEnabled()?b:b&&a!==i.WHATSAPP}g.AGM_CTA_TYPE=c;g.AGM_SOURCE_APP=i;g.extractAGMPayload=a;g.isWamoAGMIntegrationEnabled=b}),98); __d("WAWebWamEnumCtwaBizUserJourneyOperation",[],(function(a,b,c,d,e,f){a=Object.freeze({AGM_INJECTED:1,AGM_CTA_CLICKED:2,AGM_VIEW_DETAILS_CLICKED:3,AGM_BOTTOMSHEET_SHOWN:4,AGM_BOTTOMSHEET_CLOSED:5,AGM_BOTTOMSHEET_EXTERNAL_NAVIGATION:6,DUPLICATED_AGM_NOT_INJECTED:7,AGM_WELCOME_MESSAGE_NULL:8,AGM_INVALID_CTA_TYPE_FROM_MESSAGE:9,AGM_INVALID_CTA_PAYLOAD_FROM_MESSAGE:10,AGM_INVALID_SOURCE_APP_FROM_MESSAGE:11,AGM_BOTTOMSHEET_IMAGE_ERROR:12,AGM_BOTTOMSHEET_TEXT_ERROR:13});f.CTWA_BIZ_USER_JOURNEY_OPERATION=a}),66); __d("WAWebCtwaBizUserJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCtwaBizUserJourneyOperation"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CtwaBizUserJourney:[5992,{adId:[3,a.TYPES.STRING],bizFeatureEnabled:[4,a.TYPES.STRING],businessPhoneNumber:[5,a.TYPES.INTEGER],ctwaBizUserJourneyMetadata:[1,a.TYPES.STRING],ctwaBizUserJourneyOperation:[2,d("WAWebWamEnumCtwaBizUserJourneyOperation").CTWA_BIZ_USER_JOURNEY_OPERATION]},[1,1,1],"regular"]},{CtwaBizUserJourney:[]});g.CtwaBizUserJourneyWamEvent=b}),98); __d("WAWebWamEnumCtwaChatCreationMode",[],(function(a,b,c,d,e,f){a=Object.freeze({JID:0,LID:1});f.CTWA_CHAT_CREATION_MODE=a}),66); __d("WAWebWamEnumCtwaUserJourneyOperationType",[],(function(a,b,c,d,e,f){a=Object.freeze({LAND_ON_WHATSAPP:1,GET_CONTEXT_CALL_INITIATED:2,GET_CONTEXT_CALL_SUCCESS:3,AD_CONTEXT_FALLBACK_RENDERED:4,AD_CONTEXT_DISMISSED:5,KILL_APP:6,BACK_BUTTON_CLICKED:7,CALL_BUSINESS_BUTTON_CLICKED:8,VIEW_CATALOG_BUTTON_CLICKED:9,PROFILE_PHOTO_CLICKED:10,BIZ_PROFILE_CLICKED:11,GET_CONTEXT_CALL_FAILED:12,CHAT_SETTINGS_CLICKED:13,FIRST_CUSTOM_MESSAGE_SENT_WITH_AD_CONTEXT:14,FIRST_CUSTOM_MESSAGE_SENT_WITHOUT_AD_CONTEXT:15,ICEBREAKER_SENT:16,AD_CONTEXT_FULLPREVIEW_RENDERED:17,TRUST_BANNER_SHOWN:18,TRUST_BANNER_DISMISSED:19,CTWA_ADD_CONTACT_DIALOG_OPEN:20,CTWA_ADD_CONTACT_CREATE_NEW:21,CTWA_ADD_CONTACT_EXISTING:22,CTWA_ARCHIVE_THREAD:23,CTWA_DELETE_THREAD:24,CTWA_PARSE_DEEP_LINK_START:25,CTWA_PARSE_DEEP_LINK_SUCCESS:26,CTWA_PARSE_DEEP_LINK_FAILURE:27,CTWA_CONSUMER_DISCLOSURE_SHOWN_BLOCKING:28,CTWA_CONSUMER_DISCLOSURE_SHOWN_NONBLOCKING:29,CTWA_CONSUMER_DISCLOSURE_NOT_SHOWN_ACCEPTED:30,CTWA_CONSUMER_DISCLOSURE_NOT_SHOWN_COOLDOWN:31,CTWA_CONSUMER_DISCLOSURE_NOT_SHOWN_OTHER:32,CTWA_CONSUMER_DISCLOSURE_ACCEPTED:33,CTWA_CONSUMER_DISCLOSURE_NOT_ACCEPTED:34,FIRST_MESSAGE_SENT_WITHOUT_AD_PAYLOAD:35,FIRST_MESSAGE_SENT_WITH_AD_PAYLOAD:36,CALL_SENT_WITHOUT_AD_PAYLOAD:37,CALL_SENT_WITH_AD_PAYLOAD:38,CTWA_CONSUMER_DISCLOSURE_SHOWN_INTHREAD_BLOCKING:39,CONSUMER_DISCLOSURE_NOT_SHOWN_EXEMPT:40,AGM_SPINNER_HIDES_FROM_GET_CONTEXT_COMPLETION:41,AGM_SPINNER_HIDES_FROM_USER_ACTION:42,AGM_SPINNER_HIDES_FROM_MAX_LOADING_TIME:43,AGM_INJECTED:44,AGM_CTA_CLICKED:45,AGM_VIEW_DETAILS_CLICKED:46,AGM_BOTTOMSHEET_SHOWN:47,AGM_BOTTOMSHEET_CLOSED:48,AGM_BOTTOMSHEET_EXTERNAL_NAVIGATION:49,DUPLICATED_AGM_NOT_INJECTED:50,AGM_WELCOME_MESSAGE_NULL:51,AGM_INVALID_CTA_TYPE_FROM_ACTION_LINK:52,AGM_INVALID_CTA_PAYLOAD_FROM_ACTION_LINK:53,AGM_INVALID_SOURCE_APP_FROM_ACTION_LINK:54,AGM_BOTTOMSHEET_IMAGE_ERROR:55,AGM_BOTTOMSHEET_TEXT_ERROR:56,AGM_SPINNER_SHOWN:57,LAND_ON_CHAT_THREAD:58,AD_CONTEXT_PREVIEW_CLICKED:60,BIZ_CONTEXT_CARD_CLICKED:61,BIZ_CONTEXT_CARD_INSERTED:62,BIZ_CONTEXT_CARD_EXIST:63});f.CTWA_USER_JOURNEY_OPERATION_TYPE=a}),66); __d("WAWebWamEnumTrustBannerAction",[],(function(a,b,c,d,e,f){a=Object.freeze({VIEWED:0,DISMISSED:1});f.TRUST_BANNER_ACTION=a}),66); __d("WAWebCtwaUserJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCtwaChatCreationMode","WAWebWamEnumCtwaUserJourneyOperationType","WAWebWamEnumTrustBannerAction"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CtwaUserJourney:[3466,{adId:[1,a.TYPES.STRING],businessJid:[2,a.TYPES.STRING],ctwaChatCreationMode:[6,d("WAWebWamEnumCtwaChatCreationMode").CTWA_CHAT_CREATION_MODE],ctwaUserJourneyMetadata:[12,a.TYPES.STRING],ctwaUserJourneyOperation:[3,d("WAWebWamEnumCtwaUserJourneyOperationType").CTWA_USER_JOURNEY_OPERATION_TYPE],featureEnabled:[9,a.TYPES.STRING],icebreakersShown:[4,a.TYPES.BOOLEAN],sequenceNumber:[5,a.TYPES.INTEGER],threadCreationDate:[10,a.TYPES.STRING],threadIdHmac:[11,a.TYPES.STRING],trustBannerAction:[7,d("WAWebWamEnumTrustBannerAction").TRUST_BANNER_ACTION],trustBannerType:[8,a.TYPES.STRING]},[1,1,1],"private",113760892]},{CtwaUserJourney:[]});g.CtwaUserJourneyWamEvent=b}),98); __d("WAWebCtwaLogger",["WAWebBizGatingUtils","WAWebCtwaBizUserJourneyWamEvent","WAWebCtwaUserJourneyWamEvent","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebWamEnumCtwaBizUserJourneyOperation","WAWebWamEnumCtwaUserJourneyOperationType"],(function(a,b,c,d,e,f,g){"use strict";b=["agm"];var h=b.join(", ");c={injected:"injected",duplicated:"duplicated",null_greeting_message:"null_greeting_message",invalid_source_app:"invalid_source_app",bottomsheet_text_error:"bottomsheet_text_error",agm_cta_clicked:"agm_cta_clicked",agm_bottomsheet_external_navigation:"agm_bottomsheet_external_navigation",agm_view_details_clicked:"agm_view_details_clicked",agm_bottom_sheet_shown:"agm_bottom_sheet_shown",agm_bottom_sheet_closed:"agm_bottom_sheet_closed",agm_invalid_cta_payload:"agm_invalid_cta_payload",agm_bottom_sheet_image_error:"agm_bottom_sheet_image_error"};f=(e={},e[c.injected]="AGM_INJECTED",e[c.duplicated]="DUPLICATED_AGM_NOT_INJECTED",e[c.null_greeting_message]="AGM_WELCOME_MESSAGE_NULL",e[c.bottomsheet_text_error]="AGM_BOTTOMSHEET_TEXT_ERROR",e[c.agm_cta_clicked]="AGM_CTA_CLICKED",e[c.agm_bottomsheet_external_navigation]="AGM_BOTTOMSHEET_EXTERNAL_NAVIGATION",e[c.agm_view_details_clicked]="AGM_VIEW_DETAILS_CLICKED",e[c.agm_bottom_sheet_shown]="AGM_BOTTOMSHEET_SHOWN",e[c.agm_bottom_sheet_closed]="AGM_BOTTOMSHEET_CLOSED",e[c.agm_bottom_sheet_image_error]="AGM_BOTTOMSHEET_IMAGE_ERROR",e);var i=babelHelpers["extends"]({},f,(b={},b[c.invalid_source_app]="AGM_INVALID_SOURCE_APP_FROM_MESSAGE",b[c.agm_invalid_cta_payload]="AGM_INVALID_CTA_PAYLOAD_FROM_MESSAGE",b)),j=babelHelpers["extends"]({},f,(e={},e[c.invalid_source_app]="AGM_INVALID_SOURCE_APP_FROM_ACTION_LINK",e[c.agm_invalid_cta_payload]="AGM_INVALID_CTA_PAYLOAD_FROM_ACTION_LINK",e));function a(a){var b=a.operationType,c=a.fromClient,e=a.agmPayload,f=a.businessWid;a=a.adId;e={ctaType:(e=e==null?void 0:e.ctaType)!=null?e:null,adID:a};if(c){a=j[b];k(babelHelpers["extends"]({},e,{operation:d("WAWebWamEnumCtwaUserJourneyOperationType").CTWA_USER_JOURNEY_OPERATION_TYPE[a],businessPhoneNumber:f}))}else{c=i[b];l(babelHelpers["extends"]({},e,{operation:d("WAWebWamEnumCtwaBizUserJourneyOperation").CTWA_BIZ_USER_JOURNEY_OPERATION[c],businessWid:f}))}}function k(a){if(d("WAWebBizGatingUtils").getFmxAgmEnabled()){var b=a.operation,c=a.ctaType,e=a.businessPhoneNumber;a=a.adID;new(d("WAWebCtwaUserJourneyWamEvent").CtwaUserJourneyWamEvent)({adId:String(a),ctwaUserJourneyOperation:b,businessJid:n(e),icebreakersShown:!1,ctwaUserJourneyMetadata:JSON.stringify({agm_cta_type:c}),featureEnabled:h}).commit()}}function l(a){if(d("WAWebBizGatingUtils").getFmxAgmEnabled()){var b=a.operation,c=a.ctaType,e=a.businessWid;a=a.adID;new(d("WAWebCtwaBizUserJourneyWamEvent").CtwaBizUserJourneyWamEvent)({adId:String(a),ctwaBizUserJourneyOperation:b,businessPhoneNumber:parseInt(n(e),10),bizFeatureEnabled:h,ctwaBizUserJourneyMetadata:JSON.stringify({agm_cta_type:c})}).commit()}}function m(a){return a!=null?a.toString():"null"}function n(a){var b=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();b=b?d("WAWebLidMigrationUtils").toLid(a):null;b=b!=null?b:a;return m(b)}g.AGM_OPERATION_TYPE=c;g.logAGMOperation=a}),98); __d("WAWebMsgAGMProcessing",["WALogger","WATimeUtils","WAWebCtwaAGMUtils","WAWebCtwaLogger","WAWebDBMessageUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateAGMMsgs: cannot create MsgKey: ",""]);h=function(){return a};return a}var i=50;function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.ctwaContext;try{if(e==null)return[a];var f=d("WAWebCtwaAGMUtils").extractAGMPayload(e),g=d("WAWebMsgGetters").getIsSentByMe(a);if(e.greetingMessageBody==null||e.automatedGreetingMessageShown!==!0||e.sourceId==null){c("isStringNullOrEmpty")(e.greetingMessageBody)&&d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.null_greeting_message,fromClient:g,agmPayload:f,businessWid:a.to,adId:e.sourceId});return[a]}if(e.sourceApp!=null&&!Object.values(d("WAWebCtwaAGMUtils").AGM_SOURCE_APP).includes(e.sourceApp)){d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.invalid_source_app,fromClient:g,agmPayload:f,businessWid:a.to,adId:e.sourceId});return[a]}(f==null?void 0:f.ctaType)!=null&&!Object.values(d("WAWebCtwaAGMUtils").AGM_CTA_TYPE).includes(f==null?void 0:f.ctaType)&&d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.agm_invalid_cta_payload,fromClient:g,agmPayload:f,businessWid:a.to,adId:e.sourceId});var i=a.id,j=a.from,l=a.to,n=a.viewMode,o=a.t;j=j;l=l;g=g;var p=(yield k(b.chat));p=m(e==null?void 0:e.sourceId,p);if(p){d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.duplicated,fromClient:g,agmPayload:f,businessWid:l,adId:e.sourceId});return[a]}b={id:new(c("WAWebMsgKey"))({remote:b.chat,fromMe:!i.fromMe,id:yield c("WAWebMsgKey").newId()}),ctwaContext:e,body:e.greetingMessageBody,from:l,to:j,type:d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE,kind:d("WAWebMsgType").MsgKind.AutomatedGreetingMessage,viewMode:n,t:(p=o)!=null?p:d("WATimeUtils").unixTimeMs()};d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.injected,fromClient:g,agmPayload:f,businessWid:l,adId:e.sourceId});c("isStringNullOrEmpty")(e.description)&&d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.bottomsheet_text_error,fromClient:g,agmPayload:f,businessWid:l,adId:e.sourceId});c("isStringNullOrEmpty")(e.originalImageUrl)&&d("WAWebCtwaLogger").logAGMOperation({operationType:d("WAWebCtwaLogger").AGM_OPERATION_TYPE.agm_bottom_sheet_image_error,fromClient:g,agmPayload:f,businessWid:l,adId:e.sourceId});return[b,a]}catch(b){d("WALogger").WARN(h(),b);return[a]}});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebDBMessageUtils").beginningOfChat(a);a=d("WAWebDBMessageUtils").endOfChat(a);b=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],b,a,{lowerInclusive:!0,upperInclusive:!1,limit:i,reverse:!0}));return b.filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE})});return l.apply(this,arguments)}function m(a,b){return a==null?!1:b.some(function(b){b=b.ctwaContext;return b!=null&&b.sourceId===a})}g.generateAGMMsgs=a}),98); __d("WAWebMsgProcessingApiUtils",["Promise","WAJids","WALogger","WANullthrows","WAWebABProps","WAWebAck","WAWebBackendJobs.flow","WAWebBizCoexGatingUtils","WAWebBizGatingUtils","WAWebBotGating","WAWebBusinessHSMTypes","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoParser","WAWebE2EProtoUtils","WAWebEphemeralDecodeBroadcastSetting","WAWebFutureproofingEdit","WAWebGroupMsgReceiveUtils","WAWebHandleMsgCommon","WAWebHandleMsgError","WAWebHandleMsgMetaUtils","WAWebHandleMsgTypes.flow","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebMsgAGMProcessing","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamEnumDeviceType","WAWebWamEnumDsmError","WAWebWamMsgUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["drop: cannot create MsgKey: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseSenderKeyDistribution: expected: ",", got: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["protocol message: wid error in type ",""]);k=function(){return a};return a}function l(a){var b,c="";((b=a.protocolMessage)==null?void 0:b.historySyncNotification)!=null?c="historySyncNotification":((b=a.protocolMessage)==null?void 0:b.initialSecurityNotificationSettingSync)!=null?c="initialSecurityNotificationSettingSync":((b=a.protocolMessage)==null?void 0:b.appStateSyncKeyRequest)!=null?c="appStateSyncKeyRequest":((b=a.protocolMessage)==null?void 0:b.appStateSyncKeyShare)!=null?c="appStateSyncKeyShare":((b=a.protocolMessage)==null?void 0:b.peerDataOperationRequestResponseMessage)!=null?c="peerDataOperationRequestResponseMessage":((b=a.protocolMessage)==null?void 0:b.peerDataOperationRequestMessage)!=null?c="peerDataOperationRequestMessage":((b=a.protocolMessage)==null?void 0:b.cloudApiThreadControlNotification)!=null&&(c="cloudApiThreadControlNotification");d("WALogger").ERROR(k(),c).sendLogs("wid error")}function m(a){var b=a.info,e=a.msgProtobuf,f=a.paymentInfo,g=a.bizInfo;a=a.msgBotInfo;var h,i=H(b);if(!d("WAWebUserPrefsMeUser").isMeAccountNonLid(i)){l(e);return}if(((i=e.protocolMessage)==null?void 0:i.historySyncNotification)!=null){i=d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:e,message:B(b),msgContext:"relay",paymentInfo:f,bizInfo:g});C(i,a);h={history:c("WANullthrows")(i.historySyncMetaData)}}else if(((b=e.protocolMessage)==null?void 0:b.initialSecurityNotificationSettingSync)!=null){h={securityNotificationEnabled:{isEnabled:(f=e.protocolMessage.initialSecurityNotificationSettingSync.securityNotificationEnabled)!=null?f:!0}}}else if(((g=e.protocolMessage)==null?void 0:g.appStateSyncKeyShare)!=null)h={appStateSyncKeyShare:e.protocolMessage.appStateSyncKeyShare};else if(((a=e.protocolMessage)==null?void 0:a.appStateSyncKeyRequest)!=null)h={appStateSyncKeyRequest:e.protocolMessage.appStateSyncKeyRequest};else if(((i=e.protocolMessage)==null?void 0:i.peerDataOperationRequestResponseMessage)!=null){h={peerDataOperationRequestResponseMessage:(b=e.protocolMessage)==null?void 0:b.peerDataOperationRequestResponseMessage}}else if(((f=e.protocolMessage)==null?void 0:f.peerDataOperationRequestMessage)!=null){h={peerDataOperationRequestMessage:(g=e.protocolMessage)==null?void 0:g.peerDataOperationRequestMessage}}else if(((a=e.protocolMessage)==null?void 0:a.cloudApiThreadControlNotification)!=null){h={cloudApiThreadControlNotification:(i=e.protocolMessage)==null?void 0:i.cloudApiThreadControlNotification}}return h}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=a.msgProtobuf,f=a.info;if(((b=e.protocolMessage)==null?void 0:b.historySyncNotification)!=null||((b=e.protocolMessage)==null?void 0:b.initialSecurityNotificationSettingSync)!=null||((b=e.protocolMessage)==null?void 0:b.appStateSyncKeyShare)!=null||((b=e.protocolMessage)==null?void 0:b.appStateSyncKeyRequest)!=null||((b=e.protocolMessage)==null?void 0:b.peerDataOperationRequestResponseMessage)!=null||((b=e.protocolMessage)==null?void 0:b.peerDataOperationRequestMessage)!=null||((b=e.protocolMessage)==null?void 0:b.cloudApiThreadControlNotification)!=null)return m({info:f,msgProtobuf:e,paymentInfo:a.paymentInfo,bizInfo:a.bizInfo,hsmInfo:a.hsmInfo});else if(((b=e.protocolMessage)==null?void 0:b.lidMigrationMappingSyncMessage)!=null)return{lidMigrationSyncMessage:e.protocolMessage.lidMigrationMappingSyncMessage};switch(f.type){case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.CHAT:return d("WAWebUserPrefsMeUser").isMeAccount(f.author)?q(a):u(a);case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.GROUP:return f.isDirect&&d("WAWebUserPrefsMeUser").isMeAccount(f.author)&&!I(a)?q(a):u(a);case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST:if(a.ciphertextType===d("WAWebBackendJobs.flow").CiphertextType.Skmsg){if(!f.bclHashValidated)throw c("err")("parseMessage: participants for peer broadcast message is not validated");return u(a)}return s(a);case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_BROADCAST:return u(a);case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.DIRECT_PEER_STATUS:return f.isDirect===!0?o(a):s(a);case d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS:return u(a);default:throw c("err")("Unrecognized MESSAGE_TYPE")}});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{return yield q(a)}catch(c){if(c instanceof d("WAWebHandleMsgError").DeviceSentMessageError){var b=Object.keys(a.msgProtobuf).filter(function(a){return a!=="$$unknownFieldCount"&&a!=="messageContextInfo"});if(b.length===1&&b[0]==="senderKeyDistributionMessage")return u(a)}throw c}});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgProtobuf;a=babelHelpers.objectWithoutPropertiesLoose(a,["msgProtobuf"]);var c=b.deviceSentMessage;if(c==null)throw new(d("WAWebHandleMsgError").DeviceSentMessageError)(G(a.info.author),d("WAWebWamEnumDsmError").DSM_ERROR.MISSING_DSM);if(c.destinationJid==null)throw new(d("WAWebHandleMsgError").DeviceSentMessageError)(G(a.info.author),d("WAWebWamEnumDsmError").DSM_ERROR.INVALID_DSM);c=c.destinationJid;b=(yield w(d("WAWebDeviceSentMessageProtoUtils").unwrapDeviceSentMessage(b),a));return babelHelpers["extends"]({deviceSent:{destination:d("WAWebWidFactory").createWid(c)}},b)});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgProtobuf;a=babelHelpers.objectWithoutPropertiesLoose(a,["msgProtobuf"]);var c=a.info,e=b.deviceSentMessage;if(e==null)throw new(d("WAWebHandleMsgError").DeviceSentMessageError)(G(c.author),d("WAWebWamEnumDsmError").DSM_ERROR.MISSING_DSM);if(e.phash==null)throw new(d("WAWebHandleMsgError").DeviceSentMessageError)(G(c.author),d("WAWebWamEnumDsmError").DSM_ERROR.INVALID_DSM);e=e.phash;b=(yield w(d("WAWebDeviceSentMessageProtoUtils").unwrapDeviceSentMessage(b),a));return babelHelpers["extends"]({deviceSent:{phash:e,info:c}},b)});return t.apply(this,arguments)}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgProtobuf;a=babelHelpers.objectWithoutPropertiesLoose(a,["msgProtobuf"]);if(b.deviceSentMessage!=null)throw new(d("WAWebHandleMsgError").DeviceSentMessageError)(G(a.info.author),d("WAWebWamEnumDsmError").DSM_ERROR.INVALID_SENDER);b=(yield w(b,a));return babelHelpers["extends"]({deviceSent:null},b)});return v.apply(this,arguments)}function w(a,b){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f=b.info,g=b.paymentInfo,h=b.bizInfo,i=b.hidePlaceholder,j=b.processDecryptedProtoParams,k=b.hsmInfo,l=b.msgBotInfo,m=b.reportingTokenInfo,n=b.isMessageRetry,o=b.isOffline;b=b.protobufBytes;if(a==null)return{senderKey:null,storeMsg:null,renderableMsgs:[]};h=babelHelpers["extends"]({},d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:a,message:B(f),msgContext:"relay",paymentInfo:g,bizInfo:h,editAttr:f.edit,rcat:j==null?void 0:j.rcat,bizSource:j==null?void 0:(g=j.msgMeta)==null?void 0:g.bizSource,msgMeta:j==null?void 0:j.msgMeta,msgBotInfo:l}));g=h;g=g.disappearingModeTrigger;e=(e=h.id.remote)!=null?e:h.from;if(e!=null&&c("WAWebWid").isGroup(e)&&g!=null&&d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")){g=(yield d("WAWebE2EProtoUtils").updateDisappearingModeForGroups(g,e));g!=null&&(h=babelHelpers["extends"]({},h,g))}C(h,l,j==null?void 0:(e=j.msgMeta)==null?void 0:e.targetSenderJid,j==null?void 0:(g=j.msgMeta)==null?void 0:g.targetId);if(k!=null){l=k.category;e=k.tag;h.hsmTag=e;h.hsmCategory=l;e===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.MARKETING&&d("WAWebMarketingMessagesUserFeedbackGatingUtils").triggerExposureMMUserControls()}if((j==null?void 0:(g=j.msgMeta)==null?void 0:g.bizSource)!=null){h.bizSource=j==null?void 0:(k=j.msgMeta)==null?void 0:k.bizSource}l=a.senderKeyDistributionMessage!=null?y(f,a.senderKeyDistributionMessage):null;if(h.subtype==="message_edit"&&h.futureproofSubtype!=="message_edit"&&(yield d("WAWebGroupMsgReceiveUtils").futureproofEditInCAG(f.chat))){e=d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(h);h=babelHelpers["extends"]({},d("WAWebFutureproofingEdit").futureproofEdit(e))}g=h.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&l==null;k=h.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&l!=null;a=null;if(g&&j!=null){e=j.decrypted;j.reparsing;g=babelHelpers.objectWithoutPropertiesLoose(j,["decrypted","reparsing"]);h.futureproofParams=g;h.futureproofBuffer=e}f.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS&&(h.campaignId=f.campaignId,h.campaignDuration=f.campaignDuration);f.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST&&(h.broadcastId=f.chat,h.bclParticipants=f.bclParticipants,a=h);if(f.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_BROADCAST){h.broadcastId=(j=f.preMatChat)!=null?j:f.chat;g=f.ephSetting;e=h.ephemeralSharedSecret;if(g!=null&&e!=null){j=(yield d("WAWebEphemeralDecodeBroadcastSetting").decodeBroadcastEphemeralSetting(f.chat,f.author.isLid()?c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLidUser()):d("WAWebUserPrefsMeUser").getMeUser(),f.author,g,e));g=j.ephemeralDuration;e=j.ephemeralSettingTimestamp;h.ephemeralDuration=g;h.ephemeralSettingTimestamp=e}}j=[];g=h.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN;e=k||g&&i===!0&&h.futureproofType==null;e||(f.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST?j=(yield D(h,f.bclParticipants)):(h.subtype==="payment_transaction_request_cancelled"||h.subtype==="payment_action_request_declined")&&h.paymentRequestMessageKey==null||(h.reportingTokenInfo=m,h.plainProtobufBytes=b,h.preMatChat=f.preMatChat,h.isRetry=n,h.isOffline=o,(f.author!==h.from||f.author!==h.author)&&(h.senderWithDevice=f.author),j=[h]));d("WAWebBizGatingUtils").shouldGenerateAGMMsgs(h)&&(j=(yield d("WAWebMsgAGMProcessing").generateAGMMsgs(h,f)));return{senderKey:l,storeMsg:a,renderableMsgs:j}});return x.apply(this,arguments)}function y(a,b){if(!a.chat.isGroup()&&!a.chat.isBroadcast())throw c("err")("should not have senderkey");var e=b.groupId;b=b.axolotlSenderKeyDistributionMessage;if(e==null||a.chat.toString({legacy:!0})!==e){var f;d("WALogger").ERROR(j(),a.chat.toString(),(f=e)!=null?f:"null");throw c("err")("parseSenderKeyDistribution: stanza group id mismatched with protobuf")}if(!b)throw c("err")("senderKeyDistributionMessage: from "+a.author.toString()+" has no content");return{groupId:e,key:b}}function z(a){if(a.edit===d("WAWebAck").EDIT_ATTR.SENDER_REVOKE&&a.type!==d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST)return!1;return a.edit===d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE?!1:!0}function e(a){var b=a.msgInfo,c=a.placeholderType,e=a.msgMeta;a=a.placeholderAddReason;if(!z(b))return null;var f=null;switch(c){case d("WAWebHandleMsgTypes.flow").PlaceholderType.E2E:f=void 0;break;case d("WAWebHandleMsgTypes.flow").PlaceholderType.BOT_UNAVAILABLE_FANOUT:f="bot_unavailable_fanout";break;case d("WAWebHandleMsgTypes.flow").PlaceholderType.HOSTED_UNAVAILABLE_FANOUT:f="hosted_unavailable_fanout";break;case d("WAWebHandleMsgTypes.flow").PlaceholderType.VIEW_ONCE_UNAVAILABLE_FANOUT:f="view_once_unavailable_fanout";break;default:f="fanout"}c=d("WAWebHandleMsgMetaUtils").getMsgTypeFromMsgMeta(e);f=babelHelpers["extends"]({},B(b),{type:d("WAWebMsgType").MSG_TYPE.CIPHERTEXT,kind:d("WAWebMsgType").MsgKind.Ciphertext,subtype:f,e2eSenderType:d("WAWebWamMsgUtils").getWamE2eSenderType(b.author),placeholderAddReason:a,bclParticipants:b.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.PEER_BROADCAST?b.bclParticipants:void 0});return c!=null?babelHelpers["extends"]({},f,{parentMsgKey:d("WAWebE2EProtoUtils").createMsgKeyFromThreadInfo(e,b,c),kind:d("WAWebMsgType").MsgKind.PlaceholderAddon,realType:c}):babelHelpers["extends"]({},f,{kind:d("WAWebMsgType").MsgKind.PlaceholderMessage})}function f(a,b){a=babelHelpers["extends"]({},B(a),{type:d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER,kind:d("WAWebMsgType").MsgKind.DebugPlaceholder,body:b.toString()});return a}function A(a,b){if(d("WAWebBotGating").isBotMsgParseEnabledForFutureproofOrFullRecv()&&b.botParticipant!=null)return b.botParticipant;if(!a.fromMe&&c("WAWebWid").isGroup(a.remote)||c("WAWebWid").isStatus(a.remote))return a.participant;return!d("WAWebUserPrefsMeUser").isMeDevice(b.author)&&d("WAWebUserPrefsMeUser").isMeAccount(b.author)?b.author:void 0}function B(a){var b=F(a),e=d("WAWebUserPrefsMeUser").getMeUser(),f=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();b.fromMe&&c("WAWebWid").isGroup(b.remote)&&a.author.isLid()&&f!=null?f=f:f=e;f=b.fromMe?f:b.remote;f={id:b,from:f,to:b.fromMe?b.remote:e,type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:a.ts||0,ack:d("WAWebMsgKeyUtils").isNoteToSelf(b)?d("WAWebAck").ACK.READ:d("WAWebAck").ACK.SENT,author:A(b,a),notifyName:a.pushname||"",invis:!1,count:a.count};d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&a.hostedBizEncStateMismatch===!0&&((e=f.id)==null?void 0:(b=e.remote)==null?void 0:b.isUser())&&(f.hostedBizEncStateMismatch=!0);d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&a.senderOrRecipientAccountTypeHosted===!0&&((e=f.id)==null?void 0:(b=e.remote)==null?void 0:b.isUser())&&(f.senderOrRecipientAccountTypeHosted=!0);d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&a.placeholderCreatedWhenAccountIsHosted!=null&&((e=f.id)==null?void 0:(b=e.remote)==null?void 0:b.isUser())&&(f.placeholderCreatedWhenAccountIsHosted=a.placeholderCreatedWhenAccountIsHosted);return f}function C(a,b,c,e){if(b!=null&&d("WAWebBotGating").isBotMsgParseEnabledForFutureproofOrFullRecv()){a=a;Object.assign(a,{botEditTargetId:b.botEditTargetId,botEditType:b.botEditType,bizBotType:b.bizBotType,botTargetSenderJid:c,botMsgBodyType:b.botMsgBodyType,botResponseTargetId:e})}}function D(a,b){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e=(yield (h||(h=b("Promise"))).all(e.map(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var e=b.wid,f=b.ephSetting,g;try{g=new(c("WAWebMsgKey"))({remote:b.wid,fromMe:!0,id:a.id.id})}catch(a){d("WALogger").WARN(i(),a.stack);return null}var h,j;b=a.ephemeralSharedSecret;var k=a.broadcastId;if(k!=null&&f!=null&&b!=null){k=(yield d("WAWebEphemeralDecodeBroadcastSetting").decodeBroadcastEphemeralSetting(k,e,e.isLid()?c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLidUser()):d("WAWebUserPrefsMeUser").getMeUser(),f,b));h=k.ephemeralDuration;j=k.ephemeralSettingTimestamp}f=babelHelpers["extends"]({},a,{id:g,from:d("WAWebUserPrefsMeUser").getMeUser(),to:e,broadcast:!0,ephemeralDuration:h,ephemeralSettingTimestamp:j,protocolMessageKey:a.protocolMessageKey==null?void 0:new(c("WAWebMsgKey"))({remote:e,fromMe:!0,id:a.protocolMessageKey.id})});return f});return function(a){return e.apply(this,arguments)}}())));return e.filter(Boolean)});return E.apply(this,arguments)}function F(a){if(a.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_BROADCAST)return new(c("WAWebMsgKey"))({remote:d("WAWebWidFactory").toUserWid(a.author),fromMe:!1,id:a.externalId});else if(a.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.CHAT)return d("WAWebBotGating").isBotMsgParseEnabledForFutureproofOrFullRecv()&&a.botParticipant!=null?new(c("WAWebMsgKey"))({remote:a.chat,fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a.author),id:a.externalId,participant:d("WAWebWidFactory").toUserWid(c("WANullthrows")(a.botParticipant))}):new(c("WAWebMsgKey"))({remote:a.chat,fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a.author),id:a.externalId});return new(c("WAWebMsgKey"))({remote:a.chat,fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a.author),participant:d("WAWebWidFactory").toUserWid(a.author),id:a.externalId})}function G(a){return a.device==null||a.device===d("WAJids").DEFAULT_DEVICE_ID?d("WAWebWamEnumDeviceType").DEVICE_TYPE.PRIMARY:d("WAWebWamEnumDeviceType").DEVICE_TYPE.COMPANION}function H(a){return a.type===d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.CHAT?a.author:a.chat}function I(a){var b;return((b=a.meta)==null?void 0:b.appdata)===d("WAWebHandleMsgCommon").APPDATA["default"]&&a.msgProtobuf.senderKeyDistributionMessage!=null}g.parseProtocolMessage=m;g.parseMessage=a;g.isRevokeInfo=z;g.generatePlaceholder=e;g.genDebugPlaceholderMsg=f;g.generateBaseMsg=B;g.generateBclMsgs=D;g.messageInfoToKey=F;g.getDeviceType=G;g.getFrom=H}),98); __d("WAWebWamEnumAgentEngagementEnumType",[],(function(a,b,c,d,e,f){a=Object.freeze({DIRECT_CHAT:0,INVOKED:1,MEMBER:2});f.AGENT_ENGAGEMENT_ENUM_TYPE=a}),66); __d("WAWebWamEnumBotType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,METABOT:1,BOT_1P_BIZ:2,BOT_3P_BIZ:3,UGC:4,META_CHARACTER:5});f.BOT_TYPE=a}),66); __d("WAWebWamEnumInvisibleMessageCategoryType",[],(function(a,b,c,d,e,f){a=Object.freeze({PEER:1,INVISIBLE_KEY_DISTRIBUTION:2,OTHER:3,MEDIA_EXPRESS_NOTIFY:4,EPHEMERAL_SYNC_RESPONSE:5});f.INVISIBLE_MESSAGE_CATEGORY_TYPE=a}),66); __d("WAWebWamEnumMessageDropReasonType",[],(function(a,b,c,d,e,f){a=Object.freeze({SYNCD_DELETION:1,ADMIN_REVOKE_NOT_ENABLED:2,RECEIVED_WITH_OLD_COUNTER:3,INVALID_STANZA:4,INVALID_PROTOBUF:5,MESSAGE_SECRET_ERROR:6,INVALID_LID_ADDRESSED_MESSAGE:7,UNKNOWN_MESSAGE_TYPE:8,DB_OPERATION_FAILED:9,INTERNAL_ERROR:10,EXPIRED:11,INVALID_HOSTED_COMPANION_STANZA:12,MESSAGE_REVOKED:13,PAYMENT_MESSAGE_REVOKED:14,DUPLICATE_MESSAGE:15,DUPLICATE_DELIVERY:16,INVALID_MESSAGE_REFERENCE:17,UNSUPPORTED_MESSAGE:18});f.MESSAGE_DROP_REASON_TYPE=a}),66); __d("WAWebIncomingMessageDropWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumBotType","WAWebWamEnumE2eCiphertextType","WAWebWamEnumE2eDestination","WAWebWamEnumE2eDeviceType","WAWebWamEnumE2eFailureReason","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMediaType","WAWebWamEnumMessageDropReasonType","WAWebWamEnumRevokeType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({IncomingMessageDrop:[3724,{agentEngagementType:[12,d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE],botType:[14,d("WAWebWamEnumBotType").BOT_TYPE],e2eCiphertextType:[1,d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE],e2eDestination:[2,d("WAWebWamEnumE2eDestination").E2E_DESTINATION],e2eFailureReason:[9,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON],e2eSenderType:[3,d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE],invisibleMessageCategory:[13,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],isLid:[15,a.TYPES.BOOLEAN],localAddressingMode:[16,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],messageDropReason:[4,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE],messageMediaType:[5,d("WAWebWamEnumMediaType").MEDIA_TYPE],offline:[6,a.TYPES.BOOLEAN],offlineCount:[11,a.TYPES.INTEGER],retryCount:[7,a.TYPES.INTEGER],revokeType:[8,d("WAWebWamEnumRevokeType").REVOKE_TYPE],typeOfGroup:[10,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{IncomingMessageDrop:[]});g.IncomingMessageDropWamEvent=b}),98); __d("WAWebPostIncomingMessageDropMetric",["WADeprecatedWapParser","WAWebAck","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebDBMessageSerialization","WAWebHandleMsgCommon","WAWebIncomingMessageDropWamEvent","WAWebJidToWid","WAWebMsgGetters","WAWebMsgProcessingApiUtils","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumBotType","WAWebWamEnumMessageDropReasonType","WAWebWamEnumRevokeType","WAWebWamMsgUtils"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("incomingMsgParserForMetric",function(a){var b={};try{b.type=a.attrEnum("type",d("WAWebHandleMsgCommon").STANZA_MSG_TYPES)}catch(a){}try{b.pollType=b.type===d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.poll?a.child("meta").attrEnumOrNullIfUnknown("polltype",d("WAWebHandleMsgCommon").POLL_TYPES):null}catch(a){}try{var c;b.from=d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("from"));((c=b.from)==null?void 0:c.isUser())?b.author=b.from:((c=b.from)==null?void 0:c.isGroup())&&(b.author=a.hasAttr("participant")?d("WAWebJidToWid").deviceJidToDeviceWid(a.attrDeviceJid("participant")):null)}catch(a){}try{b.offline=a.attrInt("offline")}catch(a){}try{b.edit=a.attrInt("edit")}catch(a){}try{c=a.attrString("category");c=d("WAWebWamMsgUtils").getWamInvisibleMessageCatgoryType(c);c!=null&&(b.invisibleMessageCategoryType=c)}catch(a){}c=a.maybeChild("enc");if(c!=null){try{b.e2eType=c.attrEnumValues("type",d("WAWebBackendJobs.flow").CiphertextType.members())}catch(a){}try{b.encMediaType=d("WAWebBackendJobs.flow").EncMediaType.cast(c.maybeAttrString("mediatype"))}catch(a){}try{b.retryCount=c.attrInt("count")}catch(a){}}try{b.botType=d("WAWebWamEnumBotType").BOT_TYPE.UNKNOWN;if((c=b.author)==null?void 0:c.isBot())b.botType=d("WAWebWamEnumBotType").BOT_TYPE.METABOT;else{a=(c=a.maybeChild("bot"))==null?void 0:c.maybeAttrString("biz_bot");a==="1"?b.botType=d("WAWebWamEnumBotType").BOT_TYPE.BOT_1P_BIZ:a==="3"&&(b.botType=d("WAWebWamEnumBotType").BOT_TYPE.BOT_3P_BIZ)}}catch(a){}return b});function i(a){var b=a.messageDropReason;a=a.stanza;var c=null;try{c=h.parse(a).success}catch(a){}b=new(d("WAWebIncomingMessageDropWamEvent").IncomingMessageDropWamEvent)({messageDropReason:b,offline:((a=c)==null?void 0:a.offline)!=null,offlineCount:(b=c)==null?void 0:b.offline,messageMediaType:d("WAWebBackendJobsCommon").getMetricMediaType({encMediaType:(a=c)==null?void 0:a.encMediaType,msgType:(b=c)==null?void 0:b.type,msgPollType:(a=c)==null?void 0:a.pollType})});if(((a=c)==null?void 0:a.from)!=null){a=d("WAWebBackendJobsCommon").getMetricE2eDestination(c.from);a!=null&&(b.e2eDestination=a)}if(((a=c)==null?void 0:a.author)!=null){a=d("WAWebWamMsgUtils").getWamE2eSenderType(c.author);a!=null&&(b.e2eSenderType=a)}((a=c)==null?void 0:a.e2eType)!=null&&(b.e2eCiphertextType=d("WAWebBackendJobsCommon").getMetricE2eCiphertextType(c.e2eType));((a=c)==null?void 0:a.retryCount)!=null&&(b.retryCount=c.retryCount);((a=c)==null?void 0:a.edit)===d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE?b.revokeType=d("WAWebWamEnumRevokeType").REVOKE_TYPE.ADMIN:((a=c)==null?void 0:a.edit)===d("WAWebAck").EDIT_ATTR.SENDER_REVOKE&&(b.revokeType=d("WAWebWamEnumRevokeType").REVOKE_TYPE.SENDER);if(((a=c)==null?void 0:a.from)!=null&&((a=c)==null?void 0:a.author)!=null){if(((a=c)==null?void 0:(a=a.author)==null?void 0:a.isBot())===!0){((a=c)==null?void 0:(a=a.from)==null?void 0:a.isBot())===!0?b.agentEngagementType=d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.DIRECT_CHAT:b.agentEngagementType=d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.INVOKED}}if(((a=c)==null?void 0:a.botType)!=null){b.botType=(a=c)==null?void 0:a.botType}((a=c)==null?void 0:a.invisibleMessageCategoryType)!=null&&(b.invisibleMessageCategory=c.invisibleMessageCategoryType);b.commit()}function a(a){i({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.INVALID_STANZA,stanza:a})}function b(a){i({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.UNKNOWN_MESSAGE_TYPE,stanza:a})}function e(a){i({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.INTERNAL_ERROR,stanza:a})}function f(a){i({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.DB_OPERATION_FAILED,stanza:a})}function j(a){i({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.INVALID_HOSTED_COMPANION_STANZA,stanza:a})}function k(a,b){var c=a.msgInfo,e=a.msgMeta,f=a.enc;a=a.error;b=new(d("WAWebIncomingMessageDropWamEvent").IncomingMessageDropWamEvent)({messageDropReason:b,e2eCiphertextType:d("WAWebBackendJobsCommon").getMetricE2eCiphertextType(f.e2eType),messageMediaType:d("WAWebBackendJobsCommon").getMetricMediaType({encMediaType:f.encMediaType,msgType:e.type,msgPollType:e.pollType}),retryCount:f.retryCount,offline:c.offline!=null,e2eFailureReason:a==null?void 0:a.e2eFailureReason});e=d("WAWebMsgProcessingApiUtils").getFrom(c);f=d("WAWebBackendJobsCommon").getMetricE2eDestination(e);f!=null&&(b.e2eDestination=f);if(e){a=d("WAWebWamMsgUtils").getWamE2eSenderType(e);a!=null&&(b.e2eSenderType=a)}c.edit===d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE?b.revokeType=d("WAWebWamEnumRevokeType").REVOKE_TYPE.ADMIN:c.edit===d("WAWebAck").EDIT_ATTR.SENDER_REVOKE&&(b.revokeType=d("WAWebWamEnumRevokeType").REVOKE_TYPE.SENDER);f=d("WAWebWamMsgUtils").getWamInvisibleMessageCatgoryType(c.category);f!=null&&(b.invisibleMessageCategory=f);if(c.offline!=null){e=parseInt(c.offline,10);Number.isNaN(e)||(b.offlineCount=e)}b.commit()}function l(a){k(a,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.RECEIVED_WITH_OLD_COUNTER)}function m(a){k(a,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.DUPLICATE_MESSAGE)}function n(a){k(a,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.INVALID_PROTOBUF)}function o(a){k(a,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.INVALID_STANZA)}function p(a){k(a,d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.EXPIRED)}function q(a){for(a of a){var b=d("WAWebDBMessageSerialization").messageFromDbRow(a),c=new(d("WAWebIncomingMessageDropWamEvent").IncomingMessageDropWamEvent)({messageDropReason:d("WAWebWamEnumMessageDropReasonType").MESSAGE_DROP_REASON_TYPE.DB_OPERATION_FAILED,messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(b)});b=d("WAWebMsgGetters").getFrom(b);b=d("WAWebBackendJobsCommon").getMetricE2eDestination(b);b!=null&&(c.e2eDestination=b);c.commit()}}g.postIncomingMessageDropInvalidStanza=a;g.postIncomingMessageDropUnknownMessageType=b;g.postIncomingMessageDropInternalError=e;g.postIncomingMessageDropDBOperationFailed=f;g.postIncomingMessageDropInvalidHostedCompanionStanza=j;g.postIncomingMessageDropOldCounter=l;g.postIncomingMessageDropDuplicateMessage=m;g.postIncomingMessageDropInvalidProtobuf=n;g.postIncomingMessageDropInvalidStanzaFromDecryptedMessageInfo=o;g.postIncomingMessageDropExpired=p;g.postIncomingMessageDropDBOperationFailedForMsgRows=q}),98); __d("WAWebGetMessageCache",["WAWebMessageProcessorCache"],(function(a,b,c,d,e,f,g){var h=null;function a(){h==null&&(h=d("WAWebMessageProcessorCache").messageProcessorCache);return h}g.getMessageCache=a}),98); __d("WAWebLogoutReasonConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({UserInitiated:"user_initiated",SyncdFailure:"syncd_failure",InvalidAdvStatus:"invalid_adv_status",CriticalSyncTimeout:"critical_sync_timeout",SyncdTimeout:"syncd_timeout",HistorySyncTimeout:"history_sync_timeout",AccountSyncTimeout:"account_sync_timeout",MDOptOut:"md_opt_out",UnknownCompanion:"unknown_companion",ClientVersionOutdated:"client_version_outdated",SyncdErrorDuringBootstrap:"syncd_error_during_bootstrap",AccountSyncError:"account_sync_error",ClientFatalError:"client_fatal_error",StorageQuotaExceeded:"storage_quota_exceeded",PrimaryIdentityKeyChange:"primary_identity_key_change",MissingEncSalt:"missing_enc_salt",MissingScreenLockSalt:"missing_screen_lock_salt",AccountLocked:"account_locked",LidMigrationSplitThreadMismatch:"lid_migration_split_thread_mismatch",LidMigrationNoLidAvailiable:"lid_migration_no_lid_available",LidMigrationPrimaryMappingsObsolete:"lid_migration_primary_mappings_obsolete",LidMigrationPeerMappingsNotReceived:"lid_migration_peer_mapping_not_received",LidMigrationPeerMappingsMalformed:"lid_migration_peer_mapping_malformed",LidMigrationFailedToParseMapping:"lid_migration_failed_to_parse_mapping",LidMigrationCompanionIncompatibleKillswitch:"lid_migration_companion_incompatible_killswitch",LidMigrationOneOnOneThreadMigrationInternalError:"lid_migration_one_on_one_thread_migration_internal_error"});c={CLIENT_FATAL:"0",SYNC_FAIL:"1",INITIAL_HISTORY_SYNC_TIMEOUT:"2",ACCOUNT_LOCKED:"3"};f.LogoutReason=a;f.LOGOUT_REASON_CODE=c}),66); __d("WAWebPushNotificationsGatingUtils",["WAWebABProps","WAWebEnvironment","WAWebUA"],(function(a,b,c,d,e,f,g){function a(){return h()&&d("WAWebABProps").getABPropConfigValue("web_push_notifications")&&!c("WAWebEnvironment").isWindows}function h(){try{var a=d("WAWebUA").UA.isSafari&&Number(d("WAWebUA").UA.browserVersion.split(".")[0])<16;return!a}catch(a){return!1}}function b(){try{var a=d("WAWebUA").UA.isSafari||d("WAWebUA").UA.browser===d("WAWebUA").BROWSER_TYPE.FIREFOX||d("WAWebUA").UA.isChrome&&Number(d("WAWebUA").UA.browserVersion.split(".")[0])<80;return!a}catch(a){return!1}}function e(){return d("WAWebUA").UA.isSafari||d("WAWebUA").UA.isFirefox?!1:!0}g.canEnableOfflineNotifications=a;g.canSupportOfflineNotifications=h;g.canSupportPeriodicBackgroundSync=b;g.canSupportNotificationActions=e}),98); __d("WAWebPushNotificationsOfflineBbApi",["WAWebPushNotificationsGatingUtils","WAWebUserPrefsNotifications"],(function(a,b,c,d,e,f,g){var h=10*1e3,i=!0,j=null;function a(){d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications()&&(i=!1,j=self.performance.now())}function b(){d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications()&&!i&&j!=null&&self.performance.now()-j>h&&d("WAWebUserPrefsNotifications").setOfflineNotificationsBBStatus({isLongResumeTime:!0})}g.setStartCommsT=a;g.setMainStreamModeReadyT=b}),98); __d("WAWebSocketLogoutJob",["Promise","WALogger","WAWebBackendApi","WAWebRuntimeEnvironmentUtils","WAWebUserPrefsGeneral","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Socket logout failed, err: ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebRuntimeEnvironmentUtils").isServiceWorker())try{yield (h||(h=b("Promise"))).all([d("WAWebUserPrefsGeneral").setOfflinePushDisabled(!0),d("WAWebUserPrefsGeneral").setLogoutReason({reason:a})])}catch(a){d("WALogger").ERROR(i(),a).sendLogs("sw-socket-logout-failed");return}d("WAWebBackendApi").frontendFireAndForget("socketLogout",{reason:a})});return j.apply(this,arguments)}g.socketLogout=a}),98); __d("WAWebOfflineResumeUtils",["Promise","WABackoffUtils","WALogger","WAPromiseDelays","WAPromiseLoop","WAWebClearDanglingReceipts","WAWebCmd","WAWebGetMessageCache","WAWebLogoutReasonConstants","WAWebMessageReceiptBatcher","WAWebNetworkStatus","WAWebOffdStorageUpdateOfflinePeerReceipts","WAWebOfflineDeviceCache","WAWebPageLoadLogging","WAWebPruneExpiredMessagesWithAddOns","WAWebPushNotificationsOfflineBbApi","WAWebSocketLogoutJob","WAWebWamOfflineResumeReporter","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] loadMainScreen complete"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] loadMainScreen: pruneExpiredMessages message failed with error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] restoreDataFromStorage."]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] restoreDataFromStorage failed for "," due to ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] runReceiptCleanUpLoop: Gave up clean up receipts "," tries"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] runReceiptCleanUpLoop: failed with error ","."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] runReceiptCleanUpLoop: done."]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] runReceiptCleanUpLoop: skip due to offline."]);p=function(){return a};return a}var q={MIN_MESSAGE:20,LIMIT_WITH_MESSAGE:50,MAX_STANZA:200};function a(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebGetMessageCache").getMessageCache().createSnapshot();d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.createSnapshot();var a=[d("WAWebGetMessageCache").getMessageCache().checkpointQueue.wait(),d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.checkpointQueue.wait()];a.push(d("WAWebMessageReceiptBatcher").receiptBatcher.runActiveBatches());yield (h||(h=b("Promise"))).all(a)});return r.apply(this,arguments)}function e(){if(!c("WAWebNetworkStatus").online){d("WALogger").LOG(p());return(h||(h=b("Promise"))).resolve()}return d("WAPromiseLoop").promiseLoop(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(c,12e4,1e3,.1));try{yield d("WAWebClearDanglingReceipts").clearDanglingReceipts();d("WALogger").LOG(o());return a()}catch(e){d("WALogger").LOG(n(),e);if(c>3){d("WALogger").WARN(m(),c);return a()}return b}});return function(b,c,d){return a.apply(this,arguments)}}())}function f(){var a;((a=window.location)==null?void 0:a.reload)&&window.location.reload()}function s(a,b){d("WALogger").ERROR(l(),a,b).verbose().sendLogs("offline-resume-fatal-error-"+a,{sendLogsType:d("WALogger").SendLogsType.USER_FORCEFULLY_LOGGED_OUT_SAD});void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.ClientFatalError);return!0}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebPageLoadLogging").startPageLoadQplMeasure("restoreDataFromStorage");var c=a.shouldUpdateReceipts;c=c===void 0?!1:c;a=a.shouldRestoreChatsAndMsgs;var e=a===void 0?!0:a;d("WALogger").LOG(k());a=c?d("WAWebOffdStorageUpdateOfflinePeerReceipts").updatePeerReceipts():(h||(h=b("Promise"))).resolve();c=a.then(function(){return e?d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("restoreChatsAndMessages")["catch"](function(a){s("chats",a)}):(h||(h=b("Promise"))).resolve()});a=d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("restoreGroupsAndContacts")["catch"](function(a){s("groups-and-contacts",a)});var f=d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("restoreProfilePictures")["catch"](function(a){s("profile-pictures",a)});yield (h||(h=b("Promise"))).all([c,a,f]);d("WAWebPageLoadLogging").endPageLoadQplMeasure("restoreDataFromStorage")});return u.apply(this,arguments)}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{yield d("WAWebPruneExpiredMessagesWithAddOns").pruneExpiredMessagesWithAddOns()}catch(a){d("WALogger").ERROR(j(),a);throw a}yield t(a);x();d("WAWebCmd").Cmd.readyForProcessOffline();d("WALogger").LOG(i())});return w.apply(this,arguments)}function x(){d("WAWebCmd").Cmd.readyForMainStreamMode(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logMainScreenLoadT(),d("WAWebPushNotificationsOfflineBbApi").setMainStreamModeReadyT()}function y(a,b){return a+b>q.MAX_STANZA||a>q.MIN_MESSAGE&&a+b>q.LIMIT_WITH_MESSAGE}g.clearOfflineSnapShot=a;g.runReceiptCleanUpLoop=e;g.refreshWindow=f;g.loadMainScreen=v;g.exceedResumeWithOpenTabLimit=y}),98); __d("WAWebPruneExpiredMessagesWithAddOns",["WALogger","WAWebBackendApi","WAWebDBEphemeralMessage","WAWebMsgKey","WAWebPageLoadLogging","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][utils] pruneExpiredMessagesWithAddOns: pruneExpiredMessages pruned "," msg(s)"]);h=function(){return a};return a}function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebPageLoadLogging").startPageLoadQplMeasure("pruneExpiredMessagesWithAddOns");var a=(yield d("WAWebDBEphemeralMessage").pruneExpiredMessages()),b=a.length;if(b>0){var e=[],f=new Set();a.forEach(function(a){a=a.id.toString();f.add(c("WAWebMsgKey").fromString(a).remote.toString());e.push(a)});a=Array.from(f.values()).join(",").toString();d("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:e});yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a,e));d("WALogger").LOG(h(),b)}d("WAWebPageLoadLogging").endPageLoadQplMeasure("pruneExpiredMessagesWithAddOns")});return i.apply(this,arguments)}g.pruneExpiredMessagesWithAddOns=a}),98); __d("WAWebSendMsgCommonApi",["WADeprecatedWapParser","WAJids","WALogger","WAWap","WAWebABProps","WAWebAck","WAWebAddonRetryRequestUtils","WAWebDeviceListPk","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebReactionsBEUtils","WAWebSchemaMessage","WAWebSendMsgTypes","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebVerifyProtobufMsgObjectKeys","WAWebWidFactory","asyncToGeneratorRuntime","encodeProtobuf","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["filterDeviceWithChangedIdentity: cannot determine rowId for message: ",", type: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["filterDeviceWithChangedIdentity: message not found: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["filterDeviceWithChangedIdentity: addon not found: ",""]);j=function(){return a};return a}var k=5;function a(){return(d("WAWebABProps").getABPropConfigValue("web_e2e_backfill_expire_time")||k)*60}function e(a){a=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,a);d("WAWebSignalCommonUtils").writeRandomPadMax16(a);return a.readByteArray()}function f(a){return a.protocolMessage!=null&&a.protocolMessage.type===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE}function l(a){var b;b=(b=(b=a.protocolMessage)==null?void 0:b.type)!=null?b:(b=a.editedMessage)==null?void 0:(b=b.message)==null?void 0:(b=b.protocolMessage)==null?void 0:b.type;return b===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT||((b=a.secretEncryptedMessage)==null?void 0:b.secretEncType)===d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT}function m(a){return a.keepInChatMessage!=null&&a.keepInChatMessage.key!=null&&a.keepInChatMessage.key.fromMe===!0&&a.keepInChatMessage.keepType===d("WAWebProtobufsE2E.pb").KeepType.UNDO_KEEP_FOR_ALL}function n(a,b){var c,e=d("WAWebVerifyProtobufMsgObjectKeys").getProtobufMessageTypesSet(a);c=(c=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(a))!=null?c:a;if(e.has(d("WAWebMsgType").MSG_TYPE.PROTOCOL)){a=(a=c.protocolMessage)==null?void 0:a.type;if(a===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE){b=b==="admin_revoke"?d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE:d("WAWebAck").EDIT_ATTR.SENDER_REVOKE;return d("WAWap").CUSTOM_STRING(String(b))}else if(a===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT)return d("WAWap").CUSTOM_STRING(String(d("WAWebAck").EDIT_ATTR.MESSAGE_EDIT))}else if(e.has(d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED))return d("WAWap").CUSTOM_STRING(String(d("WAWebAck").EDIT_ATTR.MESSAGE_EDIT));else if(e.has(d("WAWebMsgType").MSG_TYPE.REACTION)){if(((b=c.reactionMessage)==null?void 0:b.text)===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT)return d("WAWap").CUSTOM_STRING(String(d("WAWebAck").EDIT_ATTR.SENDER_REVOKE))}else if(e.has(d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT)){if(m(c))return d("WAWap").CUSTOM_STRING(String(d("WAWebAck").EDIT_ATTR.SENDER_REVOKE))}else if(e.has(d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE))return d("WAWap").CUSTOM_STRING(String(d("WAWebAck").EDIT_ATTR.PIN_IN_CHAT));return d("WAWap").DROP_ATTR}function o(a,b){return n(a,b)}var p=new(c("WADeprecatedWapParser"))("sendMsgAckSyncParser",function(a){a.assertTag("ack");return{t:a.attrTime("t"),sync:a.hasAttr("sync")?a.attrString("sync"):null,phash:a.hasAttr("phash")?a.attrString("phash"):null,refreshLid:a.hasAttr("refresh_lid")?a.attrString("refresh_lid")==="true":!1,addressingMode:a.hasAttr("addressing_mode")?a.attrString("addressing_mode"):null,count:a.hasAttr("count")?a.attrInt("count"):null,error:a.hasAttr("error")?a.attrInt("error"):null}});function q(a){return a.device==null||a.device===d("WAJids").DEFAULT_DEVICE_ID}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.data.id;if(a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Addon){var e=(yield d("WAWebAddonRetryRequestUtils").hasSentAddonMsg(c));if(e!=null)return d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().updateIdentityRangeAfterEncryption("sentAddonRowId",e.rowId,b.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString()}))}else if(a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message){e=(yield d("WAWebSchemaMessage").getMessageTable().get(String(c),!1));a=e==null?void 0:e.rowId;if(a!=null)return d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().updateIdentityRangeAfterEncryption("rowId",a,b.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString()}))}});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.data.id;if(a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Addon){var c=(yield d("WAWebAddonRetryRequestUtils").hasSentAddonMsg(b));c||d("WALogger").WARN(j(),b);return c==null?void 0:c.rowId}else if(a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message){c=(yield d("WAWebSchemaMessage").getMessageTable().get(String(b),!1));c||d("WALogger").WARN(i(),b);return c==null?void 0:c.rowId}});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield t(a));if(e==null){d("WALogger").WARN(h(),a.data.id,a.data.type);throw c("err")("filterDeviceWithChangedIdentity: cannot determine message rowId")}var f=new Map();b.forEach(function(a){f.set(d("WAWebDeviceListPk").createDeviceListPK(a),a)});var g=Array.from(f.values()).map(function(a){return d("WAWebWidFactory").createDeviceWidFromUserAndDevice(a.user,a.server,d("WAJids").DEFAULT_DEVICE_ID)}),i=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkGetIdentityWithRowId(g.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a)}))),j=new Set();i.forEach(function(b,c){b=a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Addon?b==null?void 0:b.sentAddonRowId:b==null?void 0:b.rowId;c=g[c];(b==null||b>e)&&j.add(d("WAWebDeviceListPk").createDeviceListPK(c))});return b.filter(function(a){return!j.has(d("WAWebDeviceListPk").createDeviceListPK(a))})});return w.apply(this,arguments)}g.getResendTimeoutInSeconds=a;g.encodeAndPad=e;g.isRevokeMsg=f;g.isEditMsg=l;g.editAttribute=o;g.sendMsgAckSyncParser=p;g.isPrimaryDevice=q;g.updateIdentityRange=r;g.filterDeviceWithChangedIdentity=v}),98); __d("WAWebSignal",["WAWebSignalCipherApi","WAWebSignalSessionApi"],(function(a,b,c,d,e,f,g){g.Cipher=d("WAWebSignalCipherApi"),g.Session=d("WAWebSignalSessionApi")}),98); __d("WAWebSignalCipherApi",["Promise","WAWebCryptoLibrary","WAWebSignalCommonErrors","asyncToGeneratorRuntime","cr:4533","gkx"],(function(a,b,c,d,e,f,g){var h;function a(a,b,c,d){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){if(!c("gkx")("26258")){var i=b("cr:4533")==null?void 0:b("cr:4533").getDebugDecryptFail();if(i!=null&&i>0){b("cr:4533")==null?void 0:b("cr:4533").setDebugDecryptFail(i-1);return(h||(h=b("Promise"))).reject(new(d("WAWebSignalCommonErrors").SignalDecryptionError)())}}return d("WAWebCryptoLibrary").decryptSignalProto(a,e,f,g)});return i.apply(this,arguments)}function e(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return d("WAWebCryptoLibrary").encryptSignalProto(a,b,c)});return j.apply(this,arguments)}function f(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){return d("WAWebCryptoLibrary").decryptGroupSignalProto(a,b,c,e)});return k.apply(this,arguments)}function l(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){return d("WAWebCryptoLibrary").encryptSenderKeyMsgSignalProto(a,b,c,e)});return m.apply(this,arguments)}g.decryptSignalProto=a;g.encryptSignalProto=e;g.decryptGroupSignalProto=f;g.encryptSenderKeyMsgSignalProto=l}),98); __d("WASignalSessions",["WABinary","WASignalKeys","WASignalOther","err"],(function(a,b,c,d,e,f,g){"use strict";var h=3;function a(a,b){return i(a,0,b,[])}function i(a,b,c,d){return{ratchetPubKey:a,nextMsgIndex:b,chainKey:c,unusedMsgKeys:d}}function b(a,b){return j(a,0,b)}function j(a,b,c){return{ratchetKey:a,nextMsgIndex:b,chainKey:c}}function k(a,b,c){return{remoteOneTimeId:a,remoteSignedId:b,localOneTimePubKey:c}}function e(a,b){return n(a.local,a.remote,a.rootKey,a.recvChains,a.sendChain,a.initialExchangeInfo,a.prevSendChainHighestIndex,b,a.aliceBaseKey)}function f(a,b,c){return n(a.local,a.remote,a.rootKey,b,c,a.initialExchangeInfo,a.prevSendChainHighestIndex,a.prevSessions,a.aliceBaseKey)}function l(a,b,c,d){c===void 0&&(c=a.sendChain);return n(a.local,a.remote,d,b,c,null,Math.max(a.sendChain.nextMsgIndex-1,0),a.prevSessions,a.aliceBaseKey)}function m(a,b,c,d,e,f,g){return n(a,b,c,d,e,f,0,[],g)}function n(a,b,c,d,e,f,g,h,i){return{local:a,remote:b,rootKey:c,sendChain:e,recvChains:d,initialExchangeInfo:f,prevSendChainHighestIndex:g,prevSessions:h,aliceBaseKey:i}}function o(a,b){b=new(d("WABinary").Binary)(b);var c=d("WASignalOther").readBytes(b,32),e=d("WASignalOther").readBytes(b,32);b=d("WASignalOther").readBytes(b,16);return p(a,c,e,b)}function p(a,b,c,d){return{index:a,cipherKey:b,macKey:c,iv:d}}function q(a){return{senderRatchetKey:a.ratchetPubKey,chainKey:{index:a.nextMsgIndex,key:a.chainKey},messageKeys:a.unusedMsgKeys}}function r(a){var b=a.ratchetKey;return{senderRatchetKey:b.serializedPubKey,senderRatchetKeyPrivate:b.privateKey,chainKey:{index:a.nextMsgIndex,key:a.chainKey}}}function s(a){var b=a.local,c=a.remote,d=a.initialExchangeInfo,e=void 0;if(d){var f=d.remoteOneTimeId;e={preKeyId:f!=null?f:void 0,signedPreKeyId:d.remoteSignedId,baseKey:d.localOneTimePubKey}}return{currentSession:{sessionVersion:h,localIdentityPublic:b.pubKey,remoteIdentityPublic:c.pubKey,rootKey:a.rootKey,previousCounter:a.prevSendChainHighestIndex,senderChain:r(a.sendChain),receiverChains:a.recvChains.map(q),pendingPreKey:e,remoteRegistrationId:c.regId,localRegistrationId:b.regId,aliceBaseKey:a.aliceBaseKey},previousSessions:a.prevSessions}}function t(a){var b=a.local,c=a.remote,e=a.sendChain,f=a.initialExchangeInfo,g=void 0;if(f){var i=f.remoteOneTimeId;g={preKeyId:i!=null?i:void 0,signedPreKeyId:f.remoteSignedId,baseKey:d("WASignalOther").toBuffer(f.localOneTimePubKey)}}return{sessionVersion:h,localIdentityPublic:d("WASignalOther").toBuffer(b.pubKey),remoteIdentityPublic:d("WASignalOther").toBuffer(c.pubKey),rootKey:d("WASignalOther").toBuffer(a.rootKey),previousCounter:a.prevSendChainHighestIndex,senderChain:{senderRatchetKey:d("WASignalOther").toBuffer(e.ratchetKey.serializedPubKey),senderRatchetKeyPrivate:d("WASignalOther").toBuffer(e.ratchetKey.privateKey),chainKey:{index:e.nextMsgIndex,key:d("WASignalOther").toBuffer(e.chainKey)},messageKeys:[]},receiverChains:a.recvChains.map(function(a){return{senderRatchetKey:d("WASignalOther").toBuffer(a.ratchetPubKey),chainKey:{index:a.nextMsgIndex,key:d("WASignalOther").toBuffer(a.chainKey)},messageKeys:a.unusedMsgKeys.map(function(a){return{index:a.index,cipherKey:d("WASignalOther").toBuffer(a.cipherKey),macKey:d("WASignalOther").toBuffer(a.macKey),iv:d("WASignalOther").toBuffer(a.iv)}})}}),pendingPreKey:g,remoteRegistrationId:c.regId,localRegistrationId:b.regId,aliceBaseKey:a.aliceBaseKey==null?void 0:d("WASignalOther").toBuffer(a.aliceBaseKey)}}function u(a){var b=A(a.currentSession,"currentSession");return w(b,a.previousSessions)}function v(a){return w(a,[])}function w(a,b){var e=A(a.sessionVersion,"sessionVersion");if(e!==h)throw c("err")("Signal: bad session version "+e);e=A(a.senderChain,"senderChain");var f=A(e.chainKey,"senderChain.chainKey");e=j(d("WASignalKeys").makeSerializedKeyPairFrom(z(e.senderRatchetKeyPrivate,32,"senderRatchetKeyPrivate"),y(e.senderRatchetKey,"senderRatchetKey")),A(f.index,"senderChain.chainKey.index"),z(f.key,32,"senderChain.chainKey.key"));f=A(a.receiverChains,"receiverChains").map(function(a){var b=A(a.chainKey,"receiverChains[].chainKey");return i(y(a.senderRatchetKey,"receiverChains[].senderRatchetKey"),A(b.index,"receiverChains[].chainKey.index"),z(b.key,32,"receiverChains[].chainKey.key"),x(a.messageKeys))});var g={regId:d("WASignalOther").castRegistrationId(A(a.localRegistrationId,"localRegistrationId")),pubKey:y(a.localIdentityPublic,"localIdentityPublic")},l={regId:d("WASignalOther").castRegistrationId(A(a.remoteRegistrationId,"remoteRegistrationId")),pubKey:y(a.remoteIdentityPublic,"remoteIdentityPublic")},m=a.pendingPreKey,o=null;if(m){var p=m.preKeyId;o=k(p!=null?d("WASignalKeys").castToPreKeyId(p):null,d("WASignalKeys").castToSignedPreKeyId(A(m.signedPreKeyId,"pendingPreKey.signedPreKeyId")),y(m.baseKey,"pendingPreKey.baseKey"))}p=a.aliceBaseKey==null?null:y(a.aliceBaseKey,"aliceBaseKey");return n(g,l,z(a.rootKey,32,"rootKey"),f,e,o,a.previousCounter||0,b,p)}function x(a){return a.map(function(a){return{index:A(a.index,"messageKeys[].index"),cipherKey:z(a.cipherKey,32,"messageKeys[].cipherKey"),macKey:z(a.macKey,32,"messageKeys[].macKey"),iv:z(a.iv,16,"messageKeys[].iv")}})}function y(a,b){return d("WASignalKeys").castToSerializedPubKey(new Uint8Array(A(a,b)))}function z(a,b,c){return d("WASignalOther").toBytes(A(a,c),b)}function A(a,b){if(a==null)throw c("err")("Signal: protobuf is missing "+b);return a}g.FORMAT_VERSION=h;g.makeFreshRecvChain=a;g.makeRecvChain=i;g.makeFreshSendChain=b;g.makeSendChain=j;g.makeInitialExchangeInfo=k;g.setPrevSessions=e;g.updateChains=f;g.ratchetSession=l;g.makeFreshSession=m;g.makeSession=n;g.splitMsgKey=o;g.serializeSession=s;g.detachSession=t;g.parseSessionFromRecord=u;g.parseSession=v;g._parseSession=w;g.bytesOrThrow=z;g.definedOrThrow=A}),98); __d("WASignalGroupSession",["WASignalKeys","WASignalSessions"],(function(a,b,c,d,e,f,g){"use strict";var h=5,i=3;function j(a){var b=d("WASignalSessions").definedOrThrow(a.senderSigningKey,"senderSigningKey"),c=d("WASignalSessions").definedOrThrow(a.senderMessageKeys,"senderMessageKeys"),e=d("WASignalSessions").definedOrThrow(a.senderChainKey,"senderChainKey");return{senderSigningKeyPublic:r(b["public"],"public"),senderSigningKeyPrivate:b["private"]?d("WASignalSessions").bytesOrThrow(b["private"],32,"private"):void 0,senderKeyId:d("WASignalSessions").definedOrThrow(a.senderKeyId,"senderKeyId"),unusedMsgKeys:c.map(function(a){return k(d("WASignalSessions").definedOrThrow(a.iteration,"iteration"),d("WASignalSessions").bytesOrThrow(a.seed,50,"seed"))}),senderKeyChainKey:l(d("WASignalSessions").definedOrThrow(e.iteration,"iteration"),d("WASignalSessions").bytesOrThrow(e.seed,32,"seed"))}}function a(a,b,c,d,e){return{senderSigningKeyPublic:a,senderSigningKeyPrivate:b,senderKeyChainKey:c,senderKeyId:d,unusedMsgKeys:e==null?[]:e}}function b(a,b){var c=a.senderKeyStates.findIndex(function(a){return a.senderKeyId===b.senderKeyId});return{senderKeyStates:a.senderKeyStates.map(function(a,d){return d===c?b:a})}}function c(a,b){a=a.senderKeyStates.slice(a.senderKeyStates.length>h-1?1:0);a.push(b);return{senderKeyStates:a}}function e(a){return{senderKeyStates:[a]}}function k(a,b){return{iteration:a,seed:b}}function l(a,b){return{nextMsgIndex:a,chainKey:b}}function f(a){a=d("WASignalSessions").definedOrThrow(a.senderKeyStates,"senderKeyStates");return m(a)}function m(a){return n(a)}function n(a){a=a.map(function(a){return j(a)});return{senderKeyStates:a}}function o(a,b){var c=a.senderKeyStates.findIndex(function(a){return a.senderKeyId===b});return c===-1?void 0:a.senderKeyStates[c]}function p(a){return{senderKeyStates:a.senderKeyStates.map(function(a){return q(a)})}}function q(a){return{senderKeyId:a.senderKeyId,senderChainKey:{iteration:a.senderKeyChainKey.nextMsgIndex,seed:a.senderKeyChainKey.chainKey},senderSigningKey:{"public":a.senderSigningKeyPublic,"private":a.senderSigningKeyPrivate},senderMessageKeys:a.unusedMsgKeys.map(function(a){var b=a.iteration;a=a.seed;return{iteration:b,seed:a}})}}function r(a,b){return d("WASignalKeys").castToSerializedPubKey(new Uint8Array(d("WASignalSessions").definedOrThrow(a,b)))}function s(a){return a}g.FORMAT_VERSION=i;g.makeSenderKeyState=a;g.updateSessionWithUpdatedSenderKeyState=b;g.updateSessionWithNewSenderKeyState=c;g.makeNewSenderKeySession=e;g.makeSenderKeyMsgKey=k;g.makeSenderKeyChainKey=l;g.parseSessionFromRecord=f;g._parseSession=m;g.makeSenderKeySessionFromRecord=n;g.findSenderKeyState=o;g.serializeSession=p;g.serializeSenderKeyState=q;g.convertFromRawToSenderKeyState=s}),98); __d("WAWebCryptoLibrarySignalGroupUtilsApi",[],(function(a,b,c,d,e,f){var g="v1";function a(a,b,c,d){return{signatureKey:a,chainKey:b,keyId:c,messageKeys:d==null?[]:d}}function b(a){return{sessions:a,version:g}}function c(a){return a}function d(a,b){return{counter:a,key:b}}function e(a,b){return b!=null?{pubKey:a,privKey:b}:a}f.makeLibsignalSenderKeyState=a;f.makeNewLibsignalSenderKeySession=b;f.makeLibsignalSenderKeyMsgKey=c;f.makeLibsignalSenderKeyChainKey=d;f.makeLibsignalSenderKeySignatureKey=e}),66); __d("WAWebCryptoLibrarySenderkeySessionConversionApi",["invariant","WAByteArray","WAPromiseReduce","WASignalGroupSession","WASignalOther","WAWebCryptoLibrarySignalGroupUtilsApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.sessions;a=(yield d("WAPromiseReduce").promiseReduce(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=(yield j(b));return a==null?d("WASignalGroupSession").makeNewSenderKeySession(c):d("WASignalGroupSession").updateSessionWithNewSenderKeyState(a,c)});return function(b,c,d){return a.apply(this,arguments)}}(),null));a!=null||h(0,72944);return a});return i.apply(this,arguments)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.signatureKey.pubKey!==void 0?new Uint8Array(a.signatureKey.pubKey):new Uint8Array(a.signatureKey),c=a.signatureKey.privKey?d("WASignalOther").ensureSize(new Uint8Array(a.signatureKey.privKey),32):void 0,e=d("WASignalGroupSession").makeSenderKeyChainKey(a.chainKey.counter,d("WASignalOther").ensureSize(new Uint8Array(a.chainKey.key),32)),f=a.keyId,g=[],h=function*(b){if(a.messageKeys[b]){var c=a.messageKeys[b];c=(yield d("WASignalOther").hkdf(new Uint8Array(c),null,"WhisperGroup",50).then(function(a){return d("WASignalGroupSession").makeSenderKeyMsgKey(b,a)}));g.push(c)}};for(var i=0;i<a.messageKeys.length;i++)yield* h(i);h=g;i=d("WASignalGroupSession").makeSenderKeyState(b,c,e,f,h);return i});return k.apply(this,arguments)}function l(a){var b=[],c=d("WAWebCryptoLibrarySignalGroupUtilsApi").makeLibsignalSenderKeyChainKey(a.senderKeyChainKey.nextMsgIndex,d("WAByteArray").uint8ArrayToBuffer(a.senderKeyChainKey.chainKey)),e=a.senderKeyId,f=a.senderSigningKeyPrivate;f=f!=null?d("WAWebCryptoLibrarySignalGroupUtilsApi").makeLibsignalSenderKeySignatureKey(d("WAByteArray").uint8ArrayToBuffer(a.senderSigningKeyPublic),d("WAByteArray").uint8ArrayToBuffer(f)):d("WAWebCryptoLibrarySignalGroupUtilsApi").makeLibsignalSenderKeySignatureKey(d("WAByteArray").uint8ArrayToBuffer(a.senderSigningKeyPublic));a=d("WAWebCryptoLibrarySignalGroupUtilsApi").makeLibsignalSenderKeyState(f,c,e,b);return a}function c(a){a=a.senderKeyStates;a=a.map(function(a){return l(a)});return d("WAWebCryptoLibrarySignalGroupUtilsApi").makeNewLibsignalSenderKeySession(a)}g.toCryptoManagerSenderKeySession=a;g.toSignalSenderKeySession=c}),98); __d("WAWebCryptoLibrarySessionConversionApi",["WAArrayBufferUtils","WALogger","WASignalKeys","WASignalOther","WASignalSessions","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["toCryptoManagerSession: "," "]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["toLibsignalSession: prevSendChainHighestIndex: ",", sendChainCounter: ",""]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=m(a);c=(yield k(c,b));var e=[];for(var f in a.sessions)if(a.sessions[f].indexInfo.closed!==-1){var g=(yield k(a.sessions[f],b));g=d("WASignalSessions").detachSession(g);e.push(g)}return d("WASignalSessions").setPrevSessions(c,e)});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c=[];if(a.currentRatchet.lastRemoteEphemeralKey){var e=a[d("WAArrayBufferUtils").arrayBufferToString(a.currentRatchet.lastRemoteEphemeralKey)];if(e){var f=[],g=function*(a){var b=e.messageKeys[a];b=(yield d("WASignalOther").hkdf(new Uint8Array(b),null,"WhisperMessageKeys",80).then(function(b){return d("WASignalSessions").splitMsgKey(a,b)}));f.push(b)};for(var j=0;j<e.messageKeys.length;j++)yield* g(j);g=a.currentRatchet.lastRemoteEphemeralKey;j=e.chainKey.key;if(g!=null&&j!=null){g=d("WASignalSessions").makeRecvChain(d("WASignalKeys").castToSerializedPubKey(new Uint8Array(g)),e.chainKey.counter+1,d("WASignalOther").toBytes(j,32),f);c.push(g)}}}j=a[d("WAArrayBufferUtils").arrayBufferToString(a.currentRatchet.ephemeralKeyPair.pubKey)];g=d("WASignalKeys").castToSerializedPubKey(new Uint8Array(a.currentRatchet.ephemeralKeyPair.pubKey));var k=j.chainKey.key,l=d("WASignalOther").toBytes(a.currentRatchet.ephemeralKeyPair.privKey,32);l=d("WASignalKeys").makeSerializedKeyPairFrom(l,g);g=d("WASignalSessions").makeSendChain(l,j.chainKey.counter+1,d("WASignalOther").toBytes(k,32));l=b&&{regId:b.registrationId,pubKey:d("WASignalKeys").serializeIdentity(new Uint8Array(b.identityKeyPair.pubKey))};j=b&&{regId:a.registrationId,pubKey:new Uint8Array(a.indexInfo.remoteIdentityKey)};k=a.indexInfo.baseKey&&d("WASignalKeys").castToSerializedPubKey(new Uint8Array(a.indexInfo.baseKey));b=a.currentRatchet.previousCounter;b===-1&&d("WALogger").DEV(i(),b,g.nextMsgIndex);var m=d("WASignalOther").toBytes(a.currentRatchet.rootKey,32),n;a.pendingPreKey!=null&&(n=d("WASignalSessions").makeInitialExchangeInfo(a.pendingPreKey.preKeyId,a.pendingPreKey.signedKeyId,d("WASignalKeys").castToSerializedPubKey(new Uint8Array(a.pendingPreKey.baseKey))));a=[];l=d("WASignalSessions").makeSession(l,j,m,c,g,n,Math.max(b,0),a,k);return l}catch(a){d("WALogger").DEV(h(),a);throw a}});return l.apply(this,arguments)}function m(a){a=a.sessions;for(var b in a)if(a[b].indexInfo.closed===-1)return a[b];throw c("err")("getOpenSession: There are no open session")}g.toCryptoLibrarySessionPrevSessions=a;g.toCryptoManagerSession=k}),98); __d("WAWebSignalConvertApi",["Promise","WALogger","WAWebCryptoCurve25519","WAWebCryptoLibrarySenderkeySessionConversionApi","WAWebCryptoLibrarySessionConversionApi","WAWebSignalProtocolStore","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeConvertSession: failed with error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeConvertSession: converting to crypto library"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeConvertSenderKey: failed with error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeConvertSenderKey: converting to crypto library"]);l=function(){return a};return a}function m(a){return(a==null?void 0:a.sessions)!=null}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a==null||!m(a))return a;var e=(yield (h||(h=b("Promise"))).all([d("WAWebSignalProtocolStore").getSignalProtocolStore().getIdentityKeyPair(),d("WAWebSignalProtocolStore").getSignalProtocolStore().getLocalRegistrationId()])),f=e[0];e=e[1];if(!f||e==null)throw c("err")("Attempted to loadSession without registration info");f={identityKeyPair:d("WAWebCryptoCurve25519").toCurveKeyPair(f),registrationId:e};d("WALogger").LOG(j()).sendLogs("libsignal-to-cryptolib-session",{sampling:0});return d("WAWebCryptoLibrarySessionConversionApi").toCryptoLibrarySessionPrevSessions(a,f)}catch(a){d("WALogger").ERROR(i(),a).sendLogs("session-convert-error");throw a}});return n.apply(this,arguments)}function o(a){return a.sessions!=null}function e(a){try{if(a==null||!o(a))return a;d("WALogger").LOG(l()).sendLogs("libsignal-to-cryptolib-senderkey",{sampling:0});return d("WAWebCryptoLibrarySenderkeySessionConversionApi").toCryptoManagerSenderKeySession(a)}catch(a){d("WALogger").ERROR(k(),a).sendLogs("senderkey-convert-error");throw a}}g.shouldConvertSession=m;g.maybeConvertSession=a;g.maybeConvertSenderKey=e}),98); __d("WAWebSignalKeyApi",["WAWebCryptoCurve25519","WAWebCryptoLibraryUtilsApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=c("WAWebCryptoLibraryUtilsApi").makePreKey(a);var b=a.preKeyId,d=a.privKey;a=a.pubKey;d={privKey:d,pubKey:a};return{keyId:b,keyPair:d,isDirectDistribution:0}});return h.apply(this,arguments)}function e(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=c("WAWebCryptoLibraryUtilsApi").makeSignedPreKey(d("WAWebCryptoCurve25519").toCurveKeyPair(a),b);b=a.preKeyId;var e=a.privKey,f=a.pubKey;a=a.signature;e={privKey:e,pubKey:f};return{keyId:b,keyPair:d("WAWebCryptoCurve25519").toCurveKeyPair(e),signature:a}});return i.apply(this,arguments)}function f(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return c("WAWebCryptoLibraryUtilsApi").makeKeyPair()});return j.apply(this,arguments)}g.generatePreKeyPair=a;g.generateSignedKeyPair=e;g.generateIdentityKeyPair=f}),98); __d("WAWebSignalSessionApi",["Promise","WABinary","WAJids","WALogger","WAWebAdvSignatureApi","WAWebApiContact","WAWebCryptoCurve25519","WAWebCryptoLibrary","WAWebCryptoLibraryDbCallbacksApi","WAWebCryptoLibrarySessionApi","WAWebCryptoLibraryUtilsApi","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebSignalStoreApi","WAWebWidFactory","asyncToGeneratorRuntime","cr:4533","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["hasSameBaseKey: MsgId: ",", savedBaseKey and sessionBaseKey is same"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["hasSameBaseKey: MsgId: ",", savedBaseKey and sessionBaseKey is different "]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["hasSameBaseKey: MsgId: ",", no session has been saved locally "]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["hasSameBaseKey: MsgId: ",", no base key has been saved locally "]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["saveSessionBaseKey: for ",", no basekey provided"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Signal::createSignalSession with ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Signal::createSignalSession"]);r=function(){return a};return a}function a(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.wid,f=a.identity,g=a.deviceIdentity;c("gkx")("26258")?d("WALogger").LOG(r()):d("WALogger").LOG(q(),e.toString({legacy:!0}));if(e.device!=null&&e.device!==d("WAJids").DEFAULT_DEVICE_ID){if(!g)throw c("err")("Signal::createSignalSession: expected device-identity in keyBundle for companion device");g=(yield d("WAWebAdvSignatureApi").validateADVwithIdentityKey(e,g,f));if(!g)throw c("err")("Signal::createSignalSession: invalid identityKey fetched")}var h,i,j;try{h=d("WAWebCryptoCurve25519").toSignalCurvePubKey(new(d("WABinary").Binary)(a.identity).readBuffer())}catch(a){d("WALogger").ERROR(p()).sendLogs("Signal::createSignalSession: invalid identityKey fetched");throw a}try{i=d("WAWebCryptoCurve25519").toSignalCurvePubKey(new(d("WABinary").Binary)(a.skey.pubkey).readBuffer())}catch(a){d("WALogger").ERROR(o()).sendLogs("Signal::createSignalSession: invalid signedPreKey fetched");throw a}if(a.key)try{j=d("WAWebCryptoCurve25519").toSignalCurvePubKey(new(d("WABinary").Binary)(a.key.pubkey).readBuffer())}catch(a){d("WALogger").ERROR(n()).sendLogs("Signal::createSignalSession: invalid preKey fetched")}f={registrationId:a.regId,identityKey:h,signedPreKey:{keyId:a.skey.id,publicKey:i,signature:new(d("WABinary").Binary)(a.skey.signature).readBuffer()}};a.key&&j&&(f.preKey={keyId:a.key.id,publicKey:j});return d("WAWebCryptoLibrarySessionApi").createSignalSession(f,e,b)});return s.apply(this,arguments)}function e(a,b){d("WAWebApiContact").checkPnToLidMapping(a,d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_HAS_SIGNAL_SESSIONS);return d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().containSessions(a.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddress(a,b).toString()}))}function f(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebCryptoLibrarySessionApi").getRemoteRegId(a)});return t.apply(this,arguments)}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_DELETE_REMOTE_INFO);var c=[],e=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a).toString();c.push(d("WAWebSignalProtocolStore").getSignalProtocolStore().removeIdentity(e));w(a).forEach(function(a){c.push(d("WAWebSignalProtocolStore").getSignalProtocolStore().removeSession(a))});yield (h||(h=b("Promise"))).all(c)});return v.apply(this,arguments)}function w(a){var b=new Set();if(a.isLid()){var c=d("WAWebSignalCommonUtils").createSignalAddress(a,!0).toString(),e=d("WAWebSignalCommonUtils").createSignalAddress(a,!1).toString();b.add(e);b.add(c)}else{e=d("WAWebSignalCommonUtils").createSignalAddress(a).toString();b.add(e);c=d("WAWebApiContact").getCurrentLidDevice(d("WAWebWidFactory").createDeviceWidFromWid(a));if(c!=null){e=d("WAWebSignalCommonUtils").createSignalAddress(c,!0).toString();b.add(e)}}return Array.from(b)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_DELETE_REMOTE_SESSION);a=w(a).map(function(a){return d("WAWebSignalProtocolStore").getSignalProtocolStore().removeSession(a)});yield (h||(h=b("Promise"))).all(a);return});return y.apply(this,arguments)}function z(a){a=d("WAWebSignalCommonUtils").createSignalAddress(a).toString();return d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().maybeCleanUpUnconvertedSession(a)}function A(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);var e=d("WAWebCryptoLibraryDbCallbacksApi").getCryptoDbCallbacks();a=d("WAJids").unsafeCoerceToDeviceJid(a.toJid());a=(yield c("WAWebCryptoLibraryUtilsApi").getSessionAliceBaseKey(a,b?e.loadSessionDeprecatedLid:e.loadSession));return a.success===!0?a.value:null});return B.apply(this,arguments)}function C(a,b,c){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=!1);d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_SAVE_SESSION_BASE_KEY);var e=d("WAWebSignalCommonUtils").createSignalAddress(a,c);a=(yield A(a,c));!a?d("WALogger").LOG(m(),b):yield d("WAWebSignalStoreApi").waSignalStore.saveBaseKey(e.toString(),b,a)});return D.apply(this,arguments)}function E(a,b,c){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=!1);d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_HAS_SAME_BASE_KEY);var f=d("WAWebSignalCommonUtils").createSignalAddress(a,e);a=(yield (h||(h=b("Promise"))).all([A(a,e),d("WAWebSignalStoreApi").waSignalStore.loadBaseKey(f.toString(),c)]));e=a[0];f=a[1];if(!f){d("WALogger").LOG(l(),c);return!1}if(!e){d("WALogger").LOG(k(),c);return!1}if(!d("WAWebSignalCommonUtils").bufferEqual(f,e)){d("WALogger").LOG(j(),c);return!1}d("WALogger").LOG(i(),c);return!0});return F.apply(this,arguments)}function G(a,b,c,d){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){return d("WAWebCryptoLibrarySessionApi").createGroupSenderSignalSession(d("WAWebWidFactory").createWid(b),a,c,e)});return H.apply(this,arguments)}function I(a,b,c){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return d("WAWebCryptoLibrary").getGroupSenderKeyInfo(a,b,c)});return J.apply(this,arguments)}function K(a,b,c){c===void 0&&(c=!1);d("WAWebApiContact").checkPnToLidMapping([b],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_DELETE_GROUP_SENDER_KEY_INFO);b=d("WAWebSignalCommonUtils").createSignalAddress(b,c);c=a.toString({legacy:!0})+"::"+b.toString();return d("WAWebSignalStoreApi").waSignalStore.removeSenderKey(c)}function L(a,b){b===void 0&&(b=!1);d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_SIGNAL_SESSION_DELETE_DEVICE_SENDER_KEY);a=String(d("WAWebSignalCommonUtils").createSignalAddress(a,b));return d("WAWebSignalStoreApi").waSignalStore.removeSenderKeyBySenderId(a)}g.createSignalSession=a;g.hasSignalSessions=e;g.getRemoteRegId=f;g.deleteRemoteInfo=u;g.deleteRemoteSession=x;g.maybeDeleteUnconvertedSession=z;g.saveSessionBaseKey=C;g.hasSameBaseKey=E;g.createGroupSignalSession=G;g.getGroupSenderKeyInfo=I;g.deleteGroupSenderKeyInfo=K;g.deleteDeviceSenderKey=L}),98); __d("WAWebSignalUtilsApi",["WAWap","WAWebCryptoCurve25519","WAWebCryptoLibraryUtilsApi"],(function(a,b,c,d,e,f,g){function a(a){var b;return(b=d("WAWap")).wap("skey",null,b.wap("id",null,b.BIG_ENDIAN_CONTENT(a.keyId,3)),b.wap("value",null,a.keyPair.pubKey),b.wap("signature",null,a.signature))}function b(a){var b;return(b=d("WAWap")).wap("key",null,b.wap("id",null,b.BIG_ENDIAN_CONTENT(a.keyId,3)),b.wap("value",null,a.keyPair.pubKey))}function e(a){a=c("WAWebCryptoLibraryUtilsApi").extractIdentityKey(a);return a.success===!0?d("WAWebCryptoCurve25519").toCurveKeyPubKey(a.value):null}g.xmppSignedPreKey=a;g.xmppPreKey=b;g.extractIdentityKey=e}),98); __d("WALock",["Promise","WAResolvable","WATagsLogger"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lock failed for ",""]);i=function(){return a};return a}function a(a){return{lock:function(c,e){var f=new(d("WAResolvable").Resolvable)(),g=c.map(function(a){return[a,new(d("WAResolvable").Resolvable)()]});(h||(h=b("Promise"))).all(g.map(function(b){var c=b[0],d=b[1];return a.enqueue(c,function(){d.resolve();return f.promise})}))["catch"](function(){d("WATagsLogger").TAGS(["WALock"]).ERROR(i(),c)});return h.all(g.map(function(a){a[0];a=a[1];return a.promise})).then(function(){return e()})["finally"](function(){f.resolve()})},wait:function(b){return a.wait(b)}}}g.makeLock=a}),98); __d("WALockMap",["WALock","WAPromiseQueue"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a===void 0&&(a=-1);a=new(d("WAPromiseQueue").PromiseQueueMap)(a);return d("WALock").makeLock(a)}g.makeLockMap=a}),98); __d("WACryptoLibraryConfig",[],(function(a,b,c,d,e,f){"use strict";var g={signalFutureMessagesMax:2e3};function a(){return g}function b(a,b){g[a]=b}f.getCryptoLibraryConfig=a;f.setCryptoLibraryConfig=b}),66); __d("WACryptoEd25519",["WACryptoPrimitives","err"],(function(a,b,c,d,e,f,g){"use strict";var h=null;function i(a){var b=h;h=[];try{return a()}finally{((a=h)!=null?a:[]).forEach(function(a){return void a.fill(0)});h=b}}function j(a,b){if(h==null)throw c("err")("allocate called outside of active scope");return new a(b)}function a(a,b,c){d("WACryptoPrimitives").lowlevel.crypto_hash(a,b,c)}function b(a,b){for(var c=0;c<64;++c)b[c]=a[c],a[c]=0;l(a,b);b.fill(0)}function e(a,b){var c=[k(),k(),k(),k()];d("WACryptoPrimitives").lowlevel.scalarbase(c,b);R(a,c)}function k(a){var b=j(Float64Array,16);if(a){if(a.length>16)throw c("err")("Incorrect initialiser array provided to the fieldElement");for(var d=0;d<a.length;d++)b[d]=a[d]}return b}function l(a,b){d("WACryptoPrimitives").lowlevel.modL(a,b)}var m=function(){return k([0])},n=function(){return k([1])},o=function(){return k([2])},p=function(){return k([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139])};function q(){return[k(),k(),k(),k()]}function r(){return[k(),k(),k(),k()]}function s(){return[k(),k(),k()]}function t(a,b){var c=0;b=b;while(b>0){var d=b%65536;a[c]=d;b=(b-d)/65536;c++}}function u(a,b){return T(a,b)?0:1}function v(a){var b=d("WACryptoPrimitives").lowlevel.pack25519,c=j(Uint8Array,32);b(c,a);return c[0]&1}function w(a,b){var c=d("WACryptoPrimitives").lowlevel.S,e=d("WACryptoPrimitives").lowlevel.M,f=o(),g=k();c(g,b);e(a,f,g)}function x(a,b){var c=d("WACryptoPrimitives").lowlevel.S,e=d("WACryptoPrimitives").lowlevel.M,f=d("WACryptoPrimitives").lowlevel.A,g=m(),h=n(),i=k(),j=k(),l=k(),o=k();t(g,486662);c(i,b);e(j,g,b);f(l,i,j);f(o,l,h);e(a,b,o)}function y(a,b,c){c===1&&a.set(b)}var z=new Uint8Array([176,160,14,74,39,27,238,196,120,228,47,173,6,24,67,47,167,215,251,61,153,0,77,43,11,223,193,79,128,36,131,43]);function A(a,b){var c,e=(c=d("WACryptoPrimitives")).lowlevel.unpack25519,f=c.lowlevel.pow2523,g=c.lowlevel.M;c=c.lowlevel.S;var h=k();e(h,z);e=k();f(e,b);f=k();g(f,b,e);e=k();c(e,f);c=k();g(c,f,h);y(f,c,1^u(e,b));a.set(f)}function B(a,b){var c=d("WACryptoPrimitives").lowlevel.Z,e=d("WACryptoPrimitives").lowlevel.A,f=d("WACryptoPrimitives").lowlevel.M,g=n(),h=k(),i=k(),j=k();c(h,b,g);e(i,b,g);S(j,i);f(a,h,j)}function C(a,b){var c=d("WACryptoPrimitives").lowlevel.Z,e=m();c(a,e,b)}function D(a,b){var c=d("WACryptoPrimitives").lowlevel.M;c(a[0],b[0],b[3]);c(a[1],b[1],b[2]);c(a[2],b[2],b[3])}function E(a,b){var c=d("WACryptoPrimitives").lowlevel.M;c(a[0],b[0],b[3]);c(a[1],b[1],b[2]);c(a[2],b[2],b[3]);c(a[3],b[0],b[1])}function F(a,b){var c=d("WACryptoPrimitives").lowlevel.S,e=d("WACryptoPrimitives").lowlevel.A,f=d("WACryptoPrimitives").lowlevel.Z;c(a[0],b[0]);c(a[2],b[1]);w(a[3],b[2]);e(a[1],b[0],b[1]);b=k();c(b,a[1]);e(a[1],a[2],a[0]);f(a[2],a[2],a[0]);f(a[0],b,a[1]);f(a[3],a[3],a[2])}var G=new Uint8Array([6,126,69,255,170,4,110,204,130,26,125,75,209,211,161,197,126,79,252,3,220,8,123,210,187,6,160,96,244,237,38,15]);function H(a,b,c){var e=d("WACryptoPrimitives").lowlevel.unpack25519,f=d("WACryptoPrimitives").lowlevel.M,g=k();e(g,G);e=k();B(e,b);var h=k();x(h,b);var i=k();A(i,h);h=k();f(h,b,g);b=k();S(b,i);g=k();f(g,h,b);i=k();C(i,g);y(g,i,v(g)^c);a[0].set(g);a[1].set(e);a[2].set(n());f(a[3],a[0],a[1])}function I(a,b){a[0].set(b[0]),a[1].set(b[1]),a[2].set(b[2])}function J(a,b){var c=s();I(c,b);F(a,c)}function K(a,b){var c=r(),d=s();J(c,b);D(d,c);F(c,d);D(d,c);F(c,d);E(a,c)}function L(a){var b,c=(b=d("WACryptoPrimitives")).lowlevel.S,e=b.lowlevel.M,f=b.lowlevel.pow2523;b=b.lowlevel.pack25519;var g=k(),h=k(),i=k(),j=k(),l=k();f(g,a);c(h,g);c(i,h);e(j,i,a);e(l,j,a);f=new Uint8Array(32);b(f,l);return 1&f[31]}function M(a,b){C(a[0],b[0]),a[1].set(b[1]),a[2].set(b[2]),C(a[3],b[3])}function f(a,b){var c=q();b=U(c,b);if(b!==0)return-1;M(a,c);return 0}function N(a,b){var c=d("WACryptoPrimitives").lowlevel.M,e=d("WACryptoPrimitives").lowlevel.A;b=b;var f=n(),g=m();t(g,486662);var h=k();w(h,b);b=k();e(b,h,f);h=k();S(h,b);f=k();c(f,h,g);b=k();C(b,f);c=k();x(c,b);h=L(c);f=k([0]);y(f,g,h);c=k();e(c,b,f);g=k();C(g,c);y(c,g,h);a.set(c)}function O(a){var b=d("WACryptoPrimitives").lowlevel.unpack25519;a=d("WACryptoPrimitives").hash(a);var c=(a[31]&128)>>7;a[31]&=127;var e=k();b(e,a);b=k();P(b,e);a=q();H(a,b,c);e=q();K(e,a);return e}function P(a,b){return i(function(){return N(a,b)})}function Q(a){return i(function(){return O(a)})}function R(a,b){var c=k(),e=k(),f=k(),g=d("WACryptoPrimitives").lowlevel.M,h=d("WACryptoPrimitives").lowlevel.pack25519;S(f,b[2]);g(c,b[0],f);g(e,b[1],f);h(a,e);g=new Uint8Array(32);h(g,c);a[31]^=(g[0]&1)<<7}function S(a,b){var c=k();c.set(b);var e=d("WACryptoPrimitives").lowlevel.M,f=d("WACryptoPrimitives").lowlevel.S;for(var g=253;g>=0;--g)f(c,c),g!==2&&g!==4&&e(c,c,b);a.set(c)}function T(a,b){var c=d("WACryptoPrimitives").lowlevel.pack25519,e=d("WACryptoPrimitives").lowlevel.crypto_verify_32,f=new Uint8Array(32),g=new Uint8Array(32);c(f,a);c(g,b);return e(f,0,g,0)}function U(a,b){var c,e=(c=d("WACryptoPrimitives")).lowlevel.set25519,f=c.lowlevel.S,g=c.lowlevel.M,h=c.lowlevel.Z,i=c.lowlevel.A,j=c.lowlevel.D,l=c.lowlevel.unpack25519;c=c.lowlevel.pow2523;var o=k(),q=k(),r=k(),s=k(),t=k(),u=k(),v=k();e(a[2],n());l(a[1],b);f(r,a[1]);g(s,r,j);h(r,r,a[2]);i(s,a[2],s);f(t,s);f(u,t);g(v,u,t);g(o,v,r);g(o,o,s);c(o,o);g(o,o,r);g(o,o,s);g(o,o,s);g(a[0],o,s);f(q,a[0]);g(q,q,s);T(q,r)&&g(a[0],a[0],p());f(q,a[0]);g(q,q,s);if(T(q,r))return-1;V(a[0])===b[31]>>7&&h(a[0],m(),a[0]);g(a[3],a[0],a[1]);return 0}function V(a){var b=d("WACryptoPrimitives").lowlevel.pack25519,c=new Uint8Array(32);b(c,a);return c[0]&1}g.runInAllocationScope=i;g.allocate=j;g.hashSha512=a;g.reduce=b;g.scalarmultBase=e;g.fieldElement=k;g.modL=l;g.p3Element=q;g.unpack=f;g.elligator=P;g.hashToPoint=Q;g.pack=R;g.inv25519=S;g.unpackneg=U}),98); __d("WASignalSignatures",["Promise","WACryptoDependencies","WACryptoEd25519","WACryptoPrimitives","WAHex","WALogger","WALongInt","WASignalKeys","WASignalLocalStorageProtocol.pb","WASignalOther","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["deserializeSignedPreKey error ",""]);i=function(){return a};return a}function j(a,b,c){return d("WACryptoEd25519").runInAllocationScope(function(){var e,f=b.length,g=a.privateKey,h=new Uint8Array(32);(e=d("WACryptoEd25519")).scalarmultBase(h,g);var i=h[31]&128,j=new Uint8Array(f+128);j[0]=254;j.fill(255,1,32);j.set(g,32);j.set(b,64);j.set(c,f+64);var k=e.allocate(Uint8Array,64);e.hashSha512(k,j,f+128);j.set(h,32);h=e.allocate(Float64Array,64);e.reduce(k,h);e.scalarmultBase(j,k);var l=e.allocate(Uint8Array,64);e.hashSha512(l,j,f+64);e.reduce(l,h);for(f=0;f<32;++f)h[f]=k[f];for(f=0;f<32;++f)for(k=0;k<32;++k)h[f+k]+=l[f]*g[k];e.modL(j.subarray(32,64),h);return{pubKeyNegative:i!==0,signedMsg:j}})}function a(a,c){return(h||(h=b("Promise"))).resolve().then(function(){var b=d("WASignalOther").makeBytes(64);d("WACryptoDependencies").getCrypto().getRandomValues(b);return k(a,c,b)})}function e(a,b,c){var e=c[63];return e&96?!1:d("WACryptoEd25519").runInAllocationScope(function(){var f,g,h=(f=d("WACryptoPrimitives")).lowlevel.A,i=f.lowlevel.M,j=f.lowlevel.Z,k=f.lowlevel.pack25519,l=f.lowlevel.unpack25519,m=(g=d("WACryptoEd25519")).allocate(Uint8Array,64);m.set(c);m[63]=e&127;var n=g.fieldElement(),o=g.fieldElement(),p=g.fieldElement(),q=g.fieldElement(),r=g.fieldElement(),s=g.allocate(Uint8Array,32),t=g.fieldElement();t[0]=1;l(n,a.subarray(1));j(o,n,t);h(p,n,t);g.inv25519(q,p);i(r,o,q);k(s,r);s[31]=s[31]&127|e&128;return f.signDetachedVerify(b,m,s)})}function k(a,b,c){a=j(a,b,c);b=d("WASignalOther").sliceBytes(a.signedMsg,0,64);b[63]=b[63]&127|(a.pubKeyNegative?128:0);return b}function l(a,b,e){var f=d("WASignalKeys").makeKeyPair(),g=d("WASignalOther").makeBytes(64);d("WACryptoDependencies").getCrypto().getRandomValues(g);e=k(e,d("WASignalKeys").serializePubKey(f),g);if(!Number.isSafeInteger(b))throw c("err")("Expected timestamp to be a safe integer, given "+String(b));return{id:d("WASignalKeys").castToPreKeyId(a),ts:b,keyPair:f,signature:e}}function f(a,b){var c=d("WASignalOther").makeBytes(64);d("WACryptoDependencies").getCrypto().getRandomValues(c);return k(a,b,c)}function m(a){var b=a.id,c=a.keyPair;return d("WASignalOther").encodeSignalProto(d("WASignalLocalStorageProtocol.pb").SignedPreKeyRecordStructureSpec,{id:b,publicKey:d("WASignalKeys").serializePubKey(c),privateKey:c.privateKey,signature:a.signature,timestamp:a.ts})}function n(a){try{a=d("decodeProtobuf").decodeProtobuf(d("WASignalLocalStorageProtocol.pb").SignedPreKeyRecordStructureSpec,a);var b=a.id,c=a.publicKey,e=a.privateKey,f=a.signature;a=a.timestamp;return b==null||c==null||e==null||f==null||a==null?null:{id:d("WASignalKeys").castToSignedPreKeyId(b),ts:d("WALongInt").numberOrThrowIfTooLarge(a),keyPair:d("WASignalKeys").makeKeyPairFromSerialized(d("WASignalOther").toBytes(e,32),d("WASignalKeys").castToSerializedPubKey(new Uint8Array(c))),signature:d("WASignalOther").toBytes(f,64)}}catch(a){d("WALogger").DEV(i(),a);return null}}function o(a){return new Uint8Array(d("WAHex").parseHex(a))}function p(a){if(a.length===33)return d("WASignalKeys").castToSerializedPubKey(a);else if(a.length===32)return d("WASignalKeys").serializeIdentity(a);else throw c("err")("verifyCertificate publicKey incorrect length")}function q(a,c,d){return(h||(h=b("Promise"))).resolve().then(function(){var b=l(a,c,d),e=m(b);return{plainObject:b,record:e}})}g.signMsg=a;g.verifyMsgSignalVariant=e;g.makeSignature=k;g.makeSignedPreKey=l;g.signSenderKeyMessage=f;g.serializeSignedPreKeyForPrivateStorage=m;g.deserializeSignedPreKey=n;g.convertPublicKeyHexToUint8Array=o;g.convertPublicKeyToSerializedPubKey=p;g.generateSignedPreKey=q}),98); __d("WASignalWhisperTextProtocol.pb",["WAProtoConst"],(function(a,b,c,d,e,f,g){a={};b={};c={};e={};f={};var h={};a.internalSpec={ratchetKey:[1,(d=d("WAProtoConst")).TYPES.BYTES],counter:[2,d.TYPES.UINT32],previousCounter:[3,d.TYPES.UINT32],ciphertext:[4,d.TYPES.BYTES]};b.internalSpec={registrationId:[5,d.TYPES.UINT32],preKeyId:[1,d.TYPES.UINT32],signedPreKeyId:[6,d.TYPES.UINT32],baseKey:[2,d.TYPES.BYTES],identityKey:[3,d.TYPES.BYTES],message:[4,d.TYPES.BYTES]};c.internalSpec={id:[1,d.TYPES.UINT32],baseKey:[2,d.TYPES.BYTES],ratchetKey:[3,d.TYPES.BYTES],identityKey:[4,d.TYPES.BYTES],baseKeySignature:[5,d.TYPES.BYTES]};e.internalSpec={id:[1,d.TYPES.UINT32],iteration:[2,d.TYPES.UINT32],ciphertext:[3,d.TYPES.BYTES]};f.internalSpec={id:[1,d.TYPES.UINT32],iteration:[2,d.TYPES.UINT32],chainKey:[3,d.TYPES.BYTES],signingKey:[4,d.TYPES.BYTES]};h.internalSpec={generation:[1,d.TYPES.UINT32],signature:[2,d.TYPES.BYTES]};g.SignalMessageSpec=a;g.PreKeySignalMessageSpec=b;g.KeyExchangeMessageSpec=c;g.SenderKeyMessageSpec=e;g.SenderKeyDistributionMessageSpec=f;g.DeviceConsistencyCodeMessageSpec=h}),98); __d("WASignalWhitepaper",["Promise","WABinary","WACryptoDependencies","WASignalGroupSession","WASignalKeys","WASignalOther","WASignalSessions","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=new Uint8Array(32);i.fill(255);var j=new Uint8Array([1]),k=new Uint8Array([2]);function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e,f=a.regId;a=a.staticKeyPair;var g=b.identity,h=b.signedKey.publicKey,j=c.privateKey,k=a.privateKey;e=(e=b.oneTimeKey)==null?void 0:e.publicKey;k=d("WABinary").Binary.build(i,v(k,h),v(j,g),v(j,h),e&&v(j,e)).readByteArray();h=(yield t(k,"WhisperText"));j=h[0];e=h[1];k=b.ratchetKey;h=d("WASignalSessions").makeFreshRecvChain(k,e);e=d("WASignalKeys").makeSerializedKeyPair();j=(yield r(j,e,k));k=d("WASignalSessions").makeInitialExchangeInfo(b.oneTimeKey==null?null:b.oneTimeKey.id,b.signedKey.id,d("WASignalKeys").serializePubKey(c));return d("WASignalSessions").makeFreshSession({regId:f,pubKey:d("WASignalKeys").serializePubKey(a)},{regId:b.regId,pubKey:g},j.rootKey,[h],d("WASignalSessions").makeFreshSendChain(e,j.chainKey),k,d("WASignalKeys").serializePubKey(c))});return l.apply(this,arguments)}function c(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f,g=a.regId;a=a.staticKeyPair;var h=a.privateKey,j=e.signed.privateKey,k=c,l=b.pubKey;f=(f=e.oneTime)==null?void 0:f.privateKey;l=d("WABinary").Binary.build(i,w(l,j),w(k,h),w(k,j),f&&w(k,f)).readByteArray();h=(yield t(l,"WhisperText"));j=h[0];k=h[1];f=e.ratchet;l=d("WASignalSessions").makeFreshSendChain(f,k);return d("WASignalSessions").makeSession({regId:g,pubKey:d("WASignalKeys").serializePubKey(a)},b,j,[],l,null,0,[],c)});return m.apply(this,arguments)}function e(a){a=d("WASignalGroupSession").makeSenderKeyState(d("WASignalKeys").serializePubKey(a),a.privateKey,d("WASignalGroupSession").makeSenderKeyChainKey(0,d("WASignalKeys").makeRawSenderKey()),d("WASignalOther").makeSenderKeyId(),[]);return(h||(h=b("Promise"))).resolve(d("WASignalGroupSession").makeNewSenderKeySession(a))}function f(a,c,e,f,g){e=d("WASignalGroupSession").makeSenderKeyState(e,void 0,d("WASignalGroupSession").makeSenderKeyChainKey(c,f),a,[]);c=null;g?c=d("WASignalGroupSession").updateSessionWithNewSenderKeyState(g,e):c=d("WASignalGroupSession").makeNewSenderKeySession(e);return(h||(h=b("Promise"))).resolve(c)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield d("WASignalOther").makeCryptoKey(c,"hmac-sha256"));c=function(a){return d("WACryptoDependencies").getCrypto().subtle.sign({name:"HMAC",hash:"SHA-256"},e,a)};var f=c(j).then(function(a){return d("WASignalOther").hkdf(new Uint8Array(a),null,"WhisperMessageKeys",80)}).then(function(b){return d("WASignalSessions").splitMsgKey(a,b)});c=c(k).then(function(a){return d("WASignalOther").toBytes(a,32)});return(h||(h=b("Promise"))).all([c,f])});return o.apply(this,arguments)}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield d("WASignalOther").makeCryptoKey(c,"hmac-sha256"));c=function(a){return d("WACryptoDependencies").getCrypto().subtle.sign({name:"HMAC",hash:"SHA-256"},e,a)};var f=c(j).then(function(a){return d("WASignalOther").hkdf(new Uint8Array(a),null,"WhisperGroup",50)}).then(function(b){return d("WASignalGroupSession").makeSenderKeyMsgKey(a,b)});c=c(k).then(function(a){return d("WASignalOther").toBytes(a,32)});return(h||(h=b("Promise"))).all([c,f])});return q.apply(this,arguments)}function r(a,b,c){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=b.privateKey;c=c;b=d("WASignalKeys").ecdh(b,c);c=(yield t(new Uint8Array(b),"WhisperRatchet",a));b=c[0];a=c[1];return{rootKey:b,chainKey:a}});return s.apply(this,arguments)}function t(a,b,c){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=null);a=(yield d("WASignalOther").hkdf(a,c,b,64));return[d("WASignalOther").sliceBytes(a,0,32),d("WASignalOther").sliceBytes(a,32,32)]});return u.apply(this,arguments)}function v(a,b){return new Uint8Array(d("WASignalKeys").ecdh(a,b))}function w(a,b){return v(b,a)}g.initiateSessionOutgoing=a;g.initiateSessionIncoming=c;g.initiateSenderKeySessionOutgoing=e;g.initiateSenderKeySessionIncoming=f;g.deriveMsgKey=n;g.deriveSenderKeyMsgKey=p;g.calculateRatchet=r}),98); __d("WASignalCipher",["Promise","WABinary","WACryptoDependencies","WACryptoLibraryConfig","WACryptoUtils","WALogger","WAResultOrError","WASignalKeys","WASignalOther","WASignalSessions","WASignalSignatures","WASignalWhisperTextProtocol.pb","WASignalWhitepaper","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["decryptMsgFromSession error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["deserializePkMsg error ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["deserializeMsg error ",""]);k=function(){return a};return a}var l=40,m=8,n=2e3;function a(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.sendChain,e=(yield d("WASignalWhitepaper").deriveMsgKey(c.nextMsgIndex,c.chainKey)),f=e[0];e=e[1];var g=(yield B(e)),h=g.cipherKey;g=g.macKey;h=(yield d("WACryptoDependencies").getCrypto().subtle.encrypt({name:"AES-CBC",iv:e.iv},h,b));b=new(d("WABinary").Binary)();b.writeByteArray(a.local.pubKey);b.writeByteArray(a.remote.pubKey);var i=b.size();b.writeUint8(y(d("WASignalSessions").FORMAT_VERSION,d("WASignalSessions").FORMAT_VERSION));d("encodeProtobuf").encodeProtobuf(d("WASignalWhisperTextProtocol.pb").SignalMessageSpec,{ratchetKey:c.ratchetKey.serializedPubKey,counter:e.index,previousCounter:a.prevSendChainHighestIndex,ciphertext:h},b);h=b.readByteArray();b=(yield A(g,h));g=h.subarray(i);h=d("WABinary").Binary.build(g,new Uint8Array(b,0,m)).readByteArray();i=a.initialExchangeInfo;if(i!=null){g=new(d("WABinary").Binary)();g.writeUint8(y(d("WASignalSessions").FORMAT_VERSION,d("WASignalSessions").FORMAT_VERSION));d("encodeProtobuf").encodeProtobuf(d("WASignalWhisperTextProtocol.pb").PreKeySignalMessageSpec,{registrationId:a.local.regId,preKeyId:(b=i.remoteOneTimeId)!=null?b:void 0,signedPreKeyId:i.remoteSignedId,baseKey:i.localOneTimePubKey,identityKey:a.local.pubKey,message:h},g);b="pkmsg";i=g.readByteArray()}else b="msg",i=h;g=d("WASignalSessions").makeSendChain(c.ratchetKey,e.index+1,f);h=d("WASignalSessions").updateChains(a,a.recvChains,g);return[h,{type:b,ciphertext:i}]});return o.apply(this,arguments)}function c(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a==null)return d("WAResultOrError").makeError("errSignalNoSession");var c=(yield t(a,b));if(c.success){var e=c.value,f=e[0];e=e[1];return d("WAResultOrError").makeResult({newSessionInfo:null,updatedSession:f,plaintext:e})}else{f=a.prevSessions;e=c;for(c=0;!e.success&&c<f.length;c++){var g=d("WASignalSessions").parseSession(f[c]),h=(yield t(g,b));if(h.success){h=h.value;var i=h[0];h=h[1];i=d("WASignalSessions").setPrevSessions(i,[d("WASignalSessions").detachSession(a)].concat(f.slice(0,c),f.slice(c+1)));var j=!a||!d("WACryptoUtils").serializedPubKeysEqual(i.remote.pubKey,a.remote.pubKey)?i.remote.pubKey:null;e=d("WAResultOrError").makeResult({newSessionInfo:{newIdentity:j,baseSession:g,usedPreKey:null},updatedSession:i,plaintext:h})}}return e}});return p.apply(this,arguments)}function e(a,b,c){if(a==null)return d("WAResultOrError").makeResult(null);a=a;if(C(a,b))return d("WAResultOrError").makeResult(a);var e=a.prevSessions;for(var f=0;f<e.length;f++){var g=d("WASignalSessions").parseSession(e[f]);if(C(g,b))return c.S508658PreventOldSessionLookupAndPromote===!0?d("WAResultOrError").makeError("errSignalInvalidMsg"):d("WAResultOrError").makeResult(d("WASignalSessions").setPrevSessions(g,[d("WASignalSessions").detachSession(a)].concat(e.slice(0,f),e.slice(f+1))))}return d("WAResultOrError").makeResult(null)}function f(a,b,c,d){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=e.localSignedPreKey;if(f==null)return d("WAResultOrError").makeError("errSignalInvalidSignedPreKey");f=d("WASignalSignatures").deserializeSignedPreKey(f);if(f==null)return d("WAResultOrError").makeError("errSignalSignedPreKeyDeserialization");if(f.id!==c.localSignedPreKeyId)return d("WAResultOrError").makeError("errSignalSignedPreKeyIdMismatch");var g=null;if(c.localOneTimeKeyId!=null){e=e.localOneTimeKey;if(e==null)return d("WAResultOrError").makeError("errSignalInvalidOneTimeKey");g=d("WASignalKeys").deserializePreKey(e);if(g==null)return d("WAResultOrError").makeError("errSignalOneTimeKeyDeserialization");if(g.id!==c.localOneTimeKeyId)return d("WAResultOrError").makeError("errSignalOneTimeKeyMismatch")}a=(yield d("WASignalWhitepaper").initiateSessionIncoming(a,c.remote,c.sessionBaseKey,{signed:f.keyPair,oneTime:(e=g)==null?void 0:e.keyPair,ratchet:d("WASignalKeys").toSerializedKeyPair(f.keyPair)}));g=a.remote.pubKey;e=!b||!d("WACryptoUtils").serializedPubKeysEqual(g,b.remote.pubKey)?g:null;b&&!e&&(a=d("WASignalSessions").setPrevSessions(a,[d("WASignalSessions").detachSession(b)].concat(b.prevSessions.slice(0,l-1))));f=(yield t(a,c));if(!f.success)return f;g=f.value;b=g[0];c=g[1];return d("WAResultOrError").makeResult({newIdentity:e,baseSession:a,updatedSession:b,plaintext:c})});return q.apply(this,arguments)}function r(a){var b,c,e=null;try{var f=x(a,d("WASignalSessions").FORMAT_VERSION,m);if(!f.success)return f;f=d("decodeProtobuf").decodeProtobuf(d("WASignalWhisperTextProtocol.pb").SignalMessageSpec,f.value);var g=f.ratchetKey;e=f.counter;c=f.ciphertext;if(g==null||e==null||c==null)return d("WAResultOrError").makeError("errSignalDeserializeInvalidProtoFormat");b=d("WASignalKeys").castToSerializedPubKey(new Uint8Array(g))}catch(a){d("WALogger").DEV(k(),a);return d("WAResultOrError").makeError("errSignalDeserializeRatchetKeyBadFormat")}f={ratchetPubKey:b,counter:e,ciphertext:new Uint8Array(c),versionContentMac:a};return d("WAResultOrError").makeResult(f)}function s(a){a=x(a,d("WASignalSessions").FORMAT_VERSION,0);if(!a.success)return a;var b,c,e,f,g;try{a=d("decodeProtobuf").decodeProtobuf(d("WASignalWhisperTextProtocol.pb").PreKeySignalMessageSpec,a.value);var h=a.registrationId,i=a.preKeyId,k=a.signedPreKeyId,l=a.baseKey,m=a.identityKey;a=a.message;if(h==null||k==null||l==null||m==null||a==null)return d("WAResultOrError").makeError("errSignalDeserializePkInvalidProtoFormat");f=d("WASignalKeys").castToSerializedPubKey(new Uint8Array(l));b={regId:d("WASignalOther").castRegistrationId(h),pubKey:d("WASignalKeys").castToSerializedPubKey(new Uint8Array(m))};e=i!=null?d("WASignalKeys").castToPreKeyId(i):null;c=d("WASignalKeys").castToSignedPreKeyId(k);g=new Uint8Array(a)}catch(a){d("WALogger").DEV(j(),a);return d("WAResultOrError").makeError("errSignalDeserializePkKeyBadFormat")}l=r(g);return!l.success?l:d("WAResultOrError").makeResult(babelHelpers["extends"]({},l.value,{remote:b,sessionBaseKey:f,localSignedPreKeyId:c,localOneTimeKeyId:e}))}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.ratchetPubKey,e=b.counter,f=b.ciphertext;b=b.versionContentMac;var g=a.recvChains,h=a.recvChains.findIndex(function(a){return d("WACryptoUtils").serializedPubKeysEqual(a.ratchetPubKey,c)});if(h===-1){var j=(yield d("WASignalWhitepaper").calculateRatchet(a.rootKey,a.sendChain.ratchetKey,c)),k=d("WASignalSessions").makeFreshRecvChain(c,j.chainKey);k=(yield v(k,e));if(!k.success)return k;k=k.value;var l=d("WASignalKeys").makeSerializedKeyPair();j=(yield d("WASignalWhitepaper").calculateRatchet(j.rootKey,l,c));var n=g.slice(-4);n.push(k.updatedChain);k=k.msgKey;n=d("WASignalSessions").ratchetSession(a,n,d("WASignalSessions").makeFreshSendChain(l,j.chainKey),j.rootKey)}else{l=(yield v(g[h],e));if(!l.success)return l;j=l.value;e=g.slice();e[h]=j.updatedChain;k=j.msgKey;n=d("WASignalSessions").updateChains(a,e,a.sendChain)}l=(yield B(k));g=l.cipherKey;j=l.macKey;e=d("WABinary").Binary.build(a.remote.pubKey,a.local.pubKey,b.subarray(0,-m)).readByteArray();l=(yield A(j,e));a=b.subarray(-m);j=!d("WACryptoUtils").uint8ArraysEqual(new Uint8Array(l,0,m),a);e=null;try{e=(yield d("WACryptoDependencies").getCrypto().subtle.decrypt({name:"AES-CBC",iv:k.iv},g,f))}catch(a){d("WALogger").DEV(i(),a)}if(j&&e==null)return h===-1?d("WAResultOrError").makeError("errInvalidMacInvalidCipherKeyNewChain"):d("WAResultOrError").makeError("errInvalidMacInvalidCipherKey");if(j)return d("WAResultOrError").makeError("errInvalidMacWithDecryptedPlaintext");return e==null?d("WAResultOrError").makeError("errUnknownInvalidCipherKey"):d("WAResultOrError").makeResult([n,e])});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b-a.nextMsgIndex,e=d("WACryptoLibraryConfig").getCryptoLibraryConfig().signalFutureMessagesMax;if(c>e)return d("WAResultOrError").makeError("errSignalTooManyMessagesInFuture");e=a.unusedMsgKeys;if(c<0){var f=e.findIndex(function(a){return a.index===b});return f===-1?d("WAResultOrError").makeError("errDuplicateMsg"):d("WAResultOrError").makeResult({msgKey:e[f],updatedChain:d("WASignalSessions").makeRecvChain(a.ratchetPubKey,a.nextMsgIndex,a.chainKey,z(e,f))})}f=a.nextMsgIndex;var g=(yield d("WASignalWhitepaper").deriveMsgKey(f,a.chainKey)),h=g[0];g=g[1];var i=null;if(c>0){c=c+e.length-n;c>0?(i=e.slice(c),c-=e.length):i=e.slice();for(f=f+1;f<=b;f++){c>0?c--:i.push(g);var j=(yield d("WASignalWhitepaper").deriveMsgKey(f,h));h=j[0];g=j[1]}}return d("WAResultOrError").makeResult({msgKey:g,updatedChain:d("WASignalSessions").makeRecvChain(a.ratchetPubKey,b+1,h,i||e)})});return w.apply(this,arguments)}function x(a,b,c){if(a.length<1)return d("WAResultOrError").makeError("errSignalEmptyVersionContentSuffix");var e=a[0]>>>4;if(e!==b)return e<b?d("WAResultOrError").makeError("errSignalLegacyMsg"):d("WAResultOrError").makeError("errSignalInvalidVersion");e=a.length-c;return e<1?d("WAResultOrError").makeError("errSignalContentExceededExpectedLength"):d("WAResultOrError").makeResult(a.subarray(1,e))}function y(a,b){return(a<<4|b)&255}function z(a,b){var c=[];for(var d=0;d<a.length;d++)d!==b&&c.push(a[d]);return c}function A(a,b){return d("WACryptoDependencies").getCrypto().subtle.sign(d("WASignalOther").HMAC_SHA256,a,b)}function B(a){return(h||(h=b("Promise"))).all([d("WASignalOther").makeCryptoKey(a.cipherKey,"aes-cbc"),d("WASignalOther").makeCryptoKey(a.macKey,"hmac-sha256")]).then(function(a){var b=a[0];a=a[1];return{cipherKey:b,macKey:a}})}function C(a,b){a=a.aliceBaseKey;return!a?!1:d("WACryptoUtils").serializedPubKeysEqual(a,b)}g.MAX_UNUSED_KEYS=n;g.encryptMsg=a;g.decryptMsg=c;g.findMatchingSession=e;g.decryptPkMsgWithNewSession=f;g.deserializeMsg=r;g.deserializePkMsg=s;g.decryptMsgFromSession=t;g.readContent=x;g.versionByte=y}),98); __d("WASignalGroupCipher",["WABinary","WACryptoDependencies","WACryptoLibraryConfig","WALogger","WAResultOrError","WASignalCipher","WASignalGroupSession","WASignalKeys","WASignalOther","WASignalSessions","WASignalSignatures","WASignalWhisperTextProtocol.pb","WASignalWhitepaper","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Exception caught during SenderKeyMessageSpec Proto: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["deserializeSenderKeyDistributionMsg error ",""]);i=function(){return a};return a}var j=64;function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=n(a);if(!a.success)return a;a=a.value;var c=a.senderKeyId,e=a.iteration,f=a.signingKeyPublic;a=a.chainKey;c=(yield d("WASignalWhitepaper").initiateSenderKeySessionIncoming(c,e,f,a,b));return d("WAResultOrError").makeResult(c)});return k.apply(this,arguments)}function c(a){a=d("WASignalGroupSession").serializeSenderKeyState(a);var b=new(d("WABinary").Binary)();b.writeUint8(d("WASignalCipher").versionByte(d("WASignalGroupSession").FORMAT_VERSION,d("WASignalGroupSession").FORMAT_VERSION));d("encodeProtobuf").encodeProtobuf(d("WASignalWhisperTextProtocol.pb").SenderKeyDistributionMessageSpec,{id:a.senderKeyId,iteration:d("WASignalSessions").definedOrThrow(a.senderChainKey,"senderChainKey").iteration,chainKey:d("WASignalSessions").definedOrThrow(a.senderChainKey,"senderChainKey").seed,signingKey:d("WASignalSessions").definedOrThrow(a.senderSigningKey,"senderSigningKey")["public"]},b);return b.readByteArray()}function e(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!a.senderKeyStates||a.senderKeyStates.length===0)return d("WAResultOrError").makeError("errSignalNoSession");var c=a.senderKeyStates[a.senderKeyStates.length-1],e=(yield d("WASignalWhitepaper").deriveSenderKeyMsgKey(c.senderKeyChainKey.nextMsgIndex,c.senderKeyChainKey.chainKey)),f=e[0];e=e[1];var g=(yield p(e.seed)),h=g[0];g=g[1];g=(yield d("WACryptoDependencies").getCrypto().subtle.encrypt({name:"AES-CBC",iv:g},h,b));h=new(d("WABinary").Binary)();d("encodeProtobuf").encodeProtobuf(d("WASignalWhisperTextProtocol.pb").SenderKeyMessageSpec,{id:c.senderKeyId,iteration:e.iteration,ciphertext:g},h);b=new(d("WABinary").Binary)();b.writeUint8(d("WASignalCipher").versionByte(d("WASignalGroupSession").FORMAT_VERSION,d("WASignalGroupSession").FORMAT_VERSION));b.writeBinary(h);g=d("WASignalKeys").makeKeyPairFromSerialized(d("WASignalSessions").definedOrThrow(c.senderSigningKeyPrivate,"senderSigningKeyPrivate"),c.senderSigningKeyPublic);g=d("WASignalSignatures").signSenderKeyMessage(g,b.readByteArray());b=new(d("WABinary").Binary)();b.writeUint8(d("WASignalCipher").versionByte(d("WASignalGroupSession").FORMAT_VERSION,d("WASignalGroupSession").FORMAT_VERSION));b.writeBinary(h);b.writeByteArray(g);h=d("WASignalGroupSession").makeSenderKeyChainKey(e.iteration+1,f);g=d("WASignalGroupSession").updateSessionWithUpdatedSenderKeyState(a,d("WASignalGroupSession").makeSenderKeyState(c.senderSigningKeyPublic,c.senderSigningKeyPrivate,h,c.senderKeyId,c.unusedMsgKeys));return d("WAResultOrError").makeResult([g,b.readByteArray()])});return l.apply(this,arguments)}function f(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.senderKeyMessageId,e=b.iteration,f=b.ciphertext;b=b.versionContentMac;c=d("WASignalGroupSession").findSenderKeyState(a,c);if(c==null)return d("WAResultOrError").makeError("errSignalNoSession");var g=c.senderSigningKeyPublic;b=r(b,g);if(!b)return d("WAResultOrError").makeError("errSignalInvalidKey");g=(yield s(c,e));if(!g.success)return g;b=g.value;c=b.msgKey;e=d("WASignalGroupSession").updateSessionWithUpdatedSenderKeyState(a,b.updatedSenderKeyState);g=(yield p(c.seed));a=g[0];b=g[1];c=(yield d("WACryptoDependencies").getCrypto().subtle.decrypt({name:"AES-CBC",iv:b},a,f));return d("WAResultOrError").makeResult([e,c])});return m.apply(this,arguments)}function n(a){var b,c,e,f;try{a=d("WASignalCipher").readContent(a,d("WASignalGroupSession").FORMAT_VERSION,0);if(!a.success)return a;a=d("decodeProtobuf").decodeProtobuf(d("WASignalWhisperTextProtocol.pb").SenderKeyDistributionMessageSpec,a.value);b=a.id;c=a.iteration;var g=d("WASignalSessions").bytesOrThrow(a.signingKey,33,"signingKey");e=d("WASignalKeys").castToSerializedPubKey(g);f=d("WASignalSessions").bytesOrThrow(a.chainKey,32,"chainKey");if(b==null||c==null)return d("WAResultOrError").makeError("errSignalGrpInvalidProtoFormat")}catch(a){d("WALogger").DEV(i(),a);return d("WAResultOrError").makeError("errSignalGrpInvalidKeyFormat")}return d("WAResultOrError").makeResult({senderKeyId:b,iteration:c,signingKeyPublic:e,chainKey:f})}function o(a){if(a.length<1)return d("WAResultOrError").makeError("errSignalGrpVersionContentEmpty");var b=a[0]>>>4;if(b!==d("WASignalGroupSession").FORMAT_VERSION)return b<d("WASignalGroupSession").FORMAT_VERSION?d("WAResultOrError").makeError("errSignalLegacyMsg"):d("WAResultOrError").makeError("errSignalInvalidVersion");if(a.length<1+j)return d("WAResultOrError").makeError("errSignalGrpInvalidVersionContentLength");var c,e,f;try{b=a.subarray(1,-j);b=d("decodeProtobuf").decodeProtobuf(d("WASignalWhisperTextProtocol.pb").SenderKeyMessageSpec,b);c=b.id;e=b.iteration;f=b.ciphertext;if(c==null||e==null||f==null)return d("WAResultOrError").makeError("errSignalGrpSenderKeyInvalidProtoFormat")}catch(a){d("WALogger").ERROR(h(),a);return d("WAResultOrError").makeError("errSignalGrpSenderKeyProtoError")}return d("WAResultOrError").makeResult({senderKeyMessageId:c,iteration:e,ciphertext:new Uint8Array(f),versionContentMac:a})}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=new(d("WABinary").Binary)(a);var b=d("WASignalOther").readBytes(a,16);a=d("WASignalOther").readBytes(a,32);return[yield d("WASignalOther").makeCryptoKey(a,"aes-cbc"),b]});return q.apply(this,arguments)}function r(a,b){var c=a.subarray(a.length-j);a=a.subarray(0,a.length-j);return d("WASignalSignatures").verifyMsgSignalVariant(b,a,d("WASignalOther").toBytes(d("WASignalOther").toBuffer(c),64))}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a,e=b-c.senderKeyChainKey.nextMsgIndex,f=d("WACryptoLibraryConfig").getCryptoLibraryConfig().signalFutureMessagesMax;if(e>f)return d("WAResultOrError").makeError("errSignalGrpTooManyMessagesInFuture");f=a.unusedMsgKeys||[];if(e<0){var g=f.findIndex(function(a){return a.iteration===b});return g===-1?d("WAResultOrError").makeError("errDuplicateMsg"):d("WAResultOrError").makeResult({msgKey:f[g],updatedSenderKeyState:d("WASignalGroupSession").makeSenderKeyState(c.senderSigningKeyPublic,c.senderSigningKeyPrivate,c.senderKeyChainKey,c.senderKeyId,u(f,g))})}g=c.senderKeyChainKey.nextMsgIndex;var h=(yield d("WASignalWhitepaper").deriveSenderKeyMsgKey(g,c.senderKeyChainKey.chainKey)),i=h[0];h=h[1];var j=null;if(e>0){e=e+f.length-d("WASignalCipher").MAX_UNUSED_KEYS;e>0?(j=f.slice(e),e-=f.length):j=f.slice();for(g=g+1;g<=b;g++){e>0?e--:j.push(h);var k=(yield d("WASignalWhitepaper").deriveSenderKeyMsgKey(g,i));i=k[0];h=k[1]}}return d("WAResultOrError").makeResult({msgKey:h,updatedSenderKeyState:d("WASignalGroupSession").makeSenderKeyState(c.senderSigningKeyPublic,c.senderSigningKeyPrivate,d("WASignalGroupSession").makeSenderKeyChainKey(b+1,i),a.senderKeyId,j||f)})});return t.apply(this,arguments)}function u(a,b){var c=[];for(var d=0;d<a.length;d++)d!==b&&c.push(a[d]);return c}g.processSenderKeyDistributionMsg=a;g.createSenderKeyDistributionProto=c;g.encryptSenderKeyMsgWithSession=e;g.decryptSenderKeyMsgFromSession=f;g.deserializeSenderKeyMsg=o}),98); __d("WACryptoLibrary",["WACryptoUtils","WAJids","WALockMap","WALogger","WAResultOrError","WASignalCipher","WASignalGroupCipher","WASignalGroupSession","WASignalKeys","WASignalOther","WASignalSignatures","WASignalWhitepaper","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getSessionForRecipient pkmsg signature verification result: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WACryptoLibrary] Unable to load sender key session for group during decryptGroupContent: ",", author: ",""]);i=function(){return a};return a}var j=d("WALockMap").makeLockMap(60*1e3),k=[],l=300;function m(a){k.push(a),k.length>=l&&k.shift()}function a(a){a(k),k=[]}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){m("createOutgoingSession");b=y(b);var c=b.signedKey;c=(yield d("WASignalSignatures").verifyMsgSignalVariant(b.identity,c.publicKey,c.signature));d("WALogger").DEV(h(),c);if(!c){m("createOutgoingSession: errSignalInvalidKey");return d("WAResultOrError").makeError("errSignalInvalidKey")}c=(yield d("WASignalWhitepaper").initiateSessionOutgoing(a,b,d("WASignalKeys").makeKeyPair()));return d("WAResultOrError").makeResult(c)});return o.apply(this,arguments)}function c(a,b,c,d,e){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d,e){a=a.handleNewSession;m("establishOutgoingSession");b=(yield n(b,d));if(!b.success)return b;d=b.value;return a(c,d,d.remote.pubKey,null,e)});return p.apply(this,arguments)}function e(a,c,e,f){var g=a.loadSession,h=a.handleNewSession;m("encryptContent");return j.lock([d("WAJids").extractUserJid(c)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=null;do{var b=(yield g(c,"cryptoLibraryEncryptContent"));if(b==null){m("encryptContent: errSignalInvalidKey");return d("WAResultOrError").makeError("errSignalInvalidKey")}if(f!=null&&!d("WACryptoUtils").uint8ArraysEqual(f,b.remote.pubKey)){m("encryptContent: identity-mismatch");return d("WAResultOrError").makeError("identity-mismatch")}b=(yield d("WASignalCipher").encryptMsg(b,e));var i=b[0];b=b[1];var j=(yield h(c,i,i.remote.pubKey));j.success?a=d("WAResultOrError").makeResult(babelHelpers["extends"]({},b,{baseKey:i.aliceBaseKey})):j.error}while(a==null);return a}))}function f(a,c,e,f,g,h){var i=a.loadSession,k=a.handleNewSession,l=a.loadSignedPreKey,n=a.loadOneTimePreKey;m("decryptContent");return j.lock([d("WAJids").extractUserJid(e)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=!1,b=(yield i(e,"decryptContent"));if(f.type==="pkmsg"){var j=d("WASignalCipher").deserializePkMsg(f.ciphertext);if(!j.success){m("decryptContent: errCryptoDeserialization");return d("WAResultOrError").makeError("errCryptoDeserialization")}j=j.value;j=(yield q({loadSignedPreKey:l,loadOneTimePreKey:n},c,j,b,h));if(!j.success)return j;j=j.value}else{f.type;var o=d("WASignalCipher").deserializeMsg(f.ciphertext);if(!o.success){m("decryptContent: errCryptoDeserialization");return d("WAResultOrError").makeError("errCryptoDeserialization")}o=o.value;b=(yield d("WASignalCipher").decryptMsg(b,o));if(!b.success)return b;j=b.value}o=j;b=o.newSessionInfo;b&&(b.newIdentity!=null||b.usedPreKey!=null)&&(yield k(e,b.baseSession,b.newIdentity,b.usedPreKey));if(!a){o=b==null?void 0:b.baseSession.remote.pubKey;yield g(new Uint8Array(j.plaintext),o);a=!0}yield k(e,j.updatedSession,j.updatedSession.remote.pubKey);return d("WAResultOrError").makeResult()}))}function q(a,b,c,d,e){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){var g=a.loadSignedPreKey;a=a.loadOneTimePreKey;m("decryptPkMsg");f=d("WASignalCipher").findMatchingSession(e,c.sessionBaseKey,f);if(!f.success)return f;f=f.value;if(f){f=(yield d("WASignalCipher").decryptMsgFromSession(f,c));if(!f.success)return f;f=f.value;var h=f[0];f=f[1];return d("WAResultOrError").makeResult({newSessionInfo:null,updatedSession:h,plaintext:f})}else{h=c.localOneTimeKeyId;f=(yield g(c.localSignedPreKeyId));g=h==null?null:yield a(h);a=(yield d("WASignalCipher").decryptPkMsgWithNewSession(b,e,c,{localSignedPreKey:f,localOneTimeKey:g}));if(!a.success)return a;b=a.value;e=b.newIdentity;c=b.baseSession;f=b.updatedSession;g=b.plaintext;return d("WAResultOrError").makeResult({newSessionInfo:{newIdentity:e,baseSession:c,usedPreKey:h},updatedSession:f,plaintext:g})}});return r.apply(this,arguments)}function s(c,e,f,g){var h=c.loadSenderKeySession,a=c.saveSenderKeySession;m("encryptGroupContent");return j.lock([e,d("WAJids").extractUserJid(f)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){do{var b=(yield h(e,f));if(!b.success)return d("WAResultOrError").makeError(b.error);b=b.value;var c=(yield d("WASignalGroupCipher").encryptSenderKeyMsgWithSession(b,g));if(c.success){c=c.value;var i=c[0];c=c[1];yield a(e,f,i);i=b.senderKeyStates[b.senderKeyStates.length-1];b=d("WAResultOrError").makeResult({ciphertext:{ciphertext:c,type:"skmsg"},senderKeyId:i.senderKeyId,senderKeyDistributionProto:d("WASignalGroupCipher").createSenderKeyDistributionProto(d("WASignalGroupSession").convertFromRawToSenderKeyState(i))})}else{m("encryptGroupContent: sender-key-no-session");return d("WAResultOrError").makeError("sender-key-no-session")}}while(b==null);return b}))}function t(c,e,f,g,h){var k=c.loadSenderKeySession,a=c.saveSenderKeySession;m("decryptGroupContent");return j.lock([e,d("WAJids").extractUserJid(f)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=!1,c=(yield k(e,f));if(!c.success){d("WALogger").WARN(i(),e,f);return d("WAResultOrError").makeError(c.error)}var j=d("WASignalGroupCipher").deserializeSenderKeyMsg(g);if(!j.success){m("decryptGroupContent: errCryptoDeserialization");return d("WAResultOrError").makeError("errCryptoDeserialization")}c=c.value;c=(yield d("WASignalGroupCipher").decryptSenderKeyMsgFromSession(c,j.value));if(!c.success)return c;j=c.value;c=j[0];j=j[1];b||(yield h(new Uint8Array(j)),b=!0);yield a(e,f,c);return d("WAResultOrError").makeResult()}))}function u(c,e,f,g){var h=c.loadSenderKeySession,a=c.saveSenderKeySession;m("saveSenderKeySession");return j.lock([e,d("WAJids").extractUserJid(f)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=null;if(h){var c=(yield h(e,f));b=c.success?c.value:null}c=(yield d("WASignalGroupCipher").processSenderKeyDistributionMsg(g,b));if(!c.success)return c;b=c.value;yield a(e,f,b);return d("WAResultOrError").makeResult()}))}function v(c,e,f,g){var a=c.saveSenderKeySession;m("rotateGroupSenderKey");return j.lock([e,d("WAJids").extractUserJid(f)],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WASignalWhitepaper").initiateSenderKeySessionOutgoing(g)),c=b.senderKeyStates[0].senderKeyId;yield a(e,f,b);return{senderKeyId:c}}))}function w(a,b,c){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=a.loadSenderKeySession;a=a.saveSenderKeySession;m("createSenderKeyDistributionMsg");var f=(yield e(b,c)),g=f.error;if(!f.success&&g==="errLoadSenderKeySession"){g=(yield d("WASignalKeys").makeKeyPair());yield v({saveSenderKeySession:a},b,c,g);f=(yield e(b,c))}if(f.success){a=f.value.senderKeyStates.slice(-1);if(a.length>0)return d("WAResultOrError").makeResult(d("WASignalGroupCipher").createSenderKeyDistributionProto(d("WASignalGroupSession").convertFromRawToSenderKeyState(a[0])))}m("createSenderKeyDistributionMsg: errGetSenderKeyProto");return d("WAResultOrError").makeError("errGetSenderKeyProto")});return x.apply(this,arguments)}function y(a){var b=a.regId,c=a.identity,e=a.signedKey;a=a.oneTimeKey;m("sanitizeInitialSessionInfo");var f=d("WASignalKeys").castToSerializedPubKey(e.publicKey);return{regId:d("WASignalOther").castRegistrationId(b),identity:d("WASignalKeys").castToSerializedPubKey(c),signedKey:{id:d("WASignalKeys").castToSignedPreKeyId(e.id),publicKey:f,signature:d("WASignalOther").ensureSize(e.signature,64)},oneTimeKey:a&&{id:d("WASignalKeys").castToPreKeyId(a.id),publicKey:d("WASignalKeys").castToSerializedPubKey(a.publicKey)},ratchetKey:f}}g.publishLogs=a;g.createOutgoingSession=n;g.establishOutgoingSession=c;g.encryptContent=e;g.decryptContent=f;g.encryptGroupContent=s;g.decryptGroupContent=t;g.saveSenderKeySession=u;g.rotateGroupSenderKey=v;g.createSenderKeyDistributionMsg=w}),98); __d("WAWebCryptoLibrary",["Promise","WAByteArray","WACryptoLibrary","WAJids","WALogger","WASignalKeys","WAWebBackendJobs.flow","WAWebCryptoLibraryDbCallbacksApi","WAWebCryptoLibraryUtilsApi","WAWebSignalCommonErrors","WAWebWidToJid","asyncToGeneratorRuntime","err","justknobx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::getGroupSenderKeyInfo failed with error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::getGroupSenderKeyInfo"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::encryptGroupMessage failed with error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::encryptGroupMessage no sender key, generating a new one"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptSignalProto failed to decrypt: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptMessage failed with error ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptSignalProto"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::createSignalSession failed with error ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::createSignalSession"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptGroupSignalProto failed to decrypt: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptGroupMessage failed ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::decryptGroupSignalProto"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::processSenderKeyDistributionMsg failed with error ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::processSenderKeyDistributionMsg"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::encryptSignalProto:failed with error ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::encryptSignalProto"]);x=function(){return a};return a}var y=d("WAWebCryptoLibraryDbCallbacksApi").getCryptoDbCallbacks();function z(){var a;return{establishOutgoingSession:(a=d("WACryptoLibrary")).establishOutgoingSession,decryptContent:a.decryptContent,encryptContent:a.encryptContent,encryptGroupContent:a.encryptGroupContent,decryptGroupContent:a.decryptGroupContent,saveSenderKeySession:a.saveSenderKeySession,rotateGroupSenderKey:a.rotateGroupSenderKey}}function a(a,b,c){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){d("WALogger").LOG(q());var f=(yield y.getRegistrationInfo());if(!f)throw c("err")("No registration info found");return z().establishOutgoingSession({handleNewSession:e?y.handleNewSessionDeprecatedLid:y.handleNewSession},f,d("WAWebWidToJid").widToDeviceJid(a),b,void 0).then(function(a){if(!a.success){d("WALogger").WARN(p(),a.error);throw c("err")(a.error)}})});return A.apply(this,arguments)}function e(a,b,c,d){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){d("WALogger").LOG(o());e=e===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg?"pkmsg":"msg";var i,j=(yield y.getRegistrationInfo());return!j?(h||(h=b("Promise"))).reject(c("err")("No registration info found")):z().decryptContent({handleNewSession:g?y.handleNewSessionDeprecatedLid:y.handleNewSession,loadOneTimePreKey:y.loadOneTimePreKey,loadSession:g?y.loadSessionDeprecatedLid:y.loadSession,loadSignedPreKey:y.loadSignedPreKey},j,d("WAWebWidToJid").widToDeviceJid(a),{ciphertext:f,type:e},function(a){i=d("WAByteArray").uint8ArrayToBuffer(a);return(h||(h=b("Promise"))).resolve()},{S508658PreventOldSessionLookupAndPromote:c("justknobx")._("4176")}).then(function(a){if(a.success){if(i==null)throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)("Null result on successful decryption");return i}a=a.error;d("WALogger").WARN(n(),a);if(a==="errDuplicateMsg")throw new(d("WAWebSignalCommonErrors").SignalMessageCounterError)(a);else throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)(a)})["catch"](function(a){if(a instanceof d("WAWebSignalCommonErrors").SignalDecryptionError||a instanceof d("WAWebSignalCommonErrors").SignalMessageCounterError)throw a;d("WALogger").ERROR(m(),a.stack);throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)("Unexpected decryption error")})});return B.apply(this,arguments)}function f(a,b,e){d("WALogger").LOG(x());return z().encryptContent({handleNewSession:e?y.handleNewSessionDeprecatedLid:y.handleNewSession,loadSession:e?y.loadSessionDeprecatedLid:y.loadSession},d("WAWebWidToJid").widToDeviceJid(a),b,null).then(function(a){if(a.success){var b=a.value,e=b.type;b=b.ciphertext;return{type:(e=d("WAWebBackendJobs.flow").CiphertextType.cast(e))!=null?e:d("WAWebBackendJobs.flow").CiphertextType.Msg,ciphertext:d("WAByteArray").uint8ArrayToBuffer(b)}}d("WALogger").WARN(w(),a.error);throw c("err")(a.error)})}function C(a,b){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WAWebWidToJid").widToDeviceJid(a);b=b?yield y.loadSessionDeprecatedLid(a):yield y.loadSession(a);return b==null?void 0:b.remote});return D.apply(this,arguments)}function E(a,b,c,d){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){var g;a=d("WAWebWidToJid").widToMulticastJid(a);g=(g=d("WAJids").validateGroupJid(a))!=null?g:d("WAJids").validateStatusJid(a);if(g==null)throw c("err")("Broadcast JIDs are not supported by WACryptoManager yet.");a=d("WAWebWidToJid").widToDeviceJid(b);b=(yield z().encryptGroupContent({loadSenderKeySession:f?y.loadSenderKeySessionDeprecatedLid:y.loadSenderKeySession,saveSenderKeySession:f?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession},g,a,e));if(!b.success&&b.error==="errLoadSenderKeySession"){b.error;d("WALogger").LOG(l());var h=(yield d("WASignalKeys").makeKeyPair());yield z().rotateGroupSenderKey({saveSenderKeySession:f?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession},g,a,h);b=(yield z().encryptGroupContent({loadSenderKeySession:f?y.loadSenderKeySessionDeprecatedLid:y.loadSenderKeySession,saveSenderKeySession:f?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession},g,a,e))}if(b.success){h=b.value.ciphertext.ciphertext;f=b.value.senderKeyDistributionProto;return{ciphertext:d("WAByteArray").uint8ArrayToBuffer(h),senderKeyBytes:d("WAByteArray").uint8ArrayToBuffer(f)}}d("WALogger").WARN(k(),b.error);throw c("err")(b.error)});return F.apply(this,arguments)}function G(a,b,e,f){d("WALogger").LOG(v());return z().saveSenderKeySession({loadSenderKeySession:f?y.loadSenderKeySessionDeprecatedLid:y.loadSenderKeySession,saveSenderKeySession:f?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession},a,d("WAWebWidToJid").widToDeviceJid(b),new Uint8Array(e)).then(function(a){if(!a.success){d("WALogger").WARN(u(),a.error);throw c("err")(a.error)}})}function H(a,c,e,f){d("WALogger").LOG(t());var g=null;return z().decryptGroupContent({loadSenderKeySession:f?y.loadSenderKeySessionDeprecatedLid:y.loadSenderKeySession,saveSenderKeySession:f?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession},d("WAWebWidToJid").widToMulticastJid(a),d("WAWebWidToJid").widToDeviceJid(c),e,function(a){g=d("WAByteArray").uint8ArrayToBuffer(a);return(h||(h=b("Promise"))).resolve()}).then(function(a){if(a.success){if(g==null)throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)("Null result on successful decryption of group msg");return g}a=a.error;d("WALogger").WARN(s(),a);if(a==="errDuplicateMsg")throw new(d("WAWebSignalCommonErrors").SignalMessageCounterError)(a);else throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)(a)})["catch"](function(a){if(a instanceof d("WAWebSignalCommonErrors").SignalDecryptionError||a instanceof d("WAWebSignalCommonErrors").SignalMessageCounterError)throw a;d("WALogger").ERROR(r(),a);throw new(d("WAWebSignalCommonErrors").SignalDecryptionError)("Unexpected decryption error")})}function I(a,b,c){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){d("WALogger").LOG(j());e=(yield c("WAWebCryptoLibraryUtilsApi").createSenderKeyDistributionMsg(e?y.loadSenderKeySessionDeprecatedLid:y.loadSenderKeySession,e?y.saveSenderKeySessionDeprecatedLid:y.saveSenderKeySession,d("WAJids").toGroupJid(a.toString({legacy:!0})),d("WAWebWidToJid").widToDeviceJid(b)));if(e.success)return d("WAByteArray").uint8ArrayToBuffer(e.value);d("WALogger").WARN(i(),e.error);throw c("err")(e.error)});return J.apply(this,arguments)}g.getCryptoLibModule=z;g.createSignalSession=a;g.decryptSignalProto=e;g.encryptSignalProto=f;g.getRemoteRegId=C;g.encryptSenderKeyMsgSignalProto=E;g.processSenderKeyDistributionMsg=G;g.decryptGroupSignalProto=H;g.getGroupSenderKeyInfo=I}),98); __d("WAWebCryptoLibraryDbCallbacksApi",["Promise","WAByteArray","WAResultOrError","WASignalKeys","WASignalLocalStorageProtocol.pb","WASignalOther","WAWebApiContact","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=!1,j=!0;function a(){var a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebWidFactory").createDeviceWid(a);d("WAWebApiContact").checkPnToLidMapping([a],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_CRYPTO_LIBRARY_DB_CALLBACK_API_LOAD_SESSION);a=d("WAWebSignalCommonUtils").createSignalAddress(a,i);a=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSession(a));return(a=a)!=null?a:null});return function(b){return a.apply(this,arguments)}}(),c=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){g=d("WAWebWidFactory").createDeviceWid(a);d("WAWebApiContact").checkPnToLidMapping([g],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_CRYPTO_LIBRARY_DB_CALLBACK_API_HANDLE_NEW_SESSION);a=d("WAWebSignalCommonUtils").createSignalAddress(g,i);g=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(g);return(h||(h=b("Promise"))).all([d("WAWebSignalProtocolStore").getSignalProtocolStore().storeSession(a,c),e&&d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(g,d("WAByteArray").uint8ArrayToBuffer(e)),f!=null&&d("WAWebSignalProtocolStore").getSignalProtocolStore().removePreKey(f)]).then(function(){return d("WAResultOrError").makeResult()})});return function(b,c,d,e,f){return a.apply(this,arguments)}}(),e=function(a,b){b=d("WAWebWidFactory").createDeviceWid(b);d("WAWebApiContact").checkPnToLidMapping([b],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_CRYPTO_LIBRARY_DB_CALLBACK_API_LOAD_SENDER_KEY_SESSION);a=d("WAWebSignalCommonUtils").createSignalLikeSenderKeyName(a,b,i);return d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSenderKey(a).then(function(a){if(a==null)return d("WAResultOrError").makeError("errLoadSenderKeySession");a=a;return d("WAResultOrError").makeResult(a)})},f=function(a,b,c){b=d("WAWebWidFactory").createDeviceWid(b);d("WAWebApiContact").checkPnToLidMapping([b],d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_CRYPTO_LIBRARY_DB_CALLBACK_API_SAVE_SENDER_KEY_SESSION);a=d("WAWebSignalCommonUtils").createSignalLikeSenderKeyName(a,b,i);return d("WAWebSignalProtocolStore").getSignalProtocolStore().storeSenderKey(a,c)},g=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebSignalCommonUtils").createSignalAddress(d("WAWebWidFactory").createDeviceWid(a),j);a=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSession(a));return(a=a)!=null?a:null});return function(b){return a.apply(this,arguments)}}(),k=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){g=d("WAWebWidFactory").createDeviceWid(a);a=d("WAWebSignalCommonUtils").createSignalAddress(g,j);g=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(g);return(h||(h=b("Promise"))).all([d("WAWebSignalProtocolStore").getSignalProtocolStore().storeSession(a,c),e&&d("WAWebSignalProtocolStore").getSignalProtocolStore().saveIdentity(g,d("WAByteArray").uint8ArrayToBuffer(e)),f!=null&&d("WAWebSignalProtocolStore").getSignalProtocolStore().removePreKey(f)]).then(function(){return d("WAResultOrError").makeResult()})});return function(b,c,d,e,f){return a.apply(this,arguments)}}(),l=function(a,b){a=d("WAWebSignalCommonUtils").createSignalLikeSenderKeyName(a,d("WAWebWidFactory").createDeviceWid(b),j);return d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSenderKey(a).then(function(a){if(a==null)return d("WAResultOrError").makeError("errLoadSenderKeySession");a=a;return d("WAResultOrError").makeResult(a)})},m=function(a,b,c){a=d("WAWebSignalCommonUtils").createSignalLikeSenderKeyName(a,d("WAWebWidFactory").createDeviceWid(b),j);return d("WAWebSignalProtocolStore").getSignalProtocolStore().storeSenderKey(a,c)};return{loadSession:a,handleNewSession:c,loadSenderKeySession:e,saveSenderKeySession:f,loadSessionDeprecatedLid:g,handleNewSessionDeprecatedLid:k,loadSenderKeySessionDeprecatedLid:l,saveSenderKeySessionDeprecatedLid:m,loadSignedPreKey:function(a){return d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSignedPreKey(a).then(function(b){if(b==null)return null;var c=d("WASignalKeys").makeKeyPairFromArrayBuffers(b.pubKey,b.privKey);c=d("WASignalOther").encodeSignalProto(d("WASignalLocalStorageProtocol.pb").SignedPreKeyRecordStructureSpec,{id:a,publicKey:d("WASignalKeys").serializePubKey(c),privateKey:c.privateKey,signature:new Uint8Array(b.signature),timestamp:0});return d("WASignalOther").castToByteEncoded(c)})},loadOneTimePreKey:function(a){return d("WAWebSignalProtocolStore").getSignalProtocolStore().loadPreKey(a).then(function(b){if(b==null)return null;b=d("WASignalKeys").makeKeyPairFromArrayBuffers(b.pubKey,b.privKey);b=d("WASignalOther").encodeSignalProto(d("WASignalLocalStorageProtocol.pb").PreKeyRecordStructureSpec,{id:a,publicKey:d("WASignalKeys").serializePubKey(b),privateKey:b.privateKey});return d("WASignalOther").castToByteEncoded(b)})},getRegistrationInfo:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().getLocalRegistrationId()),b=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().getIdentityKeyPair());if(a==null||b==null)return;if(a&&b)return{regId:d("WASignalOther").castRegistrationId(a),staticKeyPair:d("WASignalKeys").makeKeyPairFromArrayBuffers(b.pubKey.slice(1),b.privKey)}});function c(){return a.apply(this,arguments)}return c}()}}g.getCryptoDbCallbacks=a}),98); __d("WAWebCryptoLibrarySessionApi",["WALogger","WAWebCryptoLibrary"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["CryptoLibrarySignal::createGroupSenderSignalSession"]);h=function(){return a};return a}function a(a,b){b===void 0&&(b=!1);return d("WAWebCryptoLibrary").getRemoteRegId(a,b).then(function(a){return a==null?void 0:a.regId})}function b(a,b,c){var e;e={identity:new Uint8Array(a.identityKey),oneTimeKey:a.preKey&&{id:(e=a.preKey)==null?void 0:e.keyId,publicKey:((e=a.preKey)==null?void 0:e.publicKey)&&new Uint8Array((e=a.preKey)==null?void 0:e.publicKey)},regId:a.registrationId,signedKey:{id:a.signedPreKey.keyId,publicKey:new Uint8Array(a.signedPreKey.publicKey),signature:new Uint8Array(a.signedPreKey.signature)}};return d("WAWebCryptoLibrary").createSignalSession(b,e,c)}function c(a,b,c,e){d("WALogger").DEV(h());return d("WAWebCryptoLibrary").processSenderKeyDistributionMsg(a,b,c,e)}g.getRemoteRegId=a;g.createSignalSession=b;g.createGroupSenderSignalSession=c}),98); __d("WAWebCryptoLibraryUtilsApi",["WACryptoPrimitives","WALogger","WAResultOrError","WASignalCipher","WASignalGroupCipher","WASignalGroupSession","WASignalKeys","WASignalOther","WASignalSessions","WASignalSignatures","WASignalWhisperTextProtocol.pb","WATimeUtils","WAWebCryptoLibrary","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["extractIdentityKey: parse proto failed"]);h=function(){return a};return a}a=function(){function a(){}var c=a.prototype;c.createSenderKeyDistributionMsg=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=(yield a(c,e));if(!f.success&&f.error==="errLoadSenderKeySession"){var g=(yield d("WASignalKeys").makeKeyPair());yield d("WAWebCryptoLibrary").getCryptoLibModule().rotateGroupSenderKey({saveSenderKeySession:b},c,e,g);f=(yield a(c,e))}if(f.success){b=f.value.senderKeyStates.slice(-1);if(b.length>0)return d("WAResultOrError").makeResult(d("WASignalGroupCipher").createSenderKeyDistributionProto(d("WASignalGroupSession").convertFromRawToSenderKeyState(b[0])))}return d("WAResultOrError").makeError("errGetSenderKeyProto")});function c(b,c,d,e){return a.apply(this,arguments)}return c}();c.getSessionAliceBaseKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield b(a));return(b==null?void 0:b.aliceBaseKey)?d("WAResultOrError").makeResult(d("WASignalOther").toBuffer(b.aliceBaseKey)):d("WAResultOrError").makeError("errSessionExists")});function c(b,c){return a.apply(this,arguments)}return c}();c.extractIdentityKey=function(a){a=d("WASignalCipher").readContent(a,d("WASignalSessions").FORMAT_VERSION,0);if(!a.success)return a;try{a=d("decodeProtobuf").decodeProtobuf(d("WASignalWhisperTextProtocol.pb").PreKeySignalMessageSpec,a.value);var b=a.registrationId,c=a.signedPreKeyId,e=a.baseKey,f=a.identityKey;a=a.message;if(b==null||c==null||e==null||f==null||a==null)return d("WAResultOrError").makeError("errSignalDeserializePkInvalidProtoFormat");d("WASignalOther").ensureSize(new Uint8Array(f),33);return d("WAResultOrError").makeResult(f)}catch(a){d("WALogger").WARN(h()).devConsole(a);return d("WAResultOrError").makeError("errSignalDeserializePkKeyBadFormat")}};c.verifySignature=function(a,b,c){a=d("WASignalSignatures").convertPublicKeyToSerializedPubKey(a);c=d("WASignalOther").ensureSize(c,64);return d("WASignalSignatures").verifyMsgSignalVariant(a,b,c)};c.signMsg=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=d("WASignalKeys").makeKeyPairFromArrayBuffers(a,b);b=(yield d("WASignalSignatures").signMsg(a,new Uint8Array(c)));return d("WASignalOther").toBuffer(b)});function c(b,c,d){return a.apply(this,arguments)}return c}();c.makePreKey=function(a){a=d("WASignalKeys").makePreKeys(a,1);a=a[0].plainObject;var b=a.id;a=a.keyPair;return{preKeyId:b,privKey:d("WASignalOther").toBuffer(a.privateKey),pubKey:d("WASignalOther").toBuffer(a.publicKey)}};c.makeSignedPreKey=function(a,b){a=d("WASignalKeys").makeKeyPairFromArrayBuffers(a.pubKey,a.privKey);b=d("WASignalSignatures").makeSignedPreKey(b,d("WATimeUtils").unixTimeMs(),a);return{preKeyId:b.id,signature:d("WASignalOther").toBuffer(b.signature),pubKey:d("WASignalOther").toBuffer(b.keyPair.publicKey),privKey:d("WASignalOther").toBuffer(b.keyPair.privateKey)}};c.makeKeyPair=function(){var a=d("WASignalKeys").makeKeyPair(),b=a.privateKey;a=a.publicKey;return{privKey:d("WASignalOther").toBuffer(b),pubKey:d("WASignalOther").toBuffer(a)}};return a}();a.prototype.verify=d("WACryptoPrimitives").verify;a.prototype.makeRegistrationId=d("WASignalOther").makeRegistrationId;a.prototype.makeSenderKeyId=d("WASignalOther").makeSenderKeyId;c=new a();e=c;g["default"]=e}),98); __d("WAWebSignalProtocolStore",["WAWebSignalProtocolStoreUnifiedApi"],(function(a,b,c,d,e,f,g){function a(){return c("WAWebSignalProtocolStoreUnifiedApi")}function b(){return c("WAWebSignalProtocolStoreUnifiedApi")}function d(){c("WAWebSignalProtocolStoreUnifiedApi").switchToMemMode()}function e(){c("WAWebSignalProtocolStoreUnifiedApi").switchToPersistMode()}g.getSignalProtocolStore=a;g.getPersistSignalProtocolStore=b;g.enableMemSignalStore=d;g.enablePersistSignalStore=e}),98); __d("WAWebProtocolStoreCommonApi",["WAWebSignalCommonUtils"],(function(a,b,c,d,e,f,g){function a(a){return a instanceof ArrayBuffer?d("WAWebSignalCommonUtils").bufferToStr(a):a}g.stringifyIdentityKey=a}),98); __d("WASemaphore",["Promise","err"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){function a(a){a===void 0&&(a=1),this.$1=0,this.$3=[],this.$2=a}var d=a.prototype;d.acquire=function(){var a=this;return new(h||(h=b("Promise")))(function(b,c){a.$4(b,c)})};d.availablePermits=function(){return this.$2-this.$1};d.$5=function(){this.$1--,this.$6()};d.$4=function(a,b){var d=this;if(this.$1<this.$2){this.$1++;var e=!1;a({release:function(){if(e)throw c("err")("Permit has already been released");e=!0;d.$5()}})}else this.$7(a,b)};d.$7=function(a,b){this.$3.push([a,b])};d.$6=function(){if(this.$3.length===0)return;var a=this.$3.shift(),b=a[0];a=a[1];this.$4(b,a)};return a}();g.Semaphore=a}),98); __d("WAWebSignalProtocolStoreCacheApi",["WALogger","WASemaphore","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]signalSnapshot: get dirty updates for\n session: ","\n senderKey: ","\n identity: ",";\n preKeyRemove: ","\n sessionRemove: ","\n identityRemove: ","\n"]);h=function(){return a};return a}a=function(){function a(){var a;this.RegistrationInfo=null;this.SignedPreKeyStore=new Map();this.PrekeyStore=new Map();this.SessionStore=new Map();this.IdentityStore=new Map();this.SenderKeyStore=new Map();this.Mutex={session:new((a=d("WASemaphore")).Semaphore)(),identity:new a.Semaphore(),senderKey:new a.Semaphore(),preKey:new a.Semaphore()};this.Dirty={session:new Set(),identity:new Set(),senderKey:new Set(),preKey:new Set()}}var b=a.prototype;b.$1=function(){var a=this,b=[],d=[];this.Dirty.session.forEach(function(e){var f=a.SessionStore.get(e);if(!f)return;!f.deleted?b.push({address:e,session:c("lodash").cloneDeep(f.session)}):d.push(e)});return{update:b,remove:d}};b.$2=function(){var a=this,b=[];this.Dirty.senderKey.forEach(function(d){var e=a.SenderKeyStore.get(d);if(e){var f=d.split("::");f.length===2&&b.push({senderKeyName:d,senderId:f[1],senderKey:c("lodash").cloneDeep(e)})}});return b};b.$3=function(){var a=this,b=[],c=[];this.Dirty.identity.forEach(function(d){var e=a.IdentityStore.get(d);if(!e)return;!e.deleted?b.push({identifier:d,identityKey:e.identityKey,rowId:e.rowId,sentAddonRowId:e.sentAddonRowId}):c.push(d)});return{update:b,remove:c}};b.$4=function(){var a=this,b=[];this.Dirty.preKey.forEach(function(c){var d=a.PrekeyStore.get(c);(d==null?void 0:d.deleted)&&b.push(parseInt(c,10))});return b};b.generateCacheUpdate=function(){var a=this.$3(),b=this.$1();b={sessionUpdate:b.update,sessionRemove:b.remove,identityUpdate:a.update,identityRemove:a.remove,senderKeyUpdate:this.$2(),preKeyRemove:this.$4()};i(b);return b};b.clearDirty=function(){this.Dirty={session:new Set(),identity:new Set(),senderKey:new Set(),preKey:new Set()}};b.clear=function(){this.RegistrationInfo=null,this.SignedPreKeyStore.clear(),this.PrekeyStore.clear(),this.SessionStore.clear(),this.IdentityStore.clear(),this.SenderKeyStore.clear(),this.clearDirty()};return a}();function i(a){d("WALogger").DEV(h(),a.sessionUpdate.map(function(a){return a.address}).join(",")||"[]",a.senderKeyUpdate.map(function(a){return a.senderKeyName}).join(",")||"[]",a.identityUpdate.map(function(a){return a.identifier}).join(",")||"[]",a.preKeyRemove.join(",")||"[]",a.sessionRemove.join(",")||"[]",a.identityRemove.join(",")||"[]").tags("unified-store")}g.SignalStoreCache=a}),98); __d("WAWebSignalProtocolStoreUnifiedApi",["$InternalEnum","Promise","WALogger","WAWebBackendApi","WAWebCryptoCurve25519","WAWebIdentityChangeApi","WAWebProtocolStoreCommonApi","WAWebSignalCommonUtils","WAWebSignalConvertApi","WAWebSignalProtocolStoreCacheApi","WAWebSignalStorageUtils","WAWebSignalStoreApi","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]maybeCleanUpUnconvertedSession: delete unconverted session"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]updateIdentityRangeAfterEncryption: "," updated"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]updateIdentityRangeAfterEncryption: updates: "," to rowId: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]updateIdentityRangeAfterEncryption: start"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]flushBufferToDiskIfNotMemOnlyMode: done"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]flushBufferToDiskIfNotMemOnlyMode: lock complete"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]flushBufferToDiskIfNotMemOnlyMode: start"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]flushBufferToDiskIfNotMemOnlyMode: skip for memory mode"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]deleteAllCache"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal][storeSenderKey][unified] senderKeyName: "," keyId:"," chainCounter: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal][storeSenderKey][unified] senderKeyName: "," keyId:"," chainCounter: ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]bulkCreateIdentity: store "," value(s) (new: ","): end"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Signal]bulkCreateIdentity: store "," value(s): start"]);u=function(){return a};return a}var v=b("$InternalEnum").Mirrored(["Persist","Memory"]);a=function(){function a(){this.Direction={SENDING:1,RECEIVING:2},this._cache=new(d("WAWebSignalProtocolStoreCacheApi").SignalStoreCache)(),this._mode=v.Persist}var e=a.prototype;e.getIdentityKeyPair=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;this._cache.RegistrationInfo||(this._cache.RegistrationInfo=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo()));return((a=this._cache.RegistrationInfo)==null?void 0:a.identityKeyPair)?d("WAWebCryptoCurve25519").toSignalCurveKeyPair(this._cache.RegistrationInfo.identityKeyPair):void 0});function c(){return a.apply(this,arguments)}return c}();e.getLocalRegistrationId=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;this._cache.RegistrationInfo||(this._cache.RegistrationInfo=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo()));return((a=this._cache.RegistrationInfo)==null?void 0:a.registrationId)||void 0});function c(){return a.apply(this,arguments)}return c}();e.isTrustedIdentity=function(a,c){return(h||(h=b("Promise"))).resolve(!0)};e._loadIdentityKeyImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)throw c("err")("Tried to get identity key for undefined/null key");if(!this._cache.IdentityStore.has(a)){var b=(yield d("WAWebSignalStoreApi").waSignalStore.getIdentityKeyWithRowId(a));this._cache.IdentityStore.set(a,b)}return((b=this._cache.IdentityStore.get(a))==null?void 0:b.identityKey)||void 0});function a(b){return a.apply(this,arguments)}return a}();e.loadIdentityKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.identity.acquire());try{return yield this._loadIdentityKeyImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._putIdentityImpl=function(a,b){this._cache.IdentityStore.set(a,{identityKey:b}),this._cache.Dirty.identity.add(a)};e.putIdentity=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield this._cache.Mutex.identity.acquire());try{this._putIdentityImpl(a,b)}finally{c.release()}});function c(b,c){return a.apply(this,arguments)}return c}();e._saveIdentity=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebProtocolStoreCommonApi").stringifyIdentityKey(b);var c=(yield this.loadIdentityKey(a));if(c!=null&&c===b)return;else if(c!=null){if(a===d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(d("WAWebUserPrefsMeUser").getMeUser()).toString()){d("WAWebBackendApi").frontendFireAndForget("handleSelfPrimaryIdentityChange",{});return}a!=null&&(yield d("WAWebIdentityChangeApi").handleNewIdentity(d("WAWebWidFactory").widFromSignalAddress(a),!1))}yield this.putIdentity(a,b)});function a(b,c){return a.apply(this,arguments)}return a}();e.saveIdentity=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a==null)throw c("err")("Tried to put identity key for undefined/null key");yield this._saveIdentity(a,b)});function d(b,c){return a.apply(this,arguments)}return d}();e.getIdentityWithRowId=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)throw c("err")("Tried to get identity key for undefined/null key");yield this.loadIdentityKey(a);a=this._cache.IdentityStore.get(a);if(a==null||a.deleted!==void 0)return;return a});function d(b){return a.apply(this,arguments)}return d}();e.bulkGetIdentityWithRowId=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this;if(a==null)throw c("err")("Tried to get identity key for undefined/null key");if(a.length===0)return[];yield this.bulkLoadIdentityKey(a);return a.map(function(a){a=b._cache.IdentityStore.get(a);if(a==null||a.deleted!==void 0)return;return a})});function d(b){return a.apply(this,arguments)}return d}();e._bulkLoadIdentityKeyImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this;if(a==null)throw c("err")("Tried to get identity key for undefined/null key");if(a.length===0)return[];var e=new Array(a.length),f=[];a.forEach(function(a,c){if(b._cache.IdentityStore.has(a)){var d;e[c]=(d=b._cache.IdentityStore.get(a))==null?void 0:d.identityKey}else f.push({id:a,pos:c})});if(f.length>0){a=(yield d("WAWebSignalStoreApi").waSignalStore.bulkGetIdentityKeyWithRowId(f.map(function(a){return a.id})));a.forEach(function(a,c){c=f[c];b._cache.IdentityStore.set(c.id,a);e[c.pos]=a==null?void 0:a.identityKey})}return e});function a(b){return a.apply(this,arguments)}return a}();e.bulkLoadIdentityKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.identity.acquire());try{return yield this._bulkLoadIdentityKeyImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._bulkCreateIdentityImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this;if(a==null)throw c("err")("Tried to bulk put identity key with undefined/null");d("WALogger").LOG(u(),a.length).tags("unified-store");yield d("WAWebSignalStorageUtils").getStorage().lock(["identity-store"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=a.map(function(a){return a.identifier}),c=(yield e._bulkLoadIdentityKeyImpl(b));b=a.filter(function(a,b){return!c[b]});b.length>0&&(yield d("WAWebSignalStoreApi").waSignalStore.bulkPutIdentity(b),b.forEach(function(a){var b=a.identifier;a=a.identityKey;e._cache.IdentityStore.set(b,{identityKey:a})}));d("WALogger").LOG(t(),a.length,b.length).tags("unified-store")}))});function a(b){return a.apply(this,arguments)}return a}();e.bulkCreateIdentity=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.identity.acquire());try{yield this._bulkCreateIdentityImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._removeIdentityImpl=function(a){this._cache.IdentityStore.set(a,{deleted:!0}),this._cache.Dirty.identity.add(a)};e.removeIdentity=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return(h||(h=b("Promise"))).reject(c("err")("Tried to remove identity key for undefined/null key"));var d=(yield this._cache.Mutex.identity.acquire());try{yield this._removeIdentityImpl(a)}finally{d.release()}});function d(b){return a.apply(this,arguments)}return d}();e._loadPreKeyImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return void 0;if(!this._cache.PrekeyStore.has(a)){var b;b=(b=(yield d("WAWebSignalStoreApi").waSignalStore.getPreKeyById(a)))==null?void 0:b.keyPair;this._cache.PrekeyStore.set(a,{keyPair:b})}b=this._cache.PrekeyStore.get(a);return(b==null?void 0:b.keyPair)||void 0});function a(b){return a.apply(this,arguments)}return a}();e.loadPreKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.preKey.acquire());try{return yield this._loadPreKeyImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._removePreKeyImpl=function(a){if(a==null)return(h||(h=b("Promise"))).reject(c("err")("Tried to remove pre key without keyId"));this._cache.PrekeyStore.set(a,{deleted:!0});this._cache.Dirty.preKey.add(a);return(h||(h=b("Promise"))).resolve()};e.removePreKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.preKey.acquire());try{yield this._removePreKeyImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e.loadSignedPreKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return void 0;if(!this._cache.SignedPreKeyStore.has(a)){var b=(yield d("WAWebSignalStoreApi").waSignalStore.getSignedPreKeyById(a));b=b?{pubKey:b.keyPair.pubKey,privKey:b.keyPair.privKey,signature:b.signature}:null;this._cache.SignedPreKeyStore.set(a,b)}return this._cache.SignedPreKeyStore.get(a)||void 0});function c(b){return a.apply(this,arguments)}return c}();e._loadSessionImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return void 0;if(!this._cache.SessionStore.has(a)){var b=(yield d("WAWebSignalStoreApi").waSignalStore.getSession(a));this._cache.SessionStore.set(a,b?{session:b}:void 0)}return(yield d("WAWebSignalConvertApi").maybeConvertSession((b=this._cache.SessionStore.get(a))==null?void 0:b.session))||void 0});function a(b){return a.apply(this,arguments)}return a}();e.loadSession=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.session.acquire());try{return yield this._loadSessionImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._storeSessionImpl=function(a,b){if(a==null)throw c("err")("Tried to put session without identifier");this._cache.SessionStore.set(a,{session:b});this._cache.Dirty.session.add(a)};e.storeSession=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield this._cache.Mutex.session.acquire());try{this._storeSessionImpl(a,b)}finally{c.release()}});function c(b,c){return a.apply(this,arguments)}return c}();e._removeSessionImpl=function(a){if(a==null)throw c("err")("Tried to remove session without identifier");this._cache.SessionStore.set(a,{deleted:!0});this._cache.Dirty.session.add(a)};e.removeSession=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.session.acquire());try{this._removeSessionImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._containSessionsImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=[];for(var e of a)this._cache.SessionStore.has(e)||c.push(e);if(c.length>0){e=(yield d("WAWebSignalStoreApi").waSignalStore.bulkGetSession(c));e.forEach(function(a,d){d=c[d];b._cache.SessionStore.set(d,a?{session:a}:void 0)})}return a.map(function(a){a=b._cache.SessionStore.get(a);return a!=null&&!(a==null?void 0:a.deleted)})});function a(b){return a.apply(this,arguments)}return a}();e.containSessions=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.session.acquire());try{return yield this._containSessionsImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e._storeSenderKeyImpl=function(a,e){if(a==null)return(h||(h=b("Promise"))).reject(c("err")("Tried to put session without identifier"));if(!c("gkx")("26258"))if(Array.isArray(e==null?void 0:e.sessions)){var f=e.sessions[e.sessions.length-1];d("WALogger").DEV(s(),a,f==null?void 0:f.keyId,f==null?void 0:(f=f.chainKey)==null?void 0:f.counter)}else{f=e==null?void 0:(f=e.senderKeyStates)==null?void 0:f[0];d("WALogger").DEV(r(),a,f==null?void 0:f.senderKeyId,f==null?void 0:(f=f.senderKeyChainKey)==null?void 0:f.nextMsgIndex)}this._cache.SenderKeyStore.set(a,e);this._cache.Dirty.senderKey.add(a);return(h||(h=b("Promise"))).resolve()};e.storeSenderKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield this._cache.Mutex.senderKey.acquire());try{yield this._storeSenderKeyImpl(a,b)}finally{c.release()}});function c(b,c){return a.apply(this,arguments)}return c}();e._loadSenderKeyImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return void 0;if(!this._cache.SenderKeyStore.has(a)){var b=(yield d("WAWebSignalStoreApi").waSignalStore.getSenderKey(a));this._cache.SenderKeyStore.set(a,b)}return d("WAWebSignalConvertApi").maybeConvertSenderKey(this._cache.SenderKeyStore.get(a))||void 0});function a(b){return a.apply(this,arguments)}return a}();e.loadSenderKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.senderKey.acquire());try{return yield this._loadSenderKeyImpl(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();e.switchToMemMode=function(){this._mode=v.Memory};e.switchToPersistMode=function(){this._mode=v.Persist};e.generateSnapshot=function(){if(this._mode===v.Memory)return this._cache.generateCacheUpdate()};e.deleteAllCache=function(){d("WALogger").LOG(q()).tags("unified-store"),this._cache.clear()};e.flushBufferToDiskIfNotMemOnlyMode=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this._mode===v.Memory){d("WALogger").LOG(p()).tags("unified-store");return(h||(h=b("Promise"))).resolve()}d("WALogger").LOG(o()).tags("unified-store");var a=[yield this._cache.Mutex.identity.acquire(),yield this._cache.Mutex.session.acquire(),yield this._cache.Mutex.senderKey.acquire(),yield this._cache.Mutex.preKey.acquire()];d("WALogger").LOG(n()).tags("unified-store");var c=this._cache.generateCacheUpdate();try{yield d("WAWebSignalStorageUtils").getStorage().lock(["session-store","identity-store","prekey-store","senderkey-store"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.bulkPutSession(c.sessionUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkPutIdentityKeyWithRowId(c.identityUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkPutSenderKey(c.senderKeyUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkRemovePreKey(c.preKeyRemove),d("WAWebSignalStoreApi").waSignalStore.bulkRemoveSession(c.sessionRemove),d("WAWebSignalStoreApi").waSignalStore.bulkRemoveIdentity(c.identityRemove)])})),this._cache.clearDirty()}finally{a.forEach(function(a){return a.release()})}d("WALogger").LOG(m()).tags("unified-store")});function c(){return a.apply(this,arguments)}return c}();e._updateIdentityRangeAfterEncryptionImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=this;d("WALogger").LOG(l()).tags("unified-store");yield this._bulkLoadIdentityKeyImpl(c);var f=[];c.forEach(function(c){var d=e._cache.IdentityStore.get(c);if(d&&!d.deleted&&(d[a]==null||d[a]>b)){d=babelHelpers["extends"]({},d);d[a]=b;e._cache.IdentityStore.set(c,d);e._cache.Dirty.identity.add(c);f.push(c)}});d("WALogger").DEV(k(),JSON.stringify(f),b).tags("unified-store");d("WALogger").LOG(j(),f.length).tags("unified-store")});function a(b,c,d){return a.apply(this,arguments)}return a}();e.updateIdentityRangeAfterEncryption=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var d=(yield this._cache.Mutex.identity.acquire());try{yield this._updateIdentityRangeAfterEncryptionImpl(a,b,c)}finally{d.release()}});function c(b,c,d){return a.apply(this,arguments)}return c}();e._maybeCleanUpUnconvertedSessionAfterEncryption=function(a){if(a==null)return(h||(h=b("Promise"))).resolve();var c=this._cache.SessionStore.get(a);c&&d("WAWebSignalConvertApi").shouldConvertSession(c.session)&&(d("WALogger").LOG(i()).tags("unified-store"),this._removeSessionImpl(a));return(h||(h=b("Promise"))).resolve()};e.maybeCleanUpUnconvertedSession=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._cache.Mutex.session.acquire());try{return yield this._maybeCleanUpUnconvertedSessionAfterEncryption(a)}finally{b.release()}});function c(b){return a.apply(this,arguments)}return c}();return a}();e=new a();g["default"]=e}),98); __d("WAWebAdvSyncDeviceListApi",["Promise","WALogger","WAWebAdvHandlerApi","WAWebApiContact","WAWebApiDeviceList","WAWebDeviceListPk","WAWebGetIdentityKeysJob","WAWebPhashUtils","WAWebUserPrefsMeUser","WAWebUsync","WAWebUsyncUser","WAWebWidFactory","asyncToGeneratorRuntime","err","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncDeviceList: skipping "," out of "," records. Skipped records for users: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncDeviceList: error ",": ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: sync my device list complete"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: sync my device list begin"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to sync device list with error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: begin syncDeviceList for ",""]);n=function(){return a};return a}var o=new Map();function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.wids,f=a.context;a=a.phash;d("WALogger").DEV(n(),e.slice(0,3).join(",")+(e.length>3?"...":""));if(a!=null){var g=(yield d("WAWebApiDeviceList").getDeviceIds(e));g=g.map(function(a){return a==null?[]:a.devices.map(function(b){return d("WAWebWidFactory").createDeviceWidFromDeviceListPk(a.id,b.id,b.isHosted)})});g=c("lodash").flatMap(g,function(a){return a});g=(yield d("WAWebPhashUtils").phashV2(g));if(a===g)return}var i=new Set(),j=[];e.forEach(function(a){var b=o.get(d("WAWebDeviceListPk").createDeviceListPK(a));b?i.add(b):j.push(a)});if(j.length===0){yield (h||(h=b("Promise"))).all(Array.from(i));return}var k=r(j,f);j.map(function(a){o.set(d("WAWebDeviceListPk").createDeviceListPK(a),k)});yield (h||(h=b("Promise"))).all([k].concat(Array.from(i)))});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){try{var e=(yield d("WAWebApiDeviceList").getDeviceInfoForSync(a)),f=e.map(function(a){return a==null?[]:a.devices.map(function(b){return d("WAWebWidFactory").createDeviceWidFromDeviceListPk(a.id,b.id,b.isHosted)})}),g=(yield (h||(h=b("Promise"))).all(f.map(function(a){return a.length===0?"":d("WAWebPhashUtils").phashV2(a)})));f=a.map(function(a,b){return{id:a,hash:g[b],ts:(a=e[b])==null?void 0:a.timestamp,expectedTs:(a=e[b])==null?void 0:a.expectedTs}});return v(f,c)}catch(a){d("WALogger").ERROR(m(),a)}finally{a.map(function(a){o["delete"](d("WAWebDeviceListPk").createDeviceListPK(a))})}});return s.apply(this,arguments)}function a(){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").DEV(l()),yield p({wids:d("WAWebUserPrefsMeUser").getMePNandLIDWids(),context:null,phash:null}),d("WALogger").DEV(k())});return t.apply(this,arguments)}function e(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield p({wids:a,context:null,phash:null});return d("WAWebApiDeviceList").getDeviceIds(a)});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.length===0)return;d("WAWebApiContact").checkPnToLidMapping(a.map(function(a){return a.id}),d("WAWebApiContact").CheckPnToLidMappingCaller.WAWEB_ADV_SYNC_DEVICE_LIST_SEND_DEVICE_SYNC_REQUEST);var e=new(d("WAWebUsync").USyncQuery)().withContext(b||"interactive").withDeviceProtocol();a.forEach(function(a){a.id.user!==0&&e.withUser(new(d("WAWebUsyncUser").USyncUser)().withId(a.id).withDeviceHash(String(a.hash)).withTs(a.ts).withExpectedTs(a.expectedTs))});b=(yield e.execute());if(b.error.all)throw c("err")("syncDeviceList: error "+b.error.all.errorCode+": "+b.error.all.errorText);b.error.devices&&d("WALogger").WARN(j(),b.error.devices.errorCode,b.error.devices.errorText);a=b.list.filter(function(a){return!("errorCode"in a.devices)});a=a.map(function(a){return{wid:a.id,devices:a.devices}});var f=a.filter(function(a){return(a=a.devices.keyIndex)==null?void 0:a.signedKeyIndexBytes}).map(function(a){return a.wid});d("WALogger").LOG(i(),b.list.length-f.length,b.list.length,f.map(function(a){return a.toString()}).join(","));yield d("WAWebGetIdentityKeysJob").getAndStoreIdentityKeys(f);return d("WAWebAdvHandlerApi").handleADVDeviceSyncResult(a)});return w.apply(this,arguments)}g.syncDeviceList=p;g.syncMyDeviceList=a;g.syncAndGetDeviceList=e}),98); __d("WAWebDeleteLastAddOnsPreview",["WAWebApiChat","WAWebMsgKey","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set(a.map(function(a){return c("WAWebMsgKey").fromString(a).remote.toString()}));b=(yield d("WAWebShouldUpdateLastAddOnPreview").bulkGetChatLastAddOnPreviewMap(Array.from(b)));var e=new Map();b.forEach(function(b,c){a.includes(b==null?void 0:b.parentMsgKey)&&e.set(c,void 0)});yield d("WAWebApiChat").bulkUpdateChatLastAddOnPreview(e)});return h.apply(this,arguments)}g.deleteLastAddOnsPreview=a}),98); __d("WAWebMessageInsertDebugPlaceholder",["WALogger","WAWebBackendApi","WAWebCmd","WAWebMessageProcessorCache","WAWebMessagingGatingUtils","WAWebMsgProcessingApiUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["_insertDebugPlaceholder: msgId::",", failed to insert with error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_insertDebugPlaceholder: msgId::",", could not parse message info"]);i=function(){return a};return a}function a(a){if(!d("WAWebMessagingGatingUtils").isMessageDropPlaceholderEnabled())return;void j(a)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.externalId,c=a.msgInfo,e=a.offline,f=a.nackReason;a=a.additionalInfo;if(c==null){d("WALogger").WARN(i(),b).tags("messaging");return}f=f.toString();a=a!=null?f+" "+a:f;f=babelHelpers["extends"]({},d("WAWebMsgProcessingApiUtils").generateBaseMsg(c),{type:d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER,kind:d("WAWebMsgType").MsgKind.DebugPlaceholder,body:a});try{yield d("WAWebMessageProcessorCache").messageProcessorCache.addMessages([{msg:f}],e!==!0),d("WAWebCmd").Cmd.isMainStreamReadyMd&&(yield d("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{chatId:f.id.remote,msg:f}))}catch(a){d("WALogger").WARN(h(),b,a).tags("messaging")}});return k.apply(this,arguments)}g.maybeInsertDebugPlaceholder=a}),98); __d("WAWebMessagePostProcessBatcher",["Promise","WABatcher","WAWebBackendApi","WAWebMsgType","WAWebNoop","WAWebWorkerSafeBackendApi"],(function(a,b,c,d,e,f,g){var h,i={delayMs:1e3};a=function(){function a(){var a=this;this.$1=d("WABatcher").createSimpleBatcher(i,function(c){a.$2(c);return(h||(h=b("Promise"))).resolve([])})}var e=a.prototype;e.acceptMessage=function(a){return this.$1.accept(a)};e.runActiveBatches=function(){return this.$1.runActiveBatch().then(c("WAWebNoop"))};e.$2=function(a){d("WAWebBackendApi").frontendFireAndForget("processOrphanReadReceipts",{msgIds:a.map(function(a){return a.id})});a=a.filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.PAYMENT&&a.subtype==="send"});a.length>0&&d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("processOrphanPaymentNotifications",{msgs:a})};return a}();e=new a();g.messagePostProcessBatcher=e}),98); __d("WAWebMessagePostprocessRenderable",["Promise","WALogger","WAWebBackendApi","WAWebBizUpdateVerifiedInfoAction","WAWebMessagePostProcessBatcher","WAWebOfflineResumeMsgProcessReporter","WAWebUserPrefsMeUser","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message] UI update completed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message] UI update started"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePrivacyModeChange: failed to update biz privacy status with error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["query contact info on new chat failed"]);l=function(){return a};return a}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.msgInfo,e=a.messageOverwriteOption,f=a.msgs,g=a.isOffline,k=a.shouldQueryContactInfo,l=a.latestPrivacyMode,m=d("WAWebOfflineResumeMsgProcessReporter").msgProcessReporter.startMarker(d("WAWebOfflineResumeMsgProcessReporter").msgProcessReporter.stage.PostProcessing);d("WALogger").DEV(j());yield (h||(h=b("Promise"))).all(f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{chatId:a.id.remote,msg:a,messageOverwriteOption:e,preserveOrder:!0,isOffline:g}),void d("WAWebMessagePostProcessBatcher").messagePostProcessBatcher.acceptMessage(a),g||void d("WAWebMessagePostProcessBatcher").messagePostProcessBatcher.runActiveBatches()});return function(b){return a.apply(this,arguments)}}()));(k||l!=null)&&n(a);d("WALogger").DEV(i());yield d("WAWebBackendApi").frontendSendAndReceive("updateUnattributedMessages",{messageInfo:c,messages:f});m==null?void 0:m()});return m.apply(this,arguments)}function n(a){var b=a.shouldQueryContactInfo,c=a.msgInfo,e=a.latestPrivacyMode;a=a.msgs;var f=c.chat;b&&d("WAWebBizUpdateVerifiedInfoAction").queryAndUpdateContactPropertiesOnNewChat(f)["catch"](function(a){d("WALogger").WARN(l())});!d("WAWebUserPrefsMeUser").isMeAccount(c.author)&&e!=null&&d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("updateBizPrivacyStatus",{msgIds:a.map(function(a){return a.id}),privacyMode:e})["catch"](function(a){d("WALogger").ERROR(k(),a)})}g.postprocessRenderableMessages=a}),98); __d("WAWebGetGroupAddressingMode",["WAWebDBGroupsGroupMetadata","WAWebHandleMsgCommon","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isGroup())return;a=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));if(a==null)return null;return a.isLidAddressingMode==null?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn:a.isLidAddressingMode?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map(),c=(yield d("WAWebDBGroupsGroupMetadata").bulkGetGroupMetadata(a));a.map(function(a,e){if(!a.isGroup()){b.set(a.toString(),null);return}e=c[e];e!=null?b.set(e.id,e.isLidAddressingMode===!0?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn):b.set(a.toString(),null)});return b});return i.apply(this,arguments)}g.getGroupAddressingMode=a;g.bulkGetGroupAddressingMode=c}),98); __d("WAWebMessageProcessorCache",["Promise","WALogger","WANullthrows","WAShiftTimer","WAWebABProps","WAWebDBCreateLidPnMappings","WAWebDBReportingTokenUtils","WAWebGetGroupAddressingMode","WAWebGroupDatabaseJob","WAWebGroupHandleAddressingModeMismatch","WAWebHandleMessageTypes.flow","WAWebPromiseQueue","WAWebSendOfflineDeliveryReceiptJob","WAWebSignalProtocolStore","WAWebSignalStorageUtils","WAWebSignalStoreApi","WAWebStoreMsgs","WAWebWamEnumMismatchOriginType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: aggregated receipts sent for "," - ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: signal key store updated for "," - ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: messages added to table for "," - ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageProcessorCache: missing doneFn"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: creating snapshot for "," - "," messages/receipts"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: flushing due to max size reached: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][offline][message-cache]: adding to cache (current length: ",", next checkpoint index: ","): ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][online][message-cache]: flushing immediately"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][message-cache]: flushing cache due to timeout"]);q=function(){return a};return a}function r(){return d("WAWebABProps").getABPropConfigValue("web_message_processing_cache_size")}function s(){return t()>0}function t(){return d("WAWebABProps").getABPropConfigValue("web_offline_message_processor_timeout_seconds")}a=function(){function a(){var a=this;this.cache=[];this.additionalInfoCache=[];this.checkpointQueue=new(d("WAWebPromiseQueue").PromiseQueue)();this.nextCheckpointIndex=0;this.checkpointPromises=new Map();this.flushImmediately=!1;this.snapshotTimer=new(d("WAShiftTimer").ShiftTimer)(function(){d("WALogger").LOG(q()),a.createSnapshot()})}var e=a.prototype;e.size=function(){return this.cache.length};e.addMessages=function(a,b){var c;b===void 0&&(b=!1);(c=this.cache).push.apply(c,a);c=this.$1();if(b){d("WALogger").DEV(p());this.flushImmediately=!0;this.createSnapshot();return c}this.flushImmediately=!1;d("WALogger").DEV(o(),this.cache.length,this.nextCheckpointIndex,a.map(function(a){var b;return a.msg!=null?"msg "+((b=a.msg)==null?void 0:(b=b.id)==null?void 0:b.toString()):"receipt "+(((b=a.receiptInfo)==null?void 0:b.externalId)||"")}));if(this.cache.length>=r()){d("WALogger").DEV(n(),this.cache.length);this.createSnapshot();return c}s()&&!this.snapshotTimer.isScheduled()&&this.snapshotTimer.onOrBefore(t()*1e3);return c};e.addAdditionalInfo=function(a,b){b===void 0&&(b=!1);this.additionalInfoCache.push(a);if(b){a=this.additionalInfoCache;this.additionalInfoCache=[];void this.$2(a)}};e.handleChangedAddressingMode=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=new Map();a.forEach(function(b){b=b.msg;if(b!=null&&b.id.remote.isGroup()){var a=b==null?void 0:b.groupAddressingMode;a!=null&&e.set(b.id.remote.toString(),a)}});a=Array.from(e.keys()).map(d("WAWebWidFactory").createWid);var f=(yield d("WAWebGetGroupAddressingMode").bulkGetGroupAddressingMode(a));a=[];for(var g of e.entries()){var i=g[0],j=g[1];f.get(i)!==j&&a.push(d("WAWebWidFactory").createWid(i))}this.flushImmediately||(yield d("WAWebGroupDatabaseJob").bulkMarkGroupParticipantStaleJob(a));yield (h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebGroupHandleAddressingModeMismatch").handleAddressingModeMismatch(a,{localAddressingMode:c("WANullthrows")(f.get(a.toString())),serverAddressingMode:c("WANullthrows")(e.get(a.toString())),mismatchOrigin:d("WAWebWamEnumMismatchOriginType").MISMATCH_ORIGIN_TYPE.INCOMING_GROUP_MESSAGE})}))});function e(b){return a.apply(this,arguments)}return e}();e.$1=function(){var a=this,d=this.nextCheckpointIndex;if(!this.checkpointPromises.has(d)){var e,f=function(a){return void 0};this.checkpointPromises.set(d,{promise:new(h||(h=b("Promise")))(function(a,b){e=a,f=b}),markCheckpointDone:function(b){a.checkpointPromises["delete"](d);if(b!=null){f(b);return}e()}})}return c("WANullthrows")(this.checkpointPromises.get(d)).promise};e.$3=function(a){var b=[];a.forEach(function(a){a=a.msg;a!=null&&b.push(a)});return d("WAWebStoreMsgs").storeMsgs(b)};e.$2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.filter(function(a){return a.type===d("WAWebHandleMessageTypes.flow").MsgAdditionalInfoType.ReportingInfo}).map(function(a){return a.data});void d("WAWebDBReportingTokenUtils").handleAddReportingInfos(a)});function c(b){return a.apply(this,arguments)}return c}();e.createSnapshot=function(){var a,c=this,e=this.cache,f=this.additionalInfoCache;this.cache=[];this.additionalInfoCache=[];this.snapshotTimer.isScheduled()&&this.snapshotTimer.cancel();var g=this.nextCheckpointIndex,n=g+e.length;this.nextCheckpointIndex=n;d("WALogger").LOG(m(),g,n);if(e.length===0)return;var o=(a=(a=this.checkpointPromises.get(g))==null?void 0:a.markCheckpointDone)!=null?a:function(a){d("WALogger").ERROR(l()).sendLogs("message-cache-missing-doneFn")},p=d("WAWebSignalProtocolStore").getSignalProtocolStore().generateSnapshot();this.checkpointQueue.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield (h||(h=b("Promise"))).all([c.$3(e),d("WAWebDBCreateLidPnMappings").flushLidPnMappingsToDb()]),d("WALogger").LOG(k(),g,n),p!=null&&(yield d("WAWebSignalStorageUtils").getStorage().lock(["session-store","identity-store","prekey-store","senderkey-store"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.bulkPutSession(p.sessionUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkPutIdentityKeyWithRowId(p.identityUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkPutSenderKey(p.senderKeyUpdate),d("WAWebSignalStoreApi").waSignalStore.bulkRemovePreKey(p.preKeyRemove),d("WAWebSignalStoreApi").waSignalStore.bulkRemoveSession(p.sessionRemove),d("WAWebSignalStoreApi").waSignalStore.bulkRemoveIdentity(p.identityRemove)])})),d("WALogger").LOG(j(),g,n)),yield d("WAWebSendOfflineDeliveryReceiptJob").sendAggregateOfflineReceipts(e),yield c.$2(f),d("WALogger").LOG(i(),g,n)}catch(a){o(a);return}o()}));void this.handleChangedAddressingMode(e)};return a}();e=new a();g.messageProcessorCache=e}),98); __d("WAWebApiMessageInfoStore",["WAJids","WALogger","WAWebAck","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebSchemaMessage","WAWebSchemaMessageInfo","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryMsgInfo: targetedMsgInfoKey: ",", ack count: ",", receiver: ",",\n played: ",", read: ",", delivery: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageInfoStore: ",", ",":"," has been delivered"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageInfoStore: ",", ",":",": primary identity change after message has been delivered"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageInfoStore: ",", ",":",": companion identity changed"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageInfoStore: missing record for ",", ",""]);l=function(){return a};return a}var m=[d("WAWebAck").ACK_STRING.PLAYED,d("WAWebAck").ACK_STRING.READ,d("WAWebAck").ACK_STRING.DELIVERY],n=Object.freeze({ELIGIBLE:"ELGIBLE",INELIGIBLE_RECORD_MISSING:"INELIGIBLE_RECORD_MISSING",INELIGIBLE_ALREADY_DELIVERED:"INELIGIBLE_ALREADY_DELIVERED",INELIGIBLE_NOT_MD:"INELIGIBLE_NOT_MD",INELIGIBLE_CHANGED_IDENTITY:"INELIGIBLE_CHANGED_IDENTITY"});function a(a){var c=new Map();a.forEach(function(a){var b=a.msgKey;a=a.receiverId;var e=d("WAWebWidFactory").toUserWid(a).toString();b=b.toString();var f=b+","+e;a=(a=a.device)!=null?a:d("WAJids").DEFAULT_DEVICE_ID;var g=c.get(f);!g?c.set(f,{msgKey:b,receiverUserJid:e,deviceDelivered:[],deviceNotDelivered:[a]}):g.deviceNotDelivered.push(a)});return d("WAWebModelStorageUtils").getStorage().lock(["message-info"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=Array.from(c.values()).map(function(a){return[a.msgKey,a.receiverUserJid]});a=(yield a.anyOf(["msgKey","receiverUserJid"],b));a.forEach(function(a){var b=a.msgKey+","+a.receiverUserJid,d=c.get(b);d&&c.set(b,babelHelpers["extends"]({},a,{deviceNotDelivered:[].concat(a.deviceNotDelivered,d.deviceNotDelivered)}))});return d("WAWebSchemaMessageInfo").getMessageInfoTable().bulkCreateOrReplace(Array.from(c.values()))});return function(b){return a.apply(this,arguments)}}())}function e(a,b,c,e){var f=d("WAWebWidFactory").toUserWid(b).toString(),g=b.device||0;return d("WAWebSchemaMessageInfo").getMessageInfoTable().get([a.toString(),f]).then(function(h){if(!h){d("WALogger").LOG(l(),a.toString(),f);return n.INELIGIBLE_RECORD_MISSING}else if(h.deviceNotDelivered.includes(g)){if(c!=null&&e>=c)return n.ELIGIBLE;if(b.device!=null&&b.device!==d("WAJids").DEFAULT_DEVICE_ID){d("WALogger").LOG(k(),a.toString(),f,g);return n.INELIGIBLE_CHANGED_IDENTITY}else if(h.delivery!=null){d("WALogger").LOG(j(),a.toString(),f,g);return n.INELIGIBLE_CHANGED_IDENTITY}return n.ELIGIBLE}d("WALogger").LOG(i(),a.toString(),f,g);return n.INELIGIBLE_ALREADY_DELIVERED})}function f(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield p([a]));b=b.get(a.toString());if(!b)throw c("err")("No message info found for "+a.toString());return b});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a.map(function(a){return a.toString()}))),e=new Map(),f=new Map();for(var g=0;g<a.length;g++){var h,i=a[g].toString();h=(h=(h=b[g])==null?void 0:h.latestEditMsgKey)!=null?h:i;f.set(h,i);var j={messageInfoRecords:[],ackReceiver:b[g]?b[g].count:null};e.set(h,j);if(a[g].remote.isUser()){h=(h=d("WAWebLidMigrationUtils").getAlternateMsgKey(c("WAWebMsgKey").from(h)))==null?void 0:h.toString();h!=null&&(f.set(h,i),e.set(h,j))}}i=(yield d("WAWebSchemaMessageInfo").getMessageInfoTable().anyOf(["msgKey"],Array.from(e.keys())));i.forEach(function(a){var b;(b=e.get(a.msgKey))==null?void 0:b.messageInfoRecords.push(a)});h=r(e);j=new Map();for(g of h){b=g[0];a=g[1];i=f.get(b);i!=null&&j.set(i,a)}return j});return q.apply(this,arguments)}function r(a){var b=new Map(),e=function(a){var e=a[0];a=a[1];var f=a.ackReceiver;a=a.messageInfoRecords;var g=0,i={delivery:[],deliveryRemaining:0,played:[],playedRemaining:0,read:[],readRemaining:0},j=!1;a.forEach(function(a){var b=d("WAWebWidFactory").createWid(a.receiverUserJid);if(d("WAWebUserPrefsMeUser").isMeAccount(b))return;s(a);for(var f=0;f<m.length;f++){var h=m[f],k=a[h];if(k!=null){i[h].push({id:b,t:k});k=c("WAWebWid").isGroup(c("WAWebMsgKey").fromString(e).remote);k&&h==="read"&&(b==null?void 0:b.isBot())&&(j=!0);if(k)break}}a.delivery!=null&&a.deliveryPrivacyMode!=null&&(i.deliveryPrivacyMode=a.deliveryPrivacyMode);g+=1});a=f!=null&&f!==0?f:g;j&&a++;d("WALogger").LOG(h(),e,f,a,i.played.length,i.read.length,i.delivery.length);i.playedRemaining=a-i.played.length;i.readRemaining=i.playedRemaining-i.read.length;i.deliveryRemaining=i.readRemaining-i.delivery.length;b.set(e,i)};for(a of a.entries())e(a);return b}function s(a){var b=a.read;b!=null&&(a.delivery==null||a.delivery>b)&&(a.delivery=b)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map(),c=(yield p(a));for(a of a){var e=c.get(a.toString());if(e==null)continue;var f=void 0;e.playedRemaining===0&&e.played.length>0?f=d("WAWebAck").ACK.PLAYED:e.readRemaining===0&&e.read.length>0?f=d("WAWebAck").ACK.READ:e.deliveryRemaining===0&&e.delivery.length>0&&(f=d("WAWebAck").ACK.RECEIVED);f!=null&&b.set(a.toString(),f)}return b});return u.apply(this,arguments)}g.RetryEligibilityResult=n;g.createOrMergeReceiptRecords=a;g.isRetryEligible=e;g.queryMsgInfo=f;g.queryMsgInfos=p;g.getHighestMsgAcks=t}),98); __d("WAWebSchemaPeerReadReceipt",["WAWebOffdStorageUtils","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addColumn,i=c.addAutoIncrementingPrimaryKey;function a(){d("WAWebOffdStorageUtils").getStorage().add("peer-read-receipt").version(d("WAWebOffdStorageUtils").getStorage().versions.version(2),[i("id"),h("msgKeys"),h("ts"),h("ack")]).view(function(a){return a})}function b(){return d("WAWebOffdStorageUtils").getStorage().table("peer-read-receipt")}g.addTable=a;g.getTable=b}),98); __d("WAWebMessageReceiptBatcher",["Promise","WABatcher","WAJids","WALogger","WAPromiseMap","WAWebAck","WAWebApiMessageInfoStore","WAWebBackendApi","WAWebDBBulkGetRootMsgs","WAWebHandleMsgReceiptCommon","WAWebHandlePrivacyModeUpdateMsgAction","WAWebModelStorageUtils","WAWebMsgKey","WAWebNoop","WAWebSchemaMessage","WAWebSchemaMessageInfo","WAWebSchemaPeerReadReceipt","WAWebUserPrefsMeUser","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][batcher]: process peer receipts batch: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_processOtherReceipts: failed to process privacy mode updates"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][batcher] process other receipts batch: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unify][batcher]: receipt has unsupported ack type ",""]);l=function(){return a};return a}var m=Object.freeze((a={},a[(e=d("WAWebAck")).ACK.SENT]=e.ACK_STRING.DELIVERY,a[e.ACK.RECEIVED]=e.ACK_STRING.DELIVERY,a[e.ACK.READ]=e.ACK_STRING.READ,a[e.ACK.PLAYED]=e.ACK_STRING.PLAYED,a[e.ACK.INACTIVE]=e.ACK_STRING.INACTIVE,a)),n={delayMs:1e3};f=function(){function a(){var a=this;this.$1=d("WABatcher").createSimpleBatcher(n,function(b){return a.$2(b).then(function(){return[]})});this.$3=d("WABatcher").createSimpleBatcher(n,function(b){return a.$4(b).then(function(){return[]})})}var e=a.prototype;e.acceptPeerReceipt=function(a){return this.$1.accept(a)};e.acceptOtherReceipt=function(a){return this.$3.accept(a)};e.runActiveBatches=function(){return(h||(h=b("Promise"))).all([this.$1.runActiveBatch(),this.$3.runActiveBatch()]).then(c("WAWebNoop"))};e.$5=function(a){var b=[];for(a of a){var e=a.ack,f=a.privacyMode,g=a.msgKeys,h=a.receiverId;e===d("WAWebAck").ACK.RECEIVED&&f!=null&&b.push({remote:h,deliveryPrivacyMode:f,msgKeys:g.map(function(a){return c("WAWebMsgKey").from(a)})})}return b};e.$6=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAPromiseMap").promiseMap(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebHandlePrivacyModeUpdateMsgAction").handlePrivacyModeTransition(a.remote,a.deliveryPrivacyMode),yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("updateBizPrivacyStatus",{msgIds:a.msgKeys,privacyMode:a.deliveryPrivacyMode})});return function(b){return a.apply(this,arguments)}}())});function c(b){return a.apply(this,arguments)}return c}();e.$7=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=this.$8(a);b=b.map(function(a){return c("WAWebMsgKey").from(a)}).filter(function(a){return a.remote.isGroup()||a.remote.isStatus()||a.remote.isBot()});b=(yield d("WAWebApiMessageInfoStore").getHighestMsgAcks(b));for(b of b.entries()){var e=b[0],f=b[1];a.set(e,f)}return a});function e(b,c){return a.apply(this,arguments)}return e}();e.$8=function(a){var b=new Map();for(a of a){var d=a.msgKeys,e=a.ack,f=a.isBotInvoke,g=a.isSender;for(d of d)if(c("WAWebMsgKey").from(d).remote.isUser()&&f!==!0&&g!==!0){var h;b.set(d,Math.max(e,(h=b.get(d))!=null?h:Number.NEGATIVE_INFINITY))}}return b};e.$9=function(a){var b=new Map();a.forEach(function(a){var c=a.ack,e=a.ts,f=a.receiverId;a=a.msgKeys;var g=f.isNewsletter()?f.toJid():d("WAWebWidFactory").toUserWid(f).toString(),h=(f=f.device)!=null?f:d("WAJids").DEFAULT_DEVICE_ID;a.forEach(function(a){var f=m[c];if(f==null){d("WALogger").WARN(l(),c);return}a=a+","+g;var i=b.get(a);if(!i){b.set(a,(a={},a[f]=e,a.deviceDelivered=new Set([h]),a))}else f!==m[d("WAWebAck").ACK.INACTIVE]&&(i[f]=q(i[f],e)),i.deviceDelivered.add(h)})});return Array.from(b,function(a){var b=a[0];a=a[1];b=b.split(",");var c=b[0];b=b[1];return[[c,b],a]})};e.$4=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this,f=this.$9(a),g=Array.from(new Set(c("lodash").flatMap(a,function(a){return a.msgKeys}))),i=(yield d("WAWebModelStorageUtils").getStorage().lock(["message-info","message","chat"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var i=(yield (h||(h=b("Promise"))).all([d("WAWebSchemaMessageInfo").getMessageInfoTable().bulkGet(f.map(function(a){var b=a[0];a[1];return b})),d("WAWebDBBulkGetRootMsgs").bulkGetRootMsgs(g,!1)])),j=i[0],l=i[1],m=new Map(g.map(function(a,b){return[a,l[b]]}));i=j.map(function(a,b){b=f[b];var c=b[0],d=c[0];c=c[1];b=b[1];if(!b)return null;if(!a)return{delivery:b.delivery,read:b.read,played:b.played,msgKey:d,receiverUserJid:c,deviceDelivered:Array.from(b.deviceDelivered),deviceNotDelivered:[]};var e=b.deviceDelivered;a.deviceDelivered.forEach(function(a){return e.add(a)});return{delivery:q(a.delivery,b.delivery),read:q(a.read,b.read),played:q(a.played,b.played),msgKey:a.msgKey,receiverUserJid:a.receiverUserJid,deviceDelivered:Array.from(e),deviceNotDelivered:a.deviceNotDelivered.filter(function(a){return!e.has(a)})}}).filter(Boolean);d("WALogger").DEV(k(),JSON.stringify(i));yield d("WAWebSchemaMessageInfo").getMessageInfoTable().bulkCreateOrReplace(i);j=(yield e.$7(a,g));i=Array.from(j.entries()).map(function(a){var b=a[0];a=a[1];var d=c("WAWebMsgKey").fromString(b);d=d.remote;if(d.isUser()||d.isGroup()||d.isStatus()){d=m.get(b);if(d==null)return;if(a>((b=d.ack)!=null?b:Number.NEGATIVE_INFINITY))return{id:d.id.toString(),ack:a}}}).filter(Boolean);return{ackUpdates:i,receiptMsgKeyToMsg:m}})));yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(i.ackUpdates);d("WAWebBackendApi").frontendFireAndForget("updateMsgModelAcks",{updates:i.ackUpdates.map(function(a){var b=a.id;a=a.ack;return{id:c("WAWebMsgKey").from(b),ack:a}})});d("WAWebBackendApi").frontendFireAndForget("updateMsgInfo",{updates:c("lodash").flatMap(a,function(a){var b=a.msgKeys,e=a.ack,f=a.ts,g=a.receiverId;return b.map(function(a){a=i.receiptMsgKeyToMsg.get(a);if(a==null)return;a=c("WAWebMsgKey").from(a.id);if(!a.fromMe)return;if(!(a.remote.isUser()||a.remote.isGroup()||a.remote.isStatus()))return;var b=d("WAWebWidFactory").toUserWid(g);if(d("WAWebUserPrefsMeUser").isMeAccount(b))return;return{msgKey:a,ts:f,participant:b,ack:e}})}).filter(Boolean)});this.$6(this.$5(a))["catch"](function(){d("WALogger").ERROR(j())})});function e(b){return a.apply(this,arguments)}return e}();e.$2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i(),JSON.stringify(a));var b=a.some(function(a){return!a.isOffline});if(b){yield d("WAPromiseMap").promiseMap(a,o);return}b=a.map(function(a){var b=a.ts,c=a.msgKeys;a=a.ack;return{ts:b,msgKeys:c,ack:a}});yield d("WAWebSchemaPeerReadReceipt").getTable().bulkCreate(b)});function c(b){return a.apply(this,arguments)}return c}();return a}();function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgKeys.map(function(a){return c("WAWebMsgKey").from(a)});if(a.remote.isStatus()){d("WAWebBackendApi").frontendFireAndForget("handleReadStatus",{msgKeys:b});return d("WAWebBackendApi").frontendSendAndReceive("updateMsgPeerAcks",{msgKeys:b,ack:d("WAWebAck").ACK.READ,t:a.ts})}if((a.remote.isUser()||a.remote.isGroup()||a.remote.isNewsletter())&&a.ack>=d("WAWebAck").ACK.RECEIVED)if(a.ack===d("WAWebAck").ACK.READ)return d("WAWebHandleMsgReceiptCommon").updateChatPeerRead(a.remote,b);else if(a.ack===d("WAWebAck").ACK.PLAYED)return d("WAWebBackendApi").frontendSendAndReceive("updateMsgPeerAcks",{msgKeys:b,ack:a.ack,t:a.ts})});return p.apply(this,arguments)}function q(a,b){if(a!=null&&b!=null)return Math.min(a,b);a=(a=a)!=null?a:b;return(b=a)!=null?b:void 0}e=new f();g.receiptBatcher=e}),98); __d("WAWebOfflineResumeTypes.flow",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({Toastbar:"toastbar",ButterBar:"butterbar",None:"none"});c=b("$InternalEnum").Mirrored(["Blocking","NonBlocking","Worker"]);f.ResumeUIProgressBarType=a;f.ResumeType=c}),66); __d("WAWebThreadMetadata",["WALogger","WAWebBackendApi"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["processOfflineThreadMeta:"]);h=function(){return a};return a}var i=null;function a(a){d("WALogger").DEV(h()).devConsole(a),i=a,d("WAWebBackendApi").frontendFireAndForget("updateChatPreviewT",{threadMeta:a.chatTimestamp})}function j(){return i}function b(a){var b=j();if(b==null)return;return b.chatTimestamp[a.toString({legacy:!0})]}function c(){var a;a=(a=i)==null?void 0:a.chatTimestamp;a!=null&&d("WAWebBackendApi").frontendFireAndForget("resetChatPreviewT",{chatIds:Object.keys(a)});i=null}g.setOfflineThreadMeta=a;g.getOfflineThreadMetaPreview=j;g.getOfflineMetaPreviewForChat=b;g.resetThreadMeta=c}),98); __d("WAWebMsgSyncConfiguratedTunnel",["WALogger","WAWebMessagePostprocessRenderable","WAWebMsgSyncTunnelConfig","WAWebOfflineHandler","WAWebOfflineResumeTypes.flow","WAWebThreadMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgSyncTunnel: sending bulk UI update with "," messages"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgSyncTunnel: sending UI update "," "]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgSyncTunnel: sendUIUpdate "," for the accessed chat"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgSyncTunnel: cache "," "]);k=function(){return a};return a}var l={CACHE:new Map(),ACTIVE:!1};function m(){var a=l.CACHE,b=l.CACHE;l.CACHE=new Map();l.ACTIVE=!1;return{cache:a,accessedChats:b}}function n(a,b){var c=a.id.remote,e=l.CACHE.get(c.toString());e==null&&(e=[],l.CACHE.set(c.toString(),e));e.push(babelHelpers["extends"]({},b,{msgData:a}));d("WALogger").LOG(k(),a.id.toString())}function o(a){var b=l.CACHE.get(a);l.CACHE["delete"](a);return b}function p(a){var b=d("WAWebMsgSyncTunnelConfig").msgSyncTunnelConfig.openedChat;if(b==null)return!1;a=a.id.remote;return a.equals(b)}function q(a){var b=d("WAWebThreadMetadata").getOfflineMetaPreviewForChat(a.id.remote);return a.t===b}function a(){return{isEnabled:function(){return d("WAWebOfflineHandler").OfflineMessageHandler.getResumeType()!==d("WAWebOfflineResumeTypes.flow").ResumeType.NonBlocking?!1:!0},drainCacheForChat:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=o(a);if(b==null)return;r(b);d("WALogger").LOG(j(),a)});function c(b){return a.apply(this,arguments)}return c}(),completeUIUpdate:function(){var a=m();a=a.cache;a.forEach(function(a,b){r(a)})},accept:function(a){if(!t())return s(a);l.ACTIVE||(l.ACTIVE=!0);var b=a.msgs,c=babelHelpers.objectWithoutPropertiesLoose(a,["msgs"]);a=void 0;b.forEach(function(b){p(b)?(a=s(babelHelpers["extends"]({},c,{msgs:[b]})),d("WALogger").LOG(i(),b.id.toString())):(n(b,c),q(b)&&void u.drainCacheForChat(b.id.remote.toString()))});return a}}}function r(a){if(a.length===0)return;d("WALogger").LOG(h(),a.length);a.forEach(function(a){var b=a.msgData;a=babelHelpers.objectWithoutPropertiesLoose(a,["msgData"]);return s(babelHelpers["extends"]({},a,{msgs:[b]}))})}function s(a){void d("WAWebMessagePostprocessRenderable").postprocessRenderableMessages(a)}var t=function(){return!1};function c(){return l}var u=a();g.isMsgSyncTunnelActive=t;g.internal_getTunnelState=c;g.msgSyncTunnel=u}),98); __d("WAWebMsgSyncTunnelConfig",["WALogger","WAWebMsgSyncConfiguratedTunnel"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Active chat out of sync closed: ",", cached: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgSyncTunnel: set new config"]);i=function(){return a};return a}var j={openedChat:null};function k(a){d("WALogger").LOG(i()).devConsole({newConfig:a,oldConfig:babelHelpers["extends"]({},j)});Object.assign(j,a);if(a.openedChat!=null&&d("WAWebMsgSyncConfiguratedTunnel").internal_getTunnelState().ACTIVE){if(j.openedChat==null)return;void d("WAWebMsgSyncConfiguratedTunnel").msgSyncTunnel.drainCacheForChat(j.openedChat.toString())}}function a(a){if(!a)return;if(!d("WAWebMsgSyncConfiguratedTunnel").isMsgSyncTunnelActive())return;var b=j.openedChat;if(b==null)return;b.equals(a)||d("WALogger").WARN(h(),a,j.openedChat).sendLogs("msg_sync_tunnel_config_out_of_sync");k({openedChat:null})}function b(){if(!d("WAWebMsgSyncConfiguratedTunnel").isMsgSyncTunnelActive())return;k({openedChat:null})}g.msgSyncTunnelConfig=j;g.setMsgSyncTunnelConfig=k;g.resetMsgSyncTunnelOpenedChat=a;g.resetMsgSyncTunnelConfig=b}),98); __d("WAWebAddonPluginProcessor",["WANullthrows","WAWebAddonCrossWindowUtils","WAWebMessagePluginProcessAsAddonRegistry"],(function(a,b,c,d,e,f,g){function a(){var a=new Map();for(var b of c("WAWebMessagePluginProcessAsAddonRegistry")){var d=b.type,e=b.processor;e!=null&&a.set(d,e)}return a}var h=a();function b(){return h}function e(a){var b;typeof a==="string"?b=a:b=d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a);return c("WANullthrows")(h.get(b))}function f(a){return Boolean(h.get(a))}g.getAddonProcessorsMap=b;g.getAddonProcessor=e;g.hasAddonProcessor=f}),98); __d("WAWebPluginCreateRegistryLookup",[],(function(a,b,c,d,e,f){function a(a){var b=new Map();for(a of a){var c,d=a.type;c=(c=a.subtype)!=null?c:null;var e=b.get(d);e==null&&(e=new Map(),b.set(d,e));e.set(c,a)}return function(a,c){return(a=b.get(a))==null?void 0:a.get((a=c)!=null?a:null)}}f.createMsgTypeRegistryLookup=a}),66); __d("WAWebMessagePluginGenerateReportingTokenContent",["WAWebMessagePluginGenerateReportingTokenContentRegistry","WAWebMessagingGatingUtils","WAWebMsgType","WAWebPluginCreateRegistryLookup"],(function(a,b,c,d,e,f,g){var h=d("WAWebPluginCreateRegistryLookup").createMsgTypeRegistryLookup(c("WAWebMessagePluginGenerateReportingTokenContentRegistry"));function a(a){var b;return(b=h(a.type,a.subtype))==null?void 0:b.generateReportingTokenContent==null?void 0:b.generateReportingTokenContent(a)}function b(a,b){return!d("WAWebMessagingGatingUtils").isReportingTokenFromInclusionListEnabled()?a!==d("WAWebMsgType").MSG_TYPE.REACTION&&a!==d("WAWebMsgType").MSG_TYPE.REACTION_ENC&&a!==d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE&&a!==d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED&&a!==d("WAWebMsgType").MSG_TYPE.POLL_UPDATE:Boolean((a=h(a,b))==null?void 0:a.generateReportingTokenContent)}g.generateReportingTokenContent=a;g.isMsgTypeReportingTokenCompatible=b}),98); __d("WAWebMessagePluginParseProtobuf",["WALogger","WAWebMessagePluginParseProtobufRegistry","WAWebMultipleMessageParserPluginParseProtobuf","WAWebProtobufsE2E.pb","WAWebWamEnumEditType","gkx","isStringNullOrEmpty","justknobx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseProtoPlugins: Matched more than 1 plugin types ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] edit protocol msg with incorrect attribute"]);i=function(){return a};return a}function a(a){var b,e=d("WAWebMultipleMessageParserPluginParseProtobuf").parseProtobufWithMultipleMessageParserPlugin(a),f=e.result;if((!c("gkx")("26258")||c("justknobx")._("2517"))&&a.msgContext==="relay"&&(a==null?void 0:(b=a.messageProtobuf)==null?void 0:(b=b.protocolMessage)==null?void 0:b.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT){if(a.editAttr!==d("WAWebWamEnumEditType").EDIT_TYPE.EDITED&&c("isStringNullOrEmpty")((b=a==null?void 0:(b=a.msgBotInfo)==null?void 0:b.botEditType)!=null?b:"")){d("WALogger").ERROR(i()).devConsole(a).sendLogs("message-edit-incorrect-edit-attribute");return null}}b=e.pluginsMatched;for(e of c("WAWebMessagePluginParseProtobufRegistry")){var g=e(a);if(g!=null){var j;b.push(g.msgData.type+":"+((j=g.msgData.subtype)!=null?j:"null"));f==null&&(f=g)}}if(b.length>1){d("WALogger").ERROR(h(),b.join(",")).sendLogs("parse-protobuf-unexpected-plugin-match");return null}return f}g.parseProtobuf=a}),98); __d("WAWebGenerateChatReportingTokenContent",[],(function(a,b,c,d,e,f){function a(a){a=new TextEncoder().encode((a=a.body)!=null?a:"");return self.crypto.getRandomValues(new Uint8Array(a.length))}f["default"]=a}),66); __d("WAWebMessagePluginGenerateReportingTokenContentRegistry",["WAWebGenerateAudioOrPttReportingTokenContent","WAWebGenerateChatReportingTokenContent","WAWebGenerateDocumentReportingTokenContent","WAWebGenerateImageReportingTokenContent","WAWebGenerateInteractiveResponseReportingTokenContent","WAWebGeneratePtvReportingTokenContent","WAWebGenerateStickerReportingTokenContent","WAWebGenerateVideoReportingTokenContent"],(function(a,b,c,d,e,f,g){a=[{type:"album",subtype:void 0,generateReportingTokenContent:null},{type:"audio",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateAudioOrPttReportingTokenContent")},{type:"biz_content_placeholder",subtype:void 0,generateReportingTokenContent:null},{type:"buttons_response",subtype:void 0,generateReportingTokenContent:null},{type:"chat",subtype:"url",generateReportingTokenContent:c("WAWebGenerateChatReportingTokenContent")},{type:"chat",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateChatReportingTokenContent")},{type:"ciphertext",subtype:"bot_unavailable_fanout",generateReportingTokenContent:null},{type:"ciphertext",subtype:"fanout",generateReportingTokenContent:null},{type:"ciphertext",subtype:"hosted_unavailable_fanout",generateReportingTokenContent:null},{type:"ciphertext",subtype:"view_once_unavailable_fanout",generateReportingTokenContent:null},{type:"ciphertext",subtype:void 0,generateReportingTokenContent:null},{type:"comment",subtype:void 0,generateReportingTokenContent:null},{type:"debug_placeholder",subtype:void 0,generateReportingTokenContent:null},{type:"document",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateDocumentReportingTokenContent")},{type:"event_creation",subtype:void 0,generateReportingTokenContent:null},{type:"event_edit_encrypted",subtype:void 0,generateReportingTokenContent:null},{type:"event_response",subtype:void 0,generateReportingTokenContent:null},{type:"groups_v4_invite",subtype:void 0,generateReportingTokenContent:null},{type:"hsm",subtype:void 0,generateReportingTokenContent:null},{type:"image",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateImageReportingTokenContent")},{type:"interactive",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateInteractiveResponseReportingTokenContent")},{type:"interactive_response",subtype:void 0,generateReportingTokenContent:null},{type:"keep_in_chat",subtype:void 0,generateReportingTokenContent:null},{type:"list",subtype:void 0,generateReportingTokenContent:null},{type:"list_response",subtype:void 0,generateReportingTokenContent:null},{type:"location",subtype:void 0,generateReportingTokenContent:null},{type:"multi_vcard",subtype:void 0,generateReportingTokenContent:null},{type:"native_flow",subtype:void 0,generateReportingTokenContent:null},{type:"newsletter_admin_invite",subtype:void 0,generateReportingTokenContent:null},{type:"notification_template",subtype:"contact_info_card",generateReportingTokenContent:null},{type:"order",subtype:void 0,generateReportingTokenContent:null},{type:"payment",subtype:"ciphertext",generateReportingTokenContent:null},{type:"payment",subtype:"futureproof",generateReportingTokenContent:null},{type:"payment",subtype:"invite",generateReportingTokenContent:null},{type:"payment",subtype:"request",generateReportingTokenContent:null},{type:"payment",subtype:"send",generateReportingTokenContent:null},{type:"pin_message",subtype:void 0,generateReportingTokenContent:null},{type:"pinned_message",subtype:void 0,generateReportingTokenContent:null},{type:"poll_creation",subtype:void 0,generateReportingTokenContent:null},{type:"poll_result_snapshot",subtype:void 0,generateReportingTokenContent:null},{type:"poll_update",subtype:"poll_vote",generateReportingTokenContent:null},{type:"product",subtype:void 0,generateReportingTokenContent:null},{type:"protocol",subtype:"admin_revoke",generateReportingTokenContent:null},{type:"protocol",subtype:"bot_feedback",generateReportingTokenContent:null},{type:"protocol",subtype:"bot_memu_onboarding",generateReportingTokenContent:null},{type:"protocol",subtype:"bot_request_welcome",generateReportingTokenContent:null},{type:"protocol",subtype:"ephemeral_setting",generateReportingTokenContent:null},{type:"protocol",subtype:"ephemeral_sync_response",generateReportingTokenContent:null},{type:"protocol",subtype:"event_edit_decrypted",generateReportingTokenContent:null},{type:"protocol",subtype:"history_sync_notification",generateReportingTokenContent:null},{type:"protocol",subtype:"message_edit",generateReportingTokenContent:null},{type:"protocol",subtype:"sender_revoke",generateReportingTokenContent:null},{type:"protocol",subtype:"share_phone_number",generateReportingTokenContent:null},{type:"protocol",subtype:"status_group_mention_message",generateReportingTokenContent:null},{type:"protocol",subtype:"status_mention_message",generateReportingTokenContent:null},{type:"ptt",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateAudioOrPttReportingTokenContent")},{type:"ptv",subtype:void 0,generateReportingTokenContent:c("WAWebGeneratePtvReportingTokenContent")},{type:"reaction",subtype:void 0,generateReportingTokenContent:null},{type:"reaction_enc",subtype:void 0,generateReportingTokenContent:null},{type:"request_phone_number",subtype:void 0,generateReportingTokenContent:null},{type:"revoked",subtype:"admin",generateReportingTokenContent:null},{type:"revoked",subtype:"sender",generateReportingTokenContent:null},{type:"rich_response",subtype:void 0,generateReportingTokenContent:null},{type:"status_notification",subtype:"status_notification_message",generateReportingTokenContent:null},{type:"sticker",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateStickerReportingTokenContent")},{type:"sticker-pack",subtype:void 0,generateReportingTokenContent:null},{type:"template_button_reply",subtype:void 0,generateReportingTokenContent:null},{type:"unknown",subtype:"payment_action_request_declined",generateReportingTokenContent:null},{type:"unknown",subtype:"payment_transaction_request_cancelled",generateReportingTokenContent:null},{type:"unknown",subtype:"phone",generateReportingTokenContent:null},{type:"unknown",subtype:"phone_only_feature",generateReportingTokenContent:null},{type:"unknown",subtype:void 0,generateReportingTokenContent:null},{type:"vcard",subtype:void 0,generateReportingTokenContent:null},{type:"video",subtype:void 0,generateReportingTokenContent:c("WAWebGenerateVideoReportingTokenContent")}];g["default"]=a}),98); __d("WAWebAlbumsParseAlbumMessageProto",["WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.albumMessage;if(b==null)return null;b=b.contextInfo;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.ALBUM,kind:d("WAWebMsgType").MsgKind.Album}),contextInfo:b}}g["default"]=a}),98); __d("WAWebEventsGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("event_name_length_limit")}function b(){return d("WAWebABProps").getABPropConfigValue("event_description_length_limit")}function c(){return d("WAWebABProps").getABPropConfigValue("events_m3_end_time_receive")}function e(){return d("WAWebABProps").getABPropConfigValue("events_m3_end_time_send")}function f(){return d("WAWebABProps").getABPropConfigValue("events_m3_maybe_respone_send")}function h(){return d("WAWebABProps").getABPropConfigValue("events_m3_maybe_response_receive")}function i(){return d("WAWebABProps").getABPropConfigValue("events_send_one_on_one_chat")}g.getEventsNameLengthLimit=a;g.getEventsDescriptionLengthLimit=b;g.isEventEndTimeReceiveEnabled=c;g.isEventEndTimeSendEnabled=e;g.isEventMaybeSendEnabled=f;g.isEventMaybeReceiveEnabled=h;g.isEventSendOneOnOneChatEnabled=i}),98); __d("WAWebEventsValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_MESSAGE_SECRET:"missing_message_secret",INVALID_MESSAGE_SECRET:"invalid_message_secret",EVENT_CREATION_INVALID_NAME:"event_creation_invalid_name",EVENT_CREATION_INVALID_DESCRIPTION:"event_creation_invalid_description",EVENT_CREATION_INVALID_CANCELED_STATUS:"event_creation_invalid_canceled_status",EVENT_CREATION_MISSING_DATE:"event_creation_missing_date",EVENT_CREATION_INVALID_LOCATION:"event_creation_invalid_location",EVENT_CREATION_INVALID_LOCATION_NAME:"event_creation_invalid_location_name",EVENT_CREATION_INVALID_LOCATION_ADDRESS:"event_creation_invalid_location_address",EVENT_CREATION_MISSING_MESSAGE_SENDER:"event_creation_missing_message_sender",EVENT_CREATION_INVALID_END_TIME:"event_creation_invalid_end_time",EVENT_CREATION_INVALID_JOIN_LINK:"event_creation_invalid_join_link"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="EventCreationValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);e=b("$InternalEnum")({EVENT_RESPONSE_MISSING_MESSAGE_KEY:"event_response_missing_message_key",EVENT_RESPONSE_MISSING_ENC_IV:"event_response_missing_enc_iv",EVENT_RESPONSE_INVALID_SIZE_ENC_IV:"event_response_invalid_size_enc_iv",EVENT_RESPONSE_MISSING_ENC_PAYLOAD:"event_response_missing_enc_payload",EVENT_RESPONSE_MISSING_MESSAGE_SENDER:"event_response_missing_message_sender"});f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="EncryptedEventResponseValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);b=b("$InternalEnum")({EVENT_EDIT_MISSING_TARGET_MESSAGE_KEY:"event_edit_missing_target_message_key",EVENT_EDIT_MISSING_ENC_IV:"event_edit_missing_enc_iv",EVENT_EDIT_INVALID_SIZE_ENC_IV:"event_edit_invalid_size_enc_iv",EVENT_EDIT_MISSING_ENC_PAYLOAD:"event_edit_missing_enc_payload",EVENT_EDIT_MISSING_MESSAGE_SENDER:"event_edit_missing_message_sender",EVENT_EDIT_MISSING_EDITED_MESSAGE:"event_edit_missing_edited_message",EVENT_EDIT_MISSING_SENDER_TIMESTAMP:"event_edit_missing_sender_timestamp",EVENT_EDIT_PARENT_SENDER_MISMATCH:"event_edit_parent_sender_mismatch",EVENT_EDIT_INVALID_PROTOCOL_MESSAGE_TYPE:"event_edit_invalid_protocol_message_type",EVENT_EDIT_MISSING_MESSAGE_SECRET:"event_edit_missing_message_secret"});d=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="EncryptedEventEditValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.EventCreationValidationErrorCode=a;g.EventCreationValidationError=c;g.EncryptedEventResponseValidationErrorCode=e;g.EncryptedEventResponseValidationError=f;g.EncryptedEventEditValidationErrorCode=b;g.EncryptedEventEditValidationError=d}),98); __d("WAWebEventsParseEventCreationMessageProto",["WALongInt","WAWebEventsGatingUtils","WAWebEventsValidationError","WAWebMsgType","WAWebURLUtils","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;var f=b.eventMessage;if(f==null)return null;var g=f.contextInfo,h=f.isCanceled,i=f.name,j=f.description,k=f.joinLink,l=f.startTime,m=f.endTime;f=f.location;l=d("WALongInt").maybeNumberOrThrowIfTooLarge(l);m=d("WALongInt").maybeNumberOrThrowIfTooLarge(m);if(k!=null&&c("WAWebURLUtils").isValidCallLink(k)===!1)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_JOIN_LINK,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(i==null||i===""||i.length>d("WAWebEventsGatingUtils").getEventsNameLengthLimit())throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(l==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_MISSING_DATE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(j!=null&&j.length>d("WAWebEventsGatingUtils").getEventsDescriptionLengthLimit())throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_DESCRIPTION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(h==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_CANCELED_STATUS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f!=null){var n=f.name,o=f.address,p=f.degreesLatitude,q=f.degreesLongitude;if(n!=null&&n.length>d("WAWebEventsGatingUtils").getEventsDescriptionLengthLimit())throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_LOCATION_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(o!=null&&o.length>d("WAWebEventsGatingUtils").getEventsDescriptionLengthLimit())throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_LOCATION_ADDRESS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(p==null&&q!=null||p!=null&&q==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_LOCATION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE)}if(m!=null&&m<l)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_INVALID_END_TIME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);o=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.EVENT_CREATION,kind:d("WAWebMsgType").MsgKind.EventCreation,eventName:i,eventDescription:j,eventJoinLink:k,eventStartTime:l,isEventCanceled:Boolean(h),eventLocation:f,eventEndTime:(n=m)!=null?n:void 0});if(a==="quoted"||a==="history_quoted"||a==="history")return{msgData:o,contextInfo:g};q=(p=b.messageContextInfo)==null?void 0:p.messageSecret;if(q==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.MISSING_MESSAGE_SECRET,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MISSING_MESSAGE_SECRET);if(q.byteLength!==32)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.INVALID_MESSAGE_SECRET,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MESSAGE_SECRET_INVALID);return{msgData:o,contextInfo:g}}g["default"]=a}),98); __d("WAWebBizContentPlaceholderMsgData.flow",["$InternalEnum"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MASK_LINKED_DEVICES:0});g.BizContentPlaceholderType=a}),98); __d("WAWebParseBizContentPlaceholderProto",["WAWebBizContentPlaceholderMsgData.flow","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.placeholderMessage;if(b==null||b.type==null)return;b=h(b.type);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.BIZ_CONTENT_PLACEHOLDER,kind:d("WAWebMsgType").MsgKind.BizContentPlaceholder,bizContentPlaceholderType:b}),contextInfo:void 0}}function h(a){switch(a){case d("WAWebProtobufsE2E.pb").Message$PlaceholderMessage$PlaceholderType.MASK_LINKED_DEVICES:return d("WAWebBizContentPlaceholderMsgData.flow").BizContentPlaceholderType.MASK_LINKED_DEVICES}}g["default"]=a}),98); __d("WAWebParseBotMemuOnboardingMessageProto",["WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;if(((b=b.protocolMessage)==null?void 0:b.type)!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE)return;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"bot_memu_onboarding"}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseBotRequestWelcomeMessageProto",["WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;if(((b=b.protocolMessage)==null?void 0:b.type)!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE)return;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"bot_request_welcome"}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseGroupInviteMessageProto",["WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.groupInviteMessage;if(b==null)return;var c=b.caption,e=b.inviteCode,f=b.inviteExpiration,g=b.groupJid,h=b.groupName;b=b.contextInfo;a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE,kind:d("WAWebMsgType").MsgKind.GroupsV4Invite,comment:c,inviteCode:e,inviteCodeExp:f==null?void 0:f.toString(),inviteGrp:g,inviteGrpName:h});return{msgData:a,contextInfo:b}}g["default"]=a}),98); __d("WAWebParseListMessageProto",["WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.listMessage;if(b==null)return;var c=b.listType;if(c===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.SINGLE_SELECT||c===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST){c=a.businessOwnerJid;var e=a.productListItemCount;if(b.listType===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST){var f;c=(f=b.productListInfo)==null?void 0:f.businessOwnerJid;e=(f=b.productListInfo)==null?void 0:f.productSections.reduce(function(a,b){return a+b.products.length},0)}f=babelHelpers["extends"]({},a,{businessOwnerJid:c,productListItemCount:e,type:d("WAWebMsgType").MSG_TYPE.LIST,kind:d("WAWebMsgType").MsgKind.List,list:b,footer:b.footerText})}else f=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown});return{msgData:f,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebMultiVcardMessageValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({EMPTY_LIST:"contacts_array_empty_list",INVALID_LIST_SIZE:"contacts_array_invalid_list_size"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="MultiVcardMessageValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.MultiVcardValidationErrorCode=a;g.MultiVcardMessageValidationError=c}),98); __d("WAWebParseMultiVcardMessageProto",["WAWebMsgType","WAWebMultiVcardMessageValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.contactsArrayMessage;if(b==null)return;var e=b.contacts,f=b.contextInfo;b=b.displayName;if((a==="relay"||a==="outgoing")&&(e==null||e.length===0))throw new(d("WAWebMultiVcardMessageValidationError").MultiVcardMessageValidationError)(d("WAWebMultiVcardMessageValidationError").MultiVcardValidationErrorCode.EMPTY_LIST,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER);a=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.MULTI_VCARD,kind:d("WAWebMsgType").MsgKind.MultiVcard,vcardFormattedName:b,vcardList:Array.isArray(e)?e.map(function(a){return{displayName:a.displayName,vcard:a.vcard,isMultiVcard:!1}}):[]});return{msgData:a,contextInfo:f}}g["default"]=a}),98); __d("WAWebParseOrderMessageProto",["WALongInt","WAWebE2EProtoParserApi","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.orderMessage;if(b==null)return;var c=b.thumbnail,e=b.message,f=b.orderId,g=b.itemCount,h=b.status,i=b.surface,j=b.sellerJid,k=b.orderTitle,l=b.token,m=b.totalAmount1000,n=b.totalCurrencyCode,o=b.contextInfo;b=b.catalogType;c=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.ORDER,kind:d("WAWebMsgType").MsgKind.Order,thumbnail:d("WAWebE2EProtoParserApi").decodeBytes(c),message:e||"",orderId:f,itemCount:g||0,status:h,surface:i,sellerJid:j,orderTitle:k||"",token:l||"",totalAmount1000:d("WALongInt").numberOrThrowIfTooLarge((a=m)!=null?a:0),totalCurrencyCode:n,catalogType:b,body:""});return{msgData:c,contextInfo:o}}g["default"]=a}),98); __d("WAWebParsePaymentInviteMessageProto",["WALogger","WALongInt","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[payment-invite] render payment invite of type ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[payment-invite] parsePaymentInviteMessageProto: does not support novi transactions"]);i=function(){return a};return a}function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.paymentInviteMessage;if(b==null)return;if(b.serviceType===d("WAWebProtobufsE2E.pb").Message$PaymentInviteMessage$ServiceType.NOVI){d("WALogger").LOG(i());return{msgData:babelHelpers["extends"]({},a,{kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:null}}d("WALogger").LOG(h(),b.serviceType);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"invite",paymentExpiryTimestamp:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.expiryTimestamp),paymentInviteServiceType:b.serviceType}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseProtocolHistorySyncNotificationMessageProto",["WAWebE2EProtoParserApi","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.protocolMessage;if(b==null)return;if(a!=="relay")return;if(b.type!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.HISTORY_SYNC_NOTIFICATION)return;a=b.historySyncNotification;if(a==null)return;var e={directPath:a.directPath,encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(a.fileEncSha256),filehash:d("WAWebE2EProtoParserApi").decodeBytes(a.fileSha256),mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(a.mediaKey),type:"md-msg-hist"};a=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"history_sync_notification",historySyncMetaData:{historySyncNotification:a,downloadOptions:e,progress:(b==null?void 0:(c=b.historySyncNotification)==null?void 0:c.progress)||0}});return{msgData:a,contextInfo:void 0}}g["default"]=a}),98); __d("WAWebParseProtocolSharePhoneNumberMessageProto",["WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.protocolMessage;if(b==null)return;if(b.type!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.SHARE_PHONE_NUMBER)return;b=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"share_phone_number"});return{msgData:b,contextInfo:void 0}}g["default"]=a}),98); __d("WAWebStatusGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){var h=["\ud83d\ude0d","\ud83d\ude02","\ud83d\ude2e","\ud83d\ude22","\ud83d\ude4f","\ud83d\udc4f","\ud83c\udf89","\ud83d\udcaf"],i=new Set(["\ud83d\ude0d","\ud83d\ude02","\ud83d\ude2e","\ud83d\ude22","\ud83d\ude4f","\ud83d\udc4f","\ud83c\udf89","\ud83d\udcaf","\ud83d\udc4d","\u2764","\ud83d\ude0a","\ud83e\udd70","\ud83e\udd29","\ud83d\udc9a","\ud83e\udd23","\ud83d\ude06","\ud83d\udd25","\ud83d\ude4c","\ud83e\udd73","\ud83d\ude2d","\ud83d\ude14","\ud83e\udd7a","\ud83d\ude32","\ud83e\udd2f","\ud83d\ude21","\ud83d\ude24"]);function a(){try{var a=JSON.parse(d("WAWebABProps").getABPropConfigValue("status_reaction_emojis"));a=a.map(function(a){return String.fromCodePoint(a)}).filter(function(a){return i.has(a)});return a.length===0?h:a}catch(a){return h}}function b(){return d("WAWebABProps").getABPropConfigValue("web_status_likes_receive_enabled")}function c(){return d("WAWebABProps").getABPropConfigValue("status_mentions_receiver")}function e(){return d("WAWebABProps").getABPropConfigValue("status_mentions_group_mention_receiver")}function f(){return d("WAWebABProps").getABPropConfigValue("status_mentions_in_chat_receiver")}function j(){return d("WAWebABProps").getABPropConfigValue("status_ranking_poster_side_gating_enabled")}function k(){return d("WAWebABProps").getABPropConfigValue("status_future_proofing")}function l(){return d("WAWebABProps").getABPropConfigValue("status_save_to_camera_roll_enabled")}function m(){return d("WAWebABProps").getABPropConfigValue("web_status_infra_m1_p1")}g.statusQuickReplyEmojis=a;g.isStatusLikesReceiveEnabled=b;g.isStatusPrivateMentionsReceiveEnabled=c;g.isStatusPrivateGroupMentionsReceivingEnabled=e;g.isStatusMentionsInChatReceiveEnabled=f;g.canCheckStatusRankingPosterGating=j;g.isStatusEmbeddedContentFutureproofingEnabled=k;g.isStatusSaveToDiskEnabled=l;g.isStatusInfraWriteEnabled=m}),98); __d("WAWebParseProtocolStatusGroupMentionMessageProto",["WAWebMsgType","WAWebStatusGatingUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a.msgContext;if(!d("WAWebStatusGatingUtils").isStatusPrivateMentionsReceiveEnabled()&&!d("WAWebStatusGatingUtils").isStatusPrivateGroupMentionsReceivingEnabled())return;a=b.groupStatusMentionMessage;if(a==null||(a==null?void 0:a.message)==null)return;return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.PROTOCOL,futureproofSubtype:"status_group_mention_message"}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseProtocolStatusMentionMessageProto",["WAWebMsgType","WAWebStatusGatingUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a.msgContext;if(!d("WAWebStatusGatingUtils").isStatusPrivateMentionsReceiveEnabled())return;a=b.statusMentionMessage;if(a==null||(a==null?void 0:a.message)==null)return;return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.PROTOCOL,futureproofSubtype:"status_mention_message"}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseProtocolStatusNotificationMessageProto",["WAWebMsgType","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a.msgContext;a=b.associatedChildMessage;b=b.statusNotificationMessage;if((a==null||(a==null?void 0:a.message)==null)&&b==null)return;var e=b;if(a!=null&&a.message!=null&&b==null){e=(b=a.message)==null?void 0:b.statusNotificationMessage}if(e==null)return;return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.STATUS_NOTIFICATION,kind:d("WAWebMsgType").MsgKind.Unknown,viewMode:d("WAWebViewMode.flow").ViewModeType.HIDDEN,futureproofSubtype:"status_notification_message"}),contextInfo:null}}g["default"]=a}),98); __d("WAWebParseRequestPhoneNumberMessageProto",["WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.requestPhoneNumberMessage;if(b==null)return;b=b.contextInfo;a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.REQUEST_PHONE_NUMBER,kind:d("WAWebMsgType").MsgKind.RequestPhoneNumber});return{msgData:a,contextInfo:b}}g["default"]=a}),98); __d("WAWebStickerMimeUtils",[],(function(a,b,c,d,e,f){var g="application/was",h="image/webp";function a(){return new Set([h,g])}f.WhatsAppLottieStickerMimeType=g;f.getValidStickerMimeTypes=a}),66); __d("WAWebMediaMessageGetValidatedProperties",["$InternalEnum","WALogger","WALongInt","WAWebHandleMsgError","WAWebMsgType","WAWebNewsletterIsNewsletterMsg","WAWebStickerMimeUtils","WAWebURLUtils","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid file length "," with a type "," for "," message"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected "," for "," message"]);i=function(){return a};return a}var j=b("$InternalEnum")({MISSING_MEDIA_KEY:"missing_media_key",INVALID_SHA256:"invalid_sha256",INVALID_ENC_SHA256:"invalid_enc_sha256",INVALID_URL:"invalid_url",INVALID_MIME_TYPE:"invalid_mime_type",INVALID_MEDIA_KEY:"invalid_media_key",INVALID_FILE_LENGTH:"invalid_file_length"}),k=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c,d,e){c=String(c)+" for "+a+" message";a=b.call(this,c,d,e)||this;a.name="MediaMessageValidationError";return a}return a}(d("WAWebHandleMsgError").MessageValidationError),l="audio/ogg; codecs=opus",m="audio/mp4",n="audio/mpeg",o="audio/aac",p="audio/amr",q="image/jpeg",r="image/png",s="image/webp",t="video/mp4",u="video/3gpp",v="video/",w="image/";function a(a){return x(a)||a.startsWith(w)}function x(a){return a.startsWith(v)}function y(a){var b,c;c=(b={},b[(c=d("WAWebMsgType")).MSG_TYPE.IMAGE]=new Set([q,r,s]),b[c.MSG_TYPE.STICKER]=d("WAWebStickerMimeUtils").getValidStickerMimeTypes(),b[c.MSG_TYPE.VIDEO]=new Set([t,u]),b[c.MSG_TYPE.AUDIO]=new Set([l,m,n,o,p]),b[c.MSG_TYPE.PTT]=new Set([l,m,n,o,p]),b);return c[a]}function z(a){a=c("WAWebURLUtils").hostname(a);return a.endsWith(".whatsapp.net")||a==="whatsapp.net"}var A=function(a){return a.id==null};function e(a,b,e,f){var g=a.mediaKey,l=a.fileSha256,m=a.fileEncSha256,n=a.fileLength,o=a.url;a=a.mimetype;e=e==="relay"||e==="outgoing";if(!e){return{mediaKey:g,fileSha256:l,fileEncSha256:m,fileLength:d("WALongInt").numberOrThrowIfTooLarge((e=n)!=null?e:0),url:o,mimetype:a}}if(A(b)){return{mediaKey:g,fileSha256:l,fileEncSha256:m,fileLength:d("WALongInt").numberOrThrowIfTooLarge((e=n)!=null?e:0),url:o,mimetype:a}}if(!c("WAWebNewsletterIsNewsletterMsg")({from:b.from,to:b.to})){if(g==null)throw new k(f,j.MISSING_MEDIA_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MEDIA_KEY);if(g.byteLength!==32)throw new k(f,j.INVALID_MEDIA_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MEDIA_KEY);if(m!=null&&m.byteLength!==32)throw new k(f,j.INVALID_ENC_SHA256,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_FILE_SHA256)}if((l==null?void 0:l.byteLength)!==32)throw new k(f,j.INVALID_SHA256,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_FILE_SHA256);if(o!=null&&(!c("WAWebURLUtils").isHttps(o)||!z(o)))throw new k(f,j.INVALID_URL,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MEDIA_URL);if(f===d("WAWebMsgType").MSG_TYPE.STICKER_PACK&&a!=null)throw new k(f,j.INVALID_MIME_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MIME_TYPE);if(a==null&&f!==d("WAWebMsgType").MSG_TYPE.STICKER_PACK)throw new k(f,j.INVALID_MIME_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MIME_TYPE);e=y(f);if(a!=null&&e!=null&&!e.has(a)){d("WALogger").LOG(i(),a,f);throw new k(f,j.INVALID_MIME_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_MIME_TYPE)}var p;f===d("WAWebMsgType").MSG_TYPE.STICKER?n!=null?(p=d("WALongInt").numberOrThrowIfTooLarge(n),b=p>=0):b=!0:f===d("WAWebMsgType").MSG_TYPE.DOCUMENT?n==null?b=!1:(p=d("WALongInt").numberOrThrowIfTooLarge(n),b=p>=0):n==null?b=!1:(p=d("WALongInt").numberOrThrowIfTooLarge(n),b=p>0);if(!b){d("WALogger").LOG(h(),n,typeof n,f);throw new k(f,j.INVALID_FILE_LENGTH,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_IMAGE_FILE_LENGTH,{sendLogs:f===d("WAWebMsgType").MSG_TYPE.IMAGE?.01:!0})}return{mediaKey:g,fileSha256:l,fileEncSha256:m,fileLength:p,url:o,mimetype:a}}g.MediaMessageValidationError=k;g.isMediaMimeType=a;g.isVideoMimeType=x;g.isWhatsAppSubdomain=z;g.getValidatedMediaMessageProperties=e}),98); __d("WAWebParseStickerPackMessageProto",["WALongInt","WATimeUtils","WAWebE2EProtoParserApi","WAWebMediaMessageGetValidatedProperties","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b,c=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;c=c.stickerPackMessage;if(c==null)return null;var f=c.caption;a=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(c,e,a,d("WAWebMsgType").MSG_TYPE.STICKER_PACK);var g=a.mediaKey,h=a.fileSha256,i=a.fileEncSha256;a=a.url;var j=[];(b=c.stickers)==null?void 0:b.forEach(function(a){j.push({fileName:a.fileName,emojis:a.emojis,isLottie:a.isLottie,mimetype:a.mimetype,isAnimated:a.isAnimated})});a=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.STICKER_PACK,kind:d("WAWebMsgType").MsgKind.StickerPack,caption:f,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(a),description:c.packDescription,isCaptionByUser:f!=null,filename:c.name,filehash:d("WAWebE2EProtoParserApi").decodeBytes(h),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(i),mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(g),directPath:c.directPath,stickerPackId:c.stickerPackId,thumbnailDirectPath:c.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(c.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(c.thumbnailEncSha256),mediaKeyTimestamp:c.mediaKeyTimestamp!=null?d("WALongInt").numberOrThrowIfTooLarge(c.mediaKeyTimestamp):d("WATimeUtils").unixTime(),stickers:j,stickerPackPublisher:c.publisher,stickerPackSize:d("WALongInt").numberOrThrowIfTooLarge((b=c.stickerPackSize)!=null?b:0),trayIconFileName:c.trayIconFileName,size:d("WALongInt").numberOrThrowIfTooLarge((e=c.fileLength)!=null?e:0)});return{msgData:a,contextInfo:null}}g["default"]=a}),98); __d("WAWebParseVcardMessageProto",["WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.contactMessage;if(b==null)return;var c=b.contextInfo,e=b.displayName;b=b.vcard;a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.VCARD,kind:d("WAWebMsgType").MsgKind.Vcard,body:b,vcardFormattedName:e});return{msgData:a,contextInfo:c}}g["default"]=a}),98); __d("WAWebAudioMessageProtoUtils",["WALogger","WAWebE2EProtoParserApi"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["fileLength is missing from msg type ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["seconds is 0 in msg type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["seconds is missing from msg type ",""]);j=function(){return a};return a}function a(a,b){if(!d("WAWebE2EProtoParserApi").shouldLogE2eProtoValidation(a,b))return;a=a.type;b.seconds==null?d("WALogger").LOG(j(),a).sendLogs(a+"-message-missing-seconds"):b.seconds===0&&d("WALogger").LOG(i(),a).sendLogs(a+"-message-incorrect-seconds");b.fileLength==null&&d("WALogger").LOG(h(),a).sendLogs(a+"-message-missing-fileLength")}function b(a){return a.byteLength>=64&&a.byteLength<=192}g.validateRequiredAudioProperties=a;g.validateWaveform=b}),98); __d("WAWebPttParseAudioMessageProto",["WALongInt","WATimeUtils","WAWebAudioMessageProtoUtils","WAWebE2EProtoParserApi","WAWebMediaMessageGetValidatedProperties","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.audioMessage;if(b==null)return;var e=b.ptt;if(e===!0)return;e=b.contextInfo;var f=b.directPath,g=b.mimetype,h=b.seconds,i=b.mediaKeyTimestamp,j=b.streamingSidecar,k=b.waveform,l=b.backgroundArgb,m=b.viewOnce;a=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,c,a,d("WAWebMsgType").MSG_TYPE.AUDIO);var n=a.mediaKey,o=a.fileSha256,p=a.fileEncSha256,q=a.fileLength;a=a.url;c=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.AUDIO,kind:d("WAWebMsgType").MsgKind.Audio,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(a),directPath:f,mimetype:g,filehash:d("WAWebE2EProtoParserApi").decodeBytes(o),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(p),size:q,duration:""+(h||0),mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(n),mediaKeyTimestamp:i!=null?d("WALongInt").numberOrThrowIfTooLarge(i):d("WATimeUtils").unixTime(),streamingSidecar:j,waveform:k&&d("WAWebAudioMessageProtoUtils").validateWaveform(k)?new Uint8Array(k):void 0,backgroundColor:l,isViewOnce:m===!0});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(c,b);d("WAWebAudioMessageProtoUtils").validateRequiredAudioProperties(c,b);return{msgData:c,contextInfo:e}}g["default"]=a}),98); __d("WAWebPttParsePttMessageProto",["WALongInt","WATimeUtils","WAWebAudioMessageProtoUtils","WAWebE2EProtoParserApi","WAWebMediaMessageGetValidatedProperties","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.audioMessage;if(b==null)return;var e=b.ptt;if(e!==!0)return;e=b.contextInfo;var f=b.directPath,g=b.mimetype,h=b.seconds,i=b.mediaKeyTimestamp,j=b.streamingSidecar,k=b.waveform,l=b.backgroundArgb,m=b.viewOnce;a=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,c,a,d("WAWebMsgType").MSG_TYPE.PTT);var n=a.mediaKey,o=a.fileSha256,p=a.fileEncSha256,q=a.fileLength;a=a.url;c=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.PTT,kind:d("WAWebMsgType").MsgKind.Ptt,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(a),directPath:f,mimetype:g,filehash:d("WAWebE2EProtoParserApi").decodeBytes(o),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(p),size:q,duration:""+(h||0),mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(n),mediaKeyTimestamp:i!=null?d("WALongInt").numberOrThrowIfTooLarge(i):d("WATimeUtils").unixTime(),streamingSidecar:j,waveform:k&&d("WAWebAudioMessageProtoUtils").validateWaveform(k)?new Uint8Array(k):void 0,backgroundColor:l,isViewOnce:m===!0});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(c,b);d("WAWebAudioMessageProtoUtils").validateRequiredAudioProperties(c,b);return{msgData:c,contextInfo:e}}g["default"]=a}),98); __d("WABase64Sanitize",["WALogger"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["base64 sanitized due to extra whitespace"]);h=function(){return a};return a}function a(a){if(a==null)return null;var b=a.replace(/\s+$/,"");a!==b&&Math.random()<1e-5&&d("WALogger").WARN(h()).sendLogs("media-key-sanitize");return b}g["default"]=a}),98); __d("WAWebStickersParseStickerMessageProto",["WABase64Sanitize","WALongInt","WATimeUtils","WAWebE2EProtoParserApi","WAWebMediaMessageGetValidatedProperties","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;var f=b==null?void 0:b.lottieStickerMessage;f=f==null?void 0:(f=f.message)==null?void 0:f.stickerMessage;b=b==null?void 0:b.stickerMessage;f!=null&&(b=f);if(b==null)return;f=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,e,a,d("WAWebMsgType").MSG_TYPE.STICKER);a=f.mediaKey;var g=f.fileSha256,h=f.fileEncSha256;f=f.url;e=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.STICKER,kind:d("WAWebMsgType").MsgKind.Sticker,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(f),directPath:b.directPath||"",mimetype:b.mimetype||"",filehash:d("WAWebE2EProtoParserApi").decodeBytes(g),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(h),mediaKey:c("WABase64Sanitize")(d("WAWebE2EProtoParserApi").decodeBytes(a)),mediaKeyTimestamp:b.mediaKeyTimestamp!=null?d("WALongInt").numberOrThrowIfTooLarge(b.mediaKeyTimestamp):d("WATimeUtils").unixTime(),height:b.height||0,width:b.width||0,firstFrameLength:b.firstFrameLength,firstFrameSidecar:b.firstFrameSidecar,isAnimated:b.isAnimated,isLottie:b.isLottie,stickerSentTs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.stickerSentTs),isAvatar:b.isAvatar});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(e,b);return{msgData:e,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebMessagePluginParseProtobufRegistry",["WAWebAlbumsParseAlbumMessageProto","WAWebEventsParseEventCreationMessageProto","WAWebEventsParseEventEditEncryptedMessageProto","WAWebEventsParseEventResponseMessageProto","WAWebParseBizContentPlaceholderProto","WAWebParseBotFeedbackProtocolMessageProto","WAWebParseBotMemuOnboardingMessageProto","WAWebParseBotRequestWelcomeMessageProto","WAWebParseButtonsResponseMessageProto","WAWebParseCancelPaymentMessageProto","WAWebParseChatMessageProto","WAWebParseDeclinePaymentMessageProto","WAWebParseDocumentMessageProto","WAWebParseEncCommentMessageProto","WAWebParseEphemeralSyncResponseMessageProto","WAWebParseExtendedTextUrlChatMessageProto","WAWebParseGroupInviteMessageProto","WAWebParseHsmMessageProto","WAWebParseImageMessageProto","WAWebParseInteractiveMessageProto","WAWebParseInteractiveResponseMessageProto","WAWebParseKeepInChatMessageProto","WAWebParseListMessageProto","WAWebParseListResponseMessageProto","WAWebParseLocationMessageProto","WAWebParseMultiVcardMessageProto","WAWebParseNativeFlowButtonsMessageProto","WAWebParseNewsletterAdminInviteMessageProto","WAWebParseOrderMessageProto","WAWebParsePaymentInviteMessageProto","WAWebParsePinMessageProto","WAWebParsePollResultSnapshotMessageProto","WAWebParseProductMessageProto","WAWebParseProtocolAdminRevokeMessageProto","WAWebParseProtocolEphemeralSettingMessageProto","WAWebParseProtocolHistorySyncNotificationMessageProto","WAWebParseProtocolMessageEditProto","WAWebParseProtocolSenderRevokeMessageProto","WAWebParseProtocolSharePhoneNumberMessageProto","WAWebParseProtocolStatusGroupMentionMessageProto","WAWebParseProtocolStatusMentionMessageProto","WAWebParseProtocolStatusNotificationMessageProto","WAWebParseRequestPaymentMessageProto","WAWebParseRequestPhoneNumberMessageProto","WAWebParseRichResponseMessageProto","WAWebParseSendPaymentMessageProto","WAWebParseStickerPackMessageProto","WAWebParseTemplateButtonReplyMessageProto","WAWebParseVcardMessageProto","WAWebParseVideoMessageProto","WAWebPollsParsePollCreationMessageProto","WAWebPollsParsePollVoteMessageProto","WAWebPttParseAudioMessageProto","WAWebPttParsePttMessageProto","WAWebPtvParsePtvMessageProto","WAWebReactionsParseReactionEncMessageProto","WAWebReactionsParseReactionMessageProto","WAWebStickersParseStickerMessageProto"],(function(a,b,c,d,e,f,g){a=[c("WAWebAlbumsParseAlbumMessageProto"),c("WAWebEventsParseEventCreationMessageProto"),c("WAWebEventsParseEventEditEncryptedMessageProto"),c("WAWebEventsParseEventResponseMessageProto"),c("WAWebParseBizContentPlaceholderProto"),c("WAWebParseBotFeedbackProtocolMessageProto"),c("WAWebParseBotMemuOnboardingMessageProto"),c("WAWebParseBotRequestWelcomeMessageProto"),c("WAWebParseButtonsResponseMessageProto"),c("WAWebParseCancelPaymentMessageProto"),c("WAWebParseChatMessageProto"),c("WAWebParseDeclinePaymentMessageProto"),c("WAWebParseDocumentMessageProto"),c("WAWebParseEncCommentMessageProto"),c("WAWebParseEphemeralSyncResponseMessageProto"),c("WAWebParseExtendedTextUrlChatMessageProto"),c("WAWebParseGroupInviteMessageProto"),c("WAWebParseHsmMessageProto"),c("WAWebParseImageMessageProto"),c("WAWebParseInteractiveMessageProto"),c("WAWebParseInteractiveResponseMessageProto"),c("WAWebParseKeepInChatMessageProto"),c("WAWebParseListMessageProto"),c("WAWebParseListResponseMessageProto"),c("WAWebParseLocationMessageProto"),c("WAWebParseMultiVcardMessageProto"),c("WAWebParseNativeFlowButtonsMessageProto"),c("WAWebParseNewsletterAdminInviteMessageProto"),c("WAWebParseOrderMessageProto"),c("WAWebParsePaymentInviteMessageProto"),c("WAWebParsePinMessageProto"),c("WAWebParsePollResultSnapshotMessageProto"),c("WAWebParseProductMessageProto"),c("WAWebParseProtocolAdminRevokeMessageProto"),c("WAWebParseProtocolEphemeralSettingMessageProto"),c("WAWebParseProtocolHistorySyncNotificationMessageProto"),c("WAWebParseProtocolMessageEditProto"),c("WAWebParseProtocolSenderRevokeMessageProto"),c("WAWebParseProtocolSharePhoneNumberMessageProto"),c("WAWebParseProtocolStatusGroupMentionMessageProto"),c("WAWebParseProtocolStatusMentionMessageProto"),c("WAWebParseProtocolStatusNotificationMessageProto"),c("WAWebParseRequestPaymentMessageProto"),c("WAWebParseRequestPhoneNumberMessageProto"),c("WAWebParseRichResponseMessageProto"),c("WAWebParseSendPaymentMessageProto"),c("WAWebParseStickerPackMessageProto"),c("WAWebParseTemplateButtonReplyMessageProto"),c("WAWebParseVcardMessageProto"),c("WAWebParseVideoMessageProto"),c("WAWebPollsParsePollCreationMessageProto"),c("WAWebPollsParsePollVoteMessageProto"),c("WAWebPttParseAudioMessageProto"),c("WAWebPttParsePttMessageProto"),c("WAWebPtvParsePtvMessageProto"),c("WAWebReactionsParseReactionEncMessageProto"),c("WAWebReactionsParseReactionMessageProto"),c("WAWebStickersParseStickerMessageProto")];g["default"]=a}),98); __d("WAWebMessagePluginProcessAsAddonRegistry",["WAWebAddonCommentMsgProcessor","WAWebEventEditAddonMessageProcessor","WAWebEventResponseAddonMessageProcessor","WAWebPinAddonMessageProcessor","WAWebPollVoteAddonMessageProcessor","WAWebReactionAddonMessageProcessor"],(function(a,b,c,d,e,f,g){a=[{type:"album",processor:null},{type:"audio",processor:null},{type:"biz_content_placeholder",processor:null},{type:"buttons_response",processor:null},{type:"chat",processor:null},{type:"chat",processor:null},{type:"ciphertext",processor:null},{type:"ciphertext",processor:null},{type:"ciphertext",processor:null},{type:"ciphertext",processor:null},{type:"ciphertext",processor:null},{type:"comment",processor:c("WAWebAddonCommentMsgProcessor")},{type:"debug_placeholder",processor:null},{type:"document",processor:null},{type:"event_creation",processor:null},{type:"event_edit_encrypted",processor:c("WAWebEventEditAddonMessageProcessor")},{type:"event_response",processor:c("WAWebEventResponseAddonMessageProcessor")},{type:"groups_v4_invite",processor:null},{type:"hsm",processor:null},{type:"image",processor:null},{type:"interactive",processor:null},{type:"interactive_response",processor:null},{type:"keep_in_chat",processor:null},{type:"list",processor:null},{type:"list_response",processor:null},{type:"location",processor:null},{type:"multi_vcard",processor:null},{type:"native_flow",processor:null},{type:"newsletter_admin_invite",processor:null},{type:"notification_template",processor:null},{type:"order",processor:null},{type:"payment",processor:null},{type:"payment",processor:null},{type:"payment",processor:null},{type:"payment",processor:null},{type:"payment",processor:null},{type:"pin_message",processor:c("WAWebPinAddonMessageProcessor")},{type:"pinned_message",processor:null},{type:"poll_creation",processor:null},{type:"poll_result_snapshot",processor:null},{type:"poll_update",processor:c("WAWebPollVoteAddonMessageProcessor")},{type:"product",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"protocol",processor:null},{type:"ptt",processor:null},{type:"ptv",processor:null},{type:"reaction",processor:c("WAWebReactionAddonMessageProcessor")},{type:"reaction_enc",processor:c("WAWebReactionAddonMessageProcessor")},{type:"request_phone_number",processor:null},{type:"revoked",processor:null},{type:"revoked",processor:null},{type:"rich_response",processor:null},{type:"status_notification",processor:null},{type:"sticker",processor:null},{type:"sticker-pack",processor:null},{type:"template_button_reply",processor:null},{type:"unknown",processor:null},{type:"unknown",processor:null},{type:"unknown",processor:null},{type:"unknown",processor:null},{type:"unknown",processor:null},{type:"vcard",processor:null},{type:"video",processor:null}];g["default"]=a}),98); __d("WAWebMultipleMessageParserPluginParseProtobuf",["WAWebMultipleMessageParserPluginParseProtobufRegistry"],(function(a,b,c,d,e,f,g){function a(a){var b=[],d;for(var e of c("WAWebMultipleMessageParserPluginParseProtobufRegistry")){var f=e(a);if(f!=null){var g;b.push(f.msgData.type+":"+((g=f.msgData.subtype)!=null?g:"null"));d==null&&(d=f)}}return{result:d,pluginsMatched:b}}g.parseProtobufWithMultipleMessageParserPlugin=a}),98); __d("WAWebMultipleMessageParserPluginParseProtobufRegistry",["WAWebParseHistorySyncProtocolMessageEditProto","WAWebParseNonNFMButtonsMessageProto","WAWebParseTemplateMessageProto"],(function(a,b,c,d,e,f,g){a=[c("WAWebParseHistorySyncProtocolMessageEditProto"),c("WAWebParseNonNFMButtonsMessageProto"),c("WAWebParseTemplateMessageProto")];g["default"]=a}),98); __d("WAWebButtonsMessageProtoUtils",["WAWebE2EProtoUtils","WAWebMsgType","WAWebParseDocumentMessageProto","WAWebParseImageMessageProto","WAWebParseLocationMessageProto","WAWebParseVideoMessageProto","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.buttonsMessage,e=a.baseMessage,f=a.msgContext,g=b.documentMessage,h=b.imageMessage,i=b.locationMessage,j=b.videoMessage,k=b.contentText;a=b.footerText;var l=b.text;b=b.headerType;var m=function(){var a=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat,title:l==null?e.title:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(l),body:k==null?e.body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(k)});if(h){var b;return(b=(b=c("WAWebParseImageMessageProto")({messageProtobuf:{imageMessage:h},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(g){return(b=(b=c("WAWebParseDocumentMessageProto")({messageProtobuf:{documentMessage:g},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(i){return(b=(b=c("WAWebParseLocationMessageProto")({messageProtobuf:{locationMessage:babelHelpers["extends"]({},i,{name:void 0,address:void 0})},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(j){return(b=(b=c("WAWebParseVideoMessageProto")({messageProtobuf:{videoMessage:j},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}return a};m=m();return babelHelpers["extends"]({},m,{headerType:b,caption:k!=null?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(k):m.caption,footer:a!=null?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(a):m.footer})}function b(a,b,c){var e=a.documentMessage,f=a.imageMessage,g=a.locationMessage,h=a.videoMessage;if(b.isForwarded&&(e||f||g||h))return a;a={buttons:b.isForwarded===!0?void 0:b.dynamicReplyButtons,footerText:b.footer,contextInfo:c};e?(a.documentMessage=e,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.DOCUMENT,a.contentText=b.caption):f?(a.imageMessage=f,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.IMAGE,a.contentText=b.caption):g?(a.locationMessage=g,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.LOCATION,a.contentText=b.caption):h?(a.videoMessage=h,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.VIDEO,a.contentText=b.caption):b.title?(a.text=b.title,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.TEXT,a.contentText=b.body):(a.contentText=b.body,a.headerType=d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.EMPTY);return{buttonsMessage:a}}g.parseButtonsMessageProto=a;g.createDynamicReplyButtonsMessage=b}),98); __d("WAWebCommonMsgSubtypeTypes",[],(function(a,b,c,d,e,f){a=Object.freeze({Subject:"subject",Add:"add",Remove:"remove",Leave:"leave",Picture:"picture",Modify:"modify",Suspend:"suspend",Delete:"delete",Create:"create",Promote:"promote",Demote:"demote",Invite:"invite",RevokeInvite:"revoke_invite",Description:"description",ParentGroupDescription:"parent_group_description",Restrict:"restrict",Announce:"announce",AnnounceMsgBounce:"announce_msg_bounce",V4AddInviteSent:"v4_add_invite_sent",V4AddInviteJoin:"v4_add_invite_join",NoFrequentlyForwarded:"no_frequently_forwarded",InitialPHashMismatch:"initial_pHash_mismatch",Ephemeral:"ephemeral",GrowthLocked:"growth_locked",GrowthUnlocked:"growth_unlocked",ParentGroupLink:"parent_group_link",SiblingGroupLink:"sibling_group_link",SubGroupLink:"sub_group_link",ParentGroupUnlink:"parent_group_unlink",SiblingGroupUnlink:"sibling_group_unlink",SubGroupUnlink:"sub_group_unlink",LinkedGroupJoin:"linked_group_join",DeleteParentGroup:"delete_parent_group",DeleteParentGroupUnlink:"delete_parent_group_unlink",DeleteParentSubGroupUnlink:"delete_parent_sub_group_unlink",IntegrityParentGroupUnlink:"integrity_parent_group_unlink",IntegritySubGroupUnlink:"integrity_sub_group_unlink",LinkedGroupPromote:"linked_group_promote",LinkedGroupDemote:"linked_group_demote",MembershipApprovalMode:"membership_approval_mode",MembershipApprovalRequest:"membership_approval_request",MemberAddMode:"member_add_mode",CreatedMembershipRequests:"created_membership_requests",RevokedMembershipRequests:"revoked_membership_requests",AutoAdd:"auto_add",DefaultSubGroupAdminAdd:"default_sub_group_admin_add",DefaultSubGroupPromote:"default_sub_group_promote",DefaultSubGroupDemote:"default_sub_group_demote",InviteAutoAdd:"invite_auto_add",CommunityParticipantAddRich:"community_participant_add_rich",CommunityInviteRich:"community_invite_rich",SubGroupParticipantAddRich:"sub_group_participant_add_rich",SubGroupInviteRich:"sub_group_invite_rich",CommunityLinkParentGroupRich:"community_link_parent_group_rich",CommunityInviteAutoAddRich:"community_invite_auto_add_rich",AllowNonAdminSubGroupCreation:"allow_non_admin_sub_group_creation",AllowAdminReports:"allow_admin_reports",CreatedSubgroupSuggestion:"created_subgroup_suggestion",RevokedSubGroupSuggestions:"revoked_sub_group_suggestions",AdminReportReceived:"admin_report_received",SubgroupSuggestionsChangeNumber:"subgroup_suggestions_change_number",SubgroupAdminTriggeredAutoAdd:"subgroup_admin_triggered_auto_add",SubgroupAdminTriggeredInviteAutoAdd:"subgroup_admin_triggered_invite_auto_add",EmptySubgroupCreate:"empty_subgroup_create",GeneralChatAdd:"general_chat_add",GeneralChatAutoAddDisabled:"general_chat_auto_add_disabled",CommunityOwnerUpdate:"community_owner_update",HiddenGroup:"hidden_group",GroupSafetyCheck:"group_safety_check",GroupAdder:"group_adder",Url:"url",Encrypt:"encrypt",EncryptNow:"encrypt_now",E2EIdentityUnavailable:"e2e_identity_unavailable",Identity:"identity",Device:"device",ChatPsa:"chat_psa",ErrorInDeviceList:"error_in_device_list",Miss:"miss",MissVideo:"miss_video",MissGroup:"miss_group",MissGroupVideo:"miss_group_video",Silence:"silence",AdminRevoke:"admin_revoke",SenderRevoke:"sender_revoke",EphemeralSetting:"ephemeral_setting",EphemeralSyncResponse:"ephemeral_sync_response",SharePhoneNumber:"share_phone_number",AppStateFatalExceptionNotification:"app_state_fatal_exception_notification",AppStateSyncKeyShare:"app_state_sync_key_share",AppStateSyncKeyRequest:"app_state_sync_key_request",HistorySyncNotification:"history_sync_notification",MessageEdit:"message_edit",BotFeedback:"bot_feedback",BotMemuOnboarding:"bot_memu_onboarding",BotRequestWelcome:"bot_request_welcome",StatusMentionMessage:"status_mention_message",StatusGroupMentionMessage:"status_group_mention_message",StatusNotificationMessage:"status_notification_message",Request:"request",Send:"send",Ciphertext:"ciphertext",Futureproof:"futureproof",PollVote:"poll_vote",Sender:"sender",Admin:"admin",Phone:"phone",PhoneOnlyFeature:"phone_only_feature",Reaction:"reaction",NonVerifiedTransition:"non_verified_transition",UnverifiedTransition:"unverified_transition",VerifiedTransition:"verified_transition",VerifiedLowUnknown:"verified_low_unknown",VerifiedHigh:"verified_high",VerifiedInitialUnknown:"verified_initial_unknown",VerifiedInitialLow:"verified_initial_low",VerifiedInitialHigh:"verified_initial_high",VerifiedTransitionAnyToNone:"verified_transition_any_to_none",VerifiedTransitionAnyToHigh:"verified_transition_any_to_high",VerifiedTransitionHighToLow:"verified_transition_high_to_low",VerifiedTransitionHighToUnknown:"verified_transition_high_to_unknown",VerifiedTransitionUnknownToLow:"verified_transition_unknown_to_low",VerifiedTransitionLowToUnknown:"verified_transition_low_to_unknown",VerifiedTransitionNoneToLow:"verified_transition_none_to_low",VerifiedTransitionNoneToUnknown:"verified_transition_none_to_unknown",PaymentTransactionStatusUpdateFailed:"payment_transaction_status_update_failed",PaymentTransactionStatusUpdateRefunded:"payment_transaction_status_update_refunded",PaymentTransactionStatusUpdateRefundFailed:"payment_transaction_status_update_refund_failed",PaymentTransactionStatusReceiverPendingSetup:"payment_transaction_status_receiver_pending_setup",PaymentTransactionStatusReceiverSuccessAfterHiccup:"payment_transaction_status_receiver_success_after_hiccup",PaymentTransactionRequestCancelled:"payment_transaction_request_cancelled",PaymentActionAccountSetupReminder:"payment_action_account_setup_reminder",PaymentActionSendPaymentReminder:"payment_action_send_payment_reminder",PaymentActionSendPaymentInvitation:"payment_action_send_payment_invitation",PaymentActionRequestDeclined:"payment_action_request_declined",PaymentActionRequestExpired:"payment_action_request_expired",PaymentInviteAccountSetUp:"payment_invite_account_set_up",BizVerifiedTransitionTopToBottom:"biz_verified_transition_top_to_bottom",BizVerifiedTransitionBottomToTop:"biz_verified_transition_bottom_to_top",BizIntroTop:"biz_intro_top",BizIntroBottom:"biz_intro_bottom",BizNameChange:"biz_name_change",BizMoveToConsumerApp:"biz_move_to_consumer_app",BizTwoTierMigrationTop:"biz_two_tier_migration_top",BizTwoTierMigrationBottom:"biz_two_tier_migration_bottom",SenderInvite:"sender_invite",ReceiverInvite:"receiver_invite",ChangeNumber:"change_number",ChangeUsername:"change_username",MaskedThreadCreated:"masked_thread_created",CagMaskedThreadCreated:"cag_masked_thread_created",InfoEncrypted:"info_encrypted",DescAdd:"desc_add",DescRemove:"desc_remove",Fanout:"fanout",BotUnavailableFanout:"bot_unavailable_fanout",HostedUnavailableFanout:"hosted_unavailable_fanout",ViewOnceUnavailableFanout:"view_once_unavailable_fanout",DisappearingMode:"disappearing_mode",DisappearingModeUpdate:"disappearing_mode_update",DisappearingModeUnsupported:"disappearing_mode_unsupported",BlockContact:"block_contact",CommunityCreate:"community_create",EphemeralKeepInChat:"ephemeral_keep_in_chat",KeepInChat:"keep_in_chat",ChatAssignment:"chat_assignment",PeerDataOperationRequestMessage:"peer_data_operation_request_message",ChatAssignmentUnassign:"chat_assignment_unassign",PeerDataOperationRequestResponseMessage:"peer_data_operation_request_response_message",MarketingMessagesFromBusinessStopped:"marketing_messages_from_business_stopped",MarketingMessagesFromBusinessResumed:"marketing_messages_from_business_resumed",NewsletterCreated:"newsletter_created",NewsletterPrivacy:"newsletter_privacy",NewsletterDeleted:"newsletter_deleted",NewsletterAdminContextCard:"newsletter_admin_context_card",PollCreation:"poll_creation",PollUpdate:"poll_update",ContactInfoCard:"contact_info_card",OrderEphemeralExemption:"order_ephemeral_exemption",BotInit:"bot_init",BotTypingPlaceholder:"bot_typing_placeholder",BotInvokeDisclaimer:"bot_invoke_disclaimer",BizBot1PDisclosure:"biz_bot_1p_disclosure",BizBot3PDisclosure:"biz_bot_3p_disclosure",BlueMsgBspFbToBspPremise:"blue_msg_bsp_fb_to_bsp_premise",BlueMsgBspFbToSelfFb:"blue_msg_bsp_fb_to_self_fb",BlueMsgBspFbToSelfPremise:"blue_msg_bsp_fb_to_self_premise",BlueMsgBspFbUnverified:"blue_msg_bsp_fb_unverified",BlueMsgBspFbUnverifiedToBspPremiseVerified:"blue_msg_bsp_fb_unverified_to_bsp_premise_verified",BlueMsgBspFbUnverifiedToSelfFbVerified:"blue_msg_bsp_fb_unverified_to_self_fb_verified",BlueMsgBspFbUnverifiedToSelfPremiseVerified:"blue_msg_bsp_fb_unverified_to_self_premise_verified",BlueMsgBspFbVerified:"blue_msg_bsp_fb_verified",BlueMsgBspFbVerifiedToBspPremiseUnverified:"blue_msg_bsp_fb_verified_to_bsp_premise_unverified",BlueMsgBspFbVerifiedToSelfFbUnverified:"blue_msg_bsp_fb_verified_to_self_fb_unverified",BlueMsgBspFbVerifiedToSelfPremiseUnverified:"blue_msg_bsp_fb_verified_to_self_premise_unverified",BlueMsgBspPremiseToSelfPremise:"blue_msg_bsp_premise_to_self_premise",BlueMsgBspPremiseUnverified:"blue_msg_bsp_premise_unverified",BlueMsgBspPremiseUnverifiedToSelfPremiseVerified:"blue_msg_bsp_premise_unverified_to_self_premise_verified",BlueMsgBspPremiseVerified:"blue_msg_bsp_premise_verified",BlueMsgBspPremiseVerifiedToSelfPremiseUnverified:"blue_msg_bsp_premise_verified_to_self_premise_unverified",BlueMsgConsumerToBspFbUnverified:"blue_msg_consumer_to_bsp_fb_unverified",BlueMsgConsumerToBspPremiseUnverified:"blue_msg_consumer_to_bsp_premise_unverified",BlueMsgConsumerToSelfFbUnverified:"blue_msg_consumer_to_self_fb_unverified",BlueMsgConsumerToSelfPremiseUnverified:"blue_msg_consumer_to_self_premise_unverified",BlueMsgSelfFbToBspPremise:"blue_msg_self_fb_to_bsp_premise",BlueMsgSelfFbToSelfPremise:"blue_msg_self_fb_to_self_premise",BlueMsgSelfFbUnverified:"blue_msg_self_fb_unverified",BlueMsgSelfFbUnverifiedToBspPremiseVerified:"blue_msg_self_fb_unverified_to_bsp_premise_verified",BlueMsgSelfFbUnverifiedToSelfPremiseVerified:"blue_msg_self_fb_unverified_to_self_premise_verified",BlueMsgSelfFbVerified:"blue_msg_self_fb_verified",BlueMsgSelfFbVerifiedToBspPremiseUnverified:"blue_msg_self_fb_verified_to_bsp_premise_unverified",BlueMsgSelfFbVerifiedToSelfPremiseUnverified:"blue_msg_self_fb_verified_to_self_premise_unverified",BlueMsgSelfPremiseToBspPremise:"blue_msg_self_premise_to_bsp_premise",BlueMsgSelfPremiseUnverified:"blue_msg_self_premise_unverified",BlueMsgSelfPremiseVerified:"blue_msg_self_premise_verified",BlueMsgToBspFb:"blue_msg_to_bsp_fb",BlueMsgToConsumer:"blue_msg_to_consumer",BlueMsgToSelfFb:"blue_msg_to_self_fb",BlueMsgUnverifiedToBspFbVerified:"blue_msg_unverified_to_bsp_fb_verified",BlueMsgUnverifiedToBspPremiseVerified:"blue_msg_unverified_to_bsp_premise_verified",BlueMsgUnverifiedToSelfFbVerified:"blue_msg_unverified_to_self_fb_verified",BlueMsgUnverifiedToVerified:"blue_msg_unverified_to_verified",BlueMsgVerifiedToBspFbUnverified:"blue_msg_verified_to_bsp_fb_unverified",BlueMsgVerifiedToBspPremiseUnverified:"blue_msg_verified_to_bsp_premise_unverified",BlueMsgVerifiedToSelfFbUnverified:"blue_msg_verified_to_self_fb_unverified",BlueMsgVerifiedToUnverified:"blue_msg_verified_to_unverified",BizPrivacyModeInitFb:"biz_privacy_mode_init_fb",BizPrivacyModeInitBsp:"biz_privacy_mode_init_bsp",BizPrivacyModeToFb:"biz_privacy_mode_to_fb",BizPrivacyModeToBsp:"biz_privacy_mode_to_bsp",SagaInit:"saga_init",BizAccountTypeChangedToHosted:"biz_account_type_changed_to_hosted",BizMeAccountTypeIsHostedSystemMsg:"biz_me_account_type_is_hosted",BizMeAccountTypeIsHostedSystemMsgTransition:"biz_me_account_type_is_hosted_transition",BizAccountTypeIsHostedSystemMsg:"biz_account_type_is_hosted",EventEditDecrypted:"event_edit_decrypted",HostedGroup:"is_capi_hosted_group",LimitSharingSystemMessage:"limit_sharing_system_message"});f.MsgSubtype=a}),66); __d("WAWebE2EProtoParserForCtwaContext",["WAWebABProps","WAWebBizGatingUtils","WAWebCtwaAGMUtils","WAWebE2EProtoParserApi","WAWebLinkify"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.externalAdReply==null&&!d("WAWebABProps").getABPropConfigValue("wa_web_parse_always_show_ad_attribution"))return;var c={},e=b.alwaysShowAdAttribution,f=b.conversionSource,g=b.conversionData,h=b.ctwaPayload,i=b.ctwaSignals;e!=null&&(c.alwaysShowAdAttribution=e);f!=null&&(c.conversionSource=f);i!=null&&h!=null&&d("WAWebBizGatingUtils").isSignalDecouplingEnabled()?c.conversionData=h:g!=null&&(c.conversionData=g);i!=null&&d("WAWebBizGatingUtils").isSignalDecouplingEnabled()&&(c.ctwaSignals=i);e=b.externalAdReply;if(e!=null){c.sourceUrl=e.sourceUrl;c.description=e.body;c.title=e.title;e.thumbnail!=null&&(c.thumbnail=d("WAWebE2EProtoParserApi").decodeBytes(e.thumbnail));c.thumbnailUrl=e.thumbnailUrl;c.mediaType=e.mediaType;c.mediaUrl=e.mediaUrl;f=d("WAWebLinkify").findLink(e.sourceUrl||"",!1,a.from);f!=null&&f.suspiciousCharacters!=null&&f.suspiciousCharacters.size!=null&&(c.isSuspiciousLink=f.suspiciousCharacters.size>0);e.adContextPreviewDismissed!=null&&d("WAWebBizGatingUtils").isHideAdContextIfSoftDismissed()&&(c.adContextPreviewDismissed=e.adContextPreviewDismissed);e.sourceApp!=null&&(c.sourceApp=e.sourceApp);h=d("WAWebCtwaAGMUtils").isWamoAGMIntegrationEnabled(e.sourceApp);h&&(e.greetingMessageBody!=null&&(c.greetingMessageBody=e.greetingMessageBody),e.automatedGreetingMessageShown!=null&&(c.automatedGreetingMessageShown=e.automatedGreetingMessageShown),e.ctaPayload!=null&&(c.ctaPayload=e.ctaPayload),e.sourceId!=null&&(c.sourceId=e.sourceId),e.originalImageUrl!=null&&(c.originalImageUrl=e.originalImageUrl))}Object.keys(c).length>0&&(a.ctwaContext=c)}g.parseCtwaContextProto=a}),98); __d("WAWebViewOnceGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("view_once_sp_receiver")}function b(){return d("WAWebABProps").getABPropConfigValue("enable_soox_message_receiving")}function c(){return d("WAWebABProps").getABPropConfigValue("enable_soox_message_sending")}g.isViewOnceSunsetEnabled=a;g.isReceivingViewOnceV2Enabled=b;g.isSendingViewOnceV2Enabled=c}),98); __d("WAWebFutureproofProtoUtils",["WAWebMessageAssociationGatingUtils","WAWebViewOnceGatingUtils"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.viewOnceMessage,c=a.viewOnceMessageV2,e=a.viewOnceMessageV2Extension,f=a.ephemeralMessage,g=a.documentWithCaptionMessage,h=a.groupMentionedMessage,i=a.editedMessage,j=a.pollCreationMessageV4,k=a.pollCreationOptionImageMessage,l=a.associatedChildMessage;a=a.botInvokeMessage;if(h)return h;if(g)return g;if(b)return b;if(d("WAWebViewOnceGatingUtils").isViewOnceSunsetEnabled()){if(c)return c;if(e&&d("WAWebViewOnceGatingUtils").isReceivingViewOnceV2Enabled())return e}if(f)return f;if(i)return i;if(a)return a;if(j)return j;if(k)return k;if(l&&d("WAWebMessageAssociationGatingUtils").isFutureproofAssociatedChildEnabled())return l}g.maybeGetFutureproofMessage=a}),98); __d("WAWebMessageAssociationValidation",["$InternalEnum","WACustomError","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_PARENT_MESSAGE_KEY:"missing_parent_message_key",INVALID_PARENT_MESSAGE_KEY:"invalid_parent_message_key",MISSING_ASSOCIATION_TYPE:"missing_association_type",MISMATCH_SENDER:"mismatch_sender",UNSUPPORTED_ASSOCIATION_TYPE:"unsupported_association_type",INVALID_CHILD_MESSAGE:"invalid_child_message"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="MessageAssociationValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);e=b("$InternalEnum")({MESSAGE_ASSOCIATIONS_MISMATCH:"message_associations_mismatch"});f=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){b="errorCode: "+String(b);c!=null&&(b+=" comment: "+c);return a.call(this,b)||this}return b}(d("WACustomError").customError("MessageAssociationInfraError"));g.MessageAssociationValidationErrorCode=a;g.MessageAssociationValidationError=c;g.MessageAssociationInfraErrorCode=e;g.MessageAssociationInfraError=f}),98); __d("WAWebE2EProtoParser",["WALogger","WANullthrows","WAWebABPropsSaga","WAWebAssociationProtoUtils","WAWebBotGating","WAWebBotMetadataProtoUtils","WAWebCommonMsgSubtypeTypes","WAWebCrashlog","WAWebE2EProtoParserForCtwaContext","WAWebE2EProtoUtils","WAWebFutureproofProtoUtils","WAWebLimitSharingProtoUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationValidation","WAWebMessagePluginParseProtobuf","WAWebMsgType","WAWebParseForwardedNewsletterMessageInfo","WAWebProtobufsE2E.pb","WAWebQuotedMessageProtoUtils","WAWebWamEnumE2eFailureReason","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["InAppSupport: Could not upload logs. No ticketId was provided."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["InAppSupport: Logs upload complete for ticketId=",", logsId=",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["InAppSupport: Logs upload failed for ticketId=",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["InAppSupport: Uploading logs for ticketId=",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseContextInfoProto: failed to parse forwarded newsletter info"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseContextInfoProto: payment not supported"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseMsgProto: Association type mismatch, parsedData Msg type: ",", associationTypeFromProtoCasted: ",", parsedData associationType: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["drop: not Message"]);o=function(){return a};return a}function p(a){var b=a.messageProtobuf,c=a.message,e=a.bizInfo,f=a.msgContext,g=a.paymentInfo,h=a.finalLocation,i=a.quotedPaymentInfo,j=a.editAttr,k=a.rcat,l=a.bizSource,m=a.msgMeta;a=a.msgBotInfo;b||d("WALogger").ERROR(o()).devConsole(b,c).sendLogs("null-message");var n=b.messageContextInfo;b=q({messageProtobuf:b,message:c,msgContext:f,paymentInfo:g,finalLocation:h,quotedPaymentInfo:i,bizInfo:e,editAttr:j,rcat:k,bizSource:l,msgMeta:m,msgBotInfo:a});c=b.contextInfo;g=b.msgData;s(g,c,f,i);x(g,n);return g}function q(a){var b=a.messageProtobuf,c=a.message,e=a.bizInfo,f=a.msgContext,g=a.paymentInfo,h=a.finalLocation,i=a.quotedPaymentInfo,j=a.editAttr,k=a.rcat,l=a.bizSource,m=a.msgMeta;a=a.msgBotInfo;var o,p=b.callLogMesssage,q=d("WAWebAssociationProtoUtils").validateMessageAssociationInMessageContextInfo(c,b.messageContextInfo,f);if(q!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var s=d("WAWebAssociationProtoUtils").getValidatedAssociationFieldsFromProto(q,c,f);if(s.associationType===d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN){var t=c;t=babelHelpers["extends"]({},t,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:"associatedUnknown",associationType:s.associationType,parentMsgKey:s.associationParentMsgKey,viewMode:s.viewMode});return{contextInfo:o,msgData:t}}}s=d("WAWebMessagePluginParseProtobuf").parseProtobuf({messageProtobuf:b,baseMessage:c,msgContext:f,paymentInfo:g,quotedPaymentInfo:i,editAttr:j,bizInfo:e,finalLocation:h,rcat:k,bizSource:l,msgMeta:m,messageAssociation:q,msgBotInfo:a});t=(s==null?void 0:s.msgData.type)===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&(s==null?void 0:s.msgData.futureproofType)!=null;if(s){if(q!=null){g=d("WAWebAssociationProtoUtils").convertAssociationTypeFromProtoToClientSupportedAssociationType(q.associationType);if(!t&&g!==d("WAWebMessageAssociation.flow").MessageAssociationType.BOT_PLUGIN&&(s==null?void 0:s.msgData.associationType)!==g&&(b==null?void 0:(i=b.protocolMessage)==null?void 0:i.type)!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT){d("WALogger").DEV(n(),s==null?void 0:s.msgData.type,g,s==null?void 0:s.msgData.associationType);throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.INVALID_CHILD_MESSAGE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE)}}void d("WAWebLimitSharingProtoUtils").parseLimitSharingFromRegularMessage(c,b.messageContextInfo);r(s.msgData);return s}e=b.deviceSentMessage;e&&u(c,e,f);p&&w(c,p);h=d("WAWebFutureproofProtoUtils").maybeGetFutureproofMessage(b);h!=null&&v({message:c,futureproofMessage:h,msgContext:f,topLevelMessageContextInfo:b.messageContextInfo,editAttr:j});void d("WAWebLimitSharingProtoUtils").parseLimitSharingFromProtocolMessage(c,b);return{contextInfo:o,msgData:c}}function r(a){if(a.isViewOnce!==!0)return;["body","caption","deprecatedMms3Url","directPath","encFilehash","filehash","mediaKey","mediaKeyTimestamp","scanLengths","scansSidecar","size","staticUrl","thumbnailDirectPath","thumbnailEncSha256","thumbnailSha256","url","height","width"].forEach(function(b){a[b]=void 0})}function s(a,b,c,e){if(!b)return;t(a,b,c,e);d("WAWebE2EProtoParserForCtwaContext").parseCtwaContextProto(a,b)}function t(a,b,c,e){var f=b.quotedMessage,g=b.mentionedJid,h=b.groupMentions;if(f!=null&&d("WAWebE2EProtoUtils").isQuotedSupported(f)){var i=a.selectedCarouselCardIndex!=null;a.quotedMsg=d("WAWebQuotedMessageProtoUtils").parseQuotedMessage({quotedMsg:f,msgContext:c,isCarouselCardReply:i,contextInfo:b,targetMessageKey:a.id})}a.quotedMsg&&a.quotedMsg.type==="payment"&&e&&d("WALogger").LOG(m());a.quotedStanzaID=b.stanzaId;a.quotedParticipant=d("WAWebE2EProtoUtils").decodeJid(b.participant);a.quotedRemoteJid=d("WAWebE2EProtoUtils").decodeJid(b.remoteJid);a.quotedGroupSubject=d("WAWebE2EProtoUtils").decodeJid(b.groupSubject);a.quotedParentGroupJid=d("WAWebE2EProtoUtils").decodeJid(b.parentGroupJid);a.mentionedJidList=Array.isArray(g)?g.map(d("WAWebE2EProtoUtils").decodeJid):g;a.groupMentions=Array.isArray(h)?h.map(function(a){return{groupSubject:a.groupSubject,groupJid:d("WAWebE2EProtoUtils").decodeJid(a.groupJid)}}):h;a.isForwarded=b.isForwarded;a.forwardingScore=b.forwardingScore;b.expiration!=null&&(a.ephemeralDuration=b.expiration);b.ephemeralSettingTimestamp!=null&&(a.ephemeralSettingTimestamp=b.ephemeralSettingTimestamp);b.ephemeralSharedSecret!=null&&(a.ephemeralSharedSecret=b.ephemeralSharedSecret);f=b.disappearingMode;if(f!=null){c=d("WAWebE2EProtoUtils").protoToDisappearingModeInitiator(a,f);c!=null&&(a.disappearingModeInitiator=c);i=d("WAWebE2EProtoUtils").protoToDisappearingMode(a,f);i!=null&&(a.disappearingModeTrigger=i.disappearingModeTrigger,a.disappearingModeInitiatedByMe=i.initiatedByMe)}b.actionLink!=null&&(a.actionLink=b.actionLink);b.smbClientCampaignId!=null&&(a.smbClientCampaignId=b.smbClientCampaignId);if(b.forwardedNewsletterMessageInfo!=null)try{a.forwardedNewsletterMessageInfo=d("WAWebParseForwardedNewsletterMessageInfo").parseForwardedNewsletterMessageInfo(b.forwardedNewsletterMessageInfo)}catch(a){d("WALogger").ERROR(l()).devConsole(a).sendLogs("Failed to parse Forwarded Newsletter Message Info.")}}function u(a,b,c){var e=d("WAWebE2EProtoUtils").decodeJid(b.destinationJid);a.id.remote=e;a.to=e;Object.assign(a,p({messageProtobuf:b.message,message:a,msgContext:c}))}function v(a){var b=a.message,d=a.futureproofMessage,e=a.msgContext,f=a.topLevelMessageContextInfo;a=a.editAttr;d=c("WANullthrows")(d.message);f=f==null?babelHelpers["extends"]({},d.messageContextInfo):babelHelpers["extends"]({},d.messageContextInfo,f);Object.assign(b,p({messageProtobuf:babelHelpers["extends"]({},d,{messageContextInfo:f}),message:b,msgContext:e,editAttr:a}))}function w(a,b){a.type=d("WAWebMsgType").MSG_TYPE.CALL_LOG;var c=!!b.isVideo;b.participants.length>1?a.subtype=c?d("WAWebCommonMsgSubtypeTypes").MsgSubtype.MissGroupVideo:d("WAWebCommonMsgSubtypeTypes").MsgSubtype.MissGroup:a.subtype=c?d("WAWebCommonMsgSubtypeTypes").MsgSubtype.MissVideo:d("WAWebCommonMsgSubtypeTypes").MsgSubtype.Miss}function x(a,b){var e;if(!b)return;b.messageSecret!=null&&(a.messageSecret=new Uint8Array(b.messageSecret));(((e=a.id)==null?void 0:(e=e.participant)==null?void 0:e.isBot())||((e=a.id)==null?void 0:(e=e.remote)==null?void 0:e.isBot()))&&d("WAWebBotGating").isBotReceiveEnabled()&&d("WAWebBotMetadataProtoUtils").parseBotMetadataProto(a,b);if(c("WAWebWid").isCAPISupportAccount(a==null?void 0:(e=a.id)==null?void 0:e.remote)&&(b==null?void 0:b.supportPayload)!=null){var f=JSON.parse(b.supportPayload);f.should_show_system_message!=null&&d("WAWebABPropsSaga").getIsSagaProtobufSystemMessageEnabled()&&(a.shouldShowSupportAISystemMessage=f.should_show_system_message);f.is_ai_message!=null&&d("WAWebABPropsSaga").getIsSagaProtobufAIStardustEnabled()&&(a.isSupportAIMessage=f.is_ai_message);Array.isArray(f.citation_items)&&f.citation_items.length>0&&(a.supportCitations=f.citation_items.map(function(a){return{title:a.title,subtitle:a.subtitle,cmsId:a.cms_id,imageUrl:a.image_url}}));if(f.should_upload_client_logs===!0&&d("WAWebABPropsSaga").getIsSagaV1ReengagementEnabled())if(f.ticket_id!=null&&f.ticket_id!=="no_ticket_created"){e=864e5;d("WALogger").LOG(k(),f.ticket_id);b={reason:d("WAWebCrashlog").SERVER_REQUESTED,immediate:!0,isHighPri:!0,logType:d("WAWebCrashlog").LogType.SUPPORT,ticketId:f.ticket_id,fromTimestamp:Date.now()-e};d("WAWebCrashlog").upload(b).then(function(a){a==null?d("WALogger").LOG(j(),f.ticket_id):d("WALogger").LOG(i(),f.ticket_id,a)})}else d("WALogger").LOG(h())}}g.parseMsgProto=p;g.parseContextInfo=s;g.parseContextInfoProto=t;g.parseMessageContextInfoProto=x}),98); __d("WAWebAddonProcessingError",["$InternalEnum","WAWebHandleMsgError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){"use strict";var h=b("$InternalEnum")({MISSING_THREAD_MESSAGE_ID:"missing_thread_message_id",MISSING_THREAD_MESSAGE_SENDER_JID:"missing_thread_message_sender_jid"}),i=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){a="type: "+a+", errorCode: "+String(c);c=b.call(this,a,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE)||this;c.name="PlaceholderValidationError";return c}return a}(d("WAWebHandleMsgError").MessageValidationError);a=function(a,b){var c=a.threadMsgId;a=a.threadMsgSenderJid;if(c==null)throw new i(b,h.MISSING_THREAD_MESSAGE_ID);else if(a==null)throw new i(b,h.MISSING_THREAD_MESSAGE_SENDER_JID);return{threadMsgId:c,threadMsgSenderJid:a}};g.validateMsgMeta=a}),98); __d("WAWebBizTemplateAndInteractiveMessagesUtils",["WAWebABProps","WAWebBizGatingUtils","WAWebInteractiveMessagesNativeFlowName","WAWebMsgGetters"],(function(a,b,c,d,e,f,g){var h=3,i=[(e=c("WAWebInteractiveMessagesNativeFlowName")).QUICK_REPLY,e.CTA_CALL,e.CTA_URL,e.CTA_CATALOG,e.CTA_COPY_CODE,e.CTA_FLOW];function j(a){switch(a){case"review_and_pay":return c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS;case"payment_info":return c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO;case"review_order":return c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS;case"payment_status":return c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_STATUS;case"payment_method":return c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_METHOD;case"open_webview":return c("WAWebInteractiveMessagesNativeFlowName").MESSAGE_WITH_LINK;case"message_with_link_status":return c("WAWebInteractiveMessagesNativeFlowName").MESSAGE_WITH_LINK_STATUS;case"cta_url":return c("WAWebInteractiveMessagesNativeFlowName").CTA_URL;case"cta_call":return c("WAWebInteractiveMessagesNativeFlowName").CTA_CALL;case"quick_reply":return c("WAWebInteractiveMessagesNativeFlowName").QUICK_REPLY;case"cta_catalog":return c("WAWebInteractiveMessagesNativeFlowName").CTA_CATALOG;case"cta_copy":return c("WAWebInteractiveMessagesNativeFlowName").CTA_COPY_CODE;case"galaxy_message":return c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW}}function a(a,b,e){if(d("WAWebMsgGetters").isBizSourceFromMarketingMessage(e))return d("WAWebABProps").getABPropConfigValue("web_premium_messages_interactivity_rendering_enabled");else if(e==="quoted_carousel_card"&&a===c("WAWebInteractiveMessagesNativeFlowName").QUICK_REPLY)return d("WAWebBizGatingUtils").carouselsEnabled();else if(l(a))return!0;return b===!0?d("WAWebABProps").getABPropConfigValue("web_premium_messages_interactivity_rendering_enabled"):!1}var k=function(a){if(a.hydratedTemplateButton!=null)return a.hydratedTemplateButton.quickReplyButton!=null;else if(a.nativeFlowButton!=null)return a.nativeFlowButton.name===String(c("WAWebInteractiveMessagesNativeFlowName").QUICK_REPLY);return!1};function b(a){if(a.length>h)return!0;if(a.length>0){var b=k(a[0]);if(!a.slice(1).every(function(a){var c=k(a);a=a.nativeFlowButton!=null?i.includes(j((a=a.nativeFlowButton)==null?void 0:a.name)):!0;return a&&b===c}))return!0}return!1}function l(a){return i.includes(a)}g.supportedNativeFlowButtonNamesForInteractiveMsg=i;g.getNativeFlowNameByButtonName=j;g.isInteractiveCtaMessageEnabled=a;g.buttonsViolateButtonImprovementsConstraints=b}),98); __d("WATrie",["WANullthrows"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(a){this._children={},this._indices=[],a&&(this._data=a)}a.fromBackwardsStrings=function(b,c){return b.reduce(function(a,b,c){return a.addBackwardsString(b,c)},new a(c))._optimize()};var b=a.prototype;b.addBackwardsString=function(b,c){var d=b.length-1,e=this;while(d>=0){var f=b.charAt(d);e._addIndex(c);e=e.get(f)||e.set(f,new a());d--}e._addIndex(c);return this};a.fromForwardsStrings=function(b,c){return b.reduce(function(a,b,c){return a.addForwardsString(b,c)},new a(c))._optimize()};b.addForwardsString=function(b,c){var d=0,e=this;while(d<b.length){var f=b.charAt(d);e._addIndex(c);e=e.get(f)||e.set(f,new a());d++}e._addIndex(c);return this};b.set=function(a,b){this._children[a]=b;return b};b.get=function(a){return this._children[a]};b.getChildren=function(){var a=this;return Object.keys(this._children).map(function(b){return{prefix:b,node:c("WANullthrows")(a.get(b))}})};b.hasChildren=function(){return!h(this._children)};b.search=function(a){var b=this._data;if(!b)return[];var c=this;for(var d=0;d<a.length;d++){if(!c)break;var e=a[d];c=c.get(e)}if(!c)return[];e=c.getIndices();return e.map(function(a){return b[a]})};b._addIndex=function(a){this._indices.push(a)};b.getIndices=function(){var a=this._indices,b=Object.keys(this._children);return b.length===1&&this._indices.length===0?this._children[b[0]].getIndices():a};b._optimize=function(){var a=this;if(!this.hasChildren())return this;var b=Object.keys(this._children),c=this._children[b[0]]._indices;b.forEach(function(b){a._children[b]._optimize()});b.length===1&&this._indices.length===c.length&&(this._indices=[]);return this};b.testOnlyGetChildrenProperty=function(){return this._children};b.testOnlyGetIndicesProperty=function(){return this._indices};return a}();function h(a){for(a in a)return!1;return!0}g["default"]=a}),98); __d("WAWebEmojiCompile",["WATrie","escapeRegex","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function a(a){a=c("WATrie").fromForwardsStrings(a.sort(function(a,b){return b.length-a.length}).map(function(a){return""+a+i}));return h(null,a,null,0)}function h(a,b,d,e,f){var g=[],k=!1,l=f;if(l==null&&!c("isStringNullOrEmpty")(a))if(e===1){f=j.has(a);f&&(l=!0)}else!c("isStringNullOrEmpty")(d)&&e===2&&(l=j.has(d+a));b.getChildren().forEach(function(b){if(b.prefix===i){k=!0;return}g.push(h(b.prefix,b.node,a,e+1,l))});f=a===String.fromCodePoint(65039)&&d!=null&&l!==!0?String.fromCodePoint(65039)+"?":c("escapeRegex")(a||"");b=g.length===0?"":"(?:"+g.join("|")+")";b&&k&&(b+="?");return""+f+b}var i="\n",j=new Set([String.fromCodePoint(169),String.fromCodePoint(174),String.fromCodePoint(8482),String.fromCodePoint(9823),String.fromCodePoint(9854),String.fromCodePoint(12336)]);g["default"]=a}),98); __d("WAWebSpecialEmojisWithSkinTones",[],(function(a,b,c,d,e,f){a={"\ud83e\udd1d\ud83c\udffb":"\ud83e\udd1d","\ud83e\udd1d\ud83c\udffc":"\ud83e\udd1d","\ud83e\udd1d\ud83c\udffd":"\ud83e\udd1d","\ud83e\udd1d\ud83c\udffe":"\ud83e\udd1d","\ud83e\udd1d\ud83c\udfff":"\ud83e\udd1d","\ud83d\udc6f\ud83c\udffb":"\ud83d\udc6f","\ud83d\udc6f\ud83c\udffc":"\ud83d\udc6f","\ud83d\udc6f\ud83c\udffd":"\ud83d\udc6f","\ud83d\udc6f\ud83c\udffe":"\ud83d\udc6f","\ud83d\udc6f\ud83c\udfff":"\ud83d\udc6f","\ud83d\udc6f\ud83c\udffb\u200d\u2642":"\ud83d\udc6f\u200d\u2642","\ud83d\udc6f\ud83c\udffc\u200d\u2642":"\ud83d\udc6f\u200d\u2642","\ud83d\udc6f\ud83c\udffd\u200d\u2642":"\ud83d\udc6f\u200d\u2642","\ud83d\udc6f\ud83c\udffe\u200d\u2642":"\ud83d\udc6f\u200d\u2642","\ud83d\udc6f\ud83c\udfff\u200d\u2642":"\ud83d\udc6f\u200d\u2642"};f["default"]=a}),66); __d("WAWebConvertToTextWithoutSpecialEmojis",["WAWebEmojiCompile","WAWebSpecialEmojisWithSkinTones"],(function(a,b,c,d,e,f,g){var h=null;function a(a){if(!h){var b=c("WAWebEmojiCompile")(Object.keys(c("WAWebSpecialEmojisWithSkinTones")));h=new RegExp("("+b+")","g")}h.lastIndex=0;return a.replace(h,function(a){return c("WAWebSpecialEmojisWithSkinTones")[a]})}g.convertToTextWithoutSpecialEmojis=a}),98); __d("WAWebInteractiveMessageType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({NATIVE_FLOW:"native_flow",SHOPS_STOREFRONT:"shops_storefront",CAROUSEL:"carousel"});c=a;f["default"]=c}),66); __d("WAWebStateUtils",[],(function(a,b,c,d,e,f){function a(a){return(a==null?void 0:a.$ProxyState$state)?a.$ProxyState$state:a}f.unproxy=a}),66); __d("WAWebGalaxyFlowsUtils",["WAWebABProps","WAWebCommonMsgSubtypeTypes","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebStateUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=3;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield window.fetch("/flows/json/"+a));return a.json()});return i.apply(this,arguments)}function e(a){a=d("WAWebStateUtils").unproxy(a);a.type=d("WAWebMsgType").MSG_TYPE.UNKNOWN;a.subtype=d("WAWebCommonMsgSubtypeTypes").MsgSubtype.PhoneOnlyFeature;return a}function f(a){if(d("WAWebABProps").getABPropConfigValue("flows_wa_web")&&a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW){a=(a=a==null?void 0:(a=a.interactivePayload)==null?void 0:(a=a.buttons)==null?void 0:a[0])!=null?a:{};a=a.buttonParamsJson;if(a!=null){a=JSON.parse(a);var b=a.flow_message_version;a=a.wa_flow_response_params;return a!=null||+b>=h}}return!1}function j(a){return((a=a.nativeFlowResponseMessage)==null?void 0:a.name)===String(c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW)&&d("WAWebABProps").getABPropConfigValue("flows_wa_web")}g.fetchFlowJSON=a;g.getInvalidatedFlowMessageFromHistorySync=e;g.isFlowSupported=f;g.isResponseFlowSupported=j}),98); __d("WAWebInteractiveResponseMessageType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({NATIVE_FLOW:"native_flow"});c=a;f["default"]=c}),66); __d("WAWebE2EProtoUtils",["invariant","WABase64","WAJids","WALogger","WALongInt","WANullthrows","WATypeUtils","WAWebABProps","WAWebAddonCrossWindowUtils","WAWebAddonProcessMsgsUtils","WAWebAddonProcessingError","WAWebApiContact","WAWebBackendApi","WAWebBackendJobs.flow","WAWebBizCoexGatingUtils","WAWebBizGatingUtils","WAWebBizTemplateAndInteractiveMessagesUtils","WAWebConvertToTextWithoutSpecialEmojis","WAWebDBGroupsGroupMetadata","WAWebEphemeralityTypes","WAWebGalaxyFlowsUtils","WAWebHandleMsgCommon","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebInteractiveResponseMessageType","WAWebIsCagGroupCache","WAWebLidMigrationUtils","WAWebMobilePlatforms","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebPollsGatingUtils","WAWebProtobufsE2E.pb","WAWebUpdateDbForGroupActionApi","WAWebUserPrefsMeUser","WAWebVerifyProtobufMsgObjectKeys","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["url(deprecatedMms3Url) missing from msg type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fileEncSha256 missing from msg type ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fileSha256 missing from msg type ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["directPath missing from msg type ",""]);l=function(){return a};return a}function m(a){var b;b=(b=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(a))!=null?b:a;if(b.ephemeralMessage){a=b.ephemeralMessage.message;return a?m(a):d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text}if(b.groupMentionedMessage){a=b.groupMentionedMessage.message;return a?m(a):d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text}if(b.botInvokeMessage){a=b.botInvokeMessage.message;return a?m(a):d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text}if(b.deviceSentMessage){a=b.deviceSentMessage.message;return a?m(a):d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text}if(b.reactionMessage||b.encReactionMessage)return d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.reaction;if(b.eventMessage||b.encEventResponseMessage||((a=b.secretEncryptedMessage)==null?void 0:a.secretEncType)===d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT)return d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.event;if(b.pollCreationMessage||b.pollCreationMessageV2||b.pollCreationMessageV3||b.pollUpdateMessage)return d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.poll;if(((a=b.extendedTextMessage)==null?void 0:a.matchedText)!=null&&b.extendedTextMessage.matchedText.trim()!=="")return d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.media;if(Boolean(b.conversation)||b.extendedTextMessage||b.templateButtonReplyMessage||b.protocolMessage||b.interactiveMessage||b.keepInChatMessage||b.requestPhoneNumberMessage||b.editedMessage||b.pinInChatMessage||b.encCommentMessage||b.newsletterAdminInviteMessage)return d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text;return b.pollResultSnapshotMessage?d("WAWebPollsGatingUtils").isPollResultSnapshotPollTypeEnvelopeEnabled()?d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.poll:d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.text:d("WAWebHandleMsgCommon").STANZA_MSG_TYPES.media}function a(a){if(d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a)===d("WAWebMsgType").MSG_TYPE.COMMENT){a=d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a);var b=d("WAWebWidFactory").toUserWid(c("WANullthrows")(a.participant,"undefined participant"));b=d("WAWebLidMigrationUtils").getEnforceCurrentLid(b);return{threadMsgId:a.id,threadMsgSenderLid:c("WANullthrows")(b,"undefined lid")}}}function e(a){var b;b=(b=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(a))!=null?b:a;return b.reactionMessage!=null||b.encReactionMessage!=null||((a=b.pollUpdateMessage)==null?void 0:a.vote)!=null||b.keepInChatMessage!=null||b.editedMessage!=null||b.pinInChatMessage!=null||b.protocolMessage!=null&&b.protocolMessage.type===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE||((a=b.botInvokeMessage)==null?void 0:(a=a.message)==null?void 0:(a=a.protocolMessage)==null?void 0:a.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE||((a=b.protocolMessage)==null?void 0:a.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE||b.encEventResponseMessage!=null||((a=b.secretEncryptedMessage)==null?void 0:a.secretEncType)===d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT?d("WAWebBackendJobs.flow").DecryptFailType.Hide:d("WAWebBackendJobs.flow").DecryptFailType.Show}function f(a,b){var e=a.fromMe,f=a.id,g=a.participant;a=a.remoteJid;g=(g=g)!=null?g:b==null?void 0:b.toString();e!=null&&a!=null&&f!=null||h(0,56276);b=g!=null&&d("WAWebWidFactory").isWidlike(g)?d("WAWebWidFactory").createWid(g):void 0;g=d("WAWebWidFactory").createWid(a);(g.isGroup()||g.isBroadcast())&&e&&(b=d("WAWebUserPrefsMeUser").getMaybeMeUser());return new(c("WAWebMsgKey"))({fromMe:e,id:f,participant:b,remote:d("WAWebWidFactory").createWid(a)})}function n(a){var b;return{fromMe:a.fromMe,id:a.id,participant:a.fromMe?void 0:(b=a.participant)==null?void 0:b.toString({legacy:!0}),remoteJid:a.remote.toString({legacy:!0})}}function o(a){return{paymentStatus:a.status,paymentTxnStatus:a.txnStatus,paymentCurrency:a.currency||"",paymentAmount1000:c("WANullthrows")(d("WALongInt").maybeNumberOrThrowIfTooLarge(a.amount1000)),paymentMessageReceiverJid:d("WAWebWidFactory").createWid(c("WANullthrows")(a.receiverJid)),paymentExpiryTimestamp:d("WALongInt").maybeNumberOrThrowIfTooLarge(a.expiryTimestamp),paymentTransactionTimestamp:c("WANullthrows")(d("WALongInt").maybeNumberOrThrowIfTooLarge(a.transactionTimestamp))}}function p(a){var b,c=["XUS","XDX","USDP"];b=(a==null?void 0:(b=a.primaryAmount)==null?void 0:b.currencyCode)||(a==null?void 0:a.currency);return c.includes(b==null?void 0:b.toUpperCase())?!0:!1}function q(a,b){return a.remote.isGroup()&&!((a=a.participant)==null?void 0:a.equals(d("WAWebUserPrefsMeUser").getMeUser()))&&!b.equals(d("WAWebUserPrefsMeUser").getMeUser())?!1:!0}function r(a){var b=a.name,c=a.bizInfo;a=a.msgContext;return b!=null||(c==null?void 0:c.nativeFlowName)!=null?!d("WAWebBizGatingUtils").nativeFlowMessagesEnabled()?!1:s({name:b,bizInfo:c,msgContext:a}):!0}function s(a){var b=a.name,d=a.bizInfo;a=a.msgContext;if(a!=="relay"&&b!=null)return!0;if((d==null?void 0:d.nativeFlowName)==null)return!1;if(b==null)return!1;return c("WAWebInteractiveMessagesNativeFlowName").cast(d.nativeFlowName)===c("WAWebInteractiveMessagesNativeFlowName").MIXED?!0:b!=null&&c("WAWebInteractiveMessagesNativeFlowName").cast(d.nativeFlowName)===b}function t(a){return a===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS||a===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS||a===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_STATUS||a===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_METHOD||a===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO}function u(a){var b;b=(b=a.interactiveMessage)==null?void 0:(b=b.nativeFlowMessage)==null?void 0:b.buttons;if(b!=null&&b.length>0&&!d("WAWebBizTemplateAndInteractiveMessagesUtils").buttonsViolateButtonImprovementsConstraints(b.map(function(a){return{nativeFlowButton:a}})))return String(d("WAWebBizTemplateAndInteractiveMessagesUtils").getNativeFlowNameByButtonName(b[0].name));if(((b=a.buttonsMessage)==null?void 0:(b=b.buttons)==null?void 0:b.length)===1){return String(d("WAWebBizTemplateAndInteractiveMessagesUtils").getNativeFlowNameByButtonName((b=a.buttonsMessage.buttons[0].nativeFlowInfo)==null?void 0:b.name))}}var v=["novi_login","novi_report_transaction","novi_hub","novi_view_code","novi_view_transaction","novi_view_bank_detail","novi_view_card_detail","wa_payment_transaction_details","wa_payment_learn_more","wa_payment_fbpin_reset"];function w(a){return a.some(function(a){return a.nativeFlowInfo&&v.includes(a.nativeFlowInfo.name)||v.includes(a.buttonId)})}function x(a){switch(a){case c("WAWebInteractiveMessageType").NATIVE_FLOW:return d("WAWebBizGatingUtils").interactiveNativeFlowMessagesEnabled();case c("WAWebInteractiveMessageType").SHOPS_STOREFRONT:return d("WAWebBizGatingUtils").shopsInteractiveMessageEnabled();case c("WAWebInteractiveMessageType").CAROUSEL:return d("WAWebBizGatingUtils").carouselsEnabled()}}function y(a){switch(a){case c("WAWebInteractiveMessageType").NATIVE_FLOW:return"nativeFlowMessage";case c("WAWebInteractiveMessageType").SHOPS_STOREFRONT:return"shopStorefrontMessage";case c("WAWebInteractiveMessageType").CAROUSEL:return"carouselMessage"}}function z(a){for(var b of c("WAWebInteractiveMessageType").members())if(y(b)in a)return b;return null}function A(a,b){b=b==null?void 0:b.messageVersion;if(b==null||a==null)return!1;switch(a){case c("WAWebInteractiveMessageType").NATIVE_FLOW:return b<=1;case c("WAWebInteractiveMessageType").SHOPS_STOREFRONT:return b<=1;case c("WAWebInteractiveMessageType").CAROUSEL:return b<=1}}function B(a){switch(a){case c("WAWebInteractiveResponseMessageType").NATIVE_FLOW:return"nativeFlowResponseMessage"}}function C(a){for(var b of c("WAWebInteractiveResponseMessageType").members())if(B(b)in a)return b;return null}function D(a){switch(a){case c("WAWebInteractiveResponseMessageType").NATIVE_FLOW:return d("WAWebBizGatingUtils").interactiveNativeFlowResponseMessagesEnabled()}}function E(a){var b=a.type,d=a.message,e=a.bizInfo;a=a.msgContext;switch(b){case c("WAWebInteractiveResponseMessageType").NATIVE_FLOW:d=c("WANullthrows")(d.nativeFlowResponseMessage);var f=c("WANullthrows")(c("WAWebInteractiveMessagesNativeFlowName").cast(d.name)),g=c("WANullthrows")(d.version);if(g>1||!s({name:f,bizInfo:e,msgContext:a}))throw c("err")("Invalid message");return{name:f,version:g,type:b,paramsJson:c("WANullthrows")(d.paramsJson)}}}function F(a,b){var d;if((b==null?void 0:(d=b.nativeFlowResponseMessage)==null?void 0:d.paramsJson)!=null){d=JSON.parse(b==null?void 0:(d=b.nativeFlowResponseMessage)==null?void 0:d.paramsJson);return{msgData:babelHelpers["extends"]({},a,{caption:d.wa_flow_response_params.flow_name,interactiveType:c("WAWebInteractiveMessageType").NATIVE_FLOW,kind:"interactive",type:"interactive",nativeFlowName:c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW,interactivePayload:{buttons:[{name:c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW,buttonParamsJson:JSON.stringify(babelHelpers["extends"]({},d,{flow_message_version:1,flow_token:d.flow_token,flow_id:d.wa_flow_response_params.flow_id,flow_response_message:d.wa_flow_response_params.response_message,flow_cta:d.wa_flow_response_params.title}))}]}}),contextInfo:b.contextInfo}}}function G(a){var b=(a=a.interactivePayload)==null?void 0:(a=a.buttons)==null?void 0:a[0];if((b==null?void 0:b.buttonParamsJson)!=null){var c=JSON.parse(b.buttonParamsJson);c.flow_json_fresh_fetched=!1;void d("WAWebGalaxyFlowsUtils").fetchFlowJSON(c.flow_id).then(function(a){c.flow_json=a,b.buttonParamsJson=JSON.stringify(c)})}}function H(a){return a.reactionMessage!=null?!1:!0}function I(a){return a!=null&&c("WAWebWid").isWid(a)?d("WAWebWidFactory").createWid(a):a}function J(a){if(a==null)return;c("WAWebWid").isWid(a)||h(0,64887);return d("WAWebWidFactory").createWid(a)}function K(a,b){if(a==null)return;var c=a.id;if(c==null)return;return N(c,a,b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon)}function L(a,b){if(a==null)return;var c=a.id;if(c==null)return;return N(c,a,b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message)}function M(a,b,e){a=d("WAWebAddonProcessingError").validateMsgMeta(a,e);e=a.threadMsgId;a=a.threadMsgSenderJid;return new(c("WAWebMsgKey"))({id:e,fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a),remote:b.chat,participant:a})}function N(a,b,e,f){var g,h,i;if(!(e==null?void 0:(g=e.id)==null?void 0:g.fromMe)){g=e.id.remote;var j=c("WAWebIsCagGroupCache").isCag(g);if(b.fromMe===!0){h=!1;i=e.author;if(j&&((j=i)==null?void 0:j.isLid())&&f!==d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon){j=d("WAWebApiContact").getPhoneNumber(e.author);j!=null&&(i=j)}}else{j=I(b.participant);!(j instanceof c("WAWebWid"))?h=!0:(h=d("WAWebUserPrefsMeUser").isMeAccount(j),(!g.isUser()||j.isBot())&&(h?i=j.isLid()?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser():i=j))}}else{h=Boolean(b.fromMe);g=I(b.remoteJid);if(b.fromMe===!0){if(g instanceof c("WAWebWid")&&!(g.isUser()||g.isNewsletter())){j=c("WAWebIsCagGroupCache").isCag(g);j=j&&f!==d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon;j=j||!((f=e.author)==null?void 0:f.isLid())?d("WAWebUserPrefsMeUser").getMeUser():d("WAWebUserPrefsMeUser").getMeLidUser();i=j}}else i=I(b.participant)}e.type===d("WAWebMsgType").MSG_TYPE.REACTION&&g!=null&&(g instanceof c("WAWebWid")&&g.isBroadcast()&&!g.isStatus()||d("WAJids").interpretAndValidateJid(g.toString()).jidType==="broadcast")&&(g=I(b.participant),i=void 0);return new(c("WAWebMsgKey"))({id:a,fromMe:h,remote:g,participant:i})}function O(a){return a==null||a===""||d("WAWebMobilePlatforms").getMobilePlatform()===d("WAWebMobilePlatforms").PLATFORMS.ANDROID?a:d("WAWebConvertToTextWithoutSpecialEmojis").convertToTextWithoutSpecialEmojis(a)}function P(a){var b={fromMe:a.fromMe,id:a.id},c=Q(a.remote);a=Q(a.participant);d("WATypeUtils").isString(c)&&(b.remoteJid=c);d("WATypeUtils").isString(a)&&(b.participant=a);return b}function Q(a){if(a instanceof c("WAWebWid"))return a.toString({legacy:!0});else if(d("WATypeUtils").isString(a))return a.replace(/@c.us$/,"@s.whatsapp.net");return void 0}function R(a){return a!=null&&a!==""?d("WABase64").decodeB64(a):void 0}function S(a){var b=Q(a.to);a={fromMe:!0,id:a.id.id};d("WATypeUtils").isString(b)&&(a.remoteJid=b);return a}function T(a,b,c){if(Boolean(b.viewOnce))return;b.directPath==null&&b.staticUrl==null&&d("WALogger").LOG(l(),a).sendLogs("outgoing-"+a+"-message-missing-direct-path");b.fileSha256==null&&d("WALogger").LOG(k(),a).sendLogs("outgoing-"+a+"-message-missing-file-sha");!c&&b.fileEncSha256==null&&d("WALogger").LOG(j(),a).sendLogs("outgoing-"+a+"-message-missing-file-enc-sha");b.url==null&&b.staticUrl==null&&!c&&d("WALogger").LOG(i(),a).sendLogs("outgoing-"+a+"-message-missing-mms3-url")}function U(a,b,c){var e,f,g;switch(a){case d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat:e=d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.CHANGED_IN_CHAT;break;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe:e=d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_ME;break;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther:e=d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER;break;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.BizUpgradeFbHosting:e=d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER;break}if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")){if(b)switch(b){case d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.CHAT_SETTING;break;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.ACCOUNT_SETTING;break;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BULK_CHANGE;break;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN;break;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN_GROUPS;break;case d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting:f=d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN;break}c!=null&&(g=c)}return{initiator:e,trigger:f,initiatedByMe:g}}function V(a,b){if(a.from==null)return;a=d("WAWebUserPrefsMeUser").isMeAccount(a.from);if(b.initiator==null)return;switch(b.initiator){case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.CHANGED_IN_CHAT:return d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat;case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_ME:return a?d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe:d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther;case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER:case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.BIZ_UPGRADE_FB_HOSTING:return a?d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther:d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe}}function W(a,b){if(!d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger"))return;a=d("WAWebUserPrefsMeUser").isMeAccount(a.from);var c=b.initiator,e=b.trigger,f=b.initiatedByMe;if(e!=null&&d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&e===d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BIZ_SUPPORTS_FB_HOSTING)return{disappearingModeTrigger:Z(e),initiatedByMe:a?f:!f};if(e!=null&&f!=null)return{disappearingModeTrigger:Z(e),initiatedByMe:a?f:!f};if(b.initiator==null)return;if(c!=null)switch(c){case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.CHANGED_IN_CHAT:return{disappearingModeTrigger:d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings};case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_ME:return{disappearingModeTrigger:d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings,initiatedByMe:a};case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.BIZ_UPGRADE_FB_HOSTING:case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER:return{disappearingModeTrigger:d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings,initiatedByMe:!a}}}function X(a,b){return Y.apply(this,arguments)}function Y(){Y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(b)),e=c==null?void 0:c.disappearingModeInitiatedByMe;c!=null&&a!=null&&c.disappearingModeTrigger===d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups&&a!==d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups&&(void d("WAWebUpdateDbForGroupActionApi").syncDisappearingModeTriggerToDB(b,a),void d("WAWebBackendApi").frontendFireAndForget("syncEphemeralTriggerCollectionForGroup",{chatId:b,trigger:a}));if(e!=null)return{disappearingModeTrigger:a,disappearingModeInitiatedByMe:e}});return Y.apply(this,arguments)}function Z(a){switch(a){case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.CHAT_SETTING:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.ACCOUNT_SETTING:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BULK_CHANGE:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.BulkChange;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.BIZ_SUPPORTS_FB_HOSTING:return d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting:d("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN_GROUPS:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.UnknownGroups;case d("WAWebProtobufsE2E.pb").DisappearingMode$Trigger.UNKNOWN:return d("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown}}var $=function(a){return a};g.typeAttributeFromProtobuf=m;g.extractCommentTargetIdAndSenderLid=a;g.decryptFailAttributeFromProtobuf=e;g.protobufToMsgKey=f;g.msgKeyToProtobuf=n;g.parseMsgPaymentInfo=o;g.hasUnsupportedCurrency=p;g.isEitherSenderOrReceiverOfPaymentMessage=q;g.shouldParseNFM=r;g.isValidNativeFlowName=s;g.isOrderNativeFlow=t;g.getBizNativeFlowName=u;g.hasUnsupportedButtons=w;g.isInteractiveMessageTypeEnabled=x;g.getInteractiveMessageFieldNameForType=y;g.getInteractiveMessageTypeForProto=z;g.isSupportedInteractiveMessageVersion=A;g.getInteractiveResponseMessageFieldNameForType=B;g.getInteractiveResponseMessageTypeForProto=C;g.isInteractiveResponseMessageTypeEnabled=D;g.getInteractiveResponsePayload=E;g.getGalaxyMessageInteractiveResponse=F;g.addFlowJSONToGalaxyMessageInteractiveMessage=G;g.isQuotedSupported=H;g.decodeJid=I;g.strictDecodeJid=J;g.translateAddonMessageKeyToLocalReference=K;g.translateRegularMessageKeyToLocalReference=L;g.createMsgKeyFromThreadInfo=M;g.translateKeyToLocalReference=N;g.convertToTextWithoutSpecialEmojis=O;g.encodeKey=P;g.encodeJid=Q;g.encodeBytes=R;g.createMessageKey=S;g.validateOutgoingRequiredMediaProperties=T;g.disappearingModeInitiatorToProto=U;g.protoToDisappearingModeInitiator=V;g.protoToDisappearingMode=W;g.updateDisappearingModeForGroups=X;g.getMutableMessageProtobuf=$}),98); __d("WAWebBizOrderDetailsParams",["$InternalEnum"],(function(a,b,c,d,e,f){e=b("$InternalEnum")({PIX_STATIC_CODE:"pix_static_code",PIX_DYNAMIC_CODE:"pix_dynamic_code",CARDS:"cards",PAYMENT_GATEWAY:"payment_gateway",PAYMENT_LINK:"payment_link",BOLETO:"boleto"});function a(a){return JSON.parse(a)}function c(a){return JSON.stringify(a)}function d(a){return JSON.stringify(a)}f.PaymentSettingType=e;f.parse=a;f.stringify=c;f.stringifyPaymentStatus=d}),66); __d("WAWebOrderDetails",["WAWebBizOrderDetailsParams","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebStateUtils","filterNulls"],(function(a,b,c,d,e,f,g){function h(a){var b=a==null?void 0:a.value;if(b==null)return;a=(a=a==null?void 0:a.offset)!=null?a:1;return parseFloat((b=b)!=null?b:0)/parseInt(a,10)}function i(a){return a==null?null:c("filterNulls")(a.map(function(a){return(a==null?void 0:a.type)!=null?babelHelpers["extends"]({type:a.type},a.payment_instruction!=null?{paymentInstruction:a.payment_instruction}:{}):null}))}var j=function(){return"custom-item"},k=function(a,b){var c;if(a!=="review_and_pay"&&a!=="payment_info"||b==null)return null;b=d("WAWebBizOrderDetailsParams").parse(b);var e=b.order,f=b.currency,g=b.reference_id,k=b.payment_configuration,l=b.external_payment_configurations,m=b.payment_settings,n=h(b.total_amount);c=(c=e==null?void 0:e.items)!=null?c:[];var o=c.map(function(a){var b;return{id:(b=(b=a==null?void 0:a.product_id)!=null?b:a==null?void 0:a.retailer_id)!=null?b:"",name:(b=a==null?void 0:a.name)!=null?b:"",amount:h(a==null?void 0:a.amount),quantity:parseInt((b=a==null?void 0:a.quantity)!=null?b:0,10),isCustomItem:(b=a==null?void 0:a.isCustomItem)!=null?b:(a==null?void 0:(b=a.retailer_id)==null?void 0:b.indexOf(j()))===0,isQuantitySet:(b=a==null?void 0:a.isQuantitySet)!=null?b:!0}}),p=o.reduce(function(a,b){return a+b.quantity},0);c=(c=c[0])==null?void 0:c.name;if(a==="payment_info"&&(m==null?void 0:m.length)===1&&m[0].type===d("WAWebBizOrderDetailsParams").PaymentSettingType.PIX_STATIC_CODE){var q=m[0][d("WAWebBizOrderDetailsParams").PaymentSettingType.PIX_STATIC_CODE];c=q.merchant_name}if(c==null||g==null||f==null||n==null)return null;q=h(e==null?void 0:e.shipping);var r=h(e==null?void 0:e.tax),s=h(e==null?void 0:e.discount);e=h(e==null?void 0:e.subtotal);l=i(l);return babelHelpers["extends"]({title:c,referenceId:g,currency:f,quantity:p,shipping:q,tax:r,discount:s,subtotal:e,totalAmount:n,items:o,payment_configuration:k,type:b.type},l!=null?{externalPaymentConfigurations:l}:{},{paymentSettings:m,buttonName:a})};a=function(a){return l(d("WAWebStateUtils").unproxy(a.safe()))};var l=function(a){var b;if(a.nativeFlowName!==c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS&&a.nativeFlowName!==c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO)return null;if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&((b=a.interactivePayload)==null?void 0:b.buttons)){b=a.interactivePayload.buttons[0];var e=b.name;b=b.buttonParamsJson;return k(e,b)}else if(a.type===d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW){b=((e=a.nativeFlowButtons)!=null?e:[])[0].nativeFlowInfo;return k(b==null?void 0:b.name,b==null?void 0:b.paramsJson)}};g.getCustomItemIdPrefix=j;g.paramsJsonToOrderInfo=k;g.getOrderInfoFromMsg=a;g.getOrderInfo=l}),98); __d("WAWebNativeFlowValidation",["WAWebBizGatingUtils","WAWebBizTemplateAndInteractiveMessagesUtils","WAWebGalaxyFlowsUtils","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebOrderDetails","WAWebOrderPaymentStatus","WAWebOrderStatus"],(function(a,b,c,d,e,f,g){function a(a,b,e){if(a.nativeFlowName==null)return!1;switch(a.nativeFlowName){case c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO:return d("WAWebOrderDetails").getOrderInfo(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS:return d("WAWebOrderDetails").getOrderInfo(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS:return d("WAWebOrderStatus").getOrderStatusInfo(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_STATUS:return d("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_METHOD:return d("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").MESSAGE_WITH_LINK:return h(a)!==!1;case c("WAWebInteractiveMessagesNativeFlowName").MESSAGE_WITH_LINK_STATUS:return d("WAWebBizGatingUtils").isMessageWithLinkNfmEnabled();case c("WAWebInteractiveMessagesNativeFlowName").CTA_CALL:return d("WAWebBizTemplateAndInteractiveMessagesUtils").isInteractiveCtaMessageEnabled(c("WAWebInteractiveMessagesNativeFlowName").CTA_CALL,e,b)&&i(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").CTA_URL:return d("WAWebBizTemplateAndInteractiveMessagesUtils").isInteractiveCtaMessageEnabled(c("WAWebInteractiveMessagesNativeFlowName").CTA_URL,e,b)&&i(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").QUICK_REPLY:return d("WAWebBizTemplateAndInteractiveMessagesUtils").isInteractiveCtaMessageEnabled(c("WAWebInteractiveMessagesNativeFlowName").QUICK_REPLY,e,b)&&i(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").CTA_CATALOG:return d("WAWebBizTemplateAndInteractiveMessagesUtils").isInteractiveCtaMessageEnabled(c("WAWebInteractiveMessagesNativeFlowName").CTA_CATALOG,e,b)&&i(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").CTA_COPY_CODE:return d("WAWebBizTemplateAndInteractiveMessagesUtils").isInteractiveCtaMessageEnabled(c("WAWebInteractiveMessagesNativeFlowName").CTA_COPY_CODE,e,b)&&i(a)!=null;case c("WAWebInteractiveMessagesNativeFlowName").MIXED:return!1;case c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW:return d("WAWebGalaxyFlowsUtils").isFlowSupported(a)}return!1}function h(a){if(d("WAWebBizGatingUtils").isMessageWithLinkNfmEnabled()){if(a.nativeFlowName!==c("WAWebInteractiveMessagesNativeFlowName").MESSAGE_WITH_LINK||a.type!==d("WAWebMsgType").MSG_TYPE.INTERACTIVE||a.interactiveType!==c("WAWebInteractiveMessageType").NATIVE_FLOW||a.interactivePayload==null)return!1;a=a.interactivePayload;if((a==null?void 0:a.buttons)&&a.buttons.length>0){a=a.buttons[0];var b=a.name;a=a.buttonParamsJson;if(b==="open_webview"&&a!=null)return!0}}return!1}function i(a){var b;a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&d("WAWebBizTemplateAndInteractiveMessagesUtils").supportedNativeFlowButtonNamesForInteractiveMsg.includes(a.nativeFlowName)&&((b=a.interactivePayload)==null?void 0:b.buttons)!=null&&a.interactivePayload.buttons.forEach(function(a){a=j(a);if(a)return!0});return!1}function j(a){return d("WAWebBizTemplateAndInteractiveMessagesUtils").supportedNativeFlowButtonNamesForInteractiveMsg.includes(d("WAWebBizTemplateAndInteractiveMessagesUtils").getNativeFlowNameByButtonName(a.name))}g.isValidNativeFlowMessage=a}),98); __d("WAWebParseNonNFMButtonsMessageProto",["WAWebButtonsMessageProtoUtils","WAWebE2EProtoUtils","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage,f=a.bizInfo;a=a.msgContext;b=b.buttonsMessage;if(b==null)return;var g=b.buttons;g=g===void 0?[]:g;var h=b.headerType,i=c("WAWebInteractiveMessagesNativeFlowName").cast(d("WAWebE2EProtoUtils").getBizNativeFlowName({buttonsMessage:b}));if(i!=null||(f==null?void 0:f.nativeFlowName)!=null)return;if(d("WAWebE2EProtoUtils").hasUnsupportedButtons(g))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo};if(h===d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.UNKNOWN||!new Set(d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.members()).has(h))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown}),contextInfo:b.contextInfo};i=d("WAWebButtonsMessageProtoUtils").parseButtonsMessageProto({buttonsMessage:b,baseMessage:e,msgContext:a});return g.length?{msgData:babelHelpers["extends"]({},i,{isDynamicReplyButtonsMsg:!0,dynamicReplyButtons:g}),contextInfo:b.contextInfo}:{msgData:i,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebParseTemplateMessageProto",["WANullthrows","WAWebBizTemplateAndInteractiveMessagesUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebParseDocumentMessageProto","WAWebParseImageMessageProto","WAWebParseInteractiveMessageProto","WAWebParseLocationMessageProto","WAWebParseVideoMessageProto"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage,f=a.msgContext;a=a.bizInfo;b=b.templateMessage;if(b==null)return;if(f==="relay"&&(a==null?void 0:a.verifiedHsmEnvelope)!==!0)return;var g=b.interactiveMessageTemplate;if(g)return h(e,f,g,b.templateId,a);a=(g=b.hydratedTemplate)!=null?g:c("WANullthrows")(b.hydratedFourRowTemplate);var i=a.documentMessage,j=a.imageMessage,k=a.locationMessage,l=a.videoMessage;g=a.hydratedButtons;var m=a.hydratedContentText;b=a.hydratedFooterText;var n=a.hydratedTitleText;a=a.templateId;var o=function(){var a=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat},Boolean(m)&&{body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(m)});if(j){var b;return(b=(b=c("WAWebParseImageMessageProto")({messageProtobuf:{imageMessage:j},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(i){return(b=(b=c("WAWebParseDocumentMessageProto")({messageProtobuf:{documentMessage:i},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(k){return(b=(b=c("WAWebParseLocationMessageProto")({messageProtobuf:{locationMessage:k},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}if(l){return(b=(b=c("WAWebParseVideoMessageProto")({messageProtobuf:{videoMessage:l},baseMessage:e,msgContext:f}))==null?void 0:b.msgData)!=null?b:a}return a};if(d("WAWebBizTemplateAndInteractiveMessagesUtils").buttonsViolateButtonImprovementsConstraints(g.map(function(a){return{hydratedTemplateButton:a}})))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:void 0};o=o();return{msgData:babelHelpers["extends"]({},o,{templateId:a,isFromTemplate:!0,caption:Boolean(m)?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(m):o.caption,footer:Boolean(b)?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(b):o.footer,title:Boolean(n)?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(n):o.title},g.length>0&&{hydratedButtons:g}),contextInfo:void 0}}function h(a,b,e,f,g){var h;h=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat},Boolean((h=e.body)==null?void 0:h.text)&&{body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis((h=e.body)==null?void 0:h.text)});a=(b=(e=c("WAWebParseInteractiveMessageProto")({messageProtobuf:{interactiveMessage:e},baseMessage:a,msgContext:b,bizSource:a.bizSource||"",bizInfo:g}))==null?void 0:e.msgData)!=null?b:h;return{msgData:babelHelpers["extends"]({},a,{templateId:f,isFromTemplate:!0,caption:a.caption,footer:a.footer,title:a.title}),contextInfo:void 0}}g["default"]=a}),98); __d("WAWebQuotedMessageProtoUtils",["WALogger","WAWebE2EProtoParser","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed parsing quoted message: ",""]);h=function(){return a};return a}function i(a){var b=a.quotedMsg,c=a.msgContext;a=a.isCarouselCardReply;return d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:b,message:{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN},msgContext:c==="history"?"history_quoted":"quoted",bizSource:a?"quoted_carousel_card":null})}function a(a){try{return i(a)}catch(a){d("WALogger").ERROR(h(),a).sendLogs("parse-quoted-msg-error");return null}}g.parseQuotedMessage=a}),98); __d("WAWebApiActiveMessageRanges",["Promise","WALogger","WANullthrows","WASyncAction.pb","WAWebDBMsgUtils","WAWebSchemaActiveMessageRanges","asyncToGeneratorRuntime","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getRangesForChat failed with error: ",""]);i=function(){return a};return a}var j=new Map(),k={reset:function(){j=new Map()},removeRange:function(a,b){var c;(c=j.get(a))==null?void 0:c["delete"](b);return d("WAWebSchemaActiveMessageRanges").getActiveMessageRangesTable().remove([a,b])},createOrReplaceRange:function(a){var b=j.get(a.chatId);b==null&&(b=new Map(),j.set(a.chatId,b));b.set(a.action,a);return d("WAWebSchemaActiveMessageRanges").getActiveMessageRangesTable().createOrReplace(a)},bulkCreateOrReplaceRanges:function(a,c){c===void 0&&(c=!0);a.forEach(function(a){var b=j.get(a.chatId);b==null&&(b=new Map(),j.set(a.chatId,b));b.set(a.action,a)});return c?d("WAWebSchemaActiveMessageRanges").getActiveMessageRangesTable().bulkCreateOrReplace(a):(h||(h=b("Promise"))).resolve()},getRangesForChat:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=j.get(a);try{if(b==null){var c=(yield d("WAWebSchemaActiveMessageRanges").getActiveMessageRangesTable().anyOf(["chatId"],[a]));b=new Map(c.map(function(a){return[a.action,a]}));j.set(a,b)}}catch(a){d("WALogger").ERROR(i(),a)}return b?Array.from(b.values()):[]});function c(b){return a.apply(this,arguments)}return c}()};function l(a,b){switch(a){case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive,actionValue:c("WANullthrows")(b.archiveChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead,actionValue:c("WANullthrows")(b.markChatAsReadAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia,actionValue:c("WANullthrows")(b.clearChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia,actionValue:c("WANullthrows")(b.clearChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia,actionValue:c("WANullthrows")(b.clearChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia,actionValue:c("WANullthrows")(b.clearChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia,actionValue:c("WANullthrows")(b.deleteChatAction)};case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia:return{action:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia,actionValue:c("WANullthrows")(b.deleteChatAction)};default:throw c("err")("unsupported action for message ranges: "+String(a))}}function a(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,c);var e=l(b,c);e=e.actionValue;e=((e=e.messageRange)==null?void 0:e.messages)||[];var f=(yield d("WAWebDBMsgUtils").filterReceivedMessagesInRange(a,e));e=Math.max(0,e.length-f.length);return k.createOrReplaceRange(babelHelpers["extends"]({chatId:a},l(b,c),{remainingMessages:e}))});return m.apply(this,arguments)}function e(a,b){return k.removeRange(a,b)}function f(a,b){b===void 0&&(b=!0);return k.bulkCreateOrReplaceRanges(a,b)}function n(a){return k.getRangesForChat(a)}function o(a,b){switch(a){case"archive":return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive;case"markChatAsRead":return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead;case"clearChat":if((b==null?void 0:b.deleteStarred)&&b.deleteMedia)return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia;else if((b==null?void 0:b.deleteStarred)&&!b.deleteMedia)return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia;else if((b==null?void 0:b.deleteMedia)&&!b.deleteStarred)return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia;return d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia;case"deleteChat":return(b==null?void 0:b.deleteMedia)?d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia:d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia;default:throw c("err")("unsupported active message range action")}}g._cache=k;g.addActiveMessageRange=a;g.removeActiveMessageRange=e;g.bulkUpdateActiveMessageRanges=f;g.getActiveMessageRanges=n;g.getActiveRangeAction=o}),98); __d("WAWebProtobufsMdStorageChatRowOpaqueData.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NONE:0,IMAGE:1,VIDEO:2});c={};e={};f={};b={};c.internalSpec={draftMessage:[1,(d=d("WAProtoConst")).TYPES.MESSAGE,e]};e.internalSpec={text:[1,d.TYPES.STRING],omittedUrl:[2,d.TYPES.STRING],ctwaContextLinkData:[3,d.TYPES.MESSAGE,b],ctwaContext:[4,d.TYPES.MESSAGE,f],timestamp:[5,d.TYPES.INT64]};f.internalSpec={conversionSource:[1,d.TYPES.STRING],conversionData:[2,d.TYPES.BYTES],sourceUrl:[3,d.TYPES.STRING],sourceId:[4,d.TYPES.STRING],sourceType:[5,d.TYPES.STRING],title:[6,d.TYPES.STRING],description:[7,d.TYPES.STRING],thumbnail:[8,d.TYPES.STRING],thumbnailUrl:[9,d.TYPES.STRING],mediaType:[10,d.TYPES.ENUM,a],mediaUrl:[11,d.TYPES.STRING],isSuspiciousLink:[12,d.TYPES.BOOL]};b.internalSpec={context:[1,d.TYPES.STRING],sourceUrl:[2,d.TYPES.STRING],icebreaker:[3,d.TYPES.STRING],phone:[4,d.TYPES.STRING]};g.ChatRowOpaqueData$DraftMessage$CtwaContextData$ContextInfoExternalAdReplyInfoMediaType=a;g.ChatRowOpaqueDataSpec=c;g.ChatRowOpaqueData$DraftMessageSpec=e;g.ChatRowOpaqueData$DraftMessage$CtwaContextDataSpec=f;g.ChatRowOpaqueData$DraftMessage$CtwaContextLinkDataSpec=b}),98); __d("WAWebDBChatSerialization",["WAWebProtobufsMdStorageChatRowOpaqueData.pb","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){var h=["draftMessage"];function a(a){a=babelHelpers["extends"]({},a);i(a);return a}function i(a){var b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsMdStorageChatRowOpaqueData.pb").ChatRowOpaqueDataSpec,a.chatRowOpaqueData);h.forEach(function(c){(b==null?void 0:b[c])!=null&&(a[c]=b==null?void 0:b[c])})}function b(a){a=babelHelpers["extends"]({},a);j(a);return a}function j(a){var b={};h.forEach(function(c){b[c]=a[c],delete a[c]});var c=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsMdStorageChatRowOpaqueData.pb").ChatRowOpaqueDataSpec,b);a.chatRowOpaqueData=c.readBuffer()}g.deserializeChat=a;g.serializeChat=b}),98); __d("WAWebApiChat",["Promise","WALogger","WATimeUtils","WAWeb-dexie","WAWebAck","WAWebApiContact","WAWebBackendApi","WAWebBusinessHSMTypes","WAWebChatThreadLogging","WAWebDBChatSerialization","WAWebDBMsgUtils","WAWebEphemeralityUtils","WAWebMiscErrors","WAWebModelStorageUtils","WAWebMsgGetters","WAWebMsgType","WAWebSchemaChat","WAWebSchemaMessage","WAWebTrustedContactsUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat with id "," is not found"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["createChatRecord: update chat table failed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["reduceChatUnreadCount: could not find chat with id ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeUnreadMentionChat: could not find chats"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["addUnreadMentionChat: could not find chats"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["markMessageAndChatAsRead: chatId: ",", update acks for "," messages"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["markMessageAndChatAsRead: chatId: ",", update unread to ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["markMessageAndChatAsRead: lastReadRowId: ",", chatId: ",", keepChatUnread: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateMarkChatAsReadSync: could not find chat with id ",""]);q=function(){return a};return a}var r=new Map(),s=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="CreateChatDuplicateError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{yield d("WAWebSchemaChat").getChatTable().create(babelHelpers["extends"]({id:a.toString()},b))}catch(a){if(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort)throw a;d("WALogger").ERROR(j()).verbose().devConsole(a);if(a instanceof c("WAWeb-dexie").ConstraintError)throw new s();throw c("err")("update chat table failed")}});return t.apply(this,arguments)}function e(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield d("WAWebSchemaChat").getChatTable().get(a.toString(),!1));if(e)return{unreadCount:e.unreadCount,timestamp:e.t};d("WALogger").ERROR(i(),a.toString());return(h||(h=b("Promise"))).reject(c("err")("Failed to find row in chat table"))});return u.apply(this,arguments)}function f(a){return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.get(a));if(c==null){d("WALogger").ERROR(q(),a);return}if(c.unreadCount===-1)return b.createOrMerge(a,{id:a,unreadCount:0,unreadMentionsOfMe:[],unreadMentionCount:0})});return function(a){return c.apply(this,arguments)}}())}function v(a){return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a)}function w(a){a=Array.from(a).map(function(a){var b=a[0];a=a[1];return{id:b,chatlistPreview:a,lastReactionPreview:void 0}});return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaMessage").getMessageTable().equals(["from","pendingReadReceipt"],[a,d("WAWebDBMsgUtils").PendingReadReceiptType.Message],{shouldDecrypt:!1}));return a.filter(function(a){return a.type!==d("WAWebMsgType").MSG_TYPE.UNKNOWN})});return y.apply(this,arguments)}function z(a,c,e){d("WALogger").DEV(p(),a,c,e);return d("WAWebModelStorageUtils").getStorage().lock(["message","chat"],function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(f){f[0];f=f[1];var g=(yield x(c)),i=[],j=0,k=[];g.forEach(function(b){b.hsmTag===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.AUTHENTICATION&&d("WAWebBackendApi").frontendFireAndForget("logOTPMessageReadActions",{msgRow:b});if(a==null||b.rowId!=null&&b.rowId>a){j++;if(d("WAWebMsgGetters").getIsImportantMessage(b)){var c={id:b.id,timestamp:b.t};k.push(c)}return}i.push({id:b.id,ack:Math.max(b.ack,d("WAWebAck").ACK.READ),pendingReadReceipt:null})});g=j===0&&e?-1:j;d("WALogger").DEV(o(),c,g);f=[f.merge(c,{id:c,unreadCount:g,unreadDividerOffset:0,unreadMentionsOfMe:k,unreadMentionCount:0})];i.length>0&&(d("WALogger").DEV(n(),c,i.length),f.push(d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(i).then(function(){return d("WAWebChatThreadLogging").handleActivitiesForChatThreadLogging([{activityType:"msgRead",ts:d("WATimeUtils").unixTime(),chatId:d("WAWebWidFactory").createWid(c),readCount:i.length}])})));yield (h||(h=b("Promise"))).all(f)});return function(a){return f.apply(this,arguments)}}())}function A(a,c){return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b[0];b=Array.from(a.keys());if(b.length===0)return;b=(yield d("WAWebSchemaChat").getChatTable().bulkGet(b));if(!b||b.length===0){d("WALogger").ERROR(m());return}var e=[];b.forEach(function(b){if(b){var d=b.id.toString();b=(b=b.unreadMentionsOfMe)!=null?b:[];var f=a.get(d);f&&(b=b.concat(f));f={id:d,unreadMentionsOfMe:b};if(c){var g;g=(g=c.get(d))!=null?g:0;f={id:d,unreadMentionsOfMe:b,unreadMentionCount:g}}e.push(f)}});return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(e)});return function(a){return e.apply(this,arguments)}}())}function B(a){return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b[0];b=Array.from(a.keys());if(b.length===0)return;b=(yield d("WAWebSchemaChat").getChatTable().bulkGet(b));if(!b||b.length===0){d("WALogger").ERROR(l());return}var c=[];b.forEach(function(b){if(b){var d;d=(d=b.unreadMentionsOfMe)!=null?d:[];var e=a.get(b.id.toString());e&&(d=d.filter(function(a){return!e.includes(a.id)}));c.push({id:b.id.toString(),unreadMentionsOfMe:d})}});return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(c)});return function(a){return c.apply(this,arguments)}}())}function C(a){return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(c){c=c[0];var d=Array.from(a.keys());if(d.length===0)return(h||(h=b("Promise"))).resolve();d=d.map(function(b){var c;c=(c=a.get(b))!=null?c:!1;return{id:b,archiveAtMentionViewedInDrawer:c}});return c.bulkCreateOrMerge(d)})}function D(a,c,e){c===void 0&&(c=1);e===void 0&&(e=!0);return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var f=(yield b.get(a));if(f==null){d("WALogger").ERROR(k(),a);return}var g=Math.max(f.unreadCount-c,0);f=(f=f.unreadDividerOffset)!=null?f:0;e&&(f+=c);return b.merge(a,{unreadCount:g,unreadDividerOffset:f})});return function(a){return f.apply(this,arguments)}}())}function E(){var a=d("WAWebTrustedContactsUtils").tokenExpirationCutoff(d("WAWebTrustedContactsUtils").TcTokenMode.Receiver);return d("WAWebModelStorageUtils").getStorage().lock(["chat"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.lessThan(["tcTokenTimestamp"],a));if(!c||c.length===0)return;c=c.map(function(a){return{id:a.id,tcToken:null,tcTokenTimestamp:null}});return b.bulkCreateOrMerge(c)});return function(a){return c.apply(this,arguments)}}())}function F(){var a=d("WAWebTrustedContactsUtils").tokenExpirationCutoff(d("WAWebTrustedContactsUtils").TcTokenMode.Receiver),c=[];return d("WAWebModelStorageUtils").getStorage().lock(["orphan-tc-token"],function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var d=(yield b.all());d.forEach(function(b){var d=b.tcTokenTimestamp;d!=null&&d<a&&c.push(b.chatId)});return b.bulkRemove(c)});return function(a){return d.apply(this,arguments)}}())}function G(a){return d("WAWebSchemaChat").getChatTable().get(a.toString(),!1)}function H(a){return d("WAWebSchemaChat").getChatTable().anyOf(["accountLid"],[a.toString()])}function I(a){return d("WAWebSchemaChat").getChatTable().bulkGet(a.map(function(a){return a.toString()}))}function J(){return d("WAWebSchemaChat").getChatTable().all().then(function(a){return a.map(function(a){return d("WAWebDBChatSerialization").deserializeChat(a)})})}function K(a){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isLid()){var b=(yield G(a));if(b!=null)return a;b=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a));if(b!=null){var c=(yield G(b));if(c!=null)return b}return a}c=(yield G(a));if(c!=null&&!c.isDeprecated)return a;b=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));if(b!=null){c=(yield G(b));if(c)return b}return a});return L.apply(this,arguments)}function M(a){return N(a)}function N(a){var b=r.get(a.toString());if(b!=null)return b;b=K(a);r.set(a.toString(),b);return b}function O(a){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[];a=a.filter(function(a){return a.isUser()});a.map(function(a){var b=r.get(a.toString());b==null&&c.push(a)});var e=d("WAWebApiContact").getAlternateWidBulk_DEPRECATED(c);Array.from(e.keys()).map(function(a){return c.push(d("WAWebWidFactory").createWidFromWidLike(a))});if(c.length>0){var f=(yield I(c));f.forEach(function(a){if(a!=null){var c;c=(c=e.get(a.id.toString()))!=null?c:a.id.toString();!(a==null?void 0:a.isDeprecated)&&!r.has(c.toString())&&r.set(c.toString(),(h||(h=b("Promise"))).resolve(d("WAWebWidFactory").createWidFromWidLike(a.id)))}})}var g=new Map();a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield r.get(a.toString()));b!=null?g.set(a,b):g.set(a,a)});return function(b){return a.apply(this,arguments)}}());return g});return P.apply(this,arguments)}function Q(a){r.set(a.toString(),(h||(h=b("Promise"))).resolve(a));var c=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));c!=null&&r.set(c.toString(),(h||(h=b("Promise"))).resolve(a))}function R(a){var b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));b!=null&&r["delete"](b.toString());r["delete"](a.toString())}function S(a){a.filter(function(a){return c("WAWebWid").isUser(a.id)&&!a.isDeprecated}).map(function(a){a=d("WAWebWidFactory").createWid(a.id);(!a.isLid()||r.get(a.toString())==null)&&r.set(a.toString(),(h||(h=b("Promise"))).resolve(a));var c=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));c!=null&&(c.isLid()||r.get(c.toString())==null)&&r.set(c.toString(),(h||(h=b("Promise"))).resolve(a))})}function T(a,b){b?R(a):Q(a)}function U(){r.clear()}function V(a){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(function(a){return a.id.toString()}),c=(yield d("WAWebSchemaChat").getChatTable().bulkGet(b));b=a.map(function(a,b){a=a;if(c[b]!=null){b=c[b];var e=b.disappearingModeInitiatedByMe;b=b.disappearingModeTrigger;e!=null&&(a=babelHelpers["extends"]({},a,{disappearingModeInitiatedByMe:e}));b!=null&&(a=babelHelpers["extends"]({},a,{disappearingModeTrigger:d("WAWebEphemeralityUtils").getDisappearingModeTriggerFromString(b)}))}return a});return b});return W.apply(this,arguments)}g.matChatCache=r;g.CreateChatDuplicateError=s;g.createChatRecord=a;g.getChatMeta=e;g.updateChatForMarkAsReadSync=f;g.latestChatBulkUpdates=v;g.bulkUpdateChatLastAddOnPreview=w;g.queryPendingReadReceiptMsgRows=x;g.markMessageAndChatAsRead=z;g.addUnreadMentionChat=A;g.removeUnreadMentionChat=B;g.updateChatArchiveDrawer=C;g.reduceChatUnreadCount=D;g.pruneExpiredTcTokens=E;g.pruneExpiredOrphanTcTokens=F;g.getChatRecord=G;g.getChatRecordByAccountLid=H;g.bulkGetChats=I;g.getAllChatsDeserialized=J;g._getActiveChatWid_DEPRECATED=K;g.getMatChatIncomingMessage=M;g.getMatChat_DEPRECATED=N;g.getMatChatBulk_DEPRECATED=O;g.removeMatChatMapping_DEPRECATED=R;g.populateMatCacheBulk=S;g.updateDeprecatedChatMatCache_DEPRECATED=T;g.clearMatChatCache_DEPRECATED=U;g.injectAdditionalEphemeralInfoFromDB=V}),98); __d("WAWebOffdStorageUpdateOfflinePeerReceipts",["Promise","WAJids","WALogger","WAWebAck","WAWebBackendApi","WAWebDBBulkGetRootMsgs","WAWebDBMsgUtils","WAWebLid1X1MigrationGating","WAWebMarkAddOnsAsReadJob","WAWebModelStorageUtils","WAWebMsgGetters","WAWebMsgKey","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebSchemaMessage","WAWebSchemaPeerReadReceipt","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: getUpdatesForPeerReadReceipts: found "," pendingReadMessages"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: finish update add-on tables"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: finish update chat/message table"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: finish compute peer played updates"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: finish compute peer receipt updates"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["updatePeerReceipts: unknown ack type: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: find "," peer receipts"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: updatePeerReceipts: start updatePeerReceipts"]);p=function(){return a};return a}function a(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"UpdatePeerReceipts_start");d("WALogger").DEV(p());var a=(yield d("WAWebSchemaPeerReadReceipt").getTable().all());if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.msgKeys=(yield d("WAWebDBBulkGetRootMsgs").fixMsgKeysWithChatId(a.msgKeys))});return function(b){return a.apply(this,arguments)}}()));else{var e=[],f=[];for(var g of a)for(var i of g.msgKeys){var q=c("WAWebMsgKey").fromString(i);q.remote.isLid()&&(g.ack===d("WAWebAck").ACK.READ?e.push(q):g.ack===d("WAWebAck").ACK.PLAYED&&f.push(q))}e.length>0&&a.push({ack:d("WAWebAck").ACK.READ,msgKeys:d("WAWebDBBulkGetRootMsgs").fixMsgKeysWithPnMapping(e).map(String)});f.length>0&&a.push({ack:d("WAWebAck").ACK.PLAYED,msgKeys:Array.from(f).map(String)})}d("WALogger").DEV(o(),a.length);var s=[],v=[];a.forEach(function(a){a.ack===d("WAWebAck").ACK.READ?s.push(a):a.ack===d("WAWebAck").ACK.PLAYED?v.push(a):d("WALogger").WARN(n(),a.ack)});q=(yield r(s));var w=q.chatUpdates;i=q.ackUpdates;d("WALogger").DEV(m());var x=new Map(i.map(function(a){return[a.id,a]}));g=u(v);g.forEach(function(a){var b=x.get(a.id);b==null?x.set(a.id,a):x.set(a.id,babelHelpers["extends"]({},b,{ack:a.ack}))});var y=Array.from(x.values());d("WALogger").DEV(l());d("WAWebBackendApi").frontendFireAndForget("updateOfflinePeerReceipt",{chatUpdates:w.map(function(a){return{chatId:a.id,unreadCount:a.unreadCount,unreadMentionsOfMe:(a=a.unreadMentionsOfMe)!=null?a:[]}}),ackUpdates:y.map(function(a){return{msgKey:a.id,ack:a.ack}})});yield (h||(h=b("Promise"))).all([d("WAWebModelStorageUtils").getStorage().lock(["message","chat"],function(a){var c=a[0];a=a[1];return(h||(h=b("Promise"))).all([c.bulkCreateOrMerge(y),a.bulkCreateOrMerge(w)])}).then(function(){d("WALogger").DEV(k())}),d("WAWebMarkAddOnsAsReadJob").markUnclassifiedAddOnsAsReadJob(Array.from(t(s)).map(function(a){return c("WAWebMsgKey").from(a)})).then(function(){d("WALogger").DEV(j())})]);return d("WAWebSchemaPeerReadReceipt").getTable().clear().then(function(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"UpdatePeerReceipts_end")})});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=t(a),f=(yield j(a));j=Array.from(f.keys());a=j.reduce(function(a,b){var c;a.push([b,d("WAWebDBMsgUtils").PendingReadReceiptType.Message]);((c=d("WAWebWidFactory").createWid(b))==null?void 0:c.isBot())&&a.push([b,d("WAWebDBMsgUtils").PendingReadReceiptType.MessageEdit]);return a},[]);var g=(yield d("WAWebSchemaMessage").getMessageTable().anyOf(["from","pendingReadReceipt"],a,{shouldDecrypt:!1}));d("WALogger").DEV(i(),g.length);g.forEach(function(a){return l(f.get(a.from),a)});g.forEach(function(a){return m(f.get(a.from),a)});a=n(g).concat(o(e));n=j.map(function(a){var b=f.get(a);return b!=null&&b.lastUnreadMsgRowId!=null?{id:a,unreadCount:b.unreadCount,unreadMentionsOfMe:b.unreadMentionsOfMe}:null}).filter(Boolean);return{chatUpdates:n,ackUpdates:a};function h(a){return c("WAWebMsgKey").fromString(a).remote.toString()}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return new Map(a.flatMap(function(a){return a.msgKeys}).map(h).filter(function(a){return a!==d("WAJids").STATUS_JID}).map(function(a){return[a,{unreadCount:0,lastUnreadMsgRowId:void 0,unreadMentionsOfMe:[],unreadMentionCount:0}]}))});return k.apply(this,arguments)}function l(a,b){var c=b.rowId;b=b.id;if(a==null||c==null)return;e.has(b)&&(a.lastUnreadMsgRowId==null||c>a.lastUnreadMsgRowId)&&(a.lastUnreadMsgRowId=c)}function m(a,b){var c=b.rowId;if(a==null||c==null||a.lastUnreadMsgRowId==null)return;if(c>a.lastUnreadMsgRowId){a.unreadCount+=1;if(d("WAWebMsgGetters").getIsImportantMessage(b)){c={id:b.id,timestamp:b.t};a.unreadMentionsOfMe.push(c)}}}function n(a){return g.flatMap(function(a){var b=a.rowId,c=f.get(a.from);if(c==null||b==null||c.lastUnreadMsgRowId==null)return[];return b<=c.lastUnreadMsgRowId?[{id:a.id,ack:d("WAWebAck").ACK.READ,pendingReadReceipt:null}]:[]})}function o(a){return Array.from(a).filter(function(a){return h(a)===d("WAJids").STATUS_JID}).map(function(a){return{id:a,ack:d("WAWebAck").ACK.READ}})}});return s.apply(this,arguments)}function t(a){return new Set(a.flatMap(function(a){return a.msgKeys}))}function u(a){var b=new Set();a.forEach(function(a){a.ack===d("WAWebAck").ACK.PLAYED&&a.msgKeys.forEach(function(a){return b.add(a)})});return Array.from(b).map(function(a){return{id:a,ack:d("WAWebAck").ACK.PLAYED,pendingReadReceipt:null}})}g.updatePeerReceipts=a}),98); __d("WAWebSchemaPendingDeviceSync",["WAWebOffdStorageUtils","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){c=d("WAWebStorageMutationBuilder").columnBuilder();var h=c.addUserDefinedPrimaryKey;function a(){d("WAWebOffdStorageUtils").getStorage().add("pending-device-sync").version(d("WAWebOffdStorageUtils").getStorage().versions.version(4),[h("id")]).view(function(a){return a})}function b(){return d("WAWebOffdStorageUtils").getStorage().table("pending-device-sync")}g.addTable=a;g.getTable=b}),98); __d("WAWebApiPendingDeviceSync",["WALogger","WAWebSchemaPendingDeviceSync","WAWebSyncDeviceAdvDeviceListJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["doPendingDeviceSync failed during RESUME_WITH_OPEN_TAB"]);h=function(){return a};return a}function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield d("WAWebSchemaPendingDeviceSync").getTable().all());yield d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob(a.map(function(a){return d("WAWebWidFactory").createWid(a.id)}),null,null);yield d("WAWebSchemaPendingDeviceSync").getTable().bulkRemove(a.map(function(a){return a.id}))}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a)}});return i.apply(this,arguments)}function c(a){return d("WAWebSchemaPendingDeviceSync").getTable().bulkCreateOrMerge(a.map(function(a){return{id:a}}))}g.doPendingDeviceSync=a;g.addUserToPendingDeviceSync=c}),98); __d("WAWebTimestampConversionUtils",["WALogger","WALongInt","WATimeUtils"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: maybeMillisecondsToSeconds: messageTimestamp: "," too large to cast"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: maybeMillisecondsToSeconds: no need to adjust timestamp"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: maybeMillisecondsToSeconds: adjusting future timestamp"]);j=function(){return a};return a}function a(a){var b=a;try{d("WALongInt").numberOrThrowIfTooLarge(a)/d("WATimeUtils").unixTime()>10?(b=d("WALongInt").numberOrThrowIfTooLarge(a)/1e3,d("WALogger").LOG(j())):d("WALogger").LOG(i())}catch(b){d("WALogger").WARN(h(),a)}return b}g.maybeMillisecondsToSeconds=a}),98); __d("WAWebActiveMessageRanges",["WALogger","WALongInt","WAWebApiActiveMessageRanges","WAWebHandleForMessageRangeEnums","WAWebSchemaActiveMessageRanges","WAWebTimestampConversionUtils"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: last message timestamp was converted to seconds from ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing message range from row."]);i=function(){return a};return a}function j(a,b){var c,e;if(a==null){d("WALogger").WARN(i());return d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN}var f=a.messages;a=a.lastMessageTimestamp;c=d("WAWebTimestampConversionUtils").maybeMillisecondsToSeconds((c=a)!=null?c:0);c!==((e=a)!=null?e:0)&&d("WALogger").LOG(h(),a).sendLogs("syncd: last message timestamp was converted to seconds",{sampling:.01});if(b.t!=null&&b.t<d("WALongInt").numberOrThrowIfTooLarge(c))return d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_TIMESTAMP;e=b.id;for(a of f){c=a.key;if(c!=null&&e!=null&&c.id===e.id)return d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_ADDITIONAL}return d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN}function a(a,b){d("WAWebApiActiveMessageRanges").getActiveMessageRanges(a.remote.toString()).then(function(c){c.forEach(function(c){if([d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive,d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead].includes(c.action)&&j(c.actionValue.messageRange,{id:a,t:b})===d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN)return d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.remote.toString(),c.action)})})}g.rangeContainsMessage=j;g.checkAndRemoveActiveMessageRanges=a}),98); __d("WAWebWamEnumCollection",[],(function(a,b,c,d,e,f){a=Object.freeze({REGULAR:1,REGULAR_LOW:2,REGULAR_HIGH:3,CRITICAL_BLOCK:4,CRITICAL_UNBLOCK_LOW:5});f.COLLECTION=a}),66); __d("WAWebWamEnumMdSyncdCriticalEventCode",[],(function(a,b,c,d,e,f){a=Object.freeze({MESSAGE_RANGE_UNSET:1,MESSAGE_RANGE_LAST_SYSTEM_MESSAGE_TIMESTAMP_SET:2,MESSAGE_RANGE_MESSAGES_UNSET:3,MESSAGE_RANGE_MESSAGES_EMPTY:4,MESSAGE_RANGE_MESSAGES_CROSS_LIMIT:5,MESSAGE_RANGE_MESSAGE_KEY_UNSET:6,MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_UNSET:7,MESSAGE_RANGE_MESSAGE_KEY_FROM_ME_UNSET:8,MESSAGE_RANGE_MESSAGE_KEY_STANZA_ID_UNSET:9,MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_INVALID:10,MESSAGE_RANGE_MESSAGE_KEY_PARTICIPANT_UNSET:11,MALFORMED_PENDING_MUTATION:12,ACTION_INVALID_INDEX_DATA:13,MISSING_MUTATION_TO_REMOVE:14,LTHASH_INCONSISTENCY_ON_DAILY_CHECK:15,LTHASH_INCONSISTENCY_ON_SNAPSHOT_MAC_MISMATCH:16});f.MD_SYNCD_CRITICAL_EVENT_CODE=a}),66); __d("WAWebMdCriticalEventWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCollection","WAWebWamEnumMdSyncdCriticalEventCode"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdCriticalEvent:[2746,{collection:[2,d("WAWebWamEnumCollection").COLLECTION],mdCriticalEventCode:[1,d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE]},[1,1,1],"regular"]},{MdCriticalEvent:[]});g.MdCriticalEventWamEvent=a}),98); __d("WAWebSyncdActionUtils",["WASyncAction.pb","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function h(a,b){return JSON.stringify([a].concat(b))}function a(a){var b=a.action,c=a.indexArgs,e=a.collection,f=a.value,g=a.version,i=a.operation;a=a.timestamp;return{collection:e,index:h(b,c),binarySyncAction:d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,babelHelpers["extends"]({},f,{timestamp:a})).readBuffer(),version:g,operation:i,timestamp:a,action:b}}function b(a){var b=a.remoteJid,c=a.id,d=a.fromMe;a=a.participant;return[b,c,d?"1":"0",a!=null&&!d?a:"0"]}g.buildIndex=h;g.buildPendingMutation=a;g.buildMessageKey=b}),98); __d("WAWebSyncdUtils",["WASyncdConst","WAWebMdCriticalEventWamEvent","WAWebSyncdActionUtils","WAWebWamEnumCollection"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSyncdActionUtils").buildIndex(d("WASyncdConst").Actions.Star,h(a))}function b(a){return h(a.id)}function h(a){var b=i(a);return[a.remote.toString({legacy:!0}),a.id,a.fromMe?"1":"0",b]}function i(a){var b="0";a.participant&&!a.remote.isUser()&&!a.fromMe&&(b=a.participant.toString({legacy:!0}));return b}function j(a){switch(a){case d("WASyncdConst").CollectionName.CriticalBlock:return d("WAWebWamEnumCollection").COLLECTION.CRITICAL_BLOCK;case d("WASyncdConst").CollectionName.CriticalUnblockLow:return d("WAWebWamEnumCollection").COLLECTION.CRITICAL_UNBLOCK_LOW;case d("WASyncdConst").CollectionName.Regular:return d("WAWebWamEnumCollection").COLLECTION.REGULAR;case d("WASyncdConst").CollectionName.RegularHigh:return d("WAWebWamEnumCollection").COLLECTION.REGULAR_HIGH;case d("WASyncdConst").CollectionName.RegularLow:return d("WAWebWamEnumCollection").COLLECTION.REGULAR_LOW}}function c(a,b){a=new(d("WAWebMdCriticalEventWamEvent").MdCriticalEventWamEvent)({mdCriticalEventCode:a});b!=null&&(a.collection=j(b));a.commit()}g.constructStarMsgKeyFromMsgKey=a;g.constructMsgKeySegments=b;g.constructMsgKeySegmentsFromMsgKey=h;g.extractParticipantForSync=i;g.collectionNameToMetric=j;g.uploadCriticalEventMetric=c}),98); __d("WAWebHandleForMessageRange",["Promise","WALogger","WASyncAction.pb","WAWebActiveMessageRanges","WAWebAddonGatingUtils","WAWebApiActiveMessageRanges","WAWebHandleForMessageRangeEnums","WAWebMsgRangeContainmentHandlers","WAWebMsgType","WAWebSchemaActiveMessageRanges","WAWebSyncdDb","WAWebSyncdUtils","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMessageContainment called with unknwon message range action action: ",""]);i=function(){return a};return a}var j=new Set(),k=function(a){return a.reduce(function(a,b){return new Set([].concat(Array.from(a),Array.from(b)))},new Set())};function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;switch(a.action){case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive:a.actionValue.archived===!0?yield d("WAWebMsgRangeContainmentHandlers").handleForArchive(a,c):yield d("WAWebMsgRangeContainmentHandlers").handleForUnarchive(a,c);return j;case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead:yield d("WAWebMsgRangeContainmentHandlers").handleForMarkAsReadUnread(a,c,!!a.actionValue.read);return j;case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia:e=d("WAWebMsgRangeContainmentHandlers").handleForClearChat(a,c);return e?new Set([e]):j;case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia:if(!(yield n(b.id))){e=d("WAWebMsgRangeContainmentHandlers").handleForClearChat(a,c);return e?new Set([e]):j}return j;case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia:e=d("WAWebMsgRangeContainmentHandlers").handleForDeleteChat(a,c);return e?new Set([e]):j}d("WALogger").WARN(i(),a.action);return j});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebSyncdUtils").constructStarMsgKeyFromMsgKey(a);a=(yield d("WAWebSyncdDb").getSyncAction(a));if(a){a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value;return(a==null?void 0:(a=a.starAction)==null?void 0:a.starred)||!1}return!1});return o.apply(this,arguments)}function p(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=!0);if(d("WAWebMsgType").SYSTEM_MESSAGE_TYPES.includes(c.type))return j;a=(yield d("WAWebApiActiveMessageRanges").getActiveMessageRanges(a.toString()));a=a.map(function(a){return[a,d("WAWebActiveMessageRanges").rangeContainsMessage(a.actionValue.messageRange,c)]});var f=a.filter(function(a){a=a[1];return a===d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_ADDITIONAL}).map(function(a){a=a[0];return a});f.forEach(function(a){a.remainingMessages--});yield d("WAWebApiActiveMessageRanges").bulkUpdateActiveMessageRanges(f,e);f=a.map(function(a){var b=a[0];a=a[1];return l(b,c,a)});e=(yield (h||(h=b("Promise"))).all(f));return k(e)});return q.apply(this,arguments)}function r(a){if(d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(a.type))return!0;return a.type==="reaction"||a.type==="poll_update"?!0:!1}function a(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=new Map();a.forEach(function(a){if(d("WAWebMsgType").SYSTEM_MESSAGE_TYPES.includes(a.type)||r(a))return;var b=c.get(a.id.remote.toString());(b==null||b.t<a.t)&&c.set(a.id.remote.toString(),a)});yield (h||(h=b("Promise"))).all(Array.from(c.entries()).map(function(a){var b=a[0];a=a[1];return p(d("WAWebWidFactory").createWid(b),a)}))});return s.apply(this,arguments)}g.handleForActiveMessageRange=p;g.handleOfflineForMessageRange=a}),98); __d("WAWebChatDbUpdatesApi",["WAWebBackendApi","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a);a=a.map(function(a){return{id:d("WAWebWidFactory").createWid(a.id),archive:a.archive}});d("WAWebBackendApi").frontendFireAndForget("chatCollectionUpdate",{updates:a})});return h.apply(this,arguments)}g.setArchive=a}),98); __d("WAWebMsgRangeContainmentHandlers",["WALogger","WAWebApiActiveMessageRanges","WAWebBackendApi","WAWebChatDbUpdatesApi","WAWebHandleForMessageRangeEnums","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleForArchive: Unarchiving chat due to an incoming message"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b===d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN){b=(yield d("WAWebUserPrefsMultiDevice").getArchiveV2EnabledSetting());var c=(yield d("WAWebUserPrefsMultiDevice").getUnarchiveChatsSetting());(!b||c)&&(d("WALogger").DEV(h()),d("WAWebChatDbUpdatesApi").setArchive([{id:a.chatId,archive:!1}]));yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.chatId,a.action)}});return i.apply(this,arguments)}function c(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){(b===d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN||a.remainingMessages===0)&&(yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.chatId,a.action))});return j.apply(this,arguments)}function e(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b===d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN?yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.chatId,a.action):a.remainingMessages===0&&(d("WAWebBackendApi").frontendFireAndForget("updateChatReadStatus",{id:d("WAWebWidFactory").createWid(a.chatId),read:c}),yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.chatId,a.action))});return k.apply(this,arguments)}function f(a,b){switch(b){case d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_TIMESTAMP:case d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_ADDITIONAL:return d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.DropMessage;case d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN:return}}function l(a,b){switch(b){case d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_TIMESTAMP:case d("WAWebHandleForMessageRangeEnums").RangeContain.CONTAINS_BY_ADDITIONAL:return d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.DropMessage;case d("WAWebHandleForMessageRangeEnums").RangeContain.DOES_NOT_CONTAIN:return}}g.handleForArchive=a;g.handleForUnarchive=c;g.handleForMarkAsReadUnread=e;g.handleForClearChat=f;g.handleForDeleteChat=l}),98); __d("PaymentLinkPSPImagePathMapper",["bx"],(function(a,b,c,d,e,f,g){"use strict";b=Object.freeze({"mercadopago-light":(a=c("bx")).getURL(a("32187")),"mercadopago-dark":a.getURL(a("32186"))});g.PaymentLinkPSPImagePathMapper=b}),98); __d("PaymentLink",["PaymentLinkPSPImagePathMapper","PaymentLinkWithCTAFeature","WAWebABProps","WAWebMobilePlatforms"],(function(a,b,c,d,e,f,g){"use strict";f="Open payment link";function a(a,b){if(a==null)return null;a=a+(b?"-dark":"-light");return Object.prototype.hasOwnProperty.call(d("PaymentLinkPSPImagePathMapper").PaymentLinkPSPImagePathMapper,a)?d("PaymentLinkPSPImagePathMapper").PaymentLinkPSPImagePathMapper[a]:null}function b(a){var b=JSON.parse(d("WAWebABProps").getABPropConfigValue("smb_payment_links_url_regex_list"));for(var c in b)if(a.match(c))return b[c];return null}function h(){return d("WAWebMobilePlatforms").isSMB()}function c(a){a=new(d("PaymentLinkWithCTAFeature").PaymentLinkWithCTAFeature)(a);return a.getMetadata()}function e(a){var b=JSON.parse(d("WAWebABProps").getABPropConfigValue("smb_payment_links_url_regex_list"));for(var c in b)if(a.match(c))return{psp:b[c],shouldDetectInComposer:h()};return null}g.CTA_TEXT=f;g.getPSPIconPath=a;g.getPSP=b;g.shouldDetectInComposer=h;g.getPaymentLinkMessageMetadata=c;g.getPaymentLinkUrlMetaData=e}),98); __d("PaymentLinkWithCTAFeature",["$InternalEnum","PaymentLink","WALogger","WAWebABProps","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[PAYMENT LINK WITH CTA] error while parsing json for ab prop smb_payment_links_cta_psp_list: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[PAYMENT LINK WITH CTA] error while parsing json for ab prop payment_links_cta_button_psp_variant_list: ",""]);i=function(){return a};return a}var j=b("$InternalEnum")({LINK_PREVIEW_HEADER_WITH_CTA:0,ORDER_HEADER_WITH_CTA:1,DEFAULT:2});function a(a){return k.isKillSwitchEnabled()?!1:(a==null?void 0:(a=a.header)==null?void 0:a.headerType)===d("WAWebProtobufsE2E.pb").Message$PaymentLinkMetadata$PaymentLinkHeader$PaymentLinkHeaderType.ORDER}var k=function(){function a(a){this.psp=a}a.isKillSwitchEnabled=function(){return d("WAWebABProps").getABPropConfigValue("smb_payment_links_cta_button_kill_switch")};var b=a.prototype;b.$1=function(){if(a.isKillSwitchEnabled())return j.DEFAULT;if(d("WAWebABProps").getABPropConfigValue("payment_br_holdout"))return j.DEFAULT;try{var b=JSON.parse(d("WAWebABProps").getABPropConfigValue("payment_links_cta_button_psp_variant_list"));if(j.isValid(b[this.psp])){return(b=j.cast(b[this.psp]))!=null?b:j.DEFAULT}}catch(a){d("WALogger").ERROR(i(),a)}try{b=JSON.parse(d("WAWebABProps").getABPropConfigValue("smb_payment_links_cta_psp_list"));b=b==null?void 0:b.psp;if(!Array.isArray(b)||(b==null?void 0:b.includes(this.psp))===!1)return j.DEFAULT}catch(a){d("WALogger").ERROR(h(),a);return j.DEFAULT}return(b=j.cast(d("WAWebABProps").getABPropConfigValue("smb_payment_links_cta_variant")))!=null?b:j.DEFAULT};b.getMetadata=function(){var a=this.$1();switch(a){case j.LINK_PREVIEW_HEADER_WITH_CTA:return{button:{displayText:d("PaymentLink").CTA_TEXT},header:{headerType:d("WAWebProtobufsE2E.pb").Message$PaymentLinkMetadata$PaymentLinkHeader$PaymentLinkHeaderType.LINK_PREVIEW}};case j.ORDER_HEADER_WITH_CTA:return{button:{displayText:d("PaymentLink").CTA_TEXT},header:{headerType:d("WAWebProtobufsE2E.pb").Message$PaymentLinkMetadata$PaymentLinkHeader$PaymentLinkHeaderType.ORDER}};case j.DEFAULT:return null}};return a}();g.PaymentLinkVariant=j;g.shouldShowPaymentLinkOrderHeader=a;g.PaymentLinkWithCTAFeature=k}),98); __d("WAWebApi",[],(function(a,b,c,d,e,f){a={GROUP_INVITE:"GROUP_INVITE",MSG_SEND:"MSG_SEND",INVALID:"INVALID",CATALOG:"CATALOG",PRODUCT:"PRODUCT",PUSH_NOTIFICATION:"PUSH_NOTIFICATION",CREATE_COMMUNITY:"CREATE_COMMUNITY",NEWSLETTER:"NEWSLETTER",AVATAR_STICKERPACK:"AVATAR_STICKERPACK",ADVERTISE:"ADVERTISE",MANAGE_ADS:"MANAGE_ADS",MESSAGE_YOURSELF:"MESSAGE_YOURSELF",BROADCAST:"BROADCAST",STATUS_POST:"STATUS_POST",EDIT_PROFILE_PICTURE:"EDIT_PROFILE_PICTURE",CALL_USER:"CALL_USER",PAYMENT_LINK:"PAYMENT_LINK",FAVORITES:"FAVORITES",OPEN_CATALOG:"OPEN_CATALOG",STICKER_PACK:"STICKER_PACK",CATALOG_LINKING_CHAT_PSA:"CATALOG_LINKING_CHAT_PSA",UGC_BOT:"UGC_BOT",META_VERIFIED:"META_VERIFIED"};f.APICmd=a}),66); __d("WAWebApiParseUtils",["WAWebBuildConstants"],(function(a,b,c,d,e,f,g){b=function(a){return a.replace(/\/+$/,"")};c=b(d("WAWebBuildConstants").BUILD_URL).replace(/[\/\.]/g,"\\$&");e="((?:/\\w+)*)";f="(?:(?:/\\w+)*)";function a(a){a=a.hostname;return a==="whatsapp.com"||a==="www.whatsapp.com"||a==="wa.me"}g.ORIGIN=c;g.OPTIONAL_PATH_PART=e;g.OPTIONAL_NON_CAPTURING_PATH_PART=f;g.isWhatsappHost=a}),98); __d("WAWebBroadcastApiParse",["$InternalEnum","WAWebABProps","WAWebApiParseUtils"],(function(a,b,c,d,e,f,g){var h="channel",i="channels",j="status",k="updates",l=new RegExp("^"+d("WAWebApiParseUtils").ORIGIN+d("WAWebApiParseUtils").OPTIONAL_PATH_PART+"/accept/?\\?channel_invite_code=(?:&.*)?$","i"),m=b("$InternalEnum").Mirrored(["Newsletter","Status"]);function n(a){return a.length===0||a.length===1&&a[0]===""}function a(a){try{var b=new URL(a),c=b.pathname;c=c.split("/");c[0];var e=c[1];c=c.slice(2);if(d("WAWebApiParseUtils").isWhatsappHost(b)){if(!n(c))return null;switch(e){case i:case h:return{feature:m.Newsletter,url:b.href};case j:return{feature:m.Status,url:b.href};case k:return!d("WAWebABProps").getABPropConfigValue("status_deeplink_enabled")?null:{feature:m.Status,url:b.href}}}c=a.match(l);if(c)return{feature:m.Newsletter,url:a}}catch(a){}return null}g.BroadcastFeatureType=m;g.parseBroadcastFeatureLink=a}),98); __d("WAWebExternalCtxConfig",["WAWebABProps"],(function(a,b,c,d,e,f,g){var h="partnertoken",i="token";function a(){return d("WAWebABProps").getABPropConfigValue("external_ctx_authorise_wa_chat")}function j(){return d("WAWebABProps").getABPropConfigValue("external_ctx_foa_logging")===1}function b(){var a=d("WAWebABProps").getABPropConfigValue("external_ctx_authorise_existing_chats");switch(a){case 1:return"NEW_CHATS_OR_EXISTING_CHATS_WITH_PARTNER_LINKS";case 2:return"ALL_CHATS";default:return"NEW_CHATS_ONLY"}}function c(){var a=d("WAWebABProps").getABPropConfigValue("external_ctx_url_param_names")||"";a=a.split(",").map(function(a){return a.trim()}).filter(function(a){return a!==""});a=a.length>0?a:[h];j()&&a.push(i);return a}g.isCtxLoggingEnabled=a;g.getFirstMessageLoggingOption=b;g.getExternalCtxUrlParamNames=c}),98); __d("WAWebChatEntryPoint",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["NewsletterIntegrity","NewsletterChatlist","NewsletterDirectory","NewsletterDirectorySearch","NewsletterDirectoryCategory","NewsletterDirectoryCategorySearch","NewsLetterRecommendation","NewsletterUpdatesTab","NewsletterUpdatesTabSearch","NewsletterCreationFlow","NewsletterAdminInviteAcceptModal","NewsletterPostLinkCard","NewsletterLinkCard","NewsletterLinkCardButton","ForwardedNewsletterMessage","NewsletterCTAOnStatus","SimilarNewsletters","Link","Deeplink","Chatlist","Vcard","Notification","Unknown","BotChatListShortcut","PrivateReply","DirectMessage","ContactInfo","Mention","ChatsTab","NewslettersTab","CommunitiesTab","VoipWindow"]);f.ChatEntryPoint=a}),66); __d("WAWebNewsletterApiParse",["$InternalEnum","WAWebApiParseUtils","WAWebChatEntryPoint"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").Mirrored(["Handle","InviteCode","Id"]),i="channel",j="create",k="directory",l=new RegExp("^"+d("WAWebApiParseUtils").ORIGIN+d("WAWebApiParseUtils").OPTIONAL_PATH_PART+"/accept/?\\?channel_invite_code=(\\w+)(?:&.*)?$","i"),m=new RegExp("^whatsapp://("+i+")/(\\w+)/?(?:\\?.*)?$","i");function n(a){return a.length===0||a.length===1&&a[0]===""}function o(a){try{var b=new URL(a),c=b.pathname;c=c.split("/");c[0];var e=c[1],f=c[2];c=c.slice(3);if(e===i&&d("WAWebApiParseUtils").isWhatsappHost(b)){if(n(c))switch(f){case j:return{type:"create",url:b.href};case k:return{type:"directory",url:b.href};default:if(f!=null&&f!=="")return{identifier:f,url:b.href,identifierType:h.InviteCode,type:"view",chatEntryPoint:d("WAWebChatEntryPoint").ChatEntryPoint.Link}}if(f!==j&&f!==k&&(c.length===1||c.length===2&&c[1]==="")){e=parseInt(c[0],10);return babelHelpers["extends"]({identifier:f,url:b.href,identifierType:h.InviteCode,type:"view",chatEntryPoint:d("WAWebChatEntryPoint").ChatEntryPoint.Link},!Number.isNaN(e)&&{serverId:e})}}c=p(l,a);if(c!=null)return c;f=p(m,a);return f!=null?f:null}catch(a){return null}}function p(a,b){a=b.match(a);if(a){var c=a[2];if(c===j)return{type:"create",url:b};return c===k?{type:"directory",url:b}:{identifier:a[2],url:a[1]||"/",identifierType:h.InviteCode,type:"view",chatEntryPoint:d("WAWebChatEntryPoint").ChatEntryPoint.Deeplink}}return null}function a(a){if(a==null)return!1;return a.startsWith("http://")||a.startsWith("https://")?o(a)!=null:o("https://"+a)!=null}g.NewsletterIdentifierType=h;g.parseNewsletter=o;g.isNewsletterInviteCode=a}),98); __d("WAWebStatusApiParse",["$InternalEnum","WAWebApiParseUtils","WAWebPonyfillsUrlSearchParams"],(function(a,b,c,d,e,f,g){"use strict";var h="status",i="text",j="photo",k=b("$InternalEnum").Mirrored(["Text","Media"]);function l(a){return a.length===0||a.length===1&&a[0]===""}function a(a){try{a=new URL(a);var b=a.pathname;if(!d("WAWebApiParseUtils").isWhatsappHost(a))return null;b=b.split("/");b[0];var e=b[1];b=b.slice(2);if(!l(b))return null;if(e!==h)return null;b=a.searchParams||new(c("WAWebPonyfillsUrlSearchParams"))(a.search);e=b.get(i);if(e!=null)return{postType:k.Text,url:a.href};e=b.get(j);if(e!=null)return{postType:k.Media,url:a.href}}catch(a){}return null}g.StatusPostType=k;g.parseStatusPostFeatureLink=a}),98); __d("WAWebWamEnumDeepLinkType",[],(function(a,b,c,d,e,f){a=Object.freeze({DEEP_LINK_UNKNOWN:1,DEEP_LINK_CHAT:2,DEEP_LINK_CONTACT_QR_CODE:3,DEEP_LINK_PAYMENT:4,DEEP_LINK_PRODUCT:5,DEEP_LINK_CATALOG:6,DEEP_LINK_FUTURE_PROOF:7,DEEP_LINK_GROUP_INVITE:8,DEEP_LINK_MSG_FORWARD:9,DEEP_LINK_MESSAGE_QR_CODE:10,DEEP_LINK_OPT_IN_QR_CODE:11,DEEP_LINK_CTWA:12,DEEP_LINK_STICKERPACK:13,DEEP_LINK_NOVI_HUB:14,DEEP_LINK_NOVI_ADD_DEBIT_CARD:15,DEEP_LINK_NOVI_ADD_BANK_ACCOUNT:16,DEEP_LINK_NOVI_WITHDRAW:17,DEEP_LINK_NOVI_RESET_PASSWORD:18,DEEP_LINK_PAYMENT_SIGNUP:19,DEEP_LINK_BIZTOOLS_ACCOUNTS:20,DEEP_LINK_PAYMENT_VIRALITY:21,DEEP_LINK_SETTINGS_ACCOUNT_DELETE:22,DEEP_LINK_SETTINGS_ACCOUNT_REQUEST_INFO:23,DEEP_LINK_SETTINGS_CHATS_HISTORY:24,DEEP_LINK_DISAPPEARING_MODE:25,DEEP_LINK_ARCHIVE_SETTINGS:26,DEEP_LINK_TOS:27,DEEP_LINK_NOVI_CARE:28,DEEP_LINK_NOVI_TPP_ACCOUNT_LINKING:29,DEEP_LINK_CONTACT_SUPPORT:30,DEEP_LINK_BIZTOOLS_DIRECTORY:31,DEEP_LINK_DIRECTORY:32,DEEP_LINK_CALL:33,DEEP_LINK_DIRECTORY_DEEPER_CATEGORY_SELECTION:34,DEEP_LINK_PHOENIX:35,DEEP_LINK_HELP_CENTER_TO_SETTINGS_CHATS:36,DEEP_LINK_CREATE_COMMUNITY:37,DEEP_LINK_SMB_AD_CREATION:38,DEEP_LINK_SMB_MANAGE_ADS:39,DEEP_LINK_SMB_MANAGE_ADS_DETAIL:40,DEEP_LINK_STATUS_SHARE:41,DEEP_LINK_PREMIUM:42,DEEP_LINK_SETTINGS_LINKED_DEVICES:43,DEEP_LINK_SMB_AD_CREATION_FROM_CATALOG:44,DEEP_LINK_SMB_AD_CREATION_FROM_BIZTAB:45,DEEP_LINK_SMB_EDIT_PROFILE:46,DEEP_LINK_EDIT_PROFILE_PIC:47,DEEP_LINK_SMB_EDIT_CATALOG:48,DEEP_LINK_SMB_BIZ_HOURS:49,DEEP_LINK_SMB_LOCATION:50,DEEP_LINK_SMB_LINKED_ACCOUNTS:51,DEEP_LINK_PRIVACY_SETTINGS:52,DEEP_LINK_SMB_EDIT_DESCRIPTION:53,DEEP_LINK_SMB_AD_CREATION_RESUME:54,DEEP_LINK_PRIVACY_DISCLOSURE:55,DEEP_LINK_CHANNEL:56,DEEPLINK_SMB_BIZ_WEBSITE:57,DEEP_LINK_PRIVACY_CHECKUP:58,DEEP_LINK_SMB_SELF_CATALOG:59,DEEP_LINK_SCAN_MIGRATION_QR_CODE:60,DEEP_LINK_PROXY:61,DEEP_LINK_HELP:62,DEEP_LINK_PRICE_TIER:63,DEEP_LINK_CALLING_PRIVACY:64,DEEP_LINK_PAYMENTS_PUSH_PROVISIONING:65,DEEP_LINK_FB_EVENT_LINK:66,DEEP_LINK_SETTINGS_ACCOUNT_2FA:67,DEEP_LINK_SMB_ADVERTISE_PROFILE:68,DEEP_LINK_SMB_LABELS_WITH_BIZTAB:69,DEEP_LINK_SMB_GREETING_MESSAGE_WITH_BIZTAB:70,DEEP_LINK_SMB_AWAY_MESSAGE_WITH_BIZTAB:71,DEEP_LINK_SMB_ADVERTISE_LATEST_STATUS:72,DEEP_LINK_SMB_PROFILE_COMPLETENESS:73,DEEP_LINK_SMB_AD_DETAILS:74,DEEP_LINK_SETTINGS_ACCOUNT_SWITCHER:75,DEEP_LINK_CHAT_TRANSFER:76,DEEP_LINK_CODE_LINKING:77,DEEP_LINK_MARKETING_MESSAGE:78,DEEP_LINK_HOME_CHATS:79,DEEP_LINK_MESSAGE_YOURSELF:80,DEEP_LINK_SETTINGS_ACCOUNT_EMAIL:81,DEEP_LINK_EDIT_AD:82,DEEP_LINK_MESSAGING_GUIDE:83,DEEP_LINK_SMB_DRAFT_AD:84,DEEP_LINK_CALLING_AWARENESS_VOICE_CHAT:85,DEEP_LINK_CALLING_AWARENESS_SCHEDULED_CALL:86,DEEP_LINK_COEXISTENCE_ONBOARDING:87,DEEP_LINK_SETTINGS_STORAGE_MANAGEMENT:88,DEEP_LINK_PAYMENT_BRAZIL_MERCHANT:89,DEEP_LINK_PAYMENT_BRAZIL_BUYER:90,DEEP_LINK_PRIVACY_GROUPS:91,DEEP_LINK_PRIVACY_PROFILE:92,DEEP_LINK_AIS:93,DEEP_LINK_PENDING_AD_PAYMENT:94,DEEP_LINK_PENDING_AD_REVIEW:95,DEEP_LINK_SETTINGS_ACCOUNT_VERIFY_EMAIL:96,DEEP_LINK_CTWA_EXTERNAL:97,DEEP_LINK_SMB_BIZ_SEARCH_ONBOARDING_SHEET:98,DEEP_LINK_CALLING_AWARENESS_GROUP_CALL:99,DEEP_LINK_SMB_ORDERS_HOME:100,DEEP_LINK_ADS_DATA_SHARING:101,DEEP_LINK_VIDEO_PROMOTION:102,DEEP_LINK_CTWA_RECENTLY_SHARED_MEDIA:103,DEEP_LINK_MARKETING_MESSAGE_OPT_IN:104,DEEP_LINK_GROUPS_PRIVACY:105,DEEP_LINK_PROFILE_PRIVACY:106,DEEP_LINK_ORDERS_EDUCATION_VIDEO:107,DEEP_LINK_META_VERIFIED:108,DEEP_LINK_SMB_AGENT_ONBOARDING:109,DEEP_LINK_SETTINGS_CHATS_BACKUP:110,DEEP_LINK_COUPONS_PROMOTION_IMPRESSION:111,DEEP_LINK_INVITE_A_FRIEND:112,DEEP_LINK_UPDATES:113,DEEP_LINK_CONTACTS_PERMISSION:114,DEEP_LINK_NOTIFICATIONS_PERMISSION:115,DEEP_LINK_WABAI_ONBOARDING:116,DEEP_LINK_CHAT_LIST:117,DEEP_LINK_BRAZIL_MERCHANT_PIX_ADD:118,DEEP_LINK_PAYMENT_UPI_EXPLORE_BUSINESSES:119,DEEP_LINK_PAYMENT_UPI_ACCOUNT_RECOVERY:120,DEEP_LINK_PAYMENT_UPI_ADD_BANK_ACCOUNT:121,DEEP_LINK_PAYMENT_UPI_START_CAMERA:122,DEEP_LINK_PAYMENT_UPI_RESUME_ONBOARDING:123,DEEP_LINK_PAYMENT_UPI_ADD_NUMBER:124,DEEP_LINK_PAYMENT_UPI_SEND_PAYMENT:125,DEEP_LINK_PAYMENT_UPI_SET_PIN:126,DEEP_LINK_PAYMENT_UPI_SET_2FA:127,DEEP_LINK_SETTINGS_ACCOUNT_PASSKEYS:128,DEEP_LINK_DOWNLOAD_SOURCE_SFW:129,DEEP_LINK_AVATAR_EDITOR:130,DEEP_LINK_BIZTOOLS_ACCOUNTS_LINK_FB:131,DEEP_LINK_PAYMENT_UPI_PAYMENT_HISTORY:132,DEEP_LINK_PAYMENT_UPI_HELP_CENTER:133,DEEP_LINK_PAYMENT_UPI_ACCOUNT_DETAILS:134,DEEP_LINK_PAYMENT_UPI_INVITE_OTHERS:135,DEEP_LINK_PAYMENT_UPI_SEND_FIRST_PAYMENT:136,DEEP_LINK_CLICK_TO_CALL:137,DEEP_LINK_INTER_APP_IDENTITY_SWITCH:138,DEEP_LINK_LISTS:139,DEEP_LINK_META_AI_IMAGINE_ME_ONBOARDING:140,DEEP_LINK_MEDIA_SEND_LIVE_ACTIVITY_OPEN_APP:141,DEEP_LINK_WAMO:142,DEEP_LINK_PAYMENT_UPI_QR_PROMINENCE:143,DEEP_LINK_SURVEY:144,DEEP_LINK_SETTINGS_ACCOUNT_SECURITY_CHECKUP:145,DEEP_LINK_THUNDERSTORM:146,DEEP_LINK_HELP_BOTTOMSHEET:147,DEEP_LINK_FAVORITE_CHAT_FILTER:148,DEEP_LINK_CATALOG_CATEGORY:149,DEEP_LINK_CATALOG_COLLECTION:150,DEEP_LINK_MAIBA_WEB_COEX_ONBOARDING:151,DEEP_LINK_SMB_ADD_PRODUCT:152,DEEP_LINK_CALL_PHONE_NUMBER:153,DEEP_LINK_ABPROP_OVERRIDE:154,DEEP_LINK_PROFILE:155,DEEP_LINK_SETTINGS_CHAT_THEMES:156,DEEP_LINK_AIMEDIAINPUT:157,DEEP_LINK_AIVOICE:158,DEEP_LINK_NEW_CUSTOM_LIST:159,DEEP_LINK_SHARED_DEVICE_PRIVACY:160,DEEP_LINK_IPAD_LAUNCH_APPEVENT:161,DEEP_LINK_CATALOG_SETTINGS:162,DEEP_LINK_BOOST_CATALOG:163,DEEP_LINK_PRIVACY_STATUS:164,DEEP_LINK_INTEROP_SETTINGS:165,DEEP_LINK_SMB_AD_RESOLVE_PAYMENT:166,DEEP_LINK_CONSENT_LAUNCHER:167,DEEP_LINK_SETTINGS_HOME_SCREEN_NOTIFICATIONS:168,DEEP_LINK_WA_LINK_ACCOUNTS:169,DEEP_LINK_PAYMENT_PIX_DEEP_INTEGRATION:170,DEEP_LINK_ACCOUNT_TRANSFER:171,DEEP_LINK_SG_CONNECT_BOTTOMSHEET:172,DEEP_LINK_BIZ_AI_LEARNING_SUMMARY:173,DEEP_LINK_BIZ_AI_HUB:174,DEEP_LINK_BIZ_MANAGE_DATA_SHARING:175,DEEPLINK_SETTINGS_EDIT_PROFILE_PHOTO:176,DEEPLINK_ADD_STATUS_GALLERY:177,DEEP_LINK_TURN_OFF_DO_NOT_DISTURB:178,DEEP_LINK_SHARE_WHATSAPP_WEB:179,DEEP_LINK_ACCOUNTS_CENTER_ADD_ACCOUNT:180,DEEP_LINK_COEXISTENCE_REONBOARDING:181});f.DEEP_LINK_TYPE=a}),66); __d("WAWebApiParse",["PaymentLink","WAArrayBufferUtils","WABase64","WABinary","WALogger","WAWebABProps","WAWebApi","WAWebApiParseUtils","WAWebBroadcastApiParse","WAWebExternalCtxConfig","WAWebFaqUrl","WAWebNewsletterApiParse","WAWebPonyfillsUrlSearchParams","WAWebStatusApiParse","WAWebWamEnumDeepLinkType","justknobx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWADeeplinkToken: failed to parse token"]);h=function(){return a};return a}var i=new RegExp("^"+(b=d("WAWebApiParseUtils")).ORIGIN+b.OPTIONAL_PATH_PART+"/accept/?\\?code=(\\w+)(?:&.*)?$","i"),j=/^https?:\/\/chat\.whatsapp\.com\/invite\/(\w+)(?:\?.*)?$/i,k=/^https?:\/\/chat\.whatsapp\.com\/(\w+)(?:\?.*)?$/i,l=/^whatsapp:\/\/chat\/?\?code=(\w+)(?:&.*)?$/i,m=function(a){var b=a.match(i);if(b)return{code:b[2],url:b[1]||"/"};b=a.match(j);if(b)return{code:b[1]};b=a.match(k);if(b)return{code:b[1]};b=a.match(l);if(b)return{code:b[1]}},n="utm_source",o="utm_campaign",p=["utm_source","utm_campaign","text","phone","data","source","context","icebreaker","source_url","type","token"];function q(a){return p.find(function(b){return b===a})}var r=32;function s(a){if(!a||typeof a!=="string")return;a=d("WABinary").Binary.build(a);if(a.size()>d("WAWebABProps").getABPropConfigValue("ctwa_data_max_length"))return;return a.readBuffer()}function t(a,b){a=s(a);if(!a)return;b.conversionTuple==null?b.conversionTuple={conversionData:a}:b.conversionTuple.conversionData=a}function u(a,b){a=a;var c=d("WABinary").numUtf8Bytes(a);if(c>r)return;b.conversionTuple==null?b.conversionTuple={conversionSource:a}:b.conversionTuple.conversionSource=a}function v(a,b,c){switch(a){case"source_url":c.ctwaContextLinkData!=null?c.ctwaContextLinkData.sourceUrl=b:c.ctwaContextLinkData={sourceUrl:b};return;case"context":c.ctwaContextLinkData!=null?c.ctwaContextLinkData.context=b:c.ctwaContextLinkData={context:b};return;case"icebreaker":c.ctwaContextLinkData!=null?c.ctwaContextLinkData.icebreaker=b:c.ctwaContextLinkData={icebreaker:b};return}}function w(a){if(a!=null&&a.split(".").length===3){var b=a.split(".")[1].replace(/\s/g,"");try{b=d("WABase64").decodeB64UrlSafe(b);return JSON.parse(d("WAArrayBufferUtils").arrayBufferToString(b))}catch(b){d("WALogger").LOG(h()).devConsole(a);return{}}}return{}}function x(a){var b={};Object.keys(a).forEach(function(c){var d=a[c];if(d==null)return;switch(c){case"data":t(d,b);break;case"source":u(d,b);break;case"source_url":case"context":case"icebreaker":v(c,d,b);break;default:(c==="phone"||c==="text"||c==="type")&&(b[c]=d)}});return b}function y(a,b){var d={};new(c("WAWebPonyfillsUrlSearchParams"))(a).forEach(function(a,b){b=q(b.toLowerCase());if(b==null)return;switch(b){case"data":t(a,d);break;case"source":u(a,d);break;case"source_url":case"context":case"icebreaker":v(b,a,d);break;case"utm_campaign":d.utm!=null?d.utm.campaign=a:d.utm={campaign:a};break;case"utm_source":d.utm!=null?d.utm.source=a:d.utm={source:a};break;case"token":if(c("justknobx")._("4413")){var e=w(a);e=x(e);Object.assign(d,e)}break;default:b,d[b]=a}});d.phone!=null&&d.phone!==""&&(d.phone=d.phone.replace(/\D/g,"")+"@c.us",d.ctwaContextLinkData&&(d.ctwaContextLinkData.phone=d.phone));if(d.ctwaContextLinkData==null){a=U(b);a!=null&&(d.partnertoken=a)}if(d.phone!=null&&d.phone!==""||d.text!=null&&d.text!=="")return d}var z=new RegExp("^"+b.ORIGIN+b.OPTIONAL_PATH_PART+"/send/?\\?(.+)$","i"),A=/^https?:\/\/api\.whatsapp\.com\/send\/?\?(.+)$/i,B=/^whatsapp:\/\/send\/?\?(.*)$/i,C=/^https?:\/\/wa\.me\/?(?:([0-9.]{0,20}))?\/?\??(.+)?$/i,D=/^https?:\/\/wa\.me\/?(?:([0-9a-z.]{5,35}))?\/?\??(.+)?$/i;e=/^https?:\/\/wa\.me\/p\/([0-9]{0,20})\/([0-9]{0,20})$/i;f=/^whatsapp:\/\/product\/([0-9]{0,20})\/([0-9]{0,20})$/i;var E=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/product/([0-9]{0,20})/([0-9]{0,20})$","i"),F=/^https?:\/\/wa\.me\/p\/([0-9]{0,20})\/([0-9]{0,20})(\/?\?.*)$/i,G=/^whatsapp:\/\/product\/([0-9]{0,20})\/([0-9]{0,20})(\/?\?.*)$/i,H=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/product/([0-9]{0,20})/([0-9]{0,20})(/?.*)$","i"),I=/^https?:\/\/wa\.me\/p\/([^\/]{0,200})\/([0-9]{0,20})$/i,J=/^whatsapp:\/\/product\/([^\/]{0,200})\/([0-9]{0,20})$/i,K=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/product/([^/]{0,200})/([0-9]{0,20})$","i"),aa=/^https?:\/\/wa\.me\/p\/([^\/]{0,200})\/([0-9]{0,20})(\/?\?.*)$/i,ba=/^whatsapp:\/\/product\/([^\/]{0,200})\/([0-9]{0,20})(\/?\?.*)$/i,ca=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/product/([^/]{0,200})/([0-9]{0,20})(/?.*)$","i"),da=/^https?:\/\/wa\.me\/biz-add-product\/?(.+)$/i,ea=/^whatsapp-smb:\/\/advertise\/?(.+)$/i,fa=/^whatsapp-smb:\/\/manage-ads\/?(?:\?.*)?$/,ga=/^whatsapp-smb:\/\/meta_verified\/?(?:\?.*)?$/i,ha=/^https?:\/\/wa\.me\/biz-catalog-settings\/?(.+)$/i,ia=/^https?:\/\/wa\.me\/biz-catalog-boost\/?(.+)$/i,ja=/^whatsapp:\/\/message_yourself\/?(?:\?.*)?$/i,ka=/^https?:\/\/wa\.me\/message_yourself\/?(?:\?.*)?$/i,la=new RegExp("^"+b.ORIGIN+b.OPTIONAL_PATH_PART+"/calluser/?\\?(.+)$","i"),ma=/^https?:\/\/wa\.me\/call\?\\?(.+)$/i,L=[e,f,I,J],M=[E,K],N=[H,ca],O=[F,G,aa,ba],na=[].concat(L,M,N,O);function P(a,b){for(var c=0;c<b.length;c++){var d=a.match(b[c]);if(d)return d}}e=function(a){return P(a,na)!=null};var oa=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/push/","i"),Q=/^https?:\/\/wa\.me\/c\/([0-9]{0,20})(?:\?.*)?$/i,R=/^whatsapp:\/\/catalog\/([0-9]{0,20})(?:\?.*)?$/i,S=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/catalog/([0-9]{0,20})?$","i"),T=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/catalog/([0-9]{0,20})(/?.*)?$","i");f=function(a){return[Q,R,S,T].some(function(b){return a.match(b)})};var pa=/^https?:\/\/wa\.me\/favorites\/?(?:\\?.*)?$/i,qa=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/favorites/?(?:\\?.*)?$","i");function ra(a){var b=a.match(z);if(b){var c=y(b[2],a);if(c){c.url=b[1]||"/";return c}}b=a.match(A);if(b)return y(b[1],a);b=a.match(B);if(b)return y(b[1],a);b=a.match(C);c=a.match(D);if(b){var d;b[1]?d={phone:b[1]+"@c.us"}:c&&c[1]&&!c[2]&&(d={url:a,customURL:c[1]});if(b[2]){c=y(b[2],a);c&&(d=babelHelpers["extends"]({},d,c))}if(d){b=U(a);b!=null&&(d.partnertoken=b)}return d}}function U(a){var b=d("WAWebExternalCtxConfig").getExternalCtxUrlParamNames();a=new URL(a);for(b of b){var c=a.searchParams.get(b);if(c!=null)return c}return null}var sa=/^https?:\/\/wa\.me\/community\/create\/?(\?(.*))?$/i;function ta(a){a=a.match(sa);if(a){a=new(c("WAWebPonyfillsUrlSearchParams"))(a[1]).get("entrypoint");return{url:"/",entrypointType:a}}}function V(a,b){a={catalogOwnerJid:a[1]+"@s.whatsapp.net"};b=U(b);b!=null&&(a.partnertoken=b);return a}function W(a){a=new(c("WAWebPonyfillsUrlSearchParams"))(a);var b=a.get(n);a=a.get(o);if(a==null&&b==null)return null;var d={};b!=null&&(d.source=b);a!=null&&(d.campaign=a);return d}function ua(a){var b=a.match(Q)||a.match(R);if(b)return V(b,a);b=a.match(S);if(b)return babelHelpers["extends"]({},V(b,a),{url:"/"});b=a.match(T);if(b){var c=W(b[2]);return babelHelpers["extends"]({},V(b,a),c!=null&&{utm:c},{url:"/"})}}function X(a,b){a={productId:a[1],businessOwnerJid:a[2]+"@s.whatsapp.net"};b=U(b);b!=null&&(a.partnertoken=b);return a}function va(a){var b=P(a,L);if(b)return X(b,a);b=P(a,M);if(b)return babelHelpers["extends"]({},X(b,a),{url:"/"});b=P(a,N);if(b){var c=W(b[3]);return babelHelpers["extends"]({},X(b,a),c!=null&&{utm:c},{url:"/"})}b=P(a,O);if(b){c=W(b[3]);return babelHelpers["extends"]({},X(b,a),c!=null&&{utm:c})}}function wa(a){a=a.match(oa);if(a)return{url:"/"}}function Y(a){a=new(c("WAWebPonyfillsUrlSearchParams"))(a);var b=a.get("wa_campaign_id");if(b==null||b==="")return;a=a.get("wa_campaign_type");return a==null||a===""?null:{campaignId:b,campaignType:a}}function xa(a){a=a.match(ea);if(a)return Y(a[1])}function ya(a){a=a.match(da);if(a)return Y(a[1])}function za(a){var b=a.match(ha);if(b){b=Y(b[1]);if((b==null?void 0:b.campaignType)==="chat_psa")return{url:d("WAWebFaqUrl").getWhatsappUsePhoneFallbackUrl(),deepLinkType:d("WAWebWamEnumDeepLinkType").DEEP_LINK_TYPE.DEEP_LINK_CATALOG_SETTINGS}}b=a.match(ia);if(b){a=Y(b[1]);if((a==null?void 0:a.campaignType)==="chat_psa")return{url:d("WAWebFaqUrl").getWhatsappUsePhoneFallbackUrl(),deepLinkType:d("WAWebWamEnumDeepLinkType").DEEP_LINK_TYPE.DEEP_LINK_BOOST_CATALOG}}}function Aa(a){return d("PaymentLink").getPaymentLinkUrlMetaData(a)}var Ba=/^https?:\/\/wa\.me\/stickerpack\/meta-avatar$/i,Ca=/^https?:\/\/wa\.me\/edit-profile-picture$/i,Z=/^https?:\/\/wa\.me\/stickerpack\/(?!meta-avatar)/i;function $(a){a=a.match(Z);return a!=null}function Da(a){a=a.match(Ba);if(a)return{url:d("WAWebFaqUrl").getAvatarFaqUrl()}}var Ea=/^https?:\/\/wa\.me\/ais\/(\d{14,20})\/?(\?.*)?$/i,Fa=new RegExp("^"+b.ORIGIN+b.OPTIONAL_NON_CAPTURING_PATH_PART+"/ais/(\\d{14,20})/?(\\?.*)?$","i");function Ga(a){var b;a=((b=(b=a.match(Ea))!=null?b:a.match(Fa))!=null?b:[])[1];return a?{resultType:d("WAWebApi").APICmd.UGC_BOT,data:{fbid:a}}:null}function Ha(a){if($(a)){a=new URL(a);a=a.pathname.split("/");a[0];a[1];a=a[2];return a}}function Ia(a){var b=a.match(Z);if(b){b=Ha(a);return{resultType:"STICKER_PACK",data:{url:b}}}}function a(a){if(typeof a!=="string")return{resultType:d("WAWebApi").APICmd.INVALID};var b=m(a);if(b)return{resultType:d("WAWebApi").APICmd.GROUP_INVITE,data:b};b=ua(a);if(b)return{resultType:d("WAWebApi").APICmd.CATALOG,data:b};b=va(a);if(b)return{resultType:d("WAWebApi").APICmd.PRODUCT,data:b};b=ta(a);if(b)return{resultType:d("WAWebApi").APICmd.CREATE_COMMUNITY,data:b};b=Da(a);if(b)return{resultType:d("WAWebApi").APICmd.AVATAR_STICKERPACK,data:b};b=d("WAWebStatusApiParse").parseStatusPostFeatureLink(a);if(b)return{resultType:d("WAWebApi").APICmd.STATUS_POST,data:b};b=d("WAWebBroadcastApiParse").parseBroadcastFeatureLink(a);if(b)return{resultType:d("WAWebApi").APICmd.BROADCAST,data:b};b=d("WAWebNewsletterApiParse").parseNewsletter(a);if(b)return{resultType:d("WAWebApi").APICmd.NEWSLETTER,data:b};if([ja,ka].some(function(b){return a.match(b)}))return{resultType:d("WAWebApi").APICmd.MESSAGE_YOURSELF};if([pa,qa].some(function(b){return a.match(b)}))return{resultType:d("WAWebApi").APICmd.FAVORITES,data:{url:"/"}};b=ya(a);if(b!=null)return{resultType:d("WAWebApi").APICmd.OPEN_CATALOG,data:b};b=za(a);if(b!=null)return{resultType:d("WAWebApi").APICmd.CATALOG_LINKING_CHAT_PSA,data:b};b=Ia(a);if(b){return{resultType:d("WAWebApi").APICmd.STICKER_PACK,data:{url:(b=b.data.url)!=null?b:""}}}b=ra(a);if(b)return{resultType:d("WAWebApi").APICmd.MSG_SEND,data:b};b=wa(a);if(b)return{resultType:d("WAWebApi").APICmd.PUSH_NOTIFICATION,data:b};b=xa(a);if(b!=null)return{resultType:d("WAWebApi").APICmd.ADVERTISE,data:b};if(a.match(fa))return{resultType:d("WAWebApi").APICmd.MANAGE_ADS,trigger:"chatListBanner"};if(a.match(ga))return{resultType:d("WAWebApi").APICmd.META_VERIFIED};if(a.match(Ca))return{resultType:d("WAWebApi").APICmd.EDIT_PROFILE_PICTURE};if(d("WAWebABProps").getABPropConfigValue("wa_web_calling_deep_link_error")&&[la,ma].some(function(b){return a.match(b)}))return{resultType:d("WAWebApi").APICmd.CALL_USER,data:{url:"/"}};b=Aa(a);if(b!=null)return{resultType:d("WAWebApi").APICmd.PAYMENT_LINK,data:b};b=Ga(a);return b?b:{resultType:d("WAWebApi").APICmd.INVALID}}g.parseConversionData=s;g.parseCTWADeeplinkToken=w;g.matchProductUrl=e;g.matchCatalogUrl=f;g.isStickerPackURL=$;g.parseAPICmd=a}),98); __d("WAWebMessagingGatingUtils",["WAWebABProps","WAWebDBReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("web_send_invisible_msg_to_new_groups")}function b(){return d("WAWebABProps").getABPropConfigValue("web_send_invisible_msg_min_group_size")}function c(){return d("WAWebABProps").getABPropConfigValue("web_send_invisible_msg_max_group_size")}function e(){var a;return(a=d("WAWebABProps").getABPropConfigValue("group_size_bypassing_sampling"))!=null?a:1e5}function f(){return d("WAWebABProps").getABPropConfigValue("web_device_sync_manager_group_enabled")}function h(){return m()>0}function i(){return d("WAWebABProps").getABPropConfigValue("rt_receive_reporting_tag")}function j(){return d("WAWebABProps").getABPropConfigValue("rt_sync_reporting_tag")}function k(){var a;return(a=d("WAWebABProps").getABPropConfigValue("rt_clean_reporting_tag"))!=null?a:d("WAWebDBReportingTokenUtils").DEFAULT_RT_CLEANUP_OLDER_THAN_DAYS}function l(){return d("WAWebABProps").getABPropConfigValue("rt_clean_reporting_token")}function m(){return d("WAWebABProps").getABPropConfigValue("rt_sender_reporting_token_version")}function n(){return d("WAWebABProps").getABPropConfigValue("rt_sender_dual_encrypted_msg_enabled")}function o(){return d("WAWebABProps").getABPropConfigValue("rt_receiver_dual_encrypted_msg_enabled")}function p(){return d("WAWebABProps").getABPropConfigValue("rt_edit_receive")}function q(){return d("WAWebABProps").getABPropConfigValue("rt_web_delay_processing")}function r(){return d("WAWebABProps").getABPropConfigValue("rt_report_token_from_inclusion_list")}function s(){return d("WAWebABProps").getABPropConfigValue("ft_validation_failure_drop_placeholder")}function t(){return d("WAWebABProps").getABPropConfigValue("visible_message_drop_placeholder_enabled_internal_only")}g.sendKeyDistributionMsgToNewGroups=a;g.sendKeyDistributionMsgMinGroupSize=b;g.sendKeyDistributionMsgMaxGroupSize=c;g.getGroupSizeBypassingSampling=e;g.isDeviceSyncManagerGroupEnabled=f;g.isReportingTokenSendingEnabled=h;g.isReportingTokenReceivingEnabled=i;g.isReportingTagSyncingEnabled=j;g.getReportingTagCleanupDays=k;g.getReportingTokenCleanupDays=l;g.getSenderReportingTokenVersion=m;g.isDualEncryptedReportingTokenSendingEnabled=n;g.isDualEncryptedReportingTokenReceiveEnabled=o;g.isReportingTokenEditReceiveEnabled=p;g.isWebReportingTokenDelayProcessingEnabled=q;g.isReportingTokenFromInclusionListEnabled=r;g.isReportingTokenValidationFailureDebugPlaceholderEnabled=s;g.isMessageDropPlaceholderEnabled=t}),98); __d("WAWebSyncGatingUtils",["WALogger","WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeaturesModel","WAWebUserPrefsHistorySync"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] History sync on demand feature is disabled as initial sync is incomplete or initial sync boundary is not available"]);h=function(){return a};return a}function a(){if(!d("WAWebPrimaryFeaturesModel").PrimaryFeatures.historySyncOnDemand)return!1;var a=d("WAWebUserPrefsHistorySync").getInitialHistorySyncCompleteLocalStorage(),b=d("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary();if(a&&(b==null||Object.keys(b).length===0)){d("WALogger").LOG(h());return!1}a=d("WAWebMobilePlatforms").getMobilePlatform()===d("WAWebMobilePlatforms").PLATFORMS.ANDROID||d("WAWebMobilePlatforms").getMobilePlatform()===d("WAWebMobilePlatforms").PLATFORMS.SMBA;return a&&d("WAWebPrimaryFeaturesModel").PrimaryFeatures.isPrimaryBetaBuild&&d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_with_android_beta")?!0:d("WAWebABProps").getABPropConfigValue("history_sync_on_demand")}function b(){return d("WAWebPrimaryFeaturesModel").PrimaryFeatures.historySyncOnDemand}function c(){return d("WAWebABProps").getABPropConfigValue("placeholder_message_resend")}function e(){return d("WAWebPrimaryFeaturesModel").PrimaryFeatures.webLinkPreviewNseSupport}function f(){return d("WAWebPrimaryFeaturesModel").PrimaryFeatures.messagePlaceholderResendNseSupport}function i(){return d("WAWebABProps").getABPropConfigValue("web_noncritical_history_sync_message_processing_break_iteration")}function j(){return d("WAWebABProps").getABPropConfigValue("web_recent_sync_handling_loop_restart_v2_enabled")}function k(){return d("WAWebABProps").getABPropConfigValue("web_recent_sync_chunk_download_optimization")}function l(){return d("WAWebABProps").getABPropConfigValue("web_recent_sync_worker_compatible_handling")}function m(){return d("WAWebABProps").getABPropConfigValue("web_recent_sync_next_chunk_fetch_optimization")}function n(){return d("WAWebABProps").getABPropConfigValue("web_recent_sync_chunk_data_handling_worker")}g.isHistorySyncOnDemandEnabled=a;g.shouldPopulateStarMessageWithTimestamp=b;g.isPlaceholderMessageResendEnabled=c;g.isWebLinkPreviewNseSupportEnabled=e;g.isMessagePlaceholderResendNseSupportEnabled=f;g.getRecentSyncMessageProcessingBreakIteration=i;g.isHistorySyncHandlingRestartV2Enabled=j;g.isRecentSyncDownloadOptimizationEnabled=k;g.isRecentSyncWorkerComaptibleHandlingEnabled=l;g.isRecentSyncNextChunkFetchOptimizationEnabled=m;g.isRecentSyncChunkDataHandlingInWorkerEnabled=n}),98); __d("WAWebL10NConstants",[],(function(a,b,c,d,e,f){a={DEBUG:99,SAVED:6,PHONE:5,PREVIOUS:4,URL:3,BROWSER:2,DEFAULT:1};b="en";c="en-US";d=new Set(["ur"]);e=new Set(["af","az","ca","cs","da","de","el","et","fi","fr","he","hr","hu","id","it","kk","lt","mk","nb","pl","pt","pt-BR","ro","ru","sk","sl","sr","sv","th","tr","uk"]);var g={"zh-tw":{longDateFormat:{LT:"Ah:mm",LTS:"Ah:m:s",L:"YYYY\u5e74MMMD\u65e5",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5LT",LLLL:"YYYY\u5e74MMMD\u65e5ddddLT",l:"YYYY\u5e74MMMD\u65e5",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5LT",llll:"YYYY\u5e74MMMD\u65e5ddddLT"}},"zh-cn":{longDateFormat:{LT:"Ah:mm",LTS:"Ah:m:s",L:"YYYY-MM-DD",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5LT",LLLL:"YYYY\u5e74MMMD\u65e5ddddLT",l:"YYYY\u5e74MMMD\u65e5",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5LT",llll:"YYYY\u5e74MMMD\u65e5ddddLT"}},ar:{longDateFormat:{LT:"h:mm A",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"}},ta:{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY, h:mm A"},preparse:null,postformat:null,meridiem:null,meridiemHour:null},nl:{longDateFormat:{l:"DD-MM-YYYY",L:"DD-MM-YYYY"}},"en-ie":{longDateFormat:{l:"DD/MM/YYYY",L:"DD/MM/YYYY"}},hi:{preparse:function(a){return a},postformat:function(a){return a},longDateFormat:{LT:"A h:mm \u092c\u091c\u0947",LTS:"A h:mm:ss \u092c\u091c\u0947",LLL:"D MMMM YYYY A h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A h:mm \u092c\u091c\u0947"},meridiem:function(a,b,c){if(a===0&&b===0)return"\u092e\u0927\u094d\u092f\u0930\u093e\u0924\u094d\u0930\u093f";if(a>=20||a<4)return"\u0930\u093e\u0924";if(a>=4&&a<12)return"\u0938\u0941\u092c\u0939";return a>=12&&a<16?"\u0926\u094b\u092a\u0939\u0930":"\u0936\u093e\u092e"}}},h={"pt-pt":{weekdays:["Domingo","Segunda-feira","Ter\xe7a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S\xe1bado"]}};h=babelHelpers["extends"]({},g,h);var i=!1;i=i;f.L10N_PRIORITY=a;f.DEFAULT_LOCALE=b;f.DEFAULT_MOMENT_LOCALE=c;f.SHOULD_USE_MOMENT_LOCALE_FORMAT=d;f.LOCALES_THAT_PREFER_24HOUR_TIME=e;f.LOCALE_DATE_TIME_CUSTOMIZATIONS=g;f.LOCALE_CUSTOMIZATIONS=h;f.MARK_TRANSLATIONS_ENABLED=i}),66); __d("WAWebL10NNumbersPluginRegistry",[],(function(a,b,c,d,e,f){var g=Math.pow(10,3),h=Math.pow(10,6);function i(a,b,c,d){d===void 0&&(d=1);var e=".";a=a/Math.pow(10,b);b=a.toString(10).split(".");a=b[0];b=b[1];return b==null||b.startsWith("0".repeat(d))||Number.parseInt(a,10)>=100?parseInt(a,10).toLocaleString(c):parseFloat(""+a+e+b.slice(0,d)).toLocaleString(c)}function j(a,b){return Intl.NumberFormat(b,{notation:"compact"}).format(a)}b={locales:["fr","fr-BE","fr-CA","fr-CH","fr-FR"],format:function(a,b){a=j(a,b);return a.toLocaleUpperCase(b)}};c={locales:["he","he-IL"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<h?i(a,3,b)+" \u05d0\u05dc\u05e3":i(a,6,b)+" \u05de\u05d9\u05dc\u05d9\u05d5\u05df"}};d={locales:["ro","ro-RO"],format:function(a,b){if(a<g)return a.toLocaleString(b);if(a===g)return"1 mie";return a<h?i(a,3,b)+" mii":i(a,6,b)+" mil."}};e={locales:["zh-SG","zh-CN"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<Math.pow(10,4)?i(a,3,b)+"\u5343":j(a,b)}};var k={locales:["ja"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<Math.pow(10,4)?i(a,3,b)+"\u5343":j(a,b)}},l={locales:["de","de-AT","de-CH","de-DE","de-LI","de-LU"],format:function(a,b){return a>g&&a<h?i(a,3,b)+" Tsd.":j(a,b)}},m={locales:["it","it-CH","it-IT"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<h?i(a,3,b)+" mila":i(a,6,b)+" mln"}},n={locales:["pt","pt-BR","pt-PT"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<h?j(a,b):i(a,6,b)+" M"}},o={locales:["zh-TW","zh-MO","zh-HK"],format:function(a,b){if(a<g)return a.toLocaleString(b);return a<Math.pow(10,4)?i(a,3,b)+"\u5343":j(a,"zh-TW")}},p=[l,b,m,c,k,n,d,o,e];l=a();function a(){var a=new Map(),b=function(b){b.locales.forEach(function(c){return a.set(c,b)})};for(var c of p)b(c);return a}f.M=h;f.l10nNumberFormattersRegister=l}),66); __d("WAWebL10NPlurals",[],(function(a,b,c,d,e,f){a={ach:{name:"Acholi",numbers:[1,2],plurals:function(a){return Number(a>1)}},af:{name:"Afrikaans",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ak:{name:"Akan",numbers:[1,2],plurals:function(a){return Number(a>1)}},am:{name:"Amharic",numbers:[1,2],plurals:function(a){return Number(a>1)}},an:{name:"Aragonese",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ar:{name:"Arabic",numbers:[0,1,2,3,11,100],plurals:function(a){return Number(a===0?0:a==1?1:a==2?2:a%100>=3&&a%100<=10?3:a%100>=11?4:5)}},arn:{name:"Mapudungun",numbers:[1,2],plurals:function(a){return Number(a>1)}},ast:{name:"Asturian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ay:{name:"Aymar\xe1",numbers:[1],plurals:function(a){return 0}},az:{name:"Azerbaijani",numbers:[1,2],plurals:function(a){return Number(a!=1)}},be:{name:"Belarusian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},bg:{name:"Bulgarian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},bn:{name:"Bengali",numbers:[1,2],plurals:function(a){return Number(a!=1)}},bo:{name:"Tibetan",numbers:[1],plurals:function(a){return 0}},br:{name:"Breton",numbers:[1,2],plurals:function(a){return Number(a>1)}},bs:{name:"Bosnian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},ca:{name:"Catalan",numbers:[1,2],plurals:function(a){return Number(a!=1)}},cgg:{name:"Chiga",numbers:[1],plurals:function(a){return 0}},cs:{name:"Czech",numbers:[1,2,5],plurals:function(a){return Number(a==1?0:a>=2&&a<=4?1:2)}},csb:{name:"Kashubian",numbers:[1,2,5],plurals:function(a){return Number(a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},cy:{name:"Welsh",numbers:[1,2,3,8],plurals:function(a){return Number(a==1?0:a==2?1:a!=8&&a!=11?2:3)}},da:{name:"Danish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},de:{name:"German",numbers:[1,2],plurals:function(a){return Number(a!=1)}},dz:{name:"Dzongkha",numbers:[1],plurals:function(a){return 0}},el:{name:"Greek",numbers:[1,2],plurals:function(a){return Number(a!=1)}},en:{name:"English",numbers:[1,2],plurals:function(a){return Number(a!=1)}},eo:{name:"Esperanto",numbers:[1,2],plurals:function(a){return Number(a!=1)}},es:{name:"Spanish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},es_ar:{name:"Argentinean Spanish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},et:{name:"Estonian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},eu:{name:"Basque",numbers:[1,2],plurals:function(a){return Number(a!=1)}},fa:{name:"Persian",numbers:[1,2],plurals:function(a){return Number(a>1)}},fi:{name:"Finnish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},fil:{name:"Filipino",numbers:[1,2],plurals:function(a){return Number(a>1)}},fo:{name:"Faroese",numbers:[1,2],plurals:function(a){return Number(a!=1)}},fr:{name:"French",numbers:[1,2],plurals:function(a){return Number(a>1)}},fur:{name:"Friulian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},fy:{name:"Frisian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ga:{name:"Irish",numbers:[1,2,3,7,11],plurals:function(a){return Number(a==1?0:a==2?1:a<7?2:a<11?3:4)}},gd:{name:"Scottish Gaelic",numbers:[1,2,3,20],plurals:function(a){return Number(a==1||a==11?0:a==2||a==12?1:a>2&&a<20?2:3)}},gl:{name:"Galician",numbers:[1,2],plurals:function(a){return Number(a!=1)}},gu:{name:"Gujarati",numbers:[1,2],plurals:function(a){return Number(a!=1)}},gun:{name:"Gun",numbers:[1,2],plurals:function(a){return Number(a>1)}},ha:{name:"Hausa",numbers:[1,2],plurals:function(a){return Number(a!=1)}},he:{name:"Hebrew",numbers:[1,2,20,3],plurals:function(a){return Number(a===1?0:a===2?1:a>=20&&a%10===0?2:3)}},hi:{name:"Hindi",numbers:[1,2],plurals:function(a){return Number(a!=1)}},hr:{name:"Croatian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},hu:{name:"Hungarian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},hy:{name:"Armenian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ia:{name:"Interlingua",numbers:[1,2],plurals:function(a){return Number(a!=1)}},id:{name:"Indonesian",numbers:[1],plurals:function(a){return 0}},is:{name:"Icelandic",numbers:[1,2],plurals:function(a){return Number(a%10!=1||a%100==11)}},it:{name:"Italian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ja:{name:"Japanese",numbers:[1],plurals:function(a){return 0}},jbo:{name:"Lojban",numbers:[1],plurals:function(a){return 0}},jv:{name:"Javanese",numbers:[0,1],plurals:function(a){return Number(a!==0)}},ka:{name:"Georgian",numbers:[1],plurals:function(a){return 0}},kk:{name:"Kazakh",numbers:[1],plurals:function(a){return 0}},km:{name:"Khmer",numbers:[1],plurals:function(a){return 0}},kn:{name:"Kannada",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ko:{name:"Korean",numbers:[1],plurals:function(a){return 0}},ku:{name:"Kurdish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},kw:{name:"Cornish",numbers:[1,2,3,4],plurals:function(a){return Number(a==1?0:a==2?1:a==3?2:3)}},ky:{name:"Kyrgyz",numbers:[1],plurals:function(a){return 0}},lb:{name:"Letzeburgesch",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ln:{name:"Lingala",numbers:[1,2],plurals:function(a){return Number(a>1)}},lo:{name:"Lao",numbers:[1],plurals:function(a){return 0}},lt:{name:"Lithuanian",numbers:[1,2,10],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&(a%100<10||a%100>=20)?1:2)}},lv:{name:"Latvian",numbers:[0,1,2],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a!==0?1:2)}},mai:{name:"Maithili",numbers:[1,2],plurals:function(a){return Number(a!=1)}},mfe:{name:"Mauritian Creole",numbers:[1,2],plurals:function(a){return Number(a>1)}},mg:{name:"Malagasy",numbers:[1,2],plurals:function(a){return Number(a>1)}},mi:{name:"Maori",numbers:[1,2],plurals:function(a){return Number(a>1)}},mk:{name:"Macedonian",numbers:[1,2],plurals:function(a){return Number(a==1||a%10==1?0:1)}},ml:{name:"Malayalam",numbers:[1,2],plurals:function(a){return Number(a!=1)}},mn:{name:"Mongolian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},mnk:{name:"Mandinka",numbers:[0,1,2],plurals:function(a){return Number(a===0?0:a==1?1:2)}},mr:{name:"Marathi",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ms:{name:"Malay",numbers:[1],plurals:function(a){return 0}},mt:{name:"Maltese",numbers:[1,2,11,20],plurals:function(a){return Number(a==1?0:a===0||a%100>1&&a%100<11?1:a%100>10&&a%100<20?2:3)}},nah:{name:"Nahuatl",numbers:[1,2],plurals:function(a){return Number(a!=1)}},nap:{name:"Neapolitan",numbers:[1,2],plurals:function(a){return Number(a!=1)}},nb:{name:"Norwegian Bokmal",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ne:{name:"Nepali",numbers:[1,2],plurals:function(a){return Number(a!=1)}},nl:{name:"Dutch",numbers:[1,2],plurals:function(a){return Number(a!=1)}},nn:{name:"Norwegian Nynorsk",numbers:[1,2],plurals:function(a){return Number(a!=1)}},no:{name:"Norwegian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},nso:{name:"Northern Sotho",numbers:[1,2],plurals:function(a){return Number(a!=1)}},oc:{name:"Occitan",numbers:[1,2],plurals:function(a){return Number(a>1)}},or:{name:"Oriya",numbers:[2,1],plurals:function(a){return Number(a!=1)}},pa:{name:"Punjabi",numbers:[1,2],plurals:function(a){return Number(a!=1)}},pap:{name:"Papiamento",numbers:[1,2],plurals:function(a){return Number(a!=1)}},pl:{name:"Polish",numbers:[1,2,5],plurals:function(a){return Number(a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},pms:{name:"Piemontese",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ps:{name:"Pashto",numbers:[1,2],plurals:function(a){return Number(a!=1)}},pt:{name:"Portuguese",numbers:[1,2],plurals:function(a){return Number(a!=1)}},"pt-BR":{name:"Brazilian Portuguese",numbers:[1,2],plurals:function(a){return Number(a!=1)}},rm:{name:"Romansh",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ro:{name:"Romanian",numbers:[1,2,20],plurals:function(a){return Number(a==1?0:a===0||a%100>0&&a%100<20?1:2)}},ru:{name:"Russian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},sah:{name:"Yakut",numbers:[1],plurals:function(a){return 0}},sco:{name:"Scots",numbers:[1,2],plurals:function(a){return Number(a!=1)}},se:{name:"Northern Sami",numbers:[1,2],plurals:function(a){return Number(a!=1)}},si:{name:"Sinhala",numbers:[1,2],plurals:function(a){return Number(a!=1)}},sk:{name:"Slovak",numbers:[1,2,5],plurals:function(a){return Number(a==1?0:a>=2&&a<=4?1:2)}},sl:{name:"Slovenian",numbers:[5,1,2,3],plurals:function(a){return Number(a%100==1?1:a%100==2?2:a%100==3||a%100==4?3:0)}},so:{name:"Somali",numbers:[1,2],plurals:function(a){return Number(a!=1)}},son:{name:"Songhay",numbers:[1,2],plurals:function(a){return Number(a!=1)}},sq:{name:"Albanian",numbers:[1,2],plurals:function(a){return Number(a!=1)}},sr:{name:"Serbian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},su:{name:"Sundanese",numbers:[1],plurals:function(a){return 0}},sv:{name:"Swedish",numbers:[1,2],plurals:function(a){return Number(a!=1)}},sw:{name:"Swahili",numbers:[1,2],plurals:function(a){return Number(a!=1)}},ta:{name:"Tamil",numbers:[1,2],plurals:function(a){return Number(a!=1)}},te:{name:"Telugu",numbers:[1,2],plurals:function(a){return Number(a!=1)}},tg:{name:"Tajik",numbers:[1,2],plurals:function(a){return Number(a>1)}},th:{name:"Thai",numbers:[1],plurals:function(a){return 0}},ti:{name:"Tigrinya",numbers:[1,2],plurals:function(a){return Number(a>1)}},tk:{name:"Turkmen",numbers:[1,2],plurals:function(a){return Number(a!=1)}},tr:{name:"Turkish",numbers:[1,2],plurals:function(a){return Number(a>1)}},tt:{name:"Tatar",numbers:[1],plurals:function(a){return 0}},ug:{name:"Uyghur",numbers:[1],plurals:function(a){return 0}},uk:{name:"Ukrainian",numbers:[1,2,5],plurals:function(a){return Number(a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2)}},ur:{name:"Urdu",numbers:[1,2],plurals:function(a){return Number(a!=1)}},uz:{name:"Uzbek",numbers:[1,2],plurals:function(a){return Number(a>1)}},vi:{name:"Vietnamese",numbers:[1],plurals:function(a){return 0}},wa:{name:"Walloon",numbers:[1,2],plurals:function(a){return Number(a>1)}},wo:{name:"Wolof",numbers:[1],plurals:function(a){return 0}},yo:{name:"Yoruba",numbers:[1,2],plurals:function(a){return Number(a!=1)}},zh:{name:"Chinese",numbers:[1],plurals:function(a){return 0}}};f["default"]=a}),66); __d("WAWebLocaleToTranslation",[],(function(a,b,c,d,e,f){a={pt:"pt_br",pt_ao:"pt_pt",pt_ch:"pt_pt",pt_cv:"pt_pt",pt_fr:"pt_pt",pt_gq:"pt_pt",pt_gw:"pt_pt",pt_lu:"pt_pt",pt_mo:"pt_pt",pt_mz:"pt_pt",pt_pt:"pt_pt",pt_st:"pt_pt",pt_tl:"pt_pt"};b=babelHelpers["extends"]({},a,{zh_hans:"zh_cn",zh_hant:"zh_tw",zh_sg:"zh_cn",tl:"fil","in":"id",iw:"he",mo:"ro",jw:"jv",ji:"yi"});c=b;f["default"]=c}),66); __d("WAWebSupportedLocales",[],(function(a,b,c,d,e,f){a=Object.freeze({af:"af",ar:"ar",ar_xb:"ar-XB",az:"az",bg:"bg",bn:"bn",ca:"ca",cs:"cs",da:"da",de:"de",el:"el",en:"en",es:"es",et:"et",fa:"fa",fi:"fi",fil:"fil",fr:"fr",gu:"gu",he:"he",hi:"hi",hr:"hr",hu:"hu",id:"id",it:"it",ja:"ja",kk:"kk",kn:"kn",ko:"ko",lt:"lt",lv:"lv",mk:"mk",ml:"ml",mr:"mr",ms:"ms",nb:"nb",nl:"nl",pa:"pa",pl:"pl",pt:"pt",pt_br:"pt-BR",pt_pt:"pt-PT",ro:"ro",ru:"ru",sk:"sk",sl:"sl",sq:"sq",sr:"sr",sv:"sv",sw:"sw",ta:"ta",te:"te",th:"th",tr:"tr",uk:"uk",ur:"ur",uz:"uz",vi:"vi",zh_cn:"zh-CN",zh_hk:"zh-HK",zh_tw:"zh-TW"});b=a;f["default"]=b}),66); __d("WAWebBaseL10N",["Locale","WAWeb-moment","WAWebEventEmitter","WAWebL10NConstants","WAWebL10NHelpers","WAWebL10NNumbersPluginRegistry","WAWebL10NPlurals","WAWebLocaleToTranslation","WAWebSupportedLocales","err","filesize","latenize"],(function(a,b,c,d,e,f,g){var h=new Set(["fa"]),i="\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669".split(""),j=1024*1024*1024,k=Math.pow(10,6),l=Math.pow(10,3),m=Math.pow(10,4);function n(a){return i[parseInt(a,10)]}var o=c("err")("Unimplemented method");a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c,e){var f;f=a.call(this)||this;if(!b||!c)throw o;f._locale=b;f.localeStrings={};f.localeStrings[d("WAWebL10NConstants").DEFAULT_LOCALE]=c;f.fbtStrings={};f.fbtStrings[d("WAWebL10NConstants").DEFAULT_LOCALE]={en_GB:{}};f.markTranslations=e;f.customizeMoment();return f}var e=b.prototype;e.getLocale=function(){throw o};e.getNormalizedLocale=function(){throw o};e.getFullLocale=function(){throw o};e.getFbtTranslations=function(){throw o};e.setLocale=function(a,b,c){throw o};e.normalizeLocaleToWajsLocale=function(a){a=a.replace(/-/g,"_").toLowerCase();var b=this._getTranslationFilename(a);if(b)return b;b=a;while(b){b=b.split("_").slice(0,-1).join("_");a=b&&this._getTranslationFilename(b);if(a)return a}return void 0};e.isLocaleSupported=function(a){return!!a&&!!this.normalizeLocaleToWajsLocale(a)};e._getTranslationFilename=function(a){a=c("WAWebLocaleToTranslation")[a]||a;return c("WAWebSupportedLocales")[a]};e.isRTL=function(){return d("Locale").isRTL()};e.LR=function(a,b){return this.isRTL()?b:a};e.embedDir=function(a,b){b===void 0&&(b=this.isRTL());return b?this.embedRTL(a):this.embedLTR(a)};e.embedLTR=function(a){return"\u202a"+a+"\u202c"};e.embedRTL=function(a){return"\u202b"+a+"\u202c"};e.isolateLTR=function(a){return"\u2066"+a+"\u2069"};e.isolateRTL=function(a){return"\u2067"+a+"\u2069"};e.forceLTR=function(a){return"\u200e"+a};e.forceRTL=function(a){return"\u200f"+a};e._getString=function(a,b,e){var f=this.localeStrings[b]||this.localeStrings[d("WAWebL10NConstants").DEFAULT_LOCALE];if(f==null)throw c("err")("Couldn't find translations for locale "+b+" or default ("+d("WAWebL10NConstants").DEFAULT_LOCALE+")");if(!Array.isArray(f))throw c("err")("Unexpected locale format.");var g=f[0];f=f[1];g=g[a]||"";if(e==null)return g;b=c("WAWebL10NPlurals")[b];if(b==null)return g;e=b.numbers[b.plurals(e)];if(e===1)return g;b=b.numbers.length===2&&e===2?a.toString():a+"_"+e;return f[b]||g};e.useArabicScriptDigits=function(a){return h.has((a=a)!=null?a:this.getNormalizedLocale())};e.isLatinAlphabetLanguage=function(a){return c("latenize").isLatin(this.removeAccents(a))};e.d=function(a,b,c){var e=d("WAWebL10NNumbersPluginRegistry").l10nNumberFormattersRegister.get(this.getFullLocale());if(e!=null&&typeof a==="number")return e.format(a,this.getFullLocale());e=typeof a==="number"&&(a>=k||a>=l&&a<m)?1:0;return this.n(a,b,babelHelpers["extends"]({},c,{notation:"compact",roundingMode:"trunc",trailingZeroDisplay:"stripIfInteger",minimumFractionDigits:e,maximumFractionDigits:e}))};e.n=function(a,b,c){a=a;if(typeof a==="number")return Intl.NumberFormat(this.getFullLocale(),c).format(a);return this.useArabicScriptDigits(b)?a.toString().replace(/[0-9]/g,n):a};e.filesizeWithParams=function(a,b){var d=a>j?1:0,e=this.getFullLocale();return this.n(c("filesize")(a,{base:2,round:d,locale:e,symbols:b}))};e.normalizeForm=function(a){a===void 0&&(a="");return d("WAWebL10NHelpers").normalizeForm(a)};e.removeAccents=function(a){a===void 0&&(a="");return d("WAWebL10NHelpers").removeAccents(a)};e.accentFold=function(a){a===void 0&&(a="");return this.removeAccents(a).toLowerCase()};e.customizeMoment=function(){var a;(a=c("WAWeb-moment")).relativeTimeRounding(Math.floor);a.relativeTimeThreshold("s",60);a.relativeTimeThreshold("m",60);a.relativeTimeThreshold("h",24)};return b}(c("WAWebEventEmitter"));g.WAWebBaseL10n=a}),98); __d("FBLocaleIDEnum",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({EN_US:"en_US",AF_ZA:"af_ZA",AK_GH:"ak_GH",AM_ET:"am_ET",AR_AR:"ar_AR",AS_IN:"as_IN",AY_BO:"ay_BO",AZ_AZ:"az_AZ",BE_BY:"be_BY",BG_BG:"bg_BG",BM_ML:"bm_ML",BN_IN:"bn_IN",BP_IN:"bp_IN",BR_FR:"br_FR",BS_BA:"bs_BA",BV_DE:"bv_DE",CA_ES:"ca_ES",CB_IQ:"cb_IQ",CK_US:"ck_US",CO_FR:"co_FR",CS_CZ:"cs_CZ",CX_PH:"cx_PH",CY_GB:"cy_GB",DA_DK:"da_DK",DE_DE:"de_DE",EH_IN:"eh_IN",EL_GR:"el_GR",EM_ZM:"em_ZM",EN_GB:"en_GB",EN_IN:"en_IN",EN_OP:"en_OP",EN_PI:"en_PI",EN_UD:"en_UD",EN_XA:"en_XA",EO_EO:"eo_EO",ES_CL:"es_CL",ES_CO:"es_CO",ES_ES:"es_ES",ES_LA:"es_LA",ES_MX:"es_MX",ES_VE:"es_VE",ET_EE:"et_EE",EU_ES:"eu_ES",FA_IR:"fa_IR",FB_AA:"fb_AA",FB_AC:"fb_AC",FB_AR:"fb_AR",FB_HA:"fb_HA",FB_HX:"fb_HX",FB_LL:"fb_LL",FB_LS:"fb_LS",FB_LT:"fb_LT",FB_RL:"fb_RL",FB_ZH:"fb_ZH",FBT_AC:"fbt_AC",FF_NG:"ff_NG",FI_FI:"fi_FI",FN_IT:"fn_IT",FO_FO:"fo_FO",FR_CA:"fr_CA",FR_FR:"fr_FR",FV_NG:"fv_NG",FY_NL:"fy_NL",GA_IE:"ga_IE",GL_ES:"gl_ES",GN_PY:"gn_PY",GU_IN:"gu_IN",GX_GR:"gx_GR",HA_NG:"ha_NG",HE_IL:"he_IL",HI_FB:"hi_FB",HI_IN:"hi_IN",HR_HR:"hr_HR",HT_HT:"ht_HT",HU_HU:"hu_HU",HY_AM:"hy_AM",ID_ID:"id_ID",IG_NG:"ig_NG",IK_US:"ik_US",IS_IS:"is_IS",IT_IT:"it_IT",IU_CA:"iu_CA",JA_JP:"ja_JP",JA_KS:"ja_KS",JV_ID:"jv_ID",KA_GE:"ka_GE",KK_KZ:"kk_KZ",KM_KH:"km_KH",KN_IN:"kn_IN",KO_KR:"ko_KR",KS_IN:"ks_IN",KU_TR:"ku_TR",KY_KG:"ky_KG",LA_VA:"la_VA",LG_UG:"lg_UG",LI_NL:"li_NL",LN_CD:"ln_CD",LO_LA:"lo_LA",LR_IT:"lr_IT",LT_LT:"lt_LT",LV_LV:"lv_LV",MG_MG:"mg_MG",MI_NZ:"mi_NZ",MK_MK:"mk_MK",ML_IN:"ml_IN",MN_MN:"mn_MN",MOS_BF:"mos_BF",MR_IN:"mr_IN",MS_MY:"ms_MY",MT_MT:"mt_MT",MY_MM:"my_MM",NB_NO:"nb_NO",ND_ZW:"nd_ZW",NE_NP:"ne_NP",NH_MX:"nh_MX",NL_BE:"nl_BE",NL_NL:"nl_NL",NN_NO:"nn_NO",NR_ZA:"nr_ZA",NS_ZA:"ns_ZA",NY_MW:"ny_MW",OM_ET:"om_ET",OR_IN:"or_IN",PA_IN:"pa_IN",PCM_NG:"pcm_NG",PL_PL:"pl_PL",PS_AF:"ps_AF",PT_BR:"pt_BR",PT_PT:"pt_PT",QB_DE:"qb_DE",QC_GT:"qc_GT",QE_US:"qe_US",QK_DZ:"qk_DZ",QR_GR:"qr_GR",QS_DE:"qs_DE",QT_US:"qt_US",QU_PE:"qu_PE",QV_IT:"qv_IT",QZ_MM:"qz_MM",RM_CH:"rm_CH",RN_BI:"rn_BI",RO_RO:"ro_RO",RU_RU:"ru_RU",RW_RW:"rw_RW",SA_IN:"sa_IN",SC_IT:"sc_IT",SE_NO:"se_NO",SI_LK:"si_LK",SK_SK:"sk_SK",SL_SI:"sl_SI",SN_ZW:"sn_ZW",SO_SO:"so_SO",SQ_AL:"sq_AL",SR_RS:"sr_RS",SS_SZ:"ss_SZ",ST_ZA:"st_ZA",SU_ID:"su_ID",SV_SE:"sv_SE",SW_KE:"sw_KE",SY_SY:"sy_SY",SZ_PL:"sz_PL",TA_IN:"ta_IN",TE_IN:"te_IN",TG_TJ:"tg_TJ",TH_TH:"th_TH",TI_ET:"ti_ET",TK_TM:"tk_TM",TL_PH:"tl_PH",TL_ST:"tl_ST",TN_BW:"tn_BW",TQ_AR:"tq_AR",TPI_PG:"tpi_PG",TR_TR:"tr_TR",TS_ZA:"ts_ZA",TT_RU:"tt_RU",TZ_MA:"tz_MA",UK_UA:"uk_UA",UR_PK:"ur_PK",UZ_UZ:"uz_UZ",VE_ZA:"ve_ZA",VI_VN:"vi_VN",WO_SN:"wo_SN",XH_ZA:"xh_ZA",YI_DE:"yi_DE",YO_NG:"yo_NG",ZH_CN:"zh_CN",ZH_HK:"zh_HK",ZH_TW:"zh_TW",ZU_ZA:"zu_ZA",ZZ_TR:"zz_TR"});c=a;f["default"]=c}),66); __d("WAWebL10NCoerceToFBLocale",["bcp-47","gkx"],(function(a,b,c,d,e,f,g){"use strict";var h="en_GB",i=new Map([["af","af_ZA"],["ar","ar_AR"],["az","az_AZ"],["bg","bg_BG"],["bn","bn_IN"],["ca","ca_ES"],["cs","cs_CZ"],["da","da_DK"],["de","de_DE"],["el","el_GR"],["en","en_GB"],["es","es_LA"],["et","et_EE"],["fa","fa_IR"],["fi","fi_FI"],["fr","fr_FR"],["gu","gu_IN"],["he","he_IL"],["hi","hi_IN"],["hr","hr_HR"],["hu","hu_HU"],["id","id_ID"],["it","it_IT"],["ja","ja_JP"],["kk","kk_KZ"],["kn","kn_IN"],["ko","ko_KR"],["lt","lt_LT"],["lv","lv_LV"],["mk","mk_MK"],["ml","ml_IN"],["mr","mr_IN"],["ms","ms_MY"],["nb","nb_NO"],["nl","nl_NL"],["pa","pa_IN"],["pl","pl_PL"],["pt","pt_BR"],["ro","ro_RO"],["ru","ru_RU"],["sk","sk_SK"],["sl","sl_SI"],["sq","sq_AL"],["sr","sr_RS"],["sv","sv_SE"],["sw","sw_KE"],["ta","ta_IN"],["te","te_IN"],["th","th_TH"],["tl","tl_PH"],["tr","tr_TR"],["uk","uk_UA"],["ur","ur_PK"],["uz","uz_UZ"],["vi","vi_VN"],["zh","zh_CN"]]),j=new Map([["pt_ao","pt_PT"],["pt_ch","pt_PT"],["pt_cv","pt_PT"],["pt_fr","pt_PT"],["pt_gq","pt_PT"],["pt_gw","pt_PT"],["pt_lu","pt_PT"],["pt_mo","pt_PT"],["pt_mz","pt_PT"],["pt_pt","pt_PT"],["pt_st","pt_PT"],["pt_tl","pt_PT"],["zh_cn","zh_CN"],["zh_hk","zh_HK"],["zh_tw","zh_TW"],["zh_hant","zh_HK"],["zh_hans","zh_CN"],["fil","tl_PH"],["in","id_ID"],["iw","he_IL"],["mo","ro_RO"],["jw","jv_ID"],["ji","yi_DE"]]),k=new Map([["fb_aa","fb_AA"],["fb_ac","fb_AC"],["fb_ar","fb_AR"],["fb_ha","fb_HA"],["fb_hx","fb_HX"],["fb_ll","fb_LL"],["fb_ls","fb_LS"],["fb_lt","fb_LT"],["fb_rl","fb_RL"],["fb_zh","fb_ZH"],["fbt_ac","fbt_AC"]]);function a(a){if(c("gkx")("26259")){var b=a.toLocaleLowerCase("en").replaceAll("-","_");if(k.has(b)){return(b=k.get(b))!=null?b:h}}b=a.toLocaleLowerCase("en").replaceAll("_","-");try{a=c("bcp-47").parse(b);b=[];a.region!=null&&b.push(a.language+"_"+a.region);a.script!=null&&b.push(a.language+"_"+a.script);for(b of b){var d=j.get(b);if(d)return d}return(d=i.get(a.language))!=null?d:h}catch(a){return h}}function b(a){return c("gkx")("26259")?k.has(a.toLocaleLowerCase("en")):!1}g.DEFAULT_WA_WEB_LOCALE=h;g.LANGUAGE_TO_FB_LOCALE=i;g.EXCEPTION_LANG_REGION_TO_FB_LOCALE=j;g.DEBUG_LOCALES=k;g.coerceWAWebL10nLocaleToFBLocale=a;g.isWAWebl10nDebugLocale=b}),98); __d("WAWebLocaleToMomentResource",[],(function(a,b,c,d,e,f){a={"zh-HK":"zh-TW",pa:"pa-IN"};b=a;f["default"]=b}),66); __d("WAWebMomentLocales",["JSResource","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){switch(a.toLocaleLowerCase("en")){case"en-au":yield c("JSResource")("WAWebMoment-en-au").__setRef("WAWebMomentLocales").load();return!0;case"en-ca":yield c("JSResource")("WAWebMoment-en-ca").__setRef("WAWebMomentLocales").load();return!0;case"en-gb":yield c("JSResource")("WAWebMoment-en-gb").__setRef("WAWebMomentLocales").load();return!0;case"en-ie":yield c("JSResource")("WAWebMoment-en-ie").__setRef("WAWebMomentLocales").load();return!0;case"en-in":yield c("JSResource")("WAWebMoment-en-in").__setRef("WAWebMomentLocales").load();return!0;case"en-nz":yield c("JSResource")("WAWebMoment-en-nz").__setRef("WAWebMomentLocales").load();return!0;case"en-sg":yield c("JSResource")("WAWebMoment-en-sg").__setRef("WAWebMomentLocales").load();return!0;case"af":yield c("JSResource")("WAWebMoment-af").__setRef("WAWebMomentLocales").load();return!0;case"ar-dz":yield c("JSResource")("WAWebMoment-ar-dz").__setRef("WAWebMomentLocales").load();return!0;case"ar":yield c("JSResource")("WAWebMoment-ar").__setRef("WAWebMomentLocales").load();return!0;case"ar-kw":yield c("JSResource")("WAWebMoment-ar-kw").__setRef("WAWebMomentLocales").load();return!0;case"ar-ly":yield c("JSResource")("WAWebMoment-ar-ly").__setRef("WAWebMomentLocales").load();return!0;case"ar-ma":yield c("JSResource")("WAWebMoment-ar-ma").__setRef("WAWebMomentLocales").load();return!0;case"ar-sa":yield c("JSResource")("WAWebMoment-ar-sa").__setRef("WAWebMomentLocales").load();return!0;case"ar-tn":yield c("JSResource")("WAWebMoment-ar-tn").__setRef("WAWebMomentLocales").load();return!0;case"az":yield c("JSResource")("WAWebMoment-az").__setRef("WAWebMomentLocales").load();return!0;case"be":yield c("JSResource")("WAWebMoment-be").__setRef("WAWebMomentLocales").load();return!0;case"bg":yield c("JSResource")("WAWebMoment-bg").__setRef("WAWebMomentLocales").load();return!0;case"bm":yield c("JSResource")("WAWebMoment-bm").__setRef("WAWebMomentLocales").load();return!0;case"bn-bd":yield c("JSResource")("WAWebMoment-bn-bd").__setRef("WAWebMomentLocales").load();return!0;case"bn":yield c("JSResource")("WAWebMoment-bn").__setRef("WAWebMomentLocales").load();return!0;case"bo":yield c("JSResource")("WAWebMoment-bo").__setRef("WAWebMomentLocales").load();return!0;case"br":yield c("JSResource")("WAWebMoment-br").__setRef("WAWebMomentLocales").load();return!0;case"bs":yield c("JSResource")("WAWebMoment-bs").__setRef("WAWebMomentLocales").load();return!0;case"ca":yield c("JSResource")("WAWebMoment-ca").__setRef("WAWebMomentLocales").load();return!0;case"cs":yield c("JSResource")("WAWebMoment-cs").__setRef("WAWebMomentLocales").load();return!0;case"cv":yield c("JSResource")("WAWebMoment-cv").__setRef("WAWebMomentLocales").load();return!0;case"cy":yield c("JSResource")("WAWebMoment-cy").__setRef("WAWebMomentLocales").load();return!0;case"da":yield c("JSResource")("WAWebMoment-da").__setRef("WAWebMomentLocales").load();return!0;case"de-at":yield c("JSResource")("WAWebMoment-de-at").__setRef("WAWebMomentLocales").load();return!0;case"de-ch":yield c("JSResource")("WAWebMoment-de-ch").__setRef("WAWebMomentLocales").load();return!0;case"de":yield c("JSResource")("WAWebMoment-de").__setRef("WAWebMomentLocales").load();return!0;case"dv":yield c("JSResource")("WAWebMoment-dv").__setRef("WAWebMomentLocales").load();return!0;case"el":yield c("JSResource")("WAWebMoment-el").__setRef("WAWebMomentLocales").load();return!0;case"eo":yield c("JSResource")("WAWebMoment-eo").__setRef("WAWebMomentLocales").load();return!0;case"es-do":yield c("JSResource")("WAWebMoment-es-do").__setRef("WAWebMomentLocales").load();return!0;case"es":yield c("JSResource")("WAWebMoment-es").__setRef("WAWebMomentLocales").load();return!0;case"es-mx":yield c("JSResource")("WAWebMoment-es-mx").__setRef("WAWebMomentLocales").load();return!0;case"es-us":yield c("JSResource")("WAWebMoment-es-us").__setRef("WAWebMomentLocales").load();return!0;case"et":yield c("JSResource")("WAWebMoment-et").__setRef("WAWebMomentLocales").load();return!0;case"eu":yield c("JSResource")("WAWebMoment-eu").__setRef("WAWebMomentLocales").load();return!0;case"fa":yield c("JSResource")("WAWebMoment-fa").__setRef("WAWebMomentLocales").load();return!0;case"fi":yield c("JSResource")("WAWebMoment-fi").__setRef("WAWebMomentLocales").load();return!0;case"fil":yield c("JSResource")("WAWebMoment-fil").__setRef("WAWebMomentLocales").load();return!0;case"fo":yield c("JSResource")("WAWebMoment-fo").__setRef("WAWebMomentLocales").load();return!0;case"fr-ca":yield c("JSResource")("WAWebMoment-fr-ca").__setRef("WAWebMomentLocales").load();return!0;case"fr-ch":yield c("JSResource")("WAWebMoment-fr-ch").__setRef("WAWebMomentLocales").load();return!0;case"fr":yield c("JSResource")("WAWebMoment-fr").__setRef("WAWebMomentLocales").load();return!0;case"fy":yield c("JSResource")("WAWebMoment-fy").__setRef("WAWebMomentLocales").load();return!0;case"ga":yield c("JSResource")("WAWebMoment-ga").__setRef("WAWebMomentLocales").load();return!0;case"gd":yield c("JSResource")("WAWebMoment-gd").__setRef("WAWebMomentLocales").load();return!0;case"gl":yield c("JSResource")("WAWebMoment-gl").__setRef("WAWebMomentLocales").load();return!0;case"gom-deva":yield c("JSResource")("WAWebMoment-gom-deva").__setRef("WAWebMomentLocales").load();return!0;case"gom-latn":yield c("JSResource")("WAWebMoment-gom-latn").__setRef("WAWebMomentLocales").load();return!0;case"gu":yield c("JSResource")("WAWebMoment-gu").__setRef("WAWebMomentLocales").load();return!0;case"he":yield c("JSResource")("WAWebMoment-he").__setRef("WAWebMomentLocales").load();return!0;case"hi":yield c("JSResource")("WAWebMoment-hi").__setRef("WAWebMomentLocales").load();return!0;case"hr":yield c("JSResource")("WAWebMoment-hr").__setRef("WAWebMomentLocales").load();return!0;case"hu":yield c("JSResource")("WAWebMoment-hu").__setRef("WAWebMomentLocales").load();return!0;case"hy-am":yield c("JSResource")("WAWebMoment-hy-am").__setRef("WAWebMomentLocales").load();return!0;case"id":yield c("JSResource")("WAWebMoment-id").__setRef("WAWebMomentLocales").load();return!0;case"is":yield c("JSResource")("WAWebMoment-is").__setRef("WAWebMomentLocales").load();return!0;case"it-ch":yield c("JSResource")("WAWebMoment-it-ch").__setRef("WAWebMomentLocales").load();return!0;case"it":yield c("JSResource")("WAWebMoment-it").__setRef("WAWebMomentLocales").load();return!0;case"ja":yield c("JSResource")("WAWebMoment-ja").__setRef("WAWebMomentLocales").load();return!0;case"jv":yield c("JSResource")("WAWebMoment-jv").__setRef("WAWebMomentLocales").load();return!0;case"ka":yield c("JSResource")("WAWebMoment-ka").__setRef("WAWebMomentLocales").load();return!0;case"kk":yield c("JSResource")("WAWebMoment-kk").__setRef("WAWebMomentLocales").load();return!0;case"km":yield c("JSResource")("WAWebMoment-km").__setRef("WAWebMomentLocales").load();return!0;case"kn":yield c("JSResource")("WAWebMoment-kn").__setRef("WAWebMomentLocales").load();return!0;case"ko":yield c("JSResource")("WAWebMoment-ko").__setRef("WAWebMomentLocales").load();return!0;case"ku":yield c("JSResource")("WAWebMoment-ku").__setRef("WAWebMomentLocales").load();return!0;case"ky":yield c("JSResource")("WAWebMoment-ky").__setRef("WAWebMomentLocales").load();return!0;case"lb":yield c("JSResource")("WAWebMoment-lb").__setRef("WAWebMomentLocales").load();return!0;case"lo":yield c("JSResource")("WAWebMoment-lo").__setRef("WAWebMomentLocales").load();return!0;case"lt":yield c("JSResource")("WAWebMoment-lt").__setRef("WAWebMomentLocales").load();return!0;case"lv":yield c("JSResource")("WAWebMoment-lv").__setRef("WAWebMomentLocales").load();return!0;case"me":yield c("JSResource")("WAWebMoment-me").__setRef("WAWebMomentLocales").load();return!0;case"mi":yield c("JSResource")("WAWebMoment-mi").__setRef("WAWebMomentLocales").load();return!0;case"mk":yield c("JSResource")("WAWebMoment-mk").__setRef("WAWebMomentLocales").load();return!0;case"ml":yield c("JSResource")("WAWebMoment-ml").__setRef("WAWebMomentLocales").load();return!0;case"mn":yield c("JSResource")("WAWebMoment-mn").__setRef("WAWebMomentLocales").load();return!0;case"mr":yield c("JSResource")("WAWebMoment-mr").__setRef("WAWebMomentLocales").load();return!0;case"ms":yield c("JSResource")("WAWebMoment-ms").__setRef("WAWebMomentLocales").load();return!0;case"ms-my":yield c("JSResource")("WAWebMoment-ms-my").__setRef("WAWebMomentLocales").load();return!0;case"mt":yield c("JSResource")("WAWebMoment-mt").__setRef("WAWebMomentLocales").load();return!0;case"my":yield c("JSResource")("WAWebMoment-my").__setRef("WAWebMomentLocales").load();return!0;case"nb":yield c("JSResource")("WAWebMoment-nb").__setRef("WAWebMomentLocales").load();return!0;case"ne":yield c("JSResource")("WAWebMoment-ne").__setRef("WAWebMomentLocales").load();return!0;case"nl-be":yield c("JSResource")("WAWebMoment-nl-be").__setRef("WAWebMomentLocales").load();return!0;case"nl":yield c("JSResource")("WAWebMoment-nl").__setRef("WAWebMomentLocales").load();return!0;case"nn":yield c("JSResource")("WAWebMoment-nn").__setRef("WAWebMomentLocales").load();return!0;case"oc-lnc":yield c("JSResource")("WAWebMoment-oc-lnc").__setRef("WAWebMomentLocales").load();return!0;case"pa-in":yield c("JSResource")("WAWebMoment-pa-in").__setRef("WAWebMomentLocales").load();return!0;case"pl":yield c("JSResource")("WAWebMoment-pl").__setRef("WAWebMomentLocales").load();return!0;case"pt-br":yield c("JSResource")("WAWebMoment-pt-br").__setRef("WAWebMomentLocales").load();return!0;case"pt":yield c("JSResource")("WAWebMoment-pt").__setRef("WAWebMomentLocales").load();return!0;case"ro":yield c("JSResource")("WAWebMoment-ro").__setRef("WAWebMomentLocales").load();return!0;case"ru":yield c("JSResource")("WAWebMoment-ru").__setRef("WAWebMomentLocales").load();return!0;case"sd":yield c("JSResource")("WAWebMoment-sd").__setRef("WAWebMomentLocales").load();return!0;case"se":yield c("JSResource")("WAWebMoment-se").__setRef("WAWebMomentLocales").load();return!0;case"si":yield c("JSResource")("WAWebMoment-si").__setRef("WAWebMomentLocales").load();return!0;case"sk":yield c("JSResource")("WAWebMoment-sk").__setRef("WAWebMomentLocales").load();return!0;case"sl":yield c("JSResource")("WAWebMoment-sl").__setRef("WAWebMomentLocales").load();return!0;case"sq":yield c("JSResource")("WAWebMoment-sq").__setRef("WAWebMomentLocales").load();return!0;case"sr-cyrl":yield c("JSResource")("WAWebMoment-sr-cyrl").__setRef("WAWebMomentLocales").load();return!0;case"sr":yield c("JSResource")("WAWebMoment-sr").__setRef("WAWebMomentLocales").load();return!0;case"ss":yield c("JSResource")("WAWebMoment-ss").__setRef("WAWebMomentLocales").load();return!0;case"sv":yield c("JSResource")("WAWebMoment-sv").__setRef("WAWebMomentLocales").load();return!0;case"sw":yield c("JSResource")("WAWebMoment-sw").__setRef("WAWebMomentLocales").load();return!0;case"ta":yield c("JSResource")("WAWebMoment-ta").__setRef("WAWebMomentLocales").load();return!0;case"te":yield c("JSResource")("WAWebMoment-te").__setRef("WAWebMomentLocales").load();return!0;case"tet":yield c("JSResource")("WAWebMoment-tet").__setRef("WAWebMomentLocales").load();return!0;case"tg":yield c("JSResource")("WAWebMoment-tg").__setRef("WAWebMomentLocales").load();return!0;case"th":yield c("JSResource")("WAWebMoment-th").__setRef("WAWebMomentLocales").load();return!0;case"tk":yield c("JSResource")("WAWebMoment-tk").__setRef("WAWebMomentLocales").load();return!0;case"tlh":yield c("JSResource")("WAWebMoment-tlh").__setRef("WAWebMomentLocales").load();return!0;case"tl-ph":yield c("JSResource")("WAWebMoment-tl-ph").__setRef("WAWebMomentLocales").load();return!0;case"tr":yield c("JSResource")("WAWebMoment-tr").__setRef("WAWebMomentLocales").load();return!0;case"tzl":yield c("JSResource")("WAWebMoment-tzl").__setRef("WAWebMomentLocales").load();return!0;case"tzm":yield c("JSResource")("WAWebMoment-tzm").__setRef("WAWebMomentLocales").load();return!0;case"tzm-latn":yield c("JSResource")("WAWebMoment-tzm-latn").__setRef("WAWebMomentLocales").load();return!0;case"ug-cn":yield c("JSResource")("WAWebMoment-ug-cn").__setRef("WAWebMomentLocales").load();return!0;case"uk":yield c("JSResource")("WAWebMoment-uk").__setRef("WAWebMomentLocales").load();return!0;case"ur":yield c("JSResource")("WAWebMoment-ur").__setRef("WAWebMomentLocales").load();return!0;case"uz":yield c("JSResource")("WAWebMoment-uz").__setRef("WAWebMomentLocales").load();return!0;case"uz-latn":yield c("JSResource")("WAWebMoment-uz-latn").__setRef("WAWebMomentLocales").load();return!0;case"vi":yield c("JSResource")("WAWebMoment-vi").__setRef("WAWebMomentLocales").load();return!0;case"x-pseudo":yield c("JSResource")("WAWebMoment-x-pseudo").__setRef("WAWebMomentLocales").load();return!0;case"yo":yield c("JSResource")("WAWebMoment-yo").__setRef("WAWebMomentLocales").load();return!0;case"zh-cn":yield c("JSResource")("WAWebMoment-zh-cn").__setRef("WAWebMomentLocales").load();return!0;case"zh-hk":yield c("JSResource")("WAWebMoment-zh-hk").__setRef("WAWebMomentLocales").load();return!0;case"zh-mo":yield c("JSResource")("WAWebMoment-zh-mo").__setRef("WAWebMomentLocales").load();return!0;case"zh-tw":yield c("JSResource")("WAWebMoment-zh-tw").__setRef("WAWebMomentLocales").load();return!0;default:return!1}});return h.apply(this,arguments)}g.downloadAndDefineLocale=a}),98); __d("WAWebUserPrefsLocales",["WAComms","WAWebABProps","WAWebL10NConstants","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsLocalStorage","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(){var a=c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_PHONE);return a!=null?a:c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG)}function b(){return c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_USER)}function e(a){d("WAWebABProps").getABPropConfigValue("language_and_time_web")&&(c("WAWebUserPrefsLocalStorage").setItemToLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_USER,a),d("WAComms").isSocketConnected()&&void d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_USER,a))}function f(a){c("WAWebUserPrefsLocalStorage").setItemToLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_PHONE,a),d("WAComms").isSocketConnected()&&void d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_PHONE,a)}function h(a){c("WAWebUserPrefsLocalStorage").setItemToLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_DID_MISMATCH_WITH_COOKIE,a)}function i(){var a;return(a=c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.LANG_DID_MISMATCH_WITH_COOKIE))!=null?a:!1}function j(){if(!d("WAWebL10NConstants").MARK_TRANSLATIONS_ENABLED)return!1;var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.MARK_TRANSLATIONS);return typeof a==="boolean"?a:d("WAWebL10NConstants").MARK_TRANSLATIONS_ENABLED}function k(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.MARK_TRANSLATIONS,a)}function l(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.HOUR_24_FROM_PHONE,a)}function m(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.HOUR_24_FROM_DEVICE,a)}function n(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.HOUR_24_FROM_PHONE);if(typeof a==="boolean")return a;a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.HOUR_24);typeof a==="boolean"&&c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.HOUR_24_FROM_PHONE,a);return typeof a==="boolean"?a:null}function o(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.HOUR_24_FROM_DEVICE);return typeof a==="boolean"?a:null}g.getPhoneLangPref=a;g.getUserLangPref=b;g.setUserLangPref=e;g.setPhoneLangPref=f;g.setLangPrefCookieDidMismatchWithUserPref=h;g.getLangPrefCookieDidMismatchWithUserPref=i;g.getMarkTranslations=j;g.setMarkTranslations=k;g.setPhoneHour24=l;g.setDeviceHour24=m;g.getPhoneHour24=n;g.getDeviceHour24=o}),98); __d("WAWebL10N",["WALogger","WAWeb-moment","WAWebABProps","WAWebBackendApi","WAWebBaseL10N","WAWebEnvironment","WAWebEventsWaitForMainStreamReadyMd","WAWebL10NCoerceToFBLocale","WAWebL10NConstants","WAWebL10nGetRenderedLocale","WAWebLocaleToMomentResource","WAWebMomentLocales","WAWebUserPrefsLocales","asyncToGeneratorRuntime","bcp-47","gkx","justknobx","lodash","nullthrows"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] constructor: Mismatch between rendered locale and user-pref locale. Using cleaned user-pref locale: ","; setting cookie to: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] constructor: Mismatch between rendered locale: ","; and cleaned user-pref locale: ","; NOT setting cookie to avoid refresh loop."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] moment locale updated to: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Could not fetch moment locales, using default en-US"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(['[l10n] _cleanRawLocaleString: "','" not compatible with Intl.NumberFormat, falling back to "','"']);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(['[l10n] _cleanRawLocaleString: loc: "','", cleaned: "','"']);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] init: with locale ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] constructor: Using pref locale as full locale: ","; rendered locale: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] setLocale: Language change detected from "," to ",", reloading page."]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] setLocale: No language change detected (","), skipping page reload."]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] setLocale: fullLocale:",", renderedLocale:",", newLocale:",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[l10n] setLocale: USER TRIGGERED Language change detected from "," to ","."]);s=function(){return a};return a}var t=5e3,u=d("WAWebL10NCoerceToFBLocale").DEFAULT_WA_WEB_LOCALE.replaceAll("_","-");a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;f=a.call(this,{l:"en",loc:"en"},{},!1)||this;f.$L10n$p_4=null;f.setLocale=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(a==null)return;c=(c=c)!=null?c:!1;b=(b=b)!=null?b:d("WAWebL10NConstants").L10N_PRIORITY.PHONE;var e=d("WAWebABProps").getABPropConfigValue("language_and_time_web")&&b>=d("WAWebL10NConstants").L10N_PRIORITY.SAVED,g=f.normalizeLocaleToBcp47Compliant(a);if(g==null||g===f.$L10n$p_2)return;e?d("WAWebUserPrefsLocales").setUserLangPref(a):d("WAWebUserPrefsLocales").setPhoneLangPref(a);if(d("WAWebABProps").getABPropConfigValue("language_and_time_web")&&b===d("WAWebL10NConstants").L10N_PRIORITY.PHONE&&d("WAWebUserPrefsLocales").getUserLangPref()!=null)return;e=f.$L10n$p_1;f.$L10n$p_2=g;a=d("WAWebL10NCoerceToFBLocale").coerceWAWebL10nLocaleToFBLocale(g);yield d("WAWebBackendApi").frontendSendAndReceive("setLocalePrefCookie",{locale:a});f.$L10n$p_3=g;f.$L10n$p_4=a;c===!0&&b===d("WAWebL10NConstants").L10N_PRIORITY.SAVED&&d("WALogger").LOG(s(),e,a);d("WALogger").LOG(r(),g,f.$L10n$p_1,a);if(c!==!0)f.trigger("locale_changed_on_phone",{newLocale:a,currentLocale:e});else if(e===a)f.$L10n$p_9.cancel(),d("WALogger").LOG(q(),e),yield f.applyMomentLocale(g),f.trigger("locale_change",{l:a,loc:g});else if(c===!0){d("WALogger").LOG(p(),e,a);f.$L10n$p_1=a;if(b>=d("WAWebL10NConstants").L10N_PRIORITY.SAVED){f.$L10n$p_10();return}void f.$L10n$p_9()}});return function(b,c,d){return a.apply(this,arguments)}}();f.$L10n$p_9=c("lodash").debounce(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c("WAWebEventsWaitForMainStreamReadyMd")();return f.$L10n$p_10()}),t);f.$L10n$p_1=d("WAWebL10nGetRenderedLocale").WAWebL10nGetRenderedLocale();f.$L10n$p_2=f.$L10n$p_5(d("WAWebL10nGetRenderedLocale").WAWebL10nGetRenderedLocale());var g=f.$L10n$p_6(),h=f.$L10n$p_7();e=(e=g)!=null?e:h;h=g==null;if(e==null){d("WAWebUserPrefsLocales").setPhoneLangPref(f.$L10n$p_1);return babelHelpers.assertThisInitialized(f)}g=f.$L10n$p_5(e);f.$L10n$p_3=g;if(g==null){h?d("WAWebUserPrefsLocales").setPhoneLangPref(f.$L10n$p_1):d("WAWebUserPrefsLocales").setUserLangPref(f.$L10n$p_1);return babelHelpers.assertThisInitialized(f)}h=d("WAWebL10NCoerceToFBLocale").coerceWAWebL10nLocaleToFBLocale(g);f.$L10n$p_4=h;h===f.$L10n$p_1&&(d("WALogger").LOG(o(),e,f.$L10n$p_1),f.$L10n$p_2=g);void f.applyMomentLocale(g);return f}var f=e.prototype;f.init=function(a){d("WALogger").LOG(n(),a);return this.setLocale(a,d("WAWebL10NConstants").L10N_PRIORITY.SAVED,!1)};f.getLocale=function(){return this.$L10n$p_1};f.getFullLocale=function(){return!c("gkx")("26258")?d("WAWebL10NCoerceToFBLocale").isWAWebl10nDebugLocale(this.$L10n$p_2)?u:this.$L10n$p_2:this.$L10n$p_2};f.getNormalizedLocale=function(){var a;return(a=this.normalizeLocaleToWajsLocale(String(this.getLocale())))!=null?a:this.getLocale()};f.getLanguage=function(){return this.$L10n$p_8(this.getFullLocale())};f.$L10n$p_8=function(a){return d("bcp-47").parse(a).language};f.getRegion=function(){var a;a=(a=d("bcp-47").parse(this.getFullLocale()))==null?void 0:a.region;if(a!=null)return a;a=this.$L10n$p_1.replace(/_/g,"-");return c("nullthrows")((a=d("bcp-47").parse(a))==null?void 0:a.region)};f.$L10n$p_6=function(){return this.normalizeLocaleToBcp47Compliant(d("WAWebUserPrefsLocales").getUserLangPref())};f.$L10n$p_7=function(){return this.normalizeLocaleToBcp47Compliant(d("WAWebUserPrefsLocales").getPhoneLangPref())};f.normalizeLocaleToBcp47Compliant=function(a){if(a==null)return null;var b=this.$L10n$p_5(a);if(b!==a){d("WALogger").LOG(m(),a,b);try{new Intl.NumberFormat(b)}catch(a){d("WALogger").LOG(l(),b,d("WAWebL10NCoerceToFBLocale").DEFAULT_WA_WEB_LOCALE),b=d("WAWebL10NCoerceToFBLocale").DEFAULT_WA_WEB_LOCALE.replaceAll("_","-")}}return b};f.$L10n$p_5=function(a){return a.replace(/@.*/,"").replace(/_/g,"-")};f.$L10n$p_10=function(){self.setTimeout(function(){window.location.reload()},100)};f.applyMomentLocale=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.toLocaleLowerCase("en");var b;if(a===d("WAWebL10NConstants").DEFAULT_MOMENT_LOCALE.toLocaleLowerCase("en"))b=a;else{var e=[];e.push(a);if(a.match(/en/i)==null){a=a.replace(/_/g,"-");e.push(a);c("WAWebLocaleToMomentResource")[a]!=null&&e.push(c("WAWebLocaleToMomentResource")[a])}e.push(this.getLanguage());e.push(u);for(a=0;a<e.length;++a){var f=(yield d("WAWebMomentLocales").downloadAndDefineLocale(e[a]));if(f){b=e[a];break}}}b==null&&(d("WALogger").WARN(k()),b=d("WAWebL10NConstants").DEFAULT_MOMENT_LOCALE);c("WAWeb-moment").locale(b);d("WALogger").LOG(j(),b);this.customizeMomentLocale(c("WAWeb-moment").locale())});function e(b){return a.apply(this,arguments)}return e}();f.customizeMomentLocale=function(a){var b=d("WAWebL10NConstants").LOCALE_CUSTOMIZATIONS[a];b&&c("WAWeb-moment").locale(a,b)};f.checkForLocaleMismatchBetweenCookieAndUserPref=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if((c("WAWebEnvironment").isWindows?d("WAWebL10NCoerceToFBLocale").coerceWAWebL10nLocaleToFBLocale(this.$L10n$p_1):this.$L10n$p_1)===this.$L10n$p_4){d("WAWebUserPrefsLocales").setLangPrefCookieDidMismatchWithUserPref(!1);return}d("WAWebUserPrefsLocales").getLangPrefCookieDidMismatchWithUserPref()?d("WALogger").WARN(i(),this.$L10n$p_1,this.$L10n$p_3):this.$L10n$p_4&&(d("WALogger").LOG(h(),this.$L10n$p_3,this.$L10n$p_4),yield d("WAWebBackendApi").frontendSendAndReceive("setLocalePrefCookie",{locale:this.$L10n$p_4}),d("WAWebUserPrefsLocales").setLangPrefCookieDidMismatchWithUserPref(!0),c("justknobx")._("2237")||void this.$L10n$p_9())});function e(){return a.apply(this,arguments)}return e}();return e}(d("WAWebBaseL10N").WAWebBaseL10n);e=new a();g["default"]=e}),98); __d("WAWebAccentDiacriticRegex",[],(function(a,b,c,d,e,f){a=/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1087-\u108D\u108F\u109A\u109B\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA717-\uA721\uA788\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4]|\uD81B[\uDF8F-\uDF9F]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g;b=a;f["default"]=b}),66); __d("WAWebL10NHelpers",["WAWebABProps","WAWebAccentDiacriticRegex","WAWebL10N","latenize"],(function(a,b,c,d,e,f,g){function h(a){a===void 0&&(a="");return a.normalize("NFKD")}function a(a){a===void 0&&(a="");return c("latenize")(h(a).replace(c("WAWebAccentDiacriticRegex"),""))}function b(a){a=a.replace(/_/g,"-").split("-");return a[0].toLowerCase()}function e(a){a=a.replace(/_/g,"-").split("-");return a.length<=1?null:a[a.length-1].toUpperCase()}var i=new Set(["en-GB","en-AU","en-IN"]);function f(){var a=c("WAWebL10N").getFullLocale();return i.has(a)&&d("WAWebABProps").getABPropConfigValue("british_english_localization_enabled_web")}g.normalizeForm=h;g.removeAccents=a;g.getLanguageCodeFromLocale=b;g.getRegionCodeFromLocale=e;g.isUsingSupportedBritishEnglishLocale=f}),98); __d("WAWebBaseMirror",["lodash"],(function(a,b,c,d,e,f,g){function a(a){var b={},c=0,d=function(a){b["change:"+a]=c++};a.props&&Object.keys(a.props).forEach(d);a.session&&Object.keys(a.session).forEach(d);a.derived&&Object.keys(a.derived).forEach(d);return b}var h="change",i=32;function b(a,b){var c=[];for(var d=0;d<b.length;d++){var e=a["change:"+b[d]],f=Math.floor(e/i);e=e%i;k(c,f+1);c[f]|=1<<e}return c}d=function(){function a(a){this.state=a}var b=a.prototype;b.destructor=function(){this.state.off("all",this.onGatherEvent,this)};b.initListener=function(){this.state.on("all",this.onGatherEvent,this),this.masks=[],this.listeners=[],this.changeEvents=[]};b.onGatherEvent=function(a){if(a===h){var b=this.changeEvents;if(!b.filter(Boolean).length)return;this.onChange();this.changeEvents=[]}else{b=this.state.mirrorMask[a];if(b===void 0)return;a=b/i|0;b=b%i|0;k(this.changeEvents,a+1);this.changeEvents[a]|=1<<b}};b.onChange=function(){if(this.listeners==null)return;var a=this.state,b=this.changeEvents;c("lodash").zip(this.masks,this.listeners).forEach(function(c){var d=c[0];c=c[1];var e=Math.min(b.length,d.length);for(var f=0;f<e;f++)if(b[f]&d[f]){var g=c[0],h=c[1];g!=null&&h!=null&&g(h,a);break}})};b.addListener=function(a,b,c){this.listeners||this.initListener();this.masks.push(b);(b=this.listeners)==null?void 0:b.push([a,c])};b.removeListener=function(a){var b=this.listeners;if(b==null)return;for(var c=0;c<b.length;c++)b[c][0]===a&&(b[c][0]=null,b[c][1]=null,j(this.masks,c),j(b,c))};return a}();function j(a,b){a[b]=a[a.length-1],a.pop()}function k(a,b){if(b<=a.length)return;b=b-a.length;for(var c=0;c<b;c++)a.push(0)}g.genMirrorMask=a;g.genBitMask=b;g.BaseMirror=d}),98); __d("isEmptyObject",[],(function(a,b,c,d,e,f){"use strict";function a(a){for(a in a)return!1;return!0}f["default"]=a}),66); __d("isPlainObject",[],(function(a,b,c,d,e,f){"use strict";function a(a){return Object.prototype.toString.call(a)==="[object Object]"}f["default"]=a}),66); /** * License: https://www.facebook.com/legal/license/MDzNl_j9yvg/ */ __d("toposort-1.0.3",[],(function(a,b,c,d,e,f){"use strict";a={};var g={exports:a};function h(){g.exports=a=function(a){return b(c(a),a)};a.array=b;function b(a,b){var c=a.length,d=new Array(c),e={},f=c;while(f--)e[f]||g(a[f],f,[]);return d;function g(h,f,i){if(i.indexOf(h)>=0)throw new Error("Cyclic dependency: "+JSON.stringify(h));if(!~a.indexOf(h))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(h));if(e[f])return;e[f]=!0;var j=b.filter(function(a){return a[0]===h});if(f=j.length){i=i.concat(h);do{var k=j[--f][1];g(k,a.indexOf(k),i)}while(f)}d[--c]=h}}function c(a){var b=[];for(var c=0,d=a.length;c<d;c++){var e=a[c];b.indexOf(e[0])<0&&b.push(e[0]);b.indexOf(e[1])<0&&b.push(e[1])}return b}}var i=!1;function j(){i||(i=!0,h());return g.exports}function b(a){switch(a){case void 0:return j()}}e.exports=b}),null); __d("toposort",["toposort-1.0.3"],(function(a,b,c,d,e,f){e.exports=b("toposort-1.0.3")()}),null); __d("WAWebModelUtils",["WANullthrows","WATypeUtils","err","isEmptyObject","isPlainObject","lodash","toposort"],(function(a,b,c,d,e,f,g){var h={sentinel:"DEFAULT VALUE PLACEHOLDER"},i={PROP:"PROP",SESSION:"SESSION",DERIVED:"DERIVED"},j=Symbol("NO_DEFAULT_VALUE"),k={PROPS:"Props",SESSION:"Session",DERIVED:"Derived",GETTER:"Getter",COLLECTION:"Collection"};function a(a){a===void 0&&(a=j);a={defaultValue:a,type:k.PROPS};return a}function b(a){a===void 0&&(a=j);a={defaultValue:a,type:k.SESSION};return a}function e(a,b){a={fn:a,deps:b,type:k.DERIVED};return a}function f(a){a={fn:a,type:k.GETTER};return a}function l(a){a={val:a,type:k.COLLECTION};return a}function m(a){a=a.defaultValue;return a===j?{}:{defaultValue:a}}var n="__x_";function o(a){return n+a}function p(a,b,e,f){if(!c("isPlainObject")(e))throw c("err")("Invalid Prop/Session definition.");var g={sk:o(b),evt:"change:"+b,attr:f};e.defaultValue!==void 0&&(g.defaultValue=e.defaultValue);a._definition[b]=g;var i=d("WATypeUtils").isFunction(g.defaultValue);if(g.defaultValue!=null&&!i)if(Array.isArray(g.defaultValue))throw c("err")("Do not return mutable types as default values as they are shared. Type: Array provided.");else if(c("isPlainObject")(g.defaultValue))throw c("err")("Do not return mutable types as default values as they are shared. Type: Object provided.");var j=g.sk;Object.defineProperty(a,b,{set:function(a){this.set(b,a)},get:function(){var a=this[j];if(a!==h)return a;return i?this[j]=g.defaultValue():g.defaultValue}})}function q(a,b,c){var d=o(b),e=c.fn;a._definition[b]=a._derived[b]={sk:d,evt:"change:"+b,attr:i.DERIVED,fn:e,deps:c.deps};Object.defineProperty(a,b,{get:function(){var a=this[d];if(a!==h)return a;a=e.call(this);this[d]=a;return a},set:function(){throw new TypeError("'"+b+"' is a derived property, it can't be set directly.")}})}function r(a){var b=[];for(var c in a){if(typeof a[c]==="function")continue;b.push([c,a[c]])}return b}function s(a){var b={},c=Object.getPrototypeOf({}),d=a;Object.getOwnPropertyNames(d).forEach(function(a){if(typeof d[a]!=="function")return;b[a]=d[a]});while((d=Object.getPrototypeOf(d))&&d!==c)Object.getOwnPropertyNames(d).forEach(function(a){if(a in b)return;b[a]=d[a]});return b}function t(a){var b=new a({},{_internalInitializationDoNotUse:!0}),d={name:a.name||"Unknown",props:{},session:{},derived:{},collections:{},isIdType:a.isIdType};a.Collection&&(d.Collection=a.Collection);a.idClass&&(d.idClass=a.idClass);a.allowedIds&&(d.allowedIds=a.allowedIds);var e=new Set(["constructor"]),f=new Set(["collection","parent","revisionNumber","__changes","__fired","__initialized"]),g=new Map(r(b).filter(function(a){var b=a[0];a=a[1];return!f.has(b)&&(a==null?void 0:a.type)===k.GETTER}).map(function(a){var b=a[0];a=a[1].fn;return[a,b]})),h=c("lodash").memoize(function(a){a=c("lodash").flatMap((a=a.dependencies)!=null?a:[],function(a){if(a.dependencyKey!=null)return[a.dependencyKey];var b=g.get(a);return b!=null?[b]:h(a)});return Array.from(new Set(a))});r(b).forEach(function(b){var g=b[0];b=b[1];if(f.has(g)||b==null)return;switch(b.type){case k.PROPS:d.props[g]=m(b);break;case k.SESSION:d.session[g]=m(b);break;case k.DERIVED:d.derived[g]=c("lodash").omit(b,"type");e.add(b.fn.name);break;case k.GETTER:var i=b.fn;d.derived[g]={fn:function(){return i(this)},deps:h(i)};e.add(i.name);break;case k.COLLECTION:d.collections[g]=b.val;break;default:throw c("err")("Invalid defineModel Class type for "+a.name+":"+g+".")}});var i=s(b);e.forEach(function(a){delete i[a]});Object.assign(d,i);return d}function u(a,b){var c;a=(c={},c[b]=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a),c)[b];return a}function v(a,b){var d,e=c("WANullthrows")(b.name);delete b.name;a=u(a,e);var f=a.prototype,g=f.__props=[],j=f.__session=[],k=f.__derived=[],l=f._collections={};e=f._definition={};var m=f._derived={},n=["props","session","derived","collections"];(d=c("lodash")).forOwn(b.props,function(a,b){g.push(b),p(f,b,a,i.PROP)});d.forOwn(b.session,function(a,b){j.push(b),p(f,b,a,i.SESSION)});d.forOwn(b.derived,function(a,b){k.push(b),q(f,b,a)});d.forOwn(b.collections,function(a,b){l[b]=a});Object.assign(f,d.omit(b,n));var o=g.concat(j),r=o.length;Object.defineProperties(f,{attributes:{get:function(){var a={};for(var b=0;b<r;++b)a[o[b]]=this[o[b]];return a}},isState:{get:function(){return!0},set:function(){throw c("err")("attempt to set isState")}}});d={};for(b=0;b<r;b++){n=o[b];"defaultValue"in e[n]&&(d[n]=h)}c("isEmptyObject")(d)||(f.__defaults=d);if(k.length){var s=[],t={},v={};c("lodash").forOwn(m,function(a,b){v[b]=!0,c("lodash").forOwn(a.deps,function(a){v[a]=!0,(t[a]||(t[a]=[])).push(b),s.push([b,a])})});s.length&&(f._deps=t,f._topo=c("toposort").array(Object.keys(v),s).reverse(),f._topoIndexMap=new Map(f._topo.map(function(a,b){return[a,b]})))}return a}g.INIT=h;g.Attr=i;g.prop=a;g.session=b;g.derived=e;g.getter=f;g.collection=l;g.convert=t;g.stateExtend=v}),98); __d("WAWebProxyStateFactory",["WACustomError","WALogger","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(['Cannot write proxy property "',".",'" created in <',"/>. Make sure it is in your list of concerns."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(['Cannot read proxy property "',".",'" created in <',"/>. Make sure it is in your list of concerns."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(['Cannot read proxy property "',".",'" created in <',"/>. Make sure it is in your list of concerns."]);j=function(){return a};return a}var k=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("DuplicatedProxyProperty")),l={};a=function(a,b,e){var f=b.props,g=b.session,m=b.collections,n=b.derived;b=babelHelpers.objectWithoutPropertiesLoose(b,["props","session","collections","derived"]);var o=function(a){this.$ProxyState$state=a},p={};[f,g,m,n].forEach(function(b){if(!b)return;Object.keys(b).forEach(function(b){p[b]={get:function(){c("gkx")("26258")?d("WALogger").WARN(j(),a,b,this.$ProxyState$ComponentName):d("WALogger").ERROR(i(),a,b,this.$ProxyState$ComponentName).sendLogs("Invalid ProxyState Access");return this.$ProxyState$state[b]},set:function(c){d("WALogger").ERROR(h(),a,b,this.$ProxyState$ComponentName).sendLogs("Invalid ProxyState Write"),this.$ProxyState$state[b]=c}}})});p.proxyName={value:a};p.mirrorMask={value:e};["set","get"].concat(Object.keys(b)).forEach(function(a){p[a]={value:function(){var b=this.$ProxyState$state;return b[a].apply(b,arguments)}}});o.prototype=Object.create(null,p);o.prototype.constructor=o;if(a in l)throw new k('Duplicated proxy property "'+a+'".');l[a]=o};g.ProxyStates=l;g.ProxyStateFactory=a}),98); __d("WAWebBaseModel",["WALogger","WANullthrows","WATypeUtils","WAWebBaseMirror","WAWebCmd","WAWebEventEmitter","WAWebModelUtils","WAWebNetworkStatus","WAWebProxyStateFactory","cr:5292","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["\t",":"],["\\t",":"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["derived:"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["\t",":"],["\\t",":"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["session:"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["\t",":"],["\\t",":"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["props:"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Detected UI change inside a transaction in model ",".\n This can result in a consistency issue. See https://fburl.com/aleoj4tt item #1 for details."]);n=function(){return a};return a}function a(a){return typeof a==="string"?a:a.toString()}var o=/^change:/,p=function(e){babelHelpers.inheritsLoose(a,e);function a(a,b){var c;b===void 0&&(b={});c=e.call(this)||this;c.stale=d("WAWebModelUtils").session(!1);c.revisionNumber=1;c.__fired=null;c.__changes=null;c.__initialized=!1;if(b._internalInitializationDoNotUse)return babelHelpers.assertThisInitialized(c);c.stale=(a==null?void 0:a.stale)||c.getDefault("stale")===!0;c.parent=b.parent;c.collection=b.collection;c._initDeriveds();c._initCollections();var f=c.__defaults;f=f?babelHelpers["extends"]({},f,a):a;f&&!q(f)&&c.set(f,babelHelpers["extends"]({silent:!0},b));c.initialize();c.__initialized=!0;return c}var f=a.prototype;f.initialize=function(){if(this.collection&&this.id&&!this.collection.modelClass.prototype.isIdType(this.id)){var a=this.collection?typeof this.collection.modelClass.prototype.idClass:"N/A";throw c("err")("Model id:"+String(this.id)+" is wrong type ("+typeof this.id+" vs expected "+a+")")}this._uiObservers=0;this.mirrorMask&&(this.mirror=new(d("WAWebBaseMirror").BaseMirror)(this))};f._refreshStaleModel=function(){if(!this._uiObservers&&this.stale)return;if(this.getCollection)this.getCollection().find(this.id);else throw c("err")("base_model:_refreshStaleModel getCollection does not exist")};f.incObservers=function(a){this._uiObservers++;if(a)return;c("WAWebNetworkStatus").online&&this.stale&&(d("WAWebCmd").Cmd.uiBusy?this.listenToOnce(d("WAWebCmd").Cmd,"ui_idle",this._refreshStaleModel):this._refreshStaleModel())};f.decObservers=function(){this._uiObservers>0&&this._uiObservers--,this._uiObservers===0&&this.stopListening(d("WAWebCmd").Cmd,"ui_idle",this._refreshStaleModel)};f.hasObservers=function(){return this._uiObservers>0};f.getObservers_TEST_ONLY=function(){return null};f.addChild=function(a,b){var c={};c[a]=b;this.set(c,{silent:!0});this.listenTo(b,"all",this._getCachedEventBubblingHandler(a))};f.get=function(a){return this[a]};f.set=function(a,e,f){!c("gkx")("26258")&&(b("cr:5292")==null?void 0:b("cr:5292").currentTransaction)&&d("WALogger").WARN(n(),this.constructor.name);f=f;if(typeof a==="string")return this._set(a,e,f);f=e;return((e=f)==null?void 0:e.merge)?this._set(r(a),f):this._set(a,f)};f._markChange=function(a,b){if(!this.__initialized)return;this._getChanges().push({key:a,oldValue:b});this.__fired&&(this.__fired[a]=!1)};f._set=function(a,b,e){var f,g=this;this.revisionNumber++;var h=!!this.__changes;f=d("WATypeUtils").isString(a)?[(f={},f[a]=b,f),e]:[a,b];var i=f[0],j=f[1],k=new Set();Object.keys(i).forEach(function(a){a=g._setKV(a,i[a],j);a==null?void 0:a.forEach(function(a){k.add(a)})});k.size>0&&(function(){var a=c("WANullthrows")(g._topo,"_topo unexpectedly undefined"),b=c("WANullthrows")(g._topoIndexMap),d=function(d){var e=a[d];if(!k.has(e))return"continue";e=g._setD(e);e==null?void 0:e.forEach(function(a){var e=c("WANullthrows")(b.get(a));if(e<d)throw c("err")("Circular derived properties / event listeners");k.add(a)})};for(var e=0;e<a.length;e++){var f=d(e);if(f==="continue")continue}})();e=j==null?void 0:j.silent;if(!e&&this.hasUnfiredChanges()){a=this.__fired={};b=this._getChanges();f=b.length>0;while(b.length){e=b.shift();var l=e.key;e=e.oldValue;if(!a[l]){a[l]=!0;var m=this._definition[l].evt;if(this.isListening(m)||this.isListening("all")){l=this[l];this.trigger(m,this,l,e)}}}(f&&this.isListening("change")||this.isListening("all"))&&this.trigger("change",this)}h||(this.__changes&&(this.__changes=null),this.__fired&&(this.__fired=null));return this};f._setKV=function(a,b,e){if(this._collections[a]){this[a].set(b,e);return}e=this._definition[a];if(!e){this[a]=b;return}else if(e.attr===d("WAWebModelUtils").Attr.DERIVED)throw c("err")("Attempting to directly set derived property: "+a);e=e.sk;var f=this[a];if(b===f)return;this[e]=b;this._markChange(a,f);return(e=this._deps)==null?void 0:e[a]};f._setD=function(a){var b=this._definition[a],c=b.sk;b=b.fn.call(this);var d=this[c];if(b===d)return;this[c]=b;this._markChange(a,d);return(c=this._deps)==null?void 0:c[a]};f.hasUnfiredChanges=function(){var a=this.__fired,b=this.__changes;if(!b)return!1;if(!a)return!0;for(var c=0;c<b.length;c++)if(!a[b[c].key])return!0;return!1};f._getChanges=function(){return this.__changes||(this.__changes=[])};f._initDeriveds=function(){var a=this;this.__derived.forEach(function(b){a[a._definition[b].sk]=d("WAWebModelUtils").INIT})};f._initCollections=function(){var a=this;Object.entries(this._collections).forEach(function(b){var c=b[0];b=b[1];a[c]=new b(null,{parent:a})})};f.unset=function(a,b){a=Array.isArray(a)?a:[a];var c={};for(a of a)c[a]=void 0;this.set(c,b)};f.clear=function(){this.unset([].concat(this.__props,this.__session))};f["delete"]=function(){this.stopListening()};f.reset=function(){this.set(this.__defaults)};f.toJSON=function(){return this.serialize()};f.serialize=function(){var a=this,b={};for(var c=0;c<this.__props.length;c++)b[this.__props[c]]=this[this.__props[c]];Object.keys(this._collections).forEach(function(c){b[c]=a[c].serialize()});return b};f.getDefault=function(a){a=this._definition[a];if(!a)return void 0;a=a.defaultValue;return d("WATypeUtils").isFunction(a)?a():a};f._getCachedEventBubblingHandler=function(a){return function(b,c,d){o.test(b)?this.trigger("change:"+a+"."+b.split(":")[1],c,d):b==="change"&&this.trigger("change",this)}.bind(this)};a.isIdType=function(a){if(this.allowedIds&&this.allowedIds.includes(a))return!0;return this.idClass?a instanceof this.idClass:typeof a==="string"};f.pp=function(){var a=this;if(!c("gkx")("26258")){var b="#cc3333",e="#33cc33",f="#3333cc";this.__props.length&&d("WALogger").LOG(m()).color(b);this.__props.forEach(function(c){var e=a[c];d("WALogger").LOG(l(),c).color(b).devConsole(e)});this.__session.length&&d("WALogger").LOG(k()).color(e);this.__session.forEach(function(b){var c=a[b];d("WALogger").LOG(j(),b).color(e).devConsole(c)});this.__derived.length&&d("WALogger").LOG(i()).color(f);this.__derived.forEach(function(b){var c=a[b];d("WALogger").LOG(h(),b).color(f).devConsole(c)})}};return a}(c("WAWebEventEmitter"));function e(a){var b=d("WAWebModelUtils").convert(a),c=d("WAWebModelUtils").stateExtend(p,b);if(a.Proxy){var e=d("WAWebBaseMirror").genMirrorMask(b);c.prototype.mirrorMask=e;c.prototype.proxyName=a.Proxy;d("WAWebProxyStateFactory").ProxyStateFactory(a.Proxy,b,e)}return c}function q(a){for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0}function r(a){var b=Object.keys(a),c=b.length,d={};for(var e=0;e<c;e++){var f=b[e];a[f]!==void 0&&(d[f]=a[f])}return d}g.prop=(f=d("WAWebModelUtils")).prop;g.session=f.session;g.derived=f.derived;g.getter=f.getter;g.collection=f.collection;g.idTypeToString=a;g.BaseModel=p;g.defineModel=e}),98); __d("WAWebWamMsgUtils",["WAWebApiParse","WAWebBotTypes","WAWebHandleMsgCommon","WAWebInteractiveMessageType","WAWebMsgGetters","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumBotType","WAWebWamEnumE2eDeviceType","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){if(d("WAWebMsgGetters").getIsStatus(a))return d("WAWebWamEnumMessageType").MESSAGE_TYPE.STATUS;else if(d("WAWebMsgGetters").getIsGroupMsg(a))return d("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP;else if(c("WAWebWid").isBroadcast(a.id.remote)||d("WAWebMsgGetters").getBroadcastId(a)!=null)return d("WAWebWamEnumMessageType").MESSAGE_TYPE.BROADCAST;else if(c("WAWebWid").isNewsletter(a.id.remote))return d("WAWebWamEnumMessageType").MESSAGE_TYPE.CHANNEL;return d("WAWebWamEnumMessageType").MESSAGE_TYPE.INDIVIDUAL}function b(a){switch(a){case"chat":return d("WAWebWamEnumMessageType").MESSAGE_TYPE.INDIVIDUAL;case"group":return d("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP;case"peer_broadcast":case"other_broadcast":return d("WAWebWamEnumMessageType").MESSAGE_TYPE.BROADCAST;case"direct_peer_status":case"other_status":return d("WAWebWamEnumMessageType").MESSAGE_TYPE.STATUS}}function e(a){if(a.isDynamicReplyButtonsMsg===!0)return d("WAWebWamEnumMediaType").MEDIA_TYPE.BUTTON_MESSAGE;switch(a.type){case"image":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PHOTO;case"video":return a.isGif===!0?d("WAWebWamEnumMediaType").MEDIA_TYPE.GIF:d("WAWebWamEnumMediaType").MEDIA_TYPE.VIDEO;case"ptv":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PUSH_TO_VIDEO;case"audio":return d("WAWebWamEnumMediaType").MEDIA_TYPE.AUDIO;case"ptt":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PTT;case"document":return d("WAWebWamEnumMediaType").MEDIA_TYPE.DOCUMENT;case"unknown":return d("WAWebWamEnumMediaType").MEDIA_TYPE.FUTURE;case"location":return a.isLive===!0?d("WAWebWamEnumMediaType").MEDIA_TYPE.LIVE_LOCATION:d("WAWebWamEnumMediaType").MEDIA_TYPE.LOCATION;case"vcard":return d("WAWebWamEnumMediaType").MEDIA_TYPE.CONTACT;case"multi_vcard":return d("WAWebWamEnumMediaType").MEDIA_TYPE.CONTACT_ARRAY;case"chat":if(a.matchedText!=null){if(d("WAWebApiParse").matchCatalogUrl(a.matchedText))return d("WAWebWamEnumMediaType").MEDIA_TYPE.CATALOG_LINK;else if(d("WAWebApiParse").matchProductUrl(a.matchedText))return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_LINK;return d("WAWebWamEnumMediaType").MEDIA_TYPE.URL}return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"sticker":return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER;case"product":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_IMAGE;case"list":var b;b=(b=(b=a.list)==null?void 0:b.listType)!=null?b:d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.UNKNOWN;switch(b){case d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.SINGLE_SELECT:return d("WAWebWamEnumMediaType").MEDIA_TYPE.LIST;case d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_LIST;default:return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE}case"list_response":return d("WAWebWamEnumMediaType").MEDIA_TYPE.LIST_REPLY;case"buttons_response":return d("WAWebWamEnumMediaType").MEDIA_TYPE.BUTTON_RESPONSE_MESSAGE;case"order":return d("WAWebWamEnumMediaType").MEDIA_TYPE.ORDER;case"interactive":return h(a.interactiveType);case"reaction":case"reaction_enc":return d("WAWebWamEnumMediaType").MEDIA_TYPE.REACTION;case"poll_creation":return d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_CREATE;case"poll_result_snapshot":return d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_RESULT_SNAPSHOT;case"poll_update":return a.subtype==="poll_vote"?d("WAWebWamEnumMediaType").MEDIA_TYPE.POLL_VOTE:d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"keep_in_chat":return a.keepType===d("WAWebProtobufsE2E.pb").KeepType.KEEP_FOR_ALL?d("WAWebWamEnumMediaType").MEDIA_TYPE.KEEP:d("WAWebWamEnumMediaType").MEDIA_TYPE.UNKEEP;case"pin_message":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PIN_IN_CHAT;case"protocol":return a.subtype==="ephemeral_sync_response"?d("WAWebWamEnumMediaType").MEDIA_TYPE.EPHEMERAL_SYNC_RESPONSE:d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"event_creation":return d("WAWebWamEnumMediaType").MEDIA_TYPE.EVENT_CREATE;case"event_response":return d("WAWebWamEnumMediaType").MEDIA_TYPE.EVENT_RESPOND;case"album":return d("WAWebWamEnumMediaType").MEDIA_TYPE.MEDIA_ALBUM;case"sticker-pack":return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER_PACK;default:a.type;return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE}}function h(a){if(a==null)return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;switch(a){case c("WAWebInteractiveMessageType").SHOPS_STOREFRONT:return d("WAWebWamEnumMediaType").MEDIA_TYPE.SHOP_STOREFRONT;case c("WAWebInteractiveMessageType").NATIVE_FLOW:return d("WAWebWamEnumMediaType").MEDIA_TYPE.INTERACTIVE_NFM;case c("WAWebInteractiveMessageType").CAROUSEL:return d("WAWebWamEnumMediaType").MEDIA_TYPE.INTERACTIVE_CAROUSEL}}function f(a){if(!(a instanceof c("WAWebWid")))return null;return d("WAWebUserPrefsMeUser").isMeAccount(a)?a.isCompanion()?d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE.MY_COMPANION:d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE.MY_PRIMARY:a.isCompanion()?d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE.OTHER_COMPANION:d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE.OTHER_PRIMARY}function i(a){if(a.id.remote.isBot())return d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.DIRECT_CHAT;var b=d("WAWebMsgGetters").getIsBotQuery(a);a=d("WAWebMsgGetters").getIsMetaBotResponse(a);return b||a?d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.INVOKED:null}function j(a,b,c){if(a==null?void 0:a.isBot())return d("WAWebWamEnumBotType").BOT_TYPE.METABOT;if(b){if(b===d("WAWebBotTypes").BizBotType.BIZ_1P)return d("WAWebWamEnumBotType").BOT_TYPE.BOT_1P_BIZ;if(b===d("WAWebBotTypes").BizBotType.BIZ_3P)return d("WAWebWamEnumBotType").BOT_TYPE.BOT_3P_BIZ}if(c){if(c===d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P)return d("WAWebWamEnumBotType").BOT_TYPE.BOT_1P_BIZ;if(c===d("WAWebBotTypes").BizBotAutomatedType.FULL_3P)return d("WAWebWamEnumBotType").BOT_TYPE.BOT_3P_BIZ}return d("WAWebWamEnumBotType").BOT_TYPE.UNKNOWN}function k(a){if(a==null||a==="")return null;switch(a){case d("WAWebHandleMsgCommon").CATEGORY_PEER:return d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE.PEER;default:return null}}g.getWamMessageType=a;g.getMessageTypeFromMsgInfoType=b;g.getWamMediaType=e;g.getInteractiveWamType=h;g.getWamE2eSenderType=f;g.getWamAgentEngagementType=i;g.getWamBotType=j;g.getWamInvisibleMessageCatgoryType=k}),98); __d("WAWebOrderPaymentStatus",["$InternalEnum","WAWebE2EProtoUtils","WAWebInteractiveMessageType","WAWebMsgType"],(function(a,b,c,d,e,f,g){var h=-1e3;e=(a=b("$InternalEnum"))({Pending:"pending",Captured:"captured"});f=a({Confirm:"confirm",PaymentInstruction:"payment_instruction"});b=a({CPI:"cpi",PIX:"pix",NATIVE:"native",PAYMENT_LINK:"payment_link",BOLETO:"boleto"});a=a({P2M_LITE:"p2m_lite",P2M_PRO:"p2m_pro",P2M_BASIC:"p2m_basic"});var i=function(a){var b={};try{b=JSON.parse(a)}catch(a){return null}if(b==null)return null;a=b;b=a.reference_id;var c=a.payment_method;a=a.payment_status;return b==null||a==null&&c==null?null:{refId:b,paymentMethod:c,paymentStatus:a}},j=function(a){var b;if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&d("WAWebE2EProtoUtils").isOrderNativeFlow(a.nativeFlowName)&&((b=a.interactivePayload)==null?void 0:b.buttons)){b=a.interactivePayload;a=b.buttons[0].buttonParamsJson;if(a!=null)return i(a)}return null},k=function(a){var b;return a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&d("WAWebE2EProtoUtils").isOrderNativeFlow(a.nativeFlowName)&&((b=a.interactivePayload)==null?void 0:b.buttons)?a.interactivePayload.buttons[0]:null},l=function(a){a=k(a);if(a==null)return null;var b=a.name;a=a.buttonParamsJson;return b!=null&&a!=null?i(a):null},m=function(a,b){a=a.msgs.getModelsArray().slice(h);var e=null;a=a.findLast(function(a){if(a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&a.subtype==="phone_only_feature"&&a.quotedMsg!=null){var f;e=j(a.quotedMsg);if(((f=e)==null?void 0:f.refId)===b)return!0}else if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&d("WAWebE2EProtoUtils").isOrderNativeFlow(a.nativeFlowName)){e=l(a);if(((f=e)==null?void 0:f.refId)===b)return!0}return!1});return a!=null&&e!=null?e:null};g.OrderPaymentStatus=e;g.OrderPaymentMethod=f;g.OrderAcceptedPaymentMethods=b;g.OrderP2MType=a;g.paramsJsonToOrderPaymentInfo=i;g.getOrderPaymentStatusInfo=j;g.getOrderPaymentStatusInfoFromNativeFlow=l;g.findLastOrderPaymentStatusInfo=m}),98); __d("WAWebOrderStatus",["$InternalEnum","WAWebBizGatingUtils","WAWebE2EProtoUtils","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebOrderDetails"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({Pending:"pending",Processing:"processing",PartiallyShipped:"partially_shipped",Shipped:"shipped",Complete:"completed",Canceled:"canceled",PaymentRequested:"payment_requested",PreparingToShip:"preparing_to_ship",Delivered:"delivered"}),i=function(a){if(a==null)return null;try{a=JSON.parse(a);var b=a.order;a=a.reference_id;b=h.cast(b==null?void 0:b.status);return b==null||a==null?null:{refId:a,status:b}}catch(a){return null}},j=function(a){var b;if(!d("WAWebE2EProtoUtils").isOrderNativeFlow(a.nativeFlowName))return null;if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&((b=a.interactivePayload)==null?void 0:b.buttons)){b=a.interactivePayload.buttons[0].buttonParamsJson;return i(b)}else if(a.type===d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW){a=((b=a.nativeFlowButtons)!=null?b:[])[0].nativeFlowInfo;return i(a==null?void 0:a.paramsJson)}};a=function(a,b){a=a.msgs.getModelsArray().slice(-1e3);a=(a=a.findLast(function(a){return[c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS,c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO].includes(a.nativeFlowName)&&((a=d("WAWebOrderDetails").getOrderInfo(a))==null?void 0:a.referenceId)===b}))==null?void 0:a.safe();return a};var k=function(a,b){a=a.msgs.getModelsArray().slice(-1e3);a=(a=a.findLast(function(a){return d("WAWebE2EProtoUtils").isOrderNativeFlow(a.nativeFlowName)&&((a=j(a))==null?void 0:a.refId)===b}))==null?void 0:a.safe();return a},l=function(){return d("WAWebBizGatingUtils").isOrderStatusM1Enabled()?h.PaymentRequested:h.Pending};e=function(a,b){a=k(a,b);b=a!=null?j(a):null;return(a=b==null?void 0:b.status)!=null?a:l()};g.OrderStatus=h;g.paramsJsonToOrderStatusInfo=i;g.getOrderStatusInfo=j;g.findOrderDetailsMessage=a;g.getDefaultOrderStatus=l;g.findOrderStatus=e}),98); __d("WAWebEventsWaitForBbEvent",["Promise","WAAbortError"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e,f){e===void 0&&(e=function(){return!0});return(f==null?void 0:f.aborted)?(h||(h=b("Promise"))).reject(new(d("WAAbortError").AbortError)()):new(h||(h=b("Promise")))(function(b,g){var h=function(){if(!e.apply(this,arguments))return;j==null?void 0:j();b(arguments)},i=function(){j==null?void 0:j(),g(new(d("WAAbortError").AbortError)())},j=function(){a.off(c,h),f==null?void 0:f.removeEventListener("abort",i),j=null};f==null?void 0:f.addEventListener("abort",i);a.on(c,h)})}g["default"]=a}),98); __d("WAWebEventsWaitForMainStreamReadyMd",["Promise","WAWebCmd","WAWebEventsWaitForBbEvent"],(function(a,b,c,d,e,f,g){var h;function a(){return d("WAWebCmd").Cmd.isMainStreamReadyMd?(h||(h=b("Promise"))).resolve():c("WAWebEventsWaitForBbEvent")(d("WAWebCmd").Cmd,"main_stream_mode_ready")}g["default"]=a}),98); __d("WAWebEventsWaitForOfflineDeliveryEnd",["WACustomError","WALogger","WAPromiseTimeout","WAWebCmd","WAWebEventsWaitForBbEvent","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume] offline delievery promise not resolved within 5 mins"]);h=function(){return a};return a}var i,j=5*60*1e3;function a(){if(i)return;i=c("WAWebEventsWaitForBbEvent")(d("WAWebCmd").Cmd,"offline_delivery_end");d("WAWebCmd").Cmd.on("offline_delivery_state_reset",function(){i=c("WAWebEventsWaitForBbEvent")(d("WAWebCmd").Cmd,"offline_delivery_end")})}function e(){return d("WAWebCmd").Cmd.isOfflineDeliveryEnd}function f(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebCmd").Cmd.isOfflineDeliveryEnd)return;if(!i)throw c("err")("waitForOfflineDeliveryEnd called before init");try{yield d("WAPromiseTimeout").promiseTimeout(i,j)}catch(a){if(a instanceof d("WACustomError").TimeoutError)d("WALogger").ERROR(h()).sendLogs("offline-resume-promise-unresolved");else throw a}yield i});return k.apply(this,arguments)}g.initWaitForOfflineDeliveryEnd=a;g.isOfflineDeliveryEnd=e;g.waitForOfflineDeliveryEnd=f}),98); __d("WAWebEventsWaitForReadyForOffline",["Promise","WAWebCmd","WAWebEventsWaitForBbEvent","err"],(function(a,b,c,d,e,f,g){var h,i;function a(){if(i)return;i=c("WAWebEventsWaitForBbEvent")(d("WAWebCmd").Cmd,"offline_process_ready")}function e(){return!i?(h||(h=b("Promise"))).reject(c("err")("waitForOfflineProcessReady called before init")):i}g.initWaitForOfflineProcessReady=a;g.waitForOfflineProcessReady=e}),98); __d("WASignalAggregator",["err"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(){var a=this;this.$1=!1;this.$2=new AbortController();this.$3=new Set();this.signal=this.$2.signal;this.$5=function(b){a["delete"](b.currentTarget),a.$6()}}var b=a.prototype;b.add=function(){this.$4();for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];for(var d of b)d.aborted||(d.addEventListener("abort",this.$5),this.$3.add(d));this.$6()};b.$6=function(){if(this.$1)return;var a=Array.from(this.$3).every(function(a){return a.aborted});if(!a)return;this.dispose();this.$2.abort()};b["delete"]=function(){this.$4(),this.$7.apply(this,arguments)};b.$7=function(){var a=!1;for(var b=arguments.length,c=new Array(b),d=0;d<b;d++)c[d]=arguments[d];for(var e of c)this.$3["delete"](e)&&(a=!0,e.removeEventListener("abort",this.$5));a&&this.$6()};b.$4=function(){if(this.$1)throw c("err")("Attempt to modify disposed SignalAggregator")};b.dispose=function(){if(this.$1)return;this.$1=!0;for(var a of this.$3)this.$7(a)};b.getSignals__INTERNAL=function(){return this.$3};return a}();g["default"]=a}),98); __d("WAMemoizeConcurrent",["Promise","WAAbortError","WAPromiseRaceAbort","WASignalAggregator"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,e){var f=new Map();return function(g){var i;if(g==null?void 0:(i=g.signal)==null?void 0:i.aborted)return(h||(h=b("Promise"))).reject(new(d("WAAbortError").AbortError)());var j=a.call(this,g);i=f.get(j);if(i==null||i.aggregator.signal.aborted){var k=new(c("WASignalAggregator"))(),l=babelHelpers["extends"]({},g,{signal:k.signal});i={aggregator:k,promise:e.call(this,l)["finally"](function(){k.dispose(),f["delete"](j)})};f.set(j,i)}l=(g==null?void 0:g.signal)||new AbortController().signal;i.aggregator.add(l);return c("WAPromiseRaceAbort")(i.promise,l)}}g["default"]=a}),98); __d("WAWebNetworkGetResponseIfOnline",["WAWebXHR"],(function(a,b,c,d,e,f,g){function a(a,b,d,e,f){b===void 0&&(b="GET");return c("WAWebXHR").request(a,b,d,f,e).then(function(a){return a.status&&a.status<12e3?a:null})["catch"](function(){return null})}g["default"]=a}),98); __d("WAWebNetworkStatus",["Promise","WALogger","WAMemoizeConcurrent","WAWebBaseModel","WAWebBuildConstants","WAWebMiscBrowserUtils","WAWebNetworkGetResponseIfOnline","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] NetworkStatus ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["NetworkStatus:checkOnline errored! ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["NetworkStatus:checkOnline response ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["NetworkStatus:checkOnline simulating offline behavior"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["NetworkStatus:checkOnline checking"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["waitIfOffline: Continuing..."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["waitIfOffline: Waiting..."]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["waitIfOffline: XHR online is false, but navigator.onLine is true, resolving promise"]);p=function(){return a};return a}var q=d("WAWebBuildConstants").DYN_ORIGIN+"status.json",r=!1;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,i=new Array(g),s=0;s<g;s++)i[s]=arguments[s];return(e=f=a.call.apply(a,[this].concat(i))||this,f.online=d("WAWebBaseModel").session(!0),f.simulatedOfflineConditions=d("WAWebBaseModel").session(!1),f.waitIfOffline=c("WAMemoizeConcurrent")(function(){return"all"},b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;if(this.online)return;if(c("WAWebMiscBrowserUtils").info().name!=="Firefox"&&navigator.onLine){d("WALogger").LOG(p());return}d("WALogger").LOG(o());yield new(h||(h=b("Promise")))(function(b){a.listenToOnce(a,"change:online",function(){d("WALogger").LOG(n()),b()})})})),f.checkOnline=c("WAMemoizeConcurrent")(function(){return"all"},b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(m());if((r||c("gkx")("26256"))&&this.simulatedOfflineConditions){d("WALogger").LOG(l());return}try{var a=(yield c("WAWebNetworkGetResponseIfOnline")(q,"GET",null,void 0));this.online=!!a;d("WALogger").LOG(k(),String(this.online))}catch(a){d("WALogger").WARN(j(),String(a)).devConsole(a)}})),e)||babelHelpers.assertThisInitialized(f)}var f=e.prototype;f.initialize=function(){this.listenTo(this,"change:online",this.$NetworkStatus$p_1),this.$NetworkStatus$p_1()};f.$NetworkStatus$p_1=function(){var a=this.online;d("WALogger").LOG(i(),a?"online":"offline").tags("comms")};f.simulateNetworkStatus=function(a){(r||c("gkx")("26256"))&&(this.online=a,this.simulatedOfflineConditions=!a)};return e}(d("WAWebBaseModel").BaseModel);e=d("WAWebBaseModel").defineModel(a);f=new e();g["default"]=f}),98); __d("WAWebPairList",["lodash"],(function(a,b,c,d,e,f,g){function a(a){return c("lodash").flatten(a.map(function(a){return[a[0],a[1]]}))}function b(a){if(a.length%2!==0)throw new RangeError("Flattened pairs come in 2, invalid list size to unflatten!");var b=[];for(var c=0;c<a.length;c++)b.push([a[c],a[++c]]);return b}g.flattenPairList=a;g.unFlattenPairList=b}),98); __d("WAWebProfilePicConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Remove","Set"]);c="pps.whatsapp.net";f.ProfilePicCommand=a;f.DEFAULT_HOSTNAME=c}),66); __d("WAWebGroupSystemMsg",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebApiParticipantStore","WAWebCommunityGatingUtils","WAWebContactSystemMsg","WAWebDBCommunity","WAWebDBGroupsGroupMetadata","WAWebGroupType","WAWebGroupsParticipantsApi","WAWebLimitSharingModelUtils","WAWebMsgKey","WAWebMsgType","WAWebPairList","WAWebProfilePicConstants","WAWebRequestMethodType","WAWebSchemaGroupMetadata","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["genIntegrityDelteteParentNotificationMsgs: missing parentGroupMetadata"]);i=function(){return a};return a}function j(a,b){var e,f=a.chatId;e=(e=(e=b.owner)!=null?e:a.author)!=null?e:d("WAWebUserPrefsMeUser").getMaybeMeUser();var g=b.participants.some(function(a){var b=a.isAdmin;a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)&&b}),h=f,i=!1,j=b.subject,k,l;if(b.defaultSubgroup===!0){var m;k="community_create";b.parentGroup&&(l=[b.parentGroup,b.subject]);e=(m=b.owner)!=null?m:a.author}else if(b.generalSubgroup===!0&&g&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()){k="general_chat_add";l=["created",b.subject];e=(m=b.owner)!=null?m:a.author}else{e=(g=b.owner)!=null?g:a.author;m=b.membershipApprovalMode===!0?"true":"false";g=b.hiddenSubgroup===!0?"true":"false";b.parentGroup&&b.participants.length===1?(l=[b.parentGroup,b.parentGroupSubject,b.subject,m,g],k="empty_subgroup_create"):k="create"}return{id:new(c("WAWebMsgKey"))({remote:h,fromMe:i,participant:e,id:C(a,k)}),author:e,body:j,from:f,recipients:[],subtype:k,t:(m=b.creation)!=null?m:a.ts,type:"gp2",kind:d("WAWebMsgType").MsgKind.Gp2,templateParams:l}}function a(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){var g=c.participants.find(function(a){var b=a.isAdmin;a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)&&b});return(yield (h||(h=b("Promise"))).all([i(),k(),l(),m(),q()])).flat();function i(){return!e&&!g&&c.defaultSubgroup===!0&&c.incognito===!0?[d("WAWebContactSystemMsg").genNotificationMsg(c.id,{type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"cag_masked_thread_created",templateParams:[]})]:[]}function k(){return e?[]:[j(a,c)]}function l(){var b=c.ephemeralDuration;return a.author&&a.ts!=null&&b!=null&&b>0?[p(a.chatId,a.ts,a.author,b)]:[]}function m(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return f==null?[]:[yield n(a,f)]});return o.apply(this,arguments)}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(c.limitSharingEnabled===!0){var b=(yield d("WAWebLimitSharingModelUtils").genLimitSharingSystemMessageOnPersistedChat({chatWID:a.chatId,sharingLimited:c.limitSharingEnabled}));if(b)return[b]}return[]});return r.apply(this,arguments)}});return k.apply(this,arguments)}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a.parentGroupId;if(!a)return!1;a=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(a));return!a||a!=null&&(yield d("WAWebDBCommunity").getJoinedSubgroups(d("WAWebWidFactory").createWid(a.id))).length<=b?!0:!1});return m.apply(this,arguments)}function n(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=a.chatId,g=a.isAdmin;g=g===void 0?!1:g;var h=a.author&&d("WAWebWidFactory").toUserWid(a.author)||void 0,i=f,j=!1,k=null,m=[],n=h,o=b.actionType,p=null,q,r=b.parentGroupId;switch(b.actionType){case d("WAWebGroupType").GROUP_ACTIONS.SUBJECT:k=b.subject;break;case d("WAWebGroupType").GROUP_ACTIONS.MODIFY:m=b.participants.map(function(a){a=a.id;return a});break;case d("WAWebGroupType").GROUP_ACTIONS.ADD:if(b.reason===d("WAWebGroupType").ADD_REASON.INVITE)if(r&&b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)}))if(b.generalSubgroup===!0&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()){var s;o="general_chat_add";p=["linked_group_join",(s=b.groupName)!=null?s:""]}else if(b.defaultSubgroup===!0){o="community_invite_rich";p=[r,(s=b.groupName)!=null?s:""]}else{o="sub_group_invite_rich";s=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(r));p=[r,(s=s==null?void 0:s.subject)!=null?s:""]}else o="invite";else if(b.reason===d("WAWebGroupType").ADD_REASON.LINKED_GROUP_JOIN)if(b.generalSubgroup===!0&&r!=null&&b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()){o="general_chat_add";p=["linked_group_join",(s=b.groupName)!=null?s:""]}else o="linked_group_join";else if(b.reason===d("WAWebGroupType").ADD_REASON.AUTO_ADD)if(r){p=[r,(s=b.groupName)!=null?s:"",(s=b.contextGroupId)!=null?s:""];o="subgroup_admin_triggered_auto_add"}else{o="auto_add";if(yield l(b,2)){p=[b.parentGroupId,(s=b.groupName)!=null?s:""]}}else if(b.reason===d("WAWebGroupType").ADD_REASON.DEFAULT_SUBGROUP_ADMIN_ADD)if(r){o="community_participant_add_rich";p=[r,(s=b.groupName)!=null?s:""]}else{o="default_sub_group_admin_add";if(yield l(b,1)){p=[b.parentGroupId,(s=b.groupName)!=null?s:""]}}else if(b.reason===d("WAWebGroupType").ADD_REASON.DEFAULT_SUBGROUP_PROMOTE)o="default_sub_group_promote";else if(b.reason===d("WAWebGroupType").ADD_REASON.INVITE_AUTO_ADD)if(r&&Boolean(b.defaultSubgroup)&&b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})){p=[r,(s=b.groupName)!=null?s:"",(s=b.contextGroupId)!=null?s:""];o="subgroup_admin_triggered_invite_auto_add"}else o="invite_auto_add",b.contextGroupId&&(p=[b.contextGroupId,""],(yield l(b,2))?p.push("false"):p.push("true"));else if(b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&b.reason===d("WAWebGroupType").ADD_REASON.GENERAL_CHAT_AUTO_ADD&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()){o="general_chat_add";p=["general_chat_auto_add",(s=b.groupName)!=null?s:""]}else if(b.reason==null&&r&&b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})&&b.generalSubgroup===!0&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()){o="general_chat_add";p=["",(s=b.groupName)!=null?s:""]}else if(r&&b.participants.some(function(a){a=a.id;return d("WAWebUserPrefsMeUser").isMeAccount(a)})){s=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(r));p=[r,(r=s==null?void 0:s.subject)!=null?r:""];o=b.defaultSubgroup===!0?"community_participant_add_rich":"sub_group_participant_add_rich"}case d("WAWebGroupType").GROUP_ACTIONS.PROMOTE:case d("WAWebGroupType").GROUP_ACTIONS.DEMOTE:case d("WAWebGroupType").GROUP_ACTIONS.REMOVE:case d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_PROMOTE:case d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_DEMOTE:if(b.actionType===d("WAWebGroupType").GROUP_ACTIONS.REMOVE&&b.reason===d("WAWebGroupType").REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){o="default_sub_group_demote";break}m=b.participants.map(function(a){a=a.id;return a});m.length===1&&(n=m[0]);b.actionType===d("WAWebGroupType").GROUP_ACTIONS.REMOVE&&m.length===1&&h===n&&(o="leave");break;case d("WAWebGroupType").GROUP_ACTIONS.INVITE_CODE:o="revoke_invite";break;case d("WAWebGroupType").GROUP_ACTIONS.DESC_ADD:o=b.isParentGroup===!0?"parent_group_description":"description";k=b.desc;break;case d("WAWebGroupType").GROUP_ACTIONS.DESC_REMOVE:o=b.isParentGroup===!0?"parent_group_description":"description";break;case d("WAWebGroupType").GROUP_ACTIONS.RESTRICT:p=[b.value?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off];k=p[0];b.threshold!=null&&p.push(b.threshold);break;case d("WAWebGroupType").GROUP_ACTIONS.ANNOUNCE:case d("WAWebGroupType").GROUP_ACTIONS.NO_FORWARD:p=[b.value?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off];k=p[0];break;case d("WAWebGroupType").GROUP_ACTIONS.EPHEMERAL:h&&(p=[""+b.duration,h]);break;case d("WAWebGroupType").GROUP_ACTIONS.GROWTH_LOCKED:p=[b.type];k=p[0];break;case d("WAWebGroupType").GROUP_ACTIONS.SUB_GROUP_LINK:case d("WAWebGroupType").GROUP_ACTIONS.SIBLING_GROUP_LINK:case d("WAWebGroupType").GROUP_ACTIONS.SUB_GROUP_UNLINK:case d("WAWebGroupType").GROUP_ACTIONS.PARENT_GROUP_UNLINK:case d("WAWebGroupType").GROUP_ACTIONS.SIBLING_GROUP_UNLINK:case d("WAWebGroupType").GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK:case d("WAWebGroupType").GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK:p=d("WAWebPairList").flattenPairList(b.groupDatas.map(function(a){return[a.id,a.subject]}));break;case d("WAWebGroupType").GROUP_ACTIONS.PARENT_GROUP_LINK:p=d("WAWebPairList").flattenPairList(b.groupDatas.map(function(a){return[a.id,a.subject]}));o="community_link_parent_group_rich";q="parentGroupLink";break;case d("WAWebGroupType").GROUP_ACTIONS.DELETE_PARENT_GROUP:p=[b.communityTitle];break;case d("WAWebGroupType").GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE:p=[b.value?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off,g?d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin:d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Regular];b.triggered==="server"&&(h=void 0);break;case d("WAWebGroupType").GROUP_ACTIONS.MEMBER_ADD_MODE:if(!d("WAWebABProps").getABPropConfigValue("web_anyone_can_add_group_setting_enabled"))break;s=b.memberAddMode;s!=null&&(p=[s===d("WAWebSchemaGroupMetadata").MemberAddMode.ALL_MEMBER_ADD?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off]);break;case d("WAWebGroupType").GROUP_ACTIONS.CREATED_MEMBERSHIP_REQUESTS:r=b.requests;b.requestMethod===d("WAWebRequestMethodType").RequestMethod.NonAdminAdd&&h!=null&&r.length>0?(p=[h.toJid()].concat(r.map(function(a){return a.toJid()})),o="created_membership_requests"):o="membership_approval_request";break;case d("WAWebGroupType").GROUP_ACTIONS.ALLOW_ADMIN_REPORTS:p=[b.value?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off];g=(yield d("WAWebApiParticipantStore").isCurrentUserGroupAdmin(a.chatId.toString()));p.push(g?d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin:d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Regular);break;case d("WAWebGroupType").GROUP_ACTIONS.ALLOW_NON_ADMIN_SUB_GROUP_CREATION:p=[b.value?d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On:d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.Off];break;case d("WAWebGroupType").GROUP_ACTIONS.CREATED_SUBGROUP_SUGGESTION:o="created_subgroup_suggestion";p=[b.subject];break;case d("WAWebGroupType").GROUP_ACTIONS.GENERAL_CHAT_AUTO_ADD_DISABLED:o="general_chat_auto_add_disabled";p=[d("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.Full];break;case d("WAWebGroupType").GROUP_ACTIONS.COMMUNITY_OWNER_UPDATE:o="community_owner_update";p=[b.newOwner.toString()];m=[b.newOwner];break;case d("WAWebGroupType").GROUP_ACTIONS.HIDDEN_GROUP:o="hidden_group";break}return{id:new(c("WAWebMsgKey"))({remote:i,fromMe:j,participant:n,id:C(a,q)}),body:k?k:void 0,author:h,from:f,to:d("WAWebUserPrefsMeUser").getMeUser(),recipients:m.map(d("WAWebWidFactory").toUserWid)||[],subtype:o,t:(s=e)!=null?s:a.ts,type:"gp2",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.Gp2,templateParams:p?p:void 0}});return o.apply(this,arguments)}function e(a,b,e,f){var g=!1;return{type:"gp2",kind:d("WAWebMsgType").MsgKind.Gp2,subtype:"picture",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:e,author:f,body:b===d("WAWebProfilePicConstants").ProfilePicCommand.Set?"set":"remove",recipients:[],from:a,to:d("WAWebUserPrefsMeUser").getMeUser(),id:new(c("WAWebMsgKey"))({remote:a,fromMe:g,id:c("WAWebMsgKey").newId_DEPRECATED()})}}function p(a,b,e,f){return{id:new(c("WAWebMsgKey"))({remote:a,fromMe:!1,participant:e,id:c("WAWebMsgKey").newId_DEPRECATED()}),author:e,from:a,to:d("WAWebUserPrefsMeUser").getMeUser(),recipients:[],subtype:"ephemeral",t:b,type:"gp2",kind:d("WAWebMsgType").MsgKind.Gp2,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,templateParams:[""+f]}}function f(a,b){return{id:new(c("WAWebMsgKey"))({remote:a,fromMe:!1,id:c("WAWebMsgKey").newId_DEPRECATED()}),from:a,to:d("WAWebUserPrefsMeUser").getMeUser(),recipients:[],subtype:"initial_pHash_mismatch",t:b,type:"gp2",kind:d("WAWebMsgType").MsgKind.Gp2,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE}}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c,e=[],f=a.chatId,g=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(f));if(g==null||g.isParentGroup===!1)return e;var i=(yield d("WAWebDBCommunity").getDefaultSubgroup(f)),j=(c=g==null?void 0:g.subject)!=null?c:"",k=d("WATimeUtils").unixTime();i!=null&&(yield d("WAWebGroupsParticipantsApi").checkMyMembership(i))&&e.push(yield n({chatId:i,author:a.author,ts:k},{actionType:d("WAWebGroupType").GROUP_ACTIONS.DELETE_PARENT_GROUP,communityTitle:j}));yield (h||(h=b("Promise"))).all(((c=(yield d("WAWebDBCommunity").getJoinedSubgroups(d("WAWebWidFactory").createWid(g.id))))!=null?c:[]).filter(function(a){return!(i!=null&&i.equals(a))}).map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){e.push(yield n({chatId:b,author:a.author,ts:k},{actionType:d("WAWebGroupType").GROUP_ACTIONS.DELETE_PARENT_GROUP,communityTitle:j})),e.push(yield n({chatId:b,author:a.author,ts:k},{actionType:d("WAWebGroupType").GROUP_ACTIONS.PARENT_GROUP_UNLINK,groupDatas:[{id:f,subject:j}]}))});return function(a){return c.apply(this,arguments)}}()));return e});return r.apply(this,arguments)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=[],f=a.chatId,g=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(f));if(g==null){d("WALogger").ERROR(i());return[]}var j=(yield d("WAWebDBCommunity").getDefaultSubgroup(f));if(j!=null&&(yield d("WAWebGroupsParticipantsApi").checkMyMembership(j))){e.push(yield n({chatId:j,author:void 0,ts:d("WATimeUtils").unixTime()},{actionType:d("WAWebGroupType").GROUP_ACTIONS.DELETE,reason:d("WAWebGroupType").DELETE_REASON.INTEGRITY_DELETE_PARENT,groupDatas:[{id:f,subject:(c=g==null?void 0:g.subject)!=null?c:""}]}))}yield (h||(h=b("Promise"))).all(((a=(yield d("WAWebDBCommunity").getJoinedSubgroups(f)))!=null?a:[]).filter(function(a){return!(j!=null&&j.equals(a))}).map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return e.push(yield n({chatId:a,author:void 0,ts:d("WATimeUtils").unixTime()},{actionType:d("WAWebGroupType").GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK,groupDatas:[{id:f,subject:(a=g==null?void 0:g.subject)!=null?a:""}]}))});return function(b){return a.apply(this,arguments)}}()));return e});return t.apply(this,arguments)}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.chatId,e=(yield d("WAWebDBGroupsGroupMetadata").getGroupMetadata(c));if((e==null?void 0:e.isParentGroup)===!0){e=(yield d("WAWebDBCommunity").getDefaultSubgroup(c));if(e&&(b.actionType===d("WAWebGroupType").GROUP_ACTIONS.DESC_ADD||b.actionType===d("WAWebGroupType").GROUP_ACTIONS.DESC_REMOVE))return n(babelHelpers["extends"]({},a,{chatId:e}),babelHelpers["extends"]({},b,{isParentGroup:!0}))}return n(a,b)});return v.apply(this,arguments)}function w(a,b){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.chatId;c=(yield d("WAWebDBCommunity").getDefaultSubgroup(c));if(!c)return;var e=(yield d("WAWebGroupsParticipantsApi").getParticipants(c));e=Boolean(e==null?void 0:e.participants.find(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createWid(a))}));if(!e)return;return n(babelHelpers["extends"]({},a,{chatId:c}),b)});return x.apply(this,arguments)}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.chatId;c=(yield d("WAWebDBCommunity").getDefaultSubgroup(c));if(!(c&&b.actionType===d("WAWebGroupType").GROUP_ACTIONS.CREATED_SUBGROUP_SUGGESTION))return;return n(babelHelpers["extends"]({},a,{chatId:c}),b)});return z.apply(this,arguments)}function A(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.chatId;c=(yield d("WAWebDBCommunity").getDefaultSubgroup(c));if(!c)return;var e=(yield d("WAWebGroupsParticipantsApi").getParticipants(c));e=Boolean(e==null?void 0:e.participants.find(function(a){return d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createWid(a))}));if(!e)return;return n(babelHelpers["extends"]({},a,{chatId:c}),b)});return B.apply(this,arguments)}function C(a,b){var d;d=(d=a.externalId)!=null?d:c("WAWebMsgKey").newId_DEPRECATED();b!=null&&(d=""+d+b);return""+d+((b=a.ts)!=null?b:"")}g.genMsgsForGroupCreation=a;g.genGroupNotificationMsg=n;g.genGroupPicChangeNotificationMsg=e;g.genInitialPhashMismatchMsg=f;g.generateDeleteParentNotificationMessages=q;g.genIntegrityDeleteParentNotificationMsgs=s;g.genDescriptionNotificationMsg=u;g.genAllowNonAdminSubGroupCreationNotificationMsg=w;g.genCreatedSubgroupSuggestionNotificationMsg=y;g.genCommunityOwnerUpdateNotificationMsg=A}),98); __d("WAWebReportingTokenValidationFailureSenderWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDeviceType","WAWebWamEnumE2eDeviceType","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumReportingTokenValidationFailureReason"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ReportingTokenValidationFailureSender:[6094,{clientMessageId:[1,a.TYPES.STRING],e2eReceiverType:[2,d("WAWebWamEnumDeviceType").DEVICE_TYPE],e2eSenderType:[3,d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE],editType:[4,d("WAWebWamEnumEditType").EDIT_TYPE],isLid:[5,a.TYPES.BOOLEAN],isMessageMediaRetry:[14,a.TYPES.BOOLEAN],isMessageRetry:[6,a.TYPES.BOOLEAN],isSecretEncryptedMsg:[12,a.TYPES.BOOLEAN],messageIsForward:[15,a.TYPES.BOOLEAN],messageMediaType:[7,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[8,d("WAWebWamEnumMessageType").MESSAGE_TYPE],offline:[9,a.TYPES.BOOLEAN],reportingTokenValidationFailureReason:[10,d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON],reportingTokenVersion:[13,a.TYPES.INTEGER],senderJid:[11,a.TYPES.STRING]},[1,1,1],"private",113760892]},{ReportingTokenValidationFailureSender:[]});g.ReportingTokenValidationFailureSenderWamEvent=b}),98); __d("WAWebReportingTokenValidationFailureWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumReportingTokenValidationFailureReason"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ReportingTokenValidationFailure:[5466,{editType:[1,d("WAWebWamEnumEditType").EDIT_TYPE],isLid:[5,a.TYPES.BOOLEAN],isMessageMediaRetry:[10,a.TYPES.BOOLEAN],isMessageRetry:[6,a.TYPES.BOOLEAN],isSecretEncryptedMsg:[8,a.TYPES.BOOLEAN],messageIsForward:[11,a.TYPES.BOOLEAN],messageMediaType:[2,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[3,d("WAWebWamEnumMessageType").MESSAGE_TYPE],offline:[7,a.TYPES.BOOLEAN],reportingTokenValidationFailureReason:[4,d("WAWebWamEnumReportingTokenValidationFailureReason").REPORTING_TOKEN_VALIDATION_FAILURE_REASON],reportingTokenVersion:[9,a.TYPES.INTEGER]},[1,1,1],"regular"]},{ReportingTokenValidationFailure:[]});g.ReportingTokenValidationFailureWamEvent=b}),98); __d("WAWebWamReportingTokenMismatchReporter",["WAWebMsgGetters","WAWebMsgKeyUtils","WAWebReportingTokenValidationFailureSenderWamEvent","WAWebReportingTokenValidationFailureWamEvent","WAWebWamEnumDeviceType","WAWebWamMsgUtils"],(function(a,b,c,d,e,f,g){function a(a){var b,c=a.msg,e=a.reason;a=a.reportingTokenVersion;b=(b=c.senderWithDevice)!=null?b:d("WAWebMsgGetters").getSender(c);new(d("WAWebReportingTokenValidationFailureWamEvent").ReportingTokenValidationFailureWamEvent)({editType:d("WAWebMsgGetters").getWamEditType(c),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(c),messageType:d("WAWebWamMsgUtils").getWamMessageType(c),reportingTokenValidationFailureReason:e,isLid:d("WAWebMsgKeyUtils").isLidMsgKey(c.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message),isMessageRetry:c.isRetry===!0,offline:c.isOffline===!0,reportingTokenVersion:a,messageIsForward:d("WAWebMsgGetters").getIsForwarded(c)}).commit();e={clientMessageId:c.id.id,e2eReceiverType:d("WAWebWamEnumDeviceType").DEVICE_TYPE.COMPANION,editType:d("WAWebMsgGetters").getWamEditType(c),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(c),messageType:d("WAWebWamMsgUtils").getWamMessageType(c),reportingTokenValidationFailureReason:e,isLid:d("WAWebMsgKeyUtils").isLidMsgKey(c.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message),isMessageRetry:c.isRetry===!0,offline:c.isOffline===!0,reportingTokenVersion:a,messageIsForward:d("WAWebMsgGetters").getIsForwarded(c)};if(b!=null){e.senderJid=b.toString();a=d("WAWebWamMsgUtils").getWamE2eSenderType(b);a!=null&&(e.e2eSenderType=a)}new(d("WAWebReportingTokenValidationFailureSenderWamEvent").ReportingTokenValidationFailureSenderWamEvent)(e).commit()}g.logReportingTokenValidationEvent=a}),98); __d("WAWebWamEnumCoexStatusReplyPrivacyDisclaimerUserAction",[],(function(a,b,c,d,e,f){a=Object.freeze({DISPLAYED:1,TAPPED:2});f.COEX_STATUS_REPLY_PRIVACY_DISCLAIMER_USER_ACTION=a}),66); __d("WAWebWamEnumCoexSysMsgInsertionChannel",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT_OPEN:0,MESSAGE_RECEIVE:1,HISTORY_SYNC:2});f.COEX_SYS_MSG_INSERTION_CHANNEL=a}),66); __d("WAWebWamEnumCoexSysMsgStateTransitionAttempt",[],(function(a,b,c,d,e,f){a=Object.freeze({E2EE_TO_HOSTED:0,HOSTED_TO_E2EE:1,HOSTED_TO_HOSTED:2});f.COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT=a}),66); __d("WAWebCoexPrivacySysMsgWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCoexStatusReplyPrivacyDisclaimerUserAction","WAWebWamEnumCoexSysMsgInsertionChannel","WAWebWamEnumCoexSysMsgStateTransitionAttempt"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CoexPrivacySysMsg:[5204,{coexStatusReplyPrivacyDisclaimerUserAction:[8,d("WAWebWamEnumCoexStatusReplyPrivacyDisclaimerUserAction").COEX_STATUS_REPLY_PRIVACY_DISCLAIMER_USER_ACTION],coexSysMsgBusinessId:[1,a.TYPES.STRING],coexSysMsgInsertionChannel:[9,d("WAWebWamEnumCoexSysMsgInsertionChannel").COEX_SYS_MSG_INSERTION_CHANNEL],coexSysMsgInsertionErrorCode:[2,a.TYPES.INTEGER],coexSysMsgInsertionErrorMsg:[3,a.TYPES.STRING],coexSysMsgInsertionSuccess:[4,a.TYPES.BOOLEAN],coexSysMsgIsSelf:[5,a.TYPES.BOOLEAN],coexSysMsgMultiDeviceId:[6,a.TYPES.INTEGER],coexSysMsgStateTransitionAttempt:[7,d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT]},[1,1,1],"private",113760892]},{CoexPrivacySysMsg:[]});g.CoexPrivacySysMsgWamEvent=b}),98); __d("WAWebBizCoexUtils",["WALogger","WATimeUtils","WAWebBizCoexGatingUtils","WAWebCoexPrivacySysMsgWamEvent","WAWebMsgKey","WAWebOfflineDeviceCache","WAWebOfflineHandler","WAWebSchemaChat","WAWebSyncDeviceAdvDeviceListJob","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWamEnumCoexSysMsgInsertionChannel","WAWebWamEnumCoexSysMsgStateTransitionAttempt","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["comit coex system msg wam event failed with error: "," message: ",""]);h=function(){return a};return a}var i=99,j=["biz_account_type_is_hosted","biz_account_type_changed_to_hosted","biz_me_account_type_is_hosted","biz_me_account_type_is_hosted_transition"],k=new Set(),l=new Set();function a(a){return a.some(function(a){return a.isHosted()})}function e(a,b){if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()||a==null)return;((a=a[0])==null?void 0:a.id)===i&&m(b)}function m(a){!d("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()?d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(a.toString(),null):void d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([a],null,null)}function f(a){return!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()||a==null?!1:j.includes(a)}function n(a){if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled())return!1;return d("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage()||a.isHosted===!0?!0:!1}function o(a){if(!d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled())return;q(a.map(function(a){var b=a[0];a[1];return b==null?null:{id:b.id,subtype:b.subtype}}))}function p(a){var b;q([{id:a==null?void 0:(b=a.id)==null?void 0:b.toString(),subtype:a==null?void 0:a.subtype,channel:d("WAWebWamEnumCoexSysMsgInsertionChannel").COEX_SYS_MSG_INSERTION_CHANNEL.HISTORY_SYNC}])}function q(a){try{var b,e=d("WAWebUserPrefsMeUser").getMe(),f=(b=e==null?void 0:e.device)!=null?b:0;a.forEach(function(a){if((a==null?void 0:a.id)==null)return;var b=c("WAWebMsgKey").fromString(a.id),g={coexSysMsgInsertionSuccess:!0,coexSysMsgMultiDeviceId:f,coexSysMsgStateTransitionAttempt:d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.E2EE_TO_HOSTED,coexSysMsgIsSelf:!1};g=new(d("WAWebCoexPrivacySysMsgWamEvent").CoexPrivacySysMsgWamEvent)(g);a.channel!=null&&(g.coexSysMsgInsertionChannel=a.channel);switch(a.subtype){case"biz_account_type_is_hosted":g.coexSysMsgStateTransitionAttempt=d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.HOSTED_TO_HOSTED;g.coexSysMsgBusinessId=b.remote.user;break;case"biz_account_type_changed_to_hosted":g.coexSysMsgStateTransitionAttempt=d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.E2EE_TO_HOSTED;g.coexSysMsgBusinessId=b.remote.user;break;case"biz_me_account_type_is_hosted":g.coexSysMsgIsSelf=!0;g.coexSysMsgStateTransitionAttempt=d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.HOSTED_TO_HOSTED;g.coexSysMsgBusinessId=(a=e==null?void 0:e.user)!=null?a:"";break;case"biz_me_account_type_is_hosted_transition":g.coexSysMsgIsSelf=!0;g.coexSysMsgStateTransitionAttempt=d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.E2EE_TO_HOSTED;g.coexSysMsgBusinessId=(a=e==null?void 0:e.user)!=null?a:"";break;case"encrypt":g.coexSysMsgStateTransitionAttempt=d("WAWebWamEnumCoexSysMsgStateTransitionAttempt").COEX_SYS_MSG_STATE_TRANSITION_ATTEMPT.HOSTED_TO_E2EE;g.coexSysMsgBusinessId=b==null?void 0:(a=b.remote)==null?void 0:a.user;break;default:return}g.commit()})}catch(a){d("WALogger").ERROR(h(),a.name,a.message).verbose().devConsole(a).sendLogs("comit coex system msg wam event failed")}}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(k.has(a))return!1;var b=(yield d("WAWebSchemaChat").getChatTable().get(a,!1));k.add(a);return!b});return s.apply(this,arguments)}function t(a){k["delete"](a.toString())}function u(a){a=a.toString()+"_"+d("WATimeUtils").unixTime().toString();if(l.has(a))return!0;l.add(a);return!1}function v(){l.clear()}g.HOSTED_DEVICE_ID=i;g.fanoutListContainsHostedDevice=a;g.triggerUsyncForCoexDeviceAdd=e;g.triggerUsyncForCoexUpdate=m;g.isCoexSystemMsgType=f;g.isMeOrCurrentContactHosted=n;g.sendWamCoexPrivacySysMsgInsertSuccess=o;g.sendWamCoexPrivacySysMsgHistorySyncInsert=p;g.shouldCreateFallbackHostedAdvSystemMsgOnPlaceholder=r;g.deleteChatFromFallbackHostedAdvSystemMsgOnPlaceholderCache=t;g.shouldDedupInitialHostedSystemMsg=u;g.clearDedupInitialHostedSystemMsgCache=v}),98); __d("WAWebBotMetadataProtoUtils",["WAWebBotGating"],(function(a,b,c,d,e,f,g){function a(a,b){var c;(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.pluginType)!=null?a.botPluginType=b.botMetadata.pluginMetadata.pluginType:(b==null?void 0:(c=b.botMetadata)==null?void 0:c.pluginMetadata)!=null&&(a.botPluginMaybeParent=!0);(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.referenceIndex)!=null&&(a.botPluginReferenceIndex=b.botMetadata.pluginMetadata.referenceIndex);(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.provider)!=null&&(a.botPluginSearchProvider=b.botMetadata.pluginMetadata.provider);(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.searchProviderUrl)!=null&&(a.botPluginSearchUrl=b.botMetadata.pluginMetadata.searchProviderUrl);(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.thumbnailCdnUrl)!=null&&(a.botReelPluginThumbnailCdnUrl=b.botMetadata.pluginMetadata.thumbnailCdnUrl);(b==null?void 0:(c=b.botMetadata)==null?void 0:(c=c.pluginMetadata)==null?void 0:c.searchQuery)!=null&&(a.botPluginSearchQuery=b.botMetadata.pluginMetadata.searchQuery);if((b==null?void 0:(c=b.botMetadata)==null?void 0:c.messageDisclaimerText)!=null&&d("WAWebBotGating").isAiMessageDisclaimerTextEnabled()){a.botMessageDisclaimerText=b==null?void 0:(c=b.botMetadata)==null?void 0:c.messageDisclaimerText}}g.parseBotMetadataProto=a}),98); __d("WAWebParseBotFeedbackProtocolMessageProto",["WAWebBotTypes","WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.protocolMessage;if(b==null)return;var c=b.type;b=b.botFeedbackMessage;if(c!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_FEEDBACK_MESSAGE)return;if(b==null)return;c=b.messageKey;var e=b.kind;b=b.text;if(c==null)return;if(e==null)return;var f;switch(e){case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_POSITIVE:f=d("WAWebBotTypes").BotFeedbackKind.POSITIVE;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_GENERIC:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_GENERIC;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_HELPFUL:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_HELPFUL;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_INTERESTING:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_INTERESTING;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_ACCURATE:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_ACCURATE;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_SAFE:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_SAFE;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_OTHER:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_OTHER;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_REFUSED:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_REFUSED;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_VISUALLY_APPEALING;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_RELEVANT_TO_TEXT;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_CLARITY:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_ENTERTAINING;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_CUSTOMIZABLE;break;case d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_PERSONALIZED:f=d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_INTERESTING}if(f==null)return;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"bot_feedback",protocolMessageKey:d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(c,a),botFeedbackKind:f,botFeedbackText:b}),contextInfo:null}}g["default"]=a}),98); __d("WAWebRichResponseParseUtils",["WALogger","WAWebProtobufsE2E.pb","WAWebRichResponse.flow","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unknown rich response submessage was of type text"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Empty rich response submessage type"]);i=function(){return a};return a}function j(a){return{type:d("WAWebRichResponse.flow").RichResponseFragmentType.Unknown,fragment:a}}function a(a,b){return{parseState:d("WAWebRichResponse.flow").RichResponseParseState.Unparsed,type:a,fragments:b.map(j)}}function b(a){try{var b=a.type,c=a.fragments;b=k(b);c=c.map(m);return t(b,c)}catch(b){return a}}function k(a){return typeof a==="string"?a:l(a)}function l(a){switch(a){case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseMessageType.AI_RICH_RESPONSE_TYPE_STANDARD:return d("WAWebRichResponse.flow").ParsedRichResponseType.Standard;case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseMessageType.AI_RICH_RESPONSE_TYPE_UNKNOWN:throw c("err")("parseRichResponseType: Unknown rich response type")}}function m(a){if(a.type!==d("WAWebRichResponse.flow").RichResponseFragmentType.Unknown)return a;try{return n(a.fragment)}catch(b){return a}}function n(a){if(a.messageType==null){d("WALogger").ERROR(i()).tags("wa-web-ai-logging").devConsole(a).sendLogs("empty-rich-response-submessage-type",{sampling:.001});throw c("err")("getRichResponseFragmentFromSubmessage: Missing message type")}switch(a.messageType){case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_TEXT:return q(a);case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_CODE:case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_DYNAMIC:case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_GRID_IMAGE:case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_INLINE_IMAGE:break;case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_TABLE:return r(a);case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_UNKNOWN:case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_LATEX:case d("WAWebProtobufsE2E.pb").AIRichResponseMessage$AIRichResponseSubMessageType.AI_RICH_RESPONSE_MAP:default:break}throw c("err")("Unsupported rich response fragment type")}function o(a){return a.type!==d("WAWebRichResponse.flow").RichResponseFragmentType.Unknown}function p(a){return a.type===d("WAWebRichResponse.flow").RichResponseFragmentType.Unknown}function q(a){var b=a.messageText;if(b==null){d("WALogger").ERROR(h()).tags("wa-web-ai-logging").devConsole(a).sendLogs("missing-rich-submessage-text-type-text",{sampling:.001});throw c("err")("parseRichResponseTextSubmessage: Missing message text")}return{type:d("WAWebRichResponse.flow").RichResponseFragmentType.Text,text:b}}function r(a){a=a.tableMetadata;if(a==null)throw c("err")("Missing table");a=a.rows.map(function(a){var b;return{isHeading:(b=a.isHeading)!=null?b:!1,items:a.items}});return{type:d("WAWebRichResponse.flow").RichResponseFragmentType.Table,table:a}}function s(a){return a.reduce(function(a,b){o(b)&&a.push(b);return a},[])}function t(a,b){if(b.every(p))throw c("err")("No fragments parsed");return b.every(o)?{parseState:d("WAWebRichResponse.flow").RichResponseParseState.Parsed,type:a,fragments:s(b)}:{parseState:d("WAWebRichResponse.flow").RichResponseParseState.Partial,type:a,fragments:b}}g.generateFutureproofRichResponse=a;g.parseRichResponse=b}),98); __d("WAWebRichResponseValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){"use strict";a=b("$InternalEnum")({INVALID_MESSAGE_TYPE:"rich_response_invalid_name",MISSING_MESSAGE_TYPE:"rich_response_missing_message_type",INVALID_SENDER:"rich_response_invalid_sender"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="RichResponseValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.RichResponseValidationErrorCode=a;g.RichResponseValidationError=c}),98); __d("WAWebParseRichResponseMessageProto",["WAWebBotGating","WAWebMsgType","WAWebRichResponseParseUtils","WAWebRichResponseValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.richResponseMessage;if(b==null)return;if(!a.from.isBot())throw new(d("WAWebRichResponseValidationError").RichResponseValidationError)(d("WAWebRichResponseValidationError").RichResponseValidationErrorCode.INVALID_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);var c=b.submessages;b=b.messageType;if(b==null)throw new(d("WAWebRichResponseValidationError").RichResponseValidationError)(d("WAWebRichResponseValidationError").RichResponseValidationErrorCode.MISSING_MESSAGE_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);b=d("WAWebRichResponseParseUtils").generateFutureproofRichResponse(b,c);c=d("WAWebBotGating").isRichStructuredResponseReceiverEnabled()?d("WAWebRichResponseParseUtils").parseRichResponse(b):b;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE,kind:d("WAWebMsgType").MsgKind.RichResponse,richResponse:c}),contextInfo:void 0}}g["default"]=a}),98); __d("WAWebBotGating",["WAWebABProps","WAWebBotGenTypingIndicatorMsg","WAWebCommonMsgUtils","WAWebL10N","WAWebMobilePlatforms","WAWebMsgGetters","WAWebMsgType","WAWebRichResponse.flow"],(function(a,b,c,d,e,f,g){function h(){if(d("WAWebMobilePlatforms").isSMB())return!1;return!x()?!1:j()}function i(){return d("WAWebABProps").getABPropConfigValue("bonsai_receiver_enabled")===!0}function j(){return d("WAWebABProps").getABPropConfigValue("bonsai_enabled")===!0}function k(){return d("WAWebABProps").getABPropConfigValue("bonsai_entry_point_enabled")===!0}function a(){return h()||i()}function b(){return h()&&d("WAWebABProps").getABPropConfigValue("bonsai_ptt_enabled")===!0}function e(a){return!h()?!1:Boolean(d("WAWebMsgGetters").getIsMetaBotResponse(a))||a.subtype===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE}function f(){return d("WAWebABProps").getABPropConfigValue("wabai_message_rendering_enabled")}function l(){return d("WAWebABProps").getABPropConfigValue("wabai_message_feedback_enabled")}function m(){return d("WAWebABProps").getABPropConfigValue("biz_ai_agent_consumer_merge_tos_enabled")}function n(){return d("WAWebABProps").getABPropConfigValue("bot_3p_status")!==0}function o(){return d("WAWebABProps").getABPropConfigValue("bot_3p_status")===2}function p(){return i()&&d("WAWebABProps").getABPropConfigValue("bonsai_carousel_enabled")}function q(){return h()&&k()&&d("WAWebABProps").getABPropConfigValue("bonsai_chat_list_entry_point_enabled")}function r(){return h()&&k()&&!q()}function s(){return d("WAWebABProps").getABPropConfigValue("wabai_consent_cooldown")}function t(){return d("WAWebABProps").getABPropConfigValue("wabai_consent_required")}function u(){return h()&&d("WAWebABProps").getABPropConfigValue("bot_commands_1p_enabled")}var v,w;function x(){var a;a=(a=d("WAWebABProps").getABPropConfigValue("bonsai_supported_languages"))!=null?a:"en";if(w!==a||v==null){var b=a.toLowerCase().split(",").map(function(a){return a.trim()});w=a;v=b.includes(c("WAWebL10N").getLanguage())}return v}function y(){return d("WAWebABProps").getABPropConfigValue("bonsai_fp_ugc_sender")}function z(){return d("WAWebABProps").getABPropConfigValue("ai_home_graphql_enabled")}function A(){return d("WAWebABProps").getABPropConfigValue("ai_home_bot_profile_sync_interval_sec")*1e3}function B(){return d("WAWebABProps").getABPropConfigValue("ai_forward_flow_enabled")}function C(){return d("WAWebABProps").getABPropConfigValue("ai_message_disclaimer_enabled")}function D(){return d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_invoke_receive_enabled")}function E(){return d("WAWebABProps").getABPropConfigValue("ai_rich_response_main_gate_enabled")}function F(){return!E()?!1:d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("ai_rich_response_smb_web_structured_response_enabled"):d("WAWebABProps").getABPropConfigValue("ai_rich_response_web_structured_response_enabled")}function G(){return!E()?!1:d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("ai_rich_response_smb_web_structured_response_receiver_enabled"):d("WAWebABProps").getABPropConfigValue("ai_rich_response_web_structured_response_receiver_enabled")}function H(){return d("WAWebABProps").getABPropConfigValue("ai_rich_response_heading_enabled")}function I(){return!E()?!1:d("WAWebABProps").getABPropConfigValue("ai_rich_response_heading_receiver_enabled")}function J(){return d("WAWebABProps").getABPropConfigValue("ai_rich_response_subheading_enabled")}function K(){return!E()?!1:d("WAWebABProps").getABPropConfigValue("ai_rich_response_subheading_receiver_enabled")}function L(){return d("WAWebABProps").getABPropConfigValue("ai_rich_response_structured_response_table_enabled")}function M(){return d("WAWebABProps").getABPropConfigValue("ai_rich_response_structured_response_table_receiver_enabled")}function N(a){return a.richResponse.parseState!==d("WAWebRichResponse.flow").RichResponseParseState.Unparsed&&G()}function O(a){if(a.type===d("WAWebMsgType").MSG_TYPE.REVOKED)return!1;return d("WAWebCommonMsgUtils").isRichResponseMsg(a.type)&&!G()?!1:d("WAWebMsgGetters").getIsBotSearchResponse(a)&&i()}function P(){return d("WAWebABProps").getABPropConfigValue("ai_chat_persistent_meta_ai_banner_enabled")}function Q(){return d("WAWebABProps").getABPropConfigValue("ai_pdfn_tos_non_blocking_notices")}g.isBotEnabled=h;g.isBotReceiveEnabled=i;g.isBotMsgParseEnabledForFutureproofOrFullRecv=a;g.isBotPttEnabled=b;g.shouldAnimateAsBotStream=e;g.isBizBot1pEnabled=f;g.isBizBot1pFeedbackEnabled=l;g.isBizBot1pMergeTosEnabled=m;g.isBizBot3pEnabled=n;g.isBizBot3pAvailable=o;g.isBotCarouselEnabled=p;g.isBotShortcutEntryPointEnabled=q;g.isBotNewChatEntryPointEnabled=r;g.bizBotConsentDismissalCooldown=s;g.isBizBotConsentRequired=t;g.isMetaBotCommandsEnabled=u;g.isFbidBotEnabled=y;g.isUgcBotEnabled=z;g.ugcBotProfileSyncInterval=A;g.isAiForwardFlowEnabled=B;g.isAiMessageDisclaimerTextEnabled=C;g.isFbidInvokeReceiveEnabled=D;g.isRichStructuredResponseEnabled=F;g.isRichStructuredResponseReceiverEnabled=G;g.isRichResponseHeadingEnabled=H;g.isRichResponseHeadingReceiverEnabled=I;g.isRichResponseSubHeadingEnabled=J;g.isRichResponseSubheadingReceiverEnabled=K;g.isRichResponseTableEnabled=L;g.isRichResponseTableReceiverEnabled=M;g.shouldRenderStructuredRichResponseMsg=N;g.showBotSearchPlugin=O;g.isAiChatPersistentMetaAIBannerEnabled=P;g.getNonBlockingNoticeIds=Q}),98); __d("WAWebBotGenTypingIndicatorMsg",["WAWebABProps","WAWebBackendApi","WAWebBotGating","WAWebMsgKey","WAWebMsgType","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){f="bot_typing_placeholder";function a(a,b){h(a,b)&&void i(a)}function h(a,b){var e=d("WAWebBotGating").isBotEnabled()&&a.id instanceof c("WAWebWid")&&a.id.isBot();a=d("WAWebBotGating").isBizBot3pEnabled()&&((a=a.contact.businessProfile)==null?void 0:a.isBizBot3p)===!0;return(e||a)&&b.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL&&b.type===d("WAWebMsgType").MSG_TYPE.CHAT}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBotGating").isBotEnabled())return;var b=a.id;if(b instanceof c("WAWebWid")&&!b.isBot()&&!((a=a.contact.businessProfile)==null?void 0:a.isBizBot3p))return;a=new(c("WAWebMsgKey"))({fromMe:!1,remote:b,id:c("WAWebMsgKey").newId_DEPRECATED()});d("WAWebBackendApi").frontendFireAndForget("addInitialBotTypingIndicatorToChat",{chatId:b,msgKey:a})});return j.apply(this,arguments)}function e(){var a=d("WAWebABProps").getABPropConfigValue("bonsai_ti_timeout_duration_ms");return a}g.BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE=f;g.maybeGenBotTypingIndicatorMessage=a;g.getBotTypingIndicatorTimeout=e}),98); __d("WAWebParseChatMessageProto",["WAWebE2EProtoUtils","WAWebMsgType","WAWebParseExtendedTextMessageProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;var e=b.conversation,f=b.extendedTextMessage;if(e==null&&f==null)return;if(e!=null)return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat,body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(e)}),contextInfo:void 0};if(d("WAWebParseExtendedTextMessageProtoUtils").isUrlExtendedTextMessage(f))return;return d("WAWebParseExtendedTextMessageProtoUtils").parseExtendedTextMessageProto({messageProtobuf:b,baseMessage:c,msgContext:a})}g["default"]=a}),98); __d("WAWebParseExtendedTextUrlChatMessageProto",["WAWebMsgType","WAWebParseExtendedTextMessageProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.rcat;a=a.msgContext;var f=b.extendedTextMessage;if(f==null)return;if(!d("WAWebParseExtendedTextMessageProtoUtils").isUrlExtendedTextMessage(f))return;b=d("WAWebParseExtendedTextMessageProtoUtils").parseExtendedTextMessageProto({messageProtobuf:b,baseMessage:c,msgContext:a});a=babelHelpers["extends"]({},c,b==null?void 0:b.msgData,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat,subtype:"url",rcat:e});return{msgData:a,contextInfo:f==null?void 0:f.contextInfo}}g["default"]=a}),98); __d("WAWebParseExtendedTextMessageProtoUtils",["WALongInt","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){return Boolean(a==null?void 0:a.matchedText)||Boolean(a==null?void 0:a.description)||Boolean(a==null?void 0:a.title)}function b(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.extendedTextMessage;if(b==null)return;var c=d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$FontType,e;if((b==null?void 0:b.font)!=null)switch(b.font){case c.SYSTEM:case c.SYSTEM_TEXT:case c.FB_SCRIPT:case c.SYSTEM_BOLD:case c.MORNINGBREEZE_REGULAR:case c.CALISTOGA_REGULAR:case c.EXO2_EXTRABOLD:case c.COURIERPRIME_BOLD:e=b.font;break}c=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.CHAT,kind:d("WAWebMsgType").MsgKind.Chat,body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis((b==null?void 0:b.text)||""),matchedText:b==null?void 0:b.matchedText,description:b==null?void 0:b.description,title:b==null?void 0:b.title,thumbnail:d("WAWebE2EProtoParserApi").decodeBytes(b==null?void 0:b.jpegThumbnail)||"",richPreviewType:b==null?void 0:b.previewType,doNotPlayInline:b==null?void 0:b.doNotPlayInline,textColor:b==null?void 0:b.textArgb,backgroundColor:b==null?void 0:b.backgroundArgb,mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(b==null?void 0:b.mediaKey),mediaKeyTimestamp:(b==null?void 0:b.mediaKeyTimestamp)!=null?d("WALongInt").numberOrThrowIfTooLarge(b.mediaKeyTimestamp):a.mediaKeyTimestamp,thumbnailDirectPath:b==null?void 0:b.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(b==null?void 0:b.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(b==null?void 0:b.thumbnailEncSha256),thumbnailHeight:b==null?void 0:b.thumbnailHeight,thumbnailWidth:b==null?void 0:b.thumbnailWidth,inviteGrpType:(b==null?void 0:b.inviteLinkGroupTypeV2)!=null?d("WAWebE2EProtoParserApi").parseInviteGrpType(b==null?void 0:b.inviteLinkGroupTypeV2):a.inviteGrpType,font:e!=null?e:a.font,paymentLinkMetadata:b==null?void 0:b.paymentLinkMetadata});return{msgData:c,contextInfo:b==null?void 0:b.contextInfo}}g.isUrlExtendedTextMessage=a;g.parseExtendedTextMessageProto=b}),98); __d("WAWebAddonCreateMsgProcessor",["WAWebAddonConstants"],(function(a,b,c,d,e,f,g){function a(a){return babelHelpers["extends"]({},a,{type:d("WAWebAddonConstants").AddonProcessorType.Regular})}function b(a){return babelHelpers["extends"]({},a,{type:d("WAWebAddonConstants").AddonProcessorType.DualEncrypted})}function c(a){return babelHelpers["extends"]({},a,{type:d("WAWebAddonConstants").AddonProcessorType.DualEncryptedWithMessageTraits})}g.createAddonMsgProcessor=a;g.createAddonMsgProcessorDualEncrypted=b;g.createAddonMessageProcessorDualEncryptedWithMessageTraits=c}),98); __d("WAWebAddonCommentMsgProcessor",["Promise","WAWebAddonConstants","WAWebAddonCreateMsgProcessor","WAWebApiChat","WAWebBackendApi","WAWebCommentParseWebMsgInfoComment","WAWebCommentUtils","WAWebDBCommentMessageSerialization","WAWebLastAddOnDBSerialization","WAWebMsgType","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=d("WAWebAddonCreateMsgProcessor").createAddonMessageProcessorDualEncryptedWithMessageTraits({isEnabled:function(){return!0},convert:{fromHistorySyncMsg:function(a){a=d("WAWebCommentParseWebMsgInfoComment").parseWebMsgInfoComment(a);return(h||(h=b("Promise"))).resolve(a)},toDualEncryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.CommentEncrypted?a:d("WAWebCommentUtils").commentMsgDataToEncCommentMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}(),toDualDecryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.CommentDecrypted?a:d("WAWebCommentUtils").encCommentMsgDataToCommentMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}()},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebBackendApi").frontendSendAndReceive("upsertCommentModelCollection",{comments:a.add,commentsToRemove:a.remove})});function c(b){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.parents;var c=[];for(a of a)if(a.kind===d("WAWebMsgType").MsgKind.CommentEncrypted){var e=(yield i.convert.toDualDecryptedMsgData(a,b.getForAddon(a)));c.push(e)}else c.push(a);return c});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.processMode,e=b.parents,f=b.existingPlaceholderKeys;if(c===d("WAWebAddonConstants").AddonProcessMode.SendRetry)return;yield d("WAWebShouldUpdateLastAddOnPreview").filterAndUpdateChatPreviews(a.map(function(a){return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromCommentRowType(d("WAWebDBCommentMessageSerialization").dbRowFromCommentMessage(a))}));if(c===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return;b=f.size>0?a.filter(function(a){return!f.has(a.id.toString())}):a;yield d("WAWebCommentUtils").updateReplyCount(b,e,[]);c=(yield d("WAWebCommentUtils").genChatIdToLastTimestamp(a));yield d("WAWebApiChat").latestChatBulkUpdates(c);d("WAWebBackendApi").frontendFireAndForget("updateChatToLatest",{chatIdToLatestUpdates:c})});function c(b,c){return a.apply(this,arguments)}return c}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebBackendApi").frontendFireAndForget("handleCommentNotification",{comments:a.add,revokes:a.remove})});function c(b){return a.apply(this,arguments)}return c}()});a=i;g["default"]=a}),98); __d("WAWebApiUpdateReplyCount",["WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=[];for(a of a){var e=a[0],f=a[1],g=b.getByParentMsgKey(e);if(g==null)continue;g=(g=g.replyCount)!=null?g:0;c.push({id:e,replyCount:g+f})}yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(c)});return h.apply(this,arguments)}g.updateReplyCountInParentMsgs=a}),98); __d("WAWebCommentGroupBy",[],(function(a,b,c,d,e,f){function a(a,b){var c=new Map();for(a of a){var d,e=a.parentMsgKey.toString();d=(d=c.get(e))!=null?d:0;c.set(e,d+1)}for(e of b){d=e.parentMsgKey.toString();b=(a=c.get(d))!=null?a:0;c.set(d,b-1)}return c}f.commentCountByParents=a}),66); __d("WAWebCommentMessageValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_COMMENT_ENC_IV:"comment_missing_enc_iv",MISSING_COMMENT_ENC_PAYLOAD:"comment_missing_enc_payload",MISSING_COMMENT_MESSAGE_KEY:"comment_missing_target_message_key",INVALID_COMMENT_ENC_IV:"comment_invalid_enc_iv",MISSING_COMMENT_SENDER:"comment_missing_sender",MISSING_MESSAGE_SECRET:"comment_parent_missing_message_secret",MISSING_ORIGINAL_MESSAGE_SENDER:"comment_missing_original_message_sender",MISSING_COMMENT_CONTENT:"comment_missing_comment_content"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="CommentMessageValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.CommentMessageValidationErrorCode=a;g.CommentMessageValidationError=c}),98); __d("WAWebCommentMsgDataConversion",["WANullthrows","WAWebCommentMessageValidationError","WAWebMsgType","WAWebViewMode.flow","WAWebWamEnumE2eFailureReason","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(a){var b;return(b=a.conversation)!=null?b:(b=a.extendedTextMessage)==null?void 0:b.text}function a(a,b){a=h(a);if(a==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_CONTENT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{ack:b.ack,body:a,from:b.from,to:b.to,id:b.id,parentMsgKey:b.targetMessageKey,author:d("WAWebWidFactory").toUserWid(c("WANullthrows")(b.author)),t:b.t,type:d("WAWebMsgType").MSG_TYPE.COMMENT,kind:d("WAWebMsgType").MsgKind.CommentDecrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,read:!1}}g.extractCommentTextFromMessage=h;g.convertMessageToCommentMsgData=a}),98); __d("WAWebReferentialMsgKey",["WAWebMsgKey","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){if(a.broadcastId&&d("WAWebWidFactory").isWidlike(a.broadcastId)){var b=a.id;return new(c("WAWebMsgKey"))({fromMe:b.fromMe,remote:d("WAWebWidFactory").createWidFromWidLike(a.broadcastId),id:b.id,participant:b.remote})}return a.id}g.getReferentialMsgKey=a}),98); __d("WAWebCommentUtils",["WANullthrows","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebApiUpdateReplyCount","WAWebBackendApi","WAWebCommentGroupBy","WAWebCommentMsgDataConversion","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebProcessCommentMsg","WAWebReferentialMsgKey","WAWebSchemaChat","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();for(a of a){var c=a.id.remote.toString(),e=a.t;if(e==null)continue;var f=b.get(c);b.set(c,{id:c.toString(),t:Math.max(e,(c=f==null?void 0:f.t)!=null?c:0),unreadCount:(f==null?void 0:f.unreadCount)!=null?f.unreadCount+1:1})}for(e of b.entries()){c=e[0];f=e[1];a=(yield d("WAWebSchemaChat").getChatTable().get(c));a!=null&&f.unreadCount!=null&&(f.unreadCount+=a.unreadCount)}c=Array.from(b.values());return c});return h.apply(this,arguments)}function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=self.crypto.getRandomValues(new Uint8Array(12));e={type:d("WAWebMsgType").MsgKind.CommentDecrypted,encode:e};var g=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.CommentDecrypted,a);e=(yield d("WAWebAddonEncryption").encryptAddOn(e,{messageSecret:g,iv:f,originalMessageSender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a))),addOnSender:d("WAWebWidFactory").toUserWid(b),stanzaId:a.id.id}));g=e.encPayload;b=e.reportingTokenContent;return babelHelpers["extends"]({encIv:f.buffer,encPayload:g,targetMessageKey:d("WAWebReferentialMsgKey").getReferentialMsgKey(a)},b!=null&&{reportingTokenContent:b})});return j.apply(this,arguments)}function e(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=d("WAWebCommentGroupBy").commentCountByParents(a,c);yield d("WAWebApiUpdateReplyCount").updateReplyCountInParentMsgs(a,b);d("WAWebBackendApi").frontendFireAndForget("updateReplyCount",{replyCountMap:a})});return k.apply(this,arguments)}function f(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebProcessCommentMsg").processEncCommentMsg(a,b));return d("WAWebCommentMsgDataConversion").convertMessageToCommentMsgData(b,a)});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e={conversation:a.body},f=d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)));return babelHelpers["extends"]({id:a.id},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),yield i(b,f,e),{type:d("WAWebMsgType").MSG_TYPE.COMMENT,kind:d("WAWebMsgType").MsgKind.CommentEncrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:a.t,addonEncrypted:!0,ack:a.ack,messageSecret:a.messageSecret})});return n.apply(this,arguments)}g.genChatIdToLastTimestamp=a;g.getEncCommentsFields=i;g.updateReplyCount=e;g.encCommentMsgDataToCommentMsgData=f;g.commentMsgDataToEncCommentMsgData=m}),98); __d("WAWebProcessCommentMsg",["WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebCommentMessageValidationError","WAWebHandleMsgValidate","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWamEnumE2eFailureReason","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.targetMessageKey,e=a.encIv,f=a.encPayload;if(e==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(c==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);c=a.author?a.author:a.id.participant;var g=d("WAWebMsgGetters").getOriginalSender(b);if(c==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(g==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_ORIGINAL_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f={type:d("WAWebMsgType").MsgKind.CommentEncrypted,encryptedAddOn:f};var h=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.CommentEncrypted,b);f=(yield d("WAWebAddonEncryption").decryptAddOn(f,{messageSecret:h,iv:e,stanzaId:b.id.id,originalMessageSender:g,addOnSender:d("WAWebWidFactory").toUserWid(c)}));yield d("WAWebHandleMsgValidate").validateAndProcessReportingTokenInfo({renderableMsgs:[babelHelpers["extends"]({},a,{plainProtobufBytes:new Uint8Array(f)})],forceDualEncryptedValidation:!0});return d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,f)});return h.apply(this,arguments)}g.processEncCommentMsg=a}),98); __d("WAWebCommentParseWebMsgInfoComment",["WALogger","WALongInt","WANullthrows","WAWebAddOnParseWebMsgInfo","WAWebCommentMsgDataConversion","WAWebMsgKeyUtils","WAWebMsgType","WAWebParseWebMessageInfoApi","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[parseWebMsgInfoComment] failed to parse comment revoke "," with error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[parseWebMsgInfoComment] has revoke stub ",", parameters ",""]);i=function(){return a};return a}function j(a){var b,e=a.webMsgInfo;a=a.isFromCag;b=e==null?void 0:(b=e.message)==null?void 0:b.commentMessage;var f=e==null?void 0:e.commentMetadata,g=[];if(e==null||(f==null?void 0:f.commentParentKey)==null)return g;a=c("WANullthrows")(d("WAWebAddOnParseWebMsgInfo").buildAddonMsgKey(e.key,a,e.participant));a=a.msgKey;var k=c("WANullthrows")(e.messageTimestamp),l;(b==null?void 0:b.message)!=null&&(l=d("WAWebCommentMsgDataConversion").extractCommentTextFromMessage(b.message));if(l==null){f=c("WANullthrows")(d("WAWebParseWebMessageInfoApi").buildMsgKey(e,c("WANullthrows")(f==null?void 0:f.commentParentKey)));f=f.msgKey;try{var m=d("WAWebParseWebMessageInfoApi").parseMsgStubProto(e,j);f=babelHelpers["extends"]({id:a,parentMsgKey:f},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{revokeAddonType:d("WAWebMsgType").MSG_TYPE.COMMENT,protocolMessageKey:m.protocolMessageKey,subtype:m.subtype,kind:d("WAWebMsgType").MsgKind.RevokedAddon,revokeTimestamp:d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(e.revokeMessageTimestamp)),type:d("WAWebMsgType").MSG_TYPE.REVOKED,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:d("WALongInt").numberOrThrowIfTooLarge(k)});g.push(f)}catch(a){d("WALogger").LOG(i(),Boolean(e.messageStubType),(m=e.messageStubParameters)==null?void 0:m.length);d("WALogger").ERROR(h(),e.key.id,a).sendLogs("parse-comment-revoke",{sampling:.01})}}else if(b!=null){f=c("WANullthrows")(b.targetMessageKey);m=c("WANullthrows")(d("WAWebParseWebMessageInfoApi").buildMsgKey(e,f));b=m.msgKey;g.push(babelHelpers["extends"]({id:a,parentMsgKey:b},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{body:l,type:d("WAWebMsgType").MSG_TYPE.COMMENT,read:!0,kind:d("WAWebMsgType").MsgKind.CommentDecrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:d("WALongInt").numberOrThrowIfTooLarge(k)}))}return g}g.parseWebMsgInfoComment=j}),98); __d("WAWebParseEncCommentMessageProto",["WAWebCommentMessageValidationError","WAWebE2EProtoUtils","WAWebMsgType","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.encCommentMessage;if(b==null)return;var c=b.encIv,e=b.encPayload;b=b.targetMessageKey;if(c==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);b=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b,a);if(b==null)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.MISSING_COMMENT_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(c.byteLength!==12)throw new(d("WAWebCommentMessageValidationError").CommentMessageValidationError)(d("WAWebCommentMessageValidationError").CommentMessageValidationErrorCode.INVALID_COMMENT_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.COMMENT,kind:d("WAWebMsgType").MsgKind.CommentEncrypted,addonEncrypted:!0,encIv:c,encPayload:e,targetMessageKey:b}),contextInfo:null}}g["default"]=a}),98); __d("WAWebJobDismissQuickPromotion",["WALogger","WASmaxInAppCommsEventRPC","WAWebBizGatingUtils","WAWebDefinePersistedJob","WAWebModelStorageUtils","WAWebQuickPromotionActionMutation","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["dismissQuickPromotion: unable to log through IQ"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["dismissQuickPromotion: unable to log through GraphQL"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["dismissQuickPromotion: surface id for GraphQL call not found"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["dismissQuickPromotion: promotion not found"]);k=function(){return a};return a}function a(a){var c=a.id,e=a.ts;return d("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(c));if(b==null){d("WALogger").WARN(k());return}var f=babelHelpers["extends"]({},b.tracking,{dismisses:b.tracking.dismisses+1}),g=f.lastDismissTs;(g==null||e>g)&&(f.lastDismissTs=e);yield a.merge(c,{tracking:f});return{surfaceId:b.surfaceId,instanceLogData:(g=b.data.qpConfigInstanceLogData)==null?void 0:g.elementValue}});return function(b){return a.apply(this,arguments)}}()).then(function(a){return d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("loadQuickPromotions",{trigger:"user-action"}).then(function(){return a})})}function c(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.id;b=b.ts;var e=(a==null?void 0:a.instanceLogData)!=null?String.fromCharCode.apply(null,a.instanceLogData):"";if(d("WAWebBizGatingUtils").qpGraphQLEnabled()){a=a==null?void 0:a.surfaceId;if(a==null)d("WALogger").WARN(j());else{a;var f;try{f=(yield d("WAWebQuickPromotionActionMutation").executeQuickPromotionActionMutation({event:"ACTION",action:"DISMISS",promotion_id:c,surface_nux_id:a,promotion_logging_data:e,client_time:b}))}catch(a){d("WALogger").ERROR(i()).devConsole(a)}if(((a=f)==null?void 0:a.type)!=="not-enabled")return;f.type}}a=(yield d("WASmaxInAppCommsEventRPC").sendEventRPC({eventType:"dismiss",eventPromotionId:c,eventTimestampSec:b,eventLogdata:e}));a.name!=="EventResponseSuccess"&&(a.name,d("WALogger").ERROR(h()).devConsole(a.value))});return l.apply(this,arguments)}e=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("saveToDb",a).finalStep("reportToComms",c).end();g.dismissQuickPromotion=e}),98); __d("WAWebJobImpressionOnQuickPromotion",["WALogger","WASmaxInAppCommsEventRPC","WAWebBizGatingUtils","WAWebDefinePersistedJob","WAWebModelStorageUtils","WAWebQuickPromotionActionMutation","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["impressionOnQuickPromotion: unable to log"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["impressionOnQuickPromotion: unable to log through GraphQL"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["impressionOnQuickPromotion: surface id for GraphQL call not found"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["impressionOnQuickPromotion: promotion not found"]);k=function(){return a};return a}function a(a){var c=a.id,e=a.ts;return d("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(c));if(b==null){d("WALogger").WARN(k());return}var f=babelHelpers["extends"]({},b.tracking,{impressions:b.tracking.impressions+1}),g=f.lastImpressionTs;(g==null||e>g)&&(f.lastImpressionTs=e);yield a.merge(c,{tracking:f});return{surfaceId:b.surfaceId,instanceLogData:(g=b.data.qpConfigInstanceLogData)==null?void 0:g.elementValue}});return function(b){return a.apply(this,arguments)}}()).then(function(a){return d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("loadQuickPromotions",{trigger:"user-action"}).then(function(){return a})})}function c(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.id;b=b.ts;var e=(a==null?void 0:a.instanceLogData)!=null?String.fromCharCode.apply(null,a.instanceLogData):"";if(d("WAWebBizGatingUtils").qpGraphQLEnabled()){a=a==null?void 0:a.surfaceId;if(a==null)d("WALogger").WARN(j());else{a;var f;try{f=(yield d("WAWebQuickPromotionActionMutation").executeQuickPromotionActionMutation({event:"VIEW",promotion_id:c,surface_nux_id:a,promotion_logging_data:e,client_time:b}))}catch(a){d("WALogger").ERROR(i()).devConsole(a)}if(((a=f)==null?void 0:a.type)!=="not-enabled")return;f.type}}a=(yield d("WASmaxInAppCommsEventRPC").sendEventRPC({eventType:"impression",eventPromotionId:c,eventTimestampSec:b,eventLogdata:e}));a.name!=="EventResponseSuccess"&&(a.name,d("WALogger").ERROR(h()).devConsole(a.value))});return l.apply(this,arguments)}e=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("saveToDb",a).finalStep("reportToComms",c).end();g.impressionOnQuickPromotion=e}),98); __d("WAWebJobPrimaryActionClickInQuickPromotion",["WALogger","WASmaxInAppCommsEventRPC","WAWebBizGatingUtils","WAWebDefinePersistedJob","WAWebModelStorageUtils","WAWebQuickPromotionActionMutation","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["primaryActionClickInQuickPromotion: unable to log"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["primaryActionClickInQuickPromotion: unable to log through GraphQL"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["primaryActionClickInQuickPromotion: surface id for GraphQL call not found"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["primaryActionClickInQuickPromotion: promotion not found"]);k=function(){return a};return a}function a(a){var c=a.id,e=a.ts;return d("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.get(c));if(b==null){d("WALogger").WARN(k());return}var f=babelHelpers["extends"]({},b.tracking,{primaryClicks:b.tracking.primaryClicks+1}),g=f.lastPrimaryClickTs;(g==null||e>g)&&(f.lastPrimaryClickTs=e);yield a.merge(c,{tracking:f});return{surfaceId:b.surfaceId,instanceLogData:(g=b.data.qpConfigInstanceLogData)==null?void 0:g.elementValue}});return function(b){return a.apply(this,arguments)}}()).then(function(a){return d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("loadQuickPromotions",{trigger:"user-action"}).then(function(){return a})})}function c(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.id;b=b.ts;var e=(a==null?void 0:a.instanceLogData)!=null?String.fromCharCode.apply(null,a.instanceLogData):"";if(d("WAWebBizGatingUtils").qpGraphQLEnabled()){a=a==null?void 0:a.surfaceId;if(a==null)d("WALogger").WARN(j());else{a;var f;try{f=(yield d("WAWebQuickPromotionActionMutation").executeQuickPromotionActionMutation({event:"ACTION",action:"PRIMARY",promotion_id:c,surface_nux_id:a,promotion_logging_data:e,client_time:b}))}catch(a){d("WALogger").ERROR(i()).devConsole(a)}if(((a=f)==null?void 0:a.type)!=="not-enabled")return;f.type}}a=(yield d("WASmaxInAppCommsEventRPC").sendEventRPC({eventType:"primary_click",eventPromotionId:c,eventTimestampSec:b,eventLogdata:e}));a.name!=="EventResponseSuccess"&&(a.name,d("WALogger").ERROR(h()).devConsole(a.value))});return l.apply(this,arguments)}e=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("saveToDb",a).finalStep("reportToComms",c).end();g.primaryActionClickInQuickPromotion=e}),98); __d("WAWebGenerateDocumentReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebMediaCleanFileName",["WALogger"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["cleanIncomingFilename:extension: ",""]);h=function(){return a};return a}function i(a){if(!a)return a;a=a.replace(/[\u202a-\u202e\u2066-\u2069\u200E\u200F\u061C]/g,"\ufffd");var b=a.split(".");if(b.length===1)return a;for(var c=b.length-1;c>0;c--){var d=b[c].trim();if(d.length)return b.slice(0,c).join(".")+"."+d}return a}function a(a){if(a==null)return a;var b=i(a);if(a!==b&&b){a=["bat","exe","cmd","com","lnk","pif","scr","vb","vbe","vbs","wsh","js","ps1","hta","sh","csh","msi","app","scpt","applescript","reg","vbe","wsf","sct"];var c=b.split(".");c=c.length>=2?c.pop():"";a.includes(c)&&d("WALogger").LOG(h(),c).verbose()}return b}g.cleanFilename=i;g.cleanIncomingFilename=a}),98); __d("WAWebServerPropConstants",[],(function(a,b,c,d,e,f){a=64;b=64;c=5e3;d=5;e=1500;var g=100*1024*1024,h=2e3*1024*1024,i=3;f.MMS_VCARD_AUTODOWNLOAD_SIZE_KB=a;f.VCARD_AS_DOCUMENT_SIZE_KB=b;f.VCARD_MAX_SIZE_KB=c;f.MULTICAST_LIMIT_GLOBAL=d;f.PTT_PLAYBACK_SPEED_HIDE_DELAY=e;f.DEFAULT_MAX_FILE_SIZE_BYTES=g;f.MAX_FILE_SIZE_BYTES=h;f.UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS=i}),66); __d("WAWebParseDocumentMessageProto",["WALongInt","WATimeUtils","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMediaCleanFileName","WAWebMediaMessageGetValidatedProperties","WAWebMsgType","WAWebServerPropConstants"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.documentMessage;if(b==null)return;a=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,c,a,d("WAWebMsgType").MSG_TYPE.DOCUMENT);var e=a.mediaKey,f=a.fileSha256,g=a.fileEncSha256,h=a.fileLength;h=h===void 0?0:h;a=a.url;var i=d("WAWebMediaCleanFileName").cleanIncomingFilename(b.fileName||b.title),j=b.caption!=null&&b.caption!=="",k=j?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(b.caption):i;c=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.DOCUMENT,kind:d("WAWebMsgType").MsgKind.Document,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(a),directPath:b.directPath,mimetype:b.mimetype,filehash:d("WAWebE2EProtoParserApi").decodeBytes(f),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(g),size:h,pageCount:b.pageCount||0,mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(e),mediaKeyTimestamp:b.mediaKeyTimestamp!=null?d("WALongInt").numberOrThrowIfTooLarge(b.mediaKeyTimestamp):d("WATimeUtils").unixTime(),filename:i,isCaptionByUser:j,caption:k,body:d("WAWebE2EProtoParserApi").decodeBytes(b.jpegThumbnail)||"",isVcardOverMmsDocument:Boolean(b.contactVcard)&&h<=d("WAWebServerPropConstants").VCARD_MAX_SIZE_KB*1024,thumbnailDirectPath:b.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(b.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(b.thumbnailEncSha256),thumbnailHeight:b.thumbnailHeight,thumbnailWidth:b.thumbnailWidth});return{msgData:c,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebParseKeepInChatMessageProto",["WALongInt","WAWebE2EProtoUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.keepInChatMessage;if(b==null)return;var c=b.key,e=b.keepType;b=b.timestampMs;c=babelHelpers["extends"]({},a,{keptMessageKey:d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(c,a),type:d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT,kind:d("WAWebMsgType").MsgKind.KeepInChat,keepType:e,senderTimestampMs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b)});return{msgData:c,contextInfo:null}}g["default"]=a}),98); __d("WAWebParseEphemeralSyncResponseMessageProto",["WALogger","WALongInt","WANullthrows","WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["EPHEMERAL_SYNC_RESPONSE msg does not contain all fields"]);h=function(){return a};return a}function a(a){var b=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;b=b.protocolMessage;if(b==null||a!=="relay"||b.type!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE)return;a=b.ephemeralExpiration;var f=b.ephemeralSettingTimestamp,g=b.disappearingMode;if(a==null||f==null||g==null){d("WALogger").WARN(h()).devConsole({protocolMessage:b});return}var i;b.disappearingMode!=null&&(i=d("WAWebE2EProtoUtils").protoToDisappearingMode(b,b.disappearingMode));return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"ephemeral_sync_response",ephemeralDuration:a,ephemeralSettingTimestamp:d("WALongInt").numberOrThrowIfTooLarge(f),disappearingModeInitiator:c("WANullthrows")(d("WAWebE2EProtoUtils").protoToDisappearingModeInitiator(e,g)),disappearingModeTrigger:(b=i)==null?void 0:b.disappearingModeTrigger,disappearingModeInitiatedByMe:(a=i)==null?void 0:a.initiatedByMe}),contextInfo:null}}g["default"]=a}),98); __d("WAArrayGroupBy",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=new Map();for(var d=0;d<a.length;d++){var e=b(a[d]),f=c.get(e);f==null?c.set(e,[a[d]]):f.push(a[d])}return Array.from(c.entries())}f.groupBy=a}),66); __d("WAWebEventEditAddonMessageProcessor",["Promise","WAArrayGroupBy","WAWebAddonCreateMsgProcessor","WAWebDBProcessEditProtocolMsgs","WAWebGenerateEventEditSystemMessages","WAWebProcessEncryptedEventEditMsgs","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=d("WAWebAddonCreateMsgProcessor").createAddonMsgProcessor({isEnabled:function(){return!0},convert:{fromHistorySyncMsg:function(){return(h||(h=b("Promise"))).resolve([])}},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.parents;a=(yield d("WAWebProcessEncryptedEventEditMsgs").processEncryptedEventEditMsgs(a,b));b=a.filter(function(a){return a.isLatest});yield d("WAWebDBProcessEditProtocolMsgs").updateMessageEditsLocally(a,b);a=d("WAArrayGroupBy").groupBy(b,function(a){return a.protocolMsg.id.remote.toString()});yield d("WAWebGenerateEventEditSystemMessages").generateEventEditSystemMessages(a);return[]});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}()});c=a;g["default"]=c}),98); __d("WAWebEventResponseMsgDataConversion",["WANullthrows","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebViewMode.flow","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b;return babelHelpers["extends"]({id:a.id},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.EventResponseDecrypted,parentMsgKey:a.parentMsgKey,eventResponse:c("WANullthrows")(a.responseProtobuf.response,"eventResponse"),senderTimestampMs:a.senderTimestampMs,t:(b=a.t)!=null?b:void 0,read:a.read,ack:(b=a.ack)!=null?b:void 0})}function b(a){var b;return babelHelpers["extends"]({id:a.id},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,kind:d("WAWebMsgType").MsgKind.EventResponseDecrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,parentMsgKey:a.parentMsgKey,eventResponse:a.eventResponse,senderTimestampMs:a.senderTimestampMs,t:(b=a.t)!=null?b:void 0,read:a.read,ack:(b=a.ack)!=null?b:void 0})}function e(a){return{type:"event_response",msgKey:a.id.toString(),parentMsgKey:a.parentMsgKey.toString(),timestamp:a.senderTimestampMs,sender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a))).toString(),eventResponse:a.eventResponse}}g.protobufToEventResponseMsgData=a;g.eventResponseToEventResponseMsgData=b;g.eventResponseMsgDataToResponseData=e}),98); __d("WAWebEventResponseAddonMessageProcessor",["WAWebAddonConstants","WAWebAddonCreateMsgProcessor","WAWebBackendApi","WAWebCreateEncryptedEventResponseMsgData","WAWebDBMarkFutureproofMessagesReparsed","WAWebEventResponseMsgDataConversion","WAWebEventsParseWebMsgInfoEventResponse","WAWebMsgType","WAWebPrepareEventResponsesToUpsert","WAWebProcessEncryptedEventResponseMsgs","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=d("WAWebAddonCreateMsgProcessor").createAddonMsgProcessorDualEncrypted({isEnabled:function(){return!0},convert:{fromHistorySyncMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebEventsParseWebMsgInfoEventResponse").parseWebMsgInfoEventResponses(a)});function c(b){return a.apply(this,arguments)}return c}(),toDualEncryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.EventResponseEncrypted?a:d("WAWebCreateEncryptedEventResponseMsgData").createEncryptedEventResponseMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}(),toDualDecryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.EventResponseDecrypted?a:d("WAWebProcessEncryptedEventResponseMsgs").decryptEncryptedEventResponseMsg(a,b)});function c(b,c){return a.apply(this,arguments)}return c}()},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebBackendApi").frontendSendAndReceive("upsertEventResponsesModelCollection",{eventResponses:a.add,eventResponsesToRemove:a.remove})});function c(b){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.parents;a=(yield d("WAWebProcessEncryptedEventResponseMsgs").processEncryptedEventResponseMsgs(a,b));b=(yield d("WAWebPrepareEventResponsesToUpsert").prepareEventResponsesToUpsert(a));return b});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.processMode;var c=a.map(d("WAWebEventResponseMsgDataConversion").eventResponseMsgDataToResponseData);yield d("WAWebShouldUpdateLastAddOnPreview").filterAndUpdateChatPreviews(c);if(b===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return;b===d("WAWebAddonConstants").AddonProcessMode.OnlineReceive&&(yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a.map(function(a){return a.id.toString()})))});function c(b,c){return a.apply(this,arguments)}return c}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}()});c=a;g["default"]=c}),98); __d("WAWebCreateEncryptedEventResponseMsgData",["WANullthrows","WAWebAck","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebEventsValidationError","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebViewMode.flow","WAWebWamEnumE2eFailureReason","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=self.crypto.getRandomValues(new Uint8Array(12)),f={type:d("WAWebMsgType").MsgKind.EventResponseDecrypted,encode:{response:a.eventResponse,timestampMs:a.senderTimestampMs}},g=d("WAWebMsgGetters").getOriginalSender(b),h=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.EventResponseDecrypted,b);if(g==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_MISSING_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f=(yield d("WAWebAddonEncryption").encryptAddOn(f,{messageSecret:h,iv:e,stanzaId:b.id.id,originalMessageSender:g,addOnSender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)))}));h=f.encPayload;return babelHelpers["extends"]({id:a.id},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,kind:d("WAWebMsgType").MsgKind.EventResponseEncrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,addonEncrypted:!0,t:Math.floor(a.senderTimestampMs/1e3),ack:(g=a.ack)!=null?g:d("WAWebAck").ACK.CLOCK,targetMessageKey:b.id,encPayload:h,encIv:e.buffer})});return h.apply(this,arguments)}g.createEncryptedEventResponseMsgData=a}),98); __d("WAWebEventEditDecryptedMsgDataConversion",["WALongInt","WANullthrows","WAWebE2EProtoUtils","WAWebEventsParseEventCreationMessageProto","WAWebEventsValidationError","WAWebMsgKeyUtils","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebProtobufsE2E.pb","WAWebViewMode.flow","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a,b){a=c("WANullthrows")(a.protocolMessage,"[Event][Edit] Missing protocol message");if(a.type!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_INVALID_PROTOCOL_MESSAGE_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.EDIT_TYPE_AND_PROTOCOL_MISMATCH);var e=d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(b),f=c("WANullthrows")(d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(a.key,e)),g=a.editedMessage;if(g==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_EDITED_MESSAGE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);a=d("WALongInt").maybeNumberOrThrowIfTooLarge(a.timestampMs);if(a==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_SENDER_TIMESTAMP,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);g=c("WANullthrows")(c("WAWebEventsParseEventCreationMessageProto")({messageProtobuf:babelHelpers["extends"]({},g,{messageContextInfo:{messageSecret:c("WANullthrows")(b.messageSecret).buffer}}),baseMessage:e,msgContext:"relay"}),"[Event][Edit] Failed to parse edited event fields");e=g.msgData;return babelHelpers["extends"]({},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Message),{id:b.id,t:Math.floor(c("WANullthrows")(a)/1e3),type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,subtype:"event_edit_decrypted",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.ProtocolEventEdit,latestEditSenderTimestampMs:a,latestEditMsgKey:b.id,protocolMessageKey:f,editMsgType:d("WAWebMsgType").MSG_TYPE.EVENT_CREATION,eventName:c("WANullthrows")(e==null?void 0:e.eventName),eventStartTime:c("WANullthrows")(e==null?void 0:e.eventStartTime),isEventCanceled:(g=e==null?void 0:e.isEventCanceled)!=null?g:!1,eventLocation:(a=e==null?void 0:e.eventLocation)!=null?a:void 0,eventDescription:(b=e==null?void 0:e.eventDescription)!=null?b:void 0,eventJoinLink:(f=e==null?void 0:e.eventJoinLink)!=null?f:void 0,eventEndTime:(g=e==null?void 0:e.eventEndTime)!=null?g:void 0})}g.protobufToEventEditDecryptedMsgData=a}),98); __d("WAWebGenerateEventEditSystemMessages",["Promise","WANullthrows","WAWebBackendApi","WAWebDBProcessMessage","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a[0];a=a[1];var e=d("WAWebWidFactory").createWid(c);c=(yield (h||(h=b("Promise"))).all(a.map(function(a){var b=a.protocolMsg.latestEditSenderTimestampMs;if(b==null||d("WAWebMsgGetters").getIsFailed(a.protocolMsg))return;return j(e,b,a)}).filter(Boolean)));a=(yield d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:e,msgObjs:c,meta:{add:"after",isHistory:!1},processMessagesOrigin:"eventEditMessage"}));a&&(yield d("WAWebDBProcessMessage").storeMessages(c,e))});return function(b){return a.apply(this,arguments)}}()))});return i.apply(this,arguments)}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f,g=e.editedMsgData,h=e.protocolMsg,i=d("WAWebUserPrefsMeUser").getMeUser(),j=c("WANullthrows")(d("WAWebMsgGetters").getSender(h));g={eventName:c("WANullthrows")(g==null?void 0:g.eventName),eventStartTime:c("WANullthrows")(g==null?void 0:g.eventStartTime),eventEndTime:g==null?void 0:g.eventEndTime,isEventCanceled:(f=g==null?void 0:g.isEventCanceled)!=null?f:!1,eventLocation:(f=g==null?void 0:g.eventLocation)!=null?f:void 0,eventDescription:(f=g==null?void 0:g.eventDescription)!=null?f:void 0,eventJoinLink:(f=g==null?void 0:g.eventJoinLink)!=null?f:void 0};return babelHelpers["extends"]({id:new(c("WAWebMsgKey"))({id:yield c("WAWebMsgKey").newId(),fromMe:d("WAWebUserPrefsMeUser").isMeAccount(j),remote:a,participant:j}),author:j,from:a,to:i,t:h.t,type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,subtype:"event_edit_decrypted",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.ProtocolEventEdit,editMsgType:d("WAWebMsgType").MSG_TYPE.EVENT_CREATION,latestEditMsgKey:h.latestEditMsgKey,latestEditSenderTimestampMs:b,protocolMessageKey:e.parentMsg.id},g)});return k.apply(this,arguments)}g.generateEventEditSystemMessages=a}),98); __d("WAWebPrepareEventResponsesToUpsert",["WANullthrows","WAWebAddonDBTable","WAWebLidMigrationUtils","WAWebMaxPerGroup","WAWebMsgGetters","WAWebMsgType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WAWebWidFactory").createWidFromWidLike(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)));return String(a.parentMsgKey)+"|"+String(d("WAWebLidMigrationUtils").toLid(b))+"|"+String(d("WAWebLidMigrationUtils").toPn(b))}function i(a){return d("WAWebMaxPerGroup").maxPerGroup(a,function(a){return a.senderTimestampMs},h)}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(function(a){return[a.parentMsgKey,c("WANullthrows")(d("WAWebMsgGetters").getSender(a))]});a=i(a);b=(yield d("WAWebAddonDBTable").addonDBTable.bulkGetByParentAndSender(d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,b));var e=new Map();b.forEach(function(a){a.kind===d("WAWebMsgType").MsgKind.EventResponseDecrypted&&e.set(h(a),a)});var f=[];a.forEach(function(a){var b=e.get(h(a));if(b!=null&&b.senderTimestampMs>a.senderTimestampMs)return;var c=b!=null&&b.eventResponse===a.eventResponse;b=(b=b==null?void 0:b.read)!=null?b:!1;c=c&&b&&a.read!==b?babelHelpers["extends"]({},a,{read:!0}):a;f.push(c)});return f});return j.apply(this,arguments)}g.getNewestEventResponses=i;g.prepareEventResponsesToUpsert=a}),98); __d("WAWebProcessEncryptedEventEditMsgs",["Promise","WALogger","WAWebABProps","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebAddonInfraError","WAWebApiContact","WAWebDBProcessEditProtocolMsgs","WAWebEventEditDecryptedMsgDataConversion","WAWebEventsValidationError","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebVerifyProtobufMsgObjectKeys","WAWebWamEnumE2eFailureReason","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Processing encrypted event edit failed: ","\n",""],["Processing encrypted event edit failed: ","\\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Processing encrypted event edit failed: ",""]);j=function(){return a};return a}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=new Map();a.forEach(function(a){if(a.kind!==d("WAWebMsgType").MsgKind.EventEditEncrypted)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedMsgType);var b=c.getForAddon(a);e.set(a,b)});if(e.size===0)return[];a=(yield (h||(h=b("Promise"))).allSettled(Array.from(e.entries()).map(function(a){var b=a[0];a=a[1];return l(b,a)})));return a.map(function(a){switch(a.status){case"fulfilled":return a.value;case"rejected":a=a.reason;if(a instanceof d("WAWebEventsValidationError").EventCreationValidationError||a instanceof d("WAWebEventsValidationError").EncryptedEventEditValidationError||a instanceof d("WAWebAddonEncryptionError").DualEncryptionValidationError){d("WALogger").ERROR(j(),a.code).sendLogs(a.code);return}d("WALogger").ERROR(i(),a.message,a.stack).sendLogs("event_edit_unknown_error")}}).filter(Boolean)});return k.apply(this,arguments)}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.encIv,f=a.encPayload,g=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.EventEditEncrypted,b),h=d("WAWebMsgGetters").getOriginalSender(b),i=d("WAWebMsgGetters").getSender(a);if(i==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(h==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_MISSING_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(!c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(i,h)))throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_PARENT_SENDER_MISMATCH,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f={type:d("WAWebMsgType").MsgKind.EventEditEncrypted,encryptedAddOn:f};i=d("WAWebWidFactory").toUserWid(i);if(d("WAWebABProps").getABPropConfigValue("lid_one_to_one_migration_event_response_force_pn_jid")){if(h.isLid()){var j;h=(j=d("WAWebApiContact").getPhoneNumber(h))!=null?j:h}if(i.isLid()){i=(j=d("WAWebApiContact").getPhoneNumber(i))!=null?j:i}}j=(yield d("WAWebAddonEncryption").decryptAddOn(f,{messageSecret:g,iv:e,stanzaId:b.id.id,originalMessageSender:h,addOnSender:i}));f=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,j);e=d("WAWebEventEditDecryptedMsgDataConversion").protobufToEventEditDecryptedMsgData((g=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(f))!=null?g:f,a);return d("WAWebDBProcessEditProtocolMsgs").generateMessageEdit(b,e)});return m.apply(this,arguments)}g.processEncryptedEventEditMsgs=a}),98); __d("WAWebProcessEncryptedEventResponseMsgs",["Promise","WALogger","WALongInt","WANullthrows","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebEventResponseMsgDataConversion","WAWebEventsValidationError","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebWamEnumE2eFailureReason","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Processing encrypted event response failed: ","\n",""],["Processing encrypted event response failed: ","\\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Processing encrypted event response failed: ",""]);j=function(){return a};return a}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=[],f=new Map();a.forEach(function(a){if(a.addonEncrypted){var b=c.getForAddon(a);f.set(a,b)}else e.push(a)});if(f.size===0)return e;a=(yield (h||(h=b("Promise"))).allSettled(Array.from(f.entries()).map(function(a){var b=a[0];a=a[1];return l(b,a)})));return e.concat(a.map(function(a){switch(a.status){case"fulfilled":return a.value;case"rejected":a=a.reason;if(a instanceof d("WAWebEventsValidationError").EventCreationValidationError||a instanceof d("WAWebEventsValidationError").EncryptedEventResponseValidationError){d("WALogger").ERROR(j(),a.code).sendLogs(a.code);return}d("WALogger").ERROR(i(),a.message,a.stack).sendLogs("unknown-error")}}).filter(Boolean))});return k.apply(this,arguments)}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.encIv,f=a.encPayload,g=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.EventResponseEncrypted,b),h=d("WAWebMsgGetters").getOriginalSender(b),i=d("WAWebMsgGetters").getSender(a);if(i==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(h==null)throw new(d("WAWebEventsValidationError").EventCreationValidationError)(d("WAWebEventsValidationError").EventCreationValidationErrorCode.EVENT_CREATION_MISSING_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f={type:d("WAWebMsgType").MsgKind.EventResponseEncrypted,encryptedAddOn:f};i=d("WAWebWidFactory").toUserWid(i);f=(yield d("WAWebAddonEncryption").decryptAddOn(f,{messageSecret:g,iv:e,stanzaId:b.id.id,originalMessageSender:h,addOnSender:i}));g=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsE2E.pb").Message$EventResponseMessageSpec,f);return d("WAWebEventResponseMsgDataConversion").protobufToEventResponseMsgData({responseProtobuf:g,parentMsgKey:a.targetMessageKey,id:a.id,senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(g.timestampMs)),t:d("WAWebMsgGetters").getT(a),ack:(e=a.ack)!=null?e:null,read:d("WAWebUserPrefsMeUser").isMeAccount(i)})});return m.apply(this,arguments)}g.processEncryptedEventResponseMsgs=a;g.decryptEncryptedEventResponseMsg=l}),98); __d("WAWebEventsParseWebMsgInfoEventResponse",["WALogger","WALongInt","WANullthrows","WAWebAddOnParseWebMsgInfo","WAWebEventResponseMsgDataConversion","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMsgInfoEventResponses failed with error "," "," and stack ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed to parse eventResponse with error ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.webMsgInfo,e=a.parsedWebMsgInfo,f=a.isFromCag;try{if(!(b==null?void 0:b.eventResponses)||!e||e.type!==d("WAWebMsgType").MSG_TYPE.EVENT_CREATION)return[];var g=e;return b.eventResponses.map(function(a){try{var b,e=(b=c("WANullthrows"))(a.eventResponseMessageKey,"eventResponseMessageKey"),h=b(a.eventResponseMessage,"eventResponseMessage");e=b(d("WAWebAddOnParseWebMsgInfo").buildAddonMsgKey(e,f));e=e.msgKey;return d("WAWebEventResponseMsgDataConversion").protobufToEventResponseMsgData({responseProtobuf:h,id:e,parentMsgKey:g.id,senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(b(h.timestampMs,"senderTimestampMs")),t:d("WAWebAddOnParseWebMsgInfo").getAddonServerTimestamp(a.timestampMs),ack:null,read:a.unread!==!0})}catch(a){d("WALogger").ERROR(i(),a.message).devConsole(a).sendLogs("parseWebMsgInfoEventResponses-responses-parse-error");return null}}).filter(Boolean)}catch(a){d("WALogger").ERROR(h(),a==null?void 0:a.name,a==null?void 0:a.code,a==null?void 0:a.stack).sendLogs("parseWebMsgInfoEventResponses-error");return[]}});return j.apply(this,arguments)}g.parseWebMsgInfoEventResponses=a}),98); __d("WAWebEventsParseEventEditEncryptedMessageProto",["WAWebE2EProtoUtils","WAWebEventsValidationError","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage;a.msgContext;a=b.secretEncryptedMessage;b=b.messageContextInfo;if(a==null||a.secretEncType!==d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT)return;var e=a.targetMessageKey,f=a.encPayload;a=a.encIv;e=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(e,c);if(e==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_TARGET_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(a==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(a.byteLength!==12)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_INVALID_SIZE_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if((b==null?void 0:b.messageSecret)==null)throw new(d("WAWebEventsValidationError").EncryptedEventEditValidationError)(d("WAWebEventsValidationError").EncryptedEventEditValidationErrorCode.EVENT_EDIT_MISSING_MESSAGE_SECRET,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MISSING_MESSAGE_SECRET);return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.EVENT_EDIT_ENCRYPTED,kind:d("WAWebMsgType").MsgKind.EventEditEncrypted,encIv:a,encPayload:f,targetMessageKey:e}),contextInfo:null}}g["default"]=a}),98); __d("WAWebEventsParseEventResponseMessageProto",["WAWebE2EProtoUtils","WAWebEventsValidationError","WAWebMsgType","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.encEventResponseMessage;if(b==null)return null;var c=b.eventCreationMessageKey,e=b.encPayload;b=b.encIv;c=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(c,a);if(c==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(b==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(b.byteLength!==12)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_INVALID_SIZE_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebEventsValidationError").EncryptedEventResponseValidationError)(d("WAWebEventsValidationError").EncryptedEventResponseValidationErrorCode.EVENT_RESPONSE_MISSING_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE,kind:d("WAWebMsgType").MsgKind.EventResponseEncrypted,addonEncrypted:!0,encIv:b,encPayload:e,targetMessageKey:c}),contextInfo:null}}g["default"]=a}),98); __d("WAWebGenerateInteractiveResponseReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebParseButtonsResponseMessageProto",["WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.buttonsResponseMessage;if(b==null)return;if(b.type===d("WAWebProtobufsE2E.pb").Message$ButtonsResponseMessage$Type.DISPLAY_TEXT){var c=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.BUTTONS_RESPONSE,kind:d("WAWebMsgType").MsgKind.ButtonsResponse,selectedButtonId:b.selectedButtonId,body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(b.selectedDisplayText)});return{msgData:c,contextInfo:b.contextInfo}}return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown}),contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebParseHsmMessageProto",["WAWebE2EProtoUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.highlyStructuredMessage;if(b==null)return;b=(b=b.hydratedHsm)==null?void 0:b.hydratedTemplate;return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.HSM,kind:d("WAWebMsgType").MsgKind.Hsm,body:b?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(b.hydratedContentText):a.body}),contextInfo:void 0}}g["default"]=a}),98); __d("WAWebParseInteractiveMessageProto",["WAWebABProps","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebHandleMsgError","WAWebInteractiveMessageHeaderMediaType","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgKey","WAWebMsgType","WAWebNativeFlowValidation","WAWebParseDocumentMessageProto","WAWebParseImageMessageProto","WAWebParseProductMessageProto","WAWebParseVideoMessageProto","WAWebWamEnumE2eFailureReason","filterNulls"],(function(a,b,c,d,e,f,g){var h=d("WAWebABProps").getABPropConfigValue("enable_product_carousel_message");function a(a){var b=a.messageProtobuf,e=a.baseMessage,f=a.bizInfo,g=a.bizSource;a=a.msgContext;b=b.interactiveMessage;if(b==null)return;var h=d("WAWebE2EProtoUtils").getInteractiveMessageTypeForProto(b);if(!h||!d("WAWebE2EProtoUtils").isInteractiveMessageTypeEnabled(h))return l(e,b);var k=b.body,m=b.footer,n=d("WAWebE2EProtoUtils").getInteractiveMessageFieldNameForType(h);k={type:d("WAWebMsgType").MSG_TYPE.INTERACTIVE,kind:d("WAWebMsgType").MsgKind.Interactive,caption:(k=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(k==null?void 0:k.text))!=null?k:"",interactiveType:h,interactivePayload:b[n],pmCampaignId:f==null?void 0:f.campaignId,bizSource:g};if(!d("WAWebE2EProtoUtils").isSupportedInteractiveMessageVersion(h,b[n]))return l(e,b);n=null;var o=b.carouselMessage;if(o!=null){n=j(e,o,a,f,g);if(n==null)return l(e,b)}if(h===c("WAWebInteractiveMessageType").NATIVE_FLOW){o=c("WAWebInteractiveMessagesNativeFlowName").cast(d("WAWebE2EProtoUtils").getBizNativeFlowName({interactiveMessage:b}));o===c("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW&&d("WAWebE2EProtoUtils").addFlowJSONToGalaxyMessageInteractiveMessage(k);k=babelHelpers["extends"]({},k,{nativeFlowName:o});if(a==="relay"){if(!d("WAWebE2EProtoUtils").isValidNativeFlowName({name:o,bizInfo:f,msgContext:a})||!d("WAWebNativeFlowValidation").isValidNativeFlowMessage(k,g,e==null?void 0:(h=e.id)==null?void 0:h.fromMe))return l(e,b)}}o=b.header!=null?i(b.header,e,a):void 0;return{msgData:babelHelpers["extends"]({},e,(f=o==null?void 0:o.headerMessage)!=null?f:{},k,{interactiveHeader:o==null?void 0:o.interactiveHeader,footer:m?d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(m.text):e.footer,carouselCardsParsed:(g=n)!=null?g:void 0}),contextInfo:b.contextInfo}}function i(a,b,e){var f=function(){if(a.imageMessage){var f;f=(f=c("WAWebParseImageMessageProto")({messageProtobuf:{imageMessage:a.imageMessage},baseMessage:b,msgContext:e}))==null?void 0:f.msgData;if(f&&f.kind!==d("WAWebMsgType").MsgKind.Image)throw new(d("WAWebHandleMsgError").MessageValidationError)("parseInteractiveHeaderMessageProto: header imageMessage is not an ImageMsgData",d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{headerMessage:f,mediaType:d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE}}if(a.documentMessage){return{headerMessage:(f=c("WAWebParseDocumentMessageProto")({messageProtobuf:{documentMessage:a.documentMessage},baseMessage:b,msgContext:e}))==null?void 0:f.msgData,mediaType:d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT}}if(a.videoMessage){f=(f=c("WAWebParseVideoMessageProto")({messageProtobuf:{videoMessage:a.videoMessage},baseMessage:b,msgContext:e}))==null?void 0:f.msgData;if(f&&f.kind!==d("WAWebMsgType").MsgKind.Video)throw new(d("WAWebHandleMsgError").MessageValidationError)("parseInteractiveHeaderMessageProto: header videoMessage is not an VideoMsgData",d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{headerMessage:f,mediaType:d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO}}if(h&&a.productMessage){f=(f=c("WAWebParseProductMessageProto")({messageProtobuf:{productMessage:a.productMessage},baseMessage:b,msgContext:e}))==null?void 0:f.msgData;return{headerMessage:f,mediaType:d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.PRODUCT}}};f=a.hasMediaAttachment===!0?f():void 0;return{headerMessage:f==null?void 0:f.headerMessage,interactiveHeader:{title:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(a.title),subtitle:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(a.subtitle),thumbnail:d("WAWebE2EProtoParserApi").decodeBytes(a.jpegThumbnail),hasMediaAttachment:Boolean(a.hasMediaAttachment),mediaType:f==null?void 0:f.mediaType}}}function j(a,b,d,e,f){b=b.cards.map(function(b){return k(b,a,d,e,f)});b=c("filterNulls")(b);return b.length===0?null:b}function k(a,b,e,f,g){var j=a.body,k=a.header,l=d("WAWebE2EProtoUtils").getInteractiveMessageTypeForProto(a);if(!l||!d("WAWebE2EProtoUtils").isInteractiveMessageTypeEnabled(l))return null;j=babelHelpers["extends"]({},k,{type:d("WAWebMsgType").MSG_TYPE.INTERACTIVE,kind:d("WAWebMsgType").MsgKind.Interactive,caption:(j=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(j==null?void 0:j.text))!=null?j:"",interactiveType:l,interactivePayload:a.nativeFlowMessage,pmCampaignId:f==null?void 0:f.campaignId,bizSource:g});l=k!=null?i(k,b,e):void 0;a=l==null?void 0:l.headerMessage;if(l==null||a==null)return null;f=babelHelpers["extends"]({},l.interactiveHeader,{title:null,subtitle:null});g=new(c("WAWebMsgKey"))({fromMe:a.id.fromMe,remote:a.id.remote,participant:a.id.participant,id:c("WAWebMsgKey").newId_DEPRECATED()});if(a.type===d("WAWebMsgType").MSG_TYPE.VIDEO)return babelHelpers["extends"]({},a,j,{id:g,interactiveHeader:f,footer:null,isCarouselCard:!0,parentMsgId:b.id.clone()});if(a.type===d("WAWebMsgType").MSG_TYPE.IMAGE)return babelHelpers["extends"]({},a,j,{id:g,interactiveHeader:f,footer:null,isCarouselCard:!0,parentMsgId:b.id.clone()});if(h&&a.type===d("WAWebMsgType").MSG_TYPE.PRODUCT)return babelHelpers["extends"]({},a,j,{id:g,interactiveHeader:f,footer:null,isCarouselCard:!0,parentMsgId:b.id.clone()})}function l(a,b){return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebParseInteractiveResponseMessageProto",["WAWebBizGatingUtils","WAWebE2EProtoUtils","WAWebGalaxyFlowsUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.bizInfo;a=a.msgContext;b=b.interactiveResponseMessage;if(b==null)return;var f=d("WAWebE2EProtoUtils").getInteractiveResponseMessageTypeForProto(b);if(!d("WAWebBizGatingUtils").interactiveNativeFlowResponseMessagesEnabled()||!f||!d("WAWebE2EProtoUtils").isInteractiveResponseMessageTypeEnabled(f))return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo};if(d("WAWebGalaxyFlowsUtils").isResponseFlowSupported(b))return d("WAWebE2EProtoUtils").getGalaxyMessageInteractiveResponse(c,b);try{var g;return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.INTERACTIVE_RESPONSE,kind:d("WAWebMsgType").MsgKind.InteractiveResponse,body:(g=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis((g=b.body)==null?void 0:g.text))!=null?g:"",interactivePayload:d("WAWebE2EProtoUtils").getInteractiveResponsePayload({type:f,message:b,bizInfo:e,msgContext:a})}),contextInfo:b.contextInfo}}catch(a){return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo}}}g["default"]=a}),98); __d("WAWebParseListResponseMessageProto",["WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.listResponseMessage;if(b==null)return;if(b.listType===d("WAWebProtobufsE2E.pb").Message$ListResponseMessage$ListType.SINGLE_SELECT){var c=babelHelpers["extends"]({},b,{contextInfo:void 0}),e=b.title||"";b.description!=null&&b.description!==""&&(e+="\n"+b.description);a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.LIST_RESPONSE,kind:d("WAWebMsgType").MsgKind.ListResponse,listResponse:c,body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(e)});return{msgData:a,contextInfo:b.contextInfo}}}g["default"]=a}),98); __d("WAWebParseNativeFlowButtonsMessageProto",["WAWebButtonsMessageProtoUtils","WAWebE2EProtoUtils","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebNativeFlowValidation","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage,f=a.bizInfo,g=a.bizSource;a=a.msgContext;b=b.buttonsMessage;if(b==null)return;var h=b.buttons;h=h===void 0?[]:h;var i=b.headerType,j=c("WAWebInteractiveMessagesNativeFlowName").cast(d("WAWebE2EProtoUtils").getBizNativeFlowName({buttonsMessage:b}));if(a==="relay"&&(j==null||j!==c("WAWebInteractiveMessagesNativeFlowName").cast(f==null?void 0:f.nativeFlowName)))return;if(!d("WAWebE2EProtoUtils").shouldParseNFM({name:j,bizInfo:f,msgContext:a})||d("WAWebE2EProtoUtils").hasUnsupportedButtons(h))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo};if(i===d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.UNKNOWN||!new Set(d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.members()).has(i))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:void 0}),contextInfo:b.contextInfo};f=d("WAWebButtonsMessageProtoUtils").parseButtonsMessageProto({buttonsMessage:b,baseMessage:e,msgContext:a});if(j==null)return;i=babelHelpers["extends"]({},f,{type:d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW,kind:d("WAWebMsgType").MsgKind.NativeFlow,nativeFlowName:c("WAWebInteractiveMessagesNativeFlowName").cast(j),nativeFlowButtons:h});return!i.nativeFlowName||!d("WAWebNativeFlowValidation").isValidNativeFlowMessage(i,g)?{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b.contextInfo}:{msgData:i,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebParseTemplateButtonReplyMessageProto",["WAWebE2EProtoUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.templateButtonReplyMessage;if(b==null)return;a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.TEMPLATE_BUTTON_REPLY,kind:d("WAWebMsgType").MsgKind.TemplateButtonReply,body:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(b.selectedDisplayText),selectedIndex:b.selectedIndex,selectedId:b.selectedId,selectedCarouselCardIndex:b.selectedCarouselCardIndex});return{msgData:a,contextInfo:b.contextInfo}}g["default"]=a}),98); __d("WAWebDBUpdateChatTable",["WALogger","WAWebMiscErrors","WAWebSchemaChat","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateChatTable: failed to update in storage"]);h=function(){return a};return a}function a(a,b){return d("WAWebSchemaChat").getChatTable().merge(a.toString(),b)["catch"](function(a){if(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort)throw a;d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("updateChatTable failed");throw c("err")("updateChatTable failed")})}g.updateChatTable=a}),98); __d("WAWebLimitSharingModelUtils",["WAWebBackendApi","WAWebContactSystemMsg","WAWebDBUpdateChatTable","WAWebHandleSingleMsg","WAWebProtobufsProtocol.pb","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaChat").getChatTable().get(a)});return i.apply(this,arguments)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebDBUpdateChatTable").updateChatTable(a,{limitSharing:b}),d("WAWebBackendApi").frontendFireAndForget("updateChatLimitSharing",{id:a,limitSharing:b})});return k.apply(this,arguments)}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=(yield h(a.toString()));if((a==null?void 0:(b=a.limitSharing)==null?void 0:b.sharingLimited)===!0){b={sharingLimited:a.limitSharing.sharingLimited,trigger:a.limitSharing.trigger};a=d("WAWebWidFactory").createWid(a.id);yield n(a,b)}});return l.apply(this,arguments)}function c(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatWID;a=a.sharingLimited;if(a===!0){var c=(yield h(b.toString()));if((c==null?void 0:(c=c.limitSharing)==null?void 0:c.sharingLimited)!==a){c={sharingLimited:a,trigger:d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.UNKNOWN};yield j(b,c);return n(b,c)}}});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebContactSystemMsg").genLimitSharingUpdateSystemMsg(a,b);yield d("WAWebHandleSingleMsg").handleSingleMsg(a,b,"limitSharing");return b});return o.apply(this,arguments)}g.getChat=h;g.updateChat=j;g.createLimitSharingMsgOnChatClear=a;g.genLimitSharingSystemMessageOnPersistedChat=c;g.genLimitSharingSystemMessage=n}),98); __d("WAWebLimitSharingPropMappingUtils",["WAWebProtobufsProtocol.pb"],(function(a,b,c,d,e,f,g){"use strict";function a(a){switch(a){case"1":return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.CHAT_SETTING;case"2":return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.BIZ_SUPPORTS_FB_HOSTING;case"3":return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.UNKNOWN_GROUP;default:return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.UNKNOWN}}function b(a){switch(a){case"CHAT_SETTING":return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.CHAT_SETTING;case"BIZ_SUPPORTS_FB_HOSTING":return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.BIZ_SUPPORTS_FB_HOSTING;default:return d("WAWebProtobufsProtocol.pb").LimitSharing$Trigger.UNKNOWN}}g.getLimitSharingTriggerFromHistorySyncStubParameter=a;g.getLimitSharingTriggerFromGroupSettingsChange=b}),98); __d("WAWebLimitSharingProtoUtils",["Promise","WAWebCommonMsgSubtypeTypes","WAWebLimitSharingModelUtils","WAWebLimitSharingPropMappingUtils","WAWebMsgType","WAWebProtobufsWeb.pb","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.limitSharingMessage;b=b.protocolMessage;c=(c=c==null?void 0:(c=c.message)==null?void 0:(c=c.protocolMessage)==null?void 0:c.limitSharing)!=null?c:b==null?void 0:b.limitSharing;c&&(yield l(a,c,d("WAWebWidFactory").createWid(a.from.toString())))});return i.apply(this,arguments)}function c(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.messageStubType===d("WAWebProtobufsWeb.pb").WebMessageInfo$StubType.CHANGE_LIMIT_SHARING){var c=a.messageStubParameters,e=c[0],f=c[1];c=c[2];e={sharingLimited:e==="true",limitSharingSettingTimestamp:Number(a.messageTimestamp)*1e3,trigger:d("WAWebLimitSharingPropMappingUtils").getLimitSharingTriggerFromHistorySyncStubParameter(f)};a=q(e,d("WAWebWidFactory").createWid(c));yield r(b,a)}});return j.apply(this,arguments)}function e(a){return{sharingLimited:a.limitSharing,trigger:d("WAWebLimitSharingPropMappingUtils").getLimitSharingTriggerFromHistorySyncStubParameter(String(a.limitSharingTrigger)),initiatedByMe:a.limitSharingInitiatedByMe,limitSharingSettingTimestamp:a.limitSharingSettingTimestamp}}function f(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if((b==null?void 0:b.limitSharingV2)!=null){b=q(b==null?void 0:b.limitSharingV2,d("WAWebWidFactory").createWid(a.from.toString()));yield n(a,b)}});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=q(b,c);yield r(a,b);yield n(a,b)});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield t(a.id.remote));if(a&&p(b,a)){a=d("WAWebWidFactory").createWid(a.id);yield d("WAWebLimitSharingModelUtils").updateChat(a,b)}});return o.apply(this,arguments)}function p(a,b){a=(a=a==null?void 0:a.limitSharingSettingTimestamp)!=null?a:0;b=(b=b==null?void 0:(b=b.limitSharing)==null?void 0:b.limitSharingSettingTimestamp)!=null?b:0;return Number(a)>Number(b)}function q(a,b){return{sharingLimited:a==null?void 0:a.sharingLimited,trigger:a==null?void 0:a.trigger,limitSharingSettingTimestamp:a==null?void 0:a.limitSharingSettingTimestamp,initiatedBy:b}}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a.type=d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE,a.subtype=d("WAWebCommonMsgSubtypeTypes").MsgSubtype.LimitSharingSystemMessage,a.limitSharing=b});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=2,e=5e3,f=0;while(f<c){var g=(yield d("WAWebLimitSharingModelUtils").getChat(a.toString()));if(g!=null)return g;yield new(h||(h=b("Promise")))(function(a){return window.setTimeout(a,e)});f++}});return u.apply(this,arguments)}g.parseLimitSharingFromProtocolMessage=a;g.parseLimitSharingFromProtocolHistorySyncMessage=c;g.getLimitSharingFromProtocolHistorySyncConversation=e;g.parseLimitSharingFromRegularMessage=f}),98); __d("WAWebParseLocationMessageProto",["WALongInt","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(a,b){var c;c=((c=a.name)!=null?c:"")||((c=a.address)!=null?c:"");a.name!=null&&a.name!==""&&a.address!=null&&a.address!==""&&(c=a.name+"\n"+a.address);var e=a.degreesLatitude!==void 0?a.degreesLatitude:void 0,f=a.degreesLongitude!==void 0?a.degreesLongitude:void 0;b=babelHelpers["extends"]({},b,{type:d("WAWebMsgType").MSG_TYPE.LOCATION,kind:d("WAWebMsgType").MsgKind.Location,loc:c,lat:e,lng:f,body:d("WAWebE2EProtoParserApi").decodeBytes(a.jpegThumbnail)||"",clientUrl:a.url});return{msgData:b,contextInfo:a.contextInfo}}function i(a,b,c){var e={};c&&(e={finalLat:c.degreesLatitude,finalLng:c.degreesLongitude,finalThumbnail:d("WAWebE2EProtoParserApi").decodeBytes(c.jpegThumbnail)||"",finalAccuracy:c.accuracyInMeters,finalSpeed:c.speedInMps,finalDegrees:c.degreesClockwiseFromMagneticNorth,finalTimeOffset:c.timeOffset});c=babelHelpers["extends"]({},b,e,{type:d("WAWebMsgType").MSG_TYPE.LOCATION,kind:d("WAWebMsgType").MsgKind.LocationLive,isLive:!0,lat:a.degreesLatitude,lng:a.degreesLongitude,body:d("WAWebE2EProtoParserApi").decodeBytes(a.jpegThumbnail)||"",accuracy:a.accuracyInMeters,speed:a.speedInMps,degrees:a.degreesClockwiseFromMagneticNorth,comment:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(a.caption),sequence:d("WALongInt").maybeNumberOrThrowIfTooLarge(a.sequenceNumber)});return{msgData:c,contextInfo:a.contextInfo}}function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.finalLocation;var d=b.locationMessage;b=b.liveLocationMessage;var e=null;d!=null&&(e=h(d,c));b!=null&&(e=i(b,c,a));return e}g["default"]=a}),98); __d("WAWebAssociationProtoUtils",["WANullthrows","WAWebAssociationProcessor","WAWebE2EProtoUtils","WAWebLidMigrationUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationValidation","WAWebNewsletterIsNewsletterMsg","WAWebProtobufsE2E.pb","WAWebWamEnumE2eFailureReason","WAWebWid","err"],(function(a,b,c,d,e,f,g){"use strict";function h(a){a=d("WAWebMessageAssociation.flow").MessageAssociationType.cast(d("WAWebProtobufsE2E.pb").MessageAssociation$AssociationType.getName(a));return(a=a)!=null?a:d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN}function i(a){switch(a){case d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN:throw c("err")("Invalid outgoing association type");case d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM:return d("WAWebProtobufsE2E.pb").MessageAssociation$AssociationType.MEDIA_ALBUM;case d("WAWebMessageAssociation.flow").MessageAssociationType.BOT_PLUGIN:return d("WAWebProtobufsE2E.pb").MessageAssociation$AssociationType.BOT_PLUGIN;case d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL:return d("WAWebProtobufsE2E.pb").MessageAssociation$AssociationType.MEDIA_POLL}}function a(a,b){return a==null||b==null?void 0:{messageAssociation:{associationType:i(a),parentMessageKey:d("WAWebE2EProtoUtils").msgKeyToProtobuf(b)}}}function j(a,b,e){var f=c("WAWebNewsletterIsNewsletterMsg")({from:b.from,to:b.to});return e==="history"&&!f?d("WAWebE2EProtoUtils").protobufToMsgKey(a):d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(a,b)}function b(a,b,e){b=j(a.parentMessageKey,b,e);e=h(a.associationType);a=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(e);if(a==null)throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.UNSUPPORTED_ASSOCIATION_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{associationParentMsgKey:c("WANullthrows")(b),associationType:e,viewMode:a.viewMode}}function e(a,b,e){b=b==null?void 0:b.messageAssociation;if(b!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){if(e==="history_quoted"||e==="quoted")return null;var f=b.parentMessageKey;b=b.associationType;if(b===d("WAWebProtobufsE2E.pb").MessageAssociation$AssociationType.STATUS_NOTIFICATION)return null;if(f==null)throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.MISSING_PARENT_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(b==null)throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.MISSING_ASSOCIATION_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==="history")return{associationType:b,parentMessageKey:f};e=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(f,a);if(e==null)throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.INVALID_PARENT_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);e=e.fromMe===a.id.fromMe&&c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(e.remote,a.id.remote))&&c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(e.participant,a.id.participant));if(!e)throw new(d("WAWebMessageAssociationValidation").MessageAssociationValidationError)(d("WAWebMessageAssociationValidation").MessageAssociationValidationErrorCode.MISMATCH_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.ERROR_PARENT_CHILD_SENDER_JID_MISMATCH);return{associationType:b,parentMessageKey:f}}return null}g.convertAssociationTypeFromProtoToClientSupportedAssociationType=h;g.convertAssociationTypeFromClientToProtoSupportedAssociationType=i;g.getValidatedOutgoingMessageAssociationContextInfo=a;g.getValidatedAssociationFieldsFromProto=b;g.validateMessageAssociationInMessageContextInfo=e}),98); __d("WAWebProcessMessageAssociationMessages",["WALogger","WAWebAddonProcessMsgsUtils","WAWebAddonSortUtils","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationValidation","WAWebViewMode.flow","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["classifyAssociatedMsgs: processor not found for ",""]);h=function(){return a};return a}function a(a,b){if(!d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled())return;a=a;a=j(a,b);b=a.orphans;a=a.nonOrphansFromCache;return l(b,a)}function c(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled())return;var c=(yield d("WAWebAddonProcessMsgsUtils").queryParentMsgs(a)),e=c[0];c=c[1];c=d("WAWebAddonSortUtils").collectValidAndOrphans(c,e);e=c.nonOrphans;c=c.orphans;a=e.length+c.length===a.length;if(!a)throw new(d("WAWebMessageAssociationValidation").MessageAssociationInfraError)(d("WAWebMessageAssociationValidation").MessageAssociationInfraErrorCode.MESSAGE_ASSOCIATIONS_MISMATCH);a=k(c,b);c=a.orphans;b=a.nonOrphansFromCache;return l(c,[].concat(e,b))});return i.apply(this,arguments)}function j(a,b){var c=[],d=[];a.forEach(function(a){b.has(a.parentMsgKey.toString())?c.push(a):d.push(a)});return{orphans:c,nonOrphansFromCache:d}}function k(a,b){var c=[],d=[];a.forEach(function(a){b.has(a.parentMsgKey.toString())?d.push(a):c.push(a)});return{orphans:c,nonOrphansFromCache:d}}function l(a,b){var c=[],e=[];a.forEach(function(a){var b=d("WAWebAssociationProcessor").getAssociationProcessor(a);b||d("WALogger").ERROR(h(),a.id.toString());(b==null?void 0:b.processorType)===d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages?e.push(a):c.push(a)});a=e.map(function(a){return babelHelpers["extends"]({},a,{viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE})});b=[].concat(b,a);var f=new Map();b.forEach(function(a){f.set(a.id.toString(),a)});return{orphanAssociatedMsgs:c,validAssociatedMsgs:f,detachedAssociatedMsgs:a}}g.classifyAssociatedMsgsFromHistorySyncUsingMissingParentsCache=a;g.classifyAssociatedMsgsUsingExistingParentsCache=c;g.collectOrphansFromMissingParentsCache=j;g.collectOrphansFromExistingParentsMessagesCache=k;g.classifyAssociatedOrphansNonOrphans=l}),98); __d("WAWebMessageEditValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_PROTOCOL_KEY:"missing_protocol_key",MISSING_EDITED_MESSAGE:"missing_edited_message"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="MessageEditValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.MessageEditValidationErrorCode=a;g.MessageEditValidationError=c}),98); __d("WAWebParseHistorySyncProtocolMessageEditProto",["WALogger","WALongInt","WAWebE2EProtoParser","WAWebE2EProtoUtils","WAWebMessageEditGatingUtils","WAWebMessageEditValidationError","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseHistorySyncEditedMessageProto: error:",", stack: ",""]);h=function(){return a};return a}function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.protocolMessage;if(b==null||(b==null?void 0:b.type)!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT)return;if(a!=="history"&&a!=="history_quoted")return;try{if(!d("WAWebMessageEditGatingUtils").receiveTextEditEnabled())return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"message_edit",futureproofType:d("WAWebMsgType").MSG_TYPE.PROTOCOL,futureproofSubtype:"message_edit"}),contextInfo:null};c=babelHelpers["extends"]({},c,{latestEditSenderTimestampMs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.timestampMs),latestEditMsgKey:c.id});var e=b.editedMessage;if(e==null)throw new(d("WAWebMessageEditValidationError").MessageEditValidationError)(d("WAWebMessageEditValidationError").MessageEditValidationErrorCode.MISSING_EDITED_MESSAGE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);b=b.key;if(b==null)throw new(d("WAWebMessageEditValidationError").MessageEditValidationError)(d("WAWebMessageEditValidationError").MessageEditValidationErrorCode.MISSING_PROTOCOL_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);Object.assign(c,d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:e,message:c,msgContext:a}));c.id=d("WAWebE2EProtoUtils").protobufToMsgKey(b,c.author);return{msgData:c,contextInfo:null}}catch(a){d("WALogger").WARN(h(),a==null?void 0:a.name,a==null?void 0:a.stack).tags("messaging").sendLogs("parseHistorySyncEditedMessageProto: EditParseError");throw a}}g["default"]=a}),98); __d("WAWebParseProtocolMessageEditProto",["WALogger","WALongInt","WANullthrows","WAWebE2EProtoParser","WAWebE2EProtoUtils","WAWebFutureproofingEdit","WAWebMessageEditGatingUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseProtocolMessageEditProto: error:",", stack: ",""]);h=function(){return a};return a}function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.protocolMessage;if(b==null||(b==null?void 0:b.type)!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT)return;if(a!=="relay"&&a!=="outgoing")return;try{var e;e=(e=(e=i(c,b,a))!=null?e:j(c,b))!=null?e:k(c,b,a);return!e?null:e}catch(a){d("WALogger").WARN(h(),a==null?void 0:a.name,a==null?void 0:a.stack).tags("messaging").sendLogs("parseProtocolMessageEditProto: EditParseError");throw a}}function i(a,b,e){var f;f=(f=(f=b.editedMessage)==null?void 0:(f=f.groupMentionedMessage)==null?void 0:f.message)!=null?f:b.editedMessage;var g=Boolean(f==null?void 0:f.conversation)||Boolean(f==null?void 0:f.extendedTextMessage);if(!g)return null;if(!d("WAWebMessageEditGatingUtils").receiveTextEditEnabled())return{msgData:d("WAWebFutureproofingEdit").futureproofEdit(a),contextInfo:null};g=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b.key,a);f=babelHelpers["extends"]({},d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:c("WANullthrows")(f),message:a,msgContext:e}),{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"message_edit",editMsgType:d("WAWebMsgType").MSG_TYPE.CHAT,latestEditSenderTimestampMs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.timestampMs),latestEditMsgKey:a.id,protocolMessageKey:g});return{msgData:f,contextInfo:null}}function j(a,b){var c;c=(c=(c=b.editedMessage)==null?void 0:(c=c.groupMentionedMessage)==null?void 0:c.message)!=null?c:b.editedMessage;var e,f,g;if(c==null?void 0:c.imageMessage)e=d("WAWebMsgType").MSG_TYPE.IMAGE,f=c.imageMessage.caption,g=c.imageMessage.contextInfo;else if(c==null?void 0:c.videoMessage)e=d("WAWebMsgType").MSG_TYPE.VIDEO,f=c.videoMessage.caption,g=c.videoMessage.contextInfo;else if(c==null?void 0:c.documentMessage)e=d("WAWebMsgType").MSG_TYPE.DOCUMENT,f=c.documentMessage.caption,g=c.documentMessage.contextInfo;else if(c==null?void 0:c.documentWithCaptionMessage){var h;e=d("WAWebMsgType").MSG_TYPE.DOCUMENT;f=(h=c.documentWithCaptionMessage)==null?void 0:(h=h.message)==null?void 0:(h=h.documentMessage)==null?void 0:h.caption;g=(h=c.documentWithCaptionMessage)==null?void 0:(c=h.message)==null?void 0:(h=c.documentMessage)==null?void 0:h.contextInfo}if(!e||f===""||f==null)return null;if(!d("WAWebMessageEditGatingUtils").receiveCaptionEditEnabled())return{msgData:d("WAWebFutureproofingEdit").futureproofEdit(a),contextInfo:null};c=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"message_edit",editMsgType:e,caption:f,latestEditSenderTimestampMs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.timestampMs),latestEditMsgKey:a.id,protocolMessageKey:d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b.key,a)});return{msgData:c,contextInfo:g}}function k(a,b,e){var f;f=(f=b.editedMessage)==null?void 0:f.richResponseMessage;if(!f)return null;f=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b.key,a);e=babelHelpers["extends"]({},d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:c("WANullthrows")(b.editedMessage),message:a,msgContext:e}),{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"message_edit",editMsgType:d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE,latestEditSenderTimestampMs:d("WALongInt").maybeNumberOrThrowIfTooLarge(b.timestampMs),latestEditMsgKey:a.id,protocolMessageKey:f});return{msgData:e,contextInfo:null}}g["default"]=a}),98); __d("WAWebDBStoreNewsletterEncryptedMsgs",["WALogger","WAPromiseMap","WAWebDBStoreMessage","WAWebDBStoreMessageAssociations","WAWebDBStoreMsgsUtils","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebNewsletterDBUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-store] Failed to store messages"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][storage] serverId is missing from message"]);i=function(){return a};return a}function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["message","chat","message-association"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var f=e[0];e[1];e[2];var g=(yield d("WAWebDBStoreMsgsUtils").getLastRowId(f));e=(yield d("WAPromiseMap").promiseMap(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f=a[0];a=a[1];e=(e=f.serverId)!=null?e:yield d("WAWebNewsletterDBUtils").getTemporaryServerId(f.to);if(e==null){d("WALogger").ERROR(i()).tags("newsletter").devConsole(f).sendLogs("newsletter-missing-serverId");return null}var h=c("WAWebMsgKey").fromString(f.id),j=d("WAWebDBStoreMessage").isPendingUnreadReceipt(h,f);f=d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:f,chatId:h.remote.toString(),hasLink:a,inChatMsgId:e,rowId:g+b+1,pendingReadReceipt:j});delete f.serverId;return f});return function(b,c){return a.apply(this,arguments)}}())).filter(Boolean);try{d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&(yield d("WAWebDBStoreMessageAssociations").bulkStoreMessageAssociations(e)),yield f.bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(e)}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a)}});return function(a){return e.apply(this,arguments)}}())}g.storeEncryptedNewsletterMessages=a}),98); __d("WAWebNewsletterDBConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({Subscriber:0,Admin:1,Guest:2,Owner:3});f.NewsletterDBMembership=a}),66); __d("WAWebNewsletterDBUtils",["WATimeUtils","WAWebApiChat","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebDBMsgUtils","WAWebJidToWid","WAWebMsgKey","WAWebMsgType","WAWebNewsletterDBConstants","WAWebSchemaMessage","WAWebSchemaNewsletterMetadata","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield d("WAWebApiChat").getChatRecord(d("WAWebJidToWid").newsletterJidToWid(a)))!=null});return h.apply(this,arguments)}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(a));return a==null||a.membershipType===d("WAWebNewsletterDBConstants").NewsletterDBMembership.Guest});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield i(a));return!a});return k.apply(this,arguments)}var l=Number.MAX_SAFE_INTEGER-1e4;function f(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebDBMessageUtils").craftInternalId(b,a);a=(yield d("WAWebSchemaMessage").getMessageTable().anyOf(["internalId"],[b]));b=a[0];return b==null?null:d("WAWebDBMessageSerialization").messageFromDbRow(b)});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=new Map(),e=new Map(a.map(function(a){return[d("WAWebDBMessageUtils").craftInternalId(b,a),a]}));a=(yield d("WAWebSchemaMessage").getMessageTable().anyOf(["internalId"],Array.from(e.keys())));a.forEach(function(a){if(a.internalId==null)return;var b=e.get(a.internalId);if(b==null)return;c.set(b,d("WAWebDBMessageSerialization").messageFromDbRow(a))});return c});return o.apply(this,arguments)}function p(a,b){b=b instanceof c("WAWebWid")?b:d("WAWebWidFactory").createWid(b);return new(c("WAWebMsgKey"))({remote:b,fromMe:!0,id:a.toString(10)})}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebDBMessageUtils").craftInternalId(a.toJid(),l);a=d("WAWebDBMessageUtils").endOfChat(a);b=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],b,a,{lowerInclusive:!0,upperInclusive:!1,limit:1,reverse:!0}));if(b.length===0)return l;if(b[0].internalId==null)return l;a=d("WAWebDBMessageUtils").getInChatMsgId(b[0].internalId);return Math.min(a+1,Number.MAX_SAFE_INTEGER)});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a.map(String)));a=a.filter(Boolean).map(function(a){return{id:a.id,viewed:!0}});yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(a)});return t.apply(this,arguments)}function u(a,b,c){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=(yield d("WAWebDBMsgUtils").getMsgsByChatId(b));var e=d("WATimeUtils").unixTime();b=b.filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE}).map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)});return b.filter(function(b){if(!b.from.equals(c))return!1;b=(b=b.newsletterAdminInviteInfo)!=null?b:{};var d=b.newsletterId;b=b.inviteExpiration;return d==null||b==null?!1:e<b&&a.equals(d)})});return v.apply(this,arguments)}g.doesNewsletterExistInStorage=a;g.isPreviewNewsletter=i;g.isSubscribedNewsletter=e;g.TEMPORARY_SERVER_ID_LOWER_BOUND=l;g.getMessageByServerId=f;g.bulkGetMessagesByServerIds=n;g.craftNewsletterMsgKeyFromServerId=p;g.getTemporaryServerId=q;g.updateMsgViewReceipt=s;g.getUnexpiredNewsletterAdminInviteMessageRecordsFromChat=u}),98); __d("WAWebNewsletterLogExposureJob",["WAJobOrchestratorTypes","WAWebMexLogNewsletterExposureJob","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("logNewsletterExposure",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebMexLogNewsletterExposureJob").mexLogNewsletterExposure(a,c)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()}g.logNewsletterExposure=a}),98); __d("WAWebNewsletterAdminInviteMessageValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({MISSING_NEWSLETTER_JID:"newsletter_admin_invite_missing_newsletter_jid",MISSING_NEWSLETTER_NAME:"newsletter_admin_invite_missing_newsletter_name",MISSING_INVITE_EXPIRATION:"newsletter_admin_invite_missing_invite_expiration",INVALID_NEWSLETTER_JID:"newsletter_admin_invite_invalid_newsletter_jid"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="NewsletterAdminInviteMessageValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.NewsletterAdminInviteMessageValidationErrorCode=a;g.NewsletterAdminInviteMessageValidationError=c}),98); __d("WAWebParseNewsletterAdminInviteMessageProto",["WATimeUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebNewsletterAdminInviteMessageValidationError","WAWebNewsletterGatingUtils","WAWebWamEnumE2eFailureReason","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.newsletterAdminInviteMessage;if(b==null)return;if(!d("WAWebNewsletterGatingUtils").isNewsletterCreationEnabled())return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE}),contextInfo:b.contextInfo};var c=b.caption,e=b.inviteExpiration,f=b.newsletterJid,g=b.newsletterName;b=b.contextInfo;if(f==null)throw new(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationError)(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationErrorCode.MISSING_NEWSLETTER_JID,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(g==null)throw new(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationError)(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationErrorCode.MISSING_NEWSLETTER_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationError)(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationErrorCode.MISSING_NEWSLETTER_JID,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f=d("WAWebE2EProtoUtils").strictDecodeJid(f);if(f==null)throw new(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationError)(d("WAWebNewsletterAdminInviteMessageValidationError").NewsletterAdminInviteMessageValidationErrorCode.INVALID_NEWSLETTER_JID,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE,kind:d("WAWebMsgType").MsgKind.NewsletterAdminInvite,newsletterAdminInviteInfo:{newsletterId:d("WAWebWidFactory").toNewsletterWid(f),newsletterName:g,inviteExpiration:d("WATimeUtils").castLongIntToUnixTime(e),inviteMessage:(a=c)!=null?a:"",pictureThumbnail:null}}),contextInfo:b}}g["default"]=a}),98); __d("WAWebNewsletterFutureProofUtils",["WAWebABProps","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebPollsGatingUtils"],(function(a,b,c,d,e,f,g){var h=new Map([[1,(b=d("WAWebMsgType")).MSG_TYPE.CHAT],[2,b.MSG_TYPE.IMAGE],[3,b.MSG_TYPE.VIDEO],[4,b.MSG_TYPE.AUDIO],[5,b.MSG_TYPE.PTT],[6,b.MSG_TYPE.LOCATION],[7,b.MSG_TYPE.VCARD],[8,b.MSG_TYPE.DOCUMENT],[11,b.MSG_TYPE.MULTI_VCARD],[12,b.MSG_TYPE.REACTION],[13,b.MSG_TYPE.POLL_CREATION],[14,b.MSG_TYPE.POLL_UPDATE],[15,b.MSG_TYPE.STICKER],[16,b.MSG_TYPE.POLL_RESULT_SNAPSHOT],[17,b.MSG_TYPE.PTV]]);function i(){return d("WAWebABProps").getABPropConfigValue("channel_supported_message_types").split(",").map(function(a){return Number.parseInt(a.trim(),10)}).filter(Number.isSafeInteger).reduce(function(a,b){b=h.get(b);b!=null&&a.add(b);return a},new Set())}function j(a){var b=i().has(a);switch(a){case d("WAWebMsgType").MSG_TYPE.PTT:return d("WAWebNewsletterGatingUtils").isNewsletterPTTReceivingEnabled();case d("WAWebMsgType").MSG_TYPE.PTV:return d("WAWebNewsletterGatingUtils").isNewsletterPTVReceivingEnabled();case d("WAWebMsgType").MSG_TYPE.POLL_CREATION:case d("WAWebMsgType").MSG_TYPE.POLL_UPDATE:return d("WAWebNewsletterGatingUtils").isNewsletterPollsReceivingEnabled();case d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT:return d("WAWebPollsGatingUtils").isPollResultSnapshotReceivingEnabled();case d("WAWebMsgType").MSG_TYPE.AUDIO:return d("WAWebNewsletterGatingUtils").isNewsletterAudioFileReceivingEnabled();case d("WAWebMsgType").MSG_TYPE.ALBUM:return d("WAWebNewsletterGatingUtils").isNewsletterAlbumsV2ReceiverEnabled();default:return b}}function a(a){var b=a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN?a.futureproofType:a.type;if(b==null)return!1;if(!j(b))return!1;return d("WAWebMsgGetters").getIsReply(a)&&!d("WAWebNewsletterGatingUtils").isNewsletterReceivingAdminRepliesEnabled()?!1:!0}g.isMsgTypeSupported=j;g.isMsgSupported=a}),98); __d("WAWebParseForwardedNewsletterMessageInfo",["WALogger","WAWebChatEntryPoint","WAWebE2EProtoUtils","WAWebProtobufsE2E.pb","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Did not receive content type from newsletter annotation"]);h=function(){return a};return a}function a(a){var b=a.newsletterJid,c=a.newsletterName;a=a.serverMessageId;b=d("WAWebE2EProtoUtils").strictDecodeJid(b);return{newsletterId:b!=null?d("WAWebWidFactory").toNewsletterWid(b):void 0,newsletterName:c,serverMessageId:a}}function b(a){var b;b=a==null?void 0:(b=a.newsletter)==null?void 0:b.contentType;if(b==null){var c;d("WALogger").WARN(h()).tags("newsletter-logging").devConsole(a).sendLogs("Missing content type in newsletter annotation");return(a==null?void 0:(c=a.newsletter)==null?void 0:c.serverMessageId)==null?d("WAWebChatEntryPoint").ChatEntryPoint.NewsletterLinkCard:d("WAWebChatEntryPoint").ChatEntryPoint.NewsletterPostLinkCard}return b===d("WAWebProtobufsE2E.pb").ContextInfo$ForwardedNewsletterMessageInfo$ContentType.LINK_CARD?a.shouldSkipConfirmation===!0?d("WAWebChatEntryPoint").ChatEntryPoint.NewsletterLinkCardButton:d("WAWebChatEntryPoint").ChatEntryPoint.NewsletterLinkCard:d("WAWebChatEntryPoint").ChatEntryPoint.NewsletterPostLinkCard}g.parseForwardedNewsletterMessageInfo=a;g.getChatEntryPointFromNewsletterLinkAnnotation=b}),98); __d("WAWebGetEnumValuesFromConfig",[],(function(a,b,c,d,e,f){"use strict";function a(a){var b=a.config,c=a.enumCastFunction,d=new Set();return b.split(",").map(function(a){return Number.parseInt(a.trim(),10)}).filter(Number.isSafeInteger).map(function(a){if(d.has(a))return null;d.add(a);return c(a)}).filter(Boolean)}f.getEnumValuesFromConfig=a}),66); __d("WAWebNewsletterDirectoryCategoryUtils",["$InternalEnum","WALogger","WAWebGetEnumValuesFromConfig"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected category: ",""]);h=function(){return a};return a}var i=b("$InternalEnum")({Business:1,Entertainment:2,Lifestyle:3,News:4,Organizations:5,People:6,Sports:7,SpecialEvents:8,SpecialEvents2:9,SpecialEvents3:10,SpecialEvents4:11,SpecialEvents5:12});function a(a){switch(a){case i.Business:return"BUSINESS";case i.Entertainment:return"ENTERTAINMENT";case i.Lifestyle:return"LIFESTYLE";case i.News:return"NEWS";case i.Organizations:return"ORGANIZATIONS";case i.People:return"PEOPLE";case i.Sports:return"SPORTS";case i.SpecialEvents:return"SPECIAL_EVENTS";case i.SpecialEvents2:return"SPECIAL_EVENTS_2";case i.SpecialEvents3:return"SPECIAL_EVENTS_3";case i.SpecialEvents4:return"SPECIAL_EVENTS_4";case i.SpecialEvents5:return"SPECIAL_EVENTS_5"}}function c(a){switch(a){case"BUSINESS":return{type:i.Business,name:"Business"};case"ENTERTAINMENT":return{type:i.Entertainment,name:"Entertainment"};case"LIFESTYLE":return{type:i.Lifestyle,name:"Lifestyle"};case"NEWS":return{type:i.News,name:"News & Information"};case"ORGANIZATIONS":return{type:i.Organizations,name:"Organizations"};case"PEOPLE":return{type:i.People,name:"People"};case"SPORTS":return{type:i.Sports,name:"Sports"};case"SPECIAL_EVENTS":return{type:i.SpecialEvents,name:"Special Events"};case"SPECIAL_EVENTS_2":return{type:i.SpecialEvents2,name:"Special Events 2"};case"SPECIAL_EVENTS_3":return{type:i.SpecialEvents3,name:"Special Events 3"};case"SPECIAL_EVENTS_4":return{type:i.SpecialEvents4,name:"Special Events 4"};case"SPECIAL_EVENTS_5":return{type:i.SpecialEvents5,name:"Special Events 5"};case"EXPLORE":case"EXPLORE_MORE":return void 0}}function e(a){switch(a){case"BUSINESS":return i.Business;case"ENTERTAINMENT":return i.Entertainment;case"LIFESTYLE":return i.Lifestyle;case"NEWS":return i.News;case"ORGANIZATIONS":return i.Organizations;case"PEOPLE":return i.People;case"SPORTS":return i.Sports;case"SPECIAL_EVENTS":return i.SpecialEvents;case"SPECIAL_EVENTS_2":return i.SpecialEvents2;case"SPECIAL_EVENTS_3":return i.SpecialEvents3;case"SPECIAL_EVENTS_4":return i.SpecialEvents4;case"SPECIAL_EVENTS_5":return i.SpecialEvents5;default:a;d("WALogger").WARN(h(),a).tags("newsletter-directory-category").sendLogs("Unexpected newsletter directory category");return i.Business}}function f(a){switch(a){case i.Business:return"BUSINESS";case i.Entertainment:return"ENTERTAINMENT";case i.Lifestyle:return"LIFESTYLE";case i.News:return"NEWS";case i.Organizations:return"ORGANIZATIONS";case i.People:return"PEOPLE";case i.Sports:return"SPORTS";case i.SpecialEvents:return"SPECIAL_EVENTS";case i.SpecialEvents2:return"SPECIAL_EVENTS_2";case i.SpecialEvents3:return"SPECIAL_EVENTS_3";case i.SpecialEvents4:return"SPECIAL_EVENTS_4";case i.SpecialEvents5:return"SPECIAL_EVENTS_5"}}function j(a){return d("WAWebGetEnumValuesFromConfig").getEnumValuesFromConfig({config:a,enumCastFunction:function(a){return i.cast(a)}})}g.NewsletterDirectoryCategoryType=i;g.getNewsletterSectionFromCategoryType=a;g.getNewsletterCategoryFromSection=c;g.getNewsletterDirectoryCategoryTypeFromValue=e;g.getCategoryValueFromEnum=f;g.getNewsletterDirectoryCategoryTypesFromConfig=j}),98); __d("WAWebWamEnumChannelDirectoryPillSelected",[],(function(a,b,c,d,e,f){a=Object.freeze({RECOMMENDED:1,TRENDING:2,FEATURED:3,NEW:4,POPULAR:5});f.CHANNEL_DIRECTORY_PILL_SELECTED=a}),66); __d("WAWebNewsletterDirectoryFilterUtils",["$InternalEnum","WAWebWamEnumChannelDirectoryPillSelected"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({Featured:"FEATURED",New:"NEW",Popular:"POPULAR",Recommended:"RECOMMENDED",Trending:"TRENDING"}),i=b("$InternalEnum")({Recommended:1,Trending:2,Featured:3,New:4,Popular:5,Country:6});function a(a){switch(a){case i.Recommended:case i.Country:return h.Recommended;case i.Trending:return h.Trending;case i.Featured:return h.Featured;case i.New:return h.New;case i.Popular:return h.Popular}}function c(a){switch(a){case h.Recommended:return i.Recommended;case h.Trending:return i.Trending;case h.Featured:return i.Featured;case h.New:return i.New;case h.Popular:return i.Popular}}function e(a){if(a==null)return void 0;switch(a){case h.Recommended:return d("WAWebWamEnumChannelDirectoryPillSelected").CHANNEL_DIRECTORY_PILL_SELECTED.RECOMMENDED;case h.New:return d("WAWebWamEnumChannelDirectoryPillSelected").CHANNEL_DIRECTORY_PILL_SELECTED.NEW;case h.Popular:return d("WAWebWamEnumChannelDirectoryPillSelected").CHANNEL_DIRECTORY_PILL_SELECTED.POPULAR;case h.Trending:return d("WAWebWamEnumChannelDirectoryPillSelected").CHANNEL_DIRECTORY_PILL_SELECTED.TRENDING;case h.Featured:return d("WAWebWamEnumChannelDirectoryPillSelected").CHANNEL_DIRECTORY_PILL_SELECTED.FEATURED}}g.NewsletterDirectoryListView=h;g.NewsletterDirectoryFilterType=i;g.getNewsletterDirectoryListViewFromFilter=a;g.getNewsletterDirectoryFilterFromListView=c;g.getNewsletterSelectedPill=e}),98); __d("WAWebNewsletterMembershipUtil",["WAWebCommonNewsletterEnums"],(function(a,b,c,d,e,f,g){function a(a){return(a==null?void 0:a.membershipType)===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber}function b(a){return h(a)||i(a)}function h(a){return(a==null?void 0:a.membershipType)===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner}function i(a){return(a==null?void 0:a.membershipType)===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin}function c(a){return(a==null?void 0:a.membershipType)===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}g.iAmSubscriber=a;g.iAmAdminOrOwner=b;g.iAmOwner=h;g.iAmAdmin=i;g.iAmGuest=c}),98); __d("WAWebPtvGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("ptv_receiving_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("ptv_autoplay_enabled")}function c(){var a=d("WAWebABProps").getABPropConfigValue("ptv_autoplay_loop_limit");return a===0?Infinity:a}function e(){return d("WAWebABProps").getABPropConfigValue("ptv_max_duration_seconds")}g.isPtvReceivingEnabled=a;g.isPtvAutoplayEnabled=b;g.getPtvAutoplayLoopLimit=c;g.getPtvMaxDurationSeconds=e}),98); __d("WAWebNewsletterGatingUtils",["$InternalEnum","WAWebABProps","WAWebCommonNewsletterEnums","WAWebGetEnumValuesFromConfig","WAWebLogNewsletterExposureAction","WAWebMobilePlatforms","WAWebMsgType","WAWebNewsletterDirectoryCategoryUtils","WAWebNewsletterDirectoryFilterUtils","WAWebNewsletterFutureProofUtils","WAWebNewsletterMembershipUtil","WAWebPrimaryFeatures","WAWebPtvGatingUtils","WAWebStateUtils","gkx"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({Disabled:0,NeedsUpgrade:1,Enabled:2}),i=b("$InternalEnum")({Disabled:0,NeedsUpgrade:1,Enabled:2,AvailableOnPhone:3}),j=b("$InternalEnum")({Disabled:0,EnabledAdminsOnly:1,EnabledAdminsAndFollowers:2,EnabledEveryone:3});function k(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("newsletter")||c("gkx")("26256")}function a(){var a=h.cast(d("WAWebABProps").getABPropConfigValue("channels_enabled"));if(a==null)return i.Disabled;if(!k())return i.Disabled;switch(a){case h.Disabled:return i.AvailableOnPhone;case h.Enabled:return i.Enabled;case h.NeedsUpgrade:return i.NeedsUpgrade}}function l(){return d("WAWebABProps").getABPropConfigValue("channels_enabled")===i.Enabled}function m(a){return l()&&d("WAWebABProps").getABPropConfigValue(a)===!0}var n=5e3;function e(){return n}function f(){return m("dsa_information_for_eu_only_enabled")}function o(){return m("dsa_channels_report_unlawful_content_enabled")}function p(){return m("channel_osa_reporting_enabled")}function q(){return m("channels_uk_osa_enabled")}function r(a){var b=!1;if(a==null)return!1;switch(a){case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner:case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin:b=d("WAWebABProps").getABPropConfigValue("channel_view_counts_enabled")>=j.EnabledAdminsOnly;break;case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber:b=d("WAWebABProps").getABPropConfigValue("channel_view_counts_enabled")>=j.EnabledAdminsAndFollowers;break;case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest:b=d("WAWebABProps").getABPropConfigValue("channel_view_counts_enabled")===j.EnabledEveryone;break}return l()&&b}function s(){return m("channels_send_view_receipt_enabled")}function t(){return l()&&d("WAWebABProps").getABPropConfigValue("channels_creation_enabled")===i.Enabled}function u(a){return((a=a.newsletterMetadata)==null?void 0:a.reactionCodesSetting)===d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All&&w()}function v(){return m("channel_reactions_enabled")&&d("WAWebNewsletterFutureProofUtils").isMsgTypeSupported(d("WAWebMsgType").MSG_TYPE.REACTION)}function w(){return m("channel_reactions_settings_enabled")}function x(a,b){return v()&&!b&&d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(a==null?void 0:a.newsletterMetadata)&&d("WAWebABProps").getABPropConfigValue("channel_reactions_sender_list_enabled")}function y(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("newsletter_tos_notice_id_smb_web"):d("WAWebABProps").getABPropConfigValue("newsletter_tos_notice_id")}function z(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("newsletter_creation_tos_id_smb_web"):d("WAWebABProps").getABPropConfigValue("newsletter_creation_tos_id")}function A(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("newsletter_admin_invite_tos_id_smb_web"):d("WAWebABProps").getABPropConfigValue("newsletter_admin_invite_tos_id")}function B(){return d("WAWebABProps").getABPropConfigValue("newsletter_creation_nux_id")}function C(){return!1}function D(){return l()&&d("WAWebABProps").getABPropConfigValue("channels_directory_enabled")===h.Enabled}function E(){return d("WAWebABProps").getABPropConfigValue("channels_directory_page_size")}function F(){return d("WAWebABProps").getABPropConfigValue("channels_directory_search_debounce_ms")}function G(){var a=d("WAWebABProps").getABPropConfigValue("channels_directory_v2_filter_types");return d("WAWebGetEnumValuesFromConfig").getEnumValuesFromConfig({config:a,enumCastFunction:function(a){return d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.cast(a)}})}function H(){return m("channels_filter_out_subscribed_in_directory_null_state")}function I(){return d("WAWebABProps").getABPropConfigValue("channels_directory_v2_cache_refresh_interval_ms")}function J(){return m("channels_directory_categories_enabled")}function K(){return d("WAWebABProps").getABPropConfigValue("directory_categories_newsletters_per_category_limit")}function L(){return d("WAWebABProps").getABPropConfigValue("channels_directory_categories_cache_refresh_interval_ms")}function M(){var a=d("WAWebABProps").getABPropConfigValue("channels_directory_category_types");return d("WAWebGetEnumValuesFromConfig").getEnumValuesFromConfig({config:a,enumCastFunction:function(a){return d("WAWebNewsletterDirectoryCategoryUtils").NewsletterDirectoryCategoryType.cast(a)}})}function N(){return d("WAWebABProps").getABPropConfigValue("directory_categories_display_newsletters_per_category_limit")}function O(){return J()&&m("channels_directory_categories_logging_enabled")}function P(){return d("WAWebABProps").getABPropConfigValue("recommended_channels_background_refresh")}function Q(){return d("WAWebABProps").getABPropConfigValue("channels_followers_list_cache_refresh_milliseconds")}function R(){return m("channel_forward_to_chat_enabled")}function aa(){return m("channels_forward_logging_v2_enabled")}function ba(){return m("channel_to_channel_forwarding_logging_enabled")}function ca(){return m("channel_forward_to_chat_v2_message_navigation_enabled")}function da(a){return a.isNewsletter()?ea():fa()}function ea(){return m("channels_forward_to_channel_enabled")}function fa(){return m("channels_forward_from_chat_to_channel_enabled")}function ga(){return m("channel_forward_bottom_button_enabled")}function ha(){return m("channels_message_edit_enabled")}function ia(){return m("channels_hide_news_url_preview")}function ja(){return d("WAWebABProps").getABPropConfigValue("channels_max_messages_batch_pull")}function ka(){return d("WAWebABProps").getABPropConfigValue("channel_pull_message_updates_threshold_seconds")}function la(){return m("channels_recommended_v3_ui_enabled")}function ma(){return d("WAWebABProps").getABPropConfigValue("channels_recommended_v3_ui_limit")}function na(){return m("channels_share_link_logging_enabled")}function oa(a){return a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner||a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin}function pa(){return m("channels_send_album_enabled")}function qa(){return m("channels_inbox_filters_web_enabled")}function ra(){return m("channels_proactive_message_gap_handling_enabled")}function S(){return m("channels_ptt_receiver_enabled")}function sa(){return S()&&d("WAWebABProps").getABPropConfigValue("channels_ptt_sender_enabled")}function ta(){return m("channels_ptt_logging_enabled")}function ua(){return T()&&d("WAWebABProps").getABPropConfigValue("channels_ptv_forwarding_enabled")}function T(){return d("WAWebPtvGatingUtils").isPtvReceivingEnabled()&&m("channels_ptv_receiving_enabled")}function va(){return m("channels_poll_creation_enabled")}function wa(){return m("channels_poll_receive_enabled")}function xa(a){return!d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(a==null?void 0:a.newsletterMetadata)?!1:U()}function U(){return m("channels_poll_voter_list_enabled")}function ya(){return m("channel_poll_forwarding_enabled")}function za(){return m("channel_photo_poll_sender_enabled")}function Aa(){return m("channel_photo_poll_receiver_enabled")}function Ba(){return m("channels_poll_single_option_control_enable")}function Ca(){return m("channels_non_basic_stickers_enabled")}function Da(){return d("WAWebABProps").getABPropConfigValue("channels_multi_admin_max_admin_count")}function Ea(){return m("channels_audio_files_receiver_enabled")}function Fa(){return m("channels_audio_files_sender_enabled")}function Ga(){return m("channels_audio_files_sender_waveform_enabled")}function Ha(){return m("channels_audio_files_display_waveform_enabled")}function Ia(){return m("channels_status_updates_consumption_enabled")}function Ja(){return m("channels_admin_reply_enabled")}function Ka(){return m("channels_admin_reply_receiver_enabled")}function La(){return m("similar_channels_in_thread_on_follow_enabled")}function Ma(){return m("similar_channels_in_channel_details_enabled")}function Na(){return d("WAWebABProps").getABPropConfigValue("similar_channels_max_limit")}function Oa(){return d("WAWebABProps").getABPropConfigValue("similar_channels_min_limit")}function Pa(){return m("channels_qpl_logging")}function Qa(){return m("channels_reactions_bottomsheet_tap_to_react_enabled")}function Ra(a){a=d("WAWebStateUtils").unproxy(a);return((a=a.newsletterMetadata)==null?void 0:a.isSuspendedOrTerminated)?!1:m("channels_updates_tab_swipe_actions_enabled")}function Sa(a){if(a==null)return!1;if(a.isSuspendedOrTerminated)return!1;if(!c("gkx")("26258")&&d("WAWebABProps").getABPropConfigValue("channels_admin_insights_gizmos_enabled"))return!0;if(!d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(a))return!1;if(m("channels_producer_insights_enabled"))return!0;V()&&void d("WAWebLogNewsletterExposureAction").logNewsletterExposureAction(a,d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights);return a.capabilities.has(d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights)&&d("WAWebABProps").getABPropConfigValue("channels_capabilities_enabled")}function Ta(a){a=a.newsletterMetadata;if(a==null)return!1;V()&&void d("WAWebLogNewsletterExposureAction").logNewsletterExposureAction(a,d("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls);return a.capabilities.has(d("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls)&&d("WAWebABProps").getABPropConfigValue("channels_capabilities_enabled")}function Ua(a){if(a==null)return!1;a=d("WAWebStateUtils").unproxy(a);a=a.size;return a>=d("WAWebABProps").getABPropConfigValue("channels_producer_insights_min_followers")}function Va(){return d("WAWebABProps").getABPropConfigValue("channels_producer_insights_hide_deltas")}function V(){return m("channels_fetch_and_log_capabilities")}function W(){return d("WAWebABProps").getABPropConfigValue("whatsapp_vpv_logging_enabled")}function X(){return m("channels_vpv_logging_enabled")}function Wa(){return W()&&X()}function Y(a){return!c("gkx")("26258")&&m(a)}function Xa(){return Y("wamo_sub_process_message_kill_switch")}function Ya(){return Y("wamo_sub_messages_supported")}function Z(){return Y("wamo_sub_consumer_enabled_v2")}function $(){return Y("wamo_sub_admin_enabled_v2")}function Za(){return Z()||$()}function $a(){return Y("wamo_sub_logging_enabled_v2")}function ab(){return m("channel_album_v2_receiving_enabled")}function bb(){return d("WAWebABProps").getABPropConfigValue("snapl_newsletter_logging_media_id_placeholder_string")}function cb(){return m("newsletters_video_playback_wabba_logging_enabled")}g.NewsletterCompanionGating=i;g.isNewsletterEnabledOnPrimary=k;g.getNewsletterDeeplinkGating=a;g.isNewsletterEnabled=l;g.getMaxSubscriberNumber=e;g.isDSAEUOnlyNoticeEnabled=f;g.isNewsletterReportUnlawfulContentEnabled=o;g.isNewsletterAusOSAReportingEnabled=p;g.isNewsletterUKOSAReportingEnabled=q;g.isNewsletterViewCountEnabled=r;g.isNewsletterViewCountSendEnabled=s;g.isNewsletterCreationEnabled=t;g.shouldShowAllReactionsForNewsletter=u;g.isNewsletterReactionEnabled=v;g.isNewsletterReactionSettingsEnabled=w;g.isNewsletterReactionSenderListEnabled=x;g.getNewsletterConsumerTos=y;g.getNewsletterProducerTos=z;g.getNewsletterAdminInviteTos=A;g.getNewsletterProducerNux=B;g.shouldHideProducerNewsletterDisclosure=C;g.isNewsletterDirectoryEnabled=D;g.getNewsletterDirectoryPageSize=E;g.getNewsletterDirectorySearchDebounce=F;g.getNewsletterDirectoryV2FilterTypes=G;g.isFilteringOutSubscribedNewslettersFromDirectoryListEnabled=H;g.getNewsletterDirectoryPageRefreshInterval=I;g.isNewsletterDirectoryCategoriesEnabled=J;g.getNewslettersPerDirectoryCategoryLimit=K;g.getNewsletterDirectoryCategoriesPreviewRefreshIntervalMs=L;g.getNewsletterDirectoryCategoryTypes=M;g.getDisplayNewsletterPerCategoryLimit=N;g.isDirectoryCategoriesLoggingEnabled=O;g.getRecommendedNewslettersRefreshInterval=P;g.getNewsletterSubscriberListCacheRefreshMs=Q;g.isNewsletterMessageForwardSendingEnabled=R;g.isNewsletterMessageForwardLoggingEnabled=aa;g.isNewsletterForwardToChannelLoggingEnabled=ba;g.isNavigationToForwardedNewsletterMessageEnabled=ca;g.isForwardToNewsletterEnabled=da;g.isNewsletterForwardBottomButtonEnabled=ga;g.isNewsletterMessageEditingEnabled=ha;g.isNewsletterHideNewsUrlPreviewEnabled=ia;g.getMaxMsgCountFromServer=ja;g.getPullMessageUpdatesThresholdSeconds=ka;g.isRecommendedUnitV3Enabled=la;g.getRecommendedUnitRowCount=ma;g.isNewsletterLinkShareLoggingEnabled=na;g.isNewsletterAdminContextCardEnabled=oa;g.isNewsletterMediaAlbumUploadEnabled=pa;g.isNewsletterInboxFiltersEnabled=qa;g.isProactiveGapFillingEnabled=ra;g.isNewsletterPTTReceivingEnabled=S;g.isNewsletterPTTSendingEnabled=sa;g.isNewsletterPTTLoggingEnabled=ta;g.isNewsletterPTVForwardingEnabled=ua;g.isNewsletterPTVReceivingEnabled=T;g.isNewsletterPollsCreationEnabled=va;g.isNewsletterPollsReceivingEnabled=wa;g.isNewsletterPollsVotersEnabledForChat=xa;g.isNewsletterPollsVotersEnabled=U;g.isNewsletterPollForwardingEnabled=ya;g.isNewsletterPhotoPollSenderEnabled=za;g.isNewsletterPhotoPollsReceiverEnabled=Aa;g.isNewsletterPollsSingleOptionEnabled=Ba;g.isNewsletterSendingNonBasicStickersEnabled=Ca;g.getMaxNumberOfAdmins=Da;g.isNewsletterAudioFileReceivingEnabled=Ea;g.isNewsletterAudioFileSendingEnabled=Fa;g.isAudioFileWaveformSenderEnabled=Ga;g.isAudioFileWaveformDisplayInNewslettersEnabled=Ha;g.isNewsletterLinksOnStatusConsumptionEnabled=Ia;g.isNewsletterSendingAdminRepliesEnabled=Ja;g.isNewsletterReceivingAdminRepliesEnabled=Ka;g.isSimilarNewsletterInThreadEnabled=La;g.isSimilarNewsletterInInfoDrawersEnabled=Ma;g.getSimilarNewslettersMaxFetchLimit=Na;g.getSimilarNewslettersMinDisplayLimit=Oa;g.isNewsletterQPLLoggingEnabled=Pa;g.isNewsletterQuickReactionsEnabled=Qa;g.isNewsletterContextMenuEnabled=Ra;g.isNewsletterProducerInsightsEnabled=Sa;g.isNewsletterPhotoPollCapabilityEnabled=Ta;g.canFetchProducerInsights=Ua;g.shouldHideProducerInsightsDeltas=Va;g.shouldFetchAndLogCapabilities=V;g.isVPVLoggingEnabled=W;g.isNewsletterVPVLoggingEnabled=X;g.isNewsletterDiscoveryVisibilityLoggingEnabled=Wa;g.isWamoSubMessagesProcessingEnabled=Xa;g.isWamoSubMessagesSupported=Ya;g.isWamoSubConsumerExperienceEnabled=Z;g.isWamoSubCreatorExperienceSupported=$;g.isWamoSubExperienceEnabled=Za;g.isWamoSubLoggingEnabled=$a;g.isNewsletterAlbumsV2ReceiverEnabled=ab;g.getNewsletterLoggingMediaID=bb;g.isNewsletterVideoPlaybackLoggingEnabled=cb}),98); __d("WAWebNewsletterErrors",["WACustomError"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}((a=d("WACustomError")).customError("UnexpectedNonNewsletterJidError"));c=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("UnexpectedNonNewsletterJidError"));e=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("MissingNewsletterServerIdError"));f=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("NewsletterMediaUploadError"));d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(a.customError("UnexpectedNewsletterQuotedParticipantMismatchError"));g.UnexpectedNonNewsletterJidError=b;g.UnexpectedNonNewsletterChatError=c;g.MissingNewsletterServerIdError=e;g.NewsletterMediaUploadError=f;g.UnexpectedNewsletterQuotedParticipantMismatchError=d}),98); __d("WAWebNewsletterValidationUtils",["WAJids","WALogger","WAWebNewsletterErrors"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose([""," is not a valid newsletter JID"]);h=function(){return a};return a}function a(a){i(a);return d("WAJids").toNewsletterJid(a)}function i(a){var b=d("WAJids").validateNewsletterJid(a)!=null;if(!b){d("WALogger").ERROR(h(),a);throw new(d("WAWebNewsletterErrors").UnexpectedNonNewsletterJidError)()}}g.toNewsletterJidOrThrow=a;g.validateNewsletterJidOrThrow=i}),98); __d("WAWebLogNewsletterExposureAction",["WALogger","WAWebNewsletterLogExposureJob","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][logNewsletterExposureAction] failed to log exposure"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.id.toJid());return d("WAWebNewsletterLogExposureJob").logNewsletterExposure(c,b)}catch(c){d("WALogger").ERROR(h()).tags("newsletter").devConsole(c,a.id,b).sendLogs("log-newsletter-exposure-failed")}});return i.apply(this,arguments)}g.logNewsletterExposureAction=a}),98); __d("WAWebDBProcessPaymentMessages",["WAWebDBMsgUtils","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebMsgType","WAWebProtobufsWeb.pb","WAWebSchemaMessage","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[],e=[],f=i(a),g=j(a.filter(function(a){return a.subtype==="payment_action_request_declined"||a.subtype==="payment_transaction_request_cancelled"}));return d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b[0];b=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(f.concat(g)));var h=new Map();b.forEach(function(a){a!=null&&h.set(a.id.toString(),a)});a.forEach(function(a){var b;b=(b=a.paymentRequestMessageKey)==null?void 0:b.toString();var f=h.get(b||"");if(f==null&&a.paymentRequestMessageKey!=null){var g=d("WAWebLidMigrationUtils").getAlternateMsgKey(a.paymentRequestMessageKey);if(g!=null){b=g.toString();f=h.get((g=(g=d("WAWebLidMigrationUtils").getAlternateMsgKey(g))==null?void 0:g.toString())!=null?g:"")}}if(f&&b!=null)if(a.subtype==="send"&&a.paymentTxnStatus!=null)c.push({id:b,paymentTxnStatus:a.paymentTxnStatus});else{g=f.from.isGroup()?f.author:f.from;var i=d("WAWebUserPrefsMeUser").isMeAccount(f.paymentMessageReceiverJid);i=i?g:f.paymentMessageReceiverJid;a.subtype==="payment_action_request_declined"?c.push({id:b,paymentStatus:d("WAWebProtobufsWeb.pb").PaymentInfo$Status.REJECTED,paymentTxnStatus:d("WAWebProtobufsWeb.pb").PaymentInfo$TxnStatus.COLLECT_REJECTED}):a.subtype==="payment_transaction_request_cancelled"&&c.push({id:b,paymentStatus:d("WAWebProtobufsWeb.pb").PaymentInfo$Status.CANCELLED,paymentTxnStatus:d("WAWebProtobufsWeb.pb").PaymentInfo$TxnStatus.COLLECT_CANCELED});c.push({id:a.id.toString(),type:d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE,templateParams:[i||"",f.paymentCurrency||"",String(f.paymentAmount1000)]})}else h.get(a.id.toString())&&!a.isMdHistoryMsg&&e.push(a.id.toString())});yield d("WAWebSchemaMessage").getMessageTable().bulkRemove(e);yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(c);return c});return function(a){return h.apply(this,arguments)}}())});return h.apply(this,arguments)}function i(a){return a.flatMap(function(a){return[a.paymentRequestMessageKey?a.paymentRequestMessageKey.toString():null,a.paymentRequestMessageKey?(a=(a=d("WAWebLidMigrationUtils").getAlternateMsgKey(a.paymentRequestMessageKey))==null?void 0:a.toString())!=null?a:null:null]}).filter(Boolean)}function j(a){return a.flatMap(function(a){return[a.id.toString(),(a=(a=d("WAWebLidMigrationUtils").getAlternateMsgKey(a.id))==null?void 0:a.toString())!=null?a:null]}).filter(Boolean)}g.processPaymentMessages=a;g.mapOriginalAndAltPaymentRequestMessageKey=i;g.mapOriginalAndAltMsgId=j}),98); __d("WAWebParseCancelPaymentMessageProto",["WAWebE2EProtoUtils","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","err"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.cancelPaymentRequestMessage;if(b==null)return;b=b.key;if(b==null)return;b=h(b,a);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"payment_transaction_request_cancelled",paymentRequestMessageKey:b}),contextInfo:null}}function h(a,b){if(!a)throw c("err")("parseProtocolMessageProto: no message key is defined for cancel payment request message");var e=a.id;if(!e)throw c("err")("parseProtocolMessageProto: no message id is defined for cancel payment request message");var f=void 0;if(b.id.remote.isGroup()){f=b.id.participant;if(b.id.fromMe)f=d("WAWebE2EProtoUtils").decodeJid(b.from);else if(!((a=d("WAWebE2EProtoUtils").decodeJid(a.participant))==null?void 0:a.equals(d("WAWebUserPrefsMeUser").getMeUser())))return null}a=new(c("WAWebMsgKey"))({id:e,fromMe:b.id.fromMe,remote:b.id.remote,participant:f});return a}g["default"]=a}),98); __d("WAWebParseDeclinePaymentMessageProto",["WAWebE2EProtoUtils","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","err"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.declinePaymentRequestMessage;if(b==null)return;b=h(b.key,a);return{msgData:babelHelpers["extends"]({},a,{type:"unknown",kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"payment_action_request_declined",paymentRequestMessageKey:b}),contextInfo:null}}function h(a,b){if(!a)throw c("err")("parseProtocolMessageProto: no message key is defined for decline payment request message");var e=a.id;if(!e)throw c("err")("parseProtocolMessageProto: no message id is defined for decline payment request message");var f;if(b.id.remote.isGroup()){var g;if(b.id.fromMe||((g=d("WAWebE2EProtoUtils").decodeJid(a.participant))==null?void 0:g.equals(d("WAWebUserPrefsMeUser").getMeUser()))||b.subtype==="send")f=d("WAWebE2EProtoUtils").decodeJid(a.participant);else return null}g=new(c("WAWebMsgKey"))({fromMe:!b.id.fromMe,remote:b.id.remote,id:e,participant:f});return g}g["default"]=a}),98); __d("WAWebParseRequestPaymentMessageProto",["WALogger","WALongInt","WANullthrows","WAWebE2EProtoParser","WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsWeb.pb"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseRequestPaymentMessageProto: does not support novi transactions"]);h=function(){return a};return a}function a(a){var b,e=a.messageProtobuf,f=a.baseMessage,g=a.paymentInfo;a=a.msgContext;e=e.requestPaymentMessage;if(e==null)return;b=(b=e.noteMessage)==null?void 0:(b=b.extendedTextMessage)==null?void 0:b.contextInfo;if((g==null?void 0:g.futureproofed)||d("WAWebE2EProtoUtils").hasUnsupportedCurrency(g)){d("WALogger").LOG(h());return{msgData:babelHelpers["extends"]({},f,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"phone_only_feature"}),contextInfo:b}}var i=e.noteMessage,j=(i==null?void 0:i.extendedTextMessage)!=null||(i==null?void 0:i.conversation)!=null||(i==null?void 0:i.stickerMessage)!=null;i=i&&j?d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:i,message:{},msgContext:a}):void 0;a=g!=null?d("WAWebE2EProtoUtils").parseMsgPaymentInfo(g):{};if(e.amount==null)e.currencyCodeIso4217!=null&&a.paymentCurrency==null&&(a.paymentCurrency=e.currencyCodeIso4217),e.amount1000!=null&&a.paymentAmount1000==null&&(a.paymentAmount1000=d("WALongInt").numberOrThrowIfTooLarge(e.amount1000));else{e.amount.currencyCode!=null&&a.paymentCurrency==null&&(a.paymentCurrency=e.amount.currencyCode);if(e.amount.value!=null&&a.paymentAmount1000==null){g=e.amount;var k=g.offset==null||g.offset===0?1e3:g.offset;a.paymentAmount1000=parseFloat(g.value)*1e3/k}}e.requestFrom!=null&&(a==null?void 0:a.paymentMessageReceiverJid)==null&&(a.paymentMessageReceiverJid=d("WAWebE2EProtoUtils").decodeJid(e.requestFrom));((a==null?void 0:a.paymentStatus)==null||(a==null?void 0:a.paymentTxnStatus)==null)&&d("WAWebE2EProtoUtils").isEitherSenderOrReceiverOfPaymentMessage(f.id,c("WANullthrows")(a.paymentMessageReceiverJid))&&(a.paymentStatus=d("WAWebProtobufsWeb.pb").PaymentInfo$Status.WAITING,a.paymentTxnStatus=d("WAWebProtobufsWeb.pb").PaymentInfo$TxnStatus.COLLECT_INIT);e.expiryTimestamp!=null&&(a==null?void 0:a.paymentExpiryTimestamp)==null&&(a.paymentExpiryTimestamp=d("WALongInt").numberOrThrowIfTooLarge(e.expiryTimestamp));return!j?{msgData:babelHelpers["extends"]({},f,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"futureproof"},a),contextInfo:b}:{msgData:babelHelpers["extends"]({},f,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"request"},a,{paymentNoteMsg:i}),contextInfo:b}}g["default"]=a}),98); __d("WAWebParseSendPaymentMessageProto",["WALogger","WAWebE2EProtoParser","WAWebE2EProtoUtils","WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPaymentRequestMessageKey: no message id is defined"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseSendPaymentMessageProto: does not support novi transactions"]);i=function(){return a};return a}function a(a){var b,c=a.messageProtobuf,e=a.baseMessage,f=a.paymentInfo;a=a.msgContext;c=c.sendPaymentMessage;if(c==null)return;b=(b=c.noteMessage)==null?void 0:(b=b.extendedTextMessage)==null?void 0:b.contextInfo;if((f==null?void 0:f.futureproofed)===!0||d("WAWebE2EProtoUtils").hasUnsupportedCurrency(f)){d("WALogger").LOG(i());return{msgData:babelHelpers["extends"]({},e,{type:"unknown",kind:d("WAWebMsgType").MsgKind.Unknown,subtype:"phone_only_feature"}),contextInfo:b}}var g=c.noteMessage;c=c.requestMessageKey;var h=(g==null?void 0:g.extendedTextMessage)!=null||(g==null?void 0:g.conversation)!=null||(g==null?void 0:g.stickerMessage)!=null,k=h?"send":"futureproof";g=g&&h?d("WAWebE2EProtoParser").parseMsgProto({messageProtobuf:g,message:{},msgContext:a}):void 0;a=f!=null?d("WAWebE2EProtoUtils").parseMsgPaymentInfo(f):null;f=c?j(c,e.id,k):null;return!h?{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"futureproof"},a,{paymentRequestMessageKey:f}),contextInfo:b}:{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.PAYMENT,kind:d("WAWebMsgType").MsgKind.Payment,subtype:"send"},a,{paymentRequestMessageKey:f,paymentNoteMsg:g}),contextInfo:b}}function j(a,b,e){if(!a)throw c("err")("getPaymentRequestMessageKey: no message key is defined");var f=a.id;if(!f)throw c("err")("getPaymentRequestMessageKey: no key id is defined");if(!b){d("WALogger").WARN(h());return null}var g;if(b.remote.isGroup()){var i;if(b.fromMe||((i=d("WAWebE2EProtoUtils").decodeJid(a.participant))==null?void 0:i.equals(d("WAWebUserPrefsMeUser").getMeUser()))||e==="send")g=d("WAWebE2EProtoUtils").decodeJid(a.participant);else return null}i=new(c("WAWebMsgKey"))({fromMe:!b.fromMe,remote:b.remote,id:f,participant:g});return i}g["default"]=a}),98); __d("WAWebPinAddonMessageProcessor",["Promise","WAArrayGroupBy","WANullthrows","WATimeUtils","WAWebAddonConstants","WAWebAddonCreateMsgProcessor","WAWebBackendApi","WAWebDBMarkFutureproofMessagesReparsed","WAWebDBProcessMessage","WAWebMsgGetters","WAWebMsgType","WAWebPinMessageProcessor","WAWebPinMsgGatingUtils","WAWebPinMsgParseWebMsgInfoPinInChat","WAWebPinsDbSerialization","WAWebProtobufsE2E.pb","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=60*d("WATimeUtils").DAY_SECONDS;a=d("WAWebAddonCreateMsgProcessor").createAddonMsgProcessor({isEnabled:function(){return d("WAWebPinMsgGatingUtils").isPinnedMessagesM1ReceiverEnabled()},convert:{fromHistorySyncMsg:function(a){a=d("WAWebPinMsgParseWebMsgInfoPinInChat").parseWebMsgInfoPinInChat(a.webMsgInfo,a.parsedWebMsgInfo);a=a.map(function(a){return d("WAWebPinsDbSerialization").deserializePinInChatMsgData(d("WAWebPinsDbSerialization").serializePinInChat(a))});return(h||(h=b("Promise"))).resolve(a)}},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.add;yield d("WAWebBackendApi").frontendSendAndReceive("updatePinCollection",{msgs:b,removeMsgs:a.remove})});function c(b){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.processMode,e=b.parents;return a.filter(function(a){var b;b=(b=a.pinExpiryDuration)!=null?b:0;if(c!==d("WAWebAddonConstants").AddonProcessMode.HistorySync){a=e.getForAddon(a);if(a.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION)return!0}return b<=i})});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e=e.processMode;if(e===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return;e=d("WAArrayGroupBy").groupBy(a,function(a){return a.id.remote.toString()});a=[d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a.map(function(a){return a.id.toString()}))].concat(e.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a[0];a=a[1];var f=d("WAWebWidFactory").createWid(e);e=(yield (h||(h=b("Promise"))).all(a.map(function(a){var b=d("WAWebMsgGetters").getT(a);if(a.pinMessageType!==d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.PIN_FOR_ALL||b==null||d("WAWebMsgGetters").getIsFailed(a))return;return d("WAWebPinMessageProcessor").genSystemMessage(f,b,c("WANullthrows")(d("WAWebMsgGetters").getSender(a)))}).filter(Boolean)));a=(yield d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:f,msgObjs:e,meta:{add:"after",isHistory:!1},processMessagesOrigin:"pinMessage"}));a&&(yield d("WAWebDBProcessMessage").storeMessages(e,f))});return function(b){return a.apply(this,arguments)}}()));yield (h||(h=b("Promise"))).all(a)});function e(b,c){return a.apply(this,arguments)}return e}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}()});e=a;g["default"]=e}),98); __d("WAWebPinMsgConstants",["$InternalEnum","WATimeUtils","err"],(function(a,b,c,d,e,f,g){f={INVALID:0,PIN:1,UNPIN:2};var h=b("$InternalEnum").Mirrored(["FiveSeconds","FifteenSeconds","OneMinute","OneDay","SevenDays","ThirtyDays"]);b=h.SevenDays;function a(a){switch(a){case h.FiveSeconds:return 5;case h.FifteenSeconds:return 15;case h.OneMinute:return d("WATimeUtils").MINUTE_SECONDS;case h.OneDay:return d("WATimeUtils").DAY_SECONDS;case h.SevenDays:return 7*d("WATimeUtils").DAY_SECONDS;case h.ThirtyDays:return 30*d("WATimeUtils").DAY_SECONDS}}function e(a){switch(a){case 5:return h.FiveSeconds;case 15:return h.FifteenSeconds;case d("WATimeUtils").MINUTE_SECONDS:return h.OneMinute;case d("WATimeUtils").DAY_SECONDS:return h.OneDay;case 7*d("WATimeUtils").DAY_SECONDS:return h.SevenDays;case 30*d("WATimeUtils").DAY_SECONDS:return h.ThirtyDays;default:throw c("err")("Unexpeded pin expiry duration")}}g.PIN_STATE=f;g.PinExpiryDurationOption=h;g.DEFAULT_PIN_EXPIRY_DURATION_OPTION=b;g.getPinExpiryDuration=a;g.getPinExpiryOption=e}),98); __d("WAWebDBCRUDOperationsPinInChat",["WAWebModelStorageUtils","WAWebPinInChatSchema","WAWebPinMsgConstants","WAWebPinMsgGatingUtils","WAWebPinsDbSerialization","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,c){var e=new Map();c.forEach(function(a){var b=a.parentMsgKey;b=b;var c=e.get(b);(!c||(c==null?void 0:c.senderTimestampMs)<=a.senderTimestampMs)&&e.set(b,a)});return d("WAWebModelStorageUtils").getStorage().lock(["pinned-messages"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.anyOf(["chatId"],[a.toString()]));c.forEach(function(a){var b=a.parentMsgKey,c=e.get(b);c&&(c.senderTimestampMs<=a.senderTimestampMs&&e["delete"](b))});var f=new Map(c.map(function(a){return[a.parentMsgKey,a]}));e.forEach(function(a,b){f.set(b,a)});c=Array.from(f.values());c=c.filter(function(a){return a.pinType===d("WAWebPinMsgConstants").PIN_STATE.PIN}).sort(function(a,b){return b.senderTimestampMs-a.senderTimestampMs}).slice(d("WAWebPinMsgGatingUtils").getMaxPins());c.forEach(function(a){e.set(a.parentMsgKey,babelHelpers["extends"]({},a,{pinType:d("WAWebPinMsgConstants").PIN_STATE.UNPIN}))});c=Array.from(e.values());yield b.bulkCreateOrReplace(c);return c});return function(a){return c.apply(this,arguments)}}())}function c(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPinInChatSchema").getTable().get(a.toString()));return a==null?null:d("WAWebPinsDbSerialization").deserializePinInChat(a)});return h.apply(this,arguments)}g.createOrUpdatePinInChat=a;g.getPinInChatByParentKey=c}),98); __d("WAWebPinMessageProcessor",["Promise","WANullthrows","WAWebBackendApi","WAWebDBCRUDOperationsPinInChat","WAWebDBMarkFutureproofMessagesReparsed","WAWebDBMsgUtils","WAWebDBProcessMessage","WAWebDBStoreMessageOrphans","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebPinsDbSerialization","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser","WAWebViewMode.flow","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.map(function(a){return a.pinParentKey}).filter(Boolean).map(function(a){return a.toString()});a=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(a));a=new Map(a.map(function(a){return[a.id.toString(),a]}));return a});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebDBStoreMessageOrphans").storeMessageOrphans(a,function(a){return c("WANullthrows")(a.pinParentKey)})});return l.apply(this,arguments)}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=(yield i(e)),g=[],j=[];for(e of e){var l=f.get(c("WANullthrows")(e.pinParentKey).toString());!l?g.push(e):j.push(e)}yield (h||(h=b("Promise"))).all([b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(g.length===0)return;yield k(g);yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(g.map(function(a){return a.id.toString()}))})(),b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(j.length===0)return;var e=(yield d("WAWebBackendApi").frontendSendAndReceive("updatePinCollection",{msgs:j,removeMsgs:[]}));e&&(yield d("WAWebDBCRUDOperationsPinInChat").createOrUpdatePinInChat(a,e.map(function(a){return d("WAWebPinsDbSerialization").serializePinInChat(a)})),yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(e.map(function(a){return a.msgKey.toString()})));e=(yield (h||(h=b("Promise"))).all(j.map(function(b){return b.pinMessageType===d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.PIN_FOR_ALL?n(a,c("WANullthrows")(b.t),c("WANullthrows")(d("WAWebMsgGetters").getSender(b))):null}).filter(Boolean)));var f=(yield d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:a,msgObjs:e,meta:{add:"after",isHistory:!1},processMessagesOrigin:"pinMessage"}));f&&(yield d("WAWebDBProcessMessage").storeMessages(e,a))})()])});return m.apply(this,arguments)}function n(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=d("WAWebUserPrefsMeUser").getMeUser(),g=d("WAWebUserPrefsMeUser").isMeAccount(e);return{id:new(c("WAWebMsgKey"))({id:yield c("WAWebMsgKey").newId(),fromMe:g,remote:a,participant:e}),author:e,from:a,to:f,recipients:[],t:b,type:d("WAWebMsgType").MSG_TYPE.PINNED_MESSAGE,kind:d("WAWebMsgType").MsgKind.PinnedMessage,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,templateParams:[e]}});return o.apply(this,arguments)}g.processPinMessages=a;g.genSystemMessage=n}),98); __d("WAWebPinsDbSerialization",["WANullthrows","WAWebAddonConstants","WAWebAddonDBSerializationUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebViewMode.flow","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){return babelHelpers["extends"]({},a,{msgKey:a.msgKey.toString(),parentMsgKey:a.parentMsgKey.toString(),chatId:a.chatId.toString(),sender:a.sender.toString()})}function b(a){return babelHelpers["extends"]({},a,{msgKey:c("WAWebMsgKey").fromString(a.msgKey),parentMsgKey:c("WAWebMsgKey").fromString(a.parentMsgKey),chatId:d("WAWebWidFactory").toChatWid(d("WAWebWidFactory").createWid(a.chatId)),sender:d("WAWebWidFactory").createUserWid(a.sender)})}function e(a){var b=d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a))).toString();return{msgKey:a.id.toString(),ack:a.ack,t:a.t,read:a.read,parentMsgKey:a.pinParentKey.toString(),senderTimestampMs:a.pinSenderTimestampMs,chatId:a.id.remote.toString(),sender:b,pinType:a.pinMessageType,pinExpiryDuration:a.pinExpiryDuration}}function f(a){var b=d("WAWebAddonDBSerializationUtils").extractAddonForUnifiedTable(a),c=b.base;b=b.addonProps;return babelHelpers["extends"]({},c,{rowType:d("WAWebAddonConstants").AddonMinimizedType.PinInChat,arbitraryIndex:a.id.remote.toString(),addonProps:b})}function h(a){var b=c("WAWebMsgKey").fromString(a.msgKey),e=a.addonProps;return babelHelpers["extends"]({id:b},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{type:d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE,kind:d("WAWebMsgType").MsgKind.PinInChat,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,ack:a.ack,t:a.t,read:a.read,pinParentKey:c("WAWebMsgKey").fromString(a.targetMsgKey),pinSenderTimestampMs:e.pinSenderTimestampMs,pinMessageType:(b=d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.cast(e.pinMessageType))!=null?b:d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.UNKNOWN_TYPE,pinExpiryDuration:e.pinExpiryDuration})}function i(a){var b=c("WAWebMsgKey").fromString(a.msgKey);b=d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon);var e=b.from,f=b.to;b=b.author;return{id:c("WAWebMsgKey").fromString(a.msgKey),from:e,to:f,author:b,type:d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE,kind:d("WAWebMsgType").MsgKind.PinInChat,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,ack:a.ack,t:a.t,read:a.read,pinSenderTimestampMs:a.senderTimestampMs,pinParentKey:c("WAWebMsgKey").fromString(a.parentMsgKey),pinMessageType:(e=d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.cast(a.pinType))!=null?e:d("WAWebProtobufsE2E.pb").Message$PinInChatMessage$Type.UNKNOWN_TYPE,pinExpiryDuration:a.pinExpiryDuration}}g.serializePinInChat=a;g.deserializePinInChat=b;g.serializePinInChatMsgData=e;g.pinInChatMsgDatIntoUnifiedAddonRow=f;g.unifiedAddonRowIntoPinInChatMsgData=h;g.deserializePinInChatMsgData=i}),98); __d("WAWebPinMsgParseWebMsgInfoPinInChat",["WALogger","WALongInt","WANullthrows","WAWebAddOnParseWebMsgInfo","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMsgInfoPinInChat failed with error "," and stack ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseWebMsgInfoPinInChat: pinInChat sender should be a wid."]);i=function(){return a};return a}function a(a,b){var e=[];try{if(a==null||a.pinInChat==null)return e;if(b==null||b.pinInChat==null)return e;a=b.pinInChat;var f=a.key,g=a.type,j=a.senderTimestampMs,k=a.serverTimestampMs;a=a.messageAddOnContextInfo;f=c("WANullthrows")(d("WAWebAddOnParseWebMsgInfo").buildAddonMsgKey(c("WANullthrows")(f)));var l=f.msgKey;f=f.sender;if(f==null)d("WALogger").ERROR(i());else{e.push({msgKey:l,parentMsgKey:b.id,chatId:d("WAWebWidFactory").toChatWid(l.remote),senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(j)),t:(b=d("WAWebAddOnParseWebMsgInfo").getAddonServerTimestamp(k))!=null?b:void 0,pinType:c("WANullthrows")(g),sender:f,pinExpiryDuration:a==null?void 0:a.messageAddOnDurationInSecs})}}catch(a){d("WALogger").ERROR(h(),a==null?void 0:a.name,a==null?void 0:a.stack)}return e}g.parseWebMsgInfoPinInChat=a}),98); __d("WAWebPinInChatValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({INVALID_PIN_IN_CHAT_EXPIRY_DURATION:"pin_in_chat_invalid_expiry_duration",INVALID_PIN_IN_CHAT_MSG_REMOTE:"pin_in_chat_invalid_msg_remote",MISSING_PARENT_MSG_KEY:"pin_in_chat_missing_parent_msg_key",MISSING_TYPE:"pin_in_chat_missing_type",MISSING_SENDER_TIMESTAMP:"pin_in_chat_missing_timestamp",INVALID_EDIT_ATTR:"invalid_edit_attr"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="PinInChatValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.PinInChatValidationErrorCode=a;g.PinInChatValidationError=c}),98); __d("WAWebParsePinMessageProto",["WALongInt","WAWebAck","WAWebE2EProtoUtils","WAWebLidMigrationUtils","WAWebMsgType","WAWebPinInChatValidationError","WAWebPinMsgGatingUtils","WAWebWamEnumE2eFailureReason","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage,f=a.editAttr;a=a.msgContext;var g=b.pinInChatMessage;if(g==null)return;if(!d("WAWebPinMsgGatingUtils").isPinnedMessagesM1ReceiverEnabled())return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE}),contextInfo:null};if(a==="relay"&&f!==d("WAWebAck").EDIT_ATTR.PIN_IN_CHAT)throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.INVALID_EDIT_ATTR,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);a=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(g.key,e);if(a==null)throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.MISSING_PARENT_MSG_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(!c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(a.remote,e.id.remote))&&!a.remote.isBroadcast())throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.INVALID_PIN_IN_CHAT_MSG_REMOTE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);b=(f=b.messageContextInfo)==null?void 0:f.messageAddOnDurationInSecs;if(b!=null&&b<0)throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.INVALID_PIN_IN_CHAT_EXPIRY_DURATION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f=g.type;if(f==null)throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.MISSING_TYPE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);g=d("WALongInt").maybeNumberOrThrowIfTooLarge(g.senderTimestampMs);if(g==null)throw new(d("WAWebPinInChatValidationError").PinInChatValidationError)(d("WAWebPinInChatValidationError").PinInChatValidationErrorCode.MISSING_SENDER_TIMESTAMP,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);e=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE,kind:d("WAWebMsgType").MsgKind.PinInChat,pinParentKey:a,pinMessageType:f,pinSenderTimestampMs:g,pinExpiryDuration:b});return{msgData:e,contextInfo:null}}g["default"]=a}),98); __d("WAWebPollVoteAddonMessageProcessor",["Promise","WALogger","WAWebABProps","WAWebAddonConstants","WAWebAddonCreateMsgProcessor","WAWebAddonInfraError","WAWebAddonLogUtils","WAWebBackendApi","WAWebDBMarkFutureproofMessagesReparsed","WAWebLastAddOnDBSerialization","WAWebMsgType","WAWebPollVoteEncryptMsgData","WAWebPollsExtractVotes","WAWebPollsParseWebMsgInfoPollUpdates","WAWebPollsVoteDataUtils","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[pollVoteMsgProcessor] Failed to decrypt poll vote message"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cannot decrypt poll vote message: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[pollVoteMsgProcessor] Decrypting poll vote message"]);k=function(){return a};return a}var l=d("WAWebAddonCreateMsgProcessor").createAddonMsgProcessorDualEncrypted({isEnabled:function(){return d("WAWebABProps").getABPropConfigValue("unified_poll_vote_addon_infra_enabled")},convert:{fromHistorySyncMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebPollsParseWebMsgInfoPollUpdates").parseWebMsgInfoPollUpdates(a).then(function(a){return a.map(d("WAWebPollsVoteDataUtils").voteDataToPollVoteMsgData)})});function c(b){return a.apply(this,arguments)}return c}(),toDualEncryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.PollVoteEncrypted?a:d("WAWebPollVoteEncryptMsgData").encryptPollVoteMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}(),toDualDecryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.PollVoteDecrypted?a:d("WAWebPollsExtractVotes").extractVote(a,b).then(d("WAWebPollsVoteDataUtils").voteDataToPollVoteMsgData)});function c(b,c){return a.apply(this,arguments)}return c}()},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return d("WAWebBackendApi").frontendSendAndReceive("upsertVotesModelCollection",{votes:a.add.map(d("WAWebPollsVoteDataUtils").pollVoteMsgDataToVoteData),votesToRemove:a.remove,restoredFromDb:b===d("WAWebAddonConstants").AddonProcessMode.Hydration||b===d("WAWebAddonConstants").AddonProcessMode.HistorySync})});function c(b,c){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c=c.parents;var e=[],f=[];for(a of a)if(a.addonEncrypted){var g=c.getForAddon(a);if(g==null)throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.MissingParentMsg);f.push(l.convert.toDualDecryptedMsgData(a,g));d("WALogger").LOG(k()).sendLogs("unexpected encrypted poll vote",{sampling:.01})}else e.push(a);if(f.length!==0){g=(yield (h||(h=b("Promise"))).allSettled(f));for(c of g)c.status==="fulfilled"&&c.value.kind===d("WAWebMsgType").MsgKind.PollVoteDecrypted?e.push(c.value):d("WALogger").LOG(j(),c.reason);d("WAWebAddonLogUtils").hasSettledWithError(g)&&d("WALogger").ERROR(i()).tags("messagings","addons").sendLogs("poll-vote-decryption-error",{sampling:.01})}return e});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.processMode;yield d("WAWebShouldUpdateLastAddOnPreview").filterAndUpdateChatPreviews(a.map(function(a){return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromVoteData(d("WAWebPollsVoteDataUtils").pollVoteMsgDataToVoteData(a),!1)}));if(b===d("WAWebAddonConstants").AddonProcessMode.HistorySync)return;b===d("WAWebAddonConstants").AddonProcessMode.OnlineReceive&&(yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a.map(function(a){return a.id.toString()})))});function c(b,c){return a.apply(this,arguments)}return c}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}()});a=l;g["default"]=a}),98); __d("WAWebPollsCreateOptionLocalIdMap",["Promise","WAHex","WANullthrows","WAWebPollOptionHashUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j(a)),c=d("WAHex").toHex(new Uint8Array(b));return{hash:b,hexHash:c,localId:a.localId}});return function(b){return a.apply(this,arguments)}}())));var e=new Map(),f=new Map();for(a of a){var g=a.hash,i=a.hexHash,k=a.localId;e.set(i,k);f.set(k,g)}return{getLocalIdForHexHash:function(a){return c("WANullthrows")(e.get(a))},getLocalIdForHash:function(a){return c("WANullthrows")(e.get(d("WAHex").toHex(new Uint8Array(a))))},getHashForLocalId:function(a){return c("WANullthrows")(f.get(a))},includesHashes:function(a){return a.every(function(a){return e.has(d("WAHex").toHex(new Uint8Array(a)))})}}});return i.apply(this,arguments)}function j(a){return d("WAWebPollOptionHashUtils").getHashBufferForString(a.name)}g.createOptionLocalIdMap=a}),98); __d("WAWebPollsProtobufConversion",["WALongInt","WANullthrows","WAWebPollsCreateOptionLocalIdMap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(b));a=a.selectedOptionLocalIds.map(b.getHashForLocalId);return{selectedOptions:a.length===0?null:a}});return h.apply(this,arguments)}function e(a){var b=a.voteProtobuf,e=a.pollVoteMsgKey,f=a.parentMsgKey,g=a.sender,h=a.senderTimestampMs,i=a.t,j=a.optionLocalIdMap,k=a.ack;a=a.read;return{msgKey:e,parentMsgKey:c("WANullthrows")(f),selectedOptionLocalIds:b.selectedOptions.map(j.getLocalIdForHash),senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(h),t:d("WALongInt").maybeNumberOrThrowIfTooLarge(i),sender:g,ack:k,read:a}}g.protobufFromVote=a;g.voteFromProtobuf=e}),98); __d("WAWebPollVoteEncryptMsgData",["WANullthrows","WAWebAck","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebPollsProtobufConversion","WAWebPollsVoteEncryption","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f,g=(f=c("WANullthrows"))((e=d("WAWebMsgGetters")).getPollOptions(b)),h=f(e.getMessageSecret(b),"Poll creation missing message secret"),i=f(e.getOriginalSender(b)),j=self.crypto.getRandomValues(new Uint8Array(12));g=(yield d("WAWebPollsVoteEncryption").encryptVote({encodedProtobuf:yield d("WAWebPollsProtobufConversion").protobufFromVote(a,g),iv:j,messageSecret:h,pollCreationOriginalSender:i,stanzaId:b.id.id,voteSender:d("WAWebWidFactory").toUserWid(f(e.getSender(a))),isOneOnOne:e.getRemote(b).isUser()}));h=g.encPayload;return babelHelpers["extends"]({id:a.id,type:d("WAWebMsgType").MSG_TYPE.POLL_UPDATE,kind:d("WAWebMsgType").MsgKind.PollVoteEncrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:"poll_vote",addonEncrypted:!0,t:Math.floor(a.senderTimestampMs/1e3)},d("WAWebMsgKeyUtils").msgKeyToTargetInfo(a.id,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),{isNewMsg:!0,local:!0,ack:(i=a.ack)!=null?i:d("WAWebAck").ACK.CLOCK,pollUpdateParentKey:b.id,encPollVote:{encPayload:h,encIv:j.buffer},senderTimestampMs:a.senderTimestampMs})});return h.apply(this,arguments)}g.encryptPollVoteMsgData=a}),98); __d("WAWebDBPollsDeleteVotes",["Promise","WAWebDBMessageDelete","WAWebPollsVotesSchema","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebPollsVotesSchema").getTable().anyOf(["parentMsgKey"],a));if(a.length===0)return;var c=a.map(function(a){return a.msgKey});a=a.map(function(a){return[a.parentMsgKey,a.sender]});c=(yield (h||(h=b("Promise"))).allSettled([d("WAWebDBMessageDelete").removeMessagesFromHistory(c,{deleteAssociatedMsgs:!1}),d("WAWebPollsVotesSchema").getTable().bulkRemove(a)]));for(a of c)if(a.status==="rejected")throw a.reason});return i.apply(this,arguments)}g.deleteVotesByParentMsgKeys=a}),98); __d("WAWebDBPollsGetParentMessages",["WANullthrows","WAWebAddonProcessMsgsUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs(a,null));var b=a[0];a=a[1];var c=new Map(),e=[];for(a of a){var f=b.get(i(a));f==null||f.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN?e.push(a):c.set(a,f)}return{pollUpdateMsgsToParentMsgs:c,orphans:e}});return h.apply(this,arguments)}function i(a){return c("WANullthrows")(a.pollUpdateParentKey).toString()}g.getParentMessages=a}),98); __d("WAWebPollsParseWebMsgInfoPollUpdates",["WALogger","WALongInt","WANullthrows","WAWebAddOnParseWebMsgInfo","WAWebMsgType","WAWebPollsCreateOptionLocalIdMap","WAWebPollsProtobufConversion","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMsgInfoPollUpdates failed with error "," and stack ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed to parse pollUpdate with error ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.webMsgInfo,e=a.parsedWebMsgInfo,f=a.isFromCag;try{if(b==null||b.pollUpdates==null)return[];if(e==null||e.type!==d("WAWebMsgType").MSG_TYPE.POLL_CREATION)return[];var g=e,j=(yield d("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(g.pollOptions));return b.pollUpdates.map(function(a){try{var b,e=(b=c("WANullthrows"))(a.pollUpdateMessageKey),h=b(a.vote);e=b(d("WAWebAddOnParseWebMsgInfo").buildAddonMsgKey(e,f));var k=e.msgKey;e=e.sender;return d("WAWebPollsProtobufConversion").voteFromProtobuf({voteProtobuf:h,pollVoteMsgKey:k,parentMsgKey:g.id,sender:e,senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(b(a.senderTimestampMs)),t:d("WAWebAddOnParseWebMsgInfo").getAddonServerTimestamp(a.serverTimestampMs),optionLocalIdMap:j,ack:null,read:a.unread!==!0})}catch(a){d("WALogger").ERROR(i(),a).devConsole(a).sendLogs("parseWebMsgInfoPollUpdates-vote-parse-error");return null}}).filter(Boolean)}catch(a){d("WALogger").ERROR(h(),a==null?void 0:a.name,a==null?void 0:a.stack).sendLogs("parseWebMsgInfoPollUpdates-error");return[]}});return j.apply(this,arguments)}g.parseWebMsgInfoPollUpdates=a}),98); __d("WAWebPollsValidationError",["$InternalEnum","WACustomError","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){c=(a=b("$InternalEnum"))({INVALID_MESSAGE_SECRET:"poll_creation_invalid_message_secret",INVALID_NAME:"poll_creation_invalid_name",INVALID_OPTIONS_COUNT:"poll_creation_invalid_options_count",INVALID_OPTION:"poll_creation_invalid_option",INVALID_SELECTABLE_OPTIONS_COUNT:"poll_creation_invalid_selectable_options_count",MISSING_MESSAGE_SECRET:"poll_creation_missing_message_secret",MISSING_NAME:"poll_creation_missing_name",MISSING_OPTIONS:"poll_creation_missing_options",MISSING_SELECTABLE_OPTIONS_COUNT:"poll_creation_missing_selectable_options_count",DUPLICATE_OPTIONS:"poll_creation_duplicate_options"});e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="PollCreationValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);f=a({INVALID_VOTE_ENC_IV:"poll_update_invalid_vote_enc_iv",MISSING_POLL_MESSAGE_KEY:"poll_update_missing_poll_message_key",MISSING_SENDER_TIMESTAMP:"poll_update_missing_sender_timestamp",MISSING_UPDATE:"poll_update_missing_update",MISSING_VOTE_ENC_IV:"poll_update_missing_vote_enc_iv",MISSING_VOTE_ENC_PAYLOAD:"poll_update_missing_vote_enc_payload",MESSAGE_STANZA_INVALID:"poll_update_message_stanza_invalid"});b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="PollUpdateValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);var h=a({INVALID_MESSAGE_SECRET:"poll_vote_invalid_message_secret",INVALID_OPTION:"poll_vote_invalid_option",INVALID_OPTIONS_COUNT:"poll_vote_invalid_options_count",OPTION_NOT_FOUND:"poll_vote_option_not_found"}),i=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this,a)||this;c.code=a;return c}return a}(d("WACustomError").customError("PollVoteValidationError"));a=a({INVALID_NAME:"poll_result_snapshot_invalid_name",INVALID_POLL_VOTES_SNAPSHOTS_COUNT:"poll_result_snapshot_invalid_poll_votes_snapshots_count",INVALID_OPTIONS_COUNT:"poll_result_snapshot_invalid_options_count",INVALID_OPTION:"poll_result_snapshot_invalid_option",INVALID_OPTION_VOTE_COUNT:"poll_result_snapshot_invalid_option_vote_count",MISSING_NAME:"poll_result_snapshot_missing_name",MISSING_POLL_VOTES:"poll_result_snapshot_missing_poll_votes",MISSING_OPTION:"poll_result_snapshot_missing_option",MISSING_OPTIONS:"poll_result_snapshot_missing_options",MISSING_OPTION_VOTE_COUNT:"poll_result_snapshot_missing_option_vote_count",DUPLICATE_OPTIONS:"poll_result_snapshot_duplicate_options"});d=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="PollResultSnapshotValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.PollCreationValidationErrorCode=c;g.PollCreationValidationError=e;g.PollUpdateValidationErrorCode=f;g.PollUpdateValidationError=b;g.PollVoteValidationErrorCode=h;g.PollVoteValidationError=i;g.PollResultSnapshotValidationErrorCode=a;g.PollResultSnapshotValidationError=d}),98); __d("WAWebPollsExtractVotes",["Promise","WALogger","WANullthrows","WAWebAddonEncryptionError","WAWebMsgGetters","WAWebMsgType","WAWebPollsCreateOptionLocalIdMap","WAWebPollsProtobufConversion","WAWebPollsValidationError","WAWebPollsVoteEncryption","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Poll vote extraction failed: ","\n",""],["Poll vote extraction failed: ","\\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Poll vote extraction failed: ",""]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).allSettled(Array.from(a.entries()).map(function(a){var b=a[0];a=a[1];return l(b,a)})));return a.map(function(a){switch(a.status){case"fulfilled":return a.value;case"rejected":a=a.reason;if(a instanceof d("WAWebPollsValidationError").PollVoteValidationError){d("WALogger").ERROR(j(),a.code).sendLogs(a.code);return}d("WALogger").ERROR(i(),a.message,a.stack).sendLogs("poll-vote-extraction-unknown-error")}}).filter(Boolean)});return k.apply(this,arguments)}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.PollVoteEncrypted,b),f=c("WANullthrows")(b.pollSelectableOptionsCount),g=c("WANullthrows")(b.pollOptions),h=c("WANullthrows")(a.encPollVote),i=d("WAWebWidFactory").toUserWid(d("WAWebMsgGetters").getSender(a));h=(yield d("WAWebPollsVoteEncryption").decryptVote({encryptedVote:h.encPayload,iv:h.encIv,messageSecret:e,stanzaId:b.id.id,pollCreationOriginalSender:d("WAWebMsgGetters").getOriginalSender(b),voteSender:i,isOneOnOne:d("WAWebMsgGetters").getRemote(b).isUser()}));e=h.selectedOptions.length;if(e>g.length||f!==0&&e>f)throw new(d("WAWebPollsValidationError").PollVoteValidationError)(d("WAWebPollsValidationError").PollVoteValidationErrorCode.INVALID_OPTIONS_COUNT);if(h.selectedOptions.some(function(a){return a.byteLength!==32}))throw new(d("WAWebPollsValidationError").PollVoteValidationError)(d("WAWebPollsValidationError").PollVoteValidationErrorCode.INVALID_OPTION);b=(yield d("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(g));if(!b.includesHashes(h.selectedOptions))throw new(d("WAWebPollsValidationError").PollVoteValidationError)(d("WAWebPollsValidationError").PollVoteValidationErrorCode.OPTION_NOT_FOUND);return d("WAWebPollsProtobufConversion").voteFromProtobuf({voteProtobuf:h,pollVoteMsgKey:a.id,parentMsgKey:a.pollUpdateParentKey,sender:i,senderTimestampMs:a.senderTimestampMs,t:c("WANullthrows")(a.t),optionLocalIdMap:b,ack:a.ack,read:d("WAWebUserPrefsMeUser").isMeAccount(i)})});return m.apply(this,arguments)}g.extractVotes=a;g.extractVote=l}),98); __d("WAWebParsePollResultSnapshotMessageProto",["WALongInt","WAWebMsgType","WAWebPollsGatingUtils","WAWebPollsValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.messageProtobuf,c=a.baseMessage;a=a.msgContext;b=b.pollResultSnapshotMessage;if(b==null)return;if(!d("WAWebPollsGatingUtils").isPollResultSnapshotReceivingEnabled())return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT}),contextInfo:b.contextInfo};var e=b.name,f=b.pollVotes;b=b.contextInfo;if(e==null)throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.MISSING_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e.length===0||e.length>d("WAWebPollsGatingUtils").getMaxPollNameLengthForIncomingMessages())throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.INVALID_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(a==="quoted"||a==="history_quoted"){a=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT,kind:d("WAWebMsgType").MsgKind.PollResultSnapshot,pollName:e,pollVotesSnapshot:null});return{msgData:a,contextInfo:b}}if(f==null||f.length===0)throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.MISSING_POLL_VOTES,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);var g=new Set();a=f.map(function(a){var b=a.optionName;a=a.optionVoteCount;if(b==null)throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.MISSING_OPTION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(b.length===0||b.length>d("WAWebPollsGatingUtils").getMaxPollOptionLengthForIncomingMessages())throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.INVALID_OPTION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(a==null)throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.MISSING_OPTION_VOTE_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);a=d("WALongInt").maybeNumber(a);if(a==null)throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.INVALID_OPTION_VOTE_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(g.has(b))throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.DUPLICATE_OPTIONS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);var c=g.size;g.add(b);return{option:{localId:c,name:b},optionVoteCount:a}}).filter(Boolean);if(a.length<2||a.length>d("WAWebPollsGatingUtils").getMaxPollOptionCount())throw new(d("WAWebPollsValidationError").PollResultSnapshotValidationError)(d("WAWebPollsValidationError").PollResultSnapshotValidationErrorCode.INVALID_POLL_VOTES_SNAPSHOTS_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);f=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT,kind:d("WAWebMsgType").MsgKind.PollResultSnapshot,pollName:e,pollVotesSnapshot:{pollVotes:a}});return{msgData:f,contextInfo:b}}g["default"]=a}),98); __d("WAWebPollsParsePollCreationMessageProto",["WANullthrows","WAWebMessageSecretErrorsWamEvent","WAWebMsgType","WAWebNewsletterIsNewsletterMsg","WAWebPollCreationUtils","WAWebPollOptionHashUtils","WAWebPollsGatingUtils","WAWebPollsValidationError","WAWebWamEnumE2eFailureReason","WAWebWamEnumMessageSecretAllowedType","WAWebWamEnumMessageSecretErrorType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;var f=b.pollCreationMessage,g=b.pollCreationMessageV2,h=b.pollCreationMessageV3;f=(f=(f=f)!=null?f:g)!=null?f:h;var i=c("WAWebNewsletterIsNewsletterMsg")({from:e.from,to:e.to});i=!i;if(f==null)return null;if(f===g&&!d("WAWebPollsGatingUtils").isPollsReceivingEnabledInCags())return null;if(f===h&&!d("WAWebPollsGatingUtils").isSingleOptionPollsReceivingEnabled())return null;g=f.name;h=f.options;var j=f.selectableOptionsCount,k=f.contextInfo;f=d("WAWebPollCreationUtils").getPollContentTypeFromE2EValue(f.pollContentType);var l=f===d("WAWebPollCreationUtils").PollContentType.IMAGE;if(l&&!d("WAWebPollsGatingUtils").isPhotoPollReceiverEnabled(e))return{msgData:babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.POLL_CREATION}),contextInfo:k};if(g==null)throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.MISSING_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(g.length===0||g.length>d("WAWebPollsGatingUtils").getMaxPollNameLengthForIncomingMessages())throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_NAME,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(a==="quoted"||a==="history_quoted"){a=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.POLL_CREATION,kind:d("WAWebMsgType").MsgKind.PollCreation,pollName:g,pollOptions:null,pollSelectableOptionsCount:null,pollContentType:f});return{msgData:a,contextInfo:k}}b=(a=b.messageContextInfo)==null?void 0:a.messageSecret;if(i&&b==null){new(d("WAWebMessageSecretErrorsWamEvent").MessageSecretErrorsWamEvent)({messageSecretAllowedList:d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.MISSING_MESSAGE_SECRET}).commit();throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.MISSING_MESSAGE_SECRET,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MISSING_MESSAGE_SECRET)}if(i&&(b==null?void 0:b.byteLength)!==32){new(d("WAWebMessageSecretErrorsWamEvent").MessageSecretErrorsWamEvent)({messageSecretAllowedList:d("WAWebWamEnumMessageSecretAllowedType").MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:d("WAWebWamEnumMessageSecretErrorType").MESSAGE_SECRET_ERROR_TYPE.WRONG_LENGTH}).commit();throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_MESSAGE_SECRET,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MESSAGE_SECRET_INVALID)}if(h==null)throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.MISSING_OPTIONS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(j==null)throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.MISSING_SELECTABLE_OPTIONS_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);var m=new Set(),n=new Set();a=h.map(function(a){var b=a.optionName;a=a.optionHash;if(b==null||b.length===0||b.length>d("WAWebPollsGatingUtils").getMaxPollOptionLengthForIncomingMessages())throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_OPTION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(m.has(b))throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.DUPLICATE_OPTIONS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(l){if(a==null)throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_OPTION,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(n.has(a))throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.DUPLICATE_OPTIONS,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);n.add(a)}var e=m.size;m.add(b);return l?{name:b,hash:d("WAWebPollOptionHashUtils").createOptionHashHexFromString(c("WANullthrows")(a)),localId:e}:{name:b,localId:e}}).filter(Boolean);if(a.length<2||a.length>d("WAWebPollsGatingUtils").getMaxPollOptionCount())throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_OPTIONS_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(j<0||j>a.length)throw new(d("WAWebPollsValidationError").PollCreationValidationError)(d("WAWebPollsValidationError").PollCreationValidationErrorCode.INVALID_SELECTABLE_OPTIONS_COUNT,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);i=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.POLL_CREATION,kind:d("WAWebMsgType").MsgKind.PollCreation,pollName:g,pollOptions:a,pollSelectableOptionsCount:j,pollContentType:f});return{msgData:i,contextInfo:k}}g["default"]=a}),98); __d("WAWebPollsParsePollVoteMessageProto",["WALongInt","WAWebE2EProtoUtils","WAWebMsgType","WAWebPollsValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.pollUpdateMessage;if(!b)return null;var c=b.$$unknownFieldCount;c=c===void 0?0:c;var e=b.vote,f=b.senderTimestampMs;b=b.pollCreationMessageKey;if(c>0)return null;if(b==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_POLL_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);c=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b,a);if(c==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_POLL_MESSAGE_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(f==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_SENDER_TIMESTAMP,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_UPDATE,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);b=e.encPayload;e=e.encIv;if(b==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_VOTE_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e==null)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.MISSING_VOTE_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(e.byteLength!==12)throw new(d("WAWebPollsValidationError").PollUpdateValidationError)(d("WAWebPollsValidationError").PollUpdateValidationErrorCode.INVALID_VOTE_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.POLL_UPDATE,kind:d("WAWebMsgType").MsgKind.PollVoteEncrypted,subtype:"poll_vote",addonEncrypted:!0,pollUpdateParentKey:c,encPollVote:{encPayload:b,encIv:e},senderTimestampMs:d("WALongInt").numberOrThrowIfTooLarge(f)}),contextInfo:null}}g["default"]=a}),98); __d("WAWebPollsVoteEncryption",["WAWebAddonEncryption","WAWebApiContact","WAWebLidMigrationUtils","WAWebMsgType","WAWebPollsVoteEncryptionInternal","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebPollsVoteEncryptionInternal").decryptVoteInternal(a)["catch"](function(b){if(a.isOneOnOne){var c=h(a.pollCreationOriginalSender,a.voteSender),e=c.alignedPollCreator,f=c.alignedVoteSender;if(e!=null&&f!=null)return d("WAWebPollsVoteEncryptionInternal").decryptVoteInternal(babelHelpers["extends"]({},a,{pollCreationOriginalSender:e,voteSender:f}))["catch"](function(b){var c=d("WAWebApiContact").getAlternateUserWid(e),g=d("WAWebApiContact").getAlternateUserWid(f);if(c!=null&&g!=null)return d("WAWebPollsVoteEncryptionInternal").decryptVoteInternal(babelHelpers["extends"]({},a,{pollCreationOriginalSender:c,voteSender:g}));throw b})}throw b})}function b(a){var b={type:d("WAWebMsgType").MsgKind.PollVoteDecrypted,encode:a.encodedProtobuf};if(a.isOneOnOne){var c=h(a.pollCreationOriginalSender,a.voteSender),e=c.alignedPollCreator;c=c.alignedVoteSender;e!=null&&c!=null&&(a.pollCreationOriginalSender=e,a.voteSender=c)}return d("WAWebAddonEncryption").encryptAddOn(b,{messageSecret:a.messageSecret,iv:a.iv,stanzaId:a.stanzaId,originalMessageSender:a.pollCreationOriginalSender,addOnSender:a.voteSender})}function h(a,b){a=d("WAWebLidMigrationUtils").toCommonAddressingMode(a,b);b=a[0];a=a[1];return{alignedVoteSender:a!=null?d("WAWebWidFactory").toUserWid(a):null,alignedPollCreator:b!=null?d("WAWebWidFactory").toUserWid(b):null}}g.decryptVote=a;g.encryptVote=b}),98); __d("WAWebPollsVoteEncryptionInternal",["WAWebAddonEncryption","WAWebMsgType","WAWebProtobufsE2E.pb","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={type:d("WAWebMsgType").MsgKind.PollVoteEncrypted,encryptedAddOn:a.encryptedVote};b=(yield d("WAWebAddonEncryption").decryptAddOn(b,{messageSecret:a.messageSecret,iv:a.iv,stanzaId:a.stanzaId,originalMessageSender:a.pollCreationOriginalSender,addOnSender:a.voteSender}));return d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsE2E.pb").Message$PollVoteMessageSpec,b)});return h.apply(this,arguments)}g.decryptVoteInternal=a}),98); __d("WAWebPollsGatingUtils",["WAWebABProps","WAWebChatGetters","WAWebMobilePlatforms","WAWebNewsletterGatingUtils","WAWebNewsletterIsNewsletterMsg","WAWebPrimaryFeatures","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){if(d("WAWebMobilePlatforms").isSMB()&&!d("WAWebABProps").getABPropConfigValue("parent_group_view_enabled_for_smb_on_web"))return!1;return!d("WAWebPrimaryFeatures").primaryFeatureEnabled("poll_creation_cag")?!1:d("WAWebABProps").getABPropConfigValue("poll_creation_cag_enabled")}function a(){return h()?!0:d("WAWebABProps").getABPropConfigValue("poll_receiving_cag_enabled")}function b(){return Math.min(d("WAWebABProps").getABPropConfigValue("poll_name_length"),500)}function e(){return 5e3}function f(){return Math.min(d("WAWebABProps").getABPropConfigValue("poll_option_length"),255)}function i(){return 2500}function j(){return Math.min(d("WAWebABProps").getABPropConfigValue("poll_option_count"),20)}function k(){return d("WAWebABProps").getABPropConfigValue("poll_result_details_view_enabled")}function l(){return d("WAWebABProps").getABPropConfigValue("polls_fast_follow_enabled")}function m(){return l()}function n(){return l()}function o(){return d("WAWebABProps").getABPropConfigValue("polls_single_option_control_enabled")}function p(a){return c("WAWebWid").isNewsletter(a)===!0?d("WAWebNewsletterGatingUtils").isNewsletterPollsSingleOptionEnabled():o()||d("WAWebABProps").getABPropConfigValue("polls_single_option_sender_control_enabled")}function q(a){return p(a)||d("WAWebABProps").getABPropConfigValue("polls_single_option_receiver_control_enabled")}function r(){return d("WAWebABProps").getABPropConfigValue("polls_notification_enabled")}function s(){return d("WAWebABProps").getABPropConfigValue("poll_result_snapshot_message_receiver_enabled")}function t(){return d("WAWebABProps").getABPropConfigValue("poll_result_snapshot_polltype_envelope_enabled")}function u(a){if(!d("WAWebChatGetters").getIsNewsletter(a))return!1;if(d("WAWebNewsletterGatingUtils").isNewsletterPhotoPollSenderEnabled())return!0;return d("WAWebNewsletterGatingUtils").isNewsletterPhotoPollCapabilityEnabled(a)?!0:!1}function v(a){return c("WAWebNewsletterIsNewsletterMsg")({from:a.from,to:a.to})&&d("WAWebNewsletterGatingUtils").isNewsletterPhotoPollsReceiverEnabled()}g.isPollsCreationEnabledInCags=h;g.isPollsReceivingEnabledInCags=a;g.getMaxPollNameLength=b;g.getMaxPollNameLengthForIncomingMessages=e;g.getMaxPollOptionLength=f;g.getMaxPollOptionLengthForIncomingMessages=i;g.getMaxPollOptionCount=j;g.isPollResultDetailsViewEnabled=k;g.arePollsFastFollowsEnabled=l;g.isPrefillPollQuestionEnabled=m;g.isPollsCancellationPromptEnabled=n;g.isSingleOptionPollsSendingEnabled=p;g.isSingleOptionPollsReceivingEnabled=q;g.arePollsNotificationsEnabled=r;g.isPollResultSnapshotReceivingEnabled=s;g.isPollResultSnapshotPollTypeEnvelopeEnabled=t;g.isPhotoPollSenderEnabled=u;g.isPhotoPollReceiverEnabled=v}),98); __d("WAWebParseProductMessageProto",["WALongInt","WAWebMsgType","WAWebParseImageMessageProto"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,e=a.baseMessage;a=a.msgContext;b=b.productMessage;if(b==null)return;var f=b.product,g=b.businessOwnerJid,h=b.body,i=b.footer;b=b.contextInfo;if(f==null)return;var j=f.productImage,k=f.productId,l=f.currencyCode,m=f.priceAmount1000,n=f.salePriceAmount1000,o=f.retailerId,p=f.url,q=f.productImageCount,r=f.title;f=f.description;var s={};if(j!=null){j=c("WAWebParseImageMessageProto")({messageProtobuf:{imageMessage:j},baseMessage:e,msgContext:a});if(j!=null){a=j.msgData;s={deprecatedMms3Url:a.deprecatedMms3Url,directPath:a.directPath,staticUrl:a.staticUrl,mimetype:a.mimetype,filehash:a.filehash,encFilehash:a.encFilehash,size:a.size,height:a.height,width:a.width,mediaKey:a.mediaKey,mediaKeyTimestamp:a.mediaKeyTimestamp,body:a.body,interactiveAnnotations:a.interactiveAnnotations,scanLengths:a.scanLengths,scansSidecar:a.scansSidecar,isViewOnce:a.isViewOnce,thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:a.thumbnailSha256,thumbnailEncSha256:a.thumbnailEncSha256}}}e=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.PRODUCT,kind:d("WAWebMsgType").MsgKind.Product,businessOwnerJid:g,productId:k,currencyCode:l,priceAmount1000:d("WALongInt").numberOrThrowIfTooLarge((j=m)!=null?j:0)||void 0,salePriceAmount1000:d("WALongInt").numberOrThrowIfTooLarge((a=n)!=null?a:0)||void 0,retailerId:o,url:p,productImageCount:q,title:r,description:f,caption:h,footer:i},s);return{msgData:e,contextInfo:b}}g["default"]=a}),98); __d("WAWebBizCatalogManagementFetchProductListQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9742717385774446"}),null); __d("WAWebBizCatalogManagementFetchProductListQuery.graphql",["WAWebBizCatalogManagementFetchProductListQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],c=[{kind:"Variable",name:"request",variableName:"request"}],d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},l=[h,k];i=[{alias:null,args:null,kind:"ScalarField",name:"availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,f,g],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},h,i,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},j,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},j],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:l,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:l,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchProductListQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetProductListResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product_list",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductListResponse",kind:"LinkedField",name:"product_list",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:i,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementFetchProductListQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetProductListResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product_list",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductListResponse",kind:"LinkedField",name:"product_list",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:i,storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementFetchProductListQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchProductListQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WASmaxInBizCtwaAdAccountIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInBizCtwaAdAccountIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInBizCtwaAdAccountIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInBizCtwaAdAccountIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInBizCtwaAdAccountCommonAdAccountErrors",["WAResultOrError","WASmaxInBizCtwaAdAccountIQErrorBadRequestMixin","WASmaxInBizCtwaAdAccountIQErrorForbiddenMixin","WASmaxInBizCtwaAdAccountIQErrorInternalServerErrorMixin","WASmaxInBizCtwaAdAccountIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBizCtwaAdAccountIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInBizCtwaAdAccountIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:c.value});var e=d("WASmaxInBizCtwaAdAccountIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:e.value});var f=d("WASmaxInBizCtwaAdAccountIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorForbidden","IQErrorInternalServerError","IQErrorServiceUnavailable"],[b,c,e,f])}g.parseCommonAdAccountErrors=a}),98); __d("WASmaxInBizCtwaAdAccountIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin",["WAResultOrError","WASmaxInBizCtwaAdAccountIQErrorResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!c.success)return c;a=d("WASmaxInBizCtwaAdAccountIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({to:c.value},a.value))}g.parseHackBaseIQErrorResponseMixin=a}),98); __d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseError",["WAResultOrError","WASmaxInBizCtwaAdAccountCommonAdAccountErrors","WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin").parseHackBaseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBizCtwaAdAccountCommonAdAccountErrors").parseCommonAdAccountErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorCommonAdAccountErrors:b.value}))}g.parseGetAccessTokenAndSessionCookiesResponseError=a}),98); __d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseIncorrectNonce",["WAResultOrError","WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"code","432");if(!e.success)return e;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"text","INCORRECT_NONCE");if(!c.success)return c;a=d("WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin").parseHackBaseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorCode:e.value,errorText:c.value},a.value))}g.parseGetAccessTokenAndSessionCookiesResponseIncorrectNonce=a}),98); __d("WASmaxInBizCtwaAdAccountIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInBizCtwaAdAccountHackBaseIQResultResponseMixin",["WAResultOrError","WASmaxInBizCtwaAdAccountIQResultResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!c.success)return c;a=d("WASmaxInBizCtwaAdAccountIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({to:c.value},a.value))}g.parseHackBaseIQResultResponseMixin=a}),98); __d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseSuccess",["WAResultOrError","WASmaxInBizCtwaAdAccountHackBaseIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"access_token");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(a,"session_cookies");if(!e.success)return e;var f=d("WASmaxParseUtils").flattenedChildWithTag(a,"business_person");if(!f.success)return f;c=d("WASmaxParseUtils").contentString(c.value);if(!c.success)return c;e=d("WASmaxParseUtils").contentString(e.value);if(!e.success)return e;f=d("WASmaxParseUtils").attrString(f.value,"id");if(!f.success)return f;a=d("WASmaxInBizCtwaAdAccountHackBaseIQResultResponseMixin").parseHackBaseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({accessTokenElementValue:c.value,sessionCookiesElementValue:e.value,businessPersonId:f.value},a.value))}g.parseGetAccessTokenAndSessionCookiesResponseSuccess=a}),98); __d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseTooManyAttempts",["WAResultOrError","WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"code","431");if(!e.success)return e;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"text","TOO_MANY_ATTEMPTS");if(!c.success)return c;a=d("WASmaxInBizCtwaAdAccountHackBaseIQErrorResponseMixin").parseHackBaseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorCode:e.value,errorText:c.value},a.value))}g.parseGetAccessTokenAndSessionCookiesResponseTooManyAttempts=a}),98); __d("WASmaxOutBizCtwaAdAccountBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBizCtwaAdAccountHackBaseIQGetRequestMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutBizCtwaAdAccountBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iqFrom;a=d("WASmaxOutBizCtwaAdAccountBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{from:d("WASmaxAttrs").OPTIONAL(d("WAWap").USER_JID,a),to:d("WAWap").S_WHATSAPP_NET}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeHackBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBizCtwaAdAccountGetAccessTokenAndSessionCookiesRequest",["WASmaxJsx","WASmaxOutBizCtwaAdAccountHackBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.codeElementValue;b=d("WASmaxOutBizCtwaAdAccountHackBaseIQGetRequestMixin").mergeHackBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"fb:thrift_iq",smax_id:d("WAWap").INT(104)},d("WASmaxJsx").smax("parameters",null,d("WASmaxJsx").smax("code",null,b))),a);return b}g.makeGetAccessTokenAndSessionCookiesRequest=a}),98); __d("WASmaxBizCtwaAdAccountGetAccessTokenAndSessionCookiesRPC",["WAComms","WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseError","WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseIncorrectNonce","WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseSuccess","WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseTooManyAttempts","WASmaxOutBizCtwaAdAccountGetAccessTokenAndSessionCookiesRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBizCtwaAdAccountGetAccessTokenAndSessionCookiesRequest").makeGetAccessTokenAndSessionCookiesRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseSuccess").parseGetAccessTokenAndSessionCookiesResponseSuccess(b,a);if(c.success)return{name:"GetAccessTokenAndSessionCookiesResponseSuccess",value:c.value};var e=d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseTooManyAttempts").parseGetAccessTokenAndSessionCookiesResponseTooManyAttempts(b,a);if(e.success)return{name:"GetAccessTokenAndSessionCookiesResponseTooManyAttempts",value:e.value};var f=d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseIncorrectNonce").parseGetAccessTokenAndSessionCookiesResponseIncorrectNonce(b,a);if(f.success)return{name:"GetAccessTokenAndSessionCookiesResponseIncorrectNonce",value:f.value};b=d("WASmaxInBizCtwaAdAccountGetAccessTokenAndSessionCookiesResponseError").parseGetAccessTokenAndSessionCookiesResponseError(b,a);if(b.success)return{name:"GetAccessTokenAndSessionCookiesResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetAccessTokenAndSessionCookies",{Success:c,TooManyAttempts:e,IncorrectNonce:f,Error:b}))});return h.apply(this,arguments)}g.sendGetAccessTokenAndSessionCookiesRPC=a}),98); __d("WASmaxInBizAccessTokenIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInBizAccessTokenHackBaseIQErrorResponseMixin",["WAResultOrError","WASmaxInBizAccessTokenIQErrorResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!c.success)return c;a=d("WASmaxInBizAccessTokenIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({to:c.value},a.value))}g.parseHackBaseIQErrorResponseMixin=a}),98); __d("WASmaxInBizAccessTokenIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInBizAccessTokenIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInBizAccessTokenIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInBizAccessTokenIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInBizAccessTokenRequestSilentNonceErrors",["WAResultOrError","WASmaxInBizAccessTokenIQErrorBadRequestMixin","WASmaxInBizAccessTokenIQErrorForbiddenMixin","WASmaxInBizAccessTokenIQErrorInternalServerErrorMixin","WASmaxInBizAccessTokenIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBizAccessTokenIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInBizAccessTokenIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:c.value});var e=d("WASmaxInBizAccessTokenIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:e.value});var f=d("WASmaxInBizAccessTokenIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorForbidden","IQErrorInternalServerError","IQErrorServiceUnavailable"],[b,c,e,f])}g.parseRequestSilentNonceErrors=a}),98); __d("WASmaxInBizAccessTokenRequestSilentNonceResponseError",["WAResultOrError","WASmaxInBizAccessTokenHackBaseIQErrorResponseMixin","WASmaxInBizAccessTokenRequestSilentNonceErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBizAccessTokenHackBaseIQErrorResponseMixin").parseHackBaseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBizAccessTokenRequestSilentNonceErrors").parseRequestSilentNonceErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorRequestSilentNonceErrors:b.value}))}g.parseRequestSilentNonceResponseError=a}),98); __d("WASmaxInBizAccessTokenIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInBizAccessTokenHackBaseIQResultResponseMixin",["WAResultOrError","WASmaxInBizAccessTokenIQResultResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!c.success)return c;a=d("WASmaxInBizAccessTokenIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({to:c.value},a.value))}g.parseHackBaseIQResultResponseMixin=a}),98); __d("WASmaxInBizAccessTokenRequestSilentNonceResponseRecoveryRequired",["WAResultOrError","WASmaxInBizAccessTokenHackBaseIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"result");if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"status","RecoveryRequired");if(!e.success)return e;c=d("WASmaxParseUtils").attrString(c.value,"email");if(!c.success)return c;a=d("WASmaxInBizAccessTokenHackBaseIQResultResponseMixin").parseHackBaseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({resultStatus:e.value,resultEmail:c.value},a.value))}g.parseRequestSilentNonceResponseRecoveryRequired=a}),98); __d("WASmaxInBizAccessTokenRequestSilentNonceResponseSuccess",["WAResultOrError","WASmaxInBizAccessTokenHackBaseIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"result");if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"status","Success");if(!c.success)return c;a=d("WASmaxInBizAccessTokenHackBaseIQResultResponseMixin").parseHackBaseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({resultStatus:c.value},a.value))}g.parseRequestSilentNonceResponseSuccess=a}),98); __d("WASmaxOutBizAccessTokenBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBizAccessTokenHackBaseIQGetRequestMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutBizAccessTokenBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iqFrom;a=d("WASmaxOutBizAccessTokenBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{from:d("WASmaxAttrs").OPTIONAL(d("WAWap").USER_JID,a),to:d("WAWap").S_WHATSAPP_NET}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeHackBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBizAccessTokenRequestSilentNonceRequest",["WASmaxJsx","WASmaxOutBizAccessTokenHackBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutBizAccessTokenHackBaseIQGetRequestMixin").mergeHackBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"fb:thrift_iq",smax_id:d("WAWap").INT(118)}),a);return a}g.makeRequestSilentNonceRequest=a}),98); __d("WASmaxBizAccessTokenRequestSilentNonceRPC",["WAComms","WASmaxInBizAccessTokenRequestSilentNonceResponseError","WASmaxInBizAccessTokenRequestSilentNonceResponseRecoveryRequired","WASmaxInBizAccessTokenRequestSilentNonceResponseSuccess","WASmaxOutBizAccessTokenRequestSilentNonceRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBizAccessTokenRequestSilentNonceRequest").makeRequestSilentNonceRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBizAccessTokenRequestSilentNonceResponseSuccess").parseRequestSilentNonceResponseSuccess(b,a);if(c.success)return{name:"RequestSilentNonceResponseSuccess",value:c.value};var e=d("WASmaxInBizAccessTokenRequestSilentNonceResponseRecoveryRequired").parseRequestSilentNonceResponseRecoveryRequired(b,a);if(e.success)return{name:"RequestSilentNonceResponseRecoveryRequired",value:e.value};b=d("WASmaxInBizAccessTokenRequestSilentNonceResponseError").parseRequestSilentNonceResponseError(b,a);if(b.success)return{name:"RequestSilentNonceResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("RequestSilentNonce",{Success:c,RecoveryRequired:e,Error:b}))});return h.apply(this,arguments)}g.sendRequestSilentNonceRPC=a}),98); __d("WAWebCTWABizAccessTokenNonceManager",["WACustomError","WALogger","WAPromiseRetryLoop","WAPromiseTimeout","WAQplTypes","WAResolvable","WASmaxBizAccessTokenRequestSilentNonceRPC","WAWebBizGatingUtils","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Received a biz token nonce without asking for it"]);h=function(){return a};return a}var i=250,j=1e3,k=null;function a(a){if(k!=null&&a!==!0)return k.promise;var b=d("WAWebBizGatingUtils").adAccountTokenNoncePushWaitTimeoutSeconds(),c=d("WAWebBizGatingUtils").adAccountTokenNonceMaxRetries();d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE);d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,{"int":{fetch_nonce_timeout:b,fetch_nonce_max_retries:c}});var e=c;a=function(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,{"int":{fetch_nonce_retry:c-e}});return d("WAPromiseTimeout").promiseTimeout(l(),b*1e3).then(function(b){a(b)})["catch"](function(a){var b=e>0;e--;if(!b){a instanceof d("WACustomError").TimeoutError&&(d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.ABORTED),k=null);throw a}})};a=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"fetchAdAccountNonce",timer:{algo:{type:"exponential",first:i},max:j},code:a});a.start();return a.promise()}function l(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"request_nonce_start");var a=k=new(d("WAResolvable").Resolvable)();return d("WASmaxBizAccessTokenRequestSilentNonceRPC").sendRequestSilentNonceRPC({}).then(function(b){switch(b.name){case"RequestSilentNonceResponseError":d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"request_nonce_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.FAIL);k=null;return{type:"error"};case"RequestSilentNonceResponseRecoveryRequired":d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,{bool:{fetch_nonce_recovery_needed:!0}});d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"request_nonce_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.FAIL);k=null;return{type:"recovery-required",emailMask:b.value.resultEmail};default:b.name;d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"request_nonce_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"push_nonce_start");return a.promise}})["catch"](function(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"request_nonce_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.FAIL);k=null;throw a})}function b(a){k==null?(d("WALogger").WARN(h()),k=null,d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"push_nonce_end"),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.DROPPED)):(k.resolve({type:"success",nonce:a}),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,"push_nonce_end"),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_NONCE,d("WAQplTypes").QuickLogActionType.SUCCESS))}function c(a){k==null&&(k=new(d("WAResolvable").Resolvable)()),k.resolve({type:"success",nonce:m(a)})}function e(){k=null}function m(a){return a}function f(){return d("WAWebBizGatingUtils").adAccountTokenNoncePushWaitTimeoutSeconds()*(d("WAWebBizGatingUtils").adAccountTokenNonceMaxRetries()+1)}g.fetchNonce=a;g.setNonceFromPushNotification=b;g.setNonceFromRecoveryCode=c;g.markNonceAsUsed=e;g.castToNonce=m;g.getMaximumNonceFetchTimeoutSeconds=f}),98); __d("WAWebCommonAdsTypes",["$InternalEnum"],(function(a,b,c,d,e,f){e=b("$InternalEnum").Mirrored(["ACTIVE","AUTHENTICATION_NEEDED","CREATING","EXTENDABLE","FINISHED","LIMITED_DELIVERY","NOT_DELIVERING","PAUSED","PENDING","REJECTED","REVIEW_NEEDED","SCHEDULED","ERROR","UNKNOWN"]);function a(a){return a}function c(a){return a}function d(a){return a}f.BoostingStatusEnum=e;f.asAdId=a;f.asAdCampaignGroupId=c;f.asAdAccountToken=d}),66); __d("WAWebFailureErrorCodes",[],(function(a,b,c,d,e,f){a={REASON_GENERIC_FAILURE:400,REASON_NOT_AUTHORIZED:401,REASON_TEMP_BANNED:402,REASON_LOCKED:403,REASON_CLIENT_TOO_OLD:405,REASON_BANNED:406,REASON_BAD_USER_AGENT:409,REASON_INTERNAL_SERVER_ERROR:500,REASON_EXPERIMENTAL:501,REASON_SERVICE_UNAVAILABLE:503};f.FAILURE_REASON=a}),66); __d("WAWebCommonAdEntryPointsTypes",[],(function(a,b,c,d,e,f){function a(a){return a}f.asAdEntryPointContent=a}),66); __d("WAWebPonyfillsCryptoRandomUUID",[],(function(a,b,c,d,e,f){function a(){return"randomUUID"in self.crypto?self.crypto.randomUUID():([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(a){return(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)})}f["default"]=a}),66); __d("WAWebUserPrefsCTWA",["WATimeUtils","WAWebBizGatingUtils","WAWebCommonAdEntryPointsTypes","WAWebCommonAdsTypes","WAWebPonyfillsCryptoRandomUUID","WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function h(){var a=c("WAWebPonyfillsCryptoRandomUUID")();c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.AD_CREATION_FLOW_ID_KEY,a);return a}function a(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.AD_CREATION_FLOW_ID_KEY);(a==null||typeof a!=="string")&&(a=h());return a}function b(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.AD_CREATION_SEQUENCE_NUMBER_KEY);(a==null||typeof a!=="number")&&(a=1);c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.AD_CREATION_SEQUENCE_NUMBER_KEY,a+1);return a}function e(){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.AD_CREATION_SEQUENCE_NUMBER_KEY,1)}function f(a){var b=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.AD_ENTRY_POINTS_CONFIGURATION);if(b==null||typeof b!=="object")return null;var e=b.configuration,f=b.ts;b=b.locale;if(typeof f!=="number"||typeof b!=="string")return null;f=!d("WATimeUtils").isInFuture(d("WATimeUtils").futureUnixTime(d("WAWebBizGatingUtils").adEntryPointsConfigurationFetchThreshold()/1e3,d("WATimeUtils").castToUnixTime(f)));if(b!==a)return null;if(e==null||typeof e!=="object")return null;b=Object.keys(e).reduce(function(a,b){var c=e[b];if(c==null||typeof c!=="object")return a;var f=c.shouldShow,g=c.content;c=c.subContent;if(typeof f!=="boolean")return a;f={shouldShow:f};if(g!=null){if(typeof g!=="string")return a;f.content=d("WAWebCommonAdEntryPointsTypes").asAdEntryPointContent(g)}if(c!=null){if(typeof c!=="string")return a;f.subContent=d("WAWebCommonAdEntryPointsTypes").asAdEntryPointContent(c)}a[b]=f;return a},{});return{configuration:b,isExpired:f}}function i(a,b){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.AD_ENTRY_POINTS_CONFIGURATION,{configuration:b,ts:d("WATimeUtils").unixTime(),locale:a})}function j(){if(!d("WAWebBizGatingUtils").adAccountTokenStoringEnabled())return null;var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.AD_ACCOUNT_TOKEN);return a==null||typeof a!=="string"?null:d("WAWebCommonAdsTypes").asAdAccountToken(a)}function k(a){if(!d("WAWebBizGatingUtils").adAccountTokenStoringEnabled())return;c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.AD_ACCOUNT_TOKEN,a)}function l(){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.AD_ACCOUNT_TOKEN,null)}g.generateAdCreationFlowId=h;g.getAdCreationFlowId=a;g.getAndIncrementAdCreationSequenceNumber=b;g.resetAdCreationSequenceNumber=e;g.getAdEntryPointsConfiguration=f;g.setAdEntryPointsConfiguration=i;g.getAdAccountToken=j;g.setAdAccountToken=k;g.clearAdAccountToken=l}),98); __d("WAWebFetchAdAccountToken",["WAQplTypes","WAResolvable","WASmaxBizCtwaAdAccountGetAccessTokenAndSessionCookiesRPC","WAWebCTWABizAccessTokenNonceManager","WAWebCommonAdsTypes","WAWebFailureErrorCodes","WAWebGraphQLServerError","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsCTWA"],(function(a,b,c,d,e,f,g){var h=null,i=1;function a(a){if(h!=null){if(a!==!0)return h.promise;h=null}h;var b=h=new(d("WAResolvable").Resolvable)(),c=d("WAWebUserPrefsCTWA").getAdAccountToken();if(c!=null&&a!==!0){b.resolve({type:"success",token:c});return b.promise}d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_TOKEN);d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_TOKEN,"request_token_start");void j(i).then(function(a){a.type==="success"?d("WAWebUserPrefsCTWA").setAdAccountToken(a.token):(a.type,h=null),b.resolve(a)})["catch"](function(a){h=null,b.reject(a)});return b.promise}function b(){h=null,d("WAWebUserPrefsCTWA").clearAdAccountToken()}function c(a){if(a instanceof d("WAWebGraphQLServerError").GraphQLServerError){a=a.source.errors.some(function(a){return d("WAWebGraphQLServerError").GraphQLErrorCode.cast(a.code)===d("WAWebGraphQLServerError").GraphQLErrorCode.INVALID_ACCESS_TOKEN||a.code===d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_GENERIC_FAILURE});return a}return!1}function j(a){return d("WAWebCTWABizAccessTokenNonceManager").fetchNonce().then(function(b){switch(b.type){case"error":case"recovery-required":return b;default:b.type;return k(b.nonce).then(function(b){return b.type==="incorrect-nonce"&&a>0?j(a-1).then(function(a){if(a.type==="success")return a;a.type;return b}):b})}})}function k(a){d("WAWebCTWABizAccessTokenNonceManager").markNonceAsUsed();return d("WASmaxBizCtwaAdAccountGetAccessTokenAndSessionCookiesRPC").sendGetAccessTokenAndSessionCookiesRPC({codeElementValue:a}).then(function(a){switch(a.name){case"GetAccessTokenAndSessionCookiesResponseTooManyAttempts":n();return{type:"too-many-attempts"};case"GetAccessTokenAndSessionCookiesResponseIncorrectNonce":n();return{type:"incorrect-nonce"};case"GetAccessTokenAndSessionCookiesResponseError":n();return{type:"error"};default:a.name;m();return{type:"success",token:d("WAWebCommonAdsTypes").asAdAccountToken(a.value.accessTokenElementValue)}}})["catch"](function(a){n();throw a})}function l(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_TOKEN,"request_token_end"),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_TOKEN,a)}function m(){l(d("WAQplTypes").QuickLogActionType.SUCCESS)}function n(){l(d("WAQplTypes").QuickLogActionType.FAIL)}function e(){return d("WAWebCTWABizAccessTokenNonceManager").getMaximumNonceFetchTimeoutSeconds()*(i+1)}g.FETCH_AD_ACCOUNT_TOKEN_MAX_RETRIES=i;g.fetchToken=a;g.markTokenAsInvalid=b;g.hasGraphQLAuthError=c;g.getMaximumAdAccountFetchTimeoutSeconds=e}),98); __d("WAWebBizCatalogManagementFetchProductList",["Promise","WALogger","WAWebBizCatalogManagementFetchProductListQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchProductListWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchProductList: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchProductList: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementFetchProductListQuery.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForGetProductListEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").fetchQuery(n,{request:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_product_list)==null?void 0:(a=a.product_list)==null?void 0:a.products;if(a==null)return m;a=a.map(function(a){return e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a)}).map(d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL);return{type:"success",productsResult:a}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.fetchProductList=a}),98); __d("WAWebBizCatalogManagementParseProductGraphql_product.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebBizCatalogManagementParseProductGraphql_product"};e.exports=a}),null); __d("WAWebBizCatalogManagementParseProductGraphql",["WAWebBizCatalogManagementParseProductGraphql_product.graphql","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebProductTypes.flow","WAWebSyntheticCountryCode","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;f=h!==void 0?h:h=b("WAWebBizCatalogManagementParseProductGraphql_product.graphql");function a(a){var b;return d("WAWebBizParseProductGraphql").parseProductGraphQL({id:a.id,name:a.name,description:a.description,url:a.url,shimmed_url:a.shimmed_url,price:a.price,currency:a.currency,retailer_id:a.retailer_id,belongs_to:a.belongs_to,status_info:{can_appeal:(b=a.status_info)==null?void 0:b.can_appeal,status:(b=a.status_info)==null?void 0:b.status},product_availability:a.availability,max_available:a.max_available,sale_price:{start_date:(b=a.sale_price)==null?void 0:b.start_date,end_date:(b=a.sale_price)==null?void 0:b.end_date,price:(b=a.sale_price)==null?void 0:b.price},media:{images:(b=(b=a.media)==null?void 0:b.images.map(function(a){return{id:a.id,original_image_url:a.original_image_url,request_image_url:a.request_image_url}}))!=null?b:[],videos:((b=(b=a.media)==null?void 0:b.videos)!=null?b:[]).map(function(a){return{id:a.id,original_video_url:a.original_video_url,thumbnail_url:a.thumbnail_url}})},compliance_info:a.compliance_info!=null?{country_code_origin:a.compliance_info.country_code_origin,importer_name:a.compliance_info.importer_name,importer_address:a.compliance_info.importer_address!=null?{street1:a.compliance_info.importer_address.street1,street2:a.compliance_info.importer_address.street2,postal_code:a.compliance_info.importer_address.postal_code,city:a.compliance_info.importer_address.city,region:a.compliance_info.importer_address.region,country_code:a.compliance_info.importer_address.country_code}:null}:null,compliance_category:d("WAWebProductTypes.flow").mapComplianceCategoryToWASchema(a.compliance_category),is_hidden:d("WAWebProductTypes.flow").mapIsHiddenToWASchema(a.is_hidden),is_sanctioned:a.is_sanctioned,variant_info:a.variant_info})}function e(a){if(a.imageCdnUrl==null)throw c("err")("productModelToGraphQLInput: imageCdnUrl is null");var b=[{url:a.imageCdnUrl}];a.additionalImageCdnUrl!=null&&b.push.apply(b,a.additionalImageCdnUrl.map(function(a){return{url:a}}));b={name:a.name,media:{image:b},is_hidden:a.isHidden};c("isStringNullOrEmpty")(a.description)||(b.description=a.description);c("isStringNullOrEmpty")(a.url)||(b.url=a.url);c("isStringNullOrEmpty")(a.retailerId)||(b.retailer_id=a.retailerId);a.priceAmount1000!=null&&(b.currency=a.currency,b.price=a.priceAmount1000.toString());a.salePriceAmount1000!=null&&(b.sale_price=a.salePriceAmount1000.toString());a.videos!=null&&(b.media.video=a.videos.map(function(a){return{url:a.original_video_url}}));var e=a.complianceInfo&&i(a.complianceInfo);e!=null&&(b.compliance_info=e);(((e=a.complianceInfo)==null?void 0:e.countryCodeOrigin)===d("WAWebSyntheticCountryCode").SyntheticCountryCode.NotApplicable||a.importerInformationExempt&&d("WAWebBizGatingUtils").isCountryOfOriginEnabled())&&(b.compliance_category=d("WAWebProductTypes.flow").ProductComplianceCategory.CountryOriginExempt);return b}function i(a){var b=d("WAWebBizCatalogParseProduct").scanComplianceInfoForMissingData(a),e=b.isExempt,f=b.hasCountryCodeOrigin,g=b.hasImporterName;b=b.hasImporterAddress;if(e||!(f&&g&&b))return;e={country_code_origin:f&&a.countryCodeOrigin!=null?a.countryCodeOrigin:""};g&&(e.importer_name=a.importerName);if(b){f={country_code:(g=(f=a.importerAddress)==null?void 0:f.countryCode)!=null?g:"",city:(f=(b=a.importerAddress)==null?void 0:b.city)!=null?f:"",street1:(b=(g=a.importerAddress)==null?void 0:g.street1)!=null?b:""};c("isStringNullOrEmpty")((g=a.importerAddress)==null?void 0:g.street2)||(f.street2=a.importerAddress.street2);c("isStringNullOrEmpty")((b=a.importerAddress)==null?void 0:b.region)||(f.region=a.importerAddress.region);c("isStringNullOrEmpty")((g=a.importerAddress)==null?void 0:g.postalCode)||(f.postal_code=a.importerAddress.postalCode)}return e}g.PARSE_PRODUCT_FRAGMENT=f;g.parseProductGraphQL=a;g.productModelToGraphQLInput=e}),98); __d("WAWebParseProtocolEphemeralSettingMessageProto",["WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.protocolMessage;if(b==null)return;if(b.type!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SETTING)return;var c;b.disappearingMode!=null&&(c=d("WAWebE2EProtoUtils").protoToDisappearingMode(a,b.disappearingMode));a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"ephemeral_setting",ephemeralDuration:b.ephemeralExpiration,disappearingModeTrigger:(a=c)==null?void 0:a.disappearingModeTrigger,disappearingModeInitiatedByMe:(b=c)==null?void 0:b.initiatedByMe});return{msgData:a,contextInfo:void 0}}g["default"]=a}),98); __d("WAWebGenerateAudioOrPttReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebGeneratePtvReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebPtvParsePtvMessageProto",["WALongInt","WATimeUtils","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMsgType","WAWebPtvGatingUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.ptvMessage;if(b==null)return;if(!d("WAWebPtvGatingUtils").isPtvReceivingEnabled())return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.PTV}),contextInfo:b==null?void 0:b.contextInfo};var c=b.url,e=b.directPath,f=b.staticUrl,g=b.mimetype,h=b.caption,i=b.fileSha256,j=b.fileEncSha256,k=b.fileLength,l=b.height,m=b.width,n=b.mediaKey,o=b.mediaKeyTimestamp,p=b.jpegThumbnail,q=b.annotations,r=b.viewOnce,s=b.thumbnailDirectPath,t=b.thumbnailSha256,u=b.thumbnailEncSha256,v=b.contextInfo,w=b.gifPlayback,x=b.gifAttribution,y=b.accessibilityLabel,z=b.seconds,A=b.streamingSidecar;a=babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.PTV,kind:d("WAWebMsgType").MsgKind.Ptv,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(c),directPath:e,staticUrl:f||"",mimetype:g,caption:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(h),filehash:d("WAWebE2EProtoParserApi").decodeBytes(i),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(j),size:d("WALongInt").numberOrThrowIfTooLarge(k||0),height:l,width:m,mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(n),mediaKeyTimestamp:o!=null?d("WALongInt").numberOrThrowIfTooLarge(o):d("WATimeUtils").unixTime(),duration:""+(z||0),body:d("WAWebE2EProtoParserApi").decodeBytes(p)||"",interactiveAnnotations:q,isViewOnce:r===!0,thumbnailDirectPath:s,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(t),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(u),isGif:w,gifAttribution:x,accessibilityLabel:y,streamingSidecar:A});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(a,b);return{msgData:a,contextInfo:v}}g["default"]=a}),98); __d("WAWebQuickPromotionActionMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9741612265875562"}),null); __d("WAWebQuickPromotionActionMutation.graphql",["WAWebQuickPromotionActionMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"WaQuickPromotionLogEventResponsePayload",kind:"LinkedField",name:"wa_quick_promotion_log_event",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQuickPromotionActionMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQuickPromotionActionMutation",selections:c},params:{id:b("WAWebQuickPromotionActionMutation_facebookRelayOperation"),metadata:{},name:"WAWebQuickPromotionActionMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebQuickPromotionActionMutation",["Promise","WACustomError","WALogger","WAPromiseTimeout","WAWebBizGatingUtils","WAWebCTWAConstants","WAWebFetchAdAccountToken","WAWebOrchestratorNonPersistedJob","WAWebQuickPromotionActionMutation.graphql","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(['executeQuickPromotionActionMutation: failed as "timeout"']);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['executeQuickPromotionActionMutation: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["executeQuickPromotionActionMutation: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebQuickPromotionActionMutation.graphql");function a(a){if(!d("WAWebBizGatingUtils").qpGraphQLEnabled())return(i||(i=b("Promise"))).resolve({type:"not-enabled"});var c=d("WAWebCTWAConstants").KNOWN_QP_SURFACES.get(a.surface_nux_id);return c==null||!d("WAWebBizGatingUtils").qpSurfaceIdsUsingGraphQL().has(c)?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("quickPromotionActionMutation",function(){return o(a)}).waitUntilCompleted()}function o(a){return d("WAPromiseTimeout").promiseTimeout(p(a),d("WAWebCTWAConstants").QP_ACTION_MUTATION_TIMEOUT_MS).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").WARN(k(),a.type);return a})["catch"](function(a){if(a instanceof d("WACustomError").TimeoutError){d("WALogger").WARN(j());return{type:"timeout"}}throw a})}function p(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return q(a,b.token).then(function(a){a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type;return a});b.type;return b})}function q(a,b){return d("WAWebRelayClient").commitMutation(n,{input:a},{environmentType:"facebook",accessToken:b}).then(function(a){if(a==null)return m;return a.wa_quick_promotion_log_event==null?m:{type:"success"}})["catch"](function(a){return d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a)?{type:"auth-failure"}:m})}g.executeQuickPromotionActionMutation=a}),98); __d("WAWebReactAddonMessageProcessorUtils",["WANullthrows","WAWebAddonDBTable","WAWebCastToReactionMsg","WAWebMsgGetters","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){return[a.reactionParentKey,c("WANullthrows")(d("WAWebMsgGetters").getSender(a))]}function i(a){return h(a).map(function(a){return a.toString()}).join("-")}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();a=a.map(h);a=(yield d("WAWebAddonDBTable").addonDBTable.bulkGetByParentAndSender(d("WAWebMsgType").MSG_TYPE.REACTION,a));for(a of a){var c=d("WAWebCastToReactionMsg").assertReactionMsgData(a),e=i(c);b.set(e,c.reactionTimestamp)}return function(a){a=i(a);return b.get(a)}});return j.apply(this,arguments)}g.createGetReactionTimestamp=a}),98); __d("WAWebReactionAddonMessageProcessor",["Promise","WALogger","WAWebAddonConstants","WAWebAddonCreateMsgProcessor","WAWebBackendApi","WAWebDBMarkFutureproofMessagesReparsed","WAWebLastAddOnDBSerialization","WAWebMsgType","WAWebReactAddonMessageProcessorUtils","WAWebReactionDataUtils","WAWebReactionEncryptMsgData","WAWebReactionGatingUtils","WAWebReactionsEncryption","WAWebReactionsParseWebMsgInfoReaction","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed decrypted enc reactions"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cannot decrypt reaction: ",""]);j=function(){return a};return a}function k(a){return!new Set([d("WAWebAddonConstants").AddonProcessMode.HistorySync,d("WAWebAddonConstants").AddonProcessMode.Hydration]).has(a)}a=d("WAWebAddonCreateMsgProcessor").createAddonMsgProcessorDualEncrypted({isEnabled:function(){return!0},convert:{fromHistorySyncMsg:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebReactionsParseWebMsgInfoReaction").parseWebMsgInfoReaction(a.webMsgInfo,a.parsedWebMsgInfo).map(function(a){return d("WAWebReactionDataUtils").reactionRowToReactionMsgData(d("WAWebReactionDataUtils").webMsgInfoReactionTypeToReactionsRow(a))})});function c(b){return a.apply(this,arguments)}return c}(),toDualEncryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.ReactionEncrypted?a:d("WAWebReactionEncryptMsgData").encryptReactionMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}(),toDualDecryptedMsgData:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return a.kind===d("WAWebMsgType").MsgKind.ReactionDecrypted?a:d("WAWebReactionsEncryption").decryptReactionMsgData(a,b)});function c(b,c){return a.apply(this,arguments)}return c}()},updateCollection:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebReactionGatingUtils").isFlattenedReactionsEnabled()&&b===d("WAWebAddonConstants").AddonProcessMode.Hydration){yield d("WAWebBackendApi").frontendSendAndReceive("reactionUIUpdate",a);return}yield d("WAWebBackendApi").frontendSendAndReceive("updateReactionCollection",{msgs:a.add,removeReactions:a.remove,allowNotifications:k(b)})});function c(b,c){return a.apply(this,arguments)}return c}(),beforeUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=c.parents,f=[];c=[];for(a of a)a.kind===d("WAWebMsgType").MsgKind.ReactionEncrypted?c.push(a):a.kind===d("WAWebMsgType").MsgKind.ReactionDecrypted&&f.push(a);yield (h||(h=b("Promise"))).allSettled(c.map(function(a){return d("WAWebReactionsEncryption").decryptReactionMsgData(a,e.getForAddon(a))})).then(function(a){for(var b of a)b.status==="fulfilled"&&b.value!=null?f.push(b.value):d("WALogger").LOG(j(),b.reason);a.some(function(a){return a.status==="rejected"})&&d("WALogger").WARN(i()).tags("messaging","addons").sendLogs("decrypt-enc-reaction-failed",{sampling:.01})});var g=(yield d("WAWebReactAddonMessageProcessorUtils").createGetReactionTimestamp(f));a=f.filter(function(a){var b=g(a);return b==null||b<a.reactionTimestamp});return a});function c(b,c){return a.apply(this,arguments)}return c}(),afterUpsert:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.processMode;yield d("WAWebShouldUpdateLastAddOnPreview").filterAndUpdateChatPreviews(a.map(function(a){return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromReactionRowType(d("WAWebReactionDataUtils").reactionMsgDataToReactionRow(a))}));b===d("WAWebAddonConstants").AddonProcessMode.OnlineReceive&&(yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a.map(function(a){return a.id.toString()})))});function c(b,c){return a.apply(this,arguments)}return c}(),manageNotifications:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.processMode;if(!k(b)||!d("WAWebReactionGatingUtils").isReactionNotificationAddOnApiEnabled())return;d("WAWebBackendApi").frontendFireAndForget("handleReactionNotification",{reactions:a.add})});function c(b,c){return a.apply(this,arguments)}return c}()});c=a;g["default"]=c}),98); __d("WAWebReactionEncryptMsgData",["WANullthrows","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebBackendApi","WAWebMsgGetters","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield d("WAWebBackendApi").frontendSendAndReceive("getGroupMetadata",{groupWid:a.id.remote}));if(e==null?void 0:e.isCag){var f;e=self.crypto.getRandomValues(new Uint8Array(12));var g={type:(f=d("WAWebMsgType")).MsgKind.ReactionDecrypted,encode:{text:a.reactionText,senderTimestampMs:a.reactionTimestamp}},h=d("WAWebAddonEncryptionError").getValidatedMessageSecret(f.MsgKind.ReactionDecrypted,b);g=(yield d("WAWebAddonEncryption").encryptAddOn(g,{messageSecret:h,iv:e,stanzaId:b.id.id,originalMessageSender:c("WANullthrows")(d("WAWebMsgGetters").getOriginalSender(b)),addOnSender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)))}));h=g.encPayload;return babelHelpers["extends"]({},d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(a),{type:f.MSG_TYPE.REACTION_ENC,kind:f.MsgKind.ReactionEncrypted,targetMessageKey:b.id,encPayload:h,encIv:e.buffer})}return a});return h.apply(this,arguments)}g.encryptReactionMsgData=a}),98); __d("WAWebReactionEncMessageValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({INVALID_ENC_IV:"enc_reaction_invalid_iv",INVALID_ENC_PAYLOAD:"enc_reaction_invalid_payload",MISSING_TARGET_MSG_KEY:"enc_reaction_missing_target_msg_key",MISSING_MESSAGE_SECRET:"enc_reaction_missing_message_secret",MISSING_SENDER:"enc_reaction_missing_sender",MISSING_PARENT_MESSAGE:"enc_reaction_missing_parent_message",MISSING_PARENT_MESSAGE_SENDER:"enc_reaction_missing_parent_message_sender",DECRYPTION_FAILED:"enc_reaction_decryption_failed"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="ReactionEncMessageValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.ReactionEncValidationErrorCode=a;g.ReactionEncMessageValidationError=c}),98); __d("WAWebReactionsValidationError",["$InternalEnum","WAWebHandleMsgError"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({INVALID_REACTION_TEXT_LENGTH:"reaction_invalid_text_length",MISSING_PARENT_MSG_KEY:"reaction_missing_parent_msg_key",MISSING_TIMESTAMP:"reaction_missing_timestamp"});c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="ReactionValidationError",b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebHandleMsgError").MessageValidationError);g.ReactionValidationErrorCode=a;g.ReactionValidationError=c}),98); __d("WAWebReactionsEncryption",["WALongInt","WANullthrows","WAWebAddonEncryption","WAWebAddonEncryptionError","WAWebE2EProtoUtils","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebReactionEncMessageValidationError","WAWebReactionsBEUtils","WAWebReactionsValidationError","WAWebWamEnumE2eFailureReason","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={type:d("WAWebMsgType").MsgKind.ReactionEncrypted,encryptedAddOn:a.encryptedReaction};b=(yield d("WAWebAddonEncryption").decryptAddOn(b,{messageSecret:a.messageSecret,iv:a.iv,stanzaId:a.stanzaId,originalMessageSender:a.originalMessageSender,addOnSender:a.reactionSender}));return d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsE2E.pb").Message$ReactionMessageSpec,b)});return i.apply(this,arguments)}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.targetMessageKey,f=a.encIv,g=a.encPayload,i=d("WAWebAddonEncryptionError").getValidatedMessageSecret(d("WAWebMsgType").MsgKind.ReactionEncrypted,b),j=d("WAWebMsgGetters").getOriginalSender(b);if(j==null)throw new(d("WAWebReactionEncMessageValidationError").ReactionEncMessageValidationError)(d("WAWebReactionEncMessageValidationError").ReactionEncValidationErrorCode.MISSING_PARENT_MESSAGE_SENDER,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);g={encryptedReaction:g,messageSecret:i,iv:f,stanzaId:b.id.id,originalMessageSender:j,reactionSender:d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)))};var k;try{k=(yield h(g))}catch(a){throw new(d("WAWebReactionEncMessageValidationError").ReactionEncMessageValidationError)(d("WAWebReactionEncMessageValidationError").ReactionEncValidationErrorCode.DECRYPTION_FAILED,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE)}f=(i=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(k.text))!=null?i:d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT;b=k.senderTimestampMs;if(b==null)throw new(d("WAWebReactionsValidationError").ReactionValidationError)(d("WAWebReactionsValidationError").ReactionValidationErrorCode.MISSING_TIMESTAMP,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.REACTION,kind:d("WAWebMsgType").MsgKind.ReactionDecrypted,reactionParentKey:e,reactionText:f,reactionTimestamp:d("WALongInt").numberOrThrowIfTooLarge(b),encPayload:void 0,encIv:void 0,read:!1})});return j.apply(this,arguments)}g.parseEncReaction=h;g.decryptReactionMsgData=a}),98); __d("WABitArray",["err"],(function(a,b,c,d,e,f,g){"use strict";var h=8;a=function(){function a(a){if(a<=0)throw c("err")("BitArray:numBits should be positive");this.$1=a;this.$2=new Uint8Array(Math.ceil(this.$1/h))}var b=a.prototype;b.get=function(a){a=this.$3(a);var b=a[0];a=a[1];return Boolean(this.$2[b]>>a&1)};b.set=function(a){a=this.$3(a);var b=a[0];a=a[1];this.$2[b]|=1<<a};b.unset=function(a){a=this.$3(a);var b=a[0];a=a[1];this.$2[b]&=~(1<<a)};b.toggle=function(a){a=this.$3(a);var b=a[0];a=a[1];this.$2[b]^=1<<a};b.clear=function(){this.$2=new Uint8Array(Math.ceil(this.$1/h))};b.toArray=function(){var a=[];for(var b=0;b<this.$1;b++)a.push(this.get(b));return a};b.toString=function(){return this.toArray().map(function(a){return a?"1":"0"}).join("")};b.toNumber=function(){return parseInt(this.toString(),2)};b.$3=function(a){if(a<0||a>=this.$1)throw c("err")("BitArray:index out of bounds");var b=Math.floor(a/h);a=a-b*h;return[b,a]};return a}();g["default"]=a}),98); __d("WAOnceWithReset",[],(function(a,b,c,d,e,f){"use strict";var g={};function a(a){var b=g,c=function(){if(b===g){for(var c=arguments.length,d=new Array(c),e=0;e<c;e++)d[e]=arguments[e];b=a.call.apply(a,[this].concat(d))}return b};c.reset=function(){b=g};return c}f["default"]=a}),66); __d("WAWebAnimatedEmojiGatingUtils",["WAWebABProps","gkx"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("animated_emojis_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("remove_single_emoji_bubble_background_enabled")}function e(){return d("WAWebABProps").getABPropConfigValue("animated_emoji_set_1_enabled")}function f(){return!c("gkx")("26258")&&d("WAWebABProps").getABPropConfigValue("animated_emoji_final_set_enabled")}function h(){return d("WAWebABProps").getABPropConfigValue("animated_race_mercedes_car_emoji_enabled")}g.isAnimatedEmojiEnabled=a;g.isStaticSingleEmojiUIEnabled=b;g.isAnimatedEmojiSet1Enabled=e;g.isAnimatedEmojiFinalSetEnabled=f;g.isAnimatedEmojiMercedesRacingEnabled=h}),98); __d("WAWebEmojiConst",["$InternalEnum","WAWebAnimatedEmojiGatingUtils","WAWebMobilePlatforms"],(function(a,b,c,d,e,f,g){c=25;e={SMILEYS_PEOPLE:"SMILEYS_PEOPLE",ANIMALS_NATURE:"ANIMALS_NATURE",FOOD_DRINK:"FOOD_DRINK",ACTIVITY:"ACTIVITY",TRAVEL_PLACES:"TRAVEL_PLACES",OBJECTS:"OBJECTS",SYMBOLS:"SYMBOLS",FLAGS:"FLAGS"};f=["SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","ACTIVITY","TRAVEL_PLACES","OBJECTS","SYMBOLS","FLAGS"];var h={APPLE:"APPLE",WHATSAPP:"WHATSAPP"},i={small:20,large:32};b=b("$InternalEnum").Mirrored(["MEDIUM","LARGE","XLARGE","XLARGE_60"]);var j=[].concat(f,["VARIATION"]),k=["\u2764","\u2665",String.fromCodePoint(129294),String.fromCodePoint(128150),String.fromCodePoint(128420),String.fromCodePoint(128154),String.fromCodePoint(128156),String.fromCodePoint(128151),String.fromCodePoint(128147),String.fromCodePoint(128153),String.fromCodePoint(129293),String.fromCodePoint(128155),String.fromCodePoint(128149),String.fromCodePoint(129505),String.fromCodePoint(10084,65039,8205,128293),String.fromCodePoint(129653),String.fromCodePoint(129654),String.fromCodePoint(129655)],l=[String.fromCodePoint(128536),String.fromCodePoint(10084,65039),String.fromCodePoint(128175),String.fromCodePoint(128514),String.fromCodePoint(129315),String.fromCodePoint(128525),String.fromCodePoint(128522),String.fromCodePoint(128526),String.fromCodePoint(129321),String.fromCodePoint(128149),String.fromCodePoint(128521),String.fromCodePoint(10024)],m=[String.fromCodePoint(129671),String.fromCodePoint(128148),String.fromCodePoint(128079),String.fromCodePoint(128557),String.fromCodePoint(128545),String.fromCodePoint(129318,8205,9794,65039),String.fromCodePoint(128293),String.fromCodePoint(128591),String.fromCodePoint(128556),String.fromCodePoint(128517),String.fromCodePoint(129395),String.fromCodePoint(127881),String.fromCodePoint(128532),String.fromCodePoint(128588),String.fromCodePoint(128536),String.fromCodePoint(128546),String.fromCodePoint(129392),String.fromCodePoint(128536),String.fromCodePoint(128558),String.fromCodePoint(128077),String.fromCodePoint(128075),String.fromCodePoint(127922)],n=[String.fromCodePoint(127950),String.fromCodePoint(127950,65039)],o={AnimatedAsset1FA87:"v1_Maracas_1FA87",AnimatedAsset1F494:"v1_Broken_heart_1F494",AnimatedAsset1F44F:"v2_Clapping_hands_1F44F",AnimatedAsset1F62D:"v1_Cry_1F62D",AnimatedAsset1F621:"v1_Enraged_face_1F621",AnimatedAsset1F926:"v1_Face_palm_1F926",AnimatedAsset1F618:"v1_Faceblownbyakiss_1F618",AnimatedAsset1F525:"v2_Fire_1F525",AnimatedAsset1F64F:"v2_Folded_hands_1F64F",AnimatedAsset1F62C:"v1_Grimacing_face_1F62C",AnimatedAsset1F605:"v1_Grinning_face_with_sweat_1F605",AnimatedAsset2764FE0F:"v1_Heart_2764_FE0F",AnimatedAsset1F4AF:"v1_Hundred_points_1F4AF",AnimatedAsset1F602:"v1_LOL_1F602",AnimatedAsset1F973:"v1_Party_1F973",AnimatedAsset1F389:"v2_Party_popper_1F389",AnimatedAsset1F614:"v1_Pensive_face_1F614",AnimatedAsset1F64C:"v2_Raising_hands_1F64C",AnimatedAsset1F923:"v1_ROFL_1F923",AnimatedAsset1F622:"v1_Sad_tear_1F622",AnimatedAsset1F60D:"v1_Smiling_face_with_heart_eyes_1F60D",AnimatedAsset1F970:"v1_Smiling_face_with_hearts_1F970",AnimatedAsset1F60A:"v1_Smiling_face_with_smiling_eyes_1F60A",AnimatedAsset1F60E:"v1_Smiling_face_with_sunglasses_1F60E",AnimatedAsset1F929:"v1_Star_struck_1F929",AnimatedAsset1F62E:"v1_Surprised_1F62E",AnimatedAsset1F44D:"v1_Thumbs_up_1F44D",AnimatedAsset1F495:"v1_Two_hearts_1F495",AnimatedAsset1F44B:"v1_Waving_hand_1F44B",AnimatedAsset1F609:"v1_Winking_face_1F609",AnimatedAsset1F3B2:"v1_Dice_1_1F3B2",AnimatedAsset2728:"v1_Sparkles_2728",AnimatedAsset1F3CE:"v1_race_car_1F3CE"},p={AnimatedAsset1FA87:"v1_Maracas_1FA87",AnimatedAsset1F494:"v1_Broken_heart_1F494",AnimatedAsset1F44F:"v2_iOS_clapping_hands_1F44F",AnimatedAsset1F62D:"v1_Cry_1F62D",AnimatedAsset1F621:"v2_iOS_enraged_face_1F621",AnimatedAsset1F926:"v2_iOS_face_palm_man",AnimatedAsset1F618:"v1_Faceblownbyakiss_1F618",AnimatedAsset1F525:"v1_Fire_1F525",AnimatedAsset1F64F:"v2_iOS_folded_hands_1F64F",AnimatedAsset1F62C:"v1_Grimacing_face_1F62C",AnimatedAsset1F605:"v2_iOS_grinning_face_with_sweat_1F605",AnimatedAsset2764FE0F:"v1_Heart_2764_FE0F",AnimatedAsset1F4AF:"v1_Hundred_points_1F4AF",AnimatedAsset1F602:"v1_LOL_1F602",AnimatedAsset1F973:"v2_iOS_party",AnimatedAsset1F389:"v2_iOS_party_popper_1F389",AnimatedAsset1F614:"v1_Pensive_face_1F614",AnimatedAsset1F64C:"v2_Raising_hands_1F64C",AnimatedAsset1F923:"v2_iOS_rofl_1F923",AnimatedAsset1F622:"v2_iOS_sad_tear_1F622",AnimatedAsset1F60D:"v1_Smiling_face_with_heart_eyes_1F60D",AnimatedAsset1F970:"v2_Smiling_face_with_heart_eyes_1F60D",AnimatedAsset1F60A:"v1_Smiling_face_with_smiling_eyes_1F60A",AnimatedAsset1F60E:"v1_Smiling_face_with_sunglasses_1F60E",AnimatedAsset1F929:"v3_iOS_star_struck_1F929",AnimatedAsset1F62E:"v1_Surprised_1F62E",AnimatedAsset1F44D:"v1_Thumbs_up_1F44D",AnimatedAsset1F495:"v1_Two_hearts_1F495",AnimatedAsset1F44B:"v1_Waving_hand_1F44B",AnimatedAsset1F609:"v2_iOS_winking_face_1F609",AnimatedAsset1F3B2:"v1_Dice_1_1F3B2",AnimatedAsset2728:"v1_Sparkles_2728",AnimatedAsset1F3CE:"v1_race_car_1F3CE"};function q(a){a=[d("WAWebMobilePlatforms").PLATFORMS.IPAD,d("WAWebMobilePlatforms").PLATFORMS.IPHONE,d("WAWebMobilePlatforms").PLATFORMS.SMBI].includes(a)?p:o;return[[String.fromCodePoint(128536),""+a.AnimatedAsset1F618],[String.fromCodePoint(10084,65039),""+a.AnimatedAsset2764FE0F],[String.fromCodePoint(128175),""+a.AnimatedAsset1F4AF],[String.fromCodePoint(128514),""+a.AnimatedAsset1F602],[String.fromCodePoint(129315),""+a.AnimatedAsset1F923],[String.fromCodePoint(128525),""+a.AnimatedAsset1F60D],[String.fromCodePoint(128522),""+a.AnimatedAsset1F60A],[String.fromCodePoint(128526),""+a.AnimatedAsset1F60E],[String.fromCodePoint(129321),""+a.AnimatedAsset1F929],[String.fromCodePoint(128149),""+a.AnimatedAsset1F495],[String.fromCodePoint(128521),""+a.AnimatedAsset1F609],[String.fromCodePoint(127922),""+a.AnimatedAsset1F3B2],[String.fromCodePoint(129671),""+a.AnimatedAsset1FA87],[String.fromCodePoint(128148),""+a.AnimatedAsset1F494],[String.fromCodePoint(128079),""+a.AnimatedAsset1F44F],[String.fromCodePoint(128557),""+a.AnimatedAsset1F62D],[String.fromCodePoint(128545),""+a.AnimatedAsset1F621],[String.fromCodePoint(129318,8205,9794,65039),""+a.AnimatedAsset1F926],[String.fromCodePoint(128293),""+a.AnimatedAsset1F525],[String.fromCodePoint(128591),""+a.AnimatedAsset1F64F],[String.fromCodePoint(128556),""+a.AnimatedAsset1F62C],[String.fromCodePoint(128517),""+a.AnimatedAsset1F605],[String.fromCodePoint(129395),""+a.AnimatedAsset1F973],[String.fromCodePoint(127881),""+a.AnimatedAsset1F389],[String.fromCodePoint(128532),""+a.AnimatedAsset1F614],[String.fromCodePoint(128588),""+a.AnimatedAsset1F64C],[String.fromCodePoint(128546),""+a.AnimatedAsset1F622],[String.fromCodePoint(129392),""+a.AnimatedAsset1F970],[String.fromCodePoint(128558),""+a.AnimatedAsset1F62E],[String.fromCodePoint(128077),""+a.AnimatedAsset1F44D],[String.fromCodePoint(128075),""+a.AnimatedAsset1F44B],[String.fromCodePoint(10024),""+a.AnimatedAsset2728],[String.fromCodePoint(127950),""+a.AnimatedAsset1F3CE],[String.fromCodePoint(127950,65039),""+a.AnimatedAsset1F3CE]]}function r(){var a=[];d("WAWebAnimatedEmojiGatingUtils").isAnimatedEmojiSet1Enabled()&&(a=[].concat(a,l));d("WAWebAnimatedEmojiGatingUtils").isAnimatedEmojiFinalSetEnabled()&&(a=[].concat(a,m));d("WAWebAnimatedEmojiGatingUtils").isAnimatedEmojiMercedesRacingEnabled()&&(a=[].concat(a,n));return a}function a(a){var b=r();a=q(a);a=a.filter(function(a){a=a[0];return b.includes(a)});return a}g.BUCKET_SIZE=c;g.CATEGORIES=e;g.ORDERED_CATEGORY_IDS=f;g.EMOJI_TYPE=h;g.EMOJI_WIDTH=i;g.LargeEmojiSize=b;g.CATEGORY_ORDERING=j;g.HEART_EMOJIS=k;g.getSupportedAnimatedEmojis=r;g.getSupportedAnimatedEmojisAssetIdsMapping=a}),98); __d("WAWebGetEmojiPathExperimental",["gkx"],(function(a,b,c,d,e,f,g){d=""+window.location.origin;var h=c("gkx")("26258")?"https://web.whatsapp.com/emoji/v1":d+"/emoji/v1",i=16,j=0,k=1;function a(a,b,c){return l(a,c,b,"png")}function l(a,b,c,d){a=m(a);return n("single",c,b,a+"."+d)}function m(a){return Array.from(a).map(function(a){return a.codePointAt(0).toString(16).padStart(6,"0")}).join("_")}function b(a,b,c,d){return n("sprite",a,c,b+"."+d)}function n(a,b,c,d){return[h,i,j,k,a,b.toLowerCase().slice(0,1),c,d].join("/")}g.getGlyphExperimentalPath=a;g.getEmojiSpritesExperimentalPath=b}),98); __d("WAWebEmoji",["invariant","WABitArray","WANullthrows","WAOnceWithReset","WAWebABProps","WAWebEmojiCompile","WAWebEmojiConst","WAWebGetEmojiPathExperimental","lodash","objectEntries"],(function(a,b,c,d,e,f,g,h){var i="\u25a1",j="\u200d",k=["\ud83c\udffb","\ud83c\udffc","\ud83c\udffd","\ud83c\udffe","\ud83c\udfff"],l=new RegExp(k.join("|"),"g");b="\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1";var m="\ud83d\udc6d",n="\ud83d\udc6c",o="\ud83d\udc6b";e=String.fromCodePoint(128105,8205,10084,65039,8205,128139,8205,128104);f=String.fromCodePoint(128105,8205,10084,65039,8205,128139,8205,128105);var p=String.fromCodePoint(128104,8205,10084,65039,8205,128139,8205,128104),q=String.fromCodePoint(129489,8205,10084,65039,8205,128139,8205,129489),r=String.fromCodePoint(128143),s=String.fromCodePoint(128105,8205,10084,65039,8205,128104),t=String.fromCodePoint(128105,8205,10084,65039,8205,128105),u=String.fromCodePoint(128104,8205,10084,65039,8205,128104),v=String.fromCodePoint(129489,8205,10084,65039,8205,129489),w=String.fromCodePoint(128145),x=String.fromCodePoint(129309),y=new Set([b,m,n,o,e,f,p,r,s,t,u,w,x]),z=d("WAWebEmojiConst").HEART_EMOJIS.map(function(a){return a}),A=new Set(["\ufe00","\ufe01","\ufe02","\ufe03","\ufe04","\ufe05","\ufe06","\ufe07","\ufe08","\ufe09","\ufe0a","\ufe0b","\ufe0c","\ufe0d","\ufe0e","\ufe0f"]),B=[127950,65039].map(function(a){return String.fromCodePoint(a)}).join(""),C=[127950,8205,128960].map(function(a){return String.fromCodePoint(a)}).join(""),D=[127950,8205,128961].map(function(a){return String.fromCodePoint(a)}).join(""),E=function(a){return a.replace(/\uFE0F/g,"")},F=c("lodash").memoize(function(a,b){function c(d){d===void 0&&(d=[]);if(d.length===b)return[d];var e=[];for(var f=0;f<a.length;f++){var g=[].concat(d);g.push(a[f]);e=e.concat(c(g))}return e}return c()},function(a,b){return a.toString()+b}),G=function(){function a(){var a=this,b;this.skinToneVariations=k;this.emojiRegex=function(){var b=a._createEmojiRegexIfNeeded();b.lastIndex=0;return b};this._createEmojiRegexIfNeeded=(b=c("WAOnceWithReset"))(function(){var b=a._getEmojiRegexSource();return new RegExp("("+b+")","g")});this.onlyEmojiRegex=function(){var b=a._createOnlyEmojiRegexIfNeeded();b.lastIndex=0;return b};this._createOnlyEmojiRegexIfNeeded=b(function(){var b=a._getEmojiRegexSource();return new RegExp("^("+b+")+$","g")});this.splitEmojis=function(b){return a.containsOnlyEmoji(b)===!1?null:b.split(a.emojiRegex()).filter(Boolean)};this.extractAllEmojis=function(b){return a.containsEmoji(b)===!1?null:Array.from(b.matchAll(a.emojiRegex())).filter(Boolean).map(function(a){return a[1]})};this.containsEmoji=function(b){return a.emojiRegex().test(b)};this.containsOnlyEmoji=function(b){return a.onlyEmojiRegex().test(b)};this.matchLargeEmojiPattern=function(b){if(b==null)return;if(b.length>50||b.includes(" "))return null;var c=a._getLargeEmojisRegex();c=c.exec(b);return c?c.filter(Boolean).slice(1):null};this.normalizeEmojiFromString=function(b){return a.normalizeEmoji(b)};this.normalizeEmoji=function(b){b=E(b);var c=a._getDerivedMaps();c=c.unqualifiedToNormalizedEmoji;return c.get(b)};this.normalizeAllEmojis=c("lodash").memoize(function(b){return b?b.replace(a.emojiRegex(),function(b,c){return A.has(c)?"":(b=a.normalizeEmoji(c))!=null?b:i}):""});this.getSkinToneVariant=function(b,c){var d=a._getBaseToSkinToneEmojis();d=d.get(b);if(d==null)return null;b=H(c);return d.get(b)};this._getDerivedMaps=b(function(){var b=a._getConfig(),d=b.orderedEmojis;b=b.legacyToEmoji;var e=new Map(),f=new Map(),g=new Map(),h=0;d.forEach(function(a,b){if(a===""||a==null)return;a=Array.isArray(a)?a:[a];a.forEach(function(a){f.set(a,b);var c=E(a);g.set(c,a)});e.set(b,h);h++});c("objectEntries")(b).forEach(function(a){var b=a[0];a=a[1];f.set(b,a);a=E(b);g.set(a,b)});return{emojiToGlyphId:f,glyphIdToIndex:e,unqualifiedToNormalizedEmoji:g}});this._getBaseToSkinToneEmojis=b(function(){var b=a._getDerivedMaps();b=b.emojiToGlyphId;var c=new Map(),d=function(b){var d=void 0,e=b.replace(l,function(a){d==null&&(d=[]);d.push(a);return""});if(d==null)return"continue";var f=d,g;e==="\ud83d\udc69"+j+"\ud83e\udd1d"+j+"\ud83d\udc69"?g=m:e==="\ud83d\udc68"+j+"\ud83e\udd1d"+j+"\ud83d\udc68"?g=n:e==="\ud83d\udc69"+j+"\ud83e\udd1d"+j+"\ud83d\udc68"?g=o:e===v?g=w:e===q?g=r:e===String.fromCodePoint(129777,8205,129778)?g=x:g=e;e=a.normalizeEmoji(g);if(e==null)return"continue";g=c.get(e);g==null&&(g=new Map(),g.set("",e),c.set(e,g));e=H(f);g.set(e,b)};for(b of b.keys()){var e=d(b);if(e==="continue")continue}return c});this._getSkinToneEmojisToBase=b(function(){var b=new Map();for(var c of a._getBaseToSkinToneEmojis().entries()){var d=c[0],e=c[1];for(e of e.values())b.set(e,d)}return b});this._getEmojiRegexSource=b(function(){var b=a._getDerivedMaps();b=b.emojiToGlyphId;return c("WAWebEmojiCompile")([].concat(Array.from(b.keys()),Array.from(A)).filter(Boolean))});this._createLargeEmojisRegexIfNeeded=b(function(){var b=a._getEmojiRegexSource();return new RegExp("^("+b+")("+b+")?("+b+")?$")});this.getEmojisInCategory=function(b){return(b=a._getConfig().categorizedEmojis[b])!=null?b:[]};this._getEmojiToCategory=b(function(){var b=a._getConfig(),c=b.categorizedEmojis,e=new Map();Object.keys(c).forEach(function(b){var f=d("WAWebEmojiConst").CATEGORY_ORDERING.indexOf(b);c[b].forEach(function(b){b=a.normalizeEmoji(b);if(b==null)return;e.set(b,f)})});return e});this._applyGlyphTransformations=function(a){if(a===B)if(d("WAWebABProps").getABPropConfigValue("custom_racing_emoji_feb2025"))return D;else if(d("WAWebABProps").getABPropConfigValue("custom_racing_emoji"))return C;return a};this.getGlyphId=function(b){b=a.normalizeEmoji(b);if(b==null)return null;b=a._applyGlyphTransformations(b);var c=a._getDerivedMaps();c=c.emojiToGlyphId;return c.get(b)};this.getGlyphPath=function(b,c){b=a.normalizeEmojiFromString(b);if(b==null)return null;b=a._applyGlyphTransformations(b);var e=a._getDerivedMaps();e=e.emojiToGlyphId;e=e.get(b);return e==null?null:d("WAWebGetEmojiPathExperimental").getGlyphExperimentalPath(b,a._getConfig().emojiType,c)};this.getSpritesPath=function(a,b,c,e){return d("WAWebGetEmojiPathExperimental").getEmojiSpritesExperimentalPath(a,b,c,e)};this.isGlyphCached=function(b){b=a._getGlyphIndex(b);return a._getCachedGlyphs().get(b)};this.markGlyphCached=function(b){b=a._getGlyphIndex(b);a._getCachedGlyphs().set(b)};this._getCachedGlyphs=b(function(){return new(c("WABitArray"))(a._getGlyphCount())});this.getCssClasses=function(b,c){c===void 0&&(c="small");return["b"+a.getBucket(b),c==="small"?"emoji":"emojik",a._getConfig().emojiType===d("WAWebEmojiConst").EMOJI_TYPE.APPLE?"apple":"wa"].join(" ")};this.getStyle=function(b,c){c===void 0&&(c="small");b=a._getCoordinates(b,c);c=b.xpos;b=b.ypos;return{backgroundPosition:"-"+c+"px -"+b+"px"}};this.getBucket=function(b){b=a._getGlyphIndex(b);b=Math.floor(b/d("WAWebEmojiConst").BUCKET_SIZE);return""+b};this.getHeartEmojis=b(function(){return z.map(a.normalizeEmoji).filter(Boolean)});this._getLastBucketId=b(function(){var b=a._getGlyphCount();return b-b%d("WAWebEmojiConst").BUCKET_SIZE});this._getLastBucketCols=b(function(){return Math.floor(Math.sqrt(a._getGlyphCount()-a._getLastBucketId()))})}var b=a.prototype;b.configure=function(a){if(a===this._config)return;this._config=a;this.getHeartEmojis.reset();this._createEmojiRegexIfNeeded.reset();this._createLargeEmojisRegexIfNeeded.reset();this._createOnlyEmojiRegexIfNeeded.reset();this._getEmojiRegexSource.reset();this._getCachedGlyphs.reset();this._getSkinToneEmojisToBase.reset();this._getBaseToSkinToneEmojis.reset();this._getEmojiToCategory.reset();this._getLastBucketId.reset();this._getLastBucketCols.reset();this._getDerivedMaps.reset()};b._getConfig=function(){this._config!=null||h(0,56544);return this._config};b.isEmoji=function(a){return this.normalizeEmoji(a)!=null};b.getSkinToneBase=function(a){a=this.normalizeEmoji(a);return a==null?null:(a=this._getSkinToneEmojisToBase().get(a))!=null?a:null};b._getLargeEmojisRegex=function(){var a=this._createLargeEmojisRegexIfNeeded();a.lastIndex=0;return a};b._getGlyphCount=function(){var a=this._getDerivedMaps();a=a.glyphIdToIndex;return a.size};b._getCoordinates=function(a,b){a=this._getGlyphIndex(a);var c=a%d("WAWebEmojiConst").BUCKET_SIZE;a=a>=this._getLastBucketId()?this._getLastBucketCols():Math.floor(Math.sqrt(d("WAWebEmojiConst").BUCKET_SIZE));b=d("WAWebEmojiConst").EMOJI_WIDTH[b];var e=Math.floor(c/a);c=Math.floor(c%a);a=c*b;c=e*b;return{xpos:a,ypos:c,width:b}};b._getGlyphIndex=function(a){var b=this._getDerivedMaps();b=b.glyphIdToIndex;return c("WANullthrows")(b.get(a))};b.getEmojiAggregate=function(a){a=this.getNormalizedOrTofu(a);var b=this.getSkinToneBase(a);return(b=b)!=null?b:E(a)};b.getNormalizedOrTofu=function(a){var b=this.normalizeEmojiFromString(a);return!b?i:a};return a}();function H(a){return a.every(function(b){return b===a[0]})?a[0]:a.join("")}function a(a){return y.has(a)}G=new G();g.OPEN_BOX_CHAR=i;g.PEOPLE_HOLDING_HANDS=b;g.WOMEN_HOLDING_HANDS=m;g.MEN_HOLDING_HANDS=n;g.WOMAN_AND_MAN_HOLDING_HANDS=o;g.KISS_WOMAN_MAN=e;g.KISS_WOMAN_WOMAN=f;g.KISS_MAN_MAN=p;g.KISS=r;g.COUPLE_WITH_HEART_WOMAN_MAN=s;g.COUPLE_WITH_HEART_WOMAN_WOMAN=t;g.COUPLE_WITH_HEART_MAN_MAN=u;g.COUPLE_WITH_HEART=w;g.HANDSHAKE=x;g.getPermutations=F;g.isBaseMultiSkinToneEmoji=a;g.EmojiUtil=G}),98); __d("WAWebDBGetReactions",["WAWebApiContact","WAWebEmoji","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebParseMsgKeyString","WAWebReactionsBEUtils","WAWebSchemaReactions","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaReactions").getReactionsTable().equals(["parentMsgKey"],a));var b={reactions:[],reactionByMe:null},e=new Map();a.forEach(function(a){var f=a.reactionText,g=a.orphan;if(f!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&g!==1){g=d("WAWebEmoji").EmojiUtil.getEmojiAggregate(f);f=(f=e.get(g))!=null?f:[];e.set(g,[].concat(f,[a]));g=c("WAWebParseMsgKeyString")(a.msgKey);g.fromMe&&(b.reactionByMe=a)}});var f=b.reactionByMe?d("WAWebEmoji").EmojiUtil.getEmojiAggregate(b.reactionByMe.reactionText):"";e.forEach(function(a,c){var d=!1;c===f&&(d=!0);b.reactions.push({aggregateEmoji:c,senders:a,hasReactionByMe:d})});return b});return h.apply(this,arguments)}function e(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=new Map();yield d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];b=(yield b.anyOf(["parentMsgKey"],a));b.forEach(function(a){var b=a.reactionText,e=a.orphan;if(b!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&e!==1){e=(b=c.get(a.parentMsgKey))!=null?b:[];e.push(a);c.set(a.parentMsgKey,e)}})});return function(a){return e.apply(this,arguments)}}());return c});return i.apply(this,arguments)}function f(a){return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(b){b=b[0];return b.anyOf(["parentMsgKey"],a)})}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e,f=a.parentMsgKey;a=a.senderUserJid;var g=[];b=(b=d("WAWebLidMigrationUtils").getAlternateMsgKey(c("WAWebMsgKey").from(f)))==null?void 0:b.toString();e=(e=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").createUserWid(a)))==null?void 0:e.toString();f=[f,b].filter(Boolean);b=[a,e].filter(Boolean);for(a of f)for(e of b)g.push([a,e]);f=(yield d("WAWebSchemaReactions").getReactionsTable().anyOf(["parentMsgKey","senderUserJid"],g,{limit:1}));return f[0]});return k.apply(this,arguments)}g.getReactions=a;g.getFilteredReactionsFromParentMsgs=e;g.getAllReactionsFromParentMsgs=f;g.existsReactionAddressingModeInsensitive=j}),98); __d("WAWebDBCreateOrUpdateReactions",["WAWebApiContact","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var c=new Map();a.forEach(function(a){d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid)&&(a.read=!0);var b=h(a),e=c.get(b);e?e.timestamp<=a.timestamp&&c.set(b,a):c.set(b,a)});return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=[],e=[];Array.from(c.values()).forEach(function(a){e.push([a.parentMsgKey,a.senderUserJid]);var b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").createUserWid(a.senderUserJid));b!=null&&e.push([a.parentMsgKey,b.toString()])});var f=(yield a.anyOf(["parentMsgKey","senderUserJid"],e));f.forEach(function(a){var d=h(a),e=c.get(d);e&&(e.timestamp<=a.timestamp?c["delete"](d):e.senderUserJid!==a.senderUserJid&&b.push([a.parentMsgKey,a.senderUserJid]))});b.length>0&&(yield a.bulkRemove(b));yield a.bulkCreateOrReplace(Array.from(c.values()));return Array.from(c.values())});return function(b){return a.apply(this,arguments)}}())}function h(a){var b=d("WAWebWidFactory").createUserWid(a.senderUserJid),c=String(d("WAWebLidMigrationUtils").toPn(b));b=String(d("WAWebLidMigrationUtils").toLid(b));return a.parentMsgKey+","+c+","+b}g.createOrUpdateReactions=a}),98); __d("WAWebDBProcessReactionsMsgs",["WAWebApiChat","WAWebBackendApi","WAWebDBCreateOrUpdateReactions","WAWebDBMarkFutureproofMessagesReparsed","WAWebLastAddOnDBSerialization","WAWebReactionsBEUtils","WAWebShouldUpdateLastAddOnPreview","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length>0){var b=(yield d("WAWebReactionsBEUtils").createReactionsRowFromMsg(a));b=(yield d("WAWebDBCreateOrUpdateReactions").createOrUpdateReactions(b));d("WAWebReactionsBEUtils").updateHasReactionFromParent(b);a=a.map(function(a){return a.id.toString()});yield d("WAWebDBMarkFutureproofMessagesReparsed").markFutureproofMessagesReparsed(a);a=(yield d("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates(b.map(function(a){return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromReactionRowType(a)})));yield d("WAWebApiChat").bulkUpdateChatLastAddOnPreview(a);d("WAWebBackendApi").frontendFireAndForget("updateChatLastAddOnPreview",{chatMap:a})}});return h.apply(this,arguments)}g.processReactionMsgs=a}),98); __d("WAWebDeleteReactionsJob",["WALogger","WAWebDBDeleteReactions","WAWebDBMessageDelete","WAWebDefinePersistedJob","WAWebMsgKey","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Msg table for chat: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Msg table, reactionMsgKeys is undefined, parentMsgKeys length ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Reactions table returned undefined, parentMsgKeys length ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: Deleting reactions from Reactions table for chat: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: NOOP step for ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Persisted: deleteReaction persisted job started"]);m=function(){return a};return a}a=d("WAWebDefinePersistedJob").defineWebPersistedJob().step("deleteReactions",function(a){var b=a.chatId;a=a.parentMsgKeys;d("WALogger").LOG(m());d("WALogger").DEV(l(),b);return{chatId:b,parentMsgKeys:a}}).step("deleteReactionsFromReactionsTable",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId;a=a.parentMsgKeys;d("WALogger").DEV(k(),b);b=(yield d("WAWebDBDeleteReactions").deleteReactionsByParentMessageKeys(a));if(!b){d("WALogger").LOG(j(),a.length);return[]}return b});return function(b){return a.apply(this,arguments)}}()).finalStep("deleteReactionsFromMessageTable",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.chatId;b=b.parentMsgKeys;var f=[];a||d("WALogger").LOG(i(),b.length);a.forEach(function(a){c("WAWebMsgKey").fromString(a).fromMe&&f.push(a)});f.length>0&&(d("WALogger").DEV(h(),e),yield d("WAWebDBMessageDelete").removeMessagesFromHistory(f,{deleteAssociatedMsgs:!1}));return a});return function(b,c){return a.apply(this,arguments)}}()).end();g.deleteReactions=a}),98); __d("WAWebReactionsParseWebMsgInfoReaction",["WALogger","WANullthrows","WAWebAddOnParseWebMsgInfo","WAWebE2EProtoUtils","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMsgInfoReaction failed with error "," and stack ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseWebMsgInfoReaction:convertToTextWithoutSpecialEmojis reaction text is null."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseWebMsgInfoReaction: reaction sender should be a wid."]);j=function(){return a};return a}function a(a,b){var e=[];try{if(a==null||a.reactions==null)return e;if(b==null||b.reactions==null)return e;b.reactions.forEach(function(a){var f=a.key,g=a.senderTimestampMs,h=a.text;a=a.unread;h=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis((h=h)!=null?h:"");f=c("WANullthrows")(d("WAWebAddOnParseWebMsgInfo").buildAddonMsgKey(f));var k=f.msgKey;f=f.sender;f==null||!(f instanceof c("WAWebWid"))?d("WALogger").ERROR(j()):h==null?d("WALogger").ERROR(i()):e.push({id:k,reactionTimestamp:g,reactionText:h,reactionParentKey:b.id,sender:d("WAWebWidFactory").createWid(f.toString()),unread:k.fromMe?!1:a===!0})})}catch(a){d("WALogger").ERROR(h(),a==null?void 0:a.name,a==null?void 0:a.stack)}return e}g.parseWebMsgInfoReaction=a}),98); __d("WAWebDBChangeOrphanStateReactions",["WAWebModelStorageUtils","WAWebSchemaReactions","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["reactions"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=a.map(function(a){return[a,1]});c=(yield d("WAWebSchemaReactions").getReactionsTable().anyOf(["parentMsgKey","orphan"],c));c.forEach(function(a){a.orphan=0,a.orphanReason=void 0});yield b.bulkCreateOrReplace(c);return c});return function(a){return c.apply(this,arguments)}}())}g.changeOrphanStateReactions=a}),98); __d("WAWebCheckUpdateOrphanReactions",["WALogger","WAWebAddonProcessMsgs","WAWebDBChangeOrphanStateReactions","WAWebReactionDataUtils","WAWebStoreOrphans","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["checkUpdateForOrphanReactions: error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Updating reaction orphans"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{a=(yield d("WAWebDBChangeOrphanStateReactions").changeOrphanStateReactions(a));d("WALogger").DEV(i()).tags("checkUpdateForOrphanReactions");a=(yield d("WAWebAddonProcessMsgs").processMsgsAndGetOrphans(a.map(function(a){return d("WAWebReactionDataUtils").reactionRowToReactionMsgData(a)})));a=a.orphans;yield d("WAWebStoreOrphans").storeOrphans(a)}catch(a){d("WALogger").WARN(h(),a)}});return j.apply(this,arguments)}g.checkUpdateForOrphanReactions=a}),98); __d("WAWebReactionsParseReactionEncMessageProto",["WAWebE2EProtoUtils","WAWebMsgType","WAWebReactionEncMessageValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.encReactionMessage;if(b==null)return;var c=b.encIv,e=b.encPayload;b=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b.targetMessageKey,a);if(b==null)throw new(d("WAWebReactionEncMessageValidationError").ReactionEncMessageValidationError)(d("WAWebReactionEncMessageValidationError").ReactionEncValidationErrorCode.MISSING_TARGET_MSG_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER);if(c==null)throw new(d("WAWebReactionEncMessageValidationError").ReactionEncMessageValidationError)(d("WAWebReactionEncMessageValidationError").ReactionEncValidationErrorCode.INVALID_ENC_IV,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER);if(e==null)throw new(d("WAWebReactionEncMessageValidationError").ReactionEncMessageValidationError)(d("WAWebReactionEncMessageValidationError").ReactionEncValidationErrorCode.INVALID_ENC_PAYLOAD,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.REACTION_ENC,kind:d("WAWebMsgType").MsgKind.ReactionEncrypted,encIv:c,encPayload:e,targetMessageKey:b}),contextInfo:null}}g["default"]=a}),98); __d("WAWebReactionsParseReactionMessageProto",["WALongInt","WAWebConstantsDeprecated","WAWebE2EProtoUtils","WAWebMsgType","WAWebReactionsBEUtils","WAWebReactionsValidationError","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf;a=a.baseMessage;b=b.reactionMessage;if(b==null)return;var c=h(b),e=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b.key,a);b=d("WALongInt").maybeNumberOrThrowIfTooLarge(b.senderTimestampMs);if(e==null)throw new(d("WAWebReactionsValidationError").ReactionValidationError)(d("WAWebReactionsValidationError").ReactionValidationErrorCode.MISSING_PARENT_MSG_KEY,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(b==null)throw new(d("WAWebReactionsValidationError").ReactionValidationError)(d("WAWebReactionsValidationError").ReactionValidationErrorCode.MISSING_TIMESTAMP,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);return{msgData:babelHelpers["extends"]({},a,{type:d("WAWebMsgType").MSG_TYPE.REACTION,kind:d("WAWebMsgType").MsgKind.ReactionDecrypted,reactionParentKey:e,reactionText:c,reactionTimestamp:b,read:!1}),contextInfo:null}}function h(a){a=a.text;if(a!=null&&a.length>c("WAWebConstantsDeprecated").REACTION_CONTENT_MAX_LENGTH)throw new(d("WAWebReactionsValidationError").ReactionValidationError)(d("WAWebReactionsValidationError").ReactionValidationErrorCode.INVALID_REACTION_TEXT_LENGTH,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_REACTION_TEXT);return(a=d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(a))!=null?a:d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT}g["default"]=a}),98); __d("WAWebReactionDataUtils",["WANullthrows","WAWebMsgGetters","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgType","WAWebReactionsBEUtils","WAWebViewMode.flow","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){var b=c("WAWebMsgKey").fromString(a.msgKey),e=d("WAWebMsgKeyUtils").msgKeyToTargetInfo(b,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon),f=e.from,g=e.to;e=e.author;return{id:b,to:g,from:f,author:e,type:d("WAWebMsgType").MSG_TYPE.REACTION,kind:d("WAWebMsgType").MsgKind.ReactionDecrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,reactionParentKey:c("WAWebMsgKey").fromString(a.parentMsgKey),reactionText:a.reactionText,reactionTimestamp:a.timestamp,t:(b=a.t)!=null?b:void 0,ack:(g=a.ack)!=null?g:void 0,read:(f=a.read)!=null?f:!1}}function b(a){var b;return{msgKey:a.id.toString(),parentMsgKey:a.reactionParentKey.toString(),senderUserJid:c("WANullthrows")(d("WAWebMsgGetters").getSender(a)).toString(),reactionText:a.reactionText,timestamp:a.reactionTimestamp,t:d("WAWebMsgGetters").getT(a),ack:(b=d("WAWebMsgGetters").getAck(a))!=null?b:void 0,orphan:0,read:a.read}}function e(a){var b=a.id,c=a.reactionTimestamp,e=a.reactionText,f=a.reactionParentKey,g=a.sender;a=a.unread;g=d("WAWebWidFactory").toUserWid(g);var h=0;return{msgKey:b.toString(),parentMsgKey:f.toString(),senderUserJid:g.toString(),reactionText:(b=e)!=null?b:d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT,timestamp:c,orphan:h,read:!a}}g.reactionRowToReactionMsgData=a;g.reactionMsgDataToReactionRow=b;g.webMsgInfoReactionTypeToReactionsRow=e}),98); __d("WAWebReactionsBEUtils",["WALogger","WALongInt","WANullthrows","WAWebAddonQueryUtils","WAWebBotGenTypingIndicatorMsg","WAWebDBGetReactions","WAWebMessageAssociation.flow","WAWebMessageAssociationConstants","WAWebMsgType","WAWebSchemaMessage","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["createReactionsRowFromMsg: reactions not allowed for this message type ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["createReactionsRowFromMsg: sender or reactionMsg are null"]);i=function(){return a};return a}var j="",k=new Set([(f=d("WAWebMsgType")).MSG_TYPE.CIPHERTEXT,f.MSG_TYPE.REVOKED,f.MSG_TYPE.DEBUG,f.MSG_TYPE.DEBUG_PLACEHOLDER,f.MSG_TYPE.GP2,f.MSG_TYPE.NOTIFICATION,f.MSG_TYPE.NEWSLETTER_NOTIFICATION,f.MSG_TYPE.NOTIFICATION_TEMPLATE,f.MSG_TYPE.E2E_NOTIFICATION,f.MSG_TYPE.CALL_LOG]),l=new Set([d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL]);function m(a){var b=a.type,c=a.subtype,e=a.futureproofType;a=a.associationType;if(b===d("WAWebMsgType").MSG_TYPE.UNKNOWN)return e!=null&&d("WAWebMessageAssociationConstants").orphanIneligibleFutureproofTypes.has(e);return k.has(b)||a!=null&&l.has(a)||b===d("WAWebMsgType").MSG_TYPE.CHAT&&c===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE?!1:!0}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[],e=[];a.forEach(function(a){a&&e.push(a.reactionParentKey)});var f=(yield d("WAWebAddonQueryUtils").getParentMsgsByMsgKey(e));a.forEach(function(a){var e;e=(e=a.author)!=null?e:a.from;if(!e||!a){d("WALogger").WARN(i());return}var g=f.get(a.reactionParentKey.toString());if(g&&!m(g)){d("WALogger").WARN(h(),g.type);return}e=d("WAWebWidFactory").toUserWid(e);e={msgKey:a.id.toString(),parentMsgKey:(g=g==null?void 0:g.id.toString())!=null?g:a.reactionParentKey.toString(),senderUserJid:e.toString(),reactionText:(g=a.reactionText)!=null?g:j,timestamp:a.reactionTimestamp,orphan:0,orphanReason:void 0,read:!1,t:c("WANullthrows")(d("WALongInt").maybeNumberOrThrowIfTooLarge(a.t))};b.push(e)});return b});return n.apply(this,arguments)}function e(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[],c=[];a.forEach(function(a){var d=a.parentMsgKey,e=a.orphan;a=a.reactionText;if(e!==1)if(a!==j){e={id:d,hasReaction:!0};c.push(e)}else b.push(d)});var e=(yield d("WAWebDBGetReactions").getFilteredReactionsFromParentMsgs(b));b.forEach(function(a){var b=e.get(a);b=b&&b.length>0||!1;a={id:a,hasReaction:b};c.push(a)});return d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(c)});return o.apply(this,arguments)}g.REVOKED_REACTION_TEXT=j;g.canHaveReactions=m;g.createReactionsRowFromMsg=a;g.updateHasReactionFromParent=e}),98); __d("WAWebParseProtocolAdminRevokeMessageProto",["WAWebAck","WAWebProtocolRevokeMessageUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.editAttr,f=a.msgContext;a=a.msgMeta;if(e!==d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE)return;return d("WAWebProtocolRevokeMessageUtils").parseProtocolRevokeMessageProto({messageProtobuf:b,baseMessage:c,editAttr:e,msgContext:f,msgMeta:a})}g["default"]=a}),98); __d("WAWebParseProtocolSenderRevokeMessageProto",["WAWebAck","WAWebProtocolRevokeMessageUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.editAttr,f=a.msgContext;a=a.msgMeta;if(e!==d("WAWebAck").EDIT_ATTR.SENDER_REVOKE)return;return d("WAWebProtocolRevokeMessageUtils").parseProtocolRevokeMessageProto({messageProtobuf:b,baseMessage:c,editAttr:e,msgContext:f,msgMeta:a})}g["default"]=a}),98); __d("WAWebProtocolRevokeMessageUtils",["WALogger","WAWebAck","WAWebE2EProtoUtils","WAWebHandleMsgError","WAWebHandleMsgMetaUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWamEnumE2eFailureReason"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseProtocolRevokeMessageProto: error:",", stack: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["missing a revoke message key "," (",") for "," from "," for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["found comment revoke"]);j=function(){return a};return a}var k=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="ProtocolRevokeMessageValidationError",a)||babelHelpers.assertThisInitialized(c)}return a}(d("WAWebHandleMsgError").MessageValidationError);function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.editAttr,f=a.msgContext;a=a.msgMeta;b=b.protocolMessage;if(b==null)return;var g=b.type;b=b.key;if(f!=="relay"&&g!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SETTING)return;if(g!==d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE)return;((f=c.author)==null?void 0:f.isLid())&&d("WAWebHandleMsgMetaUtils").isCommentMsgMeta(a)?(d("WALogger").LOG(j()),f=d("WAWebE2EProtoUtils").translateAddonMessageKeyToLocalReference(b,c)):f=d("WAWebE2EProtoUtils").translateRegularMessageKeyToLocalReference(b,c);if(f==null){d("WALogger").LOG(i(),b==null?void 0:b.id,Boolean(b),c.id,c.author,g);throw new k("protocol_revoke_missing_key",d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER)}if(e===d("WAWebAck").EDIT_ATTR.ADMIN_REVOKE)a="admin_revoke";else if(e===d("WAWebAck").EDIT_ATTR.SENDER_REVOKE)a="sender_revoke";else throw new k("protocol_revoke_missing_edit_attr",d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_PROTOCOL_BUFFER);try{return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.ProtocolRevoke,subtype:a,protocolMessageKey:f}),contextInfo:null}}catch(a){d("WALogger").WARN(h(),a==null?void 0:a.name,a==null?void 0:a.stack).tags("messaging").sendLogs("ProtocolRevokeParseError");throw a}}g.ProtocolRevokeMessageValidationError=k;g.parseProtocolRevokeMessageProto=a}),98); __d("WAWebGenerateImageReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebGenerateVideoReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebParseImageMessageProto",["WALongInt","WATimeUtils","WAWebAssociationProtoUtils","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMediaMessageGetValidatedProperties","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMsgType","WAWebPollsGatingUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.msgContext,f=a.messageAssociation;a=a.msgMeta;b=b.imageMessage;if(b==null)return;var g=b.directPath,h=b.staticUrl,i=b.mimetype,j=b.caption,k=b.height,l=b.width,m=b.mediaKeyTimestamp,n=b.jpegThumbnail,o=b.scanLengths,p=b.scansSidecar,q=b.viewOnce,r=b.thumbnailDirectPath,s=b.thumbnailSha256,t=b.thumbnailEncSha256,u=b.contextInfo,v=b.annotations,w=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,c,e,d("WAWebMsgType").MSG_TYPE.IMAGE),x=w.mediaKey,y=w.fileSha256,z=w.fileEncSha256,A=w.fileLength;w=w.url;w=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.IMAGE,kind:d("WAWebMsgType").MsgKind.Image,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(w),directPath:g||"",staticUrl:h||"",mimetype:i||"",caption:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(j),filehash:d("WAWebE2EProtoParserApi").decodeBytes(y),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(z),size:A,height:k||0,width:l||0,mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(x),mediaKeyTimestamp:m!=null?d("WALongInt").numberOrThrowIfTooLarge(m):d("WATimeUtils").unixTime(),body:d("WAWebE2EProtoParserApi").decodeBytes(n)||"",interactiveAnnotations:v,scanLengths:o,scansSidecar:p,isViewOnce:q===!0,thumbnailDirectPath:r,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(s),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(t),statusMentioned:a==null?void 0:a.statusMentioned});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(w,b);if(f&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){g=d("WAWebAssociationProtoUtils").getValidatedAssociationFieldsFromProto(f,c,e);h=g.associationParentMsgKey;i=g.associationType;j=g.viewMode;if(i===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL&&!d("WAWebPollsGatingUtils").isPhotoPollReceiverEnabled(c))return{msgData:babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,kind:d("WAWebMsgType").MsgKind.Unknown,futureproofType:d("WAWebMsgType").MSG_TYPE.IMAGE}),contextInfo:u};y=babelHelpers["extends"]({},w,{kind:"associatedImage",parentMsgKey:h,associationType:i,viewMode:j});return{msgData:y,contextInfo:u}}return{msgData:w,contextInfo:u}}g["default"]=a}),98); __d("WAWebParseVideoMessageProto",["WALongInt","WATimeUtils","WAWebAssociationProtoUtils","WAWebE2EProtoParserApi","WAWebE2EProtoUtils","WAWebMediaMessageGetValidatedProperties","WAWebMessageAssociationGatingUtils","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageProtobuf,c=a.baseMessage,e=a.msgContext,f=a.messageAssociation;a=a.msgMeta;b=b.videoMessage;if(b==null)return;var g=b.directPath,h=b.staticUrl,i=b.mimetype,j=b.caption,k=b.height,l=b.width,m=b.mediaKeyTimestamp,n=b.jpegThumbnail,o=b.viewOnce,p=b.thumbnailDirectPath,q=b.thumbnailSha256,r=b.thumbnailEncSha256,s=b.contextInfo,t=b.gifPlayback,u=b.gifAttribution,v=b.accessibilityLabel,w=b.seconds,x=b.streamingSidecar,y=b.annotations,z=d("WAWebMediaMessageGetValidatedProperties").getValidatedMediaMessageProperties(b,c,e,d("WAWebMsgType").MSG_TYPE.VIDEO),A=z.mediaKey,B=z.fileSha256,C=z.fileEncSha256,D=z.fileLength;z=z.url;z=babelHelpers["extends"]({},c,{type:d("WAWebMsgType").MSG_TYPE.VIDEO,kind:d("WAWebMsgType").MsgKind.Video,deprecatedMms3Url:d("WAWebE2EProtoParserApi").decodeUrl(z),directPath:g,staticUrl:h||"",mimetype:i,caption:d("WAWebE2EProtoUtils").convertToTextWithoutSpecialEmojis(j),filehash:d("WAWebE2EProtoParserApi").decodeBytes(B),encFilehash:d("WAWebE2EProtoParserApi").decodeBytes(C),size:D,height:k,width:l,mediaKey:d("WAWebE2EProtoParserApi").decodeBytes(A),mediaKeyTimestamp:m!=null?d("WALongInt").numberOrThrowIfTooLarge(m):d("WATimeUtils").unixTime(),duration:""+(w||0),body:d("WAWebE2EProtoParserApi").decodeBytes(n)||"",interactiveAnnotations:y,isViewOnce:o===!0,thumbnailDirectPath:p,thumbnailSha256:d("WAWebE2EProtoParserApi").decodeBytes(q),thumbnailEncSha256:d("WAWebE2EProtoParserApi").decodeBytes(r),isGif:t,gifAttribution:u,accessibilityLabel:v,streamingSidecar:x,statusMentioned:a==null?void 0:a.statusMentioned});d("WAWebE2EProtoParserApi").validateRequiredMediaProperties(z,b);if(f&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){g=d("WAWebAssociationProtoUtils").getValidatedAssociationFieldsFromProto(f,c,e);h=g.associationParentMsgKey;i=g.associationType;j=g.viewMode;B=babelHelpers["extends"]({},z,{kind:"associatedVideo",parentMsgKey:h,associationType:i,viewMode:j});return{msgData:B,contextInfo:s}}return{msgData:z,contextInfo:s}}g["default"]=a}),98); __d("WAWebGenerateStickerReportingTokenContent",["WAWebReportingTokenUtils"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebReportingTokenUtils").getMediaReportingTokenContent(a)}g["default"]=a}),98); __d("WAWebApiVerifiedBusinessName",["invariant","$InternalEnum","Promise","WAWebBizGatingUtils","WAWebHandleMsgTypes.flow","WAWebLidMigrationUtils","WAWebSchemaVerifiedBusinessName","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){var i;function a(){return d("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable().all()}var j=b("$InternalEnum").Mirrored(["Replace","Merge"]);function k(a){return d("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable().get(u(a))}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.isLid()||h(0,86986);var b=(yield k(a));if(b==null){var c=d("WAWebLidMigrationUtils").toPn(a);if(c!=null){c=(yield k(c));if(c!=null)return babelHelpers["extends"]({},c,{id:u(a)})}}return b});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebLidMigrationUtils").toLid(a);if(b!=null){b=(yield k(b));if(b!=null)return babelHelpers["extends"]({},b,{id:u(a)})}return k(a)});return o.apply(this,arguments)}function e(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBizGatingUtils").isLidMigrationForVnameEnabled())return k(a);return!c("WAWebWid").isUserWid(a)?null:a.isLid()?l(a):n(a)});return p.apply(this,arguments)}function q(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=j.Replace);var e=d("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable();a=u(a);b=babelHelpers["extends"]({},b,{id:a});c===j.Replace?yield e.createOrReplace(b):yield e.createOrMerge(a,b)});return r.apply(this,arguments)}function f(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield k(a));return(a==null?void 0:a.privacyMode)==null?null:t(a.privacyMode)});return s.apply(this,arguments)}function t(a){var b=d("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(a.actualActors),c=d("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(a.hostStorage);return b==null||c==null?null:{actualActors:b,hostStorage:c,privacyModeTs:a.privacyModeTs}}function u(a){return a.isLid()?a.toString():a.user}function v(a,b,c){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=j.Replace);a=d("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?d("WAWebLidMigrationUtils").getPnAndLidToUpdate(a):[a];return(i||(i=b("Promise"))).all(a.map(function(a){return q(a,c,e)}))});return w.apply(this,arguments)}g.getAllVerifiedNames=a;g.VerifiedBusinessNameUpdateType=j;g.getVerifiedBusinessNameRecord=k;g.getVerifiedBusinessNameRecordLidAware=e;g.createOrUpdateVerifiedBusinessName=q;g.getPrivacyMode=f;g.convertPrivacyModeFromStorageType=t;g.widToId=u;g.createOrUpdateVerifiedBusinessNameLidAware=v}),98); __d("WAWebBizUpdateVerifiedInfoAction",["WAWebApiVerifiedBusinessName","WAWebBackendApi","WAWebHandlePrivacyModeUpdateMsgAction","WAWebQueryExistsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.name,e=b.level,f=b.isApi,g=b.isSmb,h=b.serial;b=b.privacyMode;b!=null&&(yield d("WAWebHandlePrivacyModeUpdateMsgAction").handlePrivacyModeTransition(a,b,{bypassVerifiedNameUpdate:!0}));d("WAWebBackendApi").frontendFireAndForget("updateContactWithVerifiedName",{contactId:a,verifiedNameInfo:{id:a,name:c,level:e,isApi:f,isSmb:g,privacyMode:b}});yield d("WAWebApiVerifiedBusinessName").createOrUpdateVerifiedBusinessNameLidAware(a,{level:e,serial:h,name:c,isApi:f,isSmb:g,privacyMode:b?{actualActors:b.actualActors,hostStorage:b.hostStorage,privacyModeTs:b.privacyModeTs}:null})});return i.apply(this,arguments)}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebQueryExistsJob").queryWidExists(a));if(b==null)return;b=b.bizInfo;b&&(yield h(a,b.verifiedName))});return j.apply(this,arguments)}g.updateVerifiedInfo=h;g.queryAndUpdateContactPropertiesOnNewChat=a}),98); __d("WAWebHandlePrivacyModeUpdateMsgAction",["Promise","WAWebApiChat","WAWebApiVerifiedBusinessName","WAWebBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f;e===void 0&&(e={});if(!a.isUserNotPSA()||a.isCAPISupportAccount())return;var g=(yield j(a,e.chat));if(g==null)return;if(g.isBusiness===!1)return;if(g.privacyMode==null&&c==null)return;if(g.privacyMode!=null&&c!=null&&g.privacyMode.privacyModeTs>=c.privacyModeTs)return;var i=e;i=i.bypassVerifiedNameUpdate;i=i===void 0?!1:i;f={isBusiness:(f=g.isBusiness)!=null?f:!1,privacyMode:g.privacyMode};g={isBusiness:!0,privacyMode:c};d("WAWebBackendApi").frontendFireAndForget("updateBusinessInfo",{contactId:a,businessInfo:{isBusiness:!0,isEnterprise:!0,privacyMode:c}});yield (h||(h=b("Promise"))).all([i?null:d("WAWebApiVerifiedBusinessName").createOrUpdateVerifiedBusinessNameLidAware(a,{isApi:!0,isSmb:!1,privacyMode:c?{actualActors:c.actualActors,hostStorage:c.hostStorage,privacyModeTs:c.privacyModeTs}:null},d("WAWebApiVerifiedBusinessName").VerifiedBusinessNameUpdateType.Merge),d("WAWebBackendApi").frontendFireAndForget("generateAndUpdatePrivacySystemMessages",{wid:a,previousState:f,currentState:g,shouldRunMATonWid:e.shouldRunMATonWid})])});return i.apply(this,arguments)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(c!=null){var e=c.contact.isBusiness;return{isBusiness:e,privacyMode:e?c.contact.privacyMode:null}}e=(yield (h||(h=b("Promise"))).all([d("WAWebApiChat").getChatRecord(a),d("WAWebApiVerifiedBusinessName").getVerifiedBusinessNameRecordLidAware(a)]));c=e[0];a=e[1];if(c==null)return null;return a==null?{isBusiness:null}:{isBusiness:!0,privacyMode:a.privacyMode==null?null:d("WAWebApiVerifiedBusinessName").convertPrivacyModeFromStorageType(a.privacyMode)}});return k.apply(this,arguments)}g.handlePrivacyModeTransition=a;g.getChatInfo=j}),98); __d("WAWebPrimaryFeaturesModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.features=d("WAWebBaseModel").prop(),c.ddmSettings=d("WAWebBaseModel").prop(!1),c.clearAndDeleteChatSync=d("WAWebBaseModel").prop(!1),c.viewOnceSpReceiver=d("WAWebBaseModel").prop(!1),c.recentSticker=d("WAWebBaseModel").prop(!1),c.favoriteSticker=d("WAWebBaseModel").prop(!1),c.linkPreview=d("WAWebBaseModel").prop(!1),c.hqLinkPreview=d("WAWebBaseModel").prop(!1),c.pollCreationInCags=d("WAWebBaseModel").prop(!1),c.newsletter=d("WAWebBaseModel").prop(!1),c.externalWebBetaOptIn=d("WAWebBaseModel").prop(!1),c.historySyncOnDemand=d("WAWebBaseModel").prop(!1),c.webLinkPreviewNseSupport=d("WAWebBaseModel").prop(!1),c.messagePlaceholderResendNseSupport=d("WAWebBaseModel").prop(!1),c.isPrimaryBetaBuild=d("WAWebBaseModel").prop(!1),c.primaryCampaignIdInHistorySyncSupport=d("WAWebBaseModel").prop(!1),c.contactManagement=d("WAWebBaseModel").prop(!1),c.paymentInfoSyncSupport=d("WAWebBaseModel").prop(!1),c.customPaymentMethodsSyncSupport=d("WAWebBaseModel").prop(!1),c.merchantPaymentPartnerSyncSupport=d("WAWebBaseModel").prop(!1),c.isContactsBackupOn=d("WAWebBaseModel").prop(!1),c.primaryHasAddressbookPermission=d("WAWebBaseModel").prop(!1),c.primaryHasAgreedToNativeContactsNux=d("WAWebBaseModel").prop(!1),c.isAccountIntegrityStatePending=d("WAWebBaseModel").prop(!1),c.isAccountIntegrityStateTimelock=d("WAWebBaseModel").prop(!1),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.setPrimaryFeatures=function(a){this.features=a;a=new Set(a);this.ddmSettings=a.has("ddm_settings");this.clearAndDeleteChatSync=a.has("clear_and_delete_chat_sync");this.viewOnceSpReceiver=a.has("vo_sp_receiver");this.recentSticker=a.has("recent_sticker");this.favoriteSticker=a.has("favorite_sticker");this.linkPreview=a.has("link_preview");this.hqLinkPreview=a.has("link_preview_hq_thumbnail");this.pollCreationInCags=a.has("poll_creation_cag");this.newsletter=a.has("newsletter");this.externalWebBetaOptIn=a.has("external_web_beta_opt_in");this.historySyncOnDemand=a.has("history_sync_on_demand");this.webLinkPreviewNseSupport=a.has("web_link_preview_nse_support");this.messagePlaceholderResendNseSupport=a.has("message_placeholder_resend_nse_support");this.isPrimaryBetaBuild=a.has("is_primary_beta_build");this.primaryCampaignIdInHistorySyncSupport=a.has("primary_campaign_id_in_history_sync_support");this.contactManagement=a.has("contact_management");this.paymentInfoSyncSupport=a.has("payment_info_sync_support");this.customPaymentMethodsSyncSupport=a.has("custom_payment_methods_sync_support");this.isContactsBackupOn=a.has("is_contacts_backup_on");this.primaryHasAddressbookPermission=a.has("primary_has_addressbook_permission");this.primaryHasAgreedToNativeContactsNux=a.has("primary_has_agreed_to_native_contacts_nux");this.isAccountIntegrityStatePending=a.has("is_account_integrity_state_pending");this.isAccountIntegrityStateTimelock=a.has("is_account_integrity_state_timelock");this.merchantPaymentPartnerSyncSupport=a.has("merchant_payment_partner_sync_support")};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="primaryFeatures";b=d("WAWebBaseModel").defineModel(a);c=new b({id:"1"});g.PrimaryFeatures=c}),98); __d("WAWebComposeBoxActions",["WAWebEventEmitter","WAWebStateUtils"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.$ComposeBoxActionsImpl$p_1=!1,c.$ComposeBoxActionsImpl$p_2=!1,b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.focus=function(a){a=d("WAWebStateUtils").unproxy(a);a?this.trigger("focus_"+a.id.toString()):this.trigger("focus")};c.send=function(a){a=d("WAWebStateUtils").unproxy(a);this.trigger("send_"+a.id.toString())};c.paste=function(a,b,c){if(a){a=d("WAWebStateUtils").unproxy(a);this.trigger("paste_"+a.id.toString(),b,c)}else this.trigger("paste",b,c)};c.sendPaste=function(a,b){a=d("WAWebStateUtils").unproxy(a);this.trigger("send_paste_"+a.id.toString(),b)};c.toggleQuickReplies=function(){this.trigger("toggle_quick_replies")};c.addMsgSendingLogAttributes=function(a,b){this.trigger("add_sending_log_attributes_"+a.id.toString(),b)};c.setCtwaContextLinkData=function(a,b){this.trigger("set_ctwa_context_link_data_"+a.id.toString(),b)};c.setTextContent=function(a,b){this.trigger("set_text_content_"+a.id.toString(),b)};c.setIsFocus=function(a){this.$ComposeBoxActionsImpl$p_1=a};c.setHasText=function(a){this.$ComposeBoxActionsImpl$p_2=a};c.isFocused=function(){return this.$ComposeBoxActionsImpl$p_1};c.hasText=function(){return this.$ComposeBoxActionsImpl$p_2};return b}(c("WAWebEventEmitter"));b=new a();g.ComposeBoxActions=b}),98); __d("WAWebDocumentFlushed",["Promise","WAAbortError","once"],(function(a,b,c,d,e,f,g){var h,i=[],j=c("once")(function(){return new AbortController().signal});function k(){while(i.length>0){var a=i.shift();a()}}function l(){var a,b=window.requestAnimationFrame(function(){a=self.setTimeout(function(){k()},0)});return function(){window.cancelAnimationFrame(b),self.clearTimeout(a)}}function a(a){var c=(a=a==null?void 0:a.signal)!=null?a:j();return new(h||(h=b("Promise")))(function(a,b){if(c.aborted){b(new(d("WAAbortError").AbortError)());return}var e;function f(){c.removeEventListener("abort",h);var a=i.indexOf(g);a!==-1&&i.splice(a,1);i.length===0&&e!=null&&(e(),e=null)}function g(){f(),a()}function h(){f(),b(new(d("WAAbortError").AbortError)())}i.push(g);c.addEventListener("abort",h);i.length===1&&(e=l())})}e=function(){k();return(h||(h=b("Promise"))).resolve()};g.documentFlushed=a;g.resolveAllForTestingOnly=e}),98); __d("WAWebMain.scss",["cx"],(function(a,b,c,d,e,f,g,h){a={"-viewport-width-stop-xl":"1300px;","-viewport-width-stop-l":"1024px;","-viewport-width-stop-m":"900px;",paneThree:"_aig-",app:"_aigs",skipGlobalPaneStyles:"_as6h",paneOne:"_aigw",skipPaneWidthStyles:"_asu3",paneThreeWithNavBarExpanded:"_as5a"};b=a;g["default"]=b}),98); __d("WAWebStylePropertiesDeprecated",[],(function(a,b,c,d,e,f){function g(a,b){return a[b]}function a(a,b){return parseInt(g(a,b),10)}function b(a,b){return parseFloat(g(a,b))}f.getIntFromStylesProp=a;f.getFloatFromStylesProp=b}),66); __d("WAWebDrawerManager",["Promise","WAWebEventEmitter","WAWebMain.scss","WAWebStylePropertiesDeprecated"],(function(a,b,c,d,e,f,g){var h,i=d("WAWebStylePropertiesDeprecated").getIntFromStylesProp(c("WAWebMain.scss"),"-viewport-width-stop-xl");a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.setDrawerContext=function(a,b){this.trigger("update_context_"+a,b)};d.openDrawerRight=function(a,b){this.trigger("open_drawer_right",a,b)};d.openDrawerMid=function(a,b){this.trigger("open_drawer_mid",a,b)};d.openDrawerLeft=function(a,b){this.trigger("open_drawer_left",a,b)};d.existsDrawerRight=function(a){this.trigger("exists_drawer_right",a)};d.existsDrawerMid=function(a){this.trigger("exists_drawer_mid",a)};d.existsDrawerLeft=function(a){this.trigger("exists_drawer_left",a)};d.closeDrawerRight=function(){this.trigger("close_drawer_right")};d.closeDrawerMid=function(){this.trigger("close_drawer_mid")};d.closeDrawerLeft=function(){this.trigger("close_drawer_left")};d.focusDrawerLeft=function(){this.trigger("focus_drawer_left")};d.focusDrawerMid=function(){this.trigger("focus_drawer_mid")};d.focusDrawerRight=function(){this.trigger("focus_drawer_right")};d.isDrawerRightOverlappingCoversationPanel=function(){var a=this;return new(h||(h=b("Promise")))(function(b){a.existsDrawerRight(function(a){b(a&&window.matchMedia("(max-width: "+i+"px)").matches)})})};return c}(c("WAWebEventEmitter"));e=new a();g.DrawerManager=e}),98); __d("WAWebWamEnumSurfaceType",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT:1,CHATLIST:2,GALLERY:3,COMMUNITY_HOME:4,COMMUNITY_TAB:5,COMMUNITY_NAV:6,COMMUNITY_NAV_SHEET:7,COMMUNITY_SETTINGS:8,GROUP_INFO:9,NOTIFICATION:10,EXPRESSIONS_EMOJI:11,INVITE_NON_WA_CONTACT:12,CHAT_INFO_PAGE:13,NOTES_PROMPT:14,CHAT_THREAD:15,SEARCH_FILTER:16,TOOL_LIST_ITEM:17,GEN_AI_AGENT_NUX_SCREEN:18,GEN_AI_AGENT_NUX_TOS_SCREEN:19,GEN_AI_AGENT_NUX_BIZ_INFO_SCREEN:20,GEN_AI_AGENT_NUX_AUTHENTICATION_SCREEN:21,GEN_AI_MORE_BIZ_INFO_SCREEN:22,GEN_AI_AUTOMATIC_REPLIES_SCREEN:23,GEN_AI_COMMON_QUESTIONS_SCREEN:24,GEN_AI_READY_SCREEN:25,OVERFLOW_MENU:26,BROADCAST_LIST_LANDING_PAGE:27,BANNER_FROM_EXISTING_BCL:28,BANNER_FROM_NEW_BCL:29,COMPOSER:30,CONFIRM_EXIT_NOTE_DIALOGUE:31,VERIFY_EMAIL:32,EMAIL_VERIFICATION_CODE_SEND_ERROR_PROMPT:33,INCORRECT_EMAIL_VERIFICATION_CODE_PROMPT:34,EMAIL_CODE_VERIFICATION_ERROR_PROMPT:35,EMAIL_VERIFICATION:36,NOT_MY_EMAIL_PROMPT:37,REMOVE_EMAIL_ERROR_PROMPT:38,REMOVE_EMAIL:39,STICKER_TRAY_IN_CHAT:40,STICKER_SEARCH_CHAT:41,BUSINESS_HOME_PAGE:42,BROADCAST_LIST_AUDIENCE_PAGE:43,GEN_AI_WEB_ONBOARDING_EDUCATION:44,GEN_AI_WEB_ONBOARDING_QR_CODE:45,GEN_AI_WEB_ONBOARDING_SUCCESS:46,GEN_AI_SETTINGS_HOME_SCREEN:47,GEN_AI_SETTINGS_ADDITIONAL_BIZ_INFO_SCREEN:48,GEN_AI_SETTINGS_ADDITIONAL_BIZ_INFO_EDIT_SCREEN:49,GEN_AI_SETTINGS_BIZ_INFO_SCREEN:50,GEN_AI_SETTINGS_BIZ_INFO_EDIT_SCREEN:51,GEN_AI_SETTINGS_AUTO_REPLY_SCREEN:52,GEN_AI_SETTINGS_ATUO_REPLY_TYPE_EDIT_SCREEN:53,GEN_AI_SETTINGS_AUTO_REPLY_TIME_EDIT_SCREEN:54,GEN_AI_SETTINGS_FAQ_SCREEN:55,GEN_AI_SETTINGS_FAQ_EDIT_INFO_SCREEN:56,GEN_AI_SETTINGS_ADD_NEW_CONTACT_SCREEN:57,GEN_AI_SETTINGS_ADD_NEW_BUSINESS_INFO:58,GEN_AI_SETTINGS_DISCONNECT:59,ACCOUNT_SETTINGS:60,CREATE_BIZ_PROFILE:61,CREATE_PASS_KEY:62,ADD_EMAIL:63,VERIFY_NEW_EMAIL:64,INITIALIZING_ACCOUNT:65,GEN_AI_SETTINGS_DYI:66,GEN_AI_SETTINGS_LEAD_GEN_QUESTIONS:67,CATALOG_MANAGER:68,CATALOG_SETTINGS:69,FB_ACCOUNT_CONFIRMATION_BOTTOM_SHEET:70,CONNECT_CATALOG_SELECTION:71,REPLACE_CATALOG_CONFIRMATION_PROMPT:72,FB_LOGIN_BOTTOM_SHEET:73,CONNECTED_CATALOG_DETAILS_BOTTOM_SHEET:74,CONFIRM_DISCONNECT_CATALOG_BOTTOM_SHEET:75,GIF_EXPRESSIONS_TRAY:76,BUSINESS_PROFILE_DESCRIPTION_GENAI_LOADING:77,BUSINESS_PROFILE_DESCRIPTION_GENAI:78,SELECT_BIZ_CATEGORY:79,SEARCH_BIZ_CATEGORY_BOTTOM_SHEET:80,ADD_BIZ_HOURS:81,SELECT_BIZ_HOURS_BOTTOM_SHEET:82,ADD_PROFILE_PHOTO:83,ADD_BIZ_DISCOVERY_INFO:84,ADD_BIZ_DESCRIPTION:85,GEN_AI_WEB_ONBOARDING_AUTHENTICATION:86,GEN_AI_COACHING:87,PRODUCT_DETAILS:88,ORIGIN_COUNTRY:89,IMPORTER_INFO:90,IMPORTER_COUNTRY:91,EDIT_BIZ_PROFILE:92,GEN_AI_LEARNING_SUMMARY:93,GEN_AI_KNOWLEDGE_EDIT:94,ADD_ITEM:95,EDIT_ITEM:96,GEN_AI_AI_HUB_CHECKLIST:97,GEN_AI_AI_HUB_CHAT:98,GEN_AI_AI_HUB_HOME:99,GEN_AI_AI_HUB_ADD_BUSINESS_INFO:100,GEN_AI_AI_HUB_ADD_PRODUCT_INFO:101,GEN_AI_AI_HUB_ADD_PURCHASING_INFO:102,GEN_AI_AGENT_EDIT_FIELD_BOTTOM_SHEET:103,GEN_AI_AI_HUB_KNOWLEDGE_REPO:104,CONNECT_CATALOG_NUX_BOTTOM_SHEET:105,GENAI_AGENT_AUTO_REPLY_CONFIRMATION_DIALOG:106,GENAI_AGENT_AUTO_REPLY_ERROR_DIALOG:107,FB_WEB_LOGIN:108,GENAI_AGENT_COACHING_INDICATOR_BOTTOMSHEET:109,WATCH_LEARNING_VIDEO:110});f.SURFACE_TYPE=a}),66); __d("WAWebWamEnumWebcRuntimeEnvCode",[],(function(a,b,c,d,e,f){a=Object.freeze({MAIN:1,WEB_WORKER:2,SERVICE_WORKER:3});f.WEBC_RUNTIME_ENV_CODE=a}),66); __d("WAWebWebcMemoryStatWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcRuntimeEnvCode","WAWebWamEnumWebcScenarioType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMemoryStat:[1188,{appContext:[26,a.TYPES.STRING],appContextBitfield:[27,a.TYPES.INTEGER],chatCollectionSize:[17,a.TYPES.INTEGER],chatDbSize:[18,a.TYPES.INTEGER],contactCollectionSize:[19,a.TYPES.INTEGER],contactDbSize:[20,a.TYPES.INTEGER],isForeground:[13,a.TYPES.BOOLEAN],jsHeapSizeLimit:[9,a.TYPES.INTEGER],messageCollectionSize:[24,a.TYPES.INTEGER],messageDbSize:[25,a.TYPES.INTEGER],peakUsedJsHeapSize:[14,a.TYPES.INTEGER],scenario:[15,d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE],totalJsHeapSize:[10,a.TYPES.INTEGER],uptime:[6,a.TYPES.NUMBER],usedJsHeapSize:[11,a.TYPES.INTEGER],usedJsHeapSizeDelta:[16,a.TYPES.INTEGER],webcRuntimeEnv:[23,d("WAWebWamEnumWebcRuntimeEnvCode").WEBC_RUNTIME_ENV_CODE]},[1,1,10],"regular"]},{WebcMemoryStat:[]});g.WebcMemoryStatWamEvent=b}),98); __d("WAWebWamMemoryStat",["Promise","WALogger","WANullthrows","WAShiftTimer","WAWebBackendApi","WAWebLidAwareContactsDB","WAWebRuntimeEnvironmentUtils","WAWebSchemaChat","WAWebSchemaMessage","WAWebWamEnumWebcScenarioType","WAWebWebcMemoryStatWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MemoryStat] failed to set new scenario: ",""]);i=function(){return a};return a}var j=self.performance.now();function k(){var a;a=(a=self.performance)==null?void 0:a.memory;if(!a)return;o=Math.max(o,a.usedJSHeapSize);p+=a.usedJSHeapSize;q++;return{uptime:Math.round((self.performance.now()-j)/1e3),jsHeapSizeLimit:Math.round(a.jsHeapSizeLimit/1e3/1e3),totalJsHeapSize:Math.round(a.totalJSHeapSize/1e3/1e3),usedJsHeapSize:Math.round(a.usedJSHeapSize/1e3/1e3)}}function a(){var a=k();return!a?(h||(h=b("Promise"))).resolve():(h||(h=b("Promise"))).resolve([{label:"Main Window",memory:a.usedJsHeapSize,uptime:a.uptime}])}var l=5e3,m=60,n=d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE,o=0,p=0,q=0,r;function e(a){try{var b;if(d("WAWebRuntimeEnvironmentUtils").isWorker()||((b=self.performance)==null?void 0:b.memory)==null)return;if(a!==n){if(n!==d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE){(b=r)==null?void 0:b.cancel();r=null;void w();j=self.performance.now()}n=a;v()}r==null&&u()}catch(a){d("WALogger").ERROR(i(),a).sendLogs("set-memory-stat-scenario-failed",{sampling:.01})}}var s=null;function f(a){s!=null&&!s.equals(a)&&t(),s=a}function t(){if(d("WAWebRuntimeEnvironmentUtils").isWorker())return;var a=k();if(a==null)return;void B().then(function(b){var c;c=new(d("WAWebWebcMemoryStatWamEvent").WebcMemoryStatWamEvent)(babelHelpers["extends"]({},a,{scenario:d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.CHAT_NAVIGATION,peakUsedJsHeapSize:Math.round(o/1e3/1e3),usedJsHeapSize:Math.round(p/q/1e3/1e3),isForeground:((c=self.document)==null?void 0:c.visibilityState)==="visible"},b,y));c.commit()})}function u(){r=new(d("WAShiftTimer").ShiftTimer)(function(){k(),n===d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE&&q!==0&&q%m===0&&(void w(),v()),u()}),r.onOrAfter(l)}function v(){o=0,p=0,q=0}function w(){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,e=(yield (h||(h=b("Promise"))).all([B(),z()])),f=e[0];e=e[1];a=new(d("WAWebWebcMemoryStatWamEvent").WebcMemoryStatWamEvent)(babelHelpers["extends"]({},c("WANullthrows")(k()),{scenario:n,peakUsedJsHeapSize:Math.round(o/1e3/1e3),usedJsHeapSize:Math.round(p/q/1e3/1e3),isForeground:((a=self.document)==null?void 0:a.visibilityState)==="visible"},f,e));a.commit()});return x.apply(this,arguments)}var y=null;function z(){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield (h||(h=b("Promise"))).all([d("WAWebSchemaChat").getChatTable().count(),c("WAWebLidAwareContactsDB").count(),d("WAWebSchemaMessage").getMessageTable().count()])),e=a[0],f=a[1];a=a[2];y={chatDbSize:D(e),contactDbSize:D(f),messageDbSize:D(a)};return y});return A.apply(this,arguments)}function B(){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebBackendApi").frontendSendAndReceive("getCollectionSizes"));return{chatCollectionSize:D(a.chat),contactCollectionSize:D(a.contact),messageCollectionSize:D(a.message)}});return C.apply(this,arguments)}function D(a){return a>1e3?Math.round(a/100)*100:Math.round(a/10)*10}g.getMemoryTableRows=a;g.setCurrentMemoryScenario=e;g.uploadMemoryIfChatWasOpened=f;g.uploadMemoryInfoOnChatClose=t}),98); __d("WAWebCmd",["invariant","$InternalEnum","Promise","WAAbortError","WALogger","WAPromiseDelays","WAWebChatEntryPoint","WAWebComposeBoxActions","WAWebCurrentUser","WAWebDocumentFlushed","WAWebDrawerManager","WAWebEventEmitter","WAWebMsgTunnelBridge","WAWebPageLoadLogging","WAWebStateUtils","WAWebWamMemoryStat","asyncToGeneratorRuntime","err","gkx","lodash"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cmd: botTogglePluginSearchDetailsToggle called w/ null target id."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cmd: offline_process_ready"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["CMD.logout debug: \n ",""],["CMD.logout debug: \\n ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected scrollChatToBottom error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected_scrollToFocusedMsg error: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["openChatBottom. entry point: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["openChatBottom"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["openChatFromUnread with chat unreadMsgAnchor: ",", chat unreadCount: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected openChat error: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cmd: initialLoadReady"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["cmd:clearUIBusy uibusy timeout"]);t=function(){return a};return a}a=b("$InternalEnum").Mirrored(["Sender","Admin"]);e="app_state_sync_completed";var u=400;f=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var f=arguments.length,g=new Array(f),i=0;i<f;i++)g[i]=arguments[i];return(b=e=a.call.apply(a,[this].concat(g))||this,e.isMainLoaded=!1,e.uiBusy=0,e.isMainStreamReadyMd=!1,e.isOfflineDeliveryEnd=!1,e.$CmdImpl$p_3=c("lodash").debounce(function(){e.uiBusy&&(d("WALogger").LOG(t()),e.uiBusy=0,e.$CmdImpl$p_4())},1e3,{maxWait:5e3}),e.$CmdImpl$p_4=w(function(){e.uiBusy===0||h(0,75716,e.uiBusy);if(e.uiBusy!==0)return;e.$CmdImpl$p_3.cancel();e.trigger("ui_idle")}),b)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.mainLoaded=function(){this.isMainLoaded=!0,this.trigger("main_loaded")};f.initialLoadReady=function(){d("WALogger").LOG(s()),this.trigger("initial_load_ready")};f.logSocketSummary=function(){this.trigger("log_socket_summary")};f.muteAllReactions=function(a,b,c){this.trigger("mute_all_reactions",a,b,c)};f.muteChat=function(a,b,c,e){this.trigger("mute_chat",d("WAWebStateUtils").unproxy(a),b,c,e)};f.muteChatMultiselect=function(a,b,c){this.trigger("mute_chat_multiselect",a,b,c)};f.muteChatFromEntryPoint=function(a,b,c,e){this.trigger("mute_chat_from_entrypoint",d("WAWebStateUtils").unproxy(a),b,c,e)};f.assignChat=function(a,b){this.trigger("assign_chat",d("WAWebStateUtils").unproxy(a),b)};f.deleteOrExitChat=function(a,b){this.trigger("delete_or_exit_chat",d("WAWebStateUtils").unproxy(a),b)};f.deleteOrExitChatFromEntryPoint=function(a,b,c){this.trigger("delete_or_exit_chat_from_entrypoint",d("WAWebStateUtils").unproxy(a),b,c)};f.clearChat=function(a,b){this.trigger("clear_chat",d("WAWebStateUtils").unproxy(a),b)};f.archiveChat=function(a,b,c){c===void 0&&(c=!0),this.trigger("archive_chat",d("WAWebStateUtils").unproxy(a),b,c)};f.archiveChatFromEntryPoint=function(a,b,c,e){e===void 0&&(e=!0),this.trigger("archive_chat_from_entrypoint",d("WAWebStateUtils").unproxy(a),b,c,e)};f.pinChat=function(a,b){this.trigger("pin_chat",d("WAWebStateUtils").unproxy(a),b)};f.favoriteChat=function(a,b,c){this.trigger("favorite_chat",d("WAWebStateUtils").unproxy(a),b,c)};f.markChatUnread=function(a,b){this.trigger("mark_chat_unread",d("WAWebStateUtils").unproxy(a),b)};f.msgInfoDrawer=function(a){this.trigger("msg_info_drawer",d("WAWebStateUtils").unproxy(a))};f.chatSearch=function(a){this.trigger("chat_search",d("WAWebStateUtils").unproxy(a))};f.scrollChatHeight=function(a){this.trigger("scroll_chat_by_height",a)};f.ctwaAdPreviewDrawer=function(a,b,c){this.trigger("ctwa_ad_preview_drawer",d("WAWebStateUtils").unproxy(a),b,c)};f.chatInfoDrawer=function(a,b){this.trigger("chat_info_drawer",d("WAWebStateUtils").unproxy(a),b==null?void 0:b.showFullGroupDescription,b==null?void 0:b.scrollToParticipantList,b==null?void 0:b.sourceGroupChatOrNewsletter,b==null?void 0:b.focusNewsletterDescriptionOnMount,b==null?void 0:b.focusGroupSubjectOnMount,b==null?void 0:b.focusGroupDescriptionOnMount)};f.openCurrentChatInfo=function(){this.trigger("open_current_chat_info")};f.blockCurrentChat=function(){this.trigger("block_current_chat")};f.clearCurrentChatConversationHistory=function(){this.trigger("clear_current_chat_conversation_history")};f.exitCurrentGroup=function(){this.trigger("exit_current_group")};f.replyCurrentMessage=function(){this.trigger("reply_current_message")};f.replyCurrentMessagePrivate=function(){this.trigger("reply_current_message_private")};f.forwardCurrentMessage=function(){this.trigger("forward_current_message")};f.deleteSelectedMessage=function(){this.trigger("delete_current_message")};f.starCurrentMessage=function(){this.trigger("star_current_message")};f.startPttRecording=function(){this.trigger("start_ptt_recording")};f.pausePttRecording=function(){this.trigger("pause_ptt_recording")};f.sendPttRecording=function(){v.trigger("send_ptt_recording")};f.editGroupDescription=function(){this.trigger("edit_group_description")};f.attachMediaDrawer=function(a){var b=d("WAWebStateUtils").unproxy(a.chat),c=function(c){c.length>0&&d("WAWebComposeBoxActions").ComposeBoxActions.setTextContent(b,c.join("\n\n")),a.onCancel==null?void 0:a.onCancel()};if(b.id.isBot())return;c=babelHelpers["extends"]({},a,{chat:b,onCancel:c});this.trigger("attach_media_drawer",c)};f.attachProduct=function(a){this.trigger("attach_product",a)};f.verificationDrawer=function(a){this.trigger("verification_drawer",a)};f.mediaViewerModal=function(a){var b=a.msg,c=a.getZoomNode,d=a.currentTime,e=a.highlightedMsgIds;a=a.shouldShowNumberText;this.trigger("media_viewer_modal",{msg:b,getZoomNode:c,currentTime:d,highlightedMsgIds:e,shouldShowNumberText:a})};f.openMediaViewerForAlbumMedia=function(a){this.trigger("open_media_viewer_for_album_media",a)};f.productImageViewerModal=function(a,b){this.trigger("product_image_viewer_modal",a,b)};f.ephemeralDrawer=function(a,b,c){this.trigger("ephemeral_drawer",a,b,c)};f.openCommunityHome=function(a,b){this.trigger("open_community_home",a,b)};f.openCommunityTabbedInfo=function(a,b,c,d){this.trigger("open_community_tabbed_info",a,b,c,d)};f.openCommunityPendingGroupsDrawer=function(a){this.trigger("open_community_pending_groups_drawer",a)};f.openCommunityHomeManageGroups=function(a){this.trigger("open_community_home_manage_groups",a)};f.openCommunitySettingsDrawer=function(a){this.trigger("open_community_settings_drawer",a)};f.openCommunitySubgroupJoinModal=function(a,b){this.trigger("open_subgroup_join_modal",a,b)};f.openProfile=function(a){this.trigger("open_profile",a)};f.communityAddNewGroup=function(a,b,c){this.trigger("open_community_add_new_group",a,b,c)};f.openCreatedNewsletter=function(a){this.trigger("open_created_newsletter",a)};f.openNewsletterProfile=function(a,b){this.trigger("open_newsletter_profile",a,b)};f.editNewsletterDescription=function(){this.trigger("edit_newsletter_description")};f.openEventInfoDrawer=function(a,b,c,d){this.trigger("open_event_info_drawer",a,b,c,d)};f.sendStarMsgs=function(a,b,c,e){this.trigger("send_star_msgs",d("WAWebStateUtils").unproxy(a),b,c,e)};f.sendUnstarMsgs=function(a,b,c,e){this.trigger("send_unstar_msgs",d("WAWebStateUtils").unproxy(a),b,c,e)};f.sendDeleteMsgs=function(a,b,c,e,f){this.trigger("send_delete_msgs",d("WAWebStateUtils").unproxy(a),b,c,e,f)};f.sendRevokeMsgs=function(a,b,c){this.trigger("send_revoke_msgs",d("WAWebStateUtils").unproxy(a),b,c)};f.$CmdImpl$p_1=function(a,c,e){var f=this;e===void 0&&(e=d("WAWebChatEntryPoint").ChatEntryPoint.Unknown);var g=d("WAWebStateUtils").unproxy(a);g.chatEntryPoint=e;d("WAWebMsgTunnelBridge").msgSyncTunnelBridge.setActiveChat(g.id);d("WAWebWamMemoryStat").uploadMemoryIfChatWasOpened(g.id);return new(i||(i=b("Promise")))(function(a){f.trigger("open_chat",g,c,e,function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){(yield d("WAWebDrawerManager").DrawerManager.isDrawerRightOverlappingCoversationPanel())&&d("WAWebDrawerManager").DrawerManager.closeDrawerRight(),a(b)});return function(a){return c.apply(this,arguments)}}())})["catch"](function(a){d("WALogger").LOG(r(),String(a));throw a})};f.openChatAt=function(a){var c=this,e=a.chat,f=a.msgContext,g=a.chatEntryPoint,h=a.onSuccess;a=d("WAWebStateUtils").unproxy(e);if(!f)return this.openChatBottom(a,g);this.setUiBusy(!0);e=this.$CmdImpl$p_1(a,f,g).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var d,e,g=f.enableAnimation!=null?f.enableAnimation:!0;if(a)if(a.wasVisible)d=function(){return c.$CmdImpl$p_2({pos:"offset",offset:a.offset})},e=function(){return c.$CmdImpl$p_2({pos:"center",animate:g,duration:u,easing:[.7,0,.3,1]})};else{d=function(){return c.$CmdImpl$p_2({pos:a.alignAt,scrollIfNeeded:!0})};switch(a.alignAt){case"top":case"bottom":e=function(){return c.$CmdImpl$p_2({pos:"center",animate:g,duration:u,easing:[.88,.64,.13,.99]})};break;case"center":default:e=function(){return(i||(i=b("Promise"))).resolve()}}}else d=function(){return c.$CmdImpl$p_2({pos:"center"})},e=function(){return(i||(i=b("Promise"))).resolve()};yield d();return e()});return function(b){return a.apply(this,arguments)}}()).then(function(){var a;if((f==null?void 0:(a=f.msg)==null?void 0:a.botPluginReferenceIndex)!=null){a=f==null?void 0:(a=f.msg)==null?void 0:a.botResponseTargetId;a!=null&&c.botTogglePluginSearchDetailsToggle(a,!0)}(f==null?void 0:f.highlightMsg)===!0&&c.flashFocusedMsg(f.highlightMentionMsg)}).then(function(){if(h){var a=h.mediaMsgToOpenInMediaViewer,b=h.onScrollToQuotedCarouselCard;a&&void d("WAPromiseDelays").delayMs(500).then(function(){v.openMediaViewerForAlbumMedia(d("WAWebStateUtils").unproxy(a)),b==null?void 0:b()})}return!0})["catch"](d("WAAbortError").catchAbort(function(){return!1}));e["finally"](function(){c.setUiBusy(!1)});return e};f.openChatFromUnread=function(a,e){var f=this;a=d("WAWebStateUtils").unproxy(a);if(!c("gkx")("26258")){window.chat=a;var g=a.unreadMsgAnchor&&a.unreadMsgAnchor.id.toString()||"No unreadMsgAnchor found";d("WALogger").LOG(q(),g,a.unreadCount)}var h;a.unreadMsgAnchor&&(h={collection:a.unreadMsgAnchor.msgChunk,promise:(i||(i=b("Promise"))).resolve(),msg:a.unreadMsgAnchor,isUnreadDivider:a.shouldShowUnreadDivider()});if(h||a.unreadCount>0){this.setUiBusy(!0);g=this.$CmdImpl$p_1(a,h,e).then(function(){return f.$CmdImpl$p_2({pos:"top",offset:-120})}).then(function(){return!0})["catch"](d("WAAbortError").catchAbort(function(){return!1}));g["finally"](function(){f.setUiBusy(!1)});return g}return this.openChatBottom(a,e)};f.openChatBottom=function(a,b){var c=this;a=d("WAWebStateUtils").unproxy(a);d("WALogger").LOG(p());a.id.isLid()&&d("WALogger").LOG(o(),b);this.setUiBusy(!0);var e;a.msgs.length>0&&(e={collection:a.msgs,msg:a.msgs.last(),isUnreadDivider:!1});a=this.$CmdImpl$p_1(a,e,b).then(function(){return c.scrollChatToBottom()}).then(function(){return!0})["catch"](d("WAAbortError").catchAbort(function(){return!1}));a["finally"](function(){c.setUiBusy(!1)});return a};f.$CmdImpl$p_2=function(a){var c=this;return new(i||(i=b("Promise")))(function(b){c.trigger("scroll_to_focused_msg",b,a)})["catch"](function(a){d("WALogger").WARN(n(),String(a))})};f.scrollChatToBottom=function(){var a=this;return new(i||(i=b("Promise")))(function(b){a.trigger("scroll_chat_to_bottom",b)})["catch"](function(a){d("WALogger").WARN(m(),String(a))})};f.scrollToActiveChat=function(){this.trigger("scroll_to_active_chat")};f.flashFocusedMsg=function(a){var b=this;self.setTimeout(function(){b.trigger("flash_focused_msg"),a&&b.trigger("flash_mention_msg")},0)};f.setActiveNavBarItem=function(a){this.trigger("set_active_nav_bar",a)};f.setActiveFilter=function(a,b,c){this.trigger("set_active_filter",a,b,c)};f.updateChatlistSelection=function(a){a=d("WAWebStateUtils").unproxy(a);this.trigger("update_chatlist_selection",a)};f.closeChat=function(a){a=d("WAWebStateUtils").unproxy(a);this.trigger("close_chat",a);d("WAWebWamMemoryStat").uploadMemoryInfoOnChatClose();d("WAWebMsgTunnelBridge").msgSyncTunnelBridge.resetActiveChat(a.id)};f.closeActiveChat=function(){this.trigger("close_active_chat")};f.focusNextChat=function(a){this.trigger("focus_next_chat",a)};f.focusPrevChat=function(a){this.trigger("focus_prev_chat",a)};f.focusChatSearch=function(){this.trigger("focus_chat_search")};f.closeStatusViewer=function(){this.trigger("close_status_viewer")};f.openComposeBoxExpressionPanel=function(a){this.trigger("open_compose_box_panel",a)};f.openAttachmentDropdown=function(){this.trigger("open_attachment_dropdown")};f.closeExpressionPanels=function(){this.trigger("close_expression_panels")};f.logout=function(){if(!c("gkx")("26258"))try{throw c("err")("Non Error - CMD logout, thrown only for getting logout stack trace")}catch(a){a instanceof Error&&d("WALogger").LOG(l(),a.stack).verbose()}this.trigger("logout")};f.openContextMenu=function(a,b){this.trigger("open_context_menu",a,b)};f.closeContextMenu=function(a){this.trigger("close_context_menu",a)};f.openTooltip=function(a,b){this.trigger("open_tooltip",a,b)};f.closeTooltip=function(a){this.trigger("close_tooltip",a)};f.alertNewMsg=function(a){this.trigger("alert_new_msg",a)};f.newMediaMsg=function(a){this.trigger("new_media_msg",a)};f.alertCall=function(a,b,c,d,e){this.trigger("alert_call",{wid:a,msgId:b,isVideo:c,isGroup:d,isSilenced:e})};f.cancelCall=function(a){this.trigger("cancel_call",a)};f.windowError=function(a){d("WAWebCurrentUser").isEmployee()&&this.trigger("window_error",a)};f.onPanesWillChange=function(a){this.trigger("panes_will_change",a)};f.onPanesDidChange=function(a){this.trigger("panes_did_change",a)};f.reactionChangeLastMessage=function(){this.trigger("reaction_changed_last_msg")};f.openGroupsV4InviteRequestFlow=function(a,b,c,d){this.trigger("open_groups_v4_invite_request_flow",a,b,c,d)};f.toggleLidDebugBadge=function(){this.trigger("toggle_lid_debug_badge")};f.openCommandPalette=function(){this.trigger("open_command_palette")};f.closeCommandPalette=function(){this.trigger("close_command_palette")};f.setUiBusy=function(a){var b=this.uiBusy||0;a?(++b,this.$CmdImpl$p_3(),this.$CmdImpl$p_4.cancel()):b&&--b;this.uiBusy=b;b===0&&(this.$CmdImpl$p_3.cancel(),this.$CmdImpl$p_4())};f.windowMouseDown=function(a){this.trigger("window_mousedown",a)};f.windowClick=function(a){this.trigger("window_click",a)};f.midnight=function(){this.trigger("midnight")};f.serverUpdatedClientExpiration=function(){this.trigger("serverUpdatedClientExpiration")};f.scrollMessages=function(){this.trigger("scroll_messages")};f.getConversationHeaderOffset=function(a){this.trigger("get_conversation_header_offset",a)};f.floaterEscapeOverlap=function(a,b){this.trigger("floater_escape_overlap",a,b)};f.refreshMessages=function(){this.trigger("refresh_messages")};f.storageInitializationError=function(){this.trigger("storage_initialization_error")};f.editGroupSubject=function(){this.trigger("edit_group_subject")};f.endFlow=function(){this.trigger("end_flow")};f.refreshQR=function(){this.trigger("md_refresh_qr")};f.setSocketState=function(a){this.trigger("set_socket_state",a)};f.socketStreamDisconnected=function(){this.trigger("socket_stream_disconnected")};f.openSocketStream=function(){this.trigger("open_socket_stream")};f.reconnectSocket=function(){this.trigger("reconnect_socket")};f.openLongLinkModal=function(){this.trigger("open_long_link_modal")};f.closeLongLinkModal=function(a){a===void 0&&(a=!1),this.trigger("close_long_link_modal",a)};f.openLockScreenModal=function(){this.trigger("open_lock_screen_modal")};f.correctPasscodeLockScreen=function(a){this.trigger("correct_passcode_lock_screen",a)};f.incorrectPasscodeLockScreen=function(){this.trigger("incorrect_passcode_lock_screen")};f.offlineDeliveryEnd=function(){this.isOfflineDeliveryEnd=!0,this.trigger("offline_delivery_end")};f.resetOfflineDeliveryState=function(){this.isOfflineDeliveryEnd=!1,this.trigger("offline_delivery_state_reset")};f.readyForProcessOffline=function(){d("WALogger").LOG(k()),this.trigger("offline_process_ready")};f.readyForMainStreamMode=function(){d("WAWebPageLoadLogging").addPageLoadQplPoint("main_stream_mode_ready"),this.isMainStreamReadyMd=!0,this.trigger("main_stream_mode_ready")};f.onInitialChatHistorySynced=function(){this.trigger("on_initial_chat_synced")};f.onRecentChatHistorySynced=function(){this.trigger("on_recent_chat_history_synced")};f.onFullChatHistorySynced=function(){this.trigger("on_full_chat_history_synced")};f.onHistorySyncChunkProcessed=function(a){this.trigger("new_history_sync_chunk_processed",a)};f.handleOfflineProgressUpdate=function(){this.trigger("offline_progress_update")};f.criticalSyncDone=function(){this.trigger("on_critical_sync_done")};f.onTemporaryBan=function(a){this.trigger("account_temporarily_banned",a)};f.onStartingLogout=function(){this.trigger("starting_logout")};f.showServiceUnavailableError=function(){this.trigger("service_unavailable_503")};f.merchantDetailsDrawer=function(a){this.trigger("merchant_details_drawer",a)};f.showMerchantDetailsEntityTypePopup=function(a,b){this.trigger("show_merchant_details_entity_type_popup",a,b)};f.showCountrySelector=function(a,b,c,d,e,f,g){this.trigger("show_country_selector_popup",a,b,c,d,e,f,g)};f.toggleStickerMaker=function(){this.trigger("toggle_sticker_maker")};f.onAccountSyncForPrivacy=function(a){this.trigger("account_sync_for_privacy",a)};f.updateStatusPrivacySettings=function(a){this.trigger("update_status_privacy_settings",a)};f.openStickerPack=function(a){this.trigger("open_sticker_pack",a)};f.onStatusViewerOpen=function(){this.trigger("status_viewer_open")};f.onStatusPostingFlow=function(){this.trigger("status_posting_flow")};f.triggerStorageAlert=function(){c("gkx")("26258")||this.trigger("handle_low_storage_butter_bar")};f.triggerBugReportV2=function(){d("WAWebCurrentUser").isEmployee()&&this.trigger("trigger_bugreport_v2")};f.onAbPropsUpdate=function(a){this.trigger("on_ab_props_update",a)};f.abPropsLoaded=function(){this.trigger("ab_props_loaded")};f.onNotificationPermissionChange=function(){this.trigger("on_notification_permission_change")};f.onBrigadingStateChange=function(a){this.trigger("on_brigading_state_change",a)};f.playNextPtv=function(a){this.trigger("sequential_ptv_playback",a)};f.groupNotificationContextCardRendered=function(a){this.trigger("group_notification_context_card_rendered",a)};f.botTogglePluginSearchDetailsToggle=function(a,b){if(a==null){d("WALogger").WARN(j());return}this.trigger("bot_toggle_plugin_search_details_for_target_id_"+a,b)};f.rerenderApp=function(){this.trigger("rerender_app")};f.toggleAiRepliesStatus=function(a){this.trigger("toggle_ai_replies_status",a)};f.chatListVisibilityChange=function(a){this.trigger("chat_list_visibility_change",a)};f.limitSharingDrawer=function(a){this.trigger("limit_sharing_drawer",a)};f.reachoutTimelockStateChange=function(){this.trigger("reachout_timelock_state_change")};return e}(c("WAWebEventEmitter"));var v=new f();function w(a){var b,c=function(){if(b)return;b=new AbortController();var c=b,e=c.signal;d("WAWebDocumentFlushed").documentFlushed({signal:e}).then(function(){if(e.aborted)return;b=null;a()},function(a){if(a instanceof Error&&a.name===d("WAAbortError").ABORT_ERROR)return;throw a})};c.cancel=function(){if(!b)return;b.abort();b=null};return c}g.Revoke=a;g.APP_STATE_SYNC_COMPLETED=e;g.CmdImpl=f;g.Cmd=v}),98); __d("WAWebContactManagementGating",["WAWebABProps","WAWebPrimaryFeatures"],(function(a,b,c,d,e,f,g){function a(){return h()&&i()}function h(){return d("WAWebPrimaryFeatures").primaryFeatureEnabled("companion_contact_change_enabled")}function i(){return d("WAWebABProps").getABPropConfigValue("native_contact_companion_change_enabled")}function b(){var a=Number.parseInt(d("WAWebABProps").getABPropConfigValue("native_contact_companion_nux_learn_more_article_id"),10);Number.isNaN(a)&&(a=1191526044909364);return a}g.contactManagementEnabled=a;g.getNativeContactLearnMoreArticleId=b}),98); __d("WAWebFaqUrl",["WAWebBizGatingUtils","WAWebContactManagementGating","WAWebL10N","WAWebMarketingMessagesUserFeedbackGatingUtils"],(function(a,b,c,d,e,f,g){var h="https://faq.whatsapp.com",i="web";function j(a){return h+"/"+a+"?lang="+c("WAWebL10N").getNormalizedLocale()}function a(){return h+"/"+i+"?lang="+c("WAWebL10N").getNormalizedLocale()}function b(){return j(2138577903196467)}function e(){return j(6480469855345352)}function f(){return j(643460927283235)}function k(){return j(852892549070029)}function l(){return j(3398056720476987)}function m(){return j(835452491239734)}function n(){return j(1524220618005378)}function o(){return j(820124435853543)}function p(){return j(820124435853543)}function q(){return j(1148840052398648)}function r(){return j(1293093778117781)}function s(){return j(1053543185312573)}function t(){return j(1110600769849613)}function u(){return j(1317564962315842)}function v(){return j(677428350267326)}function w(){return j(819881299156447)}function x(){return j(531205362155587)}function y(){return j(2322556321235831)}function z(){return j(1130443730921732)}function A(){return j(807378207138241)}function B(){return j(1370476507114859)}function C(){return j(393169153028916)}function D(){return j(806293963922749)}function E(){return j(794517045178057)}function F(){return j(3872729742954601)}function G(){return j(1074237659908080)}function H(){return j(673193694148537)}function I(){return j(728928448599090)}function J(){return j(1077018839582332)}function K(){return j(676672070766141)}function L(){return j(854037192262196)}function M(){return j(1184376605821468)}function N(){return j(570221114584995)}function O(){return j(366296225670044)}function P(){return j(625069579217642)}function Q(){return j(812356880201038)}function R(){return j(2234976186844686)}function S(){return j(1317564962315842)}function T(){return j(1324084875126592)}function U(){return j(832060577920049)}function V(){return j(821275555582352)}function W(){return j(498814665492149)}function X(){return j(1874151452788882)}function Y(){return j(2917597651792702)}function Z(){return j(626403979060997)}function $(){return j(831150864932965)}function aa(){return j(138730494968892)}function ba(){return j(6614640168569481)}function ca(){return j(1549633222110625)}function da(){return j(231869526393268)}function ea(){return j(671443411431514)}function fa(){return j(1318001139066835)}function ga(){return j(245599461477281)}function ha(){return j(682987820062997)}function ia(){return j(1446688872845683)}function ja(){return j(652713330395407)}function ka(){return j(205306122327447)}function la(){return j(919039336073667)}function ma(){return j(673193694148537)}function na(){return j(1313491802751163)}function oa(){return j(422435220869520)}function pa(){return j(1726618467788240)}function qa(){return j(653480766448040)}function ra(){return j(526463418847093)}function sa(){return j(1262764931172994)}function ta(){return"https://www.facebook.com/privacy/policy"}function ua(){return"https://www.facebook.com/policies/other-policies/bm-ais-terms"}function va(){return"https://www.facebook.com/legal/ai-terms"}function wa(){return j(1111412106858632)}function xa(){return j(6485307734928964)}function ya(){var a=d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiRowEnabled()||d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiIndiaEnabled();return j(a?6485307734928964:1270536656989145)}function za(){return j(332114409462050)}function Aa(){return j(306908962283012)}function Ba(){return j(785493319976156)}function Ca(){return j(704225315054890)}function Da(){return j(3872729742954601)}function Ea(){return j(434854355461483)}function Fa(){return j(1314318822729539)}function Ga(){return j(1083092416402722)}function Ha(){return j(360977646301595)}function Ia(){return j(684323127185056)}function Ja(){return j(1520500555178162)}function Ka(){return j(414631957536067)}function La(){return j(445453537819972)}function Ma(){return j(764072925284841)}function Na(){return j(515115256843064)}function Oa(){return j(d("WAWebContactManagementGating").getNativeContactLearnMoreArticleId())}function Pa(){return j(3379690015658337)}function Qa(){return j(2127363544304650)}function Ra(){return j(1889908094810167)}function Sa(){return j(1791149784551042)}function Ta(){return!d("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMMessageLevelFeedbackNotInterestedMenuEnabled()?j(849628780369041):j(1027276182478056)}function Ua(){return j(1072622197196723)}function Va(){return j(471097579286138)}function Wa(){return j(925016942750794)}function Xa(){return j(3440358352849077)}function Ya(){return j(2286952358121083)}function Za(){return j(1142481766359885)}function $a(){return"https://www.whatsapp.com/usephone"}function ab(){return"https://business.whatsapp.com/policy#policies_for_whatsapp_commerce_features"}function bb(){return j(717472490411581)}function cb(){return"https://business.whatsapp.com/?lang="+c("WAWebL10N").getNormalizedLocale()}function db(){return j(361005896189245)}g.FAQ_BASE_URL=h;g.PLATFORM=i;g.getFullUrl=j;g.getFaqUrl=a;g.getDeleteAccountUrl=b;g.getNewsletterActivityInforUrl=e;g.getBusinessFaqUrl=f;g.getCannotConnectFaqUrl=k;g.getCiphertextFaqUrl=l;g.getFanoutPlaceholderFaqUrl=m;g.getCodeChangeFaqUrl=n;g.getMDCodeChangeFaqUrl=o;g.getE2EFaqUrl=p;g.getE2EEnterpriseFaqUrl=q;g.getWAChatFaqUrl=r;g.getFrequentlyForwardedFaqUrl=s;g.getMembershipApprovalModeFaqUrl=t;g.getLoginFaqUrl=u;g.getNonVerifiedTransitionFaqUrl=v;g.getNotificationChromeFaqUrl=w;g.getNotificationEdgeFaqUrl=x;g.getNotificationFirefoxFaqUrl=y;g.getNotificationOperaFaqUrl=z;g.getNotificationSafariFaqUrl=A;g.getRevokeFaqUrl=B;g.getSuspiciousLinkFaqUrl=C;g.getUnverifiedTransitionFaqUrl=D;g.getVerifiedHighFaqUrl=E;g.getBlueFaqUrl=F;g.getVerifiedLowUnknownFaqUrl=G;g.getEphemeralFaqUrl=H;g.getKICFaqUrl=I;g.getViewOnceFaqUrl=J;g.getSupportChatFaqUrl=K;g.getSupportChatSafetyFaqUrl=L;g.getCatalogCartOnOffFaqUrl=M;g.getCommunityHomeNuxUrl=N;g.getExitCommunityUrl=O;g.getCommunityCreatorPrivacyUrl=P;g.getCommunityMemberPrivacyUrl=Q;g.getCommunityBecomingOwnerUrl=R;g.getLinkDeviceFaqUrl=S;g.getLinkDeviceUsingPhoneNumberFaqUrl=T;g.getJioMartPostcodeChangeLearnMoreLink=U;g.getDBErrorFaqUrl=V;g.getHowToExitAndDeleteGroupsFaq=W;g.getRemoveFromCommunityFaqUrl=X;g.getViewOnceScreenshotProtectionUrl=Y;g.getPhoneNumberHidingFaqUrl=Z;g.getCagPhoneNumberHidingFaqUrl=$;g.getControlsWhenMessagingBusinessFaqUrl=aa;g.getMessageEditFaqUrl=ba;g.getNewsletterUpdateEditFaqUrl=ca;g.getAboutCommunitiesFaqUrl=da;g.getNewsletterPrivacyLegacyFaqUrl=ea;g.getNewsletterPrivacyMultiAdminFaqUrl=fa;g.getNewsletterGuidelinesFaqUrl=ga;g.getNewsletterGeosuspendFaqUrl=ha;g.getNewsletterMetricsEstimatedFaqUrl=ia;g.getNewsletterMetricsUnavailableFaqUrl=ja;g.getMemberAddedGroupsUrl=ka;g.getReportToAdminFaqUrl=la;g.getOrderEphemeralExemptionUrl=ma;g.getSafetyToolsFaqUrl=na;g.getSearchTheWebFaqUrl=oa;g.getScreenLockLearnMoreUrl=pa;g.getMessageHistoryOnLinkedDevicesFAQUrl=qa;g.getRequestAccountInfoFAQUrl=ra;g.getIndiaEcommerceComplianceFaqUrl=sa;g.getBotPrivacyPolicyUrl=ta;g.getBMBotTermsUrl=ua;g.getBotTermsUrl=va;g.getBotLearnMoreUrl=wa;g.getBizBot1pLearnMoreUrl=xa;g.getBizBotTosLearnMoreUrl=ya;g.getBizBot3pLearnMoreUrl=za;g.getBizBot3pDataSharingUrl=Aa;g.getConsumerTransparencyHCAUrl=Ba;g.getAvatarFaqUrl=Ca;g.getWhatsAppBusinessPremiumFaqUrl=Da;g.getSharingBusinessInfoForAdsFaqUrl=Ea;g.getFbShopsSunsetFaqUrl=Fa;g.getSagaFaqUrl=Ga;g.getNewsletterAdminInviteFaqUrlV2=Ha;g.getReportUnlawfulContentWebFaqUrl=Ia;g.getCoexHostedFaqUrl=Ja;g.getBlockingReportingFaqUrl=Ka;g.getDisableLinkPreviewsFaqUrl=La;g.getChatLockSecretCodeFaqUrl=Ma;g.getAccountTakeOverFaqUrl=Na;g.getNativeContactLearnMoreFaqUrl=Oa;g.getAntiBrigadingFaqUrl=Pa;g.getEventsLearnMoreFaqUrl=Qa;g.getCommunityGroupsVisibilityFaqUrl=Ra;g.getBizQuickRepliesFaqUrl=Sa;g.marketingMessageFeedbackLearnMoreURL=Ta;g.marketingMessageUserControlsStopLearnMoreURL=Ua;g.marketingMessageUserControlsResumeLearnMoreURL=Va;g.sharingCustomerRelatedActivityLearnMoreURL=Wa;g.getNewsletterReportLearnMoreUrl=Xa;g.getSeeExamplesOfScamsUrl=Ya;g.getHowToReport=Za;g.getWhatsappUsePhoneFallbackUrl=$a;g.getWhatsappBusinessCommercePolicyUrl=ab;g.getRestrictedAccountLearnMoreUrl=bb;g.getWhatsAppBusinessHomeUrl=cb;g.getMessagingBestPracticeUrl=db}),98); __d("BlobFactory",["emptyFunction"],(function(a,b,c,d,e,f){var g;function h(){try{new a.Blob(),g=!0}catch(a){g=!1}}var i=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder;a.Blob?c={getBlob:function(b,c){b=b||[];c=c||{};g===void 0&&h();if(g)return new a.Blob(b,c);else{var d=new i();for(var e=0;e<b.length;e++)d.append(b[e]);return d.getBlob(c.type)}},isSupported:b("emptyFunction").thatReturnsTrue}:c={getBlob:function(){},isSupported:b("emptyFunction").thatReturnsFalse};e.exports=c}),null); __d("Deferred",["Promise"],(function(a,b,c,d,e,f){"use strict";var g;(g||(g=b("Promise"))).resolve();a=function(){function a(a){var c=this;a=a||g||(g=b("Promise"));this.$1=!1;this.$2=new a(function(a,b){c.$3=a,c.$4=b})}var c=a.prototype;c.getPromise=function(){return this.$2};c.resolve=function(a){this.$1=!0,this.$3(a)};c.reject=function(a){this.$1=!0,this.$4(a)};c.isSettled=function(){return this.$1};return a}();f["default"]=a}),66); __d("WASmaxInBlocklistsIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInBlocklistsIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInBlocklistsGetBlocklistErrors",["WAResultOrError","WASmaxInBlocklistsIQErrorBadRequestMixin","WASmaxInBlocklistsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBlocklistsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInBlocklistsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);return c.success?d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorRateOverlimit"],[b,c])}g.parseGetBlocklistErrors=a}),98); __d("WASmaxInBlocklistsIQErrorFeatureNotImplementedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","feature-not-implemented");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",501);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFeatureNotImplementedMixin=a}),98); __d("WASmaxInBlocklistsIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInBlocklistsIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInBlocklistsServerErrors",["WAResultOrError","WASmaxInBlocklistsIQErrorFeatureNotImplementedMixin","WASmaxInBlocklistsIQErrorInternalServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBlocklistsIQErrorFeatureNotImplementedMixin").parseIQErrorFeatureNotImplementedMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorFeatureNotImplemented",value:b.value});var c=d("WASmaxInBlocklistsIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);return c.success?d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorFeatureNotImplemented","IQErrorInternalServerError"],[b,c])}g.parseServerErrors=a}),98); __d("WAWebUpdateLidMetadataJob",["WAWebOrchestratorNonPersistedJob","WAWebUpdateLidMetadataApi"],(function(a,b,c,d,e,f,g){function a(a){a={updates:a};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateLidMetadata",function(a){return d("WAWebUpdateLidMetadataApi").updateLidMetadata(a)}).waitUntilCompleted(a)}g.updateLidMetadataJob=a}),98);